tor: clear data on launch, update arti to 0.26.0
This commit is contained in:
parent
d79d05ef5a
commit
c626ed5a48
3 changed files with 590 additions and 457 deletions
1007
Cargo.lock
generated
1007
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
22
Cargo.toml
22
Cargo.toml
|
@ -78,23 +78,23 @@ gif = "0.13.1"
|
||||||
rkv = { version = "0.19.0", features = ["lmdb"] }
|
rkv = { version = "0.19.0", features = ["lmdb"] }
|
||||||
|
|
||||||
## tor
|
## tor
|
||||||
arti-client = { version = "0.23.0", features = ["pt-client", "static", "onion-service-service", "onion-service-client"] }
|
arti-client = { version = "0.26.0", features = ["pt-client", "static", "onion-service-service", "onion-service-client"] }
|
||||||
tor-rtcompat = { version = "0.23.0", features = ["static"] }
|
tor-rtcompat = { version = "0.26.0", features = ["static"] }
|
||||||
tor-config = "0.23.0"
|
tor-config = "0.26.0"
|
||||||
fs-mistrust = "0.8.0"
|
fs-mistrust = "0.8.0"
|
||||||
tor-hsservice = "0.23.0"
|
tor-hsservice = "0.26.0"
|
||||||
tor-hsrproxy = "0.23.0"
|
tor-hsrproxy = "0.26.0"
|
||||||
tor-keymgr = "0.23.0"
|
tor-keymgr = "0.26.0"
|
||||||
tor-llcrypto = "0.23.0"
|
tor-llcrypto = "0.26.0"
|
||||||
tor-hscrypto = "0.23.0"
|
tor-hscrypto = "0.26.0"
|
||||||
tor-error = "0.23.0"
|
tor-error = "0.26.0"
|
||||||
sha2 = "0.10.8"
|
sha2 = "0.10.8"
|
||||||
ed25519-dalek = "2.1.1"
|
ed25519-dalek = "2.1.1"
|
||||||
curve25519-dalek = "4.1.3"
|
curve25519-dalek = "4.1.3"
|
||||||
hyper = { version = "0.14.30", features = ["full"] }
|
hyper = { version = "0.14.30", features = ["full"] }
|
||||||
hyper-tls = "0.5.0"
|
hyper-tls = "0.5.0"
|
||||||
tls-api = "0.9.0"
|
tls-api = "0.12.0"
|
||||||
tls-api-native-tls = "0.9.0"
|
tls-api-native-tls = "0.12.1"
|
||||||
|
|
||||||
## stratum server
|
## stratum server
|
||||||
tokio-old = {version = "0.2", features = ["full"], package = "tokio" }
|
tokio-old = {version = "0.2", features = ["full"], package = "tokio" }
|
||||||
|
|
|
@ -80,20 +80,16 @@ pub struct Tor {
|
||||||
|
|
||||||
impl Default for Tor {
|
impl Default for Tor {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
|
// Cleanup keys, state and cache on start.
|
||||||
|
fs::remove_dir_all(TorConfig::keystore_path()).unwrap_or_default();
|
||||||
|
fs::remove_dir_all(TorConfig::state_path()).unwrap_or_default();
|
||||||
|
fs::remove_dir_all(TorConfig::cache_path()).unwrap_or_default();
|
||||||
|
// Create Tor client.
|
||||||
let runtime = TokioNativeTlsRuntime::create().unwrap();
|
let runtime = TokioNativeTlsRuntime::create().unwrap();
|
||||||
let config = Self::build_config();
|
let config = Self::build_config();
|
||||||
let client = if let Ok(c) = TorClient::with_runtime(runtime)
|
let client = TorClient::with_runtime(runtime)
|
||||||
.config(config.clone())
|
.config(config.clone())
|
||||||
.create_unbootstrapped() {
|
.create_unbootstrapped().unwrap();
|
||||||
c
|
|
||||||
} else {
|
|
||||||
fs::remove_dir_all(TorConfig::state_path()).unwrap();
|
|
||||||
fs::remove_dir_all(TorConfig::cache_path()).unwrap();
|
|
||||||
let runtime = TokioNativeTlsRuntime::create().unwrap();
|
|
||||||
TorClient::with_runtime(runtime)
|
|
||||||
.config(config.clone())
|
|
||||||
.create_unbootstrapped().unwrap()
|
|
||||||
};
|
|
||||||
Self {
|
Self {
|
||||||
running_services: Arc::new(RwLock::new(BTreeMap::new())),
|
running_services: Arc::new(RwLock::new(BTreeMap::new())),
|
||||||
starting_services: Arc::new(RwLock::new(BTreeSet::new())),
|
starting_services: Arc::new(RwLock::new(BTreeSet::new())),
|
||||||
|
|
Loading…
Reference in a new issue