Commit graph

125 commits

Author SHA1 Message Date
Johann150
f7ac1fe21b update readme 2021-01-17 19:42:48 +01:00
Johann150
c916827709 add metadata database 2021-01-17 19:42:48 +01:00
Johann150
bb7e885143 run cargo fmt 2021-01-17 19:42:48 +01:00
Matt Brubeck
3d7a28a6bd Version 2.3.0 2021-01-16 18:30:07 -08:00
Johann150
21e16e9a9c update & rephrase readme 2021-01-16 18:24:10 -08:00
Johann150
6d51e97649 fix help message 2021-01-16 18:24:10 -08:00
Johann150
7c4a042cd3 check port against TCP stream's port
This also reinstates the old format for the --addr flag and removes
the separate flag for the port.
2021-01-16 18:24:10 -08:00
Matt Brubeck
7e5517d9c0 Version 2.2.0 2021-01-16 10:59:55 -08:00
Matt Brubeck
72a4cd7c5c Update dependencies 2021-01-16 10:58:54 -08:00
Matt Brubeck
dd4be5b9f6 Take port as a separate command-line argument 2021-01-16 10:42:27 -08:00
Johann150
4e7d09204f only check path segments in URL
This will only check path segments specified in the request URL and not
path segments that are part of the path specified on the command line.

Otherwise if the content directory was (in) a hidden directory, or specified
with a relative path containing "." or ".." segments, nothing would be served.
2021-01-16 09:56:58 -08:00
Johann150
972ecf8c13 correctly redirect directories
cf. <https://lists.orbitalfox.eu/archives/gemini/2021/004827.html>
2021-01-16 09:56:04 -08:00
Johann150
681ba770a1 check all path components 2021-01-05 12:36:50 -08:00
Johann150
af783f6911 configuration flag to reenable secret files 2021-01-05 12:36:50 -08:00
Johann150
7d10fa3c74 do not serve hidden files 2021-01-05 12:36:50 -08:00
Purexo
d9cc1cfffa provide addr binding with dual-stack mode example 2021-01-03 19:04:19 -08:00
Matt Brubeck
1ce32abaa2 Version 2.1.3 2021-01-01 20:10:04 -08:00
Matt Brubeck
1361f07467 Scheme-relative URLs are no longer allowed
https://lists.orbitalfox.eu/archives/gemini/2020/003646.html
2021-01-01 20:10:04 -08:00
Matt Brubeck
c563f27b1a Send close_notify before closing connection 2021-01-01 20:05:19 -08:00
Matt Brubeck
33d39cc34b Organize imports 2020-12-31 18:07:59 -08:00
Matt Brubeck
471a9927a0 Use the Tokio async runtime 2020-12-31 18:05:46 -08:00
Matt Brubeck
beb0566201 Version 2.1.2 2020-12-31 17:07:33 -08:00
Matt Brubeck
ec50a315a3 Use concrete types for TlsStreams 2020-12-31 17:02:45 -08:00
Matt Brubeck
edf2ebffdc Refactor error handling and logging 2020-12-31 16:20:57 -08:00
Matt Brubeck
847434d844 Reorganize some code 2020-12-31 15:41:15 -08:00
Matt Brubeck
879422c2cc Simplify percent-encoding of paths. 2020-12-31 15:39:36 -08:00
Matt Brubeck
fe62be214e Reduce number of writes in send_header 2020-12-31 14:43:22 -08:00
Matt Brubeck
bf2e35537c Percent-escape more characters 2020-12-30 22:12:38 -08:00
Matt Brubeck
da3f3fb727 Version 2.1.1 2020-12-30 21:47:06 -08:00
Matt Brubeck
70b28a65e1 Encode spaces in filenames 2020-12-30 21:16:12 -08:00
Matt Brubeck
9683146851 Print directory listings in alphabetical order 2020-12-30 21:15:35 -08:00
Matt Brubeck
bd7b542048 Version 2.1.0 2020-12-28 15:06:08 -08:00
Matt Brubeck
a70f5e6100 Use async version of read_dir 2020-12-27 12:18:05 -08:00
Matt Brubeck
0909a4def8 Rename 'respond' to 'send_header' 2020-12-27 12:12:21 -08:00
Matt Brubeck
a007908248 Facter directory listing into a function 2020-12-27 12:11:38 -08:00
Johann150
e4dacd1315 implement basic directory listing 2020-12-27 11:30:53 -08:00
Matt Brubeck
7998fafcc7 Update dependencies 2020-12-22 20:58:29 -08:00
Matt Brubeck
a3b1e2d0f9 Fix typo 2020-12-22 20:52:22 -08:00
Matt Brubeck
5619af1731 Version 2.0.0 2020-12-22 20:40:58 -08:00
Matt Brubeck
9d3b5fb777 Raspberry Pi cross compilation 2020-12-22 20:40:43 -08:00
Matt Brubeck
a2f6f5932f Enable logging by default 2020-12-22 17:42:23 -08:00
Matt Brubeck
7a117f3a47 Option to add a language code to text/gemini responses 2020-12-22 16:16:42 -08:00
Matt Brubeck
dfa5dbd971 Use getopts for option parsing 2020-12-22 16:09:05 -08:00
Matt Brubeck
5d187a47fc Sort dependencies 2020-12-22 13:11:58 -08:00
Matt Brubeck
06aa131196 Version 1.3.2 2020-12-09 11:36:02 -08:00
Matt Brubeck
ebd457d9cf Update to async-tls 0.11 2020-12-09 11:35:01 -08:00
Matt Brubeck
41dac7ce5f Version 1.3.1 2020-12-08 09:06:11 -08:00
Douglas Creager
838f3ad8cb Update dependencies to make cargo install work
Right now, you get an error trying to `cargo install agate`:

    error[E0277]: the trait bound `TlsAcceptor: From<Arc<ServerConfig>>` is not satisfied
      --> src/main.rs:91:8
       |
    91 |     Ok(TlsAcceptor::from(Arc::new(config)))
       |        ^^^^^^^^^^^^^^^^^ the trait `From<Arc<ServerConfig>>` is not implemented for `TlsAcceptor`
       |
       = help: the following implementations were found:
                 <TlsAcceptor as From<Arc<rustls::server::ServerConfig>>>
                 <TlsAcceptor as From<rustls::server::ServerConfig>>
       = note: required by `from`

This stems a recent point upgrade of async-tls.  The newest version
(0.10.2) now depends on rustls 0.19.  The previous version in agate's
lock file (0.10.0) depended on rustls 0.18.  Agate itself also depended
on rustls 0.18.

The default behavior of `cargo install` is to ignore the lock file and
run a `cargo update` before building and installing.  That causes agate
and async-tls to compile against different versions of rustls, causing
the compiler error above.

Arguably, async-tls's recent release should have been a breaking
release, to 0.11, but since that ship has sailed, we can bump agate's
requirements to the latest published versions.  Everything seems to
build correctly, and the server still seems to work fine.
2020-12-08 08:28:11 -08:00
Matt Brubeck
cd5918e1b9 Refactor error handling code 2020-11-21 10:44:06 -08:00
Matt Brubeck
9097318e28 Log all requests 2020-11-21 09:53:26 -08:00