Compare commits

..

82 commits

Author SHA1 Message Date
Matt Brubeck
92093a84ab Update dependencies 2026-02-12 07:36:13 -08:00
dependabot[bot]
26482e38c0 chore(deps): bump env_logger from 0.11.8 to 0.11.9
Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.11.8 to 0.11.9.
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.8...v0.11.9)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-version: 0.11.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-12 07:35:33 -08:00
Matt Brubeck
22b6dd50af Update dependencies 2026-01-20 09:39:59 -08:00
dependabot[bot]
11c569b4ec chore(deps): bump rcgen from 0.14.6 to 0.14.7
Bumps [rcgen](https://github.com/rustls/rcgen) from 0.14.6 to 0.14.7.
- [Release notes](https://github.com/rustls/rcgen/releases)
- [Commits](https://github.com/rustls/rcgen/compare/v0.14.6...v0.14.7)

---
updated-dependencies:
- dependency-name: rcgen
  dependency-version: 0.14.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-20 09:39:35 -08:00
Matt Brubeck
067e220145 Version 3.3.20 2026-01-06 11:21:22 -08:00
Matt Brubeck
7a5ef98ea8 Update dependencies 2026-01-06 11:20:43 -08:00
dependabot[bot]
b142891abe chore(deps): bump url from 2.5.7 to 2.5.8
Bumps [url](https://github.com/servo/rust-url) from 2.5.7 to 2.5.8.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.7...v2.5.8)

---
updated-dependencies:
- dependency-name: url
  dependency-version: 2.5.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-06 10:05:12 -08:00
Matt Brubeck
e758138c58 Update dependencies 2026-01-05 11:43:34 -08:00
dependabot[bot]
1807524209 chore(deps): bump tokio from 1.48.0 to 1.49.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.48.0 to 1.49.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.48.0...tokio-1.49.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.49.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-05 11:43:03 -08:00
dependabot[bot]
9daefcd3c4 chore(deps): bump rcgen from 0.14.5 to 0.14.6
Bumps [rcgen](https://github.com/rustls/rcgen) from 0.14.5 to 0.14.6.
- [Release notes](https://github.com/rustls/rcgen/releases)
- [Commits](https://github.com/rustls/rcgen/compare/v0.14.5...v0.14.6)

---
updated-dependencies:
- dependency-name: rcgen
  dependency-version: 0.14.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 11:00:56 -08:00
dependabot[bot]
dee79f819c chore(deps): bump log from 0.4.28 to 0.4.29
Bumps [log](https://github.com/rust-lang/log) from 0.4.28 to 0.4.29.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.28...0.4.29)

---
updated-dependencies:
- dependency-name: log
  dependency-version: 0.4.29
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 08:44:37 -08:00
dependabot[bot]
c385a11999 chore(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 18:51:36 -08:00
Matt Brubeck
ef39d78f08 Simplify code for cert file paths 2025-11-16 13:23:27 -08:00
Matt Brubeck
b0d30df91a Update dependencies 2025-11-16 13:09:38 -08:00
Matt Brubeck
d8481a2b0f Update dependencies 2025-11-05 19:42:55 -08:00
Matt Brubeck
5cdfb3dc4b Update dependencies 2025-10-18 11:51:20 -07:00
Matt Brubeck
90dcaff231 Update dependencies 2025-10-15 12:15:59 -07:00
dependabot[bot]
1091812e13 chore(deps): bump tokio from 1.47.1 to 1.48.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.47.1 to 1.48.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.47.1...tokio-1.48.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-15 12:10:30 -07:00
dependabot[bot]
8a6de275ca chore(deps): bump tokio-rustls from 0.26.3 to 0.26.4
Bumps [tokio-rustls](https://github.com/rustls/tokio-rustls) from 0.26.3 to 0.26.4.
- [Release notes](https://github.com/rustls/tokio-rustls/releases)
- [Commits](https://github.com/rustls/tokio-rustls/compare/v/0.26.3...v/0.26.4)

---
updated-dependencies:
- dependency-name: tokio-rustls
  dependency-version: 0.26.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-29 09:56:12 -07:00
dependabot[bot]
1e84541bbb chore(deps): bump rcgen from 0.14.4 to 0.14.5
Bumps [rcgen](https://github.com/rustls/rcgen) from 0.14.4 to 0.14.5.
- [Release notes](https://github.com/rustls/rcgen/releases)
- [Commits](https://github.com/rustls/rcgen/compare/v0.14.4...v0.14.5)

---
updated-dependencies:
- dependency-name: rcgen
  dependency-version: 0.14.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-25 08:16:27 -07:00
Matt Brubeck
47410867a5 Version 3.3.19 2025-09-18 14:25:07 -07:00
Matt Brubeck
3bc7471f7b Update dependencies 2025-09-18 14:21:41 -07:00
dependabot[bot]
d9776361af chore(deps): bump tokio-rustls from 0.26.2 to 0.26.3
Bumps [tokio-rustls](https://github.com/rustls/tokio-rustls) from 0.26.2 to 0.26.3.
- [Release notes](https://github.com/rustls/tokio-rustls/releases)
- [Commits](https://github.com/rustls/tokio-rustls/compare/v/0.26.2...v/0.26.3)

---
updated-dependencies:
- dependency-name: tokio-rustls
  dependency-version: 0.26.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-18 09:46:13 -07:00
Matt Brubeck
ac59c0e268 Update dependencies 2025-09-14 16:51:32 -07:00
dependabot[bot]
2114ff8736 chore(deps): bump rcgen from 0.14.3 to 0.14.4
Bumps [rcgen](https://github.com/rustls/rcgen) from 0.14.3 to 0.14.4.
- [Release notes](https://github.com/rustls/rcgen/releases)
- [Commits](https://github.com/rustls/rcgen/commits)

---
updated-dependencies:
- dependency-name: rcgen
  dependency-version: 0.14.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 10:12:27 -07:00
Johann150
e781609383
update changelog 2025-09-05 20:56:42 +02:00
Johann150
37ac74f21d
document commands for converting PEM to DER 2025-09-05 20:51:34 +02:00
dependabot[bot]
73eb53de4c chore(deps): bump log from 0.4.27 to 0.4.28
Bumps [log](https://github.com/rust-lang/log) from 0.4.27 to 0.4.28.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.27...0.4.28)

---
updated-dependencies:
- dependency-name: log
  dependency-version: 0.4.28
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 08:18:33 -07:00
Matt Brubeck
5c84a90093 Update dependencies 2025-09-03 11:21:57 -07:00
Matt Brubeck
cb6b815b82 Disable unicode feature of getopts 2025-09-03 10:22:48 -07:00
dependabot[bot]
dfc4c4fd7b chore(deps): bump getopts from 0.2.23 to 0.2.24
Bumps [getopts](https://github.com/rust-lang/getopts) from 0.2.23 to 0.2.24.
- [Release notes](https://github.com/rust-lang/getopts/releases)
- [Changelog](https://github.com/rust-lang/getopts/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/getopts/compare/v0.2.23...v0.2.24)

---
updated-dependencies:
- dependency-name: getopts
  dependency-version: 0.2.24
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-03 09:32:50 -07:00
Matt Brubeck
96b5431fa0 Update dependencies 2025-08-21 12:04:42 -07:00
Matt Brubeck
1893b3ad7a Update url and related crates 2025-08-21 12:03:27 -07:00
dependabot[bot]
4173a12702 chore(deps): bump percent-encoding from 2.3.1 to 2.3.2
Bumps [percent-encoding](https://github.com/servo/rust-url) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/commits)

---
updated-dependencies:
- dependency-name: percent-encoding
  dependency-version: 2.3.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 12:00:53 -07:00
dependabot[bot]
815bd517cc chore(deps): bump url from 2.5.4 to 2.5.5
Bumps [url](https://github.com/servo/rust-url) from 2.5.4 to 2.5.5.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.4...v2.5.5)

---
updated-dependencies:
- dependency-name: url
  dependency-version: 2.5.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 12:00:38 -07:00
Matt Brubeck
13ad2f363e Use if-let chains 2025-08-21 09:28:45 -07:00
dependabot[bot]
cdc72e4f2d chore(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 13:55:22 -07:00
Matt Brubeck
8cc245996b Update dependencies 2025-08-11 11:33:56 -07:00
dependabot[bot]
16cb171b06 chore(deps): bump glob from 0.3.2 to 0.3.3
Bumps [glob](https://github.com/rust-lang/glob) from 0.3.2 to 0.3.3.
- [Release notes](https://github.com/rust-lang/glob/releases)
- [Changelog](https://github.com/rust-lang/glob/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/glob/compare/v0.3.2...v0.3.3)

---
updated-dependencies:
- dependency-name: glob
  dependency-version: 0.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 11:32:31 -07:00
Matt Brubeck
354bfcceab Version 3.3.18 2025-08-05 14:36:20 -07:00
Matt Brubeck
bf5240d1ec Update dependencies 2025-08-05 14:35:01 -07:00
dependabot[bot]
4da99828c1 chore(deps): bump tokio from 1.47.0 to 1.47.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.47.0 to 1.47.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.47.0...tokio-1.47.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.47.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 10:17:55 -07:00
Matt Brubeck
6d5ae9893f Update dependencies 2025-07-29 10:15:11 -07:00
dependabot[bot]
6c9e783b84 chore(deps): bump tokio from 1.46.1 to 1.47.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.46.1 to 1.47.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.46.1...tokio-1.47.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.47.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-29 10:14:48 -07:00
dependabot[bot]
5561277985 chore(deps): bump rcgen from 0.14.2 to 0.14.3
Bumps [rcgen](https://github.com/rustls/rcgen) from 0.14.2 to 0.14.3.
- [Release notes](https://github.com/rustls/rcgen/releases)
- [Commits](https://github.com/rustls/rcgen/compare/v0.14.2...v0.14.3)

---
updated-dependencies:
- dependency-name: rcgen
  dependency-version: 0.14.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-21 08:02:26 -07:00
Matt Brubeck
6cc3128c64 rustfmt 2025-07-11 07:30:34 -07:00
Matt Brubeck
738ab0adec Use new-style format strings 2025-07-11 07:29:33 -07:00
dependabot[bot]
dbc05d79c1 chore(deps): bump rcgen from 0.14.1 to 0.14.2
Bumps [rcgen](https://github.com/rustls/rcgen) from 0.14.1 to 0.14.2.
- [Release notes](https://github.com/rustls/rcgen/releases)
- [Commits](https://github.com/rustls/rcgen/compare/v0.14.1...v0.14.2)

---
updated-dependencies:
- dependency-name: rcgen
  dependency-version: 0.14.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-11 07:27:41 -07:00
dependabot[bot]
a2239e0a9c chore(deps): bump tokio from 1.46.0 to 1.46.1
---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.46.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-07 07:59:46 -07:00
Matt Brubeck
950e8fa69b Update to rcgen 0.14.1 2025-07-02 14:28:58 -07:00
dependabot[bot]
ead0d840cb chore(deps): bump rcgen from 0.13.2 to 0.14.0
Bumps [rcgen](https://github.com/rustls/rcgen) from 0.13.2 to 0.14.0.
- [Release notes](https://github.com/rustls/rcgen/releases)
- [Commits](https://github.com/rustls/rcgen/compare/v0.13.2...v0.14.0)

---
updated-dependencies:
- dependency-name: rcgen
  dependency-version: 0.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-02 08:34:40 -07:00
dependabot[bot]
e8991931f3 chore(deps): bump tokio from 1.45.1 to 1.46.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.45.1 to 1.46.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.45.1...tokio-1.46.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.46.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-02 08:32:24 -07:00
Matt Brubeck
f74882b3fd Version 3.3.17 2025-06-26 15:06:23 -07:00
Matt Brubeck
2ee76e7a03 Update dependencies 2025-06-26 15:05:03 -07:00
dependabot[bot]
6b5de4fbff chore(deps): bump getopts from 0.2.21 to 0.2.23
Bumps [getopts](https://github.com/rust-lang/getopts) from 0.2.21 to 0.2.23.
- [Release notes](https://github.com/rust-lang/getopts/releases)
- [Changelog](https://github.com/rust-lang/getopts/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/getopts/compare/v0.2.21...v0.2.23)

---
updated-dependencies:
- dependency-name: getopts
  dependency-version: 0.2.23
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:43:54 -07:00
Matt Brubeck
ac0f3a57a3 Update dependencies 2025-05-26 08:30:35 -07:00
dependabot[bot]
4a8f3fe32d chore(deps): bump tokio from 1.45.0 to 1.45.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.45.0 to 1.45.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.45.0...tokio-1.45.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.45.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 08:07:29 -07:00
Matt Brubeck
0be4b7c508 Update dependencies 2025-05-17 14:57:31 -07:00
Matt Brubeck
89eed22e39 Update dependencies 2025-05-14 12:29:59 -07:00
Matt Brubeck
4d660eef34 Version 3.3.16 2025-05-06 09:53:28 -07:00
Matt Brubeck
d1710c924f Do release builds on Ubuntu 22.04.
Ubuntu 20.04 is no longer supported.

Agate may require a newer version of glibc after this change, and may
not run on versions of Linux older than Ubuntu 22.04.
2025-05-06 09:51:41 -07:00
Matt Brubeck
26a32b25cc Version 3.3.15 2025-05-06 09:47:17 -07:00
Matt Brubeck
7d2f552757 Update dependencies 2025-05-06 09:45:01 -07:00
dependabot[bot]
0b189d0366 chore(deps): bump tokio from 1.44.2 to 1.45.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.2 to 1.45.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.2...tokio-1.45.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.45.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-06 08:47:53 -07:00
Matt Brubeck
c6a94d73d9 Update dedependencies 2025-05-04 11:43:29 -07:00
Matt Brubeck
78f0cbac27 Update dependencies 2025-04-10 21:20:51 -07:00
Matt Brubeck
bbcff3f875 Update dependencies 2025-04-07 09:36:57 -07:00
dependabot[bot]
5f28a8f238 chore(deps): bump tokio from 1.44.1 to 1.44.2
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.1 to 1.44.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.1...tokio-1.44.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.44.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 09:36:20 -07:00
dependabot[bot]
7c9bc9e424 chore(deps): bump env_logger from 0.11.7 to 0.11.8
Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.11.7 to 0.11.8.
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.7...v0.11.8)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-02 07:33:22 -07:00
Matt Brubeck
f240006432 Version 3.3.14 2025-03-24 11:23:34 -07:00
Matt Brubeck
16c025ea69 Update dependencies 2025-03-24 09:49:56 -07:00
dependabot[bot]
c18914ead0 chore(deps): bump log from 0.4.26 to 0.4.27
Bumps [log](https://github.com/rust-lang/log) from 0.4.26 to 0.4.27.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.26...0.4.27)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 09:20:34 -07:00
Johann150
56a4786290
explicitly test hidden directories 2025-03-19 07:09:09 +01:00
Matt Brubeck
f19d1b5b75 Update dependencies 2025-03-18 17:49:38 -07:00
Matt Brubeck
e6a5d42aeb rustfmt 2025-03-17 16:21:55 -07:00
Matt Brubeck
6177043fa7 Update edition to Rust 2024 2025-03-17 16:18:29 -07:00
Matt Brubeck
732cf0dc64 Update dependencies 2025-03-17 16:11:31 -07:00
dependabot[bot]
d5be2c2dbd chore(deps): bump tokio from 1.44.0 to 1.44.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.44.0 to 1.44.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.0...tokio-1.44.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-13 08:00:23 -07:00
dependabot[bot]
e10c696cd9 chore(deps): bump env_logger from 0.11.6 to 0.11.7
Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.11.6 to 0.11.7.
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.6...v0.11.7)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-11 08:16:57 -07:00
Matt Brubeck
044b5000b5 Update dependencies 2025-03-10 09:32:08 -07:00
dependabot[bot]
510c478b11 chore(deps): bump tokio-rustls from 0.26.1 to 0.26.2
Bumps [tokio-rustls](https://github.com/rustls/tokio-rustls) from 0.26.1 to 0.26.2.
- [Release notes](https://github.com/rustls/tokio-rustls/releases)
- [Commits](https://github.com/rustls/tokio-rustls/commits)

---
updated-dependencies:
- dependency-name: tokio-rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 09:31:11 -07:00
dependabot[bot]
0dfde40161 chore(deps): bump tokio from 1.43.0 to 1.44.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.43.0 to 1.44.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.43.0...tokio-1.44.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 08:27:34 -07:00
12 changed files with 715 additions and 428 deletions

View file

@ -10,7 +10,7 @@ jobs:
cargo-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rs/audit-check@v1
# Don't run on dependabot PRs or forks
# https://github.com/actions-rs/clippy-check/issues/2#issuecomment-807852653

View file

@ -15,10 +15,10 @@ jobs:
uses: ncipollo/release-action@v1
build_ubuntu:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: create_release
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: build
run: bash .github/workflows/release.sh
- name: upload release assets linux
@ -32,7 +32,7 @@ jobs:
runs-on: windows-latest
needs: create_release
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Build
run: cargo build --verbose --release
- name: strip names
@ -50,7 +50,7 @@ jobs:
runs-on: macos-latest
needs: create_release
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: install toolchain
run: rustup target add aarch64-apple-darwin
- name: Build x86_64
@ -79,7 +79,7 @@ jobs:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Log into GHCR

View file

@ -12,7 +12,7 @@ jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Run clippy action to produce annotations
# Don't run on dependabot PRs
# https://github.com/actions-rs/clippy-check/issues/2#issuecomment-807852653
@ -30,7 +30,7 @@ jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Formatting
uses: actions-rs/cargo@v1
with:
@ -39,7 +39,7 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rs/cargo@v1
with:
command: test

View file

@ -5,18 +5,66 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Updates to dependencies are not considered notable changes for the purpose of this changelog.
This may lead to no listed changes for a version.
## [Unreleased]
## [3.3.19] - 2025-09-18
### Fixed
* Update dependencies.
* Document commands for converting PEM to DER.
## [3.3.18] - 2025-08-05
## [3.3.17] - 2025-06-27
## [3.3.16] - 2025-05-06
### Changed
* Build release artifacts with Ubuntu 22.04, because Ubuntu 20.04 is no longer supported
* pre-built binaries may no longer run on Linux distributions older than Ubuntu 22.04 (glibc 2.35)
* users with older glibc versions will need to build from source
## [3.3.15] - 2025-05-06
## [3.3.14] - 2025-03-24
## [3.3.13] - 2025-02-24
Thank you to @luineth for contributing to this release.
### Added
* aarch64 support for Docker image (#376)
## [3.3.12] - 2025-02-18
## [3.3.11] - 2024-11-29
Thank you to @geraldwuhoo and @jphastings for contributing to this release.
### Added
* Automatically publish docker images to GHCR (#366)
### Fixed
* Refactor Dockerfile for multi-stage build (#144)
## [3.3.10] - 2024-11-04
## [3.3.9] - 2024-09-10
## [3.3.8] - 2024-07-24
## [3.3.7] - 2024-04-01
## [3.3.6] - 2024-03-22
## [3.3.5] - 2024-03-15
### Fixed
* updated and simplified dependencies
* fix syntax of license field in Cargo manifest
## [3.3.4] - 2024-01-16
### Fixed
* cleaned up documentation
## [3.3.3] - 2023-12-27
### Fixed
* fixed release automation
## [3.3.2] - 2023-12-27
### Fixed
* updated dependencies
## [3.3.1] - 2023-08-05
Thank you to Jan Stępień and @michaelnordmeyer for contributing to this release.
@ -31,7 +79,6 @@ Thank you to @equalsraf, @michaelnordmeyer and @wanderer1988 for contributing to
* listening on unix sockets (#244)
### Fixed
* updated dependencies
* misstyped email address in section on how to report security vulnerabilities (#239)
* wrong language code in README (#189)
@ -41,14 +88,12 @@ Thank you to @06kellyjac, @albertlarsan68 and @kahays for contributing to this r
### Fixed
* removed port collisions in tests, for the last time (#143)
* fixed Dockerfile startup command (#169)
* upated dependencies
## [3.2.3] - 2022-02-04
Thank you to T. Spivey for contributing to this release.
### Fixed
* improper IRIs are handled instead of crashing (bug reported via email)
* updated dependencies
## [3.2.2] - 2022-01-25
Thank you to @Suzie97 for contributing to this release.
@ -56,16 +101,12 @@ Thank you to @Suzie97 for contributing to this release.
### Added
* CI build for `aarch64-apple-darwin` target (#137)
### Fixed
* updated dependencies
## [3.2.1] - 2021-12-02
Thank you to @MatthiasPortzel for contributing to this release.
### Fixed
* host name comparisons are now case insensitive (#115)
* made automatic certificate configuration more prominent in the README
* updated dependencies
## [3.2.0] - 2021-11-15
Thank you to @balazsbtond and @joseph-marques for contributing to this release.
@ -74,7 +115,6 @@ Thank you to @balazsbtond and @joseph-marques for contributing to this release.
* you can add header text to a directory listing. See the updated readme for details. (#98)
### Fixed
* updated dependencies
* error pages also send close_notify (#100)
## [3.1.3] - 2021-10-25
@ -103,7 +143,6 @@ Thank you to @jgarte and @alvaro-cuesta for contributing to this release.
### Fixed
* actually bind to multiple IP addresses. Despite the documentation saying so,
Agate would only bind to the first address that did not result in an error. (#63)
* updated dependencies
## [3.1.0] - 2021-06-08
Thank you to Matthew Ingwersen and Oliver Simmons (@GoodClover) for contributing to this release.
@ -133,7 +172,6 @@ Thank you to @06kellyjac, @cpnfeeny, @lifelike, @skittlesvampir and @steko for c
The previous handling could be exploited as a DoS attack vector. (#59)
* Two tests were running on the same port, causing them to fail nondeterministically. (#51)
* Rephrased the changelog for 3.0.0 on continuing to use older certificates. (#55)
* Updated dependencies.
## [3.0.2] - 2021-04-08
Thank you to @kvibber, @lifelike and @pasdechance for contributing to this release.
@ -196,7 +234,6 @@ Thank you to @littleli and @06kellyjac for contributing to this release.
* The GitHub workflow has been fixed so Windows binaries are compressed correctly (#36).
* Split out install steps to allow for more options in the future.
* Add install notes for nix/NixOS to the README (#38).
* Updated dependencies.
## [2.5.2] - 2021-02-12
@ -293,9 +330,6 @@ Thank you to @Johann150 and @KilianKemps for contributing to this release.
### Added
* Optional directory listings (#8, #9).
### Fixed
* Updated dependencies.
## [2.0.0] - 2020-12-23
Thank you to @bortzmeyer, @KillianKemps, and @Ylhp for contributing to this release.
@ -326,7 +360,6 @@ Thank you @Johann150, @jonhiggs and @tronje for contributing to this release!
* verify hostname and port in request URL (#4).
* improved logging (#2, #3).
* Don't redirect to "/" when the path is empty (#5).
* Update dependencies.
## [1.2.2] - 2020-09-21
Thank you to @m040601 for contributing to this release.
@ -336,13 +369,11 @@ Thank you to @m040601 for contributing to this release.
* Built both x86_64 and ARM binaries. These binaries are built for Linux operating systems with glibc 2.28 or later, such as Debian 10 ("buster") or newer, Ubuntu 18.10 or newer, and Raspberry Pi OS 2019-06-20 or newer (#1).
### Fixed
* Update dependencies.
* Minor internal code cleanup.
## [1.2.1] - 2020-06-20
### Fixed
* Reduce memory usage when serving large files.
* Update dependencies.
## [1.2.0] - 2020-06-10
### Changed
@ -351,7 +382,6 @@ Thank you to @m040601 for contributing to this release.
### Fixed
* Handling for requests that exceed 1KB.
* Reduce memory allocations and speed up request parsing.
* Update dependencies.
## [1.1.0] - 2020-05-22
### Added
@ -364,7 +394,24 @@ Thank you to @m040601 for contributing to this release.
## [1.0.0] - 2020-05-21
[Unreleased]: https://github.com/mbrubeck/agate/compare/v3.3.1...HEAD
[Unreleased]: https://github.com/mbrubeck/agate/compare/v3.3.18...HEAD
[3.3.18]: https://github.com/mbrubeck/agate/compare/v3.3.17...v3.3.18
[3.3.17]: https://github.com/mbrubeck/agate/compare/v3.3.16...v3.3.17
[3.3.16]: https://github.com/mbrubeck/agate/compare/v3.3.15...v3.3.16
[3.3.15]: https://github.com/mbrubeck/agate/compare/v3.3.14...v3.3.15
[3.3.14]: https://github.com/mbrubeck/agate/compare/v3.3.13...v3.3.14
[3.3.13]: https://github.com/mbrubeck/agate/compare/v3.3.12...v3.3.13
[3.3.12]: https://github.com/mbrubeck/agate/compare/v3.3.11...v3.3.12
[3.3.11]: https://github.com/mbrubeck/agate/compare/v3.3.10...v3.3.11
[3.3.10]: https://github.com/mbrubeck/agate/compare/v3.3.9...v3.3.10
[3.3.9]: https://github.com/mbrubeck/agate/compare/v3.3.8...v3.3.9
[3.3.8]: https://github.com/mbrubeck/agate/compare/v3.3.7...v3.3.8
[3.3.7]: https://github.com/mbrubeck/agate/compare/v3.3.6...v3.3.7
[3.3.6]: https://github.com/mbrubeck/agate/compare/v3.3.5...v3.3.6
[3.3.5]: https://github.com/mbrubeck/agate/compare/v3.3.4...v3.3.5
[3.3.4]: https://github.com/mbrubeck/agate/compare/v3.3.3...v3.3.4
[3.3.3]: https://github.com/mbrubeck/agate/compare/v3.3.2...v3.3.3
[3.3.2]: https://github.com/mbrubeck/agate/compare/v3.3.1...v3.3.2
[3.3.1]: https://github.com/mbrubeck/agate/compare/v3.3.0...v3.3.1
[3.3.0]: https://github.com/mbrubeck/agate/compare/v3.2.4...v3.3.0
[3.2.4]: https://github.com/mbrubeck/agate/compare/v3.2.3...v3.2.4

804
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package]
name = "agate"
version = "3.3.13"
version = "3.3.20"
authors = ["Matt Brubeck <mbrubeck@limpet.net>", "Johann150 <johann+agate@qwertqwefsday.eu>"]
description = "Very simple server for the Gemini hypertext protocol"
keywords = ["server", "gemini", "hypertext", "internet", "protocol"]
@ -8,22 +8,22 @@ categories = ["network-programming"]
repository = "https://github.com/mbrubeck/agate"
readme = "README.md"
license = "MIT OR Apache-2.0"
edition = "2021"
edition = "2024"
exclude = ["/tools", "/.github", "/Cross.toml", "/content", "/CODE_OF_CONDUCT.md", "/CONTRIBUTING.md", "/CHANGELOG.md", "/tests"]
[dependencies]
configparser = "3.0"
env_logger = { version = "0.11", default-features = false, features = ["auto-color", "humantime"] }
futures-util = "0.3"
getopts = "0.2.21"
getopts = { version = "0.2.24", default-features = false }
glob = "0.3"
log = "0.4"
mime_guess = "2.0"
percent-encoding = "2.3"
rcgen = { version = "0.13.2", default-features = false, features = ["ring"] }
tokio-rustls = { version = "0.26.1", default-features = false, features = ["logging", "ring", "tls12"] }
tokio = { version = "1.43", features = ["fs", "io-util", "net", "rt-multi-thread", "sync"] }
url = "2.5.4"
rcgen = { version = "0.14.7", default-features = false, features = ["ring"] }
tokio-rustls = { version = "0.26.4", default-features = false, features = ["logging", "ring", "tls12"] }
tokio = { version = "1.49", features = ["fs", "io-util", "net", "rt-multi-thread", "sync"] }
url = "2.5.8"
[dev-dependencies]
trotter = "1.0"

View file

@ -195,6 +195,13 @@ Using a directory named just `.` causes undefined behaviour as this would have t
The files for a certificate/key pair have to be named `cert.der` and `key.der` respectively. The certificate has to be a X.509 certificate in a DER format file and has to include a subject alt name of the domain name. The private key has to be in DER format and must be either an RSA, ECDSA or Ed25519 key.
If you have an existing certificate/key pair in PEM format, you can use these commands to convert them to the DER format:
```shell
openssl x509 -inform pem -in cert.pem -outform der -out cert.der
openssl rsa -inform pem -in privkey.pem -outform der -out key.der
```
## Logging
All requests via TCP sockets will be logged using this format:

View file

@ -50,8 +50,13 @@ impl Display for CertLoadError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Self::NoReadCertDir => write!(f, "Could not read from certificate directory."),
Self::Empty => write!(f, "No keys or certificates were found in the given directory.\nSpecify the --hostname option to generate these automatically."),
Self::BadKey(domain, err) => write!(f, "The key file for {domain} is malformed: {err:?}"),
Self::Empty => write!(
f,
"No keys or certificates were found in the given directory.\nSpecify the --hostname option to generate these automatically."
),
Self::BadKey(domain, err) => {
write!(f, "The key file for {domain} is malformed: {err:?}")
}
Self::MissingKey(domain) => write!(f, "The key file for {domain} is missing."),
Self::MissingCert(domain) => {
write!(f, "The certificate file for {domain} is missing.")
@ -134,13 +139,13 @@ impl CertStore {
Err(CertLoadError::EmptyDomain(_)) => { /* there are no fallback keys */ }
Err(CertLoadError::Empty) | Err(CertLoadError::NoReadCertDir) => unreachable!(),
Err(CertLoadError::BadKey(_, e)) => {
return Err(CertLoadError::BadKey("fallback".to_string(), e))
return Err(CertLoadError::BadKey("fallback".to_string(), e));
}
Err(CertLoadError::MissingKey(_)) => {
return Err(CertLoadError::MissingKey("fallback".to_string()))
return Err(CertLoadError::MissingKey("fallback".to_string()));
}
Err(CertLoadError::MissingCert(_)) => {
return Err(CertLoadError::MissingCert("fallback".to_string()))
return Err(CertLoadError::MissingCert("fallback".to_string()));
}
// For the fallback keys there is no domain name to verify them
// against, so we can skip that step and only have to do it for the

View file

@ -7,7 +7,7 @@ use codes::*;
use metadata::{FileOptions, PresetMeta};
use {
percent_encoding::{percent_decode_str, percent_encode, AsciiSet, CONTROLS},
percent_encoding::{AsciiSet, CONTROLS, percent_decode_str, percent_encode},
rcgen::{CertificateParams, DnType, KeyPair},
std::{
borrow::Cow,
@ -27,9 +27,9 @@ use {
sync::Mutex,
},
tokio_rustls::{
TlsAcceptor,
rustls::{server::ServerConfig, version::TLS13},
server::TlsStream,
TlsAcceptor,
},
url::{Host, Url},
};
@ -73,7 +73,7 @@ fn main() {
panic!("Failed to listen on {addr}: {e}")
} else {
// already listening on the other unspecified address
log::warn!("Could not start listener on {}, but already listening on another unspecified address. Probably your system automatically listens in dual stack?", addr);
log::warn!("Could not start listener on {addr}, but already listening on another unspecified address. Probably your system automatically listens in dual stack?");
continue;
}
}
@ -82,7 +82,7 @@ fn main() {
listening_unspecified |= addr.ip().is_unspecified();
handles.push(tokio::spawn(async move {
log::info!("Started listener on {}", addr);
log::info!("Started listener on {addr}");
loop {
let (stream, _) = listener.accept().await.unwrap_or_else(|e| {
@ -92,11 +92,11 @@ fn main() {
tokio::spawn(async {
match RequestHandle::new(stream, arc).await {
Ok(handle) => match handle.handle().await {
Ok(info) => log::info!("{}", info),
Err(err) => log::warn!("{}", err),
Ok(info) => log::info!("{info}"),
Err(err) => log::warn!("{err}"),
},
Err(log_line) => {
log::warn!("{}", log_line);
log::warn!("{log_line}");
}
}
});
@ -134,11 +134,11 @@ fn main() {
tokio::spawn(async {
match RequestHandle::new_unix(stream, arc).await {
Ok(handle) => match handle.handle().await {
Ok(info) => log::info!("{}", info),
Err(err) => log::warn!("{}", err),
Ok(info) => log::info!("{info}"),
Err(err) => log::warn!("{err}"),
},
Err(log_line) => {
log::warn!("{}", log_line);
log::warn!("{log_line}");
}
}
});
@ -273,10 +273,7 @@ fn args() -> Result<Args> {
// the directory does not exist
Err(_) => {
// since certificate management should be automated, we are going to create the directory too
log::info!(
"The certificate directory {:?} does not exist, creating it.",
certs_path
);
log::info!("The certificate directory {certs_path:?} does not exist, creating it.");
std::fs::create_dir(&certs_path).expect("could not create certificate directory");
// we just created the directory, skip loading from it
(None, PathBuf::from(certs_path))
@ -293,55 +290,53 @@ fn args() -> Result<Args> {
let hostname = Host::parse(&s)?;
// check if we have a certificate for that domain
if let Host::Domain(ref domain) = hostname {
if !matches!(certs, Some(ref certs) if certs.has_domain(domain)) {
log::info!("No certificate or key found for {:?}, generating them.", s);
if let Host::Domain(ref domain) = hostname
&& !matches!(certs, Some(ref certs) if certs.has_domain(domain))
{
log::info!("No certificate or key found for {s:?}, generating them.");
let mut cert_params = CertificateParams::new(vec![domain.clone()])?;
cert_params
.distinguished_name
.push(DnType::CommonName, domain);
let mut cert_params = CertificateParams::new(vec![domain.clone()])?;
cert_params
.distinguished_name
.push(DnType::CommonName, domain);
// <CertificateParams as Default>::default() already implements a
// date in the far future from the time of writing: 4096-01-01
// <CertificateParams as Default>::default() already implements a
// date in the far future from the time of writing: 4096-01-01
let key_pair = if matches.opt_present("e") {
KeyPair::generate_for(&rcgen::PKCS_ED25519)
} else {
KeyPair::generate()
}?;
let key_pair = if matches.opt_present("e") {
KeyPair::generate_for(&rcgen::PKCS_ED25519)
} else {
KeyPair::generate()
}?;
// generate the certificate with the configuration
let cert = cert_params.self_signed(&key_pair)?;
// generate the certificate with the configuration
let cert = cert_params.self_signed(&key_pair)?;
// make sure the certificate directory exists
fs::create_dir(certs_path.join(domain))?;
// write certificate data to disk
let mut cert_file = File::create(certs_path.join(format!(
"{}/{}",
domain,
certificates::CERT_FILE_NAME
)))?;
cert_file.write_all(cert.der())?;
// write key data to disk
let key_file_path =
certs_path.join(format!("{}/{}", domain, certificates::KEY_FILE_NAME));
let mut key_file = File::create(&key_file_path)?;
#[cfg(unix)]
{
// set permissions so only owner can read
match key_file.set_permissions(std::fs::Permissions::from_mode(0o400)) {
Ok(_) => (),
Err(_) => log::warn!(
"could not set permissions for new key file {}",
key_file_path.display()
),
}
// make sure the certificate directory exists
let cert_dir = certs_path.join(domain);
fs::create_dir(&cert_dir)?;
// write certificate data to disk
let mut cert_file = File::create(cert_dir.join(certificates::CERT_FILE_NAME))?;
cert_file.write_all(cert.der())?;
// write key data to disk
let key_file_path = cert_dir.join(certificates::KEY_FILE_NAME);
let mut key_file = File::create(&key_file_path)?;
#[cfg(unix)]
{
// set permissions so only owner can read
match key_file.set_permissions(std::fs::Permissions::from_mode(0o400)) {
Ok(_) => (),
Err(_) => log::warn!(
"could not set permissions for new key file {}",
key_file_path.display()
),
}
key_file.write_all(key_pair.serialized_der())?;
reload_certs = true;
}
key_file.write_all(key_pair.serialized_der())?;
reload_certs = true;
}
hostnames.push(hostname);
@ -496,7 +491,7 @@ impl RequestHandle<UnixStream> {
metadata,
}),
// use nonexistent status code 00 if connection was not established
Err(e) => Err(format!("{} \"\" 00 \"TLS error\" error:{}", log_line, e)),
Err(e) => Err(format!("{log_line} \"\" 00 \"TLS error\" error:{e}")),
}
}
}
@ -597,13 +592,13 @@ where
}
// correct port
if let Some(expected_port) = self.local_port_check {
if let Some(port) = url.port() {
// Validate that the port in the URL is the same as for the stream this request
// came in on.
if port != expected_port {
return Err((PROXY_REQUEST_REFUSED, "Proxy request refused"));
}
if let Some(expected_port) = self.local_port_check
&& let Some(port) = url.port()
{
// Validate that the port in the URL is the same as for the stream this request
// came in on.
if port != expected_port {
return Err((PROXY_REQUEST_REFUSED, "Proxy request refused"));
}
}
Ok(url)
@ -662,24 +657,24 @@ where
}
}
if let Ok(metadata) = tokio::fs::metadata(&path).await {
if metadata.is_dir() {
if url.path().ends_with('/') || url.path().is_empty() {
// if the path ends with a slash or the path is empty, the links will work the same
// without a redirect
// use `push` instead of `join` because the changed path is used later
path.push("index.gmi");
if !path.exists() {
path.pop();
// try listing directory
return self.list_directory(&path).await;
}
} else {
// if client is not redirected, links may not work as expected without trailing slash
let mut url = url;
url.set_path(&format!("{}/", url.path()));
return self.send_header(REDIRECT_PERMANENT, url.as_str()).await;
if let Ok(metadata) = tokio::fs::metadata(&path).await
&& metadata.is_dir()
{
if url.path().ends_with('/') || url.path().is_empty() {
// if the path ends with a slash or the path is empty, the links will work the same
// without a redirect
// use `push` instead of `join` because the changed path is used later
path.push("index.gmi");
if !path.exists() {
path.pop();
// try listing directory
return self.list_directory(&path).await;
}
} else {
// if client is not redirected, links may not work as expected without trailing slash
let mut url = url;
url.set_path(&format!("{}/", url.path()));
return self.send_header(REDIRECT_PERMANENT, url.as_str()).await;
}
}
@ -743,7 +738,7 @@ where
return Ok(());
};
log::info!("Listing directory {:?}", path);
log::info!("Listing directory {path:?}");
self.send_header(SUCCESS, "text/gemini").await?;
self.stream.write_all(preamble.as_bytes()).await?;

View file

@ -1,5 +1,5 @@
use configparser::ini::Ini;
use glob::{glob_with, MatchOptions};
use glob::{MatchOptions, glob_with};
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
use std::time::SystemTime;
@ -107,7 +107,7 @@ impl FileOptions {
/// (Re)reads a specified sidecar file.
/// This function will allways try to read the file, even if it is current.
fn read_database(&mut self, db: &Path) {
log::debug!("reading database {:?}", db);
log::debug!("reading database {db:?}");
let mut ini = Ini::new_cs();
ini.set_default_section("mime");
@ -124,7 +124,7 @@ impl FileOptions {
let files = match map {
Ok(section) => section,
Err(err) => {
log::error!("invalid config file {:?}: {}", db, err);
log::error!("invalid config file {db:?}: {err}");
return;
}
};
@ -146,7 +146,9 @@ impl FileOptions {
|| !header.chars().nth(1).unwrap().is_ascii_digit()
|| !header.chars().nth(2).unwrap().is_whitespace()
{
log::error!("Line for {:?} starts like a full header line, but it is incorrect; ignoring it.", path);
log::error!(
"Line for {path:?} starts like a full header line, but it is incorrect; ignoring it."
);
return;
}
let separator = header.chars().nth(2).unwrap();
@ -154,7 +156,9 @@ impl FileOptions {
// the Gemini specification says that the third
// character has to be a space, so correct any
// other whitespace to it (e.g. tabs)
log::warn!("Full Header line for {:?} has an invalid character, treating {:?} as a space.", path, separator);
log::warn!(
"Full Header line for {path:?} has an invalid character, treating {separator:?} as a space."
);
}
let status = header
.chars()
@ -186,12 +190,12 @@ impl FileOptions {
match glob_with(path, glob_options) {
Ok(paths) => paths.collect::<Vec<_>>(),
Err(err) => {
log::error!("incorrect glob pattern in {:?}: {}", path, err);
log::error!("incorrect glob pattern in {path:?}: {err}");
continue;
}
}
} else {
log::error!("path is not UTF-8: {:?}", path);
log::error!("path is not UTF-8: {path:?}");
continue;
};
@ -206,7 +210,7 @@ impl FileOptions {
self.file_meta.insert(path, preset.clone());
}
Err(err) => {
log::warn!("could not process glob path: {}", err);
log::warn!("could not process glob path: {err}");
continue;
}
};

View file

@ -13,7 +13,7 @@
//! You should have received a copy of the GNU General Public License
//! along with this program. If not, see <https://www.gnu.org/licenses/>.
use rustls::{pki_types::CertificateDer, ClientConnection, RootCertStore};
use rustls::{ClientConnection, RootCertStore, pki_types::CertificateDer};
use std::convert::TryInto;
use std::io::{BufRead, BufReader, Read, Write};
use std::net::{SocketAddr, TcpStream, ToSocketAddrs};
@ -401,6 +401,15 @@ fn secret_exists() {
assert_eq!(page.status, Status::Gone.value());
}
#[test]
/// - status for paths with hidden segments is "gone" if the respective segment is not the last
fn secret_subdir() {
let page =
get(&["-C"], "gemini://localhost/.well-known/hidden-file").expect("could not get page");
assert_eq!(page.status, Status::Gone.value());
}
#[test]
/// - secret file served if `--serve-secret` is enabled
fn serve_secret() {
@ -530,7 +539,7 @@ mod vhosts {
mod multicert {
use super::*;
use rustls::{pki_types::CertificateDer, ClientConnection, RootCertStore};
use rustls::{ClientConnection, RootCertStore, pki_types::CertificateDer};
use std::io::Write;
use std::net::TcpStream;