Compare commits

..

2 commits

Author SHA1 Message Date
c626ed5a48 tor: clear data on launch, update arti to 0.26.0
Some checks failed
Build / Linux Build (push) Has been cancelled
Build / Windows Build (push) Has been cancelled
Build / MacOS Build (push) Has been cancelled
2025-01-13 19:40:09 +03:00
d79d05ef5a android: debug build without keystore 2025-01-13 16:54:27 +03:00
4 changed files with 592 additions and 459 deletions

1007
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -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" }

View file

@ -63,8 +63,8 @@ function build_apk() {
./gradlew clean ./gradlew clean
# Build signed apk if keystore exists # Build signed apk if keystore exists
if [ ! -f keystore.properties ]; then if [ ! -f keystore.properties ]; then
./gradlew assembleRelease ./gradlew assembleDebug
apk_path=app/build/outputs/apk/release/app-release.apk apk_path=app/build/outputs/apk/debug/app-debug.apk
else else
./gradlew assembleSignedRelease ./gradlew assembleSignedRelease
apk_path=app/build/outputs/apk/signedRelease/app-signedRelease.apk apk_path=app/build/outputs/apk/signedRelease/app-signedRelease.apk

View file

@ -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())),