feat: update upload functionality and permissions for document handling

- Removed the `upsert` option from the file upload in `uploadDoc` function to prevent unintended overwrites.
- Enhanced German translations in `i18n.js` for better clarity and consistency in the admin interface.
- Added new CSS styles for link interactions to improve user experience in `styles.css`.
- Updated Supabase SQL migration to grant additional permissions for anonymous users to insert and update storage objects, ensuring proper functionality during the booking flow.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
LagoESP
2026-04-29 20:09:27 +02:00
parent 30e296f61b
commit 4c1931cdf4
830 changed files with 9051 additions and 93 deletions
+70
View File
@@ -214,6 +214,7 @@ services:
- /mnt/user/appdata/mc-cars/supabase/migrations/04-kaution-weekend-km.sql:/sql/04-kaution-weekend-km.sql:ro
- /mnt/user/appdata/mc-cars/supabase/migrations/05-create-lead-rpc.sql:/sql/05-create-lead-rpc.sql:ro
- /mnt/user/appdata/mc-cars/supabase/migrations/06-admin-pricing-documents.sql:/sql/06-admin-pricing-documents.sql:ro
- /mnt/user/appdata/mc-cars/supabase/migrations/07-sales-orders.sql:/sql/07-sales-orders.sql:ro
entrypoint: ["sh","-c"]
command:
- |
@@ -236,6 +237,7 @@ services:
psql "postgresql://postgres:$$PGPASSWORD@db:5432/postgres" -v ON_ERROR_STOP=1 -f /sql/04-kaution-weekend-km.sql
psql "postgresql://postgres:$$PGPASSWORD@db:5432/postgres" -v ON_ERROR_STOP=1 -f /sql/05-create-lead-rpc.sql
psql "postgresql://postgres:$$PGPASSWORD@db:5432/postgres" -v ON_ERROR_STOP=1 -f /sql/06-admin-pricing-documents.sql
psql "postgresql://postgres:$$PGPASSWORD@db:5432/postgres" -v ON_ERROR_STOP=1 -f /sql/07-sales-orders.sql
echo "post-init done."
restart: "no"
networks: [mccars]
@@ -339,3 +341,71 @@ services:
- "55580:80"
networks: [mccars]
logging: { driver: json-file, options: { max-size: "10m", max-file: "3" } }
# -------------------------------------------------------------------------
# Admin panel (separate nginx instance on its own port)
# -------------------------------------------------------------------------
web-admin:
image: nginx:1.27-alpine
container_name: mccars-web-admin
restart: unless-stopped
depends_on:
- kong
environment:
SUPABASE_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_ANON_KEY: ${ANON_KEY}
volumes:
- /mnt/user/appdata/mc-cars/frontend:/usr/share/nginx/html
- /mnt/user/appdata/mc-cars/frontend/nginx-admin.conf:/etc/nginx/conf.d/default.conf:ro
entrypoint: ["/bin/sh", "-c", "printf 'window.MCCARS_CONFIG={SUPABASE_URL:\"%s\",SUPABASE_ANON_KEY:\"%s\"};\\n' \"$$SUPABASE_URL\" \"$$SUPABASE_ANON_KEY\" > /usr/share/nginx/html/config.js && exec nginx -g 'daemon off;'"]
ports:
- "55581:80"
networks: [mccars]
logging: { driver: json-file, options: { max-size: "10m", max-file: "3" } }
# -------------------------------------------------------------------------
# n8n - workflow automation (connects to Supabase via Postgres + REST)
# UI: http://localhost:55590
# -------------------------------------------------------------------------
n8n:
image: n8nio/n8n:latest
container_name: mccars-n8n
restart: unless-stopped
depends_on:
db:
condition: service_healthy
kong:
condition: service_started
environment:
# Core
N8N_HOST: 0.0.0.0
N8N_PORT: 5678
N8N_PROTOCOL: http
WEBHOOK_URL: http://localhost:55590/
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
# Database (n8n stores its own data in the same Postgres)
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: db
DB_POSTGRESDB_PORT: 5432
DB_POSTGRESDB_DATABASE: ${POSTGRES_DB}
DB_POSTGRESDB_USER: postgres
DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
DB_POSTGRESDB_SCHEMA: n8n
# Auto-create owner account on first boot
N8N_DEFAULT_USER_EMAIL: ${N8N_USER_EMAIL}
N8N_DEFAULT_USER_PASSWORD: ${N8N_USER_PASSWORD}
# Timezone
GENERIC_TIMEZONE: Europe/Vienna
TZ: Europe/Vienna
# Allow importing workflows from filesystem
N8N_USER_FOLDER: /home/node/.n8n
volumes:
- /mnt/user/appdata/mc-cars/data/n8n:/home/node/.n8n
ports:
- "55590:5678"
networks: [mccars]
logging: { driver: json-file, options: { max-size: "10m", max-file: "3" } }