mirror of
https://github.com/jwinterm/grim.git
synced 2026-10-17 14:21:24 +02:00
tor: remove delay after connection, immediately show service as started after bootstrap, remove unused features
This commit is contained in:
Generated
-11
@@ -5690,7 +5690,6 @@ version = "0.35.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
|
checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
"vcpkg",
|
"vcpkg",
|
||||||
]
|
]
|
||||||
@@ -6946,15 +6945,6 @@ version = "0.1.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
|
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "openssl-src"
|
|
||||||
version = "300.5.5+3.5.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3f1787d533e03597a7934fd0a765f0d28e94ecc5fb7789f8053b1e699a56f709"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl-sys"
|
name = "openssl-sys"
|
||||||
version = "0.9.111"
|
version = "0.9.111"
|
||||||
@@ -6963,7 +6953,6 @@ checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
"openssl-src",
|
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
"vcpkg",
|
"vcpkg",
|
||||||
]
|
]
|
||||||
|
|||||||
+2
-2
@@ -92,8 +92,8 @@ uuid = { version = "0.8.2", features = ["v4"] }
|
|||||||
num-bigint = "0.4.6"
|
num-bigint = "0.4.6"
|
||||||
|
|
||||||
## tor
|
## tor
|
||||||
arti-client = { version = "0.42.0", features = ["pt-client", "static", "onion-service-service", "onion-service-client", "experimental-api", "bridge-client"] }
|
arti-client = { version = "0.42.0", features = ["pt-client", "onion-service-service", "onion-service-client"] }
|
||||||
tor-rtcompat = { version = "0.42.0", features = ["static"] }
|
tor-rtcompat = "0.42.0"
|
||||||
tor-config = "0.42.0"
|
tor-config = "0.42.0"
|
||||||
fs-mistrust = "0.14.1"
|
fs-mistrust = "0.14.1"
|
||||||
tor-hsservice = "0.42.0"
|
tor-hsservice = "0.42.0"
|
||||||
|
|||||||
+7
-10
@@ -250,8 +250,6 @@ impl Tor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Wait 5s after launch.
|
|
||||||
thread::sleep(Duration::from_millis(5000));
|
|
||||||
TOR_STATE.client_launching.store(false, Ordering::Relaxed);
|
TOR_STATE.client_launching.store(false, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -537,6 +535,11 @@ impl Tor {
|
|||||||
let id = service_id.clone();
|
let id = service_id.clone();
|
||||||
w_services.insert(id, (port, key.clone(), service, proxy));
|
w_services.insert(id, (port, key.clone(), service, proxy));
|
||||||
}
|
}
|
||||||
|
// Remove service from starting.
|
||||||
|
{
|
||||||
|
let mut w_services = TOR_STATE.start.write();
|
||||||
|
w_services.remove(&service_id);
|
||||||
|
}
|
||||||
// Check service availability.
|
// Check service availability.
|
||||||
let addr = onion_addr.unwrap().display_unredacted().to_string();
|
let addr = onion_addr.unwrap().display_unredacted().to_string();
|
||||||
let url = format!("http://{}/", addr);
|
let url = format!("http://{}/", addr);
|
||||||
@@ -577,8 +580,8 @@ impl Tor {
|
|||||||
.block_on(async {
|
.block_on(async {
|
||||||
const MAX_ERRORS: i32 = 16;
|
const MAX_ERRORS: i32 = 16;
|
||||||
let mut errors_count = 0;
|
let mut errors_count = 0;
|
||||||
// Wait 5 seconds.
|
// Wait 10 seconds.
|
||||||
tokio::time::sleep(Duration::from_millis(5000)).await;
|
tokio::time::sleep(Duration::from_millis(10000)).await;
|
||||||
loop {
|
loop {
|
||||||
if !Self::check_running(&service_id) {
|
if !Self::check_running(&service_id) {
|
||||||
break;
|
break;
|
||||||
@@ -609,9 +612,6 @@ impl Tor {
|
|||||||
// Remove service from checking.
|
// Remove service from checking.
|
||||||
let mut w_services = TOR_STATE.check.write();
|
let mut w_services = TOR_STATE.check.write();
|
||||||
w_services.remove(service_id);
|
w_services.remove(service_id);
|
||||||
// Remove service from starting.
|
|
||||||
let mut w_services = TOR_STATE.start.write();
|
|
||||||
w_services.remove(service_id);
|
|
||||||
}
|
}
|
||||||
// Restart services.
|
// Restart services.
|
||||||
Self::restart();
|
Self::restart();
|
||||||
@@ -626,9 +626,6 @@ impl Tor {
|
|||||||
if !Self::check_running(&service_id) {
|
if !Self::check_running(&service_id) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Remove service from starting.
|
|
||||||
let mut w_services = TOR_STATE.start.write();
|
|
||||||
w_services.remove(&service_id);
|
|
||||||
errors_count = 0;
|
errors_count = 0;
|
||||||
// Check again after 60s.
|
// Check again after 60s.
|
||||||
Duration::from_millis(60000)
|
Duration::from_millis(60000)
|
||||||
|
|||||||
Reference in New Issue
Block a user