summaryrefslogtreecommitdiff
path: root/crates/arti/src/cfg.rs
Commit message (Collapse)AuthorAgeFilesLines
* Add a test for transport configurationNick Mathewson2024-04-021-0/+46
| | | | | | | (Previously, nothing actually parsed these values in our configuration.) Closes #1333.
* Merge branch 'encapsulate_config_rs' into 'main'Nick Mathewson2024-03-131-8/+18
|\ | | | | | | | | Encapsulate usage of config-rs inside tor-config. See merge request tpo/core/arti!2040
| * tor-config: Put config::Config inside a wrapper type.Nick Mathewson2024-03-131-1/+1
| | | | | | | | This will let us replace Config with something better.
| * Use ConfigurationSource::Verbatim in our tests.Nick Mathewson2024-03-131-7/+17
| |
* | Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|/
* arti-client: Add VanguardsConfig to TorClientConfig.Gabriela Moldovan2024-03-111-0/+11
|
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* arti: define RpcConfig only if neededTobias Stoeckmann2024-02-291-1/+1
| | | | The RpcConfig struct is only used if feature rpc is selected.
* arti: use name bindings only if neededTobias Stoeckmann2024-02-291-1/+3
| | | | | The local name binding for tor_config::define_list_builder_accessors is only needed if feature onion-service-service is selected.
* Add a configuration option for long_lived_ports.Nick Mathewson2024-02-201-0/+1
|
* Merge branch 'err_on_no_onion_service_support' into 'main'Nick Mathewson2024-01-161-4/+10
|\ | | | | | | | | | | | | Give an error when user configured onion services with no support. Closes #1184 See merge request tpo/core/arti!1885
| * Give an error when user configured onion services with no support.Nick Mathewson2024-01-161-4/+10
| | | | | | | | | | | | | | | | | | | | | | 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.
* | hsrproxy: Temporarily remove ability to config unix addressesNick Mathewson2024-01-161-0/+2
|/ | | | | | | | 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
* arti::cfg: Turn a TODO HSS into a ticket.Nick Mathewson2024-01-091-1/+1
|
* arti: Test for expected value of onion service cfg.Nick Mathewson2023-12-121-2/+34
|
* arti: Enforce onion service nickname distinctnessNick Mathewson2023-12-121-3/+3
| | | | | | | | | | | The most logical way to do this was to change the "List" type to a HashMap, and add a build function to the ListBuilder. This change additionally renames: OnionServiceProxyConfig{List=>Map} NamedProxyMap => ProxyBuilderMap (We now have two kinds of map, and this name change will clarify the distinction.)
* arti: Downgrade a TODO HSS about testing onion-service config.Nick Mathewson2023-12-121-1/+2
| | | | | | | IIUC, there will never be a Some(InNew) entry here, since we will never have an onion service be configured by default. Instead we test this kind of configuration by having commented-out options that we uncomment as needed.
* arti cfg: suppress a warningIan Jackson2023-12-041-0/+1
| | | | | | | | | | | | | There is a TODO HSS for this. Fixes cargo check --workspace --all-targets producing warning: unused variable: `result` --> crates/arti/src/cfg.rs:1060:13 | 1060 | let result = file.resolve::<(TorClientConfig, ArtiConfig)>(); | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result` | = note: `#[warn(unused_variables)]` on by default
* Revert "hsrproxy: Temporarily change the format of ProxyRule."Nick Mathewson2023-11-291-1/+1
| | | | | | | | | | | 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.
* Use a less obtrustive sign to end the onion services config sectionNick Mathewson2023-10-111-5/+5
|
* Improve test fn documentation even more.Ian Jackson2023-10-101-2/+2
|
* arti::cfg: tweak narrow() test fn to be more useful.Nick Mathewson2023-10-101-12/+14
| | | | | | | | | It still matches the start pattern in the same way, but it takes the _next_ match of the end pattern after the start pattern, and it allows the end pattern to be absent. This will make the bridge tests a little more robust, and let the onion service tests stop saying BEGIN and END.
* Non-working attempt to test onion service configuration.Nick Mathewson2023-10-031-2/+52
| | | | | | | 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.
* arti: Try to document some test helpers.Nick Mathewson2023-10-031-1/+18
|
* arti: Make onion_service configuration option pluralNick Mathewson2023-10-031-3/+3
|
* Note that we *do* need to actually test the onion service config.Ian Jackson2023-10-031-1/+1
|
* arti: Add a list of [[onion_service]]s to the config.Nick Mathewson2023-10-031-1/+29
| | | | There are no tests for parsing it yet.
* arti tests: Suppress a lint locallyIan Jackson2023-09-051-1/+2
| | | | | There's a complaint (seen in a CI build log) about over-eager iterator item cloning. This is a perf complaint and not very relevant in tests.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* arti::cfg tests: Use fold to make nightly clippy happierNick Mathewson2023-08-221-4/+5
|
* arti cfg tests: Add keystore to example config.Gabriela Moldovan2023-07-131-14/+2
| | | | Closes #939
* arti-client: Use the config struct from tor-keymgr.Gabriela Moldovan2023-07-131-1/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* arti: Add a `logging.time_granularity` option with 1s default.Nick Mathewson2023-07-061-0/+1
| | | | | | | This lets us provide less information in our logs: in particular, it lets us avoid logging with microsecond precision. Closes #551.
* arti cfg tests: Add declare_exceptions for storage.keystore_dir.Gabriela Moldovan2023-06-291-1/+22
| | | | | This moves `storage.keystore_dir` to a separate `declare_exceptions` block and explains why we have this exception.
* example-config: Temporarily remove keystore_dir example.Gabriela Moldovan2023-06-291-1/+1
| | | | | | Let's remove this until we figure out how the config should behave when the `keymgr` feature is disabled (should it accept or reject `keystore_dir = true`?)
* arti-client: Add keystore_dir to StorageConfig.Gabriela Moldovan2023-06-291-0/+1
|
* arti cfg tests: Suppress an undesriable clippy lintIan Jackson2023-06-281-0/+1
|
* arti cfg tests: declare_exceptions: Annotate the types for clarity (fmt)Ian Jackson2023-06-281-6/+4
|
* arti cfg tests: declare_exceptions: Annotate the types for clarityIan Jackson2023-06-281-1/+6
|
* arti cfg tests: Point the reader to the types used in declarationsIan Jackson2023-06-281-0/+12
|
* arti cfg tests: Move InCode into declare_config_exampleIan Jackson2023-06-281-19/+19
| | | | It's used for declarations only, and they should all be here.
* arti cfg tests: Make declare_exception take distinguished old/new typesIan Jackson2023-06-281-15/+27
| | | | | | As per discussion in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1320#note_2916689 and IRC followup.
* HS configuration: Add retry parameters to configurationIan Jackson2023-06-281-0/+2
| | | | | | | I think these should go in `[circuit_timing]`. That section already has some retry parameters, so is not strictly *timing*. This is not honoured yet.
* HS configuration: Add and honour `allow_onion_addrs` in configurationIan Jackson2023-06-281-0/+11
| | | | | | | We put this in `[address_filter]`. The interaction with the corresponding stream preference is a bit complicated. We must turn the stream pref into a `BoolOrAuto`.
* art cfg tests: Fix garbled doc wordinggabi-2502023-06-281-2/+2
|
* arti cfg tests: Fix doc commentgabi-2502023-06-281-1/+1
|
* arti cfg tests: Overhaul exception handling (fmt)Ian Jackson2023-06-281-36/+32
|
* arti cfg tests: Overhaul exception handlingIan Jackson2023-06-281-92/+324
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was super confusing and fragile. Amongst the problems: * Information about exceptional config keys was spread across a number of places, manipulated in ad-hoc ways (conditional Vec appends, etc). * As a consequence, each exceptional table has confusing and unclear semantics. * It doesn't deal well with the way that cargo sometimes enables features for dependency crates even if arti itself wouldn't demand them; this can lead to sub-crates supporting config keys when the tests in arti don't expect them to, causing spurious test failures. Fix this: * Introduce a new, systematic, way of writing information about configuration keys that need some kind of special handling. * Use this new approach in *both* sets of "thorough" config tests. * Be more relaxed about deprecated keys. We don't want to tightly couple this to absence in the supported file, I think. * Understand more clearly the concept of keys of which we don't know, in the current build config, whether the code is expected to accept them. I have tested this locally with: for p in '-p arti' '--workspace'; do for f in '--no-default-features --features=tokio,native-tls' '--all-features' ''; do nailing-cargo test $p $f; done; done
* arti cfg tests: Remove a comment relating to work already doneIan Jackson2023-06-281-4/+0
| | | | | | We *do* have a thing that works like this. It's fragile and confusing and that's what I'm about to fix.