﻿# Gapsoe CMS - MySQL
DATABASE_HOST=127.0.0.1
DATABASE_PORT=3306
DATABASE_NAME=gapsoe_cms
DATABASE_USER=root
DATABASE_PASSWORD=
DATABASE_CONNECTION_LIMIT=10

# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
CMS_SESSION_SECRET=change-this-to-a-long-random-secret-at-least-32-chars
CMS_SUPER_ADMIN_EMAIL=admin@gapsoe.local


# Managed tenant sub-domains (Shopify-style)
# Local: localhost -> stores become my-store.localhost
# Production example: gapsoecms.com -> stores become my-store.gapsoecms.com
# Add a wildcard DNS record: *.gapsoecms.com -> this Next.js server / reverse proxy.

CMS_PLATFORM_DOMAIN=localhost

# Optional public mirror used by client-side UI. The server availability API also returns the canonical value.
NEXT_PUBLIC_CMS_PLATFORM_DOMAIN=localhost
# Usually https in production. Local development uses http automatically for *.localhost.
CMS_PLATFORM_PROTOCOL=http

# Media Library (optional)
# Defaults to <project>/public/uploads when left blank.
MEDIA_STORAGE_DIR=
# Set this when uploads are served from a CDN/storage domain, e.g. https://cdn.example.com
MEDIA_PUBLIC_BASE_URL=
MEDIA_MAX_FILE_MB=20

# Secrets / integrations
# Used to encrypt Stripe/API secrets stored in MySQL. Use a long random production value.
CMS_ENCRYPTION_KEY=change-this-to-a-second-long-random-secret

# Custom-domain verification
# Public IP that should receive root-domain A records.
CMS_DOMAIN_TARGET_IP=
# Hostname that should receive www CNAME records, e.g. stores.example.com
CMS_DOMAIN_CNAME=
# Set true only when your hosting/reverse proxy automatically provisions SSL after DNS verification.
CMS_SSL_AUTO_ACTIVE=false

# Manual signup payment instructions (shown during account creation)
NEXT_PUBLIC_PAYMENT_BANK_NAME=Bank / wallet name
NEXT_PUBLIC_PAYMENT_ACCOUNT_TITLE=Gapsoe Digital
NEXT_PUBLIC_PAYMENT_ACCOUNT_NUMBER=YOUR_ACCOUNT_OR_IBAN

# Approval email delivery (optional; without these, messages stay in email_outbox)
RESEND_API_KEY=
EMAIL_FROM=Gapsoe CMS <accounts@example.com>

# Production helper
# Generate a production .env.local with fresh random secrets:
# npm.cmd run setup:env -- --domain=cms.example.com --ip=YOUR_REAL_SERVER_PUBLIC_IP
# Never use a random IP here. DNS must point to the real public IP/reverse proxy serving this app.

# V10.6 physical tenant database isolation.
# Each store is provisioned as: gapsoe_tenant_000001_store_slug
TENANT_DATABASE_PREFIX=gapsoe_tenant
TENANT_DATABASE_CONNECTION_LIMIT=4
