summaryrefslogtreecommitdiff
path: root/crates/tor-hsservice
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-hsservice: Make sure we always watch the parents of the key_dirs.Gabriela Moldovan2024-08-271-15/+24
| | | | | This ensures that if a `key_dir` is created after we start watching it (or if it's moved), we are still able to detect changes.
* tor-hsservice: Always recreate the file watcher if the config changes.Gabriela Moldovan2024-08-271-59/+6
| | | | | | While this means we will be recreating the watcher slightly more often than necessary, this new approach is less error-prone than what we had before.
* Merge branch 'ci' into 'main'Ian Jackson2024-08-271-0/+3
|\ | | | | | | | | Run tests of every crate, with all features disabled See merge request tpo/core/arti!2350
| * Add script for *testing* without any features enabledIan Jackson2024-08-191-0/+3
| | | | | | | | | | | | | | | | | | We can't do this for every crate. I looked at what is now matrix-check to see if I wanted to use any of the code. But it seems too entangled with its particular purpose, and has a lot of embedded knowledge of our crates' features. I found it sufficiently far from what I wanted that I decided on a fresh script.
* | tor-hsservice: Add a TODO about rethinking publish rate-limiting.Gabriela Moldovan2024-08-211-0/+11
| |
* | tor-hsservive: Document how restricted discovery live reloading works.Gabriela Moldovan2024-08-211-0/+48
| |
* | tor-hsservice: Remove a TODO that is no longer relevant.Gabriela Moldovan2024-08-211-16/+1
| | | | | | | | This is now implemented.
* | tor-hsservice: Add TODO about updating publisher status on error.Gabriela Moldovan2024-08-211-0/+1
| | | | | | | | | | This is a general issue with the publisher that will need to be addressed soon.
* | tor-hsservice: Update the authorized_clients and watcher when the config ↵Gabriela Moldovan2024-08-211-1/+5
| | | | | | | | changes.
* | tor-hsservice: Store a FileWatcher in the publisher reactor.Gabriela Moldovan2024-08-211-2/+137
| | | | | | | | | | This `FileWatcher` is watching the `restricted_discovery.key_dirs` directories for changes.
* | tor-hsservice: Pass watch_configuration down to restricted discovery config.Gabriela Moldovan2024-08-211-0/+8
| | | | | | | | | | | | We need to know if `watch_configuration` is set in the descriptor publisher reactor to know whether we should be watching the `restricted_discovery.key_dirs` directories.
* | tor-hsservice: Derive getters for OnionServiceConfig, RestrictedDiscoveryConfig.Gabriela Moldovan2024-08-212-7/+5
| |
* | tor-hsservice: Schedule descriptor republication whenever the key_dirs ↵Gabriela Moldovan2024-08-211-1/+57
| | | | | | | | contents change.
* | tor-hsservice: Add helper for reading authorized_clients.Gabriela Moldovan2024-08-211-8/+17
| | | | | | | | | | This will soon be used in the `key_dirs` change handler, which will re-read the authorized_clients list.
* | tor-hsservice: Add channel for receiving key_dirs change events.Gabriela Moldovan2024-08-211-0/+11
| |
* | tor-hsservice: Log a message whenever restricted discovery mode is toggled.Gabriela Moldovan2024-08-211-0/+13
| |
* | tor-hsservice: Only republish if the config changes are relevant.Gabriela Moldovan2024-08-211-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the publisher would always publish a new descriptor if the config changed. Now, it only republishes if the parts of the config that changed are relevant (i.e. if they are part of `OnionServiceConfigPublisherView`). A future change will make it so that we trigger a republish task whenever the restricted discovery mode authorized clients change. This will involve looking at the contents of the configured `key_dirs`, as well as the `OnionServiceConfigPublisherView`.
* | tor-hsservice: Make restricted_discovery updateable.Gabriela Moldovan2024-08-211-1/+1
| |
* | tor-hsservice: Make the reactor take a reference to the config.Gabriela Moldovan2024-08-212-3/+3
| | | | | | | | This resolves a clippy warning.
* | tor-hsservice: Use OnionServiceConfigPublisherView in the publisher.Gabriela Moldovan2024-08-212-16/+11
| | | | | | | | | | Resolves the TODO prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1603#note_2944902
* | tor-hsservice: Create a type for the descriptor publisher's view of the config.Gabriela Moldovan2024-08-211-1/+49
| | | | | | | | | | Partially addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1603#note_2944902
* | tor-hsservice: Log the client nicknames the descriptor is encrypted for.Gabriela Moldovan2024-08-211-1/+4
| | | | | | | | Knowing the nicknames can be useful when debugging.
* | tor-hsservice: Log if we are about to generate a new descriptor.Gabriela Moldovan2024-08-211-0/+1
|/
* Resolve unreachable_patterns warnings from nightly.Nick Mathewson2024-08-131-16/+13
| | | | | | | | | | | | | | Nightly rust doesn't like it when you have a `match` arm that can never be reached because of an uninhabited type. As such, we can't say stuff like: ``` let x: Option<Void> = ...; match x { Some(_) => unreachable!(), None => ... } ```
* tor-hsservice: Log whether the service is running in restricted discovery mode.Gabriela Moldovan2024-08-131-0/+12
|
* tor-hsservice: Move authorized_clients out of RunningOnionService.Gabriela Moldovan2024-08-133-31/+9
| | | | | | We now create the authorized_clients in the publisher (we don't need the authorized_clients anywhere else, so it makes little sense to keep them in `RunningOnionService`).
* tor-hsservice: Remove unnecessary docsrs cfg_attr.Gabriela Moldovan2024-08-071-1/+0
| | | | | The module is correctly documented as "only available on crate feature restricted-discovery" without it.
* tor-hsservice: Add comments about the cfg_attrs around restricted_discovery.Gabriela Moldovan2024-08-071-0/+3
|
* tor-hsservice: Add missing docsrs cfg to restricted_discovery module.Gabriela Moldovan2024-08-061-0/+1
| | | | | | | | | | | Without it, if the `restricted-discovery` feature is compiled out, the module gets documented as: ``` Non-restricted-discovery (Available on non-crate feature `restricted-discovery` only) ``` which is inaccurate.
* tor-hsservice: Add an extra log in the descriptor publisher.Gabriela Moldovan2024-08-051-0/+4
| | | | This helped me debug some shadow test failures.
* tor-hsservice: Fix broken doc links in RestrictedDiscoveryConfig.Gabriela Moldovan2024-08-051-6/+4
|
* tor-hsservice: Rewrite read_keys impl to be more functional.Gabriela Moldovan2024-08-051-21/+11
|
* tor-hsservice: Use DirEntry::file_name to simplify key file reading logic.Gabriela Moldovan2024-08-051-19/+14
|
* tor-hsservice: Reduce code duplication in restricted mode tests.Gabriela Moldovan2024-08-051-6/+3
|
* tor-hsservice: Give static_keys precedence over key_dirs (fmt).Gabriela Moldovan2024-08-053-16/+8
|
* tor-hsservice: Give static_keys precedence over key_dirs.Gabriela Moldovan2024-08-052-32/+100
| | | | | This rewrites `RestrictedDiscoveryConfig::read_keys` to give `static_keys` precedence over the keys from `key_dirs`.
* tor-hsservice: Do not error if there are more than ↵Gabriela Moldovan2024-08-053-93/+24
| | | | | | MAX_RESTRICTED_DISCOVERY_CLIENTS. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2266#note_3051758
* tor-hsservice: Add a note about live updates.Gabriela Moldovan2024-08-051-0/+7
|
* tor-hsservice: Use the configured authorized clients when encrypting the ↵Gabriela Moldovan2024-08-055-8/+49
| | | | descriptor.
* tor-hsservice: Remove unused import from internal prelude.Gabriela Moldovan2024-08-051-1/+0
| | | | | The base64ct dependency is now unused in tor-hsservice, so we should consider removing it at some point.
* tor-hsservice: Remove unused config types.Gabriela Moldovan2024-08-052-79/+1
|
* tor-hsservice: Store the client keys in RunningOnionService.Gabriela Moldovan2024-08-052-0/+41
|
* tor-hsservice: Use restricted config option in OnionServiceConfig.Gabriela Moldovan2024-08-051-13/+30
|
* tor-hsservice: Add restricted discovery configuration.Gabriela Moldovan2024-08-055-2/+918
|
* tor-hsservice: Add a restricted-discovery feature.Gabriela Moldovan2024-08-051-0/+11
| | | | | | | Restricted discovery mode is initially going to be gated behind the experimental `restricted-discovery` feature. Part of #1292
* tor-hsservice: Remove extraneous whitespace.Gabriela Moldovan2024-08-051-2/+2
|
* Bump versions for tor- and arti- crates to 0.21.0Nick Mathewson2024-08-011-26/+26
| | | | | | | | | | This is the result of: ``` for crate in $( ./maint/list_crates |grep '^\(tor\|arti-\)' ); do cargo set-version -p $crate 0.21.0 done ```
* tor-hsservice: Add OnionServiceBuilder, deprecate OnionService::new.Gabriela Moldovan2024-07-152-1/+36
| | | | Closes #1490
* tor-hsservice: Abolish OnionServiceState (fmt).Gabriela Moldovan2024-07-151-24/+27
| | | | Includes both `cargo fmt` and some manual code motion.
* tor-hsservice: Abolish OnionServiceState.Gabriela Moldovan2024-07-151-38/+21
| | | | | | | | | | | | | | | This removes a mostly-unnecessary struct holding the state of an `OnionService` or `RunningOnionService`. It only exists because I wanted to reduce the duplication of the `OnionService` and `RunningOnionService` fields. I am removing it because `OnionService` will soon become a builder, and this inner structure is making it difficult to create an ergonomic builder API (if we keep `OnionServiceState`, the builder fields won't map 1:1 to the fields of the build `OnionService` type). Note: this commit intentionally a bit misformatted to make reviewing easier. The reformatting will come in a future commit.