diff --git a/Cargo.lock b/Cargo.lock index c0025ce..ca635df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -571,18 +571,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-as-inner" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.71", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -903,51 +891,6 @@ dependencies = [ "arrayvec 0.7.4", ] -[[package]] -name = "hickory-proto" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "hickory-resolver" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" -dependencies = [ - "cfg-if", - "futures-util", - "hickory-proto", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "hmac" version = "0.12.1" @@ -957,17 +900,6 @@ dependencies = [ "digest", ] -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi", -] - [[package]] name = "http" version = "1.1.0" @@ -1161,7 +1093,7 @@ dependencies = [ [[package]] name = "idempotent-proxy-canister" -version = "1.1.4" +version = "1.1.5" dependencies = [ "base64", "bytes", @@ -1180,7 +1112,7 @@ dependencies = [ [[package]] name = "idempotent-proxy-server" -version = "1.1.4" +version = "1.1.5" dependencies = [ "anyhow", "async-trait", @@ -1209,7 +1141,7 @@ dependencies = [ [[package]] name = "idempotent-proxy-types" -version = "1.1.4" +version = "1.1.5" dependencies = [ "base64", "ciborium", @@ -1224,16 +1156,6 @@ dependencies = [ "sha3", ] -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.5.0" @@ -1254,18 +1176,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "ipconfig" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" -dependencies = [ - "socket2", - "widestring", - "windows-sys 0.48.0", - "winreg 0.50.0", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -1328,12 +1238,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1360,21 +1264,6 @@ dependencies = [ "value-bag", ] -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - [[package]] name = "matchit" version = "0.7.3" @@ -1646,12 +1535,6 @@ dependencies = [ "cc", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quinn" version = "0.11.2" @@ -1760,7 +1643,6 @@ dependencies = [ "futures-core", "futures-util", "h2", - "hickory-resolver", "http", "http-body", "http-body-util", @@ -1797,17 +1679,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "winreg 0.52.0", -] - -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", + "winreg", ] [[package]] @@ -2637,7 +2509,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", ] @@ -2802,12 +2674,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "widestring" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" - [[package]] name = "winapi" version = "0.3.9" @@ -2969,16 +2835,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "winreg" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index cc592ae..afab1d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ strip = true opt-level = 's' [workspace.package] -version = "1.1.4" +version = "1.1.5" edition = "2021" repository = "https://github.com/ldclabs/idempotent-proxy" keywords = ["idempotent", "reverse", "proxy", "icp"] @@ -40,9 +40,8 @@ reqwest = { version = "0.12", features = [ "json", "gzip", "stream", - "trust-dns", "http2", - "hickory-dns", + # "hickory-dns", ], default-features = true } dotenvy = "0.15" futures = "0.3" diff --git a/enclave/setup.sh b/enclave/setup.sh index f9ce70e..d8b9a32 100644 --- a/enclave/setup.sh +++ b/enclave/setup.sh @@ -4,14 +4,22 @@ ifconfig lo 127.0.0.1 ifconfig +# Debian: failed to initialize nft: Protocol not supported +update-alternatives --set iptables /usr/sbin/iptables-legacy +# update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy +# update-alternatives --set arptables /usr/sbin/arptables-legacy +# update-alternatives --set ebtables /usr/sbin/ebtables-legacy + # adding a default route ip route add default via 127.0.0.1 dev lo route -n # iptables rules to route traffic to transparent proxy iptables -A OUTPUT -t nat -p tcp --dport 1:65535 ! -d 127.0.0.1 -j DNAT --to-destination 127.0.0.1:1200 +# replace the source address with 127.0.0.1 for outgoing packets with a source of 0.0.0.0 +# ensures returning packets have 127.0.0.1 as the destination and not 0.0.0.0 iptables -t nat -A POSTROUTING -o lo -s 0.0.0.0 -j SNAT --to-source 127.0.0.1 -iptables -L -t nat +iptables -L -t nat -v -n # generate identity key /app/keygen --secret /app/id.sec --public /app/id.pub