From 38c05340121acb94020d6a5eab882920914bb5da Mon Sep 17 00:00:00 2001 From: R3D347HR4Y Date: Tue, 16 Jun 2026 11:32:56 +0200 Subject: [PATCH] fix(docs): update README and Nginx configuration for frontend routes - Corrected frontend route references in README to reflect updated paths for account and settings. - Modified Nginx configuration comments to align with the new route structure, ensuring clarity for development and production setups. - Added new Nginx location blocks for handling account settings and redirecting old paths to the new structure. --- README.md | 2 +- deploy/nginx/default.conf.template | 29 ++++++++++++++++++--- internal/api/mail/handlers_account_oauth.go | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fcf5463..e13f375 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Un seul **nginx** expose l’entrée HTTP (`:80`) et route : | `/auth/*` | Authentik | | `/meet/*` | Jitsi (si `JITSI_ENABLED=true`) | | `/cloud/*` | Nextcloud nginx+FPM (si `NEXTCLOUD_ENABLED=true`) | -| `/mail/*`, `/drive/*`, `/contacts`, `/agenda`, `/compte`, `/admin/*` | Suite frontend (`MAIL_FRONTEND_UPSTREAM`, défaut `host.docker.internal:3004` ; Docker : `suite-frontend:3000`) | +| `/mail/*`, `/drive/*`, `/contacts`, `/agenda`, `/account`, `/settings`, `/admin/*` | Suite frontend (`MAIL_FRONTEND_UPSTREAM`, défaut `host.docker.internal:3004` ; Docker : `suite-frontend:3000`) | Nextcloud : FPM + nginx dédié ; ultid appelle `NEXTCLOUD_URL` en interne (`http://nextcloud:80`). Caddy retiré : un seul proxy évite la double couche ; TLS plus tard (certbot, Traefik, ou `listen 443` nginx). diff --git a/deploy/nginx/default.conf.template b/deploy/nginx/default.conf.template index d1b2fb9..a0a3d76 100644 --- a/deploy/nginx/default.conf.template +++ b/deploy/nginx/default.conf.template @@ -946,7 +946,7 @@ server { proxy_set_header Connection $connection_upgrade; } - # Ulti Suite frontend (mail + drive + contacts + agenda + compte) — dev: pnpm dev on host (MAIL_FRONTEND_UPSTREAM=host.docker.internal:3004) + # Ulti Suite frontend (mail + drive + contacts + agenda + account + settings) — dev: pnpm dev on host (MAIL_FRONTEND_UPSTREAM=host.docker.internal:3004) # Prod: set MAIL_FRONTEND_UPSTREAM=suite-frontend:3000 # Démos publiques de la landing (zéro rétention) — frontend Next. location ^~ /demo { @@ -1068,8 +1068,8 @@ server { proxy_set_header Connection $connection_upgrade; } - # Réglages du compte Ulti - location ^~ /compte { + # Réglages mail Ultimail (hors /mail/*) + location ^~ /settings { resolver 127.0.0.11 valid=10s ipv6=off; set $mail_upstream ${MAIL_FRONTEND_UPSTREAM}; proxy_pass http://$mail_upstream; @@ -1082,6 +1082,29 @@ server { proxy_set_header Connection $connection_upgrade; } + # Compte utilisateur Ulti + location ^~ /account { + resolver 127.0.0.11 valid=10s ipv6=off; + set $mail_upstream ${MAIL_FRONTEND_UPSTREAM}; + proxy_pass http://$mail_upstream; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + } + + # Ancien chemin compte → /account (ne pas matcher /compte-mark.svg etc.) + location = /compte { + return 301 /account; + } + + location ^~ /compte/ { + rewrite ^/compte/(.*)$ /account/$1 permanent; + } + # Console d'administration suite location ^~ /admin { resolver 127.0.0.11 valid=10s ipv6=off; diff --git a/internal/api/mail/handlers_account_oauth.go b/internal/api/mail/handlers_account_oauth.go index 96bd97a..0531314 100644 --- a/internal/api/mail/handlers_account_oauth.go +++ b/internal/api/mail/handlers_account_oauth.go @@ -188,7 +188,7 @@ func (h *Handler) oauthReturnURL(status, code string) string { if base == "" { base = "http://localhost:3004" } - u := base + "/mail/settings/accounts?oauth=" + status + u := base + "/settings/accounts?oauth=" + status if code != "" { u += "&code=" + code }