diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index eacaa88..2bc2ed3 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -139,7 +139,7 @@ jobs: S3_SECRET_KEY=${ASXPIO_S3_SECRET_KEY} LTC_ADDRESS=${LTC_ADDRESS} CRYPTO_ADDRESSES=${CRYPTO_ADDRESSES} - BINGO_HOST=bingo.asxp.io + BINGO_HOST=datacenterbingo.xyz EOF chmod 600 /opt/asxpio/.env diff --git a/CLAUDE.md b/CLAUDE.md index af6d8e3..9d807d5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -117,7 +117,7 @@ Admin pages use a shared dark palette extended in `public/style.css` (search for ## Datacenter bingo -A second public site served from the **same process** on `BINGO_HOST` (`bingo.asxp.io`, non-secret config in `deploy.yaml` → `.env` → Traefik router `asxpio-bingo` via compose interpolation). `config.ru` dispatches by Host: `BINGO_HOST` → `BingoWeb` (`bingo_web.rb`), everything else → `AsxpioWeb`. Unset `BINGO_HOST` = bingo unreachable. +A second public site served from the **same process** on `BINGO_HOST` (`datacenterbingo.xyz`, `www.` redirects to it; non-secret config in `deploy.yaml` → `.env` → Traefik router `asxpio-bingo` via compose interpolation). `config.ru` dispatches by Host: `BINGO_HOST` → `BingoWeb` (`bingo_web.rb`), everything else → `AsxpioWeb`. Unset `BINGO_HOST` = bingo unreachable. - 5×5 card of the 25 largest Russian datacenters; a cell is crossed out when an incident (with a public source) is recorded. Rows/columns/diagonals → BINGO banner. - Locales `ru` / `en` / `uk` at `/ru`, `/en`, `/uk`; `/` redirects by `Accept-Language` (fallback `en`). Per-locale DB columns (`name_*`, `city_*`, `title_*`); `ru` is required, others fall back to it. UI strings in `Bingo::T` (`lib/bingo.rb`). diff --git a/config.ru b/config.ru index 38de138..3f1c1f3 100644 --- a/config.ru +++ b/config.ru @@ -8,6 +8,10 @@ bingo = BingoWeb.new bingo_host = ENV['BINGO_HOST'] run lambda { |env| - host = Rack::Request.new(env).host - (bingo_host && host == bingo_host ? bingo : asxpio).call(env) + req = Rack::Request.new(env) + if bingo_host && req.host == "www.#{bingo_host}" + [301, { 'location' => "https://#{bingo_host}#{req.fullpath}" }, []] + else + (bingo_host && req.host == bingo_host ? bingo : asxpio).call(env) + end } diff --git a/docker-compose.yml b/docker-compose.yml index 34e2d9a..9a22d6a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,7 @@ services: - "traefik.http.services.asxpio.loadbalancer.server.port=3000" # Datacenter bingo: same container, routed by Host in config.ru. # BINGO_HOST is interpolated from /opt/asxpio/.env (written by deploy). - - "traefik.http.routers.asxpio-bingo.rule=Host(`${BINGO_HOST}`)" + - "traefik.http.routers.asxpio-bingo.rule=Host(`${BINGO_HOST}`) || Host(`www.${BINGO_HOST}`)" - "traefik.http.routers.asxpio-bingo.entrypoints=websecure" - "traefik.http.routers.asxpio-bingo.tls=true" - "traefik.http.routers.asxpio-bingo.tls.certresolver=letsencrypt"