Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .devcontainer/claude-sandbox/init-firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ for domain in \
"registry.npmjs.org" \
"api.anthropic.com" \
"sentry.io" \
"statsig.anthropic.com" \
"statsig.com" \
"marketplace.visualstudio.com" \
"vscode.blob.core.windows.net" \
Expand All @@ -74,8 +73,8 @@ for domain in \
echo "Resolving $domain..."
ips=$(dig +noall +answer A "$domain" | awk '$4 == "A" {print $5}')
if [ -z "$ips" ]; then
echo "ERROR: Failed to resolve $domain"
exit 1
echo "WARN: Failed to resolve $domain — skipping"
continue
fi

while read -r ip; do
Expand Down
9 changes: 4 additions & 5 deletions claude-bun/.devcontainer/init-firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,23 @@ while read -r cidr; do
exit 1
fi
echo "Adding GitHub range $cidr"
ipset add allowed-domains "$cidr"
ipset add -exist allowed-domains "$cidr"
done < <(echo "$gh_ranges" | jq -r '(.web + .api + .git)[]' | aggregate -q)

# Resolve and add other allowed domains
for domain in \
"registry.npmjs.org" \
"api.anthropic.com" \
"sentry.io" \
"statsig.anthropic.com" \
"statsig.com" \
"marketplace.visualstudio.com" \
"vscode.blob.core.windows.net" \
"update.code.visualstudio.com"; do
echo "Resolving $domain..."
ips=$(dig +noall +answer A "$domain" | awk '$4 == "A" {print $5}')
if [ -z "$ips" ]; then
echo "ERROR: Failed to resolve $domain"
exit 1
echo "WARN: Failed to resolve $domain — skipping"
continue
fi

while read -r ip; do
Expand All @@ -86,7 +85,7 @@ for domain in \
exit 1
fi
echo "Adding $ip for $domain"
ipset add allowed-domains "$ip"
ipset add -exist allowed-domains "$ip"
done < <(echo "$ips")
done

Expand Down