Commit e635a8de authored by eta's avatar eta
Browse files

Merge branch 'enable-onions' into 'main'

Enable onion services using draft arti support

See merge request !96
parents 141669e4 5c385e51
Loading
Loading
Loading
Loading
+64 −0
Original line number Diff line number Diff line
@@ -133,6 +133,8 @@ dependencies = [
 "tor-error",
 "tor-geoip",
 "tor-guardmgr",
 "tor-hsclient",
 "tor-hscrypto",
 "tor-keymgr",
 "tor-llcrypto",
 "tor-netdir",
@@ -3371,6 +3373,7 @@ dependencies = [
 "tor-bytes",
 "tor-cert",
 "tor-error",
 "tor-hscrypto",
 "tor-linkspec",
 "tor-llcrypto",
 "tor-units",
@@ -3461,6 +3464,7 @@ dependencies = [
 "tor-error",
 "tor-geoip",
 "tor-guardmgr",
 "tor-hscrypto",
 "tor-linkspec",
 "tor-netdir",
 "tor-netdoc",
@@ -3526,6 +3530,7 @@ dependencies = [
 "thiserror",
 "tor-circmgr",
 "tor-error",
 "tor-hscrypto",
 "tor-linkspec",
 "tor-llcrypto",
 "tor-netdoc",
@@ -3649,6 +3654,44 @@ dependencies = [
 "tracing",
]

[[package]]
name = "tor-hsclient"
version = "0.3.0"
source = "git+https://gitlab.torproject.org/eta/arti?branch=exit-selection-draft#5c290fb71d31c6dbf2e852c9ed7e315f0617050f"
dependencies = [
 "async-trait",
 "derive_more",
 "educe",
 "either",
 "futures",
 "itertools 0.11.0",
 "postage",
 "rand 0.8.5",
 "rand_core 0.6.4",
 "retry-error",
 "safelog",
 "slotmap",
 "strum 0.25.0",
 "thiserror",
 "tor-basic-utils",
 "tor-bytes",
 "tor-cell",
 "tor-checkable",
 "tor-circmgr",
 "tor-config",
 "tor-dirclient",
 "tor-error",
 "tor-hscrypto",
 "tor-keymgr",
 "tor-linkspec",
 "tor-llcrypto",
 "tor-netdir",
 "tor-netdoc",
 "tor-proto",
 "tor-rtcompat",
 "tracing",
]

[[package]]
name = "tor-hscrypto"
version = "0.3.0"
@@ -3757,7 +3800,9 @@ dependencies = [
 "bitflags 2.1.0",
 "derive_builder_fork_arti",
 "derive_more",
 "digest 0.10.6",
 "futures",
 "hex",
 "humantime",
 "itertools 0.11.0",
 "num_enum",
@@ -3767,11 +3812,13 @@ dependencies = [
 "static_assertions",
 "strum 0.25.0",
 "thiserror",
 "time",
 "tor-basic-utils",
 "tor-checkable",
 "tor-config",
 "tor-error",
 "tor-geoip",
 "tor-hscrypto",
 "tor-linkspec",
 "tor-llcrypto",
 "tor-netdoc",
@@ -3799,6 +3846,7 @@ dependencies = [
 "itertools 0.11.0",
 "once_cell",
 "phf",
 "rand 0.8.5",
 "serde",
 "serde_with",
 "signature 1.6.4",
@@ -3812,8 +3860,11 @@ dependencies = [
 "tor-cert",
 "tor-checkable",
 "tor-error",
 "tor-hscrypto",
 "tor-linkspec",
 "tor-llcrypto",
 "tor-protover",
 "tor-units",
 "weak-table",
 "zeroize",
]
@@ -3867,6 +3918,7 @@ dependencies = [
 "tor-checkable",
 "tor-config",
 "tor-error",
 "tor-hscrypto",
 "tor-linkspec",
 "tor-llcrypto",
 "tor-protover",
@@ -3875,6 +3927,7 @@ dependencies = [
 "tor-units",
 "tracing",
 "typenum",
 "visibility",
 "zeroize",
]

@@ -4108,6 +4161,17 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"

[[package]]
name = "visibility"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8881d5cc0ae34e3db2f1de5af81e5117a420d2f937506c2dc20d6f4cfb069051"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 1.0.107",
]

[[package]]
name = "void"
version = "1.0.2"
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ simple_logger = "1"
smoltcp = { version = "0.9.1", default-features = false, features = ["log", "phy-tuntap_interface", "phy-raw_socket", "medium-ip", "socket-udp", "socket-tcp", "proto-ipv4", "proto-ipv6", "socket", "async"] }
tokio = { version = "1", features = ["net", "rt", "time", "sync", "io-util", "macros"] }
tracing = "0.1.37"
arti-client = { git = "https://gitlab.torproject.org/eta/arti", branch = "exit-selection-draft", default-features = false, features = ["tokio", "rustls", "static-sqlite", "geoip"] }
arti-client = { git = "https://gitlab.torproject.org/eta/arti", branch = "exit-selection-draft", default-features = false, features = ["tokio", "rustls", "static-sqlite", "geoip", "onion-service-client"] }
tor-rtcompat = { git = "https://gitlab.torproject.org/eta/arti", branch = "exit-selection-draft" }
tor-linkspec = { git = "https://gitlab.torproject.org/eta/arti", branch = "exit-selection-draft" }
tor-proto = { git = "https://gitlab.torproject.org/eta/arti", branch = "exit-selection-draft", features = ["experimental-api"] }
+3 −0
Original line number Diff line number Diff line
use crate::accounting::BandwidthCounter;
use arti_client::config::BoolOrAuto;
use arti_client::TorClient;
use arti_client::{CountryCode, TorAddr};
use arti_client::{DangerouslyIntoTorAddr, StreamPrefs};
@@ -215,6 +216,8 @@ where
            stream_prefs.exit_country(cc);
        }

        stream_prefs.connect_to_onion_services(BoolOrAuto::Explicit(true));

        let arti_stream = match self
            .arti
            .connect_with_prefs(tor_addr.clone(), &stream_prefs)