Compare commits
No commits in common. "13b5f2bbcb5b879736897367ed1c75759572d544" and "130a21b221b689492ec623cc12fd3838ec67842d" have entirely different histories.
13b5f2bbcb
...
130a21b221
4 changed files with 8 additions and 33 deletions
10
.env.example
10
.env.example
|
|
@ -30,16 +30,6 @@ EMAIL_FROM_NAME=Eva Shafik
|
||||||
# Timezone used for booking times in emails (IANA name)
|
# Timezone used for booking times in emails (IANA name)
|
||||||
SITE_TIMEZONE=Europe/Oslo
|
SITE_TIMEZONE=Europe/Oslo
|
||||||
|
|
||||||
# Public URLs the browser uses: <URL_SCHEME>://admin.<DOMAIN><URL_PORT>.
|
|
||||||
# They must match the address bar exactly (SvelteKit's form CSRF check).
|
|
||||||
# Local default: http + :8080. Behind a reverse proxy / TLS on 443, e.g.:
|
|
||||||
# URL_SCHEME=https
|
|
||||||
# URL_PORT=
|
|
||||||
# (empty URL_PORT = no port in the URL; leave the line out to get :8080)
|
|
||||||
DOMAIN=localhost
|
|
||||||
URL_SCHEME=http
|
|
||||||
URL_PORT=:8080
|
|
||||||
|
|
||||||
# Caddy scheme for the reverse proxy on port 8080.
|
# Caddy scheme for the reverse proxy on port 8080.
|
||||||
# http (default) — plain HTTP; matches the ORIGIN vars in docker-compose.yml
|
# http (default) — plain HTTP; matches the ORIGIN vars in docker-compose.yml
|
||||||
# https — HTTPS on :8080 (self-signed unless you add a cert issuer;
|
# https — HTTPS on :8080 (self-signed unless you add a cert issuer;
|
||||||
|
|
|
||||||
|
|
@ -173,11 +173,10 @@ cd app-public && npm run build
|
||||||
## Environment
|
## Environment
|
||||||
|
|
||||||
- `DOMAIN` — base domain for subdomain routing. Defaults to `localhost` for local dev. Set in `docker-compose.yml` or `.env`.
|
- `DOMAIN` — base domain for subdomain routing. Defaults to `localhost` for local dev. Set in `docker-compose.yml` or `.env`.
|
||||||
- `URL_SCHEME` (default `http`), `URL_PORT` (default `:8080`; set it empty for no port) — build every browser-facing URL below as `<scheme>://<sub>.<DOMAIN><port>`. They must match the address bar exactly: a mismatched `ORIGIN` makes SvelteKit reject form POSTs (admin login) with "Cross-site POST form submissions are forbidden". Behind a TLS reverse proxy: `URL_SCHEME=https`, `URL_PORT=`. (podman-compose 1.5 can't do nested `${A:-${B}}` defaults, hence two flat variables.)
|
- `PUBLIC_POCKETBASE_URL` — public-facing PocketBase URL (`http://db.${DOMAIN}:8080`). Set in `docker-compose.yml`.
|
||||||
- `PUBLIC_POCKETBASE_URL` — public-facing PocketBase URL (`<scheme>://db.${DOMAIN}<port>`). Set in `docker-compose.yml`.
|
|
||||||
- `POCKETBASE_INTERNAL_URL` — internal Docker network URL (`http://pocketbase:80`). Set in `docker-compose.yml`.
|
- `POCKETBASE_INTERNAL_URL` — internal Docker network URL (`http://pocketbase:80`). Set in `docker-compose.yml`.
|
||||||
- `ORIGIN` — SvelteKit origin for SSR. Differs per app: `<scheme>://admin.${DOMAIN}<port>` (admin), `<scheme>://www.${DOMAIN}<port>` (public).
|
- `ORIGIN` — SvelteKit origin for SSR. Differs per app: `http://admin.${DOMAIN}:8080` (admin), `http://www.${DOMAIN}:8080` (public).
|
||||||
- `PUBLIC_SITE_URL` — public site URL used by the admin app for cross-subdomain preview links (`<scheme>://www.${DOMAIN}<port>`).
|
- `PUBLIC_SITE_URL` — public site URL used by the admin app for cross-subdomain preview links (`http://www.${DOMAIN}:8080`).
|
||||||
- `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS`, `EMAIL_FROM`, `EMAIL_FROM_NAME` — Brevo SMTP relay for booking emails (both apps). Empty `SMTP_HOST` = log emails instead of sending.
|
- `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS`, `EMAIL_FROM`, `EMAIL_FROM_NAME` — Brevo SMTP relay for booking emails (both apps). Empty `SMTP_HOST` = log emails instead of sending.
|
||||||
- `SITE_TIMEZONE` — IANA timezone for booking times in emails (default `Europe/Oslo`).
|
- `SITE_TIMEZONE` — IANA timezone for booking times in emails (default `Europe/Oslo`).
|
||||||
- Secrets (Stripe, `INTERNAL_API_SECRET`, SMTP) are read from a root-level `.env` next to `docker-compose.yml`; see `.env.example`.
|
- Secrets (Stripe, `INTERNAL_API_SECRET`, SMTP) are read from a root-level `.env` next to `docker-compose.yml`; see `.env.example`.
|
||||||
|
|
|
||||||
11
README.md
11
README.md
|
|
@ -38,17 +38,6 @@ The project runs exclusively through Docker Compose. There is no bare host dev m
|
||||||
|
|
||||||
Caddy's `.localhost` handling works without DNS or hosts-file changes. Source changes require rebuilding (`docker compose up --build`); the containers run the production build (`node build`), not a dev server.
|
Caddy's `.localhost` handling works without DNS or hosts-file changes. Source changes require rebuilding (`docker compose up --build`); the containers run the production build (`node build`), not a dev server.
|
||||||
|
|
||||||
**Deploying behind HTTPS** (e.g. another reverse proxy terminating TLS and forwarding to `:8080`): the apps must know the URL the browser really uses, or the admin login fails with *"Cross-site POST form submissions are forbidden"*. In `.env`:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
DOMAIN=example.com # → admin.example.com, www.example.com, db.example.com
|
|
||||||
URL_SCHEME=https
|
|
||||||
URL_PORT= # empty: no port in the URL
|
|
||||||
CADDY_SCHEME=http # this stack's Caddy stays plain HTTP behind the TLS proxy
|
|
||||||
```
|
|
||||||
|
|
||||||
Then `docker compose up -d` (no rebuild needed: these are runtime env vars).
|
|
||||||
|
|
||||||
## Docker Compose
|
## Docker Compose
|
||||||
|
|
||||||
Run the full stack:
|
Run the full stack:
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,9 @@ services:
|
||||||
environment:
|
environment:
|
||||||
PORT: 3001
|
PORT: 3001
|
||||||
POCKETBASE_INTERNAL_URL: http://pocketbase:80
|
POCKETBASE_INTERNAL_URL: http://pocketbase:80
|
||||||
# Browser-facing URLs. They must match the address bar exactly, or
|
PUBLIC_POCKETBASE_URL: http://db.${DOMAIN:-localhost}:8080
|
||||||
# SvelteKit rejects logins/forms ("Cross-site POST form submissions are
|
ORIGIN: http://admin.${DOMAIN:-localhost}:8080
|
||||||
# forbidden"). Behind a TLS proxy: URL_SCHEME=https and URL_PORT= (empty).
|
PUBLIC_SITE_URL: http://www.${DOMAIN:-localhost}:8080
|
||||||
PUBLIC_POCKETBASE_URL: ${URL_SCHEME:-http}://db.${DOMAIN:-localhost}${URL_PORT-:8080}
|
|
||||||
ORIGIN: ${URL_SCHEME:-http}://admin.${DOMAIN:-localhost}${URL_PORT-:8080}
|
|
||||||
PUBLIC_SITE_URL: ${URL_SCHEME:-http}://www.${DOMAIN:-localhost}${URL_PORT-:8080}
|
|
||||||
BODY_SIZE_LIMIT: 52428800 # 50MB — import payload embeds all images as base64
|
BODY_SIZE_LIMIT: 52428800 # 50MB — import payload embeds all images as base64
|
||||||
STRIPE_CURRENCY: ${STRIPE_CURRENCY:-eur}
|
STRIPE_CURRENCY: ${STRIPE_CURRENCY:-eur}
|
||||||
# Booking emails (Brevo SMTP relay) — admin needs these for resend/test sends
|
# Booking emails (Brevo SMTP relay) — admin needs these for resend/test sends
|
||||||
|
|
@ -65,8 +62,8 @@ services:
|
||||||
environment:
|
environment:
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
POCKETBASE_INTERNAL_URL: http://pocketbase:80
|
POCKETBASE_INTERNAL_URL: http://pocketbase:80
|
||||||
PUBLIC_POCKETBASE_URL: ${URL_SCHEME:-http}://db.${DOMAIN:-localhost}${URL_PORT-:8080}
|
PUBLIC_POCKETBASE_URL: http://db.${DOMAIN:-localhost}:8080
|
||||||
ORIGIN: ${URL_SCHEME:-http}://www.${DOMAIN:-localhost}${URL_PORT-:8080}
|
ORIGIN: http://www.${DOMAIN:-localhost}:8080
|
||||||
# No PocketBase or Stripe secrets here: shop writes happen in PocketBase
|
# No PocketBase or Stripe secrets here: shop writes happen in PocketBase
|
||||||
# (pb_hooks/shop). The publishable key is public by design.
|
# (pb_hooks/shop). The publishable key is public by design.
|
||||||
PUBLIC_STRIPE_PUBLISHABLE_KEY: ${PUBLIC_STRIPE_PUBLISHABLE_KEY:-}
|
PUBLIC_STRIPE_PUBLISHABLE_KEY: ${PUBLIC_STRIPE_PUBLISHABLE_KEY:-}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue