summaryrefslogtreecommitdiff
path: root/crates/arti-client/src/config.rs
Commit message (Collapse)AuthorAgeFilesLines
* Turn FallbackList into a real type, and store one in GuardMgr.Nick Mathewson2022-03-301-0/+6
| | | | | | | | | | | | | | The guard manager is responsible for handing out the first hops of tor circuits, keeping track of their successes and failures, and remembering their states. Given that, it makes sense to store this information here. It is not yet used; I'll be fixing that in upcoming commits. Arguably, this information no longer belongs in the directory manager: I've added a todo about moving it. This commit will break compilation on its own in a couple of places; subsequent commits will fix it up.
* dirmgr: Initial DirFilter code.Nick Mathewson2022-03-241-0/+1
| | | | | | This code sits behind a feature flag, and can be used to modify directories before storing them. This is part of the implementation for #397.
* Move SystemConfig to arti::cfgIan Jackson2022-03-211-48/+0
| | | | Fixes #314, #418.
* Merge branch 'config-partials-transparent' into 'main'Ian Jackson2022-03-171-27/+30
|\ | | | | | | | | Absolish builders for CircMgrConfig and DirMgrConfig See merge request tpo/core/arti!417
| * DirMgrConfig: abolish builder; make it transparent and exhaustiveIan Jackson2022-03-161-13/+16
| | | | | | | | See rationale in the comment.
| * Make CircMgrConfig transparent (and make it a trait)Ian Jackson2022-03-161-14/+9
| | | | | | | | See commentary for the rationale.
| * Change type of TorClientConfig::override_net_paramsIan Jackson2022-03-161-3/+7
| | | | | | | | | | | | | | Now we use NetParams. That implies making its constructor public, which I think it fine. This is related to #413 but is far from completing that ticket.
| * Actually honour preemptive circuits configurationIan Jackson2022-03-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | This handwritten conversion function omitted a field. There was nothing to spot this mistake. IMO this shows why these particular types ought not to use builders, but instead, should cause API breaks when things change. Adding this line here to explicitly fix the bug, although we are about to abolish this function completely almost right away.
* | derive_builder: Switch to upstream 0.11Ian Jackson2022-03-161-3/+3
|/ | | | | | | | | This has the different syntax for builder field attributes than what I originally proposed in my MR, and which therefore is in the pinned branch. My upstream MR for the field attributes feature was morged: https://github.com/colin-kiegel/rust-derive-builder/issues/239
* Use new upstream humantime_serde_option featureIan Jackson2022-03-141-4/+3
| | | | Replace all uses of our copy of this code.
* rustfmtIan Jackson2022-03-111-2/+1
|
* Make TorClientConfigBuilder DeserializeIan Jackson2022-03-111-0/+11
| | | | As per #371
* Drop remaining conversion from FooConfig to FooConfigBuilderIan Jackson2022-03-071-66/+0
|
* Have ArtiConfig contain a TorClientConfig, and drop builder retconIan Jackson2022-03-071-6/+1
| | | | | | | | | | | | | | | | | | | Replace the recapitulation of TorClientConfig fields in ArtiConfig and instead just have it contain one. This is part of #374. The conversions from ArtiConfig back to ArtiConfigBuilder and TorClientConfigBuilder would need to change, but, since we don't want them anyway, No longer impl Deserialize for ArtiConfig. (As per #371 this will want to become a private type.) No longer impl From<ArtiConfig> for ArtiConfigBuilder and TorClientConfigBuilder. And abolish tests of that code. (This all has to be in one commit, because previously ArtiConfig::tor_client_config used the validated-to-builder config retcon.)
* Derive Deserialize for derive-builder-generated config buildersIan Jackson2022-03-071-0/+8
| | | | | | | | | | | | | I used git-grep -P '\#\[serde\((?!default|deny_unknown)' to find places where I needed to add additional attributes on the builder method fields. This is currently a bit duplicative, but when #371 is completely done, the validated (non-builder) configs won't need to be Deserialize any more. This is part of #371 and #372.
* Fix rustdoc errors.Nick Mathewson2022-03-011-8/+9
|
* Run rustfmt.Nick Mathewson2022-03-011-1/+0
|
* arti-client: Add stability warning to config moduleIan Jackson2022-03-011-0/+9
|
* Add warnings about configuration stability.Nick Mathewson2022-02-281-2/+8
|
* Expose Reconfigure enum from arti-client.Nick Mathewson2022-02-011-1/+1
| | | | | This enum is required to use `TorClient::reconfigure` correctly, and as such ought to be re-exported.
* Make max_file_limit configurableNeel Chauhan2022-01-281-0/+56
|
* Put our cache files in the right place.Nick Mathewson2022-01-181-1/+1
| | | | | | | This resolves a copy-and-paste error where we were putting everything in our state directory. Closes #297.
* Improve the layout of crate exports; add runtime convenience functionseta2022-01-111-3/+1
| | | | | | | | | | | | | | | | | | | | This commit addresses multiple problems highlighted by arti#182: - `arti-client` had some types in its public API that weren't accessible without importing another crate (`CfgPath`, `DataReader`, `DataWriter`). This has been fixed. - In addition, the doc comments for `DataReader` and `DataWriter` were cleaned up to be of better quality, now that they're public. - It was impossible to use `arti-client` without also importing `tor-rtcompat`. This is now fixed by the addition of two convenience methods: `TorClient::bootstrap_with_tokio` and `TorClient::bootstrap_with_async_std`. - Potentially controversially: `tor-rtcompat` now returns *concrete* types from methods like `current_runtime`, instead of `impl Runtime`. - This was needed in order to actually be able to name the `TorClient` type that results from using these methods. - This does mean we lose API flexibility, but on balance I think this is a good thing, because the API we *do* have is actually usable...
* Expose and rename stream timeout config.Nick Mathewson2022-01-101-16/+24
| | | | | | | | | | | Previously we kept this in an ambiguously named type, `ClientTimeoutConfig`. But everything we do right now is client related! So `StreamTimeoutConfig` is a better name. Also, we'd previously neglected to expose the builder for this type from `TorClientConfigBuilder`. Now we do. Closes #281.
* Improve documentation of which config can change.Nick Mathewson2021-12-071-0/+2
| | | | | It no longer makes sense to say "most things can't change", now that most things can.
* Make TorClient reconfigurable.Nick Mathewson2021-12-071-0/+8
| | | | This covers ClientAddrConfig and ClientTimeoutConfig.
* Make ClientTimeoutConfig members crate-private.Nick Mathewson2021-12-071-3/+3
| | | | We shouldn't have pub members in these config objects.
* Rename timeout_rules to stream_timeouts.Nick Mathewson2021-12-071-15/+16
| | | | | | | (There are other timeout rules, after all.) Also, rename stream_timeout to connect_timeout, to make it more clear when it applies.
* Merge branch 'revised_preemptive_config' into 'main'eta2021-12-071-13/+13
|\ | | | | | | | | Usability: renaming and documentation in preemptive circuit config See merge request tpo/core/arti!176
| * Rename circuits_preemptive to preemptive_circuitsNick Mathewson2021-12-071-13/+13
| | | | | | | | | | | | This obeys a few conventions: * adjective before noun * config objects end with "config"
* | Merge branch 'bug252' into 'main'eta2021-12-071-0/+81
|\ \ | |/ |/| | | | | | | | | Make DNS fields in arti-client/src/client.rs configurable Closes #252 See merge request tpo/core/arti!171
| * Rename ClientDNSConfig -> ClientTimeoutConfigNeel Chauhan2021-12-071-19/+22
| |
| * Improve ClientDNSConfig field commentsNeel Chauhan2021-12-031-3/+5
| |
| * Make DNS fields in arti-client/src/client.rs configurableNeel Chauhan2021-12-031-0/+76
| |
* | Allow configurability on preemptive circuitsNeel Chauhan2021-12-071-2/+21
|/
* Fix a documentation link.Nick Mathewson2021-11-301-2/+3
|
* Fix a bad rustdoc reference.Nick Mathewson2021-11-291-1/+1
|
* Change sane_defaults() and with_directories()Nick Mathewson2021-11-291-32/+27
| | | | | | | | The sane_defaults() call is now the same as you get from a default builder: by convention, we just call that method Default::default(). The with_directories() constructor makes more sense as a constructor for the TorClientConfigBuilder than for TorClientConfig.
* Merge branch 'config-updates-and-tests'Nick Mathewson2021-11-291-28/+109
|\
| * Document StorageConfig defaults better.Nick Mathewson2021-11-291-3/+17
| | | | | | | | (Also fix a couple of typos)
| * Add basic tests for high-level buildersNick Mathewson2021-11-251-3/+52
| | | | | | | | | | Make sure that we can change elements, and we can reconstruct builders that give us the same thing.
| * Impl and test Default for high-level configsNick Mathewson2021-11-251-0/+20
| |
| * Ensure that all config sections have deny_unknown_fieldsNick Mathewson2021-11-251-0/+1
| | | | | | | | | | When we deserialize a configuration, we should reject unknown variables (except when we have an explicit reason to allow them).
| * Make directory accessors crate-private.Nick Mathewson2021-11-251-4/+2
| | | | | | | | These don't need to be exposed any longer.
| * Define defaults for StorageConfigNick Mathewson2021-11-251-19/+18
| | | | | | | | | | | | | | | | I'm still not 100% sure this is the right move: should we encourage app developers to always pick their own directories? Or should we make it easy for them to use, well, `sane_defaults`? This patch takes the second approach.
* | deglob some enums, use concise iteration syntaxDaniel Eades2021-11-251-1/+1
|/
* Resolve a pair of rustdoc warnings.Nick Mathewson2021-11-241-1/+1
|
* More typo fixes that I forgot to save :(Nick Mathewson2021-11-241-2/+2
|
* Fix a few typos.Nick Mathewson2021-11-241-1/+1
| | | | Also fix some commonwealth spellings that had slipped in.
* Implement meta-builder pattern for TorClientConfigNick Mathewson2021-11-221-10/+159
| | | | | This should be ergonomic than having to construct every section of the configuration separately.