Add IP allocation to fly-setup, improve idempotency
fly-setup now allocates shared IPv4 + IPv6 (both free for HTTP/HTTPS), stages secrets with --stage to avoid unnecessary redeployments, and selects the Pulumi stack explicitly. Updated docs with cost note for dedicated IPv4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bcefb08894
commit
a580b0f079
2 changed files with 25 additions and 8 deletions
|
|
@ -50,7 +50,7 @@ infrastructure. They can continue to operate in parallel for private access.
|
||||||
|
|
||||||
| Decision | Choice | Rationale |
|
| Decision | Choice | Rationale |
|
||||||
|----------|--------|-----------|
|
|----------|--------|-----------|
|
||||||
| Proxy host | Fly.io (free tier) | Managed container, no server to maintain via Ansible |
|
| Proxy host | Fly.io (free tier) | Managed container, no server to maintain via Ansible. Shared IPv4 + IPv6 are free for HTTP/HTTPS; dedicated IPv4 is $2/mo if a service needs non-HTTP(S) protocols |
|
||||||
| Tunnel | Tailscale (existing) | Already in use, WireGuard encryption, ACL control |
|
| Tunnel | Tailscale (existing) | Already in use, WireGuard encryption, ACL control |
|
||||||
| DNS | CNAME at [[gandi]] | No DNS migration needed, no Cloudflare dependency |
|
| DNS | CNAME at [[gandi]] | No DNS migration needed, no Cloudflare dependency |
|
||||||
| TLS (public) | Fly.io auto-provisions Let's Encrypt | No cert management, `$0.10/mo` per hostname |
|
| TLS (public) | Fly.io auto-provisions Let's Encrypt | No cert management, `$0.10/mo` per hostname |
|
||||||
|
|
@ -323,10 +323,19 @@ set -euo pipefail
|
||||||
|
|
||||||
APP="blumeops-proxy"
|
APP="blumeops-proxy"
|
||||||
|
|
||||||
# Fetch Tailscale auth key from 1Password
|
# Fetch Tailscale auth key from Pulumi state
|
||||||
TS_AUTHKEY=$(op --vault vg6xf6vvfmoh5hqjjhlhbeoaie item get <FLY_ITEM_ID> --fields ts-authkey --reveal)
|
echo "Fetching Tailscale auth key from Pulumi..."
|
||||||
fly secrets set TS_AUTHKEY="$TS_AUTHKEY" -a "$APP"
|
TS_AUTHKEY=$(cd "$(dirname "$0")/../pulumi/tailscale" && pulumi stack select tail8d86e && pulumi stack output flyio_authkey --show-secrets)
|
||||||
echo "Tailscale auth key set"
|
fly secrets set TS_AUTHKEY="$TS_AUTHKEY" --stage -a "$APP"
|
||||||
|
echo "Tailscale auth key staged (will take effect on next deploy)"
|
||||||
|
|
||||||
|
# Allocate IPs (idempotent — fly errors if already allocated)
|
||||||
|
# Shared IPv4 is free and sufficient for HTTP/HTTPS services.
|
||||||
|
# Use 'fly ips allocate-v4' (no --shared) for dedicated IPv4 ($2/mo)
|
||||||
|
# if the service needs non-HTTP protocols.
|
||||||
|
fly ips allocate-v4 --shared -a "$APP" 2>/dev/null || true
|
||||||
|
fly ips allocate-v6 -a "$APP" 2>/dev/null || true
|
||||||
|
echo "IPs allocated"
|
||||||
|
|
||||||
# Add certs for all public domains (idempotent — fly ignores duplicates)
|
# Add certs for all public domains (idempotent — fly ignores duplicates)
|
||||||
fly certs add docs.eblu.me -a "$APP" 2>/dev/null || true
|
fly certs add docs.eblu.me -a "$APP" 2>/dev/null || true
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,17 @@ APP="blumeops-proxy"
|
||||||
|
|
||||||
# Fetch Tailscale auth key from Pulumi state
|
# Fetch Tailscale auth key from Pulumi state
|
||||||
echo "Fetching Tailscale auth key from Pulumi..."
|
echo "Fetching Tailscale auth key from Pulumi..."
|
||||||
TS_AUTHKEY=$(cd "$(dirname "$0")/../pulumi/tailscale" && pulumi stack output flyio_authkey --show-secrets)
|
TS_AUTHKEY=$(cd "$(dirname "$0")/../pulumi/tailscale" && pulumi stack select tail8d86e && pulumi stack output flyio_authkey --show-secrets)
|
||||||
fly secrets set TS_AUTHKEY="$TS_AUTHKEY" -a "$APP"
|
fly secrets set TS_AUTHKEY="$TS_AUTHKEY" --stage -a "$APP"
|
||||||
echo "Tailscale auth key set"
|
echo "Tailscale auth key staged (will take effect on next deploy)"
|
||||||
|
|
||||||
|
# Allocate IPs (idempotent — fly errors if already allocated)
|
||||||
|
# Shared IPv4 is free and sufficient for HTTP/HTTPS services.
|
||||||
|
# Use 'fly ips allocate-v4' (no --shared) for dedicated IPv4 ($2/mo)
|
||||||
|
# if the service needs non-HTTP protocols.
|
||||||
|
fly ips allocate-v4 --shared -a "$APP" 2>/dev/null || true
|
||||||
|
fly ips allocate-v6 -a "$APP" 2>/dev/null || true
|
||||||
|
echo "IPs allocated"
|
||||||
|
|
||||||
# Add certs for all public domains (idempotent — fly ignores duplicates)
|
# Add certs for all public domains (idempotent — fly ignores duplicates)
|
||||||
fly certs add docs.eblu.me -a "$APP" 2>/dev/null || true
|
fly certs add docs.eblu.me -a "$APP" 2>/dev/null || true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue