- Nouveau paquet internal/catalog : pool pgx, migrations SQL embarquées (sérialisées entre instances par verrou consultatif), transactions rejouées après conflit, interblocage ou bascule du primaire (pool vidé sur erreur de lecture seule ou de connexion). DSN multi-hôtes accepté (target_session_attrs=read-write) pour une future HA. - Store.UseCatalog : tags, icônes, auteurs (item_meta) et liens de partage (shares) lus et écrits en base ; chaque modification se fait sous verrou consultatif par racine (« main », « home/<id> »), donc sans perte d'écriture entre instances. Sans DATABASE_URL, rien ne change (JSON). - Reprise unique de .meta.json et .shares.json au premier branchement (table imports), fichiers renommés en *.imported. - Serveur : DATABASE_URL / DATABASE_URL_FILE, DATABASE_WAIT (60 s). - Compose : service postgres:16 sur un réseau interne dédié ; Traefik inchangé. Dockerfile : go.sum et téléchargement des modules. - Tests : UPANDOWN_TEST_DATABASE_URL fait passer toute la suite storage par la base ; tests de partage entre deux instances et de reprise JSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LNfwm4pfYR9C914C2EeiuB
82 lines
3.2 KiB
YAML
82 lines
3.2 KiB
YAML
# Up And Down
|
|
services:
|
|
upandown:
|
|
build: .
|
|
image: upandown:local
|
|
restart: unless-stopped
|
|
# ports:
|
|
# - "${UPANDOWN_PORT:-8080}:8080"
|
|
environment:
|
|
# Authentification : local (comptes + inscription), oidc, both ou none (reverse proxy qui authentifie).
|
|
AUTH_MODE: ${AUTH_MODE:-local}
|
|
# Administrateur initial (mode local ou both). Sans eux, le premier compte créé le devient.
|
|
ADMIN_USER: ${ADMIN_USER:-}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-}
|
|
# Inscription des comptes locaux : closed, approval (validation par un administrateur) ou open.
|
|
# Modifiable ensuite dans l'interface (Administration > Général).
|
|
REGISTRATION: ${REGISTRATION:-closed}
|
|
# OIDC (AUTH_MODE=oidc ou both). URI de redirection chez le fournisseur : https://<hôte>/auth/callback
|
|
OIDC_ISSUER: ${OIDC_ISSUER:-}
|
|
OIDC_CLIENT_ID: ${OIDC_CLIENT_ID:-}
|
|
OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET:-}
|
|
OIDC_REDIRECT_URL: ${OIDC_REDIRECT_URL:-}
|
|
# Ajouter « groups » pour OIDC_ALLOWED_GROUPS / OIDC_ADMIN_GROUPS.
|
|
OIDC_SCOPES: ${OIDC_SCOPES:-openid profile email groups}
|
|
OIDC_NAME: ${OIDC_NAME:-SSO}
|
|
OIDC_ALLOWED_GROUPS: ${OIDC_ALLOWED_GROUPS:-}
|
|
OIDC_GROUPS_CLAIM: ${OIDC_GROUPS_CLAIM:-groups}
|
|
OIDC_ADMIN_GROUPS: ${OIDC_ADMIN_GROUPS:-}
|
|
OIDC_ADMIN_EMAILS: ${OIDC_ADMIN_EMAILS:-}
|
|
OIDC_LOGOUT: ${OIDC_LOGOUT:-true}
|
|
SESSION_TTL: ${SESSION_TTL:-24h}
|
|
SESSION_SECRET: ${SESSION_SECRET:-}
|
|
PUBLIC_URL: ${PUBLIC_URL:-}
|
|
# Dépôts : taille maximale d'un fichier (Mo, 0 : illimité) ; quota par utilisateur (Mo, 0 : illimité).
|
|
MAX_UPLOAD_MB: ${MAX_UPLOAD_MB:-0}
|
|
USER_QUOTA_MB: ${USER_QUOTA_MB:-0}
|
|
COMMON_READONLY: ${COMMON_READONLY:-false}
|
|
TRASH_DAYS: ${TRASH_DAYS:-0}
|
|
# Historique des versions (remplacements) : versions gardées par fichier (0 : désactivé).
|
|
HISTORY_KEEP: ${HISTORY_KEEP:-10}
|
|
HISTORY_INTERVAL: ${HISTORY_INTERVAL:-0}
|
|
HISTORY_MAX_AGE: ${HISTORY_MAX_AGE:-0}
|
|
SHARE_SECRET: ${SHARE_SECRET:-}
|
|
# Catalogue PostgreSQL partagé (indispensable pour plusieurs instances).
|
|
# Plusieurs hôtes possibles pour une base répliquée :
|
|
# postgres://upandown:<mdp>@pg1,pg2/upandown?target_session_attrs=read-write
|
|
DATABASE_URL: ${DATABASE_URL:-postgres://upandown:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD requis}@postgres:5432/upandown?sslmode=disable}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
# Bind mount : chown -R 65532:65532 ./data
|
|
- ./data:/data
|
|
read_only: true
|
|
cap_drop: [ALL]
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
networks:
|
|
- traefik-net
|
|
- upandown-db
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: upandown
|
|
POSTGRES_USER: upandown
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD requis}
|
|
volumes:
|
|
- ./postgres:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U upandown -d upandown"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- upandown-db
|
|
networks:
|
|
upandown-db:
|
|
internal: true
|
|
traefik-net:
|
|
external: true
|