summaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/publish
Commit message (Collapse)AuthorAgeFilesLines
* Move helpers from tor-hsservice to tor-netdir.Wesley Aptekar-Cassels2024-11-251-2/+5
| | | | | These helpers seem potentially broadly useful, and only really discoverable if they're here.
* tor-hsservice: add clippy allowsSteven Engler2024-11-201-0/+4
|
* update `CfgPath::path` to use a `CfgPathResolver`Steven Engler2024-11-181-2/+2
| | | | | | | | | | | | | | | | This is a big change across multiple crates since there isn't a good way to break it up. This changes the signature of `CfgPath::path` to: ``` pub fn path(&self, path_resolver: &CfgPathResolver) -> Result<PathBuf, CfgPathError> { ``` Making this change means that our global `CfgPathResolver` needs to be stored in the 'arti-client' library instead of `tor-config-path`, and must be passed through to anything that calls `path` to expand the variables.
* tor-hsservice: pass through the `CfgPathResolver`Steven Engler2024-11-181-8/+19
|
* tor-config: removed re-export of `CfgPath`Steven Engler2024-11-041-1/+2
| | | | | Also updated other packages to get `CfgPath` directly from `tor-config-path' instead of 'tor-config'.
* Introduce mpsc_channel_no_memquota and use it in the places it's wantedIan Jackson2024-10-151-1/+2
| | | | | These are the call sites where using this fucntion is correct. (Outside tor-rtmock, which we'll do separately.)
* tor-hsservice: Remove the anonymity setting from the config.Gabriela Moldovan2024-09-121-2/+2
| | | | As mentioned in #727, this is not supported yet.
* Merge branch 'bug_1613' into 'main'gabi-2502024-09-121-1/+1
|\ | | | | | | | | | | | | Bug 1613: Add support for inserting externally generated and removing arbitrary service discovery keys Closes #1613 See merge request tpo/core/arti!2396
| * tor-keymgr: add an overwrite flag to KeyMgr::insert()Morgan2024-09-101-1/+1
| |
* | Merge branch 'publisher-svc-status' into 'main'David Goulet2024-09-102-108/+517
|\ \ | |/ |/| | | | | | | | | tor-hsservice: Improve descriptor publisher status reporting Closes #1216 and #1572 See merge request tpo/core/arti!2397
| * tor-hsservice: Add tests for status changes induced by descriptor uploads.Gabriela Moldovan2024-09-091-1/+185
| |
| * tor-hsservice: Include descriptor upload errors in onion service status.Gabriela Moldovan2024-09-091-9/+17
| |
| * tor-hsservice: Change the error type in Problem::DescriptorUpload.Gabriela Moldovan2024-09-091-1/+17
| | | | | | | | | | | | | | | | We will need to return a list of descriptor upload errors. We can't return a `Vec<RetryError<DescUploadError>>` here because `DescUploadError` is a lower-level error type that can't express that e.g. the upload timed out.
| * tor-hsservice: Remove unused UploadError variant (fmt).Gabriela Moldovan2024-09-091-3/+1
| |
| * tor-hsservice: Remove unused UploadError variant.Gabriela Moldovan2024-09-091-6/+1
| | | | | | | | | | We never return `UploadError::Timeout` (timeouts are represented as `BackoffError::Timeout`).
| * tor-hsservice: Rename UploadStatus to UploadResult.Gabriela Moldovan2024-09-091-4/+4
| | | | | | | | This type is a `Result`, renaming for clarity.
| * tor-hsservice: Fill out the missing descriptor publisher docs.Gabriela Moldovan2024-09-091-7/+62
| | | | | | | | Closes #1216
| * tor-hsservice: Return Bug where possible.Gabriela Moldovan2024-09-091-4/+4
| | | | | | | | | | This makes it clearer that some of these functions are essentially infallible.
| * tor-hsservice: Update docs with new status reporting logic.Gabriela Moldovan2024-09-091-12/+32
| |
| * tor-hsservice: Validate the authorized clients before publishing.Gabriela Moldovan2024-09-092-2/+40
| | | | | | | | | | This enables us to report a "broken" service status if restricted discovery is enabled but the authorized_clients list is empty.
| * tor-hsservice: Set the publisher State based on the upload results.Gabriela Moldovan2024-09-091-29/+106
| | | | | | | | Closes #1572
| * tor-hsservice: Store the upload result in TimePeriodContext.Gabriela Moldovan2024-09-091-2/+33
| | | | | | | | | | | | This will allows us determine the ComponentStatus of the publisher (it'll be either `Running` or `Degraded`, depending on whether the upload failed).
| * tor-hsservice: Don't update the onion svc status when publisher goes idle.Gabriela Moldovan2024-09-091-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | After uploading the descriptor, the publisher transitions into the `Idle` state. This transition happens even if the upload was unsuccessful, so it shouldn't cause the onion service status to become `Running` (because `Running` implies the service is fully reachable, and if the publisher failed to upload the descriptor to some or all HsDirs, that won't necessarily be the case). A future commit will set the publisher's onion svc `State` to `Running`/`Recovering`/`Broken` according to the upload status.
| * tor-hsservice: Add a comment noting where the publisher tests live.Gabriela Moldovan2024-09-091-0/+2
| |
| * tor-hsservice: Replace UploadStatus enum with type alias.Gabriela Moldovan2024-09-091-24/+6
| | | | | | | | This resolves a TODO.
| * tor-hsservice: Store the authorized_clients in the mutable state of the reactor.Gabriela Moldovan2024-09-092-17/+18
| | | | | | | | | | | | Previously, these were stored in the immutable state behind a mutex, but since they're not really immutable (we update them if the config changes), it makes more sense to put them in `State`.
| * tor-hsservice: Move a misplaced TODO.Gabriela Moldovan2024-09-091-1/+1
| | | | | | | | | | | | This TODO was added in !2353 and was supposed to be about reporting a broken/degraded onion service status if the restricted discovery config watcher fails.
* | tor_hsservice use get::<HsIdKey> rather than get::<HsIdKeypair>Adam Joseph F0B74D717CDE8412A3E0D4D5F29AC8080DA8E1E02024-09-091-4/+3
|/ | | | | | | | | | There are three places where we query the KeyMgr for an `HsIdKeypair` but all we really need is the public part. This commit changes those three callsites to instead use `get::<HsIdKey>`. This relies on the previous commit, which makes sure that a request for an `HsIdKey` will always succeed if the keystore has a `HsIdKeypair` with the same service nickname.
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-1/+1
| | | | | | | | | | | | | | 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.
* tor-hsservice: Add a TODO about rethinking publish rate-limiting.Gabriela Moldovan2024-08-211-0/+11
|
* 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: 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 the reactor take a reference to the config.Gabriela Moldovan2024-08-211-2/+2
| | | | 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: 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: Move authorized_clients out of RunningOnionService.Gabriela Moldovan2024-08-131-2/+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: Add an extra log in the descriptor publisher.Gabriela Moldovan2024-08-051-0/+4
| | | | This helped me debug some shadow test failures.
* tor-hsservice: Use the configured authorized clients when encrypting the ↵Gabriela Moldovan2024-08-052-8/+31
| | | | descriptor.