diff --git a/dev2/README.md b/dev2/README.md index 5bf5652..9b90a95 100644 --- a/dev2/README.md +++ b/dev2/README.md @@ -160,9 +160,12 @@ small file per site, so parallel migrations never edit a shared file: "companion_commands": { "genrewatch-worker": "bun run worker" }, "env_overrides": { "SITE_URL": "https://example.com" }, "pg_service": "Postgres-iVtY", "max_body": "256m", "branch": "master", - "env_remove": ["TURSO_DATABASE_URL", "TURSO_AUTH_TOKEN"] } + "env_remove": ["TURSO_DATABASE_URL", "TURSO_AUTH_TOKEN"], + "subnet_octet": 178 } ``` +`subnet_octet` replaces the `` in the app network `10.200..0/24` when another stack already holds that /24 (c0ncerts.com: bittorrented.com was hand-built on its 10.200.78.0/24). + ### Secrets in `env_overrides` `sites.d/` is committed and this repository is public, so a value that is a diff --git a/dev2/dev2-site b/dev2/dev2-site index f1eddbe..d2f89aa 100755 --- a/dev2/dev2-site +++ b/dev2/dev2-site @@ -685,7 +685,9 @@ def render_compose(s, st, app_port_inside, build_args=(), node_preset=()): # ran out at 34 networks on dev2, and widening them means restarting dockerd # under every container. 10.200..0/24 is deterministic and allowlisted # on the data ports. - n = s["port"] - FIRST_PORT + # `subnet_octet` in sites.d moves a site off a /24 another stack already holds + # (bittorrented.com was hand-built on c0ncerts.com's 10.200.78.0/24). + n = s.get("subnet_octet", s["port"] - FIRST_PORT) y.append(f"networks:\n default:\n ipam:\n config:\n - subnet: 10.200.{n}.0/24") # Healthchecks chosen by `dev2-site healthchecks` survive a re-render. return health_compose("\n".join(y) + "\n", st.get("healthchecks") or {}) diff --git a/dev2/sites.d/c0ncerts.com.json b/dev2/sites.d/c0ncerts.com.json new file mode 100644 index 0000000..5d6de50 --- /dev/null +++ b/dev2/sites.d/c0ncerts.com.json @@ -0,0 +1,16 @@ +{ + "db": "supabase", + "proxies": [ + { + "host": "supabase.c0ncerts.com", + "port": 8278, + "max_body": "512m" + } + ], + "env_overrides": { + "NEXT_PUBLIC_SUPABASE_URL": "https://supabase.c0ncerts.com", + "NEXT_PUBLIC_SUPABASE_ANON_KEY": "secret:NEXT_PUBLIC_SUPABASE_ANON_KEY", + "SUPABASE_SERVICE_ROLE_KEY": "secret:SUPABASE_SERVICE_ROLE_KEY" + }, + "subnet_octet": 178 +}