Skip to content

Commit

Permalink
fix: fix building enclave image
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Jul 19, 2024
1 parent b6fd5c0 commit 27200d8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 153 deletions.
154 changes: 5 additions & 149 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"
Expand Down
10 changes: 9 additions & 1 deletion enclave/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27200d8

Please sign in to comment.