summaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr
Commit message (Collapse)AuthorAgeFilesLines
* Bump all crates to 0.1.0arti-v0.1.0Nick Mathewson2022-03-011-13/+13
|
* dirmgr::Store.expire_all takes configtharvik2022-02-233-26/+47
|
* dirmgr: add Store traittharvik2022-02-236-278/+310
|
* Rename TorConnectionFailed to TorAccessFailedNick Mathewson2022-02-221-1/+1
|
* Rename TorShuttingDown to ArtiShuttingDownNick Mathewson2022-02-221-1/+1
|
* dirclient: Remove HttpStatus error variantNick Mathewson2022-02-171-2/+11
| | | | | | | Getting a non-200 status is no longer a failure condition; it's just a different kind of answer. Closes #349.
* Merge branch 'remaining-errors'Nick Mathewson2022-02-176-59/+170
|\
| * Use TorConnectionFailed for failure to download directory.Nick Mathewson2022-02-171-1/+1
| |
| * tor-dirmgr: Use Bug type for sqlite-detected bugsIan Jackson2022-02-171-1/+9
| | | | | | | | So we get a stack trace
| * tor-dirmgr: Make sqlite_error_kind take rusqlite::ErrorIan Jackson2022-02-171-32/+34
| | | | | | | | | | We're about to reuse this and we'll want it to take the higher-level type. Also it seems more proper like this.
| * dirmgr: Remember where netdocs came from.Nick Mathewson2022-02-165-16/+61
| | | | | | | | | | This isn't complete (see TODO), but it's enough to let us report the right ErrorKind if something fails to parse.
| * dirmgr: eliminate StringParsingError.Nick Mathewson2022-02-164-29/+23
| | | | | | | | | | | | | | | | It had too many possible Kinds depending on what kind of string had failed to parse. I decided to use #[source] here instead of #[from], so that we would have to explicitly convert these errors where they show up.
| * dirmgr: HasKind for internal and sqlite errorsNick Mathewson2022-02-162-13/+54
| | | | | | | | | | At first I had thought that all sqlite errors would be internal, but that's not the case.
| * dirmgr: implement HasKind for the easier variantsNick Mathewson2022-02-161-9/+30
| |
* | arti-client: add ability to automatically bootstrapeta2022-02-161-2/+2
|/ | | | | | | | | | | | | The new `BootstrapBehavior` enum controls whether an unbootstrapped `TorClient` will bootstrap itself automatically (`Ondemand`) when an attempt is made to use it, or whether the user must perform bootstrapping themselves (`Manual`). The `lazy-init` example shows how you could write a simple `get_tor_client()` function that used a global `OnceCell` to share a Tor client across an entire application with this API. closes arti#278
* Merge branch 'warn_not_deny' into 'main'eta2022-02-141-1/+1
|\ | | | | | | | | | | | | Change deny(clippy::all) to warn(clippy::all). Closes #338 See merge request tpo/core/arti!306
| * Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
| | | | | | | | Closes #338.
* | dirmgr: Remove a useless Ok(x?)Nick Mathewson2022-02-141-1/+1
|/ | | | Found by nightly clippy.
* Allow creating unbootstrapped `TorClient`s (and `DirMgr`s)eta2022-02-112-24/+159
| | | | | | | | | | | | | | | This commit changes how the `TorClient` type works, enabling it to be constructed synchronously without initiating the bootstrapping process. Daemon tasks are still started on construction (although some of them won't do anything if the client isn't bootstrapped). The old bootstrap() methods are now reimplemented in terms of the new create_unbootstrapped() and bootstrap_existing() methods. This required refactoring how the `DirMgr` works to enable the same sort of thing there. closes #293
* Make SpawnError wrappers contain a 'spawning' stringNick Mathewson2022-02-042-22/+34
| | | | | (By our convention, these errors should say what we were trying to spawn when the error occurred.)
* Make TorError implement Clone.Nick Mathewson2022-02-041-4/+22
| | | | | This patch makes only minimal changes in lower-level error types: we have more refactoring to do.
* spawn errors: Fix tor-dirmgrIan Jackson2022-02-041-3/+10
|
* tor-error: Add as a ddpendency to many cratesIan Jackson2022-02-041-0/+1
| | | | Doing this here makes it easier when I rebase/reorder things
* Merge branch 'dirclient-testing' into 'main'Nick Mathewson2022-02-031-1/+1
|\ | | | | | | | | dir-client: bug fix and more tests See merge request tpo/core/arti!271
| * Upgrade required version of futures crate to 0.3.14Nick Mathewson2022-02-011-1/+1
| | | | | | | | | | Earlier versions have a bug in UnboundedReceiver that make our new dirclient tests fail.
* | Fix invalid path character on windowsMichael2022-01-311-2/+2
|/
* Bump tor-netdir and tor-guardmgr versionsarti-v0.0.4Nick Mathewson2022-01-311-1/+1
| | | | | | | | tor-netdir needs to bump because tor-netdoc bumped, even though there were no other changes in tor-netdir. Whoops. tor-guardmgr needs to bump because it already published, with the older tor-netdir.
* Bump the patch version of every crate that changed since 0.0.3Nick Mathewson2022-01-311-7/+7
|
* Fix test failure in tor_dirmgr::state::test::get_microdescs_stateNick Mathewson2022-01-271-1/+12
| | | | | | | | | This failure occurred because our tests use canned data to exercise the directory state functionality, and the canned consensus has suddenly become very expired. There are better fixes possible, but this is a minimal one that should get CI working on main again.
* Make the native-tls crate optional.Nick Mathewson2022-01-261-3/+1
| | | | | | | | | | | This commit puts the native-tls crate behind a feature. The feature is off-by-default in the tor-rtcompat crate, but can be enabled either from arti or arti-client. There is an included script that I used to test that tor-rtcompat could build and run its tests with all subsets of its features. Closes #300
* bootstrap reporting: Documentation fixups from review.Nick Mathewson2022-01-191-1/+2
|
* tor-dirmgr: Create a bootstrap-status exporting mechanism.Nick Mathewson2022-01-185-9/+591
| | | | | | | | | | | | | | | | | | | | | | The interface is similar to the one exposed by `arti-client`: it internally uses postage::watch to give a series of events showing when a bootstrap status is changing. Thanks to the existing state/driver separation in the DirMgr design we don't need much new logic: each download state needs to expose (internally) how far along it is in its download, which the bootstrap code passes to the DirMgr if it has changed. I believe that in the long run, we'll probably want to expose more (or different) information here, and we'll want to process it differently. With that in mind, I've made the API for `DirBootstrapStatus` deliberately narrow, so that we can change its of its internal later on without breaking code that depends on it. (The information exposed by this commit is not yet summarized in `arti-client`.) Part of #96.
* Bump all crate versions to 0.0.3.Nick Mathewson2022-01-111-12/+12
|
* Fixup broken doc comment from arti!220eta2022-01-101-1/+1
| | | | That's what I get for blindly trusting @nickm :p
* Merge branch 'ticket_178' into 'main'eta2022-01-101-9/+73
|\ | | | | | | | | | | | | Fix ticket 178: Don't use a NetDir until we have microdescriptors for all of our primary guards. Closes #178 See merge request tpo/core/arti!220
| * Only replace netdir once we have enough guard MDs.Nick Mathewson2022-01-061-9/+73
| | | | | | | | | | | | | | | | This prevents a security-failure condition that could happen if our directory caches don't give us these microdescriptors, but we nevertheless decide that the directory is usable. Closes #178
* | Merge branch 'bug274' into 'main'eta2022-01-101-1/+14
|\ \ | | | | | | | | | | | | | | | | | | Fix busy-loop when consensus is near expiring. Closes #274 See merge request tpo/core/arti!223
| * | Fix busy-loop when consensus is near expiring.Nick Mathewson2022-01-071-1/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | When our current consensus is getting close to being invalid (but it isn't invalid yet), we try to get a new one. So far, so good. But we had a bug: when we went to get a new consensus, we'd see that we had a perfectly fine not-yet-invalid consensus in our cache, reload it, find that it was ready, and continue! This patch fixes our behavior: If we have a usable consensus, then when we reset the bootstrapping process, we ignore any cached consensus. Fixes bug #274.
* / Minimize the required version for each dependency.Nick Mathewson2022-01-071-16/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found these versions empirically, by using the following process: First, I used `cargo tree --depth 1 --kind all` to get a list of every immediate dependency we had. Then, I used `cargo upgrade --workspace package@version` to change each dependency to the earliest version with which (in theory) the current version is semver-compatible. IOW, if the current version was 3.2.3, I picked "3". If the current version was 0.12.8, I picked "0.12". Then, I used `cargo +nightly upgrade -Z minimal-versions` to downgrade Cargo.lock to the minimal listed version for each dependency. (I had to override a few packages; see .gitlab-ci.yml for details). Finally, I repeatedly increased the version of each of our dependencies until our code compiled and the tests passed. Here's what I found that we need: anyhow >= 1.0.5: Earlier versions break our hyper example. async-broadcast >= 0.3.2: Earlier versions fail our tests. async-compression 0.3.5: Earlier versions handled futures and tokio differently. async-trait >= 0.1.2: Earlier versions are too buggy to compile our code. clap 2.33.0: For Arg::default_value_os(). coarsetime >= 0.1.20: exposed as_ticks() function. curve25519-dalek >= 3.2: For is_identity(). generic-array 0.14.3: Earlier versions don't implement From<&[T; 32]> httparse >= 1.2: Earlier versions didn't implement Error. itertools at 0.10.1: For at_most_once. rusqlite >= 0.26.3: for backward compatibility with older rustc. serde 1.0.103: Older versions break our code. serde_json >= 1.0.50: Since we need its Value type to implement Eq. shellexpand >= 2.1: To avoid a broken dirs crate version. tokio >= 1.4: For Handle::block_on(). tracing >= 0.1.18: Previously, tracing_core and tracing had separate LevelFilter types. typenum >= 1.12: Compatibility with rust-crypto crates x25519-dalek >= 1.2.0: For was_contributory(). Closes #275.
* extend lints to include 'clippy::all'Daniel Eades2021-12-281-0/+1
|
* fallbackdir: Update list generated on December 15, 2021Tor CI Release2021-12-161-869/+891
| | | | Signed-off-by: Tor CI Release <[email protected]>
* tor-dirmgr: retain cache_usage on reset.Nick Mathewson2021-12-161-4/+19
| | | | | | | Previously we didn't retain the value of our cache_usage field when calling reset() from GetMicrodescsState. This resolves an XXXX comment.
* Merge branch 'flag-publish-2' into 'main'eta2021-12-165-158/+366
|\ | | | | | | | | Refactor directory events to use a new FlagPublisher mechanism. See merge request tpo/core/arti!188
| * Refactor directory events to use a FlagPublisher mechanism.Nick Mathewson2021-12-145-158/+366
| | | | | | | | | | | | | | | | This approach tries to preserve the current interface, but uses a counter-based event backend to implement a coalescing stream of events that can be represented as small integers. The advantage here is that publishing events no longer needs to be a blocking operation, since there is no queue to fill up.
* | tor-dirmgr: Warn on a bug case.Nick Mathewson2021-12-161-2/+1
|/ | | | | | | | This warning occurs if we ask for microdescriptors from our local cache, and our cache gives us something we didn't ask for. It shouldn't be possible, so let's warn when it occurs. This patch resolves an XXXX.
* Merge branch 'reconfigure' into 'main'eta2021-12-134-29/+131
|\ | | | | | | | | Make most arti-client fields reconfigurable. See merge request tpo/core/arti!181
| * Add a few tests to tor-config.Nick Mathewson2021-12-071-3/+2
| |
| * Make override_net_params take effect sooner.Nick Mathewson2021-12-072-4/+19
| | | | | | | | | | This is still not as soon as I'd like: a real change here will require refactoring DirMgr::notify().
| * Make much of DirMgrConfig reconfigurable.Nick Mathewson2021-12-074-38/+94
| | | | | | | | | | | | | | | | | | | | We can't change the authorities while in-flight: that would be pretty miserable to implement. Similarly we can't change the cache while in-flight. Everything else should be fair game, though there are a couple of tricky bits. I've tried to document those.
| * Sketch API for reconfiguration.Nick Mathewson2021-12-072-0/+32
| | | | | | | | | | | | | | This patch doesn't actually make anything reconfigurable, but it does create an API that will tell you "you can't change the value of that!" If the API looks reasonable, I can start making it possible to change the values of individual items.