Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b64bd9703 | ||
|
|
ee1a22cbe9 | ||
|
|
68ece4222e | ||
|
|
7cba86f0c4 | ||
|
|
f059d56081 | ||
|
|
3e77b7d6d1 | ||
|
|
1f6ada41e9 | ||
|
|
91dd9c5389 | ||
|
|
7d8f0448cc | ||
|
|
34e6c912d5 | ||
|
|
0b6d5e76fd | ||
|
|
44053bb8de | ||
|
|
763c0cf9f3 | ||
|
|
afe36ace94 | ||
|
|
0fcb71c91d | ||
|
|
8a58030a9d | ||
|
|
83770d2b8e | ||
|
|
e3f179686b |
@@ -27,6 +27,8 @@ SECRET_POSTGRES_P_VERSION=v1
|
||||
SECRET_Y_API_KEY_VERSION=v1
|
||||
# DJANGO_HOST_EMAIL_PASSWORD
|
||||
SECRET_EMAIL_PASS_VERSION=v1
|
||||
# (the two RSA JWT keys are no longer secrets: the jwt-keys service generates
|
||||
# them into the jwt_keys volume on first deploy — see README)
|
||||
|
||||
##############################################################################
|
||||
# EMAIL
|
||||
|
||||
@@ -29,7 +29,7 @@ You should then be able to visit the landing page of your app, but not yet to lo
|
||||
|
||||
## RSA keys
|
||||
|
||||
Since v6, the backend and the collaboration server (`yhub`) authenticate each other with signed tokens. Each needs its own RSA private key, never the same one. The recipe generates both automatically on first deploy into the `jwt_keys` volume (the `jwt-keys` service, using the yhub image's Node crypto) and reuses them on later deploys. They are not Swarm secrets because abra cannot generate PEM keys and Swarm secrets must exist before the stack is deployed.
|
||||
Since v6, the backend and the collaboration server (`yhub`) authenticate each other with signed tokens. Each needs its own RSA private key, never the same one. The recipe generates both automatically on first deploy into the `jwt_keys` volume (the `jwt-keys` service, using Node crypto) and reuses them on later deploys. They are not Swarm secrets because abra cannot generate PEM keys and Swarm secrets must exist before the stack is deployed.
|
||||
|
||||
## Upgrading from v5 to v6
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Set any config versions here
|
||||
# Docs: https://docs.coopcloud.tech/maintainers/handbook/#manage-configs
|
||||
export ABRA_ENTRYPOINT_VERSION=v6
|
||||
export NGINX_CONF_VERSION=v4
|
||||
export NGINX_CONF_VERSION=v5
|
||||
export PG_BACKUP_VERSION=v5
|
||||
export MINIO_INITIALIZE_VERSION=v2
|
||||
export MIGRATE_VERSION=v1
|
||||
|
||||
+70
-47
@@ -57,6 +57,7 @@ x-common-env: &common-env
|
||||
# Collaboration server (yhub), reached in-stack
|
||||
YHUB_API_BASE_URL: http://yhub:3002
|
||||
# RSA key signing the tokens the backend presents to yhub and y-provider
|
||||
# (generated at runtime by the jwt-keys service, shared via the jwt_keys volume)
|
||||
JWT_PRIVATE_KEY_FILE: /keys/jwt.pem
|
||||
# Email app URL (used in email templates; matches recipe DOMAIN)
|
||||
DJANGO_EMAIL_URL_APP: "https://${DOMAIN}"
|
||||
@@ -105,6 +106,7 @@ x-yhub-env: &yhub-env
|
||||
COLLABORATION_BACKEND_BASE_URL: https://${DOMAIN}
|
||||
COLLABORATION_SERVER_ORIGIN: https://${DOMAIN}
|
||||
Y_PROVIDER_API_KEY_FILE: /run/secrets/y_api_key
|
||||
# (generated at runtime by the jwt-keys service, shared via the jwt_keys volume)
|
||||
YHUB_JWT_PRIVATE_KEY_FILE: /keys/yhub-jwt.pem
|
||||
# Seed documents from the pre-v6 media bucket the first time they are opened.
|
||||
# Only turn off once `abra app cmd <app> backend migrate_documents` covered all documents.
|
||||
@@ -120,14 +122,14 @@ x-minio-env: &minio-env
|
||||
|
||||
services:
|
||||
app:
|
||||
image: lasuite/impress-frontend:v6.0.4
|
||||
image: lasuite/impress-frontend:v6.1.0-1
|
||||
networks:
|
||||
- backend
|
||||
deploy:
|
||||
labels:
|
||||
- "traefik.enable=false"
|
||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
||||
- "coop-cloud.${STACK_NAME}.version=1.0.1+v6.0.4"
|
||||
- "coop-cloud.${STACK_NAME}.version=2.1.2+v6.1.0-1"
|
||||
user: "${DOCKER_USER:-1000}"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080"]
|
||||
@@ -137,7 +139,7 @@ services:
|
||||
start_period: 10s
|
||||
|
||||
backend:
|
||||
image: lasuite/impress-backend:v6.0.4
|
||||
image: lasuite/impress-backend:v6.1.1
|
||||
networks:
|
||||
- backend
|
||||
environment:
|
||||
@@ -152,7 +154,7 @@ services:
|
||||
user: "${DOCKER_USER:-1000}"
|
||||
command: ["gunicorn", "-c", "/usr/local/etc/gunicorn/impress.py", "impress.wsgi:application"]
|
||||
entrypoint: >
|
||||
sh -c "while [ ! -s /keys/jwt.pem ]; do sleep 1; done; if [ \"$$AUTO_MIGRATIONS\" = \"true\" ]; then /migrate.sh; fi && exec /abra-entrypoint.sh /usr/local/bin/entrypoint \"$$@\"" --
|
||||
sh -c "while [ ! -r /keys/jwt.pem ]; do sleep 1; done; if [ \"$$AUTO_MIGRATIONS\" = \"true\" ]; then /migrate.sh; fi && exec /abra-entrypoint.sh /usr/local/bin/entrypoint \"$$@\"" --
|
||||
volumes:
|
||||
- jwt_keys:/keys:ro
|
||||
configs:
|
||||
@@ -173,7 +175,7 @@ services:
|
||||
- email_pass
|
||||
|
||||
celery:
|
||||
image: lasuite/impress-backend:v6.0.4
|
||||
image: lasuite/impress-backend:v6.1.1
|
||||
networks:
|
||||
- backend
|
||||
healthcheck:
|
||||
@@ -187,7 +189,7 @@ services:
|
||||
environment:
|
||||
<<: [*common-env, *postgres-env, *yprovider-env]
|
||||
entrypoint: >
|
||||
sh -c "while [ ! -s /keys/jwt.pem ]; do sleep 1; done; exec /abra-entrypoint.sh /usr/local/bin/entrypoint \"$$@\"" --
|
||||
sh -c "while [ ! -r /keys/jwt.pem ]; do sleep 1; done; exec /abra-entrypoint.sh /usr/local/bin/entrypoint \"$$@\"" --
|
||||
volumes:
|
||||
- jwt_keys:/keys:ro
|
||||
configs:
|
||||
@@ -206,7 +208,7 @@ services:
|
||||
|
||||
# Collaboration server: serves the websocket and holds the document content
|
||||
yhub:
|
||||
image: lasuite/impress-yhub:v6.0.4
|
||||
image: lasuite/impress-yhub:v6.1.1
|
||||
networks:
|
||||
- backend
|
||||
environment: *yhub-env
|
||||
@@ -217,10 +219,30 @@ services:
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
start_period: 30s
|
||||
# The server never creates its schema: run the idempotent init-db before every start
|
||||
entrypoint: >
|
||||
sh -c "while [ ! -s /keys/yhub-jwt.pem ]; do sleep 1; done; export POSTGRES=\"postgres://docs:$$(node -e 'process.stdout.write(encodeURIComponent(require(\"fs\").readFileSync(\"/run/secrets/postgres_p\",\"utf8\").trim()))')@db:5432/yhub\" && node node_modules/@y/hub/bin/init-db.js && exec /usr/local/bin/entrypoint \"$$@\"" --
|
||||
command: ["node", "--import", "./dist/sentry.js", "dist/server.js"]
|
||||
# Since v6.1.0 the image is distroless (no shell), so this is plain node:
|
||||
# - wait for the RSA key the jwt-keys sidecar generates into the shared volume
|
||||
# - POSTGRES has no _FILE variant: build it from the postgres_p secret
|
||||
# - the server never creates its schema: run the idempotent init-db
|
||||
# (dist/init-db.js retries while postgres isn't up yet) before every start
|
||||
# - then load sentry and the server in this process, like the image's
|
||||
# `node --import ./dist/sentry.js dist/server.js`
|
||||
# No `$` in here, or compose would interpolate it.
|
||||
entrypoint:
|
||||
- node
|
||||
- -e
|
||||
- >-
|
||||
const fs = require('fs'), cp = require('child_process');
|
||||
const key = '/keys/yhub-jwt.pem';
|
||||
const hasKey = () => { try { fs.accessSync(key, fs.constants.R_OK); return true; } catch { return false; } };
|
||||
const sab = new Int32Array(new SharedArrayBuffer(4));
|
||||
for (let i = 0; i < 300 && !hasKey(); i++) Atomics.wait(sab, 0, 0, 1000);
|
||||
if (!hasKey()) { console.error('yhub: RSA key never appeared in /keys'); process.exit(1); }
|
||||
const pw = encodeURIComponent(fs.readFileSync('/run/secrets/postgres_p', 'utf8').trim());
|
||||
process.env.POSTGRES = 'postgres://docs:' + pw + '@db:5432/yhub';
|
||||
const r = cp.spawnSync(process.execPath, ['/app/dist/init-db.js'], { stdio: 'inherit' });
|
||||
if (r.status !== 0) process.exit(r.status ?? 1);
|
||||
import('/app/dist/sentry.js').then(() => import('/app/dist/server.js'));
|
||||
# The image's CMD gets appended to `node -e` as extra argv and is ignored
|
||||
volumes:
|
||||
- jwt_keys:/keys:ro
|
||||
secrets:
|
||||
@@ -231,7 +253,7 @@ services:
|
||||
|
||||
# Valkey of yhub: holds updates not yet persisted to postgres, so it is a store, not a cache
|
||||
yhub-valkey:
|
||||
image: valkey/valkey:8.1.11-alpine
|
||||
image: valkey/valkey:9.2.1-alpine
|
||||
command: ["valkey-server", "--maxmemory-policy", "volatile-lru", "--appendonly", "yes", "--appendfsync", "everysec"]
|
||||
healthcheck:
|
||||
test: ["CMD", "valkey-cli", "ping"]
|
||||
@@ -246,12 +268,45 @@ services:
|
||||
labels:
|
||||
backupbot.backup: "${ENABLE_BACKUPS:-true}"
|
||||
|
||||
# Conversion service only since v6 (no longer serves the collaboration)
|
||||
y-provider:
|
||||
image: lasuite/impress-y-provider:v6.1.1
|
||||
networks:
|
||||
- backend
|
||||
healthcheck:
|
||||
# y-provider returns 403 on unauthenticated requests; wget exit 4 = network error (server down), anything else = server is responding
|
||||
test: ["CMD-SHELL", "wget -qO /dev/null http://localhost:4444/ 2>/dev/null; test $$? -ne 4"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
environment: *yprovider-env
|
||||
user: "${DOCKER_USER:-1000}"
|
||||
entrypoint: >
|
||||
sh -c "export Y_PROVIDER_API_KEY=\"$$(cat /run/secrets/y_api_key)\" && exec /usr/local/bin/entrypoint \"$$@\"" --
|
||||
command: ["yarn", "start"]
|
||||
secrets:
|
||||
- y_api_key
|
||||
|
||||
docspec:
|
||||
image: ghcr.io/docspec/api:1.21.11
|
||||
networks:
|
||||
- backend
|
||||
healthcheck:
|
||||
# Use 127.0.0.1 (not localhost) for this healthcheck
|
||||
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:3000/health"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
# Generates the two RSA keys the backend and yhub sign with, into a shared volume.
|
||||
# They cannot be abra-generated secrets (PEM format) and Swarm secrets cannot be
|
||||
# created at deploy time, so this idempotent sidecar creates them once and keeps them
|
||||
# on the volume across redeploys. Both consumers wait for their file before starting.
|
||||
# Uses a plain Node image (not the yhub image): yhub v6.1.0 is distroless (no shell).
|
||||
jwt-keys:
|
||||
image: lasuite/impress-yhub:v6.0.4
|
||||
image: node:22-alpine
|
||||
networks:
|
||||
- backend
|
||||
user: "0"
|
||||
@@ -279,38 +334,6 @@ services:
|
||||
chmod 0400 /keys/jwt.pem /keys/yhub-jwt.pem
|
||||
while true; do sleep 3600; done
|
||||
|
||||
# Conversion service only since v6 (no longer serves the collaboration)
|
||||
y-provider:
|
||||
image: lasuite/impress-y-provider:v6.0.4
|
||||
networks:
|
||||
- backend
|
||||
healthcheck:
|
||||
# y-provider returns 403 on unauthenticated requests; wget exit 4 = network error (server down), anything else = server is responding
|
||||
test: ["CMD-SHELL", "wget -qO /dev/null http://localhost:4444/ 2>/dev/null; test $$? -ne 4"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
environment: *yprovider-env
|
||||
user: "${DOCKER_USER:-1000}"
|
||||
entrypoint: >
|
||||
sh -c "export Y_PROVIDER_API_KEY=\"$$(cat /run/secrets/y_api_key)\" && exec /usr/local/bin/entrypoint \"$$@\"" --
|
||||
command: ["yarn", "start"]
|
||||
secrets:
|
||||
- y_api_key
|
||||
|
||||
docspec:
|
||||
image: ghcr.io/docspec/api:1.21.4
|
||||
networks:
|
||||
- backend
|
||||
healthcheck:
|
||||
# Use 127.0.0.1, which is required instead of localhost for this healtcheck because of elixir/busybox bindings
|
||||
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:3000/health"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
db:
|
||||
image: pgautoupgrade/pgautoupgrade:18-debian
|
||||
networks:
|
||||
@@ -339,7 +362,7 @@ services:
|
||||
- postgres_p
|
||||
|
||||
redis:
|
||||
image: redis:8.10.3
|
||||
image: redis:8.12.0
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 15s
|
||||
@@ -380,7 +403,7 @@ services:
|
||||
- minio_ru
|
||||
|
||||
web:
|
||||
image: nginx:1.31.8
|
||||
image: nginx:1.31.10
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8083"]
|
||||
interval: 15s
|
||||
|
||||
+8
-2
@@ -13,6 +13,12 @@ server {
|
||||
# Disables server version feedback on pages and in headers
|
||||
server_tokens off;
|
||||
|
||||
# Docker's embedded DNS. Used to resolve yhub per request (via a variable
|
||||
# in proxy_pass) so nginx doesn't refuse to start while yhub isn't healthy
|
||||
# yet: swarm only publishes a service's DNS name once it has a healthy task.
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
set $yhub_upstream http://{{ env "STACK_NAME" }}_yhub:3002;
|
||||
|
||||
location @proxy_to_docs_backend {
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header Host $http_host;
|
||||
@@ -62,7 +68,7 @@ server {
|
||||
proxy_set_header Connection "Upgrade";
|
||||
|
||||
# Collaboration server
|
||||
proxy_pass http://{{ env "STACK_NAME" }}_yhub:3002;
|
||||
proxy_pass $yhub_upstream;
|
||||
|
||||
# Set appropriate timeout for WebSocket
|
||||
proxy_read_timeout 86400;
|
||||
@@ -76,7 +82,7 @@ server {
|
||||
|
||||
# Document routes (http fallback, history) and the public keys of yhub
|
||||
location ~ ^/collaboration/(ydoc|activity|changeset|rollback|jwks)/ {
|
||||
proxy_pass http://{{ env "STACK_NAME" }}_yhub:3002;
|
||||
proxy_pass $yhub_upstream;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header Origin $http_origin;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Upgrade valkey to latest version
|
||||
@@ -0,0 +1 @@
|
||||
Latest images need different handling, but you should not need to change anything!
|
||||
@@ -0,0 +1 @@
|
||||
Patches nginx image
|
||||
+24
-11
@@ -1,13 +1,26 @@
|
||||
⚠️ Major upgrade to Docs v6: the collaboration server is replaced by the new `yhub`
|
||||
service, and existing documents have to be migrated to it, or they open EMPTY.
|
||||
Patch upgrade to Docs v6.1.1 + valkey 9.2.1, and v6 deployable without manual keys.
|
||||
|
||||
`SECRET_COLLAB_SS_VERSION` and the `collab_ss` secret are no longer used. The two
|
||||
RSA keys the backend and yhub sign with are generated automatically on first
|
||||
deploy into the `jwt_keys` volume (the `jwt-keys` service) and reused afterwards;
|
||||
no manual secret insertion is needed.
|
||||
- Docs app images bumped v6.1.0 -> v6.1.1 (backend, celery, yhub, y-provider);
|
||||
the frontend image stays v6.1.0-1 (no v6.1.1 frontend image published yet).
|
||||
Includes upstream security fixes (access-request/role/invitation rights,
|
||||
email normalization, document move/duplicate rights). Celery v6.1.1 adds
|
||||
heartbeat-file probes but still answers `celery inspect ping`, so the
|
||||
existing healthcheck keeps working. Auto-migrations apply 0037 on startup.
|
||||
Changelog: https://github.com/suitenumerique/docs/releases/tag/v6.1.1
|
||||
- yhub-valkey bumped 9.2.0-alpine -> 9.2.1-alpine (in-line patch; bug fixes,
|
||||
incl. TLS loading and the forkless-save crash). Changelog:
|
||||
https://github.com/valkey-io/valkey/releases/tag/9.2.1
|
||||
- Docspec moves to the Rust `ghcr.io/docspec/api:1.21.11` (port 3000), which
|
||||
Docs >= 5.7 expects; the archived Elixir `ghcr.io/docspecio/api` (port 4000)
|
||||
is removed. Changelog: https://github.com/docspec/docspec/releases
|
||||
(1.21.4 -> 1.21.11 is within-major, no breaking changes; 2.0.0 is still RC).
|
||||
- The two RSA JWT keys (backend <-> yhub) are now generated at runtime by a
|
||||
`jwt-keys` sidecar (`node:22-alpine`) into the `jwt_keys` volume; the backend,
|
||||
celery and yhub wait for their file. `SECRET_JWT_PK_VERSION` /
|
||||
`SECRET_YHUB_JWT_PK_VERSION` are gone -- fresh installs deploy without manual
|
||||
`abra app secret insert` of PEMs, and upgrades move to the new keys
|
||||
transparently.
|
||||
- Postgres stays pgautoupgrade 18-debian: the same-shape 19-debian image is a
|
||||
DB major and is held (app support / migration window not declared).
|
||||
|
||||
After deploying (SOFT_MIGRATION is on by default), migrate all documents:
|
||||
|
||||
abra app cmd <app-name> backend migrate_documents
|
||||
|
||||
Only then may you set SOFT_MIGRATION=false. See the README for details.
|
||||
Recommended release: `abra recipe release lasuite-docs -z`
|
||||
|
||||
Reference in New Issue
Block a user