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>
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.
* 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]
* Move all rewrite handling logic into the rewrites module
* Improve handling of query strings
* Fix display of rewrite/redirect errors, show underlying errors again
* Document rewrites to a different virtual host
---------
Co-authored-by: Jose Quintana <1700322+joseluisq@users.noreply.github.com>
* Skipping basic auth check for OPTIONS requests
* Adding authorization header to allowed_headers list
* refactor: improve cors module and update docs feature page
---------
Co-authored-by: Jose Quintana <joseluisquintana20@gmail.com>
* feat: `all` and `experimental` cargo feature flags
- the `all` will host all available features (`default`) plus the
`experimental`.
- the `experimental` will only hold unstable features like for example
`metrics` (as of writing)
* chore: enable the `all` cargo feature for freebsd
this feature also fixes#312
The SWS binaries for ppc64le (powerpc64le-unknown-linux-gnu) and
s590x (s390x-unknown-linux-gnu) are dynamically linked so
it does **not** make so much sense to deliver them with either the
Alpine (musl) or the Scratch images (they even do not work properly as
of writing).
So we remove those two from the SWS Alpine and Scratch Docker image
variants to avoid misunderstandings or future issues.
The Debian Docker image should be preferred instead, either linux/ppc64le
or linux/s390x respectively.
This resolves#308
It loads the HTML 404 (`--page404`) and 50x (`--page50x`) error page
content at runtime. This allows changing the content of those HTML
files on demand without restarting the server.
Previously, the error pages were loaded at start-up time (basically
they were static content).
**Some additional improvements:**
- If a relative path is used then it will be resolved under the root directory.
- The default error page values have been changed:
- `--page50x=./50x.html`
- `--page404=./404.html`
In case paths are not found then the server defaults to a generic HTML
message (as before).