diff --git a/.github/workflows/.github-ci.yml b/.github/workflows/.github-ci.yml index d7705da..acf60a0 100644 --- a/.github/workflows/.github-ci.yml +++ b/.github/workflows/.github-ci.yml @@ -46,5 +46,5 @@ jobs: push: true allow: network.host network: host - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 tags: ${{ steps.docker.outputs.tags }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c606e1c..4a55e65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM golang:1.17-alpine AS build-env +FROM golang:1.24.1-alpine AS build-env ENV GO111MODULE=on WORKDIR /go/src/github.com/hugomd/ascii-live/ RUN apk add ca-certificates COPY . /go/src/github.com/hugomd/ascii-live/ RUN cd /go/src/github.com/hugomd/ascii-live && \ go mod download && \ - CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . + CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o main . FROM scratch COPY --from=build-env /go/src/github.com/hugomd/ascii-live/main / diff --git a/go.mod b/go.mod index a626244..1751516 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/hugomd/ascii-live -go 1.17 +go 1.24.1 require ( - github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b - github.com/gorilla/mux v1.7.3 + github.com/golang/glog v1.2.4 + github.com/gorilla/mux v1.8.1 ) diff --git a/go.sum b/go.sum index 68db0f5..e5c898b 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= diff --git a/main.go b/main.go index 457d226..ff76b46 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,7 @@ import ( ) var NotFoundMessage = map[string]string{ - "error": "Frames not found. Navigate to /list for list of frames. Navigate to https://github.com/hugomd/ascii-live to submit new frames.", + "error": "Frames not found. Navigate to /ascii/list for list of frames. Navigate to https://github.com/hugomd/ascii-live to submit new frames.", } var NotCurledMessage = map[string]string{ @@ -53,7 +53,7 @@ func notCurledHandler(w http.ResponseWriter, r *http.Request) { } func handler(w http.ResponseWriter, r *http.Request) { - cn := w.(http.CloseNotifier) + ctx := r.Context() flusher := w.(http.Flusher) vars := mux.Vars(r) @@ -79,7 +79,7 @@ func handler(w http.ResponseWriter, r *http.Request) { for { select { // Handle client disconnects - case <-cn.CloseNotify(): + case <-ctx.Done(): glog.Infof("Client stopped listening") return default: