aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsrproxy/src/config.rs
Commit message (Collapse)AuthorAgeFilesLines
* added Unix Socket supportpryty262026-07-011-21/+58
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-hsrproxy: migrate to derive_deftly(TorConfig)Nick Mathewson2026-02-171-28/+7
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | 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.
* 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.
* tor-hsrproxy: Export a connection count metricIan Jackson2025-04-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 > ```
* Fix AF_UNIX terminology in docs, comments, and error messagesIan Jackson2025-03-241-1/+1
|
* 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
|
* 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-161-6/+19
| | | | | | | | 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
* 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-111-4/+9
|\ | | | | | | | | Resolve several TODO HSS items in hsrproxy See merge request tpo/core/arti!1809
| * 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: 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.
* 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.
* | hsrproxy: add a note about a future warning.Nick Mathewson2023-10-041-0/+2
|/
* hsrproxy: Make configs and builders implement more traits.Nick Mathewson2023-10-031-2/+6
|
* hsrproxy: Start to sketch out an rproxy implementation.Nick Mathewson2023-09-271-0/+11
|
* hsrproxy: rename Direct => Simple.Nick Mathewson2023-09-191-21/+24
|
* hss: Rename ProxyTarget to ProxyAction.Nick Mathewson2023-09-191-16/+16
|
* hsproxy: Revise configuration based on discussionNick Mathewson2023-09-191-41/+95
| | | | | | | We now have a single ProxyTarget action for the case where we accept a request and forward it: `Forward`. It takes an encapsulation method (currently only "direct") and a target address which can be inet or unix.
* hsrproxy: test actual outputs of builder.Nick Mathewson2023-09-191-1/+10
|
* hsproxy: reject configurations with unreachable patterns.Nick Mathewson2023-09-191-3/+52
| | | | | | | This implementation uses rangemap to detect _all_ unreachable patterns, which might be a little overkill, but it's actually simpler to write it this way than to use an O(N^2) search to make sure that no pattern is covered by a _single_ previous pattern.
* hsrproxy: Say "one", not "single" to avoid confusion.Nick Mathewson2023-09-191-1/+1
|
* hsrproxy: repair emptyportrange behaviorNick Mathewson2023-09-071-0/+2
|
* hsproxy: add TODO link to thread.Nick Mathewson2023-09-071-0/+3
|
* hsprproxy: add note about possible validation stepNick Mathewson2023-09-071-0/+2
|
* hsrproxy: tests for (not accepting) legacy ipv4 formatsNick Mathewson2023-09-071-0/+17
|
* hsrproxy: Add todos about udp and haproxyNick Mathewson2023-09-071-1/+9
|
* hsrproxy: Refactor ProxyPattern to use RangeInclusive.Nick Mathewson2023-09-071-50/+33
| | | | | Also, allow nonempty ranges starting with 0- and implement Eq and PartialEq.
* hsrproxy: Make config member pub(crate).Nick Mathewson2023-09-071-1/+1
|
* hsrproxy: implement builders and serde.Nick Mathewson2023-09-071-5/+70
|
* hsrproxy: implement parse/encode for patterns and targets.Nick Mathewson2023-09-071-5/+256
|
* Create a tor-hsrproxy crate to handle "proxy to local port".Nick Mathewson2023-09-071-0/+50
I'm calling this a "reverse proxy" since I think a lot of folks like that terminology, though I'm not personally a huge fan. Calling it "`tor-hsproxy`" would IMO confuse people more about what kind of proxy it was. This is a separate crate from `tor-hsservice` because it's logically at a different level: if you're writing a little embedded onion service, you don't need this code. Right now there is only configuration logic here.