1075 Commits

Author SHA1 Message Date
ekangmonyet
89f5846ffa feat: support for downloading a directory as a compressed tarball (#544)
$ static-web-server -p 1234 -d ./public \
    --directory-listing --directory-listing-download=targz
2025-05-31 12:15:44 +02:00
Jose Quintana
7ca2785c82 chore: update dependencies 26.05.2025 and MSRV 1.81.0 (#545)
- BREAKING: End support for unmaintained Windows 7, 8, 8.1 platforms as previously announced on v2.36.1.
- SECURITY (RUSTSEC-2024-0437): Crash due to uncontrolled recursion in protobuf crate was temporarily solved in the previous release. However, this PR applies the dependency patches recently available.
- RESTORED: `experimental` Cargo feature for metrics and in-memory cache.
2025-05-27 00:25:29 +02:00
Jose Quintana
0236980bc5 feat: control log ANSI output via boolean --log-with-ansi option (#543)
This PR adds support for controlling ANSI escape codes for colors and other text formatting when logging via a new boolean --log-with-ansi CLI option and its equivalent SERVER_LOG_WITH_ANSI env.

No ANSI by default:
Note that from now on, SWS will be no-ansi by default. If you want colored log output, then use --log-with-ansi.
For example:

```
static-web-server -p 8788 -d ./public/ -g trace -z --log-with-ansi
```
2025-05-17 14:39:37 +02:00
Jose Quintana
cb1999550e fix: generic server log info output even on higher log levels (#542)
It fixes an issue (previously an ad-hoc and inconsistent behavior) where SWS printed INFO-level messages at startup despite setting up a higher log level. E.g., `WARN` or `ERROR`.

Notice:

For consistency reasons, SWS now won't persistently show server information at startup independently of the log level as it did before. Instead, those info log entries are non-persistent and under the normal `INFO` log level.

For example, to show those logs again then use the `INFO` log level.

$ static-web-server -p 8787 -d public/ -g info
2025-05-08 01:36:19 +02:00
Jose Quintana
a384d9230a chore: update Alpine (3.20.6) and Debian (12.10) Docker images (#539) 2025-04-16 21:38:03 +02:00
Jose Quintana
5d1eaac0b5 chore: automate post-release updates using ci (#538)
It just automates the post-release updates needed after every release, like documentation and installer script updates, as well as checksum generation.
2025-04-10 01:09:08 +02:00
Jose Quintana
934b0e2c40 docs: v2.36.1 [skip ci] 2025-04-02 00:23:31 +02:00
Jose Quintana
ab44158182 v2.36.1 v2.36.1 2025-04-02 00:00:32 +02:00
Jose Quintana
5fbd0c5696 fix: add missing Origin to the Vary header value when CORS enabled (#534)
reference: https://fetch.spec.whatwg.org/#example-vary-origin
2025-03-28 09:21:29 +01:00
Jose Quintana
ad4c1718a6 chore: update dependencies 24-03-2025 (#532)
This change removes the "experimental" Cargo feature from the
resulting static-web-server **binary** temporarily (not the Cargo
feature itself) to prevent shipping the RUSTSEC-2024-0437 security 
vulnerability along with SWS binary.
The "experimental" Cargo feature will be restored once the upstream
patch is available.

Old Windows 7, 8, 8.1 patch:
Additionally, it pins zerofrom, zerofrom-derive and litemap
dependencies **temporarily** to be able to build SWS for old Windows
7, 8, 8.1 because newer versions of them require rustc 1.81 or later.
2025-03-24 02:22:29 +01:00
Jose Quintana
ee5c032dac docs: v2.36.0 [skip ci] 2025-02-10 21:58:31 +01:00
Jose Quintana
95b1f7bb04 v2.36.0 v2.36.0 2025-02-10 21:12:52 +01:00
Jose Quintana
0053d74e6c refactor: improve post release updates ci workflow (#525) 2025-02-07 07:15:42 +01:00
Jose Quintana
aadca81026 chore: update dependencies 06-02-2025 (#524) 2025-02-06 22:43:42 +01:00
Jose Quintana
a639039065 fix: add missing query string to the uri trailing slash redirect (#523)
Before:

$ curl -i "http://localhost:8787/assets?param=123"
HTTP/1.1 308 Permanent Redirect
location: /assets/
vary: accept-encoding
cache-control: public, max-age=86400
content-length: 0
date: Mon, 03 Feb 2025 21:19:19 GMT

After:

$ curl -i "http://localhost:8787/assets?param=123"
HTTP/1.1 308 Permanent Redirect
location: /assets/?param=123
vary: accept-encoding
cache-control: public, max-age=86400
content-length: 0
date: Mon, 03 Feb 2025 21:19:29 GMT
2025-02-03 22:41:49 +01:00
Jose Quintana
8fa9cdad0d refactor: improve fallback page path checking and logging (#522)
* refactor: check fallback page path and add log debug if not
* refactor: improve fallback page docs and command description
2025-02-03 18:23:12 +01:00
dctaf
134db396cf feat: optional log from X-Real-IP header via new --log-x-real-ip option (#521)
* feat(logger): --log-x-real-ip option.
* docs: Updates for --log-x-real-ip.
2025-02-02 12:51:00 +01:00
Jose Quintana
99aa74db6c chore: update Alpine (3.19.6) and Debian (12.9) Docker images (#518) 2025-01-15 16:55:30 +01:00
Jose Quintana
28d6bd6f0e docs: v2.35.0 [skip ci] 2025-01-10 18:43:49 +01:00
Jose Quintana
82c548313c v2.35.0 v2.35.0 2025-01-10 16:58:37 +01:00
Jose Quintana
284eb50a32 docs: devel docker images [skip ci] (#516)
it complements PR #512
2025-01-09 23:19:10 +01:00
Jose Quintana
c236674810 chore: update dependencies 09-01-2025 (#515)
* chore: update dependencies 09-01-2025
* fix: needless single-use named lifetime in `static_files::handle()`
2025-01-09 22:58:21 +01:00
Jose Quintana
1c4929d04e refactor: update github ci workflows (#514)
It updates all GitHub CI workflow dependencies to their corresponding latest stable versions and improves them when necessary.
2025-01-03 02:30:43 +01:00
Jose Quintana
35bb607115 fix: netbsd 9.2 broken source link used by cross tool for cross-compiling (#513)
It fixes a broken link that contains `libexecinfo.so` needed by the `cross` tool when cross-compiling to NetBSD.
2025-01-03 01:45:00 +01:00
Jose Quintana
b46a7a0f80 feat: build and push devel Docker image on master branch changes (#512)
* chore: build and push devel image on master changes via ci workflow (#508) by @mschoettle

* ci: build and push devel image on master

* Temporarily enable devel docker release on pull request

* add build release

* ci: build only amd64 and use devel dockerfiles

* temporarily disable login to docker hub

* fix tag

* add cache for binary

* test release binary

* move binary to the right place

* update action versions

* disable docker hub image

* test tags

* test tags

* test tags

* add permissions to scratch job

* apply feedback

* remove test step

* Address comments

* refactor: prefer job matrix strategy and x86_64-unknown-linux-musl

---------

Co-authored-by: Matthias Schoettle <git@mattsch.com>
2024-12-11 00:16:45 +01:00
alxv-su
206900b3ec fix: directory listing HTML content outside of body tag (#511)
* The closing body tag has been moved right before the closing html tag

* Fixed minor formatting issues
2024-12-10 17:12:49 +01:00
Jose Quintana
d142db972d docs: v2.34.0 [skip ci] 2024-12-04 00:34:05 +01:00
Jose Quintana
49cd6e65a0 v2.34.0 v2.34.0 2024-12-04 00:03:23 +01:00
Jose Quintana
0768c20d4e refactor: update deprecated macos-12 runner to macos-14 due to issues
2024-12-03: https://github.com/actions/runner-images/issues/10721
2024-12-03 23:44:35 +01:00
Matthias Schoettle
2737f4c4ca refactor: prevent single wildcards from matching path separators for URL Rewrites (#506)
* refactor: prevent single wildcards from matching path separators for URL Rewrites

* Fix log output in documentation

BREAKING CHANGE: Up to version 2.33.1 the wildcard `*` was matching the path separator. For example, `/{*}/{*}/` matched `/assets/images/logo/`. In later versions, the default has changed such that `*` does not match the path separator. In contrast, double wildcard (`**`) can match also a path separator.
2024-12-02 06:54:10 +01:00
Matthias Schoettle
12387a88bb docs: improve docs configuration and fix anchor links (#504)
* Fix anchor links in documentation

* Move strict to mkdocs config

* add mkdocs to CI

---------

Co-authored-by: Jose Quintana <1700322+joseluisq@users.noreply.github.com>
2024-12-01 13:22:16 +01:00
Jose Quintana
4ed4bb4474 chore: update Alpine (3.19.4) and Debian (12.8) Docker images (#505)
* chore: update Debian Docker images to 12.8
* chore: update Alpine Docker images to 3.19.4
2024-11-29 21:55:34 +01:00
Matthias Schoettle
5516b6a4be chore: add additional tests for URL Redirects (#503) 2024-11-29 15:58:56 +01:00
Jose Quintana
b9b8425b28 Merge pull request #502 from static-web-server/update-dependencies-28-10-2024
Update dependencies 28.10.2024
2024-11-28 22:47:09 +01:00
Matthias Schoettle
96ed7df2aa refactor: prevent single wildcards from matching path separators for URL Redirects (#501)
* Enable literal_separator for redirects

This ensures that * does not match the path separator.

* Fix tests

* Update documentation

BREAKING CHANGE: Up to version 2.33.1 the wildcard `*` was matching the path separator. For example, `/{*}/{*}/` matched `/assets/images/logo/`. In later versions, the default has changed such that `*` does not match the path separator. In contrast, double wildcard (`**`) can match also a path separator.
2024-11-28 13:30:36 +01:00
Jose Quintana
e1a73c0e1e docs: add contributing, code of conduct and code guidelines pages [skip ci] (#497) 2024-11-11 23:16:54 +01:00
Jeidnx
13e3f3861f feat: better x-forwarded-for handling (#495)
Adds a `log-forwarded-for` option to control if the X-Forwarded-For
header information should be logged.
Also includes a `trusted-proxies`
option to optionally specify from which IPs to accept this header.
Existing uses of log-remote-address will stop logging forwarded-for
IPs after this change.
2024-11-11 15:00:59 +01:00
Christopher
cd11bd62b4 docs: mention truenas scale deprecation (#486)
* Update docker.md

Remove deprecated Truenas/Truecharts installation notes.

* Update download-and-install.md

Remove deprecated Truenas/Truecharts installation notes.

* Update download-and-install.template.md

Remove deprecated Truenas/Truecharts installation notes.

* refactor: mention TrueCharts as a helm charts alternative

---------

Co-authored-by: Jose Quintana <1700322+joseluisq@users.noreply.github.com>
2024-11-07 12:18:39 +01:00
Jose Quintana
8be70ac9b5 docs: v2.33.1 [skip ci] 2024-11-02 10:37:31 +01:00
Jose Quintana
f102212da5 v2.33.1 v2.33.1 2024-11-02 09:53:14 +01:00
Jose Quintana
93479ba042 chore: update dependencies 26-10-2024 (#490)
* chore: update dependencies 26-10-2024
* chore: update dependencies 2024-10-31
* fix: move out handler.rs tests
* chore: pin rust version to 1.81.0 for freebsd on ci due to issues on 1.82.0 for i386 toolchain
2024-11-01 18:05:33 +01:00
Akhil Velagapudi
de8482d294 refactor: don't set Last-Modified if mtime is Unix epoch (#488)
Resolves #487

Signed-off-by: Akhil Velagapudi <4@4khil.com>
2024-10-14 03:43:12 +01:00
Jose Quintana
30a6409613 docs: minor tweaks to man-pages-completions.md page [skip ci] 2024-09-18 00:43:33 +02:00
Jose Quintana
3484e357de docs: v2.33.0 [skip ci] 2024-09-17 23:56:26 +02:00
Jose Quintana
e6a3487586 v2.33.0 v2.33.0 2024-09-17 23:24:19 +02:00
Jose Quintana
ec85abdf32 feat: add in-memory files cache to the experimental Cargo feature (#482) 2024-09-15 21:42:23 +02:00
Jose Quintana
e25b5867bc chore: update dependencies 08.09.2024 (#479) 2024-09-15 20:38:57 +02:00
Jose Quintana
a3d40b8c2f fix: issues when building SWS without default features (#480)
* fix: issues when building without default features
* fix: windows http1_cancel_recv build issues
2024-09-10 15:28:54 +02:00
Jose Quintana
6bb6138671 chore: update Alpine (3.18.9) and Debian (12.7) Docker images (#478) 2024-09-08 22:19:04 +02:00
Jan Christian Grünhage
d567b4ec1e feat: support for generating man pages and completions (#475)
via a new `static-web-server generate` subcomand.

* feat: generate man page and completions
* fix: missing Windows imports in binary server entrypoint
* refactor: log completions and man pages generation using server_info

---------

Co-authored-by: Jose Quintana <joseluisquintana20@gmail.com>
2024-09-08 21:28:40 +02:00