From 458838719b3a2817d6eb4a079edc27c832a9d25d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 17:31:22 +0000 Subject: [PATCH 1/3] chore(deps): bump actions/checkout from 4 to 5 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build-test.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/dockerhub-push.yml | 2 +- .github/workflows/lint-test.yml | 2 +- .github/workflows/release-binary.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index efb1507..364c34d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -19,7 +19,7 @@ jobs: go-version: 1.19 - name: Check out code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Test run: go test . diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 16f2462..1975167 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/dockerhub-push.yml b/.github/workflows/dockerhub-push.yml index 9ab6183..83f5370 100644 --- a/.github/workflows/dockerhub-push.yml +++ b/.github/workflows/dockerhub-push.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 4fce7f4..3f908f4 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -17,7 +17,7 @@ jobs: with: go-version: 1.19 - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Run golangci-lint uses: golangci/golangci-lint-action@v3.7.0 with: diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index f50f547..34f3295 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -15,7 +15,7 @@ jobs: with: go-version: 1.19 - name: "Check out code" - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: "Create release on GitHub" From bdd675caf071f16d446b4ad8a073120f4ca31c4b Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Thu, 9 Oct 2025 17:11:56 +0200 Subject: [PATCH 2/3] gh --- .github/ISSUE_TEMPLATE/feature_request.md | 18 ----- .github/ISSUE_TEMPLATE/issue-report.md | 36 --------- .../bug-report-reference.yml | 79 +++++++++++++++++++ .../feature-request-reference.yml | 37 +++++++++ .github/auto_assign.yml | 9 +++ .github/dependabot.yml | 49 +++++++----- .github/workflows/auto-merge.yaml | 28 +++++++ .github/workflows/build-test.yml | 9 +-- .github/workflows/lint-test.yml | 15 +--- .github/workflows/release-binary.yml | 10 +-- Dockerfile | 2 +- go.mod | 2 +- go.sum | 4 + internal/runner/runner.go | 6 +- 14 files changed, 201 insertions(+), 103 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/ISSUE_TEMPLATE/issue-report.md create mode 100644 .github/ISSUE_TEMPLATE/reference-templates/bug-report-reference.yml create mode 100644 .github/ISSUE_TEMPLATE/reference-templates/feature-request-reference.yml create mode 100644 .github/auto_assign.yml create mode 100644 .github/workflows/auto-merge.yaml diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 7d33dd1..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Feature request -about: Request feature to implement in this project -labels: 'Type: Enhancement' ---- - - - -### Please describe your feature request: - - -### Describe the use case of this feature: - diff --git a/.github/ISSUE_TEMPLATE/issue-report.md b/.github/ISSUE_TEMPLATE/issue-report.md deleted file mode 100644 index d689b0f..0000000 --- a/.github/ISSUE_TEMPLATE/issue-report.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Issue report -about: Create a report to help us to improve the project -labels: 'Type: Bug' - ---- - - - - - -### simplehttpserver version: - - - - -### Current Behavior: - - -### Expected Behavior: - - -### Steps To Reproduce: - - - -### Anything else: - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/reference-templates/bug-report-reference.yml b/.github/ISSUE_TEMPLATE/reference-templates/bug-report-reference.yml new file mode 100644 index 0000000..901a1fa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/reference-templates/bug-report-reference.yml @@ -0,0 +1,79 @@ +name: Bug Report +description: Create a report to help us to improve the simplehttpserver. +title: "[BUG] ..." +labels: ["Type: Bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + For support requests, FAQs or "How to" questions, please use the [GitHub Discussions](https://github.com/projectdiscovery/simplehttpserver/discussions) section instead or join our [Discord server](https://discord.gg/projectdiscovery) to discuss the idea on the **#simplehttpserver** channel. + + :warning: **Issues missing important information may be closed without further investigation.** + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues. + required: true + - type: textarea + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: Steps To Reproduce + description: | + Steps to reproduce the behavior, for example, commands to run simplehttpserver. + + πŸ“ For a more detailed output that could help in troubleshooting, you may want to run simplehttpserver with the **`-verbose`** or **`-debug`** flags. This will provide additional insights into what's happening under the hood. + + :warning: **Please redact any literal target hosts/URLs or other sensitive information.** + placeholder: | + 1. Run `simplehttpserver -t ...` + validations: + required: true + - type: textarea + attributes: + label: Relevant log output + description: | + Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + + πŸ“ For a more detailed output that could help in troubleshooting, you may want to run simplehttpserver with the **`-verbose`** or **`-debug`** flags. This will provide additional insights into what's happening under the hood. + + :warning: **Please redact any literal target hosts/URLs or other sensitive information.** + render: shell + - type: textarea + attributes: + label: Environment + description: | + Examples: + - **OS**: Ubuntu 20.04 + - **simplehttpserver** (`simplehttpserver -version`): v3.3.1 + - **Go** (`go version`): go1.22.0 _(only if you've installed it via the `go install` command)_ + value: | + - OS: + - simplehttpserver: + - Go: + render: markdown + validations: + required: true + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Templates? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/reference-templates/feature-request-reference.yml b/.github/ISSUE_TEMPLATE/reference-templates/feature-request-reference.yml new file mode 100644 index 0000000..18fc17a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/reference-templates/feature-request-reference.yml @@ -0,0 +1,37 @@ +name: Feature Request +description: Request feature to implement in the simplehttpserver. +title: "[FEATURE] ..." +labels: ["Type: Enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! + + Please make sure to provide a detailed description with all the relevant information that might be required to start working on this feature. In case you are not sure about your request or whether the particular feature is already supported or not, please [start a discussion](https://github.com/projectdiscovery/simplehttpserver/discussions/categories/ideas) instead. + + Join our [Discord server](https://discord.gg/projectdiscovery) to discuss the idea on the **#simplehttpserver** channel. + - type: textarea + attributes: + label: Describe your feature request + description: A clear and concise description of feature to implement. + validations: + required: true + - type: textarea + attributes: + label: Describe the use case of the feature + description: A clear and concise description of the feature request's motivation and the use-cases in which it could be useful. + validations: + required: true + - type: textarea + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + validations: + required: false + - type: textarea + attributes: + label: Additional context + description: Add any other context about the feature request here. + validations: + required: false diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml new file mode 100644 index 0000000..273b6ac --- /dev/null +++ b/.github/auto_assign.yml @@ -0,0 +1,9 @@ +addReviewers: true +reviewers: + - dogancanbakir + - dwisiswant0 + - mzack9999 + +numberOfReviewers: 1 +skipKeywords: + - '@dependabot' \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 69d9543..e5e1f5f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,6 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - version: 2 updates: - - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" + - package-ecosystem: "gomod" directory: "/" schedule: interval: "weekly" @@ -15,9 +8,19 @@ updates: commit-message: prefix: "chore" include: "scope" + allow: + - dependency-name: "github.com/projectdiscovery/*" + groups: + modules: + patterns: ["github.com/projectdiscovery/*"] + security: + applies-to: "security-updates" + patterns: ["*"] + exclude-patterns: ["github.com/projectdiscovery/*"] + labels: + - "Type: Maintenance" - # Maintain dependencies for go modules - - package-ecosystem: "gomod" + - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" @@ -25,13 +28,21 @@ updates: commit-message: prefix: "chore" include: "scope" + groups: + workflows: + patterns: ["*"] + exclude-patterns: ["projectdiscovery/actions/*"] + labels: + - "Type: Maintenance" - # Maintain dependencies for docker - - package-ecosystem: "docker" - directory: "/" - schedule: - interval: "weekly" - target-branch: "dev" - commit-message: - prefix: "chore" - include: "scope" \ No newline at end of file +# # Maintain dependencies for docker +# - package-ecosystem: "docker" +# directory: "/" +# schedule: +# interval: "weekly" +# target-branch: "dev" +# commit-message: +# prefix: "chore" +# include: "scope" +# labels: +# - "Type: Maintenance" diff --git a/.github/workflows/auto-merge.yaml b/.github/workflows/auto-merge.yaml new file mode 100644 index 0000000..ad2890d --- /dev/null +++ b/.github/workflows/auto-merge.yaml @@ -0,0 +1,28 @@ +name: πŸ€– Auto Merge + +on: + pull_request_review: + types: [submitted] + workflow_run: + workflows: ["♾️ Compatibility Check"] + types: + - completed + +permissions: + pull-requests: write + issues: write + repository-projects: write + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - uses: actions/checkout@v5 + with: + token: ${{ secrets.DEPENDABOT_PAT }} + + - uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + github-token: ${{ secrets.DEPENDABOT_PAT }} + target: all \ No newline at end of file diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 364c34d..44c86e4 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -13,13 +13,8 @@ jobs: name: Test Builds runs-on: ubuntu-latest steps: - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.19 - - - name: Check out code - uses: actions/checkout@v5 + - uses: actions/checkout@v5 + - uses: projectdiscovery/actions/setup/go@v1 - name: Test run: go test . diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 3f908f4..7e474d7 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -12,15 +12,6 @@ jobs: name: Lint Test runs-on: ubuntu-latest steps: - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.19 - - name: Checkout code - uses: actions/checkout@v5 - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v3.7.0 - with: - version: latest - args: --timeout 5m - working-directory: . \ No newline at end of file + - uses: actions/checkout@v5 + - uses: projectdiscovery/actions/setup/go@v1 + - uses: projectdiscovery/actions/golangci-lint/v2@v1 \ No newline at end of file diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index 34f3295..9950c6d 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -10,14 +10,8 @@ jobs: release: runs-on: ubuntu-latest steps: - - name: "Set up Go" - uses: actions/setup-go@v4 - with: - go-version: 1.19 - - name: "Check out code" - uses: actions/checkout@v5 - with: - fetch-depth: 0 + - uses: actions/checkout@v5 + - uses: projectdiscovery/actions/setup/go@v1 - name: "Create release on GitHub" uses: goreleaser/goreleaser-action@v4 env: diff --git a/Dockerfile b/Dockerfile index d986488..35fed2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.3-alpine as build-env +FROM golang:1.24.0-alpine as build-env RUN go install -v github.com/projectdiscovery/simplehttpserver/cmd/simplehttpserver@latest FROM alpine:latest diff --git a/go.mod b/go.mod index 2ba06ef..0da1783 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/projectdiscovery/simplehttpserver -go 1.19 +go 1.24 require ( github.com/fsnotify/fsnotify v1.9.0 diff --git a/go.sum b/go.sum index 9f1ef77..4139f38 100644 --- a/go.sum +++ b/go.sum @@ -12,11 +12,13 @@ github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= @@ -70,6 +72,7 @@ github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -82,6 +85,7 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= diff --git a/internal/runner/runner.go b/internal/runner/runner.go index dc63940..c730151 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -46,7 +46,11 @@ func New(options *Options) (*Runner, error) { if err != nil { return nil, err } - defer watcher.Close() + defer func() { + if watcher != nil { + _ = watcher.Close() + } + }() r.serverTCP = serverTCP return &r, nil From 3ab48be9e42abab9c1da5acf888c8e4f05ba18c9 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Thu, 9 Oct 2025 17:15:58 +0200 Subject: [PATCH 3/3] fix version syntax --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0da1783..b3782a3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/projectdiscovery/simplehttpserver -go 1.24 +go 1.24.0 require ( github.com/fsnotify/fsnotify v1.9.0