Infrastructure
Living beside other products
GAOS is not alone on the private VM. Several unrelated products share the same machine, the same tunnel and the same databases — held apart by a port register, a naming convention, and network boundaries that are structural rather than promised.
One VM, many products
Each product owns a stack, its own proxy, and exactly one tunnel port per environment. Nothing is shared at the routing layer: one product's misconfiguration cannot capture another product's traffic, because the two proxies never see each other's containers.
host → port
:18301:18101own port
That per-product proxy is worth the roughly 30–40 MB it idles at. The alternative — one shared ingress reading every container on the host — means a mislabelled container in one product can silently start answering for another, and the failure presents as a 404 with a healthy backend and nothing in any log.
The port register
Ports are derived, not remembered. The pattern is 1<env><product>1:
the second digit is the environment — 18xx1 production, 19xx1
non-production — and the middle pair identifies the product.
| Digits | Product | Production | Development |
|---|---|---|---|
00 | portal | 18001 | — |
01 | laundry | 18101 | 19101 |
02 | cubiq | 18201 | 19201 |
03 | gaos | 18301 | 19301 |
04 | pustaka | 18401 | — |
05 | jagara | 18501 | — |
06 | saas | 18601 | — |
A product's development port therefore falls out of its production port without a lookup. The register is the only thing preventing two products from claiming the same number, so claiming a slot means writing it down, not just using it.
One namespace per product
Each product gets a wildcard namespace and one line in the edge's host map. Adding a subdomain inside that namespace costs nothing at the edge — no DNS change, no certificate change, no nginx change — because the wildcard and the map entry already cover it.
Wildcards match exactly one level
*.gaos.mfardiansyah.id covers dev.gaos.mfardiansyah.id, but it
does not cover a.b.gaos.mfardiansyah.id. Every namespace level
needs its own DNS record and its own certificate SAN. The classic symptom is one product
working while another answers with a bare connection reset: a third-level wildcard was never
created, or its SAN never made it onto the certificate.
| Namespace | Product | Certificate |
|---|---|---|
clino.id · *.clino.id · *.dev.clino.id | laundry | clino |
*.gaos.mfardiansyah.id | gaos | mfardiansyah |
*.gaos. · *.pustaka. · *.jagara. · *.saas.mfardiansyah.id | allocated | mfardiansyah |
mfardiansyah.id · *.mfardiansyah.id | portal | mfardiansyah |
Every one of these is an A record pointing at the same address, the edge’s
one public IP. There is no second IP anywhere in the design.
What is shared and what is not
Databases are shared infrastructure — one database stack per environment, joined by the products that need it as an external network. That sharing is real, so the boundaries around it are drawn deliberately.
| Service | Container | Host port | Whose |
|---|---|---|---|
| ArcadeDB · prod | arcadedb-master | 9480 HTTP · 9688 Bolt | GAOS probes it; no schema applied yet |
| ArcadeDB · dev | arcadedb-master-dev | 9580 HTTP · 9788 Bolt | GAOS probes it; no schema applied yet |
| MinIO | minio-master | 11000 API · 11001 console | other projects — GAOS stores nothing there |
| MySQL | mysqldb-master | 5306 | other projects |
| Redis | redis-master-prod | 7379 | other projects |
| Qdrant | qdrant-master | 8333 · 8334 | other projects |
| RabbitMQ | rabbitmq-master | 7672 · 17672 | other projects |
| phpMyAdmin | pma-master | 8082 | other projects |
Networks: master-compose-ai-net (172.24.0.0/16) for production and
master-compose-ai-dev-net (172.28.0.0/16) for development. GAOS's own
internal networks are gaos-prod-int (172.30.12.0/24) and
gaos-dev-int (172.30.13.0/24) — pinned deliberately, because this host
already carries eleven bridge networks across 172.17–172.29 and an
unpinned range eventually collides with a neighbour.
Only what needs data joins the data network
In GAOS's stacks, only the dashboard joins the shared network. The proxy, the PWA, the panel and these docs cannot resolve — let alone reach — the neighbouring products' databases. Least privilege as a topology, not a policy.
The shared stack is nobody's to restart
The database stack belongs to the environment, not to a product. A product declares the network as external so it can never create it, and can therefore never quietly bring up a half-configured replacement of something its neighbours depend on.
A product touches only its own data
GAOS owns its own database and nothing else in the shared stack — the other schemas and buckets there belong to other projects. Sharing a network is not a licence to read what is on it.
Credentials come from the environment
No shared credential is ever copied into a product's repository. Values are referenced by name and supplied on the host, so a leak in one repository cannot expose infrastructure the other products depend on.
Never bulk-import the shared environment file
An env_file injects every line it finds. Appending the shared infrastructure
.env into a product's file hands that product's containers the credentials of every
other project on the host. Copy the handful of names actually needed, one line at a time.
A neighbour GAOS calls: ai-manager
Every other neighbour on this page is something GAOS must stay apart from. Since D-055 one is something it depends on: model work goes to ai-manager, which runs it through ai-claude-cli in a workspace per product. Both belong to the owner's AI stack, not to GAOS, and GAOS reaches ai-manager over HTTPS at its public address rather than by joining its network — the same boundary rule as everything above, applied to a dependency.
| Service | What GAOS uses | Credential |
|---|---|---|
ai-manager /v1/chat, /v1/requests/*, /v1/workspaces/* | Turns, polling, workspace context | The ai-stack Basic login, from a file |
ai-manager /admin/workspaces/* | Provisioning and file sync (once M14.1 exists) | The admin bearer, from a file — broader than GAOS needs (OQ-29) |
| ai-claude-cli | Nothing directly: its port stays private | — |
Its limits — 256 KB requests, a 600-second turn, two worker processes, one turn per session — are listed in The gateway §limits.
Adding a product
The routine work is three steps at the edge, and then nothing at the edge ever again.
- Claim the next free slot in the port register and write it down.
- Add the DNS record for the new wildcard namespace, and add the same name as a SAN on the certificate the edge renews.
- Add one line to the edge's host map, ordered so the more specific pattern wins.
Everything after that belongs to the product: its own compose stack, its own proxy on its own tunnel port, its own routing table, its own secrets. Subdomains within its namespace are its own business and cost nothing to add.
The checks that catch a bad neighbour
Two things go wrong quietly when a new stack lands: a port published without the tunnel address, which puts the stack on the local network; and a stack joining the wrong environment's shared network, which is undetectable at runtime because it simply works. Assert both mechanically. A smoke test will never find either one.
For the machinery underneath these conventions, see How the infrastructure runs; for GAOS's own two tiers, see Development and production.