summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/config.rs
Commit message (Collapse)AuthorAgeFilesLines
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* circmgr: Begin porting path selection to tor-relay-selectionNick Mathewson2024-03-121-0/+10
| | | | | This covers the easy cases, where we are selecting relays at random based on a selector.
* tor-circmgr: Explain why vanguards_config is defined as an "other" accessor.Gabriela Moldovan2024-03-111-0/+5
|
* tor-hsclient: Do not enable vanguards feature in dev-dependency.Gabriela Moldovan2024-03-111-0/+2
|
* arti-client: Add vanguard_config() to CircMgrConfig.Gabriela Moldovan2024-03-111-0/+11
|
* PathConfigBuilder: Actually provide the long_lived_ports settersIan Jackson2024-02-201-0/+6
|
* Use list_builder and sub-builder pattern for long_lived_ports.Nick Mathewson2024-02-201-6/+18
|
* Add a configuration option for long_lived_ports.Nick Mathewson2024-02-201-0/+13
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* HS configuration: Add retry parameters to configurationIan Jackson2023-06-281-0/+36
| | | | | | | 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.
* Fix an unrelated missing cfg_attr.Nick Mathewson2023-03-081-0/+1
|
* Apply rustfmtIan Jackson2023-03-011-5/+10
|
* tor-circmgr: Provide testing feature and TestConfigIan Jackson2023-03-011-0/+43
| | | | Like the similar thing in tor-guardmgr.
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* guardmgr config: Introduce and require new GuardMgrConfig traitIan Jackson2022-11-031-4/+2
| | | | | It doesn't seem to me like it makes sense to provide the backward compatibility here.
* CircMgr: Enable reachable_addrs filter.Nick Mathewson2022-06-171-1/+14
|
* Add a configuration option for reachable_addrsNick Mathewson2022-06-171-0/+28
| | | | (This doesn't do anything yet.)
* impl_standard_builder: Have it generate FooConfig::builderIan Jackson2022-05-121-18/+0
| | | | | This deletes many handcoded impls. It also generates lots of impls that we previously didn't have.
* Rename impl_standard_builder from impl_default_via_builderIan Jackson2022-05-121-4/+4
| | | | | | | | | | | | I have Plans for this macro. In particular: * I have a wip branch which tests that the Builder can be deserialised from an empty config (ie, that config reading of a config with a blank section for this item works). * I think we should autogenerate $Config::builder(), and promote that, rather than $ConfigBuilder::default(). This macro could do that.
* config: Replace more handwritten impl DefaultIan Jackson2022-05-121-26/+4
|
* Add correct serde(default) attrs for humantime_serde::optionIan Jackson2022-05-121-4/+4
| | | | | | | | | Discovered by a test case in my local tree. The test case was macro-generated by an extension of impl_standard_builder (which macro istself currently awaiting review, arti!499) Have also sent an MR to update the upstream docs https://github.com/jean-airoldie/humantime-serde/pull/8
* config derive attrs: Make builders serde, and validated structs notIan Jackson2022-05-051-19/+7
| | | | | | | | | | | | | | | * Builders additionally derive: Debug, Serialize, Deserialize. * Validated structs no longer derive: Serialize, Deserialize and all related attributes deleted. * As a consequence, all the `#[serde(deny_unknown_fields)]` are gone. That means that right now unknown fields are totally ignored. This is good for compatibility but poor for useability. Doing something better here is arti#417, in progress. * As a consequence, delete tor_dirmgr::retry::default_parallelism. (The default value was already duplicated into a builder attr.)
* Change builder list APIIan Jackson2022-05-041-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new API is (roughly) as discussed in https://gitlab.torproject.org/tpo/core/arti/-/issues/451 This is quite a large commit and it is not convenient to split it up. It contains the following changes: * Redo the list builder and accessor macros implemnetation, including docs and tests. * Change uses of define_list_config_builder. In each case: - Move the docs about the default value to the containing field. - Remove the other docs (which were just recapitulations, and are now not needed since the ListBuilder is no longer public). - Rewmove or replace `pub` in the define_list_builder_helper call, so that the builder is no longer public. - Change the main macro call site to use define_list_builder_helper. - Add a call to define_list_builder_accessors. * Make the module `list_builder` pub so that we have somewhere to put the overview documentation. * Consequential changes: - Change `outer.inner().replace(X)` to `outer.set_inner(X)` - Consequential changes to imports (`use` statements).
* Document defaults for all the config listsIan Jackson2022-04-251-1/+3
| | | | | | | And add an imprecation in define_list_config_builder's doc comment do do so in future for other invocations of the macro. Add add the missing full stops.
* Use better syntax for doc comment attributeIan Jackson2022-04-251-3/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/471#note_2798020
* Introduce PredictedPortsListBuilderIan Jackson2022-04-251-4/+18
| | | | | | This means that `NetworkConfig::initial_predicted_ports` is now like the other list-like things, returning `&mut list_builder` with the same `set()` and `append()` methods.
* Use a lower default for max_retries.Nick Mathewson2022-03-301-1/+1
| | | | | | | | | | The older default seems (experimentally) to be ridiculously high. Generally, if we can't build a circuit within a handful attempts, that circuit has already timed out... unless there is a fast-failure condition, in which case we're just hammering the network (or our view of it.) Found with `arti-testing` for #329.
* Turn FallbackList into a real type, and store one in GuardMgr.Nick Mathewson2022-03-301-0/+2
| | | | | | | | | | | | | | 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.
* Merge branch 'config-partials-transparent' into 'main'Ian Jackson2022-03-171-31/+33
|\ | | | | | | | | Absolish builders for CircMgrConfig and DirMgrConfig See merge request tpo/core/arti!417
| * Add rationale for CircMgrConfig transparency and traitIan Jackson2022-03-161-1/+22
| |
| * Provide define_accessor_trait and use it to generate CircMgrConfigIan Jackson2022-03-161-20/+12
| |
| * Make CircMgrConfig transparent (and make it a trait)Ian Jackson2022-03-161-29/+18
| | | | | | | | See commentary for the rationale.
* | derive_builder: Switch to upstream 0.11Ian Jackson2022-03-161-4/+4
|/ | | | | | | | | 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-5/+4
| | | | Replace all uses of our copy of this code.
* Drop remaining conversion from FooConfig to FooConfigBuilderIan Jackson2022-03-071-34/+0
|
* 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.
* Test for PathConfig::at_least_as_permissive_as().Nick Mathewson2022-01-201-0/+29
| | | | | | This is totally not just an exercise to get combined test coverage for tor-circmgr over 90% because I needed something to do that wouldn't distract anybody else. :)
* Rename PathConfig::more_permissive_than()Nick Mathewson2022-01-201-1/+1
| | | | | | Since it implements a "<=" type relationship, it should be called "at_least_as_permissive_as()." Since it's a crate-private function, the long name isn't too bad.
* Remove "self" arg from PathConfig::builder()Nick Mathewson2022-01-201-1/+1
| | | | This was added by mistake.
* Adjust comment to be accurate wrt #263.Nick Mathewson2021-12-161-3/+5
|
* Make preemptive circuits reconfigurable.Nick Mathewson2021-12-071-2/+7
| | | | | | This required re-centralizing the configuration object for preemptive circuits, since previously the settings from it were a bit spread out over the crate.
* Make circuit_timing reconfigurable.Nick Mathewson2021-12-071-2/+6
|
* Allow on-the-fly changing of path_rulesNick Mathewson2021-12-071-0/+14
| | | | | | | | | | | | And now the complexity begins: when the user changes the path_rules, they not only want new circuits to obey those rules: they want _all new requests_ to be put onto circuits that obey those rules. That means that when the path rules become more restrictive, we need to retire all the circuits, and make sure that currently pending circuits aren't used for any requests. If it's any comfort, doing this was even more complicated in C tor. ;)
* Clarify names and docs for predictive circuits.Nick Mathewson2021-12-071-17/+27
| | | | | Also, use humantime_serde, rather than a number of seconds, to indicate configuration time.
* Rename circuits_preemptive to preemptive_circuitsNick Mathewson2021-12-071-12/+12
| | | | | | This obeys a few conventions: * adjective before noun * config objects end with "config"
* Allow configurability on preemptive circuitsNeel Chauhan2021-12-071-0/+82
|
* Ensure that all config sections have deny_unknown_fieldsNick Mathewson2021-11-251-0/+2
| | | | | When we deserialize a configuration, we should reject unknown variables (except when we have an explicit reason to allow them).
* Fix a few typos.Nick Mathewson2021-11-241-4/+4
| | | | Also fix some commonwealth spellings that had slipped in.