aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/ipt_mgr
Commit message (Collapse)AuthorAgeFilesLines
* tor-hsservice: Change ReplayLog error type.Wesley Aptekar-Cassels2025-08-131-1/+1
| | | | | | | | This disentangles the ReplyLog from the IptManager. This will allow us to make the InternalPowError type more public (in order to use it in the OnionServiceStatus code) without also having to make the CreateIptError type more public.
* tor-hsservice: Use tor_persist::state_dirIan Jackson2024-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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: Introduce StartupError::StateDirectoryInaccessibleIoIan Jackson2024-02-011-5/+5
| | | | | | We're going to change the payload of StateDirectoryInaccessible to tor_persist::Error, since that's what tor_persist::state_dir gives us, but then we can't use it here.
* tor-hsservice: ipt_mgr: Move storage handle to stateIan Jackson2024-02-011-3/+4
| | | | | 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.
* tor-hsservice: Make IPT logs be persistentIan Jackson2023-12-131-0/+7
|
* tor-hsservice: Use keystore to store and reuse IPT keysIan Jackson2023-12-041-0/+1
|
* tor-hsservice: ipt_mgr: Prepare for nonfatal IPT creation errorsIan Jackson2023-12-041-1/+10
| | | | | | | | | Previously IPT creation could only fail due to key generation failures or other kinds of internal error, which were very unlikely and treated as fatal. But with key persistence, IPT creation will be able to fail due to eg disk full.
* tor-hsservice: ipt_mgr: Save and load IPT relays etc. (fmt)Ian Jackson2023-12-041-6/+3
|
* tor-hsservice: ipt_mgr: Save and load IPT relays etc.Ian Jackson2023-12-041-4/+139
| | | | | | | | Store the IPT manager's data structure to the provided storage manager. Keys are not persistent yet! And we must save the publication IPT set since it can have the only record of IPT publication times.
* tor-hsservice: Pass and record storage handlesIan Jackson2023-12-041-1/+4
| | | | | | | | | | | | | | | * Introduce type aliases for the Arc<dyn >. Add Send and Sync bounds. * Pass the storage manager to ipt_mgr and the per-key handle to ipt_set. * Store the handles in ipt_mgr::Immutable and IptPublishSet. * Change the ipt mgr storage key to "hs_ipts_{nickname}". This avoids use of "_" as a non-separator, and allows the possibility of other submodules using other storage keys too - and, here, we introduce one. * Provide a dummy struct for the IPT set state, which is needed to define the type alias etc. We'll populate that struct later.
* tor-hsservice: ipt_mgr: Move nascent state records into mod persistIan Jackson2023-11-271-0/+33
Let's avoid cluttering the core algorithm file with this, which is going to expand.