Skip to content

Commit 081f10c

Browse files
committed
feat: add self-update flags using the shared updater
1 parent c4d4d7b commit 081f10c

6 files changed

Lines changed: 225 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ SimpleHTTPserver requires **go1.17+** to install successfully. Run the following
4242
go install -v github.com/projectdiscovery/simplehttpserver/cmd/simplehttpserver@latest
4343
```
4444

45+
To update an installed binary to the latest release, run:
46+
47+
```sh
48+
simplehttpserver -update
49+
```
50+
51+
The `-up` alias is also supported. The update command exits when finished without starting a server.
52+
4553
# Usage
4654

4755
```sh
@@ -70,6 +78,7 @@ This will display help for the tool. Here are all the switches it supports.
7078
| `-basic-auth` | Basic auth (username:password) | `simplehttpserver -basic-auth user:password` |
7179
| `-realm` | Basic auth message | `simplehttpserver -realm "insert the credentials"` |
7280
| `-version` | Show version | `simplehttpserver -version` |
81+
| `-up`, `-update` | Update to the latest release | `simplehttpserver -update` |
7382
| `-silent` | Show only results | `simplehttpserver -silent` |
7483
| `-py` | Emulate Python Style | `simplehttpserver -py` |
7584
| `-header` | HTTP response header (can be used multiple times) | `simplehttpserver -header 'X-Powered-By: Go'` |

‎go.mod‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,69 @@ require (
88
github.com/projectdiscovery/goflags v0.1.76
99
github.com/projectdiscovery/gologger v1.1.72
1010
github.com/projectdiscovery/sslcert v0.0.0-20210416140253-8f56bec1bb5e
11+
github.com/projectdiscovery/utils v0.11.1
1112
gopkg.in/yaml.v2 v2.4.0
1213
)
1314

1415
require (
16+
aead.dev/minisign v0.2.0 // indirect
17+
github.com/Masterminds/semver/v3 v3.2.1 // indirect
18+
github.com/VividCortex/ewma v1.2.0 // indirect
19+
github.com/alecthomas/chroma/v2 v2.14.0 // indirect
1520
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
21+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
1622
github.com/aymerick/douceur v0.2.0 // indirect
23+
github.com/charmbracelet/glamour v0.8.0 // indirect
24+
github.com/charmbracelet/lipgloss v0.13.0 // indirect
25+
github.com/charmbracelet/x/ansi v0.3.2 // indirect
26+
github.com/cheggaaa/pb/v3 v3.1.4 // indirect
1727
github.com/cnf/structhash v0.0.0-20250313080605-df4c6cc74a9a // indirect
1828
github.com/djherbis/times v1.6.0 // indirect
29+
github.com/dlclark/regexp2 v1.11.5 // indirect
1930
github.com/ebitengine/purego v0.10.0 // indirect
31+
github.com/fatih/color v1.15.0 // indirect
2032
github.com/go-ole/go-ole v1.2.6 // indirect
33+
github.com/google/go-github/v30 v30.1.0 // indirect
34+
github.com/google/go-querystring v1.1.0 // indirect
2135
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
36+
github.com/google/uuid v1.3.1 // indirect
2237
github.com/gorilla/css v1.0.1 // indirect
2338
github.com/json-iterator/go v1.1.12 // indirect
2439
github.com/kr/pretty v0.1.0 // indirect
2540
github.com/logrusorgru/aurora/v4 v4.0.0 // indirect
41+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
2642
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
43+
github.com/mattn/go-colorable v0.1.13 // indirect
2744
github.com/mattn/go-isatty v0.0.20 // indirect
45+
github.com/mattn/go-runewidth v0.0.16 // indirect
2846
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
2947
github.com/miekg/dns v1.1.72 // indirect
48+
github.com/minio/selfupdate v0.6.1-0.20230907112617-f11e74f84ca7 // indirect
3049
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3150
github.com/modern-go/reflect2 v1.0.2 // indirect
51+
github.com/muesli/reflow v0.3.0 // indirect
52+
github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a // indirect
3253
github.com/pkg/errors v0.9.1 // indirect
3354
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
3455
github.com/projectdiscovery/blackrock v0.0.1 // indirect
35-
github.com/projectdiscovery/utils v0.11.1 // indirect
56+
github.com/projectdiscovery/machineid v0.0.0-20250715113114-c77eb3567582 // indirect
57+
github.com/rivo/uniseg v0.4.7 // indirect
3658
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
3759
github.com/shirou/gopsutil/v4 v4.26.3 // indirect
3860
github.com/tidwall/gjson v1.18.0 // indirect
3961
github.com/tidwall/match v1.2.0 // indirect
4062
github.com/tidwall/pretty v1.2.1 // indirect
4163
github.com/tklauser/go-sysconf v0.3.16 // indirect
4264
github.com/tklauser/numcpus v0.11.0 // indirect
65+
github.com/yuin/goldmark v1.7.4 // indirect
66+
github.com/yuin/goldmark-emoji v1.0.3 // indirect
4367
github.com/yusufpapurcu/wmi v1.2.4 // indirect
68+
github.com/zcalusic/sysinfo v1.0.2 // indirect
69+
golang.org/x/crypto v0.51.0 // indirect
4470
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect
4571
golang.org/x/mod v0.35.0 // indirect
4672
golang.org/x/net v0.55.0 // indirect
73+
golang.org/x/oauth2 v0.27.0 // indirect
4774
golang.org/x/sync v0.20.0 // indirect
4875
golang.org/x/sys v0.45.0 // indirect
4976
golang.org/x/term v0.43.0 // indirect

0 commit comments

Comments
 (0)