Compare commits

..

2 commits

Author SHA1 Message Date
thibaud-leclere
eae320c76d chore: run pre-commit hook in Docker when pnpm is unavailable
Falls back to api-client-tools container (node_base stage) so lint and
typecheck always run regardless of the host environment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 16:57:12 +02:00
thibaud-leclere
8e8b715962 fix: revert to Coolify native SERVICE_FQDN_* variables for domain management
COOLIFY_URL/COOLIFY_FQDN were custom variables requiring manual setup,
causing VITE_BACKEND_WS_URL to resolve to wss://backend/graphql (broken).
SERVICE_FQDN_HOPPSCOTCH_80 triggers Coolify auto-generation of an editable
domain, and SERVICE_URL_HOPPSCOTCH provides the scheme-less form needed for
the wss:// WebSocket URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 14:48:08 +00:00
4 changed files with 27 additions and 20 deletions

View file

@ -48,8 +48,10 @@ API_CLIENT_TAG=latest
#-----------------------Coolify Prod Local Defaults----------------# #-----------------------Coolify Prod Local Defaults----------------#
# Used only when running docker-compose.prod.yml locally. # Used only when running docker-compose.prod.yml locally.
# Coolify generates these SERVICE_* values itself in production. # In production, Coolify auto-generates SERVICE_FQDN_* and SERVICE_URL_* from the
COOLIFY_URL=http://localhost:3000 # domain configured in the Coolify UI (editable per deployment).
COOLIFY_FQDN=localhost:3000 SERVICE_FQDN_HOPPSCOTCH_80=http://localhost:3000
SERVICE_FQDN_HOPPSCOTCH=http://localhost:3000
SERVICE_URL_HOPPSCOTCH=localhost:3000
SERVICE_PASSWORD_POSTGRES=testpass SERVICE_PASSWORD_POSTGRES=testpass
SERVICE_BASE64_HOPPSCOTCH=0123456789abcdef0123456789abcdef SERVICE_BASE64_HOPPSCOTCH=0123456789abcdef0123456789abcdef

View file

@ -1 +1,5 @@
npm run pre-commit if command -v pnpm > /dev/null 2>&1; then
npm run pre-commit
else
docker run --rm -v "$(pwd):/repo" -w /repo api-client-tools npm run pre-commit
fi

View file

@ -118,17 +118,17 @@ Le compose prod utilise l'image AIO et un seul domaine Coolify :
- `/admin` : admin - `/admin` : admin
- `/backend` : backend GraphQL/API - `/backend` : backend GraphQL/API
Variables générées/préremplies pour Coolify : Variables auto-générées par Coolify (éditables dans l'UI) :
- `COOLIFY_URL` : URL publique du service, issue du domaine renseigné dans Coolify - `SERVICE_FQDN_HOPPSCOTCH_80` : déclenche la génération du domaine public et la configuration du proxy
- `COOLIFY_FQDN` : domaine public sans schéma, issu du domaine renseigné dans Coolify - `SERVICE_FQDN_HOPPSCOTCH` : URL publique avec schéma (`https://api-xxx.host.fr`)
- `SERVICE_URL_HOPPSCOTCH` : domaine sans schéma, utilisé pour l'URL WebSocket (`wss://`)
- `SERVICE_PASSWORD_POSTGRES` : mot de passe PostgreSQL généré - `SERVICE_PASSWORD_POSTGRES` : mot de passe PostgreSQL généré
- `SERVICE_BASE64_HOPPSCOTCH` : clé stable générée de 32 caractères pour `DATA_ENCRYPTION_KEY` - `SERVICE_BASE64_HOPPSCOTCH` : clé stable de 32 caractères pour `DATA_ENCRYPTION_KEY`
Ne pas modifier les variables `SERVICE_FQDN_*` / `SERVICE_URL_*` dans Coolify : Coolify génère un domaine aléatoire au premier déploiement. Il est ensuite
elles sont générées et peuvent être écrasées. Renseigner uniquement le domaine modifiable dans l'UI Coolify sur le service `hoppscotch`. Les URLs
du service `hoppscotch` dans Coolify. Les URLs app/admin/backend sont ensuite app/admin/backend sont dérivées par sous-chemins automatiquement.
dérivées par sous-chemins via `COOLIFY_URL` et `COOLIFY_FQDN`.
Démarrer avec le tag `latest` : Démarrer avec le tag `latest` :

View file

@ -22,21 +22,22 @@ services:
restart: unless-stopped restart: unless-stopped
image: ${API_CLIENT_REGISTRY:-forge.lclr.dev}/${API_CLIENT_NAMESPACE:-thibaud-lclr}/${API_CLIENT_IMAGE_PREFIX:-api-client}-aio:${API_CLIENT_TAG:-latest} image: ${API_CLIENT_REGISTRY:-forge.lclr.dev}/${API_CLIENT_NAMESPACE:-thibaud-lclr}/${API_CLIENT_IMAGE_PREFIX:-api-client}-aio:${API_CLIENT_TAG:-latest}
environment: environment:
- SERVICE_FQDN_HOPPSCOTCH_80
- SERVICE_BASE64_HOPPSCOTCH - SERVICE_BASE64_HOPPSCOTCH
- DATABASE_URL=postgresql://postgres:${SERVICE_PASSWORD_POSTGRES}@hoppscotch-db:5432/${POSTGRES_DB:-hoppscotch} - DATABASE_URL=postgresql://postgres:${SERVICE_PASSWORD_POSTGRES}@hoppscotch-db:5432/${POSTGRES_DB:-hoppscotch}
- DATA_ENCRYPTION_KEY=${SERVICE_BASE64_HOPPSCOTCH} - DATA_ENCRYPTION_KEY=${SERVICE_BASE64_HOPPSCOTCH}
- REDIRECT_URL=${COOLIFY_URL} - REDIRECT_URL=${SERVICE_FQDN_HOPPSCOTCH}
- VITE_BASE_URL=${COOLIFY_URL} - VITE_BASE_URL=${SERVICE_FQDN_HOPPSCOTCH}
- VITE_SHORTCODE_BASE_URL=${COOLIFY_URL} - VITE_SHORTCODE_BASE_URL=${SERVICE_FQDN_HOPPSCOTCH}
- VITE_ADMIN_URL=${COOLIFY_URL}/admin - VITE_ADMIN_URL=${SERVICE_FQDN_HOPPSCOTCH}/admin
- VITE_BACKEND_GQL_URL=${COOLIFY_URL}/backend/graphql - VITE_BACKEND_GQL_URL=${SERVICE_FQDN_HOPPSCOTCH}/backend/graphql
- VITE_BACKEND_WS_URL=wss://${COOLIFY_FQDN}/backend/graphql - VITE_BACKEND_WS_URL=wss://${SERVICE_URL_HOPPSCOTCH}/backend/graphql
- VITE_BACKEND_API_URL=${COOLIFY_URL}/backend/v1 - VITE_BACKEND_API_URL=${SERVICE_FQDN_HOPPSCOTCH}/backend/v1
- VITE_APP_TOS_LINK=${VITE_APP_TOS_LINK:-https://docs.hoppscotch.io/support/terms} - VITE_APP_TOS_LINK=${VITE_APP_TOS_LINK:-https://docs.hoppscotch.io/support/terms}
- VITE_APP_PRIVACY_POLICY_LINK=${VITE_APP_PRIVACY_POLICY_LINK:-https://docs.hoppscotch.io/support/privacy} - VITE_APP_PRIVACY_POLICY_LINK=${VITE_APP_PRIVACY_POLICY_LINK:-https://docs.hoppscotch.io/support/privacy}
- VITE_PROXYSCOTCH_ACCESS_TOKEN=${VITE_PROXYSCOTCH_ACCESS_TOKEN:-} - VITE_PROXYSCOTCH_ACCESS_TOKEN=${VITE_PROXYSCOTCH_ACCESS_TOKEN:-}
- ENABLE_SUBPATH_BASED_ACCESS=true - ENABLE_SUBPATH_BASED_ACCESS=true
- WHITELISTED_ORIGINS=${COOLIFY_URL}/backend,${COOLIFY_URL},${COOLIFY_URL}/admin - WHITELISTED_ORIGINS=${SERVICE_FQDN_HOPPSCOTCH}/backend,${SERVICE_FQDN_HOPPSCOTCH},${SERVICE_FQDN_HOPPSCOTCH}/admin
- TRUST_PROXY=${TRUST_PROXY:-true} - TRUST_PROXY=${TRUST_PROXY:-true}
depends_on: depends_on:
hoppscotch-db: hoppscotch-db: