Commit Graph

1055 Commits

Author SHA1 Message Date
Jose Quintana
59fbcdcb9a chore: test perfcheck 2025-11-26 04:48:54 +01:00
Jose Quintana
ea9f43f404 refactor: move perfcheck workflow behind a PR comment trigger (#584) 2025-11-26 04:47:08 +01:00
Jose Quintana
0fedeb36b4 fix: crate documentation issues (#583)
* chore: improve crate doc checks on ci
* fix: doc_auto_cfg feature has been removed (error)
* fix: bare URLs are not automatically turned into clickable links (warning)
2025-11-26 04:12:17 +01:00
Jose Quintana
55562a1c35 chore: update dependencies 26.11.2025 (#582) 2025-11-26 03:17:33 +01:00
Jose Quintana
557363e128 refactor: replace regex crate with regex-lite to reduce binary size (#581)
It optimizes for binary size by replacing the `regex` crate with its lightweight equivalent (`regex-lite`).
The change reports a binary size reduction of approximately `~500KB`.

x86_64-unknown-linux-musl example:

before (v2.39.0):
8,9M	static-web-server

after:
8,4M    static-web-server
2025-11-20 01:19:38 +01:00
Jose Quintana
ce5b4fab30 refactor: drop lazy_static for fixed text mime types in compression (#580)
It removes the `lazy_static` dependency in favor of a fixed text-mime type list in the `compression` module.
2025-11-20 00:53:08 +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
Jose Quintana
d48da4ca06 refactor: simplify public dir for docker image & default error pages (#579) 2025-11-15 21:48:54 +01:00
Francis Tseng
326abbe7d5 feat: add exit_on_error option to Server::run_server_on_rt function (#578)
* feat: add `exit_on_error` option when starting server to choose if the
entire process exits if the server fails to start
* Update src/server.rs
* style: formatting fix

---------

Co-authored-by: Francis Tseng <accounts@frnsys.com>
Co-authored-by: Jose Quintana <1700322+joseluisq@users.noreply.github.com>
2025-11-15 10:58:18 +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
a6b181e347 v2.39.0 v2.39.0 2025-10-26 02:47:35 +02: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
Jose Quintana
a7e8fa3272 chore: update Alpine (3.21.5) & Debian (12.12) Docker images (#573) 2025-10-23 22:35:51 +02:00
Jose Quintana
2549119abd fix: virtual hosts don't work with HTTP/2 (#571)
* virtual hosts: support HTTP/2 using :authority

So far, the HTTP host header has been used to determine the hostname
that is being accessed. In HTTP/2, this header is not guaranteed to be
sent. Instead, the ":authority" pseudo-header field is used. This commit
adds a check for that header to make virtual hosts also work with
HTTP/2.

Additionally, this commit adds code to check and remove the port number,
which may or may not be sent as part of the HTTP host header.

* chore: add test cases

---------

Co-authored-by: CrazyCraftix <>
Co-authored-by: joseluisq <1700322+joseluisq@users.noreply.github.com>
2025-10-18 06:35:38 +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
71c54dd1f2 v2.38.1 v2.38.1 2025-09-09 00:05:06 +02:00
Jose Quintana
2a0923866f chore: update docker alpine images to 3.21.4 (#563) 2025-09-08 11:05:26 +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
Jose Quintana
a522274430 chore: update dependencies 05-09-2025 (#561) 2025-09-05 21:48:50 +02:00
Jose Quintana
c5477fe785 chore: update dependencies 2025-08-23 (#556) 2025-08-23 14:22:41 +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
e15d42fb4c v2.38.0 v2.38.0 2025-07-21 22:37:26 +02:00
Jose Quintana
47ce050388 chore: update Alpine (3.20.7) & Debian (12.11) Docker images (#553) 2025-07-21 22:00:43 +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 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
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