From 063662b92698dad5eaf523342f91864c86ee87ba Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 4 Oct 2026 16:30:24 +0200 Subject: [PATCH] The photo app's definition under today's rules, so the mesh builds it from here again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 2026-10-04 the mesh held photos from the catalogue's stub — a server and an admin client — which dropped the eef and filip sites and the api, flip and filip-api routes. This definition could not simply be rebuilt: it named photos-api.novox.be and its own host paths, and transcribed the bucket. Endpoints are named and every route names one; the client is told the api's composed name; paths are the mesh's ${dir:state}; the bucket is the one the store derives (hq ADR 0202), the same mesh-novox-photos the data lives in. --- module.json | 59 +++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/module.json b/module.json index 6cf7beb..cd3692f 100644 --- a/module.json +++ b/module.json @@ -10,97 +10,98 @@ "route" ], "contributes": { - "s3-bucket": { - "bucket": "photos" - }, "mongodb-database": { "name": "photos" }, "route": { "api": { "label": "photos-api", - "port": 9102 + "endpoint": "api" }, "admin": { "label": "photos", - "port": 8102 + "endpoint": "admin" }, "eef": { "label": "eef", - "port": 8104 + "endpoint": "eef" }, "filip": { "label": "filip", - "port": 8103 + "endpoint": "filip" }, "flip": { "label": "flip", - "port": 8103 + "endpoint": "filip" }, "filip-api": { "label": "filip-api", - "port": 9102 + "endpoint": "api" } } }, "binds": { - "s3-bucket": "/var/lib/photos/store.json", - "mongodb-database": "/var/lib/photos/database.json", - "route": "/var/lib/photos/route.json" + "s3-bucket": "${dir:state}/store.json", + "mongodb-database": "${dir:state}/database.json", + "route": "${dir:state}/route.json" }, "secrets": { - "s3-bucket": "/var/lib/photos/store.secret", - "mongodb-database": "/var/lib/photos/database.secret" + "s3-bucket": "${dir:state}/store.secret", + "mongodb-database": "${dir:state}/database.secret" }, "own-secrets": { - "admin-key": "/var/lib/photos/admin-key.secret" + "admin-key": "${dir:state}/admin-key.secret" }, "listens": [ { + "name": "api", "port": 9102, "protocol": "tcp", "from": "mesh", - "why": "the photos API over http; photos-api.novox.be is a route grant, and the proxy reaches it here. The machine side of the 9102:9000 mapping, named because three of this module's containers share the container-side port 80 and only the machine side tells them apart" + "why": "the photos API over http, which every client site calls; reached by the proxy here under the api and filip-api routes. The machine side of the 9102:9000 mapping" }, { + "name": "admin", "port": 8102, "protocol": "tcp", "from": "mesh", - "why": "the admin client site over http; the public name photos.novox.be is a route grant, and the proxy reaches it here" + "why": "the admin client site over http; reached by the proxy here under the photos route" }, { + "name": "filip", "port": 8103, "protocol": "tcp", "from": "mesh", - "why": "the filip client site over http; the public name filip.novox.be is a route grant, and the proxy reaches it here" + "why": "the filip client site over http; reached by the proxy here under the filip and flip routes" }, { + "name": "eef", "port": 8104, "protocol": "tcp", "from": "mesh", - "why": "the eef client site over http; the public name eef.novox.be is a route grant, and the proxy reaches it here" + "why": "the eef client site over http; reached by the proxy here under the eef route" } ], "resources": [ { "id": "state", "type": "directory", - "path": "/var/lib/photos", - "mode": "0700" + "mode": "0700", + "place": "." }, { "id": "server-env", "type": "file", - "path": "/var/lib/photos/server.env", + "path": "${dir:state}/server.env", "mode": "0600", - "content": "NODE_ENV=production\nPORT=9000\nMONGO_URL=mongodb://${bound:mongodb-database:as}:${secret:mongodb-database}@${bound:mongodb-database:at}:${bound:mongodb-database:port}/${bound:mongodb-database:as}?authSource=${bound:mongodb-database:as}\nMONGO_DB=${bound:mongodb-database:as}\nMINIO_ENDPOINT=${bound:s3-bucket:at}\nMINIO_PORT=${bound:s3-bucket:port}\nMINIO_BUCKET=mesh-novox-photos\nMINIO_ACCESSKEY=${bound:s3-bucket:as}\nMINIO_SECRET=${secret:s3-bucket}\nMINIO_USE_SSL=false\nSUPER_ADMIN_KEY=${secret:admin-key}\n" + "content": "NODE_ENV=production\nPORT=9000\nMONGO_URL=mongodb://${bound:mongodb-database:as}:${secret:mongodb-database}@${bound:mongodb-database:at}:${bound:mongodb-database:port}/${bound:mongodb-database:as}?authSource=${bound:mongodb-database:as}\nMONGO_DB=${bound:mongodb-database:as}\nMINIO_ENDPOINT=${bound:s3-bucket:at}\nMINIO_PORT=${bound:s3-bucket:port}\nMINIO_BUCKET=${bound:s3-bucket:bucket}\nMINIO_ACCESSKEY=${bound:s3-bucket:as}\nMINIO_SECRET=${secret:s3-bucket}\nMINIO_USE_SSL=false\nSUPER_ADMIN_KEY=${secret:admin-key}\n" }, { "id": "client-env", "type": "file", - "path": "/var/lib/photos/client.env", + "path": "${dir:state}/client.env", "mode": "0644", - "content": "REACT_APP_API_URL=https://photos-api.novox.be\n" + "content": "REACT_APP_API_URL=https://${bound:route:name-api}\n" }, { "id": "net", @@ -114,7 +115,7 @@ "artifact": "server", "network": "photos", "env-file": [ - "/var/lib/photos/server.env" + "${dir:state}/server.env" ], "ports": [ "9102:9000" @@ -128,7 +129,7 @@ "artifact": "admin-client", "network": "photos", "env-file": [ - "/var/lib/photos/client.env" + "${dir:state}/client.env" ], "ports": [ "8102:80" @@ -141,7 +142,7 @@ "artifact": "client", "network": "photos", "env-file": [ - "/var/lib/photos/client.env" + "${dir:state}/client.env" ], "ports": [ "8104:80" @@ -154,7 +155,7 @@ "artifact": "client", "network": "photos", "env-file": [ - "/var/lib/photos/client.env" + "${dir:state}/client.env" ], "ports": [ "8103:80"