aboutsummaryrefslogtreecommitdiff
path: root/crates/arti
Commit message (Collapse)AuthorAgeFilesLines
...
| * RPC: Add experimental method to list SOCKS proxies.Nick Mathewson2024-08-285-16/+135
| | | | | | | | | | | | | | We'll need this for our rpc-library code to meaningfully open SOCKS connections. Closes #1523.
| * arti: Define a new ArtiRpcSession type.Nick Mathewson2024-08-284-4/+81
| | | | | | | | | | | | | | This type exists in the `arti` crate. It wraps and delegates to `arti_rpcserver::RpcSession`. Subsequent commits will use it to expose information from the `arti` crate to the RPC system; right now it does nothing.
* | tor-config: Rename watch_file to watch_path.Gabriela Moldovan2024-08-271-1/+1
|/ | | | `FileWatcher::watch_file` can be used with arbitrary paths.
* Merge branch 'ci' into 'main'Ian Jackson2024-08-272-1/+5
|\ | | | | | | | | Run tests of every crate, with all features disabled See merge request tpo/core/arti!2350
| * Add script for *testing* without any features enabledIan Jackson2024-08-191-0/+3
| | | | | | | | | | | | | | | | | | We can't do this for every crate. I looked at what is now matrix-check to see if I wanted to use any of the code. But it seems too entangled with its particular purpose, and has a lot of embedded knowledge of our crates' features. I found it sufficiently far from what I wanted that I decided on a fresh script.
| * arti: Fix an unused Result in tests if pts disabledIan Jackson2024-08-191-1/+2
| | | | | | | | | | Fixes compilation with cargo test --no-default-features -p arti --features=tokio,rustls
* | arti: Temporarily disable a flaky test.Gabriela Moldovan2024-08-221-0/+1
| | | | | | | | Disabling until #1549 is fixed to unblock CI.
* | arti: Use a postage::watch channel in the tests.Gabriela Moldovan2024-08-222-15/+24
| | | | | | | | | | | | | | | | The watch channel should help prevent flakiness in the tests (`TestModule` uses `maybe_send` to only send the received config if it's different from the previously received value. This is supposed to prevent the tests from failing when duplicate update events are received).
* | arti: Add test for config reloading.Gabriela Moldovan2024-08-212-0/+175
| |
* | arti: Wrap long lines not handled by rustfmt.Gabriela Moldovan2024-08-211-2/+14
| |
* | tor-hsservice: Pass watch_configuration down to restricted discovery config.Gabriela Moldovan2024-08-211-7/+23
| | | | | | | | | | | | We need to know if `watch_configuration` is set in the descriptor publisher reactor to know whether we should be watching the `restricted_discovery.key_dirs` directories.
* | tor-config: Support watching dirs for files with a given extension.Gabriela Moldovan2024-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This also fixes a couple of issues with the previous implementation: * it enables you to watch for more than just one file/extension per directory (each directory now has a list of filters. If any of the filters apply to the path contained in the notify::Event, the `FilterWatcher` notifies the listeners * it removes the list watched files from `FileWatcher`. This makes things a lot simpler to grok: essentially, the file watcher only ever watches directories, notifying if an "interesting" file was changed (in our case, the interesting files are files that have a relevant extension, such as `.auth`, or specific configuration files, as specified by `ConfigurationSources`).
* | tor-config: Make FileWatcher use an opaque channel type.Gabriela Moldovan2024-08-211-89/+106
| | | | | | | | The `FileWatcher` now uses a `postage::watch` channel under the hood.
* | tor-config: Give FileWatcherBuilder a handle to the runtime.Gabriela Moldovan2024-08-211-5/+6
| | | | | | | | | | The event handler will soon be made async, so we need a handle to the runtime.
* | tor-config: Move FileWatcher to tor-config.Gabriela Moldovan2024-08-211-185/+22
| | | | | | | | | | | | | | | | | | For the most part, this is just code motion. The only change here is that `prepare` is no longer a method on `FileWatcher`. This decouples `FileWatcher` from `ConfigurationSources`, enabling us to use it to watch files and directories that aren't configuration.
* | arti: Update outdated FileWatcher docs.Gabriela Moldovan2024-08-211-5/+1
|/ | | | | The `FileWatcher` doesn't contain the channel for receiving events anymore, and `FileWatcher::event_matched` was removed at some point.
* Merge branch '1144-std-backtrace' into 'main'David Goulet2024-08-122-6/+3
|\ | | | | | | | | | | | | Use std::backtrace instead of backtrace crate Closes #1144 See merge request tpo/core/arti!2301
| * Match previous backtrace formattingRobin Leander Schröder2024-08-081-2/+2
| | | | | | | | | | std::backtrace::Backtrace's Display looks the same as backtrace_rs::Backtrace's Debug
| * Use std::backtrace instead of backtrace crateRobin Leander Schröder2024-08-012-4/+1
| | | | | | | | | | Removes resolve_backtraces from rtmock since it is no longer needed as stdlib's backtraces automatically lazily resolve without needing a &mut.
* | Merge branch 'docsrs' into 'main'Jim Newsome2024-08-071-1/+0
|\ \ | | | | | | | | | | | | | | | | | | Don't need to tell docs.rs to enable `docsrs` cfg. It does it automatically as of https://github.com/rust-lang/docs.rs/pull/2390#event-11664409098 While this change isn't in our MSRV yet, we were only using this when building for docs.rs, where we use the latest anyway. See merge request tpo/core/arti!2308
| * | Don't need to tell docs.rs to enable `docsrs` cfgKunal Mehta2024-08-021-1/+0
| | | | | | | | | | | | | | | It now does it automatically, see <https://docs.rs/about/builds#detecting-docsrs>.
* | | arti: Add the restricted_discovery configuration to the example config.Gabriela Moldovan2024-08-052-9/+94
| | | | | | | | | | | | This also adds a test for it.
* | | tor-hsservice: Add restricted discovery configuration.Gabriela Moldovan2024-08-051-1/+1
| | |
* | | arti: Avoid using the now-deprecated arti_client constant.Gabriela Moldovan2024-08-051-2/+2
| | | | | | | | | | | | We can just used `build_for_arti()` here.
* | | tor-hsservice: Add a restricted-discovery feature.Gabriela Moldovan2024-08-051-1/+2
| | | | | | | | | | | | | | | | | | | | | Restricted discovery mode is initially going to be gated behind the experimental `restricted-discovery` feature. Part of #1292
* | | doc: Add arti hsc subcommand docs to doc/hsc.md.Gabriela Moldovan2024-08-051-28/+1
| | | | | | | | | | | | | | | This also makes the `tests/testcases/hsc/hsc.md` test case a symlink to `doc/hsc.md`.
* | | arti: Update the hsc markdown test.Gabriela Moldovan2024-08-051-3/+19
| | | | | | | | | | | | | | | | | | | | | This adds a bit more information to `hsc.md`. Note: `hsc.md` is currently just a test case for the CLI tests. A future commit promote it to module-level README.
* | | arti: Elide the -c help in the expected output of the CLI tests.Gabriela Moldovan2024-08-051-2/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | The help output of the `-c ` option includes some local paths, which can be quite long on some platforms, spanning over multiple lines. This causes the CLI tests to fail, because they expect each of the paths from the `-c` help to fit on a single line. To fix this, we can use `trycmd`'s `...` to match as many lines as needed. Closes #1509
* | Have `arti hss onion-name` error if it doesn't print the onion nameKunal Mehta2024-08-012-4/+7
| | | | | | | | | | | | | | There are two error cases where the onion name isn't printed, but previously returned `Ok(())`. It now returns an error to exit with a non-zero status code.
* | Bump "arti" crate to 1.2.6Nick Mathewson2024-08-011-1/+1
| | | | | | | | | | | | | | | | Done with ``` cargo set-version --bump patch -p arti ```
* | Bump versions for tor- and arti- crates to 0.21.0Nick Mathewson2024-08-011-10/+10
| | | | | | | | | | | | | | | | | | | | This is the result of: ``` for crate in $( ./maint/list_crates |grep '^\(tor\|arti-\)' ); do cargo set-version -p $crate 0.21.0 done ```
* | Run "fixup-features".Nick Mathewson2024-08-011-1/+1
|/
* Merge branch 'cli-tests' into 'main'gabi-2502024-07-3131-0/+305
|\ | | | | | | | | | | | | arti: Add tests for the hss/hsc subcomands Closes #1250 See merge request tpo/core/arti!2275
| * arti: Add tests for the arti hsc subcommand.Gabriela Moldovan2024-07-3020-0/+146
| |
| * arti: Add tests for the arti hss subcommand.Gabriela Moldovan2024-07-3012-0/+159
| | | | | | | | Closes #1250
* | arti: Use Path::try_exists() instead of Path::exists().Gabriela Moldovan2024-07-301-1/+1
|/
* arti: Gate the hsc subcommand behind the keymgr feature (fmt).Gabriela Moldovan2024-07-102-2/+10
|
* arti: Gate the hsc subcommand behind the keymgr feature.Gabriela Moldovan2024-07-102-4/+4
| | | | | | | | | | | The `arti hsc` subcommand can't run without keymgr support. Previously, it relied on `tor-keymgr/keymgr` being enabled indirectly by its dependencies, via the `experimental` feature. We need to be able to enable this feature in `arti` without relying on `experimental` (because `arti hsc` will eventually be made non-experimental). Part of #1487
* arti: Add a keymgr feature.Gabriela Moldovan2024-07-101-1/+2
| | | | | | | Adding a `keymgr` feature here will enable us to detect if `arti` is running without keymgr support. This is needed for the correct handling of subcommands that require keymgr support (such as the `arti hsc` subcommand).
* tor-hscrypto: Remove unnecessary Display wrapper.Gabriela Moldovan2024-07-081-1/+1
| | | | | | | | | | | I don't think we need a separate wrapper type for displaying `HsClientDescEncKey` keys in the "C Tor format" (`<auth-type>:<key-type>:<base32-encoded-public-key>`). I think this should be the canonical string representation of `HsClientDescEncKey`, so I'm removing the `display_authorized_client` function and corresponding `DisplayAuthorizedHsClientDescEncKey` wrapper type.
* Merge branch 'warnings' into 'main'Ian Jackson2024-07-081-1/+1
|\ | | | | | | | | Fix or allow warnings that show up in beta See merge request tpo/core/arti!2244
| * Work around clippy::doc_lazy_continuation false positivesIan Jackson2024-07-081-1/+1
| | | | | | | | | | | | | | See https://github.com/rust-lang/rust-clippy/issues/13001 I think it's OK to change this in our tree, nevertheless.
* | Fix markdown quoting.Ian Jackson2024-07-081-1/+1
|/ | | | | | | | | | | | Fixes: warning: unclosed HTML tag `FILE` --> crates/arti/src/subcommands/hsc.rs:56:33 | 56 | /// Write the public key to <FILE>. Use - to write to stdout | ^^^^^^ | = note: `#[warn(rustdoc::invalid_html_tags)]` on by default
* arti: Rewrite the hsc prepare-service-discovery-key command (fmt).Gabriela Moldovan2024-06-271-11/+6
|
* arti: Rewrite the hsc prepare-service-discovery-key command.Gabriela Moldovan2024-06-271-10/+30
| | | | | | | The `arti hsc prepare-service-discovery-key` command is now `arti hsc get-key [--key-type=service-discovery]`. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2212#note_3042903
* arti: Add an arti hsc subcommand.Gabriela Moldovan2024-06-274-1/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an experimental `arti hsc` subcommand for managing client state and keys. Currently, it only supports the `prepare-service-discovery-keys` operation described in #1281 and `doc/dev/notes/client-auth.md`. A note on terminology: I am referring to services that encrypt the second layer of their descriptor as running in "restricted discovery" mode (because they can only be discovered, i.e. have their IPT points found out, by a set of authorized clients). The corresponding client "auth" keys, being the keys that enable the client to find out the list of intro points, pow-params etc. of the service, are referred to as service "discovery keys". Alternative names I considered: * extra descriptor encryption: accurate, but overly technical. IMO, the CLI should be accessible to users who aren't familiar with the nitty-gritty of the protocol * shielded mode: good, but slightly misleading. Calling it "shielded mode" makes it sound like a universally desirable "extra protection" that should almost always be enabled (which is not the case). Seeing `shielded_mode = off` in the config might be worry operators that don't fully understand what "extra descriptor encryption" or "shielded mode" means * restricted mode: slightly inaccurate. It implies this mechanism is a good substitute for conventional service-side authentication, which it isn't (because client authorization isn't instantaneous) Closes #1281
* Update arti to 1.2.5Ian Jackson2024-06-271-1/+1
| | | | cargo set-version --offline -p arti 1.2.5
* Update versions of 0.x tor-* and arti-* cratesIan Jackson2024-06-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nailing-cargo -uE set-version -p arti-client 0.20.0 nailing-cargo -uE set-version -p arti-relay 0.20.0 nailing-cargo -uE set-version -p arti-rpcserver 0.20.0 nailing-cargo -uE set-version -p tor-async-utils 0.20.0 nailing-cargo -uE set-version -p tor-basic-utils 0.20.0 nailing-cargo -uE set-version -p tor-bytes 0.20.0 nailing-cargo -uE set-version -p tor-cell 0.20.0 nailing-cargo -uE set-version -p tor-cert 0.20.0 nailing-cargo -uE set-version -p tor-chanmgr 0.20.0 nailing-cargo -uE set-version -p tor-checkable 0.20.0 nailing-cargo -uE set-version -p tor-circmgr 0.20.0 nailing-cargo -uE set-version -p tor-config 0.20.0 nailing-cargo -uE set-version -p tor-consdiff 0.20.0 nailing-cargo -uE set-version -p tor-dirclient 0.20.0 nailing-cargo -uE set-version -p tor-dirmgr 0.20.0 nailing-cargo -uE set-version -p tor-error 0.20.0 nailing-cargo -uE set-version -p tor-geoip 0.20.0 nailing-cargo -uE set-version -p tor-guardmgr 0.20.0 nailing-cargo -uE set-version -p tor-hsclient 0.20.0 nailing-cargo -uE set-version -p tor-hscrypto 0.20.0 nailing-cargo -uE set-version -p tor-hsrproxy 0.20.0 nailing-cargo -uE set-version -p tor-hsservice 0.20.0 nailing-cargo -uE set-version -p tor-keymgr 0.20.0 nailing-cargo -uE set-version -p tor-linkspec 0.20.0 nailing-cargo -uE set-version -p tor-llcrypto 0.20.0 nailing-cargo -uE set-version -p tor-log-ratelim 0.20.0 nailing-cargo -uE set-version -p tor-memquota 0.20.0 nailing-cargo -uE set-version -p tor-netdir 0.20.0 nailing-cargo -uE set-version -p tor-netdoc 0.20.0 nailing-cargo -uE set-version -p tor-persist 0.20.0 nailing-cargo -uE set-version -p tor-proto 0.20.0 nailing-cargo -uE set-version -p tor-protover 0.20.0 nailing-cargo -uE set-version -p tor-ptmgr 0.20.0 nailing-cargo -uE set-version -p tor-relay-selection 0.20.0 nailing-cargo -uE set-version -p tor-rpcbase 0.20.0 nailing-cargo -uE set-version -p tor-rtcompat 0.20.0 nailing-cargo -uE set-version -p tor-rtmock 0.20.0 nailing-cargo -uE set-version -p tor-socksproto 0.20.0 nailing-cargo -uE set-version -p tor-units 0.20.0 Each of which runs a rune like cargo set-version --offline -p tor-units 0.20.0
* Merge branch 'feat' into 'main'gabi-2502024-06-251-0/+1
|\ | | | | | | | | Run maint/fixup-features See merge request tpo/core/arti!2229
| * Fix formatting anomaly introduced by fixup-featuresIan Jackson2024-06-251-1/+2
| |