aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/tor.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-30 16:32:23 +0100
committertv <tv@krebsco.de>2026-10-30 16:32:23 +0100
commita903c25b548490dc5fa48f398f6ddfdeca2270c6 (patch)
tree1c1a006b63108c6cc9e2634ee5c53f5c5b99bcb6 /src/transport/tor.rs
parenta6d5ea115df597e7fe1dc13a55261c2ff9a28ed7 (diff)
move transport config checks to respective modules
Diffstat (limited to 'src/transport/tor.rs')
-rw-r--r--src/transport/tor.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/transport/tor.rs b/src/transport/tor.rs
index 8eb1d02..f2e0199 100644
--- a/src/transport/tor.rs
+++ b/src/transport/tor.rs
@@ -198,6 +198,17 @@ impl TorTransport {
/// while: it fetches what it needs to know of the Tor network). Until it is done,
/// dials wait for it (arti bootstraps on demand), and the onion service is published
/// once it is: the node starts without waiting for Tor.
+ /// This transport's options, checked when the configuration is loaded
+ /// (`config::Settings::check`), if the node uses it: where arti keeps its state.
+ pub(crate) fn check(settings: &crate::config::Settings) -> Result<()> {
+ if settings.tor_state_dir.is_none() {
+ bail!(
+ "tor needs tor-state-dir: where arti keeps its state, the onion service's key among it"
+ );
+ }
+ Ok(())
+ }
+
/// The transport as `settings` configure it (`transport::start`), proving `key`.
/// None if `stop` came first (bootstrapping arti can take a while).
pub(crate) async fn from_settings(