From 2f6993c178e8d403755d724cb7fd29d1d0a9e49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Wed, 21 Oct 2026 20:08:23 +0300 Subject: [PATCH 1/2] require patched go version --- .github/workflows/release-binary.yml | 10 +++++++--- .goreleaser.yml | 7 ++++--- Dockerfile | 15 ++++++++++----- README.md | 2 +- go.mod | 2 +- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index 82a1d48..2e774e0 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -10,8 +10,12 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 - - uses: projectdiscovery/actions/setup/go@v1 + - name: "Check out code" + uses: actions/checkout@v7 + with: + fetch-depth: 0 + - name: "Set up Go" + uses: projectdiscovery/actions/setup/go@v1 - name: "Create release on GitHub" uses: goreleaser/goreleaser-action@v7 env: @@ -20,6 +24,6 @@ jobs: DISCORD_WEBHOOK_ID: "${{ secrets.DISCORD_WEBHOOK_ID }}" DISCORD_WEBHOOK_TOKEN: "${{ secrets.DISCORD_WEBHOOK_TOKEN }}" with: - args: "release --rm-dist" + args: "release --clean" version: latest workdir: . \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index e0a4795..2df503f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,5 @@ +version: 2 + before: hooks: - go mod tidy @@ -16,9 +18,8 @@ builds: - arm64 archives: -- format: zip - replacements: - darwin: macOS +- formats: [zip] + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}' checksum: algorithm: sha256 diff --git a/Dockerfile b/Dockerfile index 113729d..c2952b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,12 @@ -FROM golang:1.27.0-alpine as build-env -RUN go install -v github.com/projectdiscovery/simplehttpserver/cmd/simplehttpserver@latest +# Pinning apk package versions breaks the build once Alpine drops them; the base image tag is the pin. +# hadolint global ignore=DL3018 +FROM golang:1.27.3-alpine AS build-env +RUN apk add --no-cache git +WORKDIR /app +COPY . /app +RUN go mod download && go build ./cmd/simplehttpserver -FROM alpine:latest +FROM alpine:3.24 RUN apk add --no-cache bind-tools ca-certificates -COPY --from=build-env /go/bin/simplehttpserver /usr/local/bin/simplehttpserver -ENTRYPOINT ["simplehttpserver"] \ No newline at end of file +COPY --from=build-env /app/simplehttpserver /usr/local/bin/simplehttpserver +ENTRYPOINT ["simplehttpserver"] diff --git a/README.md b/README.md index 7452d6a..58e9b76 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ SimpleHTTPserver is a go enhanced version of the well known python simplehttpser # Installing SimpleHTTPserver -SimpleHTTPserver requires **go1.17+** to install successfully. Run the following command to get the repo - +SimpleHTTPserver requires **go1.26.10+** to install successfully. Run the following command to get the repo - ```sh go install -v github.com/projectdiscovery/simplehttpserver/cmd/simplehttpserver@latest diff --git a/go.mod b/go.mod index f596ba1..12aefb9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/projectdiscovery/simplehttpserver -go 1.25.0 +go 1.26.10 require ( github.com/fsnotify/fsnotify v1.10.1 From 45c6da2ebf3cda688e4e031752441d5cd0078301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Thu, 22 Oct 2026 08:38:06 +0300 Subject: [PATCH 2/2] fix lint for go1.26 toolchain --- internal/runner/watchdog.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/runner/watchdog.go b/internal/runner/watchdog.go index 2cdde4c..3686724 100644 --- a/internal/runner/watchdog.go +++ b/internal/runner/watchdog.go @@ -25,8 +25,8 @@ func watchFile(fname string, callback WatchEvent) (watcher *fsnotify.Watcher, er log.Println("err", err) } } - case <-watcher.Errors: - // ignore errors for now + case err := <-watcher.Errors: + log.Println("err", err) } } }()