Files
scrabble-game/deploy/landing/Caddyfile
T
Ilia Denisov b6c2598710
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 26s
CI / ui (pull_request) Successful in 1m13s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Failing after 16m19s
feat(offer): live catalog price list in the public offer, served by the render sidecar
Robokassa moderation requires the public offer to list every digital good with
its price. Move /offer/ off the static landing container to the render sidecar:
it splices the live catalog price list (§4.4) into the owner-edited
ui/legal/offer_ru.md and renders it with the shared ui/src/lib/offer.ts — one
renderer, no drift, always matching the current catalog with no redeploy.

- backend: /api/v1/internal/offer/pricing (internal, off the edge allow-list)
  projects the active catalog into two markdown tables — chip packs priced per
  rail (roubles / VK votes / Telegram Stars) and chip-priced values — through
  payments.Money so no float reaches the page. Cached in memory: warmed at boot,
  marked stale on every catalog mutation, so a served render issues no query.
- renderer: GET /offer/ fetches the tables and substitutes them at the
  <#pricing_template#> marker, then renders; offer_ru.md is baked into the image
  and marked is bundled from ui. GET /offer -> 301. Only /offer/ is edge-exposed.
- caddy: route /offer/ to the sidecar; drop the now-dead landing /offer/
  handlers and the vite emit-offer plugin.
- offer: fill §4.3 (the chip-payment wording) and drop the in-page back link.
- landing footer: a feedback link (the offer's Telegram contact) beside the
  offer link.
- docs (ARCHITECTURE, FUNCTIONAL +_ru, renderer README), CI /offer/ probe,
  unit + integration + node tests.
2026-07-10 20:25:41 +02:00

34 lines
1.3 KiB
Caddyfile

# Static landing container. Serves the public landing page and the built
# assets it references at /; the game SPA (/app/, /telegram/) and the Connect
# edge stay on the gateway. The contour caddy routes the catch-all here, so
# stray public paths are absorbed by static file serving and never reach the Go
# edge. This file is baked into the image at build time (gateway/Dockerfile,
# target `landing`), not bind-mounted.
{
admin off
}
:80 {
root * /srv
encode zstd gzip
# Mirror the gateway webui caching: hash-named build assets are immutable,
# every HTML shell is no-cache so a new deploy is picked up immediately.
header /assets/* Cache-Control "public, max-age=31536000, immutable"
@shell not path /assets/*
header @shell Cache-Control "no-cache"
# The public offer page (/offer/) is no longer served here: the contour caddy routes it to the
# render sidecar, which splices the live catalog price list into ui/legal/offer_ru.md. This
# container never sees /offer/, so it carries no offer assets (the vite emit-offer plugin is gone).
# An unknown path falls back to the landing shell (the gateway's old "/"
# behaviour); "/" itself resolves through the index below.
handle {
try_files {path} /landing.html
file_server {
index landing.html
}
}
}