summaryrefslogtreecommitdiff
path: root/crates/tor-hsrproxy/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-062-2/+2
| | | | Run maint/add_warning
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-2/+1
|
* Replace copy_interactive with futures-copy.Nick Mathewson2025-10-301-72/+25
| | | | | | | | This change lets us avoid spawning extra tasks (due to one-direction nature of copy_interactive), and avoid some lock contention (due to use of AsyncReadExt::split). Addresses part of #786.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* proto: Move the `stream` module under `client` (breaking).Gabriela Moldovan2025-08-181-1/+1
| | | | | | | | | | | | The `stream` module is client-specific, for the most part, so I am moving it under `client`. Later on, we will factor out the parts that can be shared with the relay implementation. Note: this is a breaking change as the deleted `stream` module was `pub`. We could've kept the module and reexported from it the public types from `tor_proto::client::stream`, but I think it's better to have this `client` namespacing, because it makes the separation between the client and relay parts clearer.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-072-4/+4
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* metrics: Discuss schema stability (currently, "no")Ian Jackson2025-04-081-0/+3
|
* tor-hsrproxy: config: make ProxyActionDiscriminants privateIan Jackson2025-04-081-0/+1
| | | | | beta clippy pointed out that it shouldn't be exhaustive. but `#[strum_discriminants(non_exhaustive)]` is rejected.
* metrics: tor-hsrproxy: Use a bespoke type for counter outcomesIan Jackson2025-04-081-5/+19
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2918#note_3185872
* tor-hsrproxy: Add allow(unused) if features not all enabledIan Jackson2025-04-081-0/+3
| | | | This avoids warnings from failure to cfg-decorate imports.
* tor-hsrproxy: Export a connection count metric (fmt)Ian Jackson2025-04-081-1/+3
|
* tor-hsrproxy: Export a connection count metricIan Jackson2025-04-082-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | This proves the concept. Many more metrics will need to be added throughout the codebase. With this compiled in and enabled, I see this with curl: > ``` > # TYPE arti_hss_proxy_connections_failed_total counter > arti_hss_proxy_connections_failed_total{nickname="ztest",action="destroy_circuit"} 0 > arti_hss_proxy_connections_failed_total{nickname="ztest",action="ignore_stream"} 0 > arti_hss_proxy_connections_failed_total{nickname="ztest",action="forward"} 0 > arti_hss_proxy_connections_failed_total{nickname="ztest",action="reject_stream"} 0 > > # TYPE arti_hss_proxy_connections_total counter > arti_hss_proxy_connections_total{nickname="ztest",action="reject_stream"} 0 > arti_hss_proxy_connections_total{nickname="ztest",action="forward"} 1 > arti_hss_proxy_connections_total{nickname="ztest",action="destroy_circuit"} 0 > arti_hss_proxy_connections_total{nickname="ztest",action="ignore_stream"} 0 > > # TYPE arti_hss_proxy_connections_ok_total counter > arti_hss_proxy_connections_ok_total{nickname="ztest",action="destroy_circuit"} 0 > arti_hss_proxy_connections_ok_total{nickname="ztest",action="reject_stream"} 0 > arti_hss_proxy_connections_ok_total{nickname="ztest",action="ignore_stream"} 0 > arti_hss_proxy_connections_ok_total{nickname="ztest",action="forward"} 1 > ```
* tor-hsrproxy: Move cloning into spawnIan Jackson2025-04-081-12/+12
| | | | | This means that we can use the same variable names for the clones, which is considerably less confusing.
* Fix AF_UNIX terminology in docs, comments, and error messagesIan Jackson2025-03-241-1/+1
|
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-1/+1
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Apply import alphabetisation churnIan Jackson2024-04-031-1/+1
|
* Switch to derive-deftlyIan Jackson2024-04-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the combination of a number of separate commits, many of which were generated by seddery, and then rebased and squashed. Cargo.toml perl -i~ -pe 's{^derive-adhoc}{derive-deftly = "0.10"}' crates/*/Cargo.toml (not regenerated during rebase) update Cargo.lock `cargo fetch` without --locked (regenerated during rebase) seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{^use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bdefine_derive_adhoc\b}{define_derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bAdhoc\b}{Deftly}g if m{derive}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[derive_adhoc\b}{#[derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc\b}{derive_deftly_adhoc} if m{use.*deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc!}{derive_deftly_adhoc!}' (not regenerated during rebase) Manually add `#[derive_deftly_adhoc]` where needed. seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[adhoc\b}{#[deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc_template}{derive_deftly_template}' (not regenerated during rebase) Manually fix up an import Manually update some builder attrs Manually fix up tor_rtmock::time_core This was missed in my seddery, due to me rebasing the branch and not redoing the seddery.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* hsproxy: Improve error messages.Nick Mathewson2024-02-081-22/+34
| | | | | | | | When giving an error message about an hsrproxy configuration: 1) mention that this is for an onion service. 2) mention what the invalid text was. Part of #1266
* hsrproxy: Temporarily remove ability to config unix addressesNick Mathewson2024-01-162-10/+24
| | | | | | | | I'm taking this out for now since we don't have support for actually making these addresses work, and the current behavior will just ignore connections silently. Closes #1245
* hsrproxy: downgrade remaining TODO HSS comments.Nick Mathewson2024-01-091-2/+2
|
* Add NOTEs about similar code for address types.Nick Mathewson2023-12-121-0/+4
|
* hsproxy: warn on some dubious configurationsNick Mathewson2023-12-121-8/+42
| | | | | | | Specifically, warn about non-private target addresses and onion services with no forwarding rules at all. Removes some TODO HSS comments and closes #1154.
* Merge branch 'todo_hsrproxy' into 'main'Nick Mathewson2023-12-112-33/+50
|\ | | | | | | | | Resolve several TODO HSS items in hsrproxy See merge request tpo/core/arti!1809
| * Apply 1 suggestion(s) to 1 file(s)Ian Jackson2023-12-111-0/+2
| |
| * hsrproxy: replace "TODO HSS" instances with references to #1154Nick Mathewson2023-12-071-3/+8
| | | | | | | | | | (These are the ones about warning on questionable configuration choices.)
| * hsproxy: Downgrade a TODO.Nick Mathewson2023-12-071-1/+1
| | | | | | | | | | "We might someday want to do X" does not really rise to the level of a "must-fix".
| * hsrproxy: Log rate-limited failures of other types as wellNick Mathewson2023-12-071-22/+18
| | | | | | | | | | We separate these from our failures to connect to a local proxy, since that is a much more common error.
| * hsproxy: remove TODO about retroactive limitsNick Mathewson2023-12-071-1/+1
| | | | | | | | | | See arti#1153 for followup work here. The current behavior is IMO a decent default.
| * hsrproxy: Remove TODO about empty Connected messagesNick Mathewson2023-12-071-1/+0
| | | | | | | | See torspec!237
| * hsproxy: Add a rate-limited log for forwarding errors.Nick Mathewson2023-12-071-5/+9
| |
| * hsrproxy: Take nickname as an argument and pass it to forwarding functionNick Mathewson2023-12-071-4/+15
| | | | | | | | We'll use this for logging.
* | hsrproxy: Add a test for the contents of a parsed configuration.Nick Mathewson2023-12-111-1/+34
|/
* hsrproxy: Allow ports to be specified as integersNick Mathewson2023-11-291-5/+23
| | | | | | Previously, we required the user to specify a pattern matching a single port as `"80"`, with quotes. Now we allow the user to omit the quotes.
* Revert "hsrproxy: Temporarily change the format of ProxyRule."Nick Mathewson2023-11-291-76/+6
| | | | | | | | | | | This reverts commit 21605d2c9e601c3a5099bfd8d8c887cbb3b36c0a. We're doing this because we wanted the configuration of proxy rules to be a 2-tuple, as in `[ "22", "127.0.0.1:22" ]`. But `config` couldn't handle that before, so we temporarily changed it to a string, as in "22 => 127.0.0.1:22". Closes #1058.
* hsrproxy: Document what we check about begin messagesNick Mathewson2023-10-231-1/+2
| | | | | | | Specifically, we check nothing except the port. This matches the behavior of C-tor and the documentation in torspec!179.
* hsrproxy: Send back DONE reasons.Nick Mathewson2023-10-231-3/+3
| | | | | This is in keeping with the behavior of C tor, and of torspec!179.
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-3/+3
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-hsrproxyIan Jackson2023-10-111-1/+2
|
* Merge branch 'configure_onion_service_part2' into 'main'Nick Mathewson2023-10-111-2/+92
|\ | | | | | | | | Non-working attempt to test onion service configuration. See merge request tpo/core/arti!1640
| * hsrproxy: Temporarily change the format of ProxyRule.Nick Mathewson2023-10-101-6/+76
| | | | | | | | | | | | | | | | | | Since config-rs has a bug breaking its support for nested arrays (see discussion at !1640), we're temporarily changing the format to a single string with a "=>" in the middle. I've opened #1058 to put things back as they were once config-rs is fixed.
| * Non-working attempt to test onion service configuration.Nick Mathewson2023-10-031-0/+20
| | | | | | | | | | | | | | The problem here is that, for some reason, the proxy_rule configuration doesn't actually work. I suspect a bug in Flatten, since the same configuration works fine if you pass it to the hsrproxy config directly.
* | Note reconfigure limitations.Nick Mathewson2023-10-051-0/+4
| |
* | hsrproxy: Add "how" to reconfigure.Nick Mathewson2023-10-051-1/+9
| | | | | | | | Our reconfigure methods take these by convention.
* | hsrproxy: add a note about a future warning.Nick Mathewson2023-10-041-0/+2
|/