summaryrefslogtreecommitdiff
path: root/crates/arti/src
Commit message (Collapse)AuthorAgeFilesLines
...
* rpc: More specificity surrounding SOCKS-rpc integrationNick Mathewson2024-09-091-2/+25
|
* Suggestion about describing non-RPC behavior of SOCKS protocol from @diziet.Nick Mathewson2024-09-091-1/+3
|
* arti/rpclib: Tweak proxy_info format.Nick Mathewson2024-09-092-2/+4
| | | | | | | Renamed address to tcp_address, and made it optional, so that later we can have a unix_path, etc. On deser side, add support for unrecognized listener types.
* arti/rpclib: Lowercase our socks5 listener variant.Nick Mathewson2024-09-091-0/+1
|
* arti: Add a comment explaining how RPC and SOCKS interactNick Mathewson2024-09-091-0/+181
| | | | | | | | | This belongs in a spec, but adding things to a spec is slow and fraught. Instead we'll put it here for now and move it later. There are some XXXXs about "finalizing" the design that we need to resolve before we can merge !2373 and implement stream creation in `arti-rpc-client-core`.
* arti: add and document get_rpc_proxy_info method.Nick Mathewson2024-09-091-2/+38
| | | | | | | | Currently this behaves the same as get_proxy_info, but this may change in the future, if we introduce RPC-unsuitable proxy ports. (Also rename the get_proxy_info method to avoid x_ prefix.)
* arti: Temporarily disable a flaky test.Ian Jackson2024-09-051-0/+1
| | | | | | | | This effectively reverts 71e3d52f5aeb34ca7bca80053079a8c7505b99ac, which was itself a revert of disabling this test the first time. Sadly it still doesn't seem to be reliable. We have agreed on IRC to disable it for now.
* Merge branch 'slow-test' into 'main'Ian Jackson2024-09-051-2/+15
|\ | | | | | | | | | | | | arti: Make the config watcher debounce interval configurable. Closes #1589 See merge request tpo/core/arti!2387
| * arti: Make the config watcher debounce interval configurable (fmt).Gabriela Moldovan2024-09-041-1/+9
| |
| * arti: Make the config watcher debounce interval configurable.Gabriela Moldovan2024-09-041-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the `reload_cfg::test::watch_multiple` test would take about 3s to run. This test modifies 3 files and waits for the corresponding `reconfigure()` events to fire. Because of the `sleep(DEBOUNCE_INTERVAL)` in `run_watcher`, it would wind up waiting for about 1s for each of them. This makes the event debouncing optional, and disables it in the tests. Closes #1589
* | Merge branch 'reload-cfg-test' into 'main'David Goulet2024-09-041-2/+4
|\ \ | |/ |/| | | | | | | | | arti: Write the test config atomically. Closes #1549 See merge request tpo/core/arti!2375
| * Revert "arti: Temporarily disable a flaky test."Gabriela Moldovan2024-08-291-1/+0
| | | | | | | | This reverts commit ececf6be2eaffc201666cd3413dc19c025be66de.
| * arti: Write the test config atomically.Gabriela Moldovan2024-08-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The flakiness from the `watch_single_file` test was caused by the race between the config write, and the fake SIGHUP "signal" sent on `sighup_tx`: sometimes, the sighup would get handled between creating the config file and writing its contents. In those cases, the config received in `TestModule::reconfigure` would be `Default::default()`, which caused an assertion to fail (because the test is expecting to receive the `ArtiConfig` it wrote to disk). Closes #1549
* | Provide a MemoryQuotaTracker in TorClientIan Jackson2024-09-041-1/+0
| | | | | | | | Nothing uses this yet.
* | arti: Proper testing of the memory limit config parsingIan Jackson2024-09-041-2/+53
| | | | | | | | | | | | Including testing that uncommenting the example generates a config with tracking enabled, and that the example low_water is the default value for the example max.
* | arti cfg tests: Provide resolve_return_resultsIan Jackson2024-09-041-0/+6
| |
* | arti cfg tests: strip_prefix: Leave section markers unchangedIan Jackson2024-09-041-1/+6
| |
* | arti cfg tests: strip_prefix: Document error behaviourIan Jackson2024-09-041-1/+3
| |
* | Look for memquota configuration in the TorClient configurationIan Jackson2024-09-042-1/+39
| | | | | | | | Tests are not entirely trivial and will come in a moment.
* | Fix typosDimitris Apostolou2024-09-032-2/+2
|/
* arti: Implement the hsc subcommand using an inert tor client.Gabriela Moldovan2024-08-281-1/+1
| | | | | | | | | This allows us to reenable the `arti hsc` tests, which were previously disabled due to flakiness (see #1496). The `help` test bit rotted a bit, so I had to tweak its expected output. Closes #1496
* Merge branch 'expose-proxy-setting' into 'main'Nick Mathewson2024-08-285-11/+298
|\ | | | | | | | | | | | | RPC: Add experimental method to list SOCKS proxy addresses. Closes #1523 See merge request tpo/core/arti!2359
| * rpc: Use MockRuntime for set_proxy_info test.Nick Mathewson2024-08-281-2/+2
| |
| * rpc: Add a test for setting proxy info.Nick Mathewson2024-08-282-0/+43
| |
| * rpc: Rename E::SenderDroppedNick Mathewson2024-08-281-5/+6
| |
| * rpc: Try another incantation for watching for ProxyInfo.Nick Mathewson2024-08-281-13/+7
| |
| * rpc: Add another layer of indirection on proxyinfoNick Mathewson2024-08-282-3/+12
| |
| * rpc: Try using postage::watch to initialize ProxyInfo.Nick Mathewson2024-08-285-35/+80
| | | | | | | | | | (This is a bit trickier than I would like, but it ensures that we never return a "not initialized yet" code.)
| * 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-283-3/+79
| | | | | | | | | | | | | | 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-271-1/+2
|\ | | | | | | | | Run tests of every crate, with all features disabled See merge request tpo/core/arti!2350
| * 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-221-15/+22
| | | | | | | | | | | | | | | | 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-211-0/+174
| |
* | 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-121-5/+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-011-3/+1
| | | | | | | | | | Removes resolve_backtraces from rtmock since it is no longer needed as stdlib's backtraces automatically lazily resolve without needing a &mut.
* | 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.
* | Have `arti hss onion-name` error if it doesn't print the onion nameKunal Mehta2024-08-011-3/+5
|/ | | | | | | 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.