aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/ipt_mgr.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-hsservice: ipt mgr: expiry: Add some commentsIan Jackson2024-02-131-0/+4
|
* tor-hsservice: ipt mgr: expiry: Break out all_ipts (fmt)Ian Jackson2024-02-131-4/+1
|
* tor-hsservice: ipt mgr: expiry: Break out all_iptsIan Jackson2024-02-131-8/+15
| | | | And clarify docs for the *current* ipt functions.
* tor-hsservice: ipt mgr: expiry: rename a variableIan Jackson2024-02-131-3/+3
| | | | | "current" has a special meaning here: it means an IPT that we haven't replaced with another at the same relay due to number of requests.
* tor-hsservice: ipt mgr: Move/rename to StateExpiryError (fmt)Ian Jackson2024-02-131-3/+1
|
* tor-hsservice: ipt mgr: Move/rename to StateExpiryErrorIan Jackson2024-02-131-39/+4
| | | | | The private ExpiryError type is now err::StateExpiryError. We'll fix up the local alias in the HasKind impl in a moment.
* tor-hsservice: replay: Move replay filename knowledge into replay.rsIan Jackson2024-02-131-27/+5
|
* tor-hsservice: ipt mgr: Temporarily suppress a lintIan Jackson2024-02-131-0/+1
|
* tor-hsservice: ipt mgr: Check that file expiry happens precisely when wantedIan Jackson2024-02-131-4/+20
| | | | | This test detects the bug mentioned here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1977#note_2995265
* tor-hsservice: ipt mgr: Add a test hook for expiryIan Jackson2024-02-131-0/+24
|
* tor-hsservice: ipt mgr: Do old IPT file cleanup on startup tooIan Jackson2024-02-131-0/+4
| | | | This isn't strictly necessary, but it's better.
* tor-hsservice: ipt mgr: Explain about the ipt_set invariantIan Jackson2024-02-131-0/+6
| | | | This seemed to warrant some discussion and a cross-reference.
* tor-hsservice: ipt mgr: Rewrite state expiry doc commentIan Jackson2024-02-131-3/+7
| | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1977#note_2994999 https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1977#note_2995000
* tor-hsservice: ipt mgr: Abolish a foolish intermediate variableIan Jackson2024-02-131-14/+9
| | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1977#note_2994998 Removing the intermediate variable removes the possibility that the information in it could fail to be transferred to the main mutable state, so we don't need the IEFE any more.
* tor-hsservice: ipt mgr tests: Narrow a TODOIan Jackson2024-02-121-1/+1
| | | | We do have some tests, but they're not as comprehensive as we'd like.
* tor-hsservice: ipt mgr tests: Test that we expire old IPT dataIan Jackson2024-02-121-0/+37
|
* tor-hsservice: ipt mgr tests: Avoid reusing RNG seedIan Jackson2024-02-121-4/+4
| | | | | | Without this, we can regenerate the same IptLocalIds (etc.) on shutdown/restart (which involves calling startup again within a test case).
* tor-hsservice: ipt mgr: Expire replay logs for old IPTsIan Jackson2024-02-121-4/+57
|
* tor-hsservice: ipt mgr: Expire keys for old IPTsIan Jackson2024-02-121-3/+84
|
* tor-hsservice: ipt mgr: Track whether we've deleted any IPT (fmt)Ian Jackson2024-02-121-9/+9
|
* tor-hsservice: ipt mgr: Track whether we've deleted any IPTIan Jackson2024-02-121-2/+17
| | | | Indentation left anmolaous briefly for ease of review.
* tor-hsservice: ipt mgr: Break out REPLAY_LOG_SUFFIXIan Jackson2024-02-121-1/+4
| | | | | The expiry code is going to want this too. We should at least make a constant of it.
* tor-hsservice: ipt mgr: Rotate IPT relays even without good IPTs! (fmt)Ian Jackson2024-02-121-6/+6
|
* tor-hsservice: ipt mgr: Rotate IPT relays even without good IPTs!Ian Jackson2024-02-121-3/+1
| | | | | | | | We shouldn't keep the same IPT relays just because they're not working! Firstly, that's just silly, and secondly, for privacy reasons we want to put a limit on teh lifetime anyway. Indentation left anmolaous briefly for ease of review.
* tor-hsservice: Use FatalError::KeystoreRace where possible.Gabriela Moldovan2024-02-011-1/+1
|
* tor-hsservice: Rewrite get_or_gen_key using KeyMgr::generate.Gabriela Moldovan2024-02-011-13/+18
| | | | | | | Now that `KeyMgr::generate` returns the generated key, we can tidy up `get_or_gen_key`. Part of #1074
* tor-hsservice: Remove now-unused importsIan Jackson2024-02-011-1/+1
|
* tor-hsservice: Drop now-unused fslock dependencyIan Jackson2024-02-011-1/+0
| | | | We're just using fslock-guard now.
* tor-hsservice: Use tor_persist::state_dir, etc. (fmt)Ian Jackson2024-02-011-8/+10
|
* tor-hsservice: Use tor_persist::state_dirIan Jackson2024-02-011-58/+15
| | | | | | | | | | | | | | | | | | | | | | | We no longer do replay log locking in IptManager::new. Instead, we rely on the acquire_instance call in OnionService::launch, which ends up with ipt_mgr getting an InstanceHandle (which contains a lock guard). OnionServiceStateMgr is abolished; it existed to deal with the generics in the tor_persist::StateMgr API. state_dir has no generics (other than the T being loaded/stored). Many places (structs and argument lists) now have state_dir types which embody a path (or a CheckeDir) along with a lock, rather than separate path+lock+mistrust. The creation/startup code uses the new calls from state_dir. Other more minor changes: - StartupError::StateDirectoryInaccessible contains tor_persist::Error - test::create_storage_handles_from_state_dir changed and renamed, from _from_state_mgr. - replay::PersistFile's (separate) file lock is now fslock_guard's
* tor-hsservice: ipt_mgr: Move storage handle to stateIan Jackson2024-02-011-6/+7
| | | | | The new state_dir types require &mut for storing, which is correct, but that means we can't have it in Immutable.
* tor-hsservice: storage: Move Arcs into type aliasesIan Jackson2024-02-011-1/+1
| | | | | | | These are here because that's what you get from the tor_persist singleton StageMgr API (for type erasure reasons). We're going to change these to tor_persist::state_dir types and those don't involve Arcs.
* Merge branch 'ipt_parameters' into 'main'Nick Mathewson2024-01-311-14/+33
|\ | | | | | | | | | | | | Clean up, tune, and correct various parameters related to introduction points. Closes #1210 See merge request tpo/core/arti!1924
| * Rename parameters for intro-point lifetime to match the spec.Nick Mathewson2024-01-311-2/+2
| | | | | | | | | | | | | | | | | | | | (Also, correct the comments that describe them.) We may as well match the spec names when they aren't completely bogus. We are already renaming these parameters for this release, so it isn't an additional breaking change.
| * hss: clean up comments on ipt establish time tuningNick Mathewson2024-01-251-3/+7
| | | | | | | | See #1210 "question 4".
| * hss: Pick random intro-point lifetime based on netparamsNick Mathewson2024-01-251-2/+14
| | | | | | | | | | This makes us more spec-conformant. See discussion at #1210 "question 3".
| * Use hs_intro_num_extra param for max_n_intro_relays.Nick Mathewson2024-01-251-3/+3
| | | | | | | | See #1210 "question 2" for more discussion here.
| * hss: Use 3 hours for IPT_PUBLISH_*.Nick Mathewson2024-01-251-6/+9
| | | | | | | | See discussion and rationale on #1210 "question 1".
* | Merge branch 'set_faulty_eventually' into 'main'Nick Mathewson2024-01-261-0/+1
|\ \ | | | | | | | | | | | | | | | | | | HSS: Mark an Ipt as faulty if it fails continuously for 15 minutes. Closes #1248 See merge request tpo/core/arti!1915
| * | HSS: Mark an Ipt as faulty if it fails continuously for 15 minutes.Nick Mathewson2024-01-251-0/+1
| |/ | | | | | | Closes #1248.
* / test-temp-dir: New crateIan Jackson2024-01-251-1/+1
|/ | | | | Introduce the crate, move the code motion, and make minimal necessary changes.
* tor-hsservice: Update the IptManager status.Gabriela Moldovan2024-01-241-2/+7
|
* tor-hsservice: Give the IptManager a StatusSender.Gabriela Moldovan2024-01-241-0/+12
| | | | Part of #1083
* Document when (most) spawned tasks will be canceled.Nick Mathewson2024-01-181-0/+4
|
* tor-hsservice: Store the StateMgr inside OnionServiceState.Gabriela Moldovan2024-01-181-5/+5
| | | | | | This introduces an internal `OnionServiceStateMgr` trait, which enables us to store the `StateMgr` inside the `OnionServiceState` (without having to parameterize `OnionServiceState` on `S: StateMgr`).
* ipt_mgr: Remove todo-#1211Nick Mathewson2024-01-161-12/+7
| | | | | | All appropriate checks here should be in `is_hs_intro_point()`. Closes #1211.
* Rename IptEstablisher::{new => launch}Nick Mathewson2024-01-131-1/+1
|
* hsservice: Remove the unused n_faults fieldNick Mathewson2024-01-131-1/+0
| | | | (We can revert this later if it turns out to be needed.)
* tor-hsservice: todos: Reference the general status ticketIan Jackson2024-01-111-1/+1
|
* tor-hsservice: todos: Reference a new logging ticketIan Jackson2024-01-111-1/+1
| | | | I have tagged this as UX but *not* MUST.