Repository navigation
Add the FAF webclient (webclient.faforever.com) - #350
Conversation
## Add the FAF webclient (webclient.faforever.com) Deploys [FAForever/webclient](https://github.com/FAForever/webclient): FAF in the browser and on phones, in the Rust client's design. Maps, mods, replays, leaderboards, open lobbies, tournaments and events need no account; the chat needs a FAF login. Set up exactly like faf-tournaments. ### `apps/faf-webclient` (new) - Image `faforever/faf-webclient:latest`, published on every push to `main` of FAForever/webclient; Keel rolls it out (`@every 2m`). - IngressRoute `webclient.$BASE_DOMAIN`, port 8098, `/healthz` probes. - Stateless: no volume, no database. - `FAF_BASE_DOMAIN` comes from `baseDomain`, so the test cluster's copy talks to the test servers (`api.faforever.xyz`, `hydra.faforever.xyz`, `chat.faforever.xyz`, ...). - Secret `faf-webclient` (Infisical), one key: `FAF_API_CLIENT_SECRET`. The secret is optional; without it the site runs and the Maps, Mods and Replays tabs say the login is missing. ### `apps/ory-hydra/values.yaml`: two clients 1. **"FAF Web (public)"**: service login, set up like "FAF Website (public)". `client_credentials`, scope `public_profile`, secret `FAFWEB_M2M_SECRET`. - Why: every `/data` read on the API needs a token, so listing maps, mods and replays needs one. - The token stays on the server and is only attached to read-only GETs of an allowlisted set of API resources. One cached copy per response (60 s) is shared by every visitor. 2. **"FAF Web"**: player login for the chat, set up like the desktop clients. Public client with PKCE, no secret. - Scope `openid,offline,public_profile`. No `lobby`, so no ownership check: it is only used to chat. - Redirect `https://webclient.$BASE_DOMAIN/auth/callback`. - The server swaps the code for tokens and fetches the IRC token from `user.$BASE_DOMAIN/irc/ergochat/token`, the same call the desktop clients make. Hydra and the user service have no CORS, which is why the server does this. The access token never leaves the server. - The browser then connects to `chat.$BASE_DOMAIN` over WebSocket itself, from the player's own IP. Ergo's multiclient keeps the desktop client connected. ### `Tiltfile` `faf-webclient` added next to `faf-tournaments`. ### Needs an admin 1. Infisical, prod and test: one random value, stored twice: - `FAFWEB_M2M_SECRET` in `ory-hydra` (Hydra creates the client with it) - `FAF_API_CLIENT_SECRET` in a new secret `faf-webclient` (the app logs in with it) 2. GitHub: FAForever/webclient needs the org's `DOCKER_USERNAME` / `DOCKER_PASSWORD` secrets, like faf-tournaments. 3. DNS for `webclient.faforever.com` and `webclient.faforever.xyz`, unless a wildcard already covers them.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Add the FAF webclient (webclient.faforever.com)
Deploys FAForever/webclient: FAF in the browser and on phones, in the Rust client's design. Maps, mods, replays, leaderboards, open lobbies, tournaments and events need no account; the chat needs a FAF login.
Set up exactly like faf-tournaments.
apps/faf-webclient(new)faforever/faf-webclient:latest, published on every push tomainof FAForever/webclient; Keel rolls it out (@every 2m).webclient.$BASE_DOMAIN, port 8098,/healthzprobes.FAF_BASE_DOMAINcomes frombaseDomain, so the test cluster's copy talks to the test servers (api.faforever.xyz,hydra.faforever.xyz,chat.faforever.xyz, ...).faf-webclient(Infisical), one key:FAF_API_CLIENT_SECRET. The secret is optional; without it the site runs and the Maps, Mods and Replays tabs say the login is missing.apps/ory-hydra/values.yaml: two clientsclient_credentials, scopepublic_profile, secretFAFWEB_M2M_SECRET./dataread on the API needs a token, so listing maps, mods and replays needs one.openid,offline,public_profile. Nolobby, so no ownership check: it is only used to chat.https://webclient.$BASE_DOMAIN/auth/callback.user.$BASE_DOMAIN/irc/ergochat/token, the same call the desktop clients make. Hydra and the user service have no CORS, which is why the server does this. The access token never leaves the server.chat.$BASE_DOMAINover WebSocket itself, from the player's own IP. Ergo's multiclient keeps the desktop client connected.Tiltfilefaf-webclientadded next tofaf-tournaments.Needs an admin
FAFWEB_M2M_SECRETinory-hydra(Hydra creates the client with it)FAF_API_CLIENT_SECRETin a new secretfaf-webclient(the app logs in with it)DOCKER_USERNAME/DOCKER_PASSWORDsecrets, like faf-tournaments.webclient.faforever.comandwebclient.faforever.xyz, unless a wildcard already covers them.Summary by CodeRabbit
webclient.<base domain>.