221 Commits

Author SHA1 Message Date
Jose Quintana
865e8e4e89 refactor: improve SWS installer script functionality for Linux/BSDs (#611)
* refactor: improve installer script functionality
* refactor: simplify installer script and installation docs
* fix: typos
2026-01-08 19:21:02 +01:00
Jose Quintana
beacdbc023 docs: initial showcases page (#605)
https://static-web-server.net/showcases/
2025-12-20 12:47:28 +01:00
github-actions[bot]
520af20a03 docs: v2.40.1 [skip ci] (#601)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-08 04:03:19 +01:00
Matthias Schoettle
dd43d06551 refactor: format check support Markdown files via mdformat (#597)
* chore: format Markdown files with mdformat
* chore: switch to mdformat config file
* chore: add missing trailing slash
* docs: add section about formatting Markdown files
2025-12-07 10:40:21 +01:00
github-actions[bot]
f58d6355c1 docs: v2.40.0 [skip ci] (#591)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-30 23:36:09 +01:00
Jose Quintana
c66c791ca9 refactor: prefer dynamically-linked binaries for Debian Docker images (#588)
* refactor: prefer dynamically-linked binaries for debian docker images
* fix: disable dynamically-linked binary execution tests
   As dynamically-linked binaries can not be executed for obvious reasons
* docs: improve os/arch section
2025-11-29 03:04:56 +01:00
Jose Quintana
ee4b049d3b feat: armv7-unknown-linux-gnueabihf target (#586) 2025-11-27 23:03:54 +01:00
Jose Quintana
b23498458f refactor: Rootless Debian and Alpine Docker images by default (#567)
* chore: setup user public directory, permissions and symlink
* chore: alpine and debian rootless
* docs: rootless information
2025-11-17 23:22:20 +01:00
David Legrand
2c25d823f2 feat: content negotiation for markdown files via Accept header (#577)
* feat: add accept markdown

* docs: add accept markdown feature

* fix: cors error detected by clippy in CI

* fix: simplify markdown handling

* chore: add accept markdown integration tests

* chore: move accept markdown test files

* fix: after review
2025-11-06 15:44:20 +01:00
Jose Quintana
db22a69a7b docs: v2.39.0 [skip ci] (#575)
Add missing freebsd x86_64 artifact

- static-web-server-v2.39.0-x86_64-unknown-freebsd.tar.gz
- SHA256SUM: 8ed7e75844f952ad9f20f303187084af4c433ecac4558b2c3268af7f36d0983c
2025-10-26 02:21:44 +01:00
github-actions[bot]
c21d896f5f docs: v2.39.0 [skip ci] (#575)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-26 02:02:46 +01:00
Jose Quintana
57025e3321 chore: update dependencies 23-10-2025 & MSRV to Rust 1.85.0 (2024 Edition) (#572)
* fix: update dependencies 23-10-2025
* chore: update dependencies 26-10-2025
* chore: update dependencies 26.10.2025 & bump up MSRV to 1.85.0
* fix: lint errors
* fix: style edition 2024

SWS now requires Rust 1.85.0 (Rust 2024 Edition) or later
https://blog.rust-lang.org/2025/02/20/Rust-1.85.0/
2025-10-26 02:04:21 +02:00
github-actions[bot]
648170dc2b docs: v2.38.1 [skip ci] (#565)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-09 00:22:54 +02:00
Jose Quintana
0b5577085d chore: remove public from Cache-Control header value (#562)
It removes `public` from `Cache-Control` value, leaving max-age=<VALUE>, which can prevent CDN and Basic Authentication issues. See details on #560.

This applies to the "Cache-Control Headers" feature, with no user-breaking changes expected.
2025-09-06 09:20:09 +02:00
github-actions[bot]
840522c4b2 docs: v2.38.0 [skip ci] (#555)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-21 23:02:33 +02:00
Jose Quintana
8c435ad010 chore: update dependencies 21.07.2025 & fix clippy lint warnings (#552)
* fix: clippy lint warnings
* chore: update dependencies 21.07.2025
* core: rust version on FreeBSD CI has been bumped up to 1.88.0.
2025-07-21 21:43:51 +02:00
David Legrand
acd838877b feat: prefer a less-generic config file sws.toml as default (#551)
- `sws.toml` used if present
- But `config.toml` has priority if it exists
- A warning message is printed if `config.toml` is used, as it will be removed in a future release previous advice.
2025-07-02 11:09:04 +02:00
Jose Quintana
ac72d4e6be docs: v2.37.0 [skip ci] 2025-06-03 23:28:19 +02:00
Jose Quintana
b67202baea v2.37.0 2025-06-03 22:31:24 +02:00
Jose Quintana
b56e3c4a96 chore: update dependencies 30.05.2025 and MSRV to 1.82.0 (#546)
* chore: update dependencies 30.05.2025
* chore: format and lint checks for test files on CI
* fix: clippy lint warnings in test files
2025-05-31 23:31:50 +02:00
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
934b0e2c40 docs: v2.36.1 [skip ci] 2025-04-02 00:23:31 +02:00
Jose Quintana
ee5c032dac docs: v2.36.0 [skip ci] 2025-02-10 21:58:31 +01:00
Jose Quintana
0053d74e6c refactor: improve post release updates ci workflow (#525) 2025-02-07 07:15:42 +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
28d6bd6f0e docs: v2.35.0 [skip ci] 2025-01-10 18:43:49 +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
d142db972d docs: v2.34.0 [skip ci] 2024-12-04 00:34:05 +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
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
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 2024-09-17 23:24:19 +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
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
Jose Quintana
5bdfcd4c88 feat: experimental in-memory files cache with eviction policy support (#328)
Via a new advanced configuration entry.

The feature also supports expiration policies such as Time To Live (TTL) and Time To Idle (TTI).

Admission to a cache is controlled by the Least Frequently Used (LFU) policy and the eviction from a cache is controlled by the Least Recently Used (LRU) policy.

Example:

```toml
[general]

[advanced]

[advanced.memory-cache]
# Maximum capacity entries of the memory cache-store. Default 256
capacity = 256
# Time to live in seconds of a cached file entry. Default 1h
ttl = 3600
# Time to idle in seconds of a cached file entry. Default 5min
tti = 300
# Maximum size in bytes for a file entry to be cached. Default 8MB
max-file-size = 8192
```

Note that this feature requires Rust 1.76.0 or newer.

This feature is **experimental**. However, when stabilized then a cargo feature will be available as well as a proper documentation page.
2024-09-04 00:15:55 +02:00
Jose Quintana
e67e4c4901 docs: v2.32.2 [skip ci] 2024-08-14 00:10:12 +02:00
Jose Quintana
ce50a81d21 docs: v2.32.1 [skip ci] 2024-07-21 00:10:57 +02:00
Jose Quintana
25b1b1c391 docs: improve feature, versioning pages and remove dead links (#460) 2024-07-01 23:59:20 +02:00
Jose Quintana
9afff97acd docs: v2.32.0 [skip ci] 2024-06-19 06:49:32 +02:00
Jose Quintana
eeb88dab51 feat: disable symlinks option via --disable-symlinks (#454)
* feat: disable symlinks option

--disable-symlinks[=<DISABLE_SYMLINKS>]
  Prevent following files or directories if any path name component is
  a symbolic link [env: SERVER_DISABLE_SYMLINKS=] [default: false]
  [possible values: true, false]

* chore: add tests
* docs: feature page [skip ci]
2024-06-11 22:46:50 +02:00
Jose Quintana
91f8ec0675 docs: improve download-and-install.md page (second part) 2024-05-23 00:42:42 +02:00