~garritfra/taurus

Simplify Config::load

Simplify Config::load by using the fs::read_to_string function provided
in std. Additionally, we update the type of the config_path argument to
be generic over AsRef<Path> which is generally preferred over &str for
file path arguments.
6fe4a2d0 — Alexey Yerin 2 years ago
Cancel request on invalid Unicode character

It's pointless to continue as file names mostly don't contain invalid
Unicode.

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
9c83ef84 — Alexey Yerin 2 years ago
Extract I/O related functions to "io" module

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
c9e07b85 — Garrit Franke 2 years ago
Merge branch 'master' of git.sr.ht:~garritfra/taurus
b7cfb3ae — Alexey Yerin 2 years ago
Improve docs & update generate_cert script

- Show accurate defaults
- Make generate_cert executable
- Delete temporary certificate files (everything except identity.pfx)

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
025dda68 — Alexey Yerin 2 years ago
Infer gemini:// scheme in the URL

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
6a1979cb — Alexey Yerin 2 years ago
Nicer logs and logger module

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
02969c64 — Garrit Franke 2 years ago
Add Continuous Integration
a1e82d5e — Alexey Yerin 2 years ago
Trim 0x0 characters & display error message

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
71a6eb03 — Garrit Franke 2 years ago
Use 4096 bit key length for test certs

Fixes a security error on debian machines
Return TaurusError when failing to parse GeminiRequest

This patch adds TaurusError::InvalidRequest` and updates GeminiRequest
to impl FromStr and expose Gemini::parse that will attempt to parse a
string and return an instance of TaurusError::InvalidRequest if an error
occurs - such as the request being malformed, or the url being invalid.

Signed-off-by: Josh Leeb-du Toit <mail@joshleeb.com>
Add TaurusResult type alias

This patch adds the `TaurusResult` type alias, and replaces instances of
`error::TaurusError` with just `TaurusError`.

Signed-off-by: Josh Leeb-du Toit <mail@joshleeb.com>
be28fe5d — Alexey Yerin 2 years ago
Use to_string_lossy on possibly non-Unicode inputs

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
Impl From<native_tls::Error> to TaurusError::InvalidCertificate

This patch adds `#[from]` to `TaurusError::InvalidCertificate` which
means that any `native_tls::Error` can be converted (using `From` and
`Into`) to a `TaurusError::InvalidCertificate`.

From what I can see, [here][native_tls_error_docs], the
`native_tls::Error` type is kind of a catch all for errors from that lib
rather than being broken down into suberrors (like `io::Error`)

[native_tls_error_docs]: https://docs.rs/native-tls/0.2.6/native_tls/struct.Error.html

Signed-off-by: Josh Leeb-du Toit <mail@joshleeb.com>
80455fe1 — Alexey Yerin 2 years ago
Do not duplicate defaults

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
17a0ed06 — Garrit Franke 2 years ago
Add default value to arg
46d6cd23 — Alexey Yerin 2 years ago
Better error handling with enums

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
38933ba3 — Alexey Yerin 2 years ago
Prevent memory leaks

Creating an owned String takes time and space in the heap and should be
done lazily. But in some places error message (which is an owned String)
is created even if there's no errors.
78160a01 — Garrit Franke 2 years ago v0.0.2
v0.0.2
4e2ddb2e — Alexey Yerin 2 years ago
MIME type detection

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
Next