mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
Floci could run exactly one web console, the image it ships. This publishes the contract between Floci and a console so any image can take that slot, and an operator gets there by setting one image name rather than by configuring seven fields. Three things make a console a Floci console: it listens on the port in PORT, it serves GET /api/health, and it talks to Floci at AWS_ENDPOINT_URL. Everything else is detail the contract spells out, including the AWS baseline every launched container already receives, so a console built on any AWS SDK is configured by that SDK's ordinary endpoint and credential discovery. Floci learns a console's shape from three sources, in order. The image's own io.floci.console.* labels come first, so a console describes itself and needs no operator input at all. A built-in profile covers the consoles Floci already knows. The contract defaults (/api/health, port 4500, status: ok) cover the rest. Configuration overrides all three, for a console that describes itself neither way. That ladder is why the new config keys ship commented out in application.yml. They exist for the console that fits none of the three sources, and setting one silently disables the discovery that would otherwise just work. Every accessor is Optional or OptionalInt, so nothing is required and the test configuration needs no entry. A malformed label is ignored rather than fatal: a console that declares port="banana" starts on the default instead of failing the emulator, and the reason is logged. Docs: docs/ui/console-contract.md is the contract itself, written for console authors, and docs/ui/index.md is the operator's page. Both are in the mkdocs nav. Tests: 608 lines. ConsoleProfileResolverTest covers the resolution ladder including the precedence between its three sources; ContainerLifecycleManagerImageLabelsTest covers reading labels off an image; FlociUiManagerTest grows to cover the manager against the contract. Neutralising the label arm fails 5 of the 13 resolver tests, so the ladder is genuinely exercised rather than the tests only asserting defaults.