- Implement improved error handling for the purchase order upload process, ensuring that failures from n8n are properly surfaced to the user. - Introduce a timeout mechanism for the n8n fetch request to handle potential delays more effectively. - Refine the validation logic for the purchase order payload to ensure stricter adherence to expected formats and values.
69 lines
No EOL
3.1 KiB
Bash
69 lines
No EOL
3.1 KiB
Bash
# ============================================================
|
|
# MEGA Infrastructure — Development Environment
|
|
# ============================================================
|
|
# DEV values populated. Before going to production, generate fresh
|
|
# secrets and replace every CHANGE_ME_FOR_PROD line below. Keep this
|
|
# file out of git — it's a deployment reference, not a committed secret.
|
|
#
|
|
# NOTE: N8N_INGEST_SECRET below is already mirrored into the n8n
|
|
# workflow's Send PDF Callback / Send Image Callback x-ingest-secret
|
|
# header (same value, hardcoded — self-hosted Coolify n8n has no
|
|
# $env.* runtime). If you change one, change the other.
|
|
# ============================================================
|
|
|
|
|
|
# ----------------------------------------------------------
|
|
# NEXT.JS DASHBOARD (Vercel / host env)
|
|
# ----------------------------------------------------------
|
|
|
|
# Public base URL where the dashboard is served.
|
|
# Used as the callback target by the n8n workflow and for absolute links.
|
|
# (This value is hardcoded into the Send Callback nodes in n8n — if
|
|
# you ever change it, edit the workflow too.)
|
|
APP_URL=https://mega.dash.apphub.co.za
|
|
|
|
# Browser-visible PocketBase URL. Exposed to the client, must be https in prod.
|
|
NEXT_PUBLIC_POCKETBASE_URL=https://pb.mega.infra.apphub.co.za
|
|
|
|
# Default UI theme on first load: "light" or "dark"
|
|
NEXT_PUBLIC_DEFAULT_THEME=light
|
|
|
|
# PIN users enter on the login screen to access the dashboard.
|
|
# DEV default 1357 — CHANGE_ME_FOR_PROD before going live.
|
|
NEXT_PUBLIC_APP_PIN=2468
|
|
|
|
# PocketBase admin auth (server-side only).
|
|
# Use email + password OR a pre-set admin token — not both.
|
|
# DEV defaults below — CHANGE_ME_FOR_PROD before going live.
|
|
POCKETBASE_ADMIN_EMAIL=admin@mega.co.za
|
|
POCKETBASE_ADMIN_PASSWORD=12345678
|
|
# POCKETBASE_ADMIN_TOKEN=
|
|
|
|
# The webhook URL the upload route forwards PO files to.
|
|
# This is the n8n workflow's PRODUCTION URL — only reachable once the
|
|
# workflow is Published (top-right of the n8n editor).
|
|
# Use the /webhook-test/... variant during local iteration if you haven't
|
|
# published yet.
|
|
N8N_PO_INGEST_URL=https://wfdash.n8n.apphub.co.za/webhook/purchase-order-upload
|
|
|
|
# Shared secret between Next.js /api/purchase-orders/ingest and the n8n
|
|
# callback. DEV value below — already in the n8n workflow's Send Callback
|
|
# nodes. CHANGE_ME_FOR_PROD before going live (rotate both sides together).
|
|
N8N_INGEST_SECRET=b8dffe7b00fca75272bf9a090d15a3c59fa0ec20d6bb232f7bb792db0921ac3b
|
|
|
|
|
|
# ----------------------------------------------------------
|
|
# POCKETBASE (admin UI > Settings)
|
|
# ----------------------------------------------------------
|
|
# PocketBase itself reads these from its own env, not from the dashboard.
|
|
# They are listed here for completeness — set them in PocketBase's
|
|
# runtime config (or systemd unit / docker-compose env section).
|
|
#
|
|
# PB_ADMIN_EMAIL / PB_ADMIN_PASSWORD are used by the dashboard's
|
|
# server-side pbAdmin() client (matches POCKETBASE_ADMIN_* above).
|
|
#
|
|
# PB_URL is the public-facing PocketBase URL (matches NEXT_PUBLIC_POCKETBASE_URL).
|
|
|
|
PB_URL=https://pb.mega.infra.apphub.co.za
|
|
POCKETBASE_ADMIN_EMAIL=admin@mega.co.za
|
|
POCKETBASE_ADMIN_PASSWORD=12345678 |