Commit Graph

137 Commits

Author SHA1 Message Date
Nick Mathewson 48f77a93c0 Clarify names and docs for predictive circuits.
Also, use humantime_serde, rather than a number of seconds, to indicate
configuration time.
2021-12-07 12:09:05 -05:00
Nick Mathewson c2e20a242a Rename circuits_preemptive to preemptive_circuits
This obeys a few conventions:
  * adjective before noun
  * config objects end with "config"
2021-12-07 12:06:53 -05:00
Neel Chauhan 9c66b68c5a Rename ClientDNSConfig -> ClientTimeoutConfig 2021-12-07 08:43:58 -08:00
eta 45b96579b8 Merge branch 'preemptive-config' into 'main'
Allow configurability on preemptive circuits

Closes #245

See merge request tpo/core/arti!164
2021-12-07 15:04:42 +00:00
Neel Chauhan 0e9c2d274e Allow configurability on preemptive circuits 2021-12-07 15:04:41 +00:00
Nick Mathewson 31b385c5b2 Resolve roughly half of the XXXXs.
We want to only use TODO in the codebase for non-blockers, and open
tickets for anything that is a bigger blocker than a TODO.  These
XXXXs seem like definite non-blockers to me.

Part of arti#231.
2021-12-06 15:11:03 -05:00
Neel Chauhan f32a10865e Make DNS fields in arti-client/src/client.rs configurable 2021-12-03 10:28:42 -08:00
Nick Mathewson 04d99ff1d0 Idle hacking to get 90% coverage in arti-config
This is just a matter of writing a few tests for some very easy
functions.
2021-12-02 18:55:30 -05:00
Nick Mathewson 3b072c5420 Merge branch 'readme_fixes' 2021-11-30 09:12:51 -05:00
eta 2920a4d084 Merge branch 'simplify_config_helpers' into 'main'
Change sane_defaults() and with_directories()

See merge request tpo/core/arti!155
2021-11-29 20:42:28 +00:00
Nick Mathewson eef81d9d57 Bump every crate by one patch version. 2021-11-29 15:21:58 -05:00
Nick Mathewson f107794b74 Change sane_defaults() and with_directories()
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.
2021-11-29 14:20:34 -05:00
Nick Mathewson eb861b7edd Merge branch 'config-updates-and-tests' 2021-11-29 13:59:41 -05:00
Nick Mathewson 098547f735 Document StorageConfig defaults better.
(Also fix a couple of typos)
2021-11-29 13:55:33 -05:00
dagon d5c48c616f run ./maint/readmes.sh 2021-11-29 21:29:28 +10:00
Nick Mathewson f2034ac6e2 Add basic tests for high-level builders
Make sure that we can change elements, and we can reconstruct builders
that give us the same thing.
2021-11-25 09:40:16 -05:00
Nick Mathewson 3a91f363bb Implement builder patterns for ArtiConfig.
This commit implements the "metabuilder" pattern and the "builder
reconstruction" pattern for the ArtiConfig type.

I'm not 100% that this will be necessary, but it will certainly help
with testing.
2021-11-25 09:40:14 -05:00
Nick Mathewson 75d977a259 Impl and test Default for high-level configs 2021-11-25 09:39:11 -05:00
Daniel Eades db16d13df4 add semicolons if nothing returned 2021-11-25 13:20:37 +00:00
Daniel Eades 052f51ff71 deglob some enums, use concise iteration syntax 2021-11-25 12:39:52 +00:00
Nick Mathewson fbf72fd5af Resolve a pair of rustdoc warnings. 2021-11-24 18:24:47 -05:00
Nick Mathewson 307ca9b4d0 Implement meta-builder pattern for TorClientConfig
This should be ergonomic than having to construct every section of the
configuration separately.
2021-11-22 14:53:52 +00:00
Nick Mathewson 40ff7113d4 Make every Config type implement Eq.
Doing this is necessary for reconfiguration support, and will help a lot
with testing, too.
2021-11-21 12:06:15 -05:00
Nick Mathewson e7fdf05f50 For every* config type, make defaults consistent.
This patch makes sure that for every* config type we have, the defaults
you get from a Builder match those you get from Serde, and that both
match the value that you get from arti_defaults.toml. Later down the
line I'll be adding some tests to keep these in sync.

* StorageConfig still has no defaults of its own, since we aren't so
sure we want other applications to use Arti's directories by default.
2021-11-21 11:52:43 -05:00
Nick Mathewson efdd327569 Rename .gitignore APP_FOO to ARTI_FOO.
Since these shell-variables are hardwired to use org.torproject.Arti as
the program name, it isn't appropriate to call them "app-specific".

If we someday reinstate APP_FOO, it should be based on a user-provided
application name.
2021-11-21 11:29:10 -05:00
Nick Mathewson 97f5a7a357 Give every ConfigBuilder a From<Config> implementation.
This will make it more convenient to reconfigure things.
2021-11-21 10:54:34 -05:00
Nick Mathewson aa83a5e38a Ensure that every section-level config type has a builder() function. 2021-11-21 10:54:34 -05:00
Nick Mathewson 0372d24eed Make arti-client config object match arti config better.
Now every section that the two configuration objects share has the
same type and name.  This should help us in documenting our configuration
in a way that doesn't confuse people.

There is still lots of API work to go.
2021-11-21 10:54:34 -05:00
Nick Mathewson 065d3dc104 Lower StorageConfig to arti-client crate 2021-11-21 10:54:34 -05:00
Nick Mathewson 934412586e Use named fields for the elements of ConfigBuildError 2021-11-18 14:31:34 -05:00
Nick Mathewson 96659a850b Rename RetryConfig to DownloadSchedule, fold in parallelism. 2021-11-18 12:33:08 -05:00
Nick Mathewson a1a620e451 Move the socks_port option into a new proxy section.
Now there are no options that aren't in a toml section.
2021-11-18 11:48:14 -05:00
Nick Mathewson 44f6da5f38 Rename the "network" configuration section to "tor_network".
This is more accurate, since it describes the details of the tor
network that we're connecting to.
2021-11-18 11:37:48 -05:00
Nick Mathewson d83fd2d181 Rename addr_config to address_filter; clarify its usage. 2021-11-18 11:37:48 -05:00
Nick Mathewson eba35e789c Flatten enforce_distance into path_rules.
Also use the path_rules name consistently throughout the code.
2021-11-18 11:37:48 -05:00
Nick Mathewson d592e86f9c Fold "circuit_timing" and "request_timing" into a single section. 2021-11-18 11:37:48 -05:00
Nick Mathewson 5184f5ba84 Move top-level configuration downwards from `arti` to `arti-config`.
To do this at all neatly, I had to split out `tor-config` from
`arti-config` again, and putting the lower level stuff (paths,
builder errors) into tor-config.  I also changed our use of
derive_builder to always use a common error type, to avoid
error type proliferation.
2021-11-18 11:37:48 -05:00