feat(settings): store Khanegi keys in settings tables instead of tenant JSON

Template defaults seed from deploy_settings_const; new tenants copy them, import decides per key, and /get_settings reads the per-tenant rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 20:14:17 +03:30
co-authored by Cursor
parent 8f9988eb15
commit d57ce0a3cb
15 changed files with 2659 additions and 354 deletions
+2 -1
View File
@@ -103,7 +103,8 @@ sudo certbot --nginx -d adm.montzar.ir
1. Open `https://adm.montzar.ir` → login
2. `https://adm.montzar.ir/get_user?domain=montpar.ir` (or any known domain)
3. Confirm uploads/logo URLs use `PUBLIC_API_URL`
3. `https://adm.montzar.ir/get_settings?domain=k.montzar.ir` (nginx must proxy `/get_settings` like `/get_user`)
4. Confirm uploads/logo URLs use `PUBLIC_API_URL`
## 8) Migrations with logical replication (failover replicas)
+10 -1
View File
@@ -1,7 +1,7 @@
# Place under /etc/nginx/sites-available/adm.montzar.ir
# SSL: assume Certbot already issued for adm.montzar.ir (or enable after first HTTP).
#
# Single domain: SPA at / + Nest API under /api + public get_user/get_version + uploads.
# Single domain: SPA at / + Nest API under /api + public get_user/get_settings/get_version + uploads.
upstream superadmin_api {
server 127.0.0.1:3010;
@@ -49,6 +49,15 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /get_settings {
proxy_pass http://superadmin_api;
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;
}
location = /get_version {
proxy_pass http://superadmin_api;
proxy_http_version 1.1;