Commit graph

187 commits

Author SHA1 Message Date
Manish Kuniyal
692ac31734
Added Back-to-Top Button in the Readme file (#1142) 2023-07-07 12:15:33 +02:00
Techassi
67af7ef6d3
feat: add support for basic auth per URI (#1110)
* Add support for basic auth per domain
* Move URI matching to link collection phase
* Allow AsRef for BasicAuthExtractor::new to avoid clone
* Add tests

---------

Co-authored-by: Matthias Endler <matthias@endler.dev>
2023-06-26 12:06:24 +02:00
Stefan Kreutz
7dd84f6b7c
Add optional Rustls support (#1099)
* Add optional Rustls support

This commit adds a non-default feature flag to use Rustls instead of OpenSSL.

My personal motivation is to use Lychee on OpenBSD -current, where the
`openssl` crate frequently fails to link against the unreleased system
LibreSSL. Using the `vendored-openssl` feature helps with compilation, but
segfaults at runtime.

The commit adds three feature flags to the library, binary, benchmark, and all
examples:

- The `native-tls` feature flag toggles the `openssl` crate.
- The `rustls-tls` feature flag toggles the `rustls` crate.
- The `email-check` feature flag toggles the `check-if-email-exists` crate,
  which is the only existing functionality currently incompatible with Rustls.

By default, `native-tls` and `email-check` are enabled. Thus, Lychee (bin and
lib) can be used as before unless default features are disabled.

To use the Rustls feature, pass `--no-default-features --features rustls` to
cargo check/build/test/..., e.g.,

    $ cargo clippy --workspace --all-targets --no-default-features \ --features
    rustls-tls -- --deny warnings

Checking email addresses requires both, `native-tls` and `email-check`, to be
enabled. Otherwise, email addresses are excluded.

The `email-check` feature flag is technically not necessary. I preferred it
over `not(rustls-tls)` because it's clearer and it addresses the AGPL license
issue #594. As far as I understand, a Lychee binary compiled without the
`email-check` feature could be distributed with file-based copyleft for the
MPL-licensed dependencies only. But that's out of scope here.

The benchmark shows a performance regression varying between 2% and 4.4% when
using Rustls instead of OpenSSL on my machine.

PS: The `ring` crate needs to be patched on OpenBSD 7.3 and later until the new
xonly patches have been upstreamed, see the `rust-ring` port.

* Use platform native certificates with Rustls

By default, reqwest uses the webpki-roots crate with Rustls, effectively
bundling Mozilla's root certificates.

This commit uses the rustls-native-certs crate instead to use locally
installed root certificates, to minimize the difference between the
native-tls and rustls-tls features.

* Document feature flags
2023-06-16 02:21:57 +02:00
Dariusz Porowski
7a35a655d2
Alpine Docker Image Support (#1074) 2023-05-22 12:36:22 +02:00
Matthias
75e80190fb bump version 2023-05-15 00:25:32 +02:00
Matthias
a7ddcac502 prepare for release 2023-04-17 23:24:11 +02:00
Thomas
994b2852cd
Wayback integration (#1003)
Adds support for suggesting archived URLs for broken links.
Uses Wayback Machine as the archive provider.
2023-03-28 00:45:06 +02:00
Matthias
49d1d3accb update help message 2023-03-03 12:13:09 +01:00
Daniel M. Capella
bd30e0d739
Update name of Arch package (#959) 2023-02-23 10:31:44 +01:00
Matthias Endler
b653a0a1ec
Fix cached 200 status code handling (#958)
* Fix cached 200 status code handling

Assert that code 200 never needs to be explicitly accepted for cached response
to match the behavior of uncached checks

* Bump version to v0.11.1
2023-02-23 00:25:53 +01:00
Matthias Endler
123742a8b4
Bump to v0.11.0 (#957) 2023-02-22 21:35:38 +01:00
dependabot[bot]
6743edd887
Bump clap from 4.0.32 to 4.1.1 (#917)
* Bump clap from 4.0.32 to 4.1.1

Bumps [clap](https://github.com/clap-rs/clap) from 4.0.32 to 4.1.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.0.32...v4.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Update docs

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias <matthias-endler@gmx.net>
2023-01-17 15:08:12 +01:00
Matthias Endler
81fc8608f6
Add scoop (Windows) installation instructions 2022-12-13 00:09:38 +01:00
Matthias
982d978e47
Add different verbosity levels (#824)
More granular verbosity levels have been asked
for repeatedly.
To enable that we're moving to [env_logger] and [clap-verbosity-flag]
to provide more flexible verbosity settings.

Also tackles #661, #709
Lays the groundwork for tackling #268

https://github.com/rust-cli/env_logger
https://github.com/clap-rs/clap-verbosity-flag
2022-11-28 23:25:33 +01:00
dependabot[bot]
2ce1a9ae06
Bump clap from 3.2.23 to 4.0.22 (#813)
* Bump clap from 3.2.23 to 4.0.22

Bumps [clap](https://github.com/clap-rs/clap) from 3.2.23 to 4.0.22.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.23...v4.0.22)

* The `headers` option got renamed to `header` to align with the rest
   of the options, which are singular.
* The short option for `header` (`-h`) was removed to avoid a conflict with
  help (`lychee -h`).
* Update and simplify readme check

Co-authored-by: Matthias <matthias-endler@gmx.net>
2022-11-13 21:10:32 +01:00
Matthias
fbf0e9faea
Fix typo 2022-11-13 13:50:11 +01:00
Petr Ruzicka
6bb5525abb
Add note about lychee.toml and exclude_path to README.md (#823)
Fix #822
2022-11-11 18:27:26 +01:00
Matthias
0e929f9b4c Bump version 2022-11-08 23:48:21 +01:00
Matthias
5ebb3fff6e
Bump Version (#811) 2022-11-06 00:21:00 +01:00
Matthias
9315aa0a8a
Update badge name 2022-11-03 11:12:24 +01:00
Jakub Wilk
ffb57fa202
Fix syntax highlighting in README (#792)
The help message was highlighted as if it was a gitignore file.
Let's disable this spurious syntax highlighting.
2022-10-24 15:59:04 +02:00
Andy Grunwald
a67b513238
Extend description of "--exclude" to also exclude email addresses, not only URLs (#801) 2022-10-23 12:17:20 +02:00
Matthias
3c22d41cc3
Mention CONTRIBUTING.md in README 2022-08-14 02:10:11 +02:00
Matthias
34d3955140
Add link to new homepage 2022-08-14 00:51:42 +02:00
Matthias
cbd936960a
Move from structopt to clap (#732)
Structopt was subsumed by clap. See
https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#migrating
2022-08-12 22:53:13 +02:00
Sebastian Spier
bccb082759
Listing InnerSourceCommons/InnerSourcePatterns as user (#730)
The repo https://github.com/InnerSourceCommons/InnerSourcePatterns is using lychee as a link checker since a couple of days.
(we found the recommendation for it in the liche repo)

I wasn't clear if we should add the new user/repo at top or bottom of the list.
Went for the top :)

Thank you for this great tool!
2022-08-12 13:54:05 +02:00
Matthias
601adcefd3
Add new SVG-based screencast (#693)
This is taken from https://github.com/sharkdp/fd, so all credits
go to the original authors.

The demo was a bit dated. We've since added more features and
changed the output. On top of that, the gif was a bit blurry.

The new version is in SVG and the commands can be scripted, so
we can change them with a PR and render them through CI.

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2022-08-10 17:35:50 +02:00
Matthias
b76285c193
Bump version (#703) 2022-07-27 10:48:36 +02:00
Matthias
aa931b8c00
Mention other file formats 2022-07-21 00:04:53 +02:00
Matthias
c89911d161
Update documentation around excluding links 2022-05-31 17:48:56 +02:00
Matthias
b40aacd459
Prepare for release v0.10.0 (#629) 2022-05-30 23:02:18 +02:00
Matthias
22fecfc056
Add support for URI remapping (#620)
Remaps allow mapping from a URI pattern to a different URI.

The syntax is

```
lychee --remap 'https://example.com http://127.0.0.1'
```

Some use-cases are
- Testing URIs prior to production deployment
- Testing URIs behind a proxy

Be careful when using this feature because checking every link against a
large set of regular expressions has a performance impact. Also there are no
constraints on the URI mapping, so the rules might contradict with each
other.
Remap rules get applied in order of definition to every input URI.
2022-05-29 21:41:22 +02:00
Matthias
363b95fe5f
Add support for excluding paths from link checking (#623)
This change deprecates `--exclude-file` as it was ambiguous.
Instead, `--exclude-path` was introduced to support excluding paths
to files and directories that should not be checked.
Furthermore, `.lycheeignore` is now the only way
to exclude URL patterns.
2022-05-29 17:27:09 +02:00
Matthias
d616177a99
Implement excluding code blocks (#523)
This is done in the extractor to avoid unnecessary
allocations.
2022-03-26 10:42:56 +01:00
Matthias
328c96576d
Bump version to v0.9.0 (#560) 2022-03-22 13:43:49 +01:00
Matthias
35c40f6398
Add Docker pulls label (#550) 2022-03-11 22:42:23 +01:00
Matthias
4699a97f83
Add links badge 2022-03-07 00:51:14 +01:00
Matthias
05bd3817ee
Make retry wait time configurable (#525) 2022-02-24 12:24:57 +01:00
Matthias
a5a56006dd
Remove background from logo (#526)
The new version is meant to be less introdusive.
It should still work on white and black backgrounds.
2022-02-24 12:22:30 +01:00
Matthias
812663d832
Prevent flaky tests (#514)
Move from example.org to example.com, which seems to be more permissive for testing
2022-02-18 10:29:49 +01:00
Matthias
47df7780fe
Use captured identifiers in format strings (#507)
Makes for arguably cleaner-looking code.
The downside is that the MSRV is 1.58
https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html

Given that nobody uses lychee as a library yet
and we have precompiled binaries, it's an acceptable
tradeoff.
My little research revealed that this is a much-liked
feature: https://twitter.com/matthiasendler/status/1483895557621960715
2022-02-12 10:51:52 +01:00
Matthias
58b17b2252
Update link to troubleshooting guide 2022-02-04 12:05:59 +01:00
Matthias
04f9b7c23b
Add additional parameters for Docker usage example 2022-01-27 12:43:34 +01:00
Matthias
4630216c30 Add description for max-cache-age flag 2022-01-14 16:55:56 +01:00
Matthias
ac490f9c53
Add caching functionality (v2) (#443)
A while ago, caching was removed due to some issues (see #349).
This is a new implementation with the following improvements:

 * Architecture: The new implementation is decoupled from the collector, which was a major issue in the last version.    Now the collector has a single responsibility: collecting links. This also avoids race-conditions when running multiple collect_links instances, which probably was an issue before.
* Performance: Uses DashMap under the hood, which was noticeably faster than Mutex<HashMap> in my tests.
* Simplicity: The cache format is a CSV file with two columns: URI and status. I decided to create a new struct called CacheStatus for serialization, because trying to serialize the error kinds in Status turned out to be a bit of a nightmare and at this point I don't think it's worth the pain (and probably isn't idiomatic either).

This is an optional feature. Caching only gets used if the `--cache` flag is set.
2022-01-14 15:25:51 +01:00
Matthias
92b939eb2f
Update README.md 2022-01-13 13:11:55 +01:00
Matthias
3b060c80dc
Update README.md 2022-01-10 21:03:30 +01:00
Matthias
0645177b84
Bump version (#450) 2022-01-10 01:38:46 +01:00
Matthias
21f3160b71
Make retries configurable; align constants (#446)
Using the same default values for the library and the
binary now but tweaked the values a bit for slightly faster performance.
2022-01-07 01:03:10 +01:00
Matthias
9f8e496a8d
Add Azure/ResourceModules 2021-12-20 22:50:19 +01:00