summaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'bug1531' into 'main'Ian Jackson2024-10-211-2/+2
|\ | | | | | | | | | | | | Move crates to crates to slotmap-careful Closes #1531 See merge request tpo/core/arti!2530
| * Convert a few crates to slotmap-carefulNeel Chauhan2024-10-171-2/+2
| |
* | Disable a lot of dead code warnings (fmt)Ian Jackson2024-10-171-1/+4
| |
* | Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
|/ | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* Introduce mpsc_channel_no_memquota and use it in the places it's wantedIan Jackson2024-10-155-4/+13
| | | | | These are the call sites where using this fucntion is correct. (Outside tor-rtmock, which we'll do separately.)
* tor-config: Expose assert_config_error test helper.Gabriela Moldovan2024-10-081-14/+1
| | | | | | This moves the `assert_config_error` helper from the restricted discovery config tests to a `testing` module in `tor-config` (I am about to reuse it for the C Tor keystore config tests too).
* tor-hsservice: Implement ctor_path() for service keys.Gabriela Moldovan2024-10-081-0/+20
|
* tor-hsservice: Remove now-unused import from internal prelude.Gabriela Moldovan2024-10-081-1/+1
|
* tor-keymgr: Rename KeyPathRange to ArtiPathRange (fmt).Gabriela Moldovan2024-10-081-1/+1
|
* tor-keymgr: Rename KeyPathRange to ArtiPathRange.Gabriela Moldovan2024-10-082-2/+2
| | | | | This is only used for representing portions of `ArtiPath`s, so let's rename it accordingly.
* tor-keymgr: Implement KeyPath::matches for CTorPaths.Gabriela Moldovan2024-10-081-8/+6
| | | | | | | `KeyPath::matches` now returns a boolean (because we can't return a matching "range" for `CTorPaths`, because unlike ArtiPaths, they're not represented as `String`s, and do not have variable parts that need to be captured).
* tor-hsservice: Move HsNickname to tor-persist.Gabriela Moldovan2024-10-082-134/+1
| | | | | | | We are about to need this in `tor-keymgr`, where we're about to add a config for C Tor service keystores (the C Tor keystore config will have an associated `HsNickname` that specifies which of the arti hidden services it's supposed to be used with).
* tor-hsservice: Use the new "restricted discovery" terminology.Gabriela Moldovan2024-10-031-1/+1
| | | | Part of #1476
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-252-3/+2
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* tor-hsservice: Update docs to reflect KeystoreSelector renaming.Gabriela Moldovan2024-09-231-1/+1
|
* tor-keymgr: Rename the primary keystore for clarity.Gabriela Moldovan2024-09-233-10/+10
| | | | | | | | | | Previously, arti's primary keystore was referred to as its "default" keystore. However, "default" is inaccurate here: there is no way to meaningfully override this "default" (the "default" store acts as the main keystore). Throughout the codebase, we query all keystores for keys (including the secondary ones), but only ever write to the default/primary keystore. This is OK for now, because it enables us to have one mutable keystore, and multiple secondary, read-only stores.
* tor-hsservice: Remove unused import from internal prelude.Gabriela Moldovan2024-09-171-1/+1
|
* tor-hsservice: Add API for generating the hsid for a service.Gabriela Moldovan2024-09-171-2/+30
| | | | This also reexports `HsId` from the `tor-hsservice` crate.
* tor-hsservice: Make maybe_generate_hsid take a selector (fmt).Gabriela Moldovan2024-09-171-3/+14
|
* tor-hsservice: Make maybe_generate_hsid take a selector.Gabriela Moldovan2024-09-171-6/+8
| | | | | | | | | | | We will soon add a new `OnionService` function for generating an HsId for the service without launching it (#1621). This new API will be implemented using `maybe_generate_hsid`, which will need to take the user-provided keystore selector as an argument. (the selector exists for future-proofing reasons; we're not yet exposing it in the CLI, but it will be part of the new `OnionService` API)
* tor-hsservice: Do not generate the HsId until the service is launched.Gabriela Moldovan2024-09-171-8/+10
| | | | | | | This defers generating an HsId until `OnionService::launch`, enabling us to use APIs like `OnionService::onion_name` to e.g. check for the existence of an HsId (previously, you couldn't do that because creating an `OnionService` would auto-generate the `HsId`).
* tor-hsservice: Remove outdated TODO.Gabriela Moldovan2024-09-171-4/+0
| | | | | | As per #1247, we decided to stick with the current name. As for the docs, they were added in !1946
* tor-hsservice: Remove deprecated constructor.Gabriela Moldovan2024-09-171-36/+1
| | | | This has been deprecated since 1.2.6, so let's remove it.
* tor-hsservice: Satisfy cargo fmt.Gabriela Moldovan2024-09-121-2/+0
|
* tor-hsservice: Remove the anonymity setting from the config.Gabriela Moldovan2024-09-123-26/+18
| | | | As mentioned in #727, this is not supported yet.
* Merge branch 'bug_1613' into 'main'gabi-2502024-09-123-6/+16
|\ | | | | | | | | | | | | 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-103-6/+16
| |
* | Merge branch 'publisher-svc-status' into 'main'David Goulet2024-09-106-144/+612
|\ \ | |/ |/| | | | | | | | | 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-092-3/+40
| | | | | | | | | | | | | | | | 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: Remove outdated comment about publisher.Gabriela Moldovan2024-09-091-17/+0
| | | | | | | | The descriptor publisher docs live in the `publisher` module.
| * tor-hsservice: Fill out the missing descriptor publisher docs.Gabriela Moldovan2024-09-092-8/+66
| | | | | | | | 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: Add basic tests for publisher status reporting.Gabriela Moldovan2024-09-092-4/+52
| |
| * 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: Add Degraded{Unr,R}eachable onion svc states.Gabriela Moldovan2024-09-092-3/+16
| | | | | | | | | | | | | | | | | | Currently, the `DegradedReachable` status is only reported by the the IPT manager and `DegradedUnreachable` is unused. Soon we'll the publisher reporting `DegradedReachable` or `DegradedUnreachable` or `Running`, depending on how the descriptor uploads went.
| * 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: Remove outdated IPT manager TODOs.Gabriela Moldovan2024-09-091-4/+0
| | | | | | | | | | These TODOs were addressed a while ago (when we introduced `IptManager::ipt_errors`).
| * tor-hsservice: Remove dead_code allows.Gabriela Moldovan2024-09-091-4/+1
| | | | | | | | | | These aren't dead code anymore, with the exception of `PublisherStatusSender::send_recovering`, which isn't used.
| * tor-hsservice: Remove an outdated TODO.Gabriela Moldovan2024-09-091-2/+0
| | | | | | | | This is already implemented.