summaryrefslogtreecommitdiff
path: root/crates/tor-hsservice
Commit message (Collapse)AuthorAgeFilesLines
* Bump all the unstable tor- and arti- crates to 0.22.0.Gabriela Moldovan2024-09-031-26/+26
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.22.0 done ```
* oneshot-fused-workaround: Set the initial version to 0.1.0.Gabriela Moldovan2024-09-031-1/+1
| | | | This is the first time we're publishing this, so let's start at 0.1.0.
* Fix formatting issues introduced by fixup-features.Gabriela Moldovan2024-09-031-1/+3
|
* Run fixup-features in preparation for release.Gabriela Moldovan2024-09-031-1/+1
|
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-284-3/+5
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* tor-hsservice: Recreate the file watcher on every key_dir change event.Gabriela Moldovan2024-08-271-0/+3
| | | | | | | This ensures that if a directory used as a `key_dir` is moved (e.g. renamed), and then moved back to its original location (the one specified in `key_dirs`), our watcher continues watching the `key_dirs` contents.
* tor-config: Rename watch_file to watch_path.Gabriela Moldovan2024-08-271-2/+2
| | | | `FileWatcher::watch_file` can be used with arbitrary paths.
* 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
|