2054f805c8d005b33ed73f769a0f5c03908e6d86
serveg
Small HTTP/1.1 file server. Meant to run behind a reverse proxy that handles TLS (see CADDY.md).
Features:
- upload and download files
- per-directory passwords (read more in example config)
- generates html pages for directories
- own http implementation, not "net/http"
Dependencies
- BurntSushi/toml - toml 1.1.0 parser
- daviddengcn/go-colortext - print colored text (linux/windows)
Build
make build
Run
cp serveg.example.toml serveg.toml # edit shares and passwords
bin/servegp # reads ./serveg.toml
# or
bin/servegp -config /etc/serveg/serveg.toml
HTTP API
| Request | Result |
|---|---|
GET /share/dir/ |
directory listing with an upload form if the share has write_password |
GET /share/file |
download file, supports If-Modified-Since, Range (single range) and If-Range (date) |
PUT /share/file |
upload: 201 created, 200 replaced |
OPTIONS /share/file with X-Upload-Size: <size> |
upload check, same as PUT but without body |
Passwords use HTTP Basic auth, the user name is ignored:
curl -O http://localhost:8080/public/file.zip
curl -C - -O http://localhost:8080/public/file.zip # continue interrupted download
curl -u :password -T file.zip http://localhost:8080/public/file.zip
Error responses explain the reason in a plain text body.
Description
Languages
Go
91.4%
Go Template
8.4%
Makefile
0.2%