summaryrefslogtreecommitdiff
path: root/crates/arti/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* arti: Make Rpc argument unconditional when constructing socks proxyNick Mathewson2025-01-231-2/+1
| | | | | | Formerly this was a conditional method argument, which is a huge antipattern. Now it is unconditionally present, as `Option<T>` for a type that is uninhabited when RPC isn't supported.
* arti: Remove old workaround for runtime selection under RPC.Nick Mathewson2025-01-231-6/+1
| | | | | This was necessary before we had support for implementing RPC methods on generic types.
* 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.
* arti-client: add path resolver to `TorClient` and `TorClientConfig`Steven Engler2024-11-181-1/+1
| | | | | | Rather than using `arti_client::config::path_resolver()`, third-party code can get the path resolver using `TorClientConfig`s `AsRef<CfgPathResolver>` impl instead.
* update `CfgPath::path` to use a `CfgPathResolver`Steven Engler2024-11-181-0/+1
| | | | | | | | | | | | | | | | This is a big change across multiple crates since there isn't a good way to break it up. This changes the signature of `CfgPath::path` to: ``` pub fn path(&self, path_resolver: &CfgPathResolver) -> Result<PathBuf, CfgPathError> { ``` Making this change means that our global `CfgPathResolver` needs to be stored in the 'arti-client' library instead of `tor-config-path`, and must be passed through to anything that calls `path` to expand the variables.
* Merge branch 'dead' into 'main'Alexander Hansen Færøy2024-10-171-0/+2
|\ | | | | | | | | Disable a lot of dead code warnings and add a default-runtime feature in arti See merge request tpo/core/arti!2551
| * Disable a lot of dead code warningsIan Jackson2024-10-171-0/+2
| | | | | | | | | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* | arti: remove 'relay' subcommand and 'arti-relay' depSteven Engler2024-10-151-16/+1
|/
* arti: move 'relay' subcommand to 'subcommands::relay' moduleSteven Engler2024-09-251-9/+4
|
* arti: Gate the arti hsc subcommand behind a new "hsc" feature (fmt).Gabriela Moldovan2024-09-191-4/+1
|
* arti: Gate the arti hsc subcommand behind a new "hsc" feature.Gabriela Moldovan2024-09-191-7/+3
| | | | This new feature is experimental.
* arti: Add an enum for the hss subcommand.Gabriela Moldovan2024-09-171-27/+8
| | | | | | | This is needed because we'll soon add an `hss get-key` subcommand for getting and/or generating a service identity key alongside `hss onion-name` (`hss onion-name` will become a convenience around `hss get-key --key-type=onion-name`).
* arti: Remove a completed TODO.Gabriela Moldovan2024-09-171-1/+0
| | | | The tests were added in !2275
* arti: Move proxy subcommand to a separate module.Gabriela Moldovan2024-09-121-34/+5
| | | | | | | | No functional changes, this is just code motion. This helps organize the code in `arti/src/lib.rs` a bit. It now only contains the argument parsing and various other setup, and all the subcommands are contained in separate modules.
* arti: Move arti::run to subcommands::proxy.Gabriela Moldovan2024-09-121-154/+4
| | | | No functional changes, this is just code motion.
* rpc: Try using postage::watch to initialize ProxyInfo.Nick Mathewson2024-08-281-3/+3
| | | | | (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-281-10/+6
| | | | | | | 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-281-0/+3
| | | | | | | 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.
* arti: Avoid using the now-deprecated arti_client constant.Gabriela Moldovan2024-08-051-2/+2
| | | | We can just used `build_for_arti()` here.
* 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-101-1/+5
|
* arti: Gate the hsc subcommand behind the keymgr feature.Gabriela Moldovan2024-07-101-3/+3
| | | | | | | | | | | 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 an arti hsc subcommand.Gabriela Moldovan2024-06-271-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* arti: wait a short while on startup if lockfiles are unavailable.Nick Mathewson2024-06-241-1/+1
|
* arti: Add a TODO about a possible refactoring.Gabriela Moldovan2024-06-171-0/+2
| | | | | I propose we move each subcommand implementation to a `subcommand` submodule.
* arti: Move arti hss subcommand implementation to separate module.Gabriela Moldovan2024-06-171-38/+3
| | | | This addresses a TODO.
* relay: Add relay cargo feature flag and subcommandDavid Goulet2024-06-111-39/+63
| | | | | | | | | | Add the optional non default feature flag "relay" that will be used to enable relay support of arti. This commit also adds the "relay" subcommand to arti binary conditionnal on the feature flag in order to have a place holder starting point. Signed-off-by: David Goulet <[email protected]>
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Upgrade to futures-rustls 0.26.0, rustls 0.23.5.Nick Mathewson2024-04-221-0/+7
| | | | | | | | | The rustls upgrade will solve #1377 and CVE-2024-32650. Note that we've had to patch our RustlsProvider impl a bit in order to keep the tests passing. See comments. Closes #1377.
* arti, CI: Add a test case for command line helpIan Jackson2024-03-051-0/+3
|
* arti: Print help on `arti hss` without subcommandIan Jackson2024-03-051-0/+1
| | | | That's not the default.
* arti: Fix misplaced clap hunkIan Jackson2024-03-051-4/+4
| | | | | | | | | ab950a68 "arti: Add an hss subcommand." mistakenly moved the calls to `subcommand_required` and `arg_required_else_help` into the compile-time conditional. But they're related to the main command parsing. Fixes #1311
* Merge branch 'deny-unchecked-duration-substraction' into 'main'Ian Jackson2024-03-051-0/+1
|\ | | | | | | | | | | | | deny clippy::unchecked_duration_subtraction Closes #1304 See merge request tpo/core/arti!2008
| * deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
| |
* | arti config watch: Pass Runtime as first argumentIan Jackson2024-03-041-1/+1
| | | | | | | | That seems often how we do things elsewhere.
* | arti config watch: Pass a Runtime, not a TorClient (fmt)Ian Jackson2024-03-041-1/+6
| |
* | arti config watch: Pass a Runtime, not a TorClientIan Jackson2024-03-041-1/+1
|/ | | | | | | | | | | | I found this confusing in !2009, where the variable is unused on Windows: I wondered if this meant our config-reloading only worked on Unix, since "obviously it would need the TorClient". But actually the TorClient was only used *in this argument* for its runtime. The actual reconfiguration of the TorClient is doen by it being in one of the ReconfigurableModule's. Change the type of the argument for clarity.
* Refactor and improve error hinting.Nick Mathewson2024-02-141-4/+4
| | | | | | | | | | | | Instead of using complicated match statements, use downcasting to find error types that define specific hints. This also lets us define a reasonable hint-extractor for anyhow::Error, and use it when reporting errors in main. I've left an implementation of hint() in `impl Error`, to avoid breaking backward compatibility. Closes #1165.
* arti: Use Weak references for the reconfigurable modules (fmt).Gabriela Moldovan2024-01-251-6/+1
|
* arti: Use Weak references for the reconfigurable modules.Gabriela Moldovan2024-01-251-1/+10
| | | | | | | | | | | | | | | Previously, the `ProxySet` (and all the other `reconfigurable_modules`) were kept alive by the `watch_for_config_changes` background thread, which was preventing them from being dropped when `run()` exited. IOW, onion services never received the shutdown signal. Now `watch_for_config_changes` takes `Weak` references, and the only strong references to the modules are kept in the `reconfigurable_modules` local variable in `run()`, which is dropped when `run()` exits (e.g. on SIGINT). This allows onion services to execute their shutdown logic on CTRL-C. Part of #1244
* tor-hsservice: Add TODO about testing arti hss.Gabriela Moldovan2024-01-181-0/+1
|
* arti: Use OnionService to get the onion_name().Gabriela Moldovan2024-01-181-7/+19
|
* Give an error when user configured onion services with no support.Nick Mathewson2024-01-161-0/+2
| | | | | | | | | | | We do this by adding a stub config and config builder type, whose only purpose is to generate an error if anything is deserialized into it. (If this turns out not to be the best pattern, we can change it later, since this is all internal to the `arti` crate.) Closes #1184.
* tor-keymgr: Abolish ArtiNativeKeystoreConfig::expand_keystore_dir.Gabriela Moldovan2024-01-101-2/+2
| | | | | | This resolves a `TODO HSS` in arti-client. Part of #1187
* arti::lib: Downgrade "TODO HSS" commentsNick Mathewson2024-01-091-2/+2
| | | | These are not "must fix before releasing onion services".
* arti: Fix log message typo.Gabriela Moldovan2023-12-141-1/+1
|
* Merge branch 'return-of-the-son-of-arti-todos' into 'main'Nick Mathewson2023-12-141-26/+36
|\ | | | | | | | | Resolve Arti crate todos, redux See merge request tpo/core/arti!1833
| * arti: Use a macro to declare modules as conditionally public.Nick Mathewson2023-12-131-25/+36
| | | | | | | | | | (We can't use `visibility::make(pub)` or `visible` here. Try it yourself if you don't believe me!)
| * arti: conditionally expose onion_proxy module when experimental-api is enabledNick Mathewson2023-12-121-4/+4
| |