Files
wowcheckout/docker-compose.yml
such-gitea ff152f216d fix(webhooks): refuse internal webhook targets and stop following redirects
Merchant-supplied webhook URLs were posted to without any host check,
redirects were followed, and the raw request error was stored and returned
to the caller. With open registration, anyone could make the service send
requests to the wallet RPC, the database, the daemon or a cloud metadata
address, and read back what the error revealed.

Every delivery path now goes through webhook_targets.post_webhook. It
accepts only http and https URLs without embedded credentials, requires
every resolved address to be public, and never follows redirects (a 3xx is
a failed delivery). WEBHOOK_ALLOWED_PRIVATE_HOSTS names exact hosts that may
resolve privately, for receivers reached over a LAN. Stored delivery errors
carry only the refusal reason or the exception class.
2026-11-18 15:40:59 -05:00

243 lines
7.7 KiB
YAML

services:
nginx:
build:
context: ./nginx
ports:
- "${NGINX_BIND:-0.0.0.0}:${NGINX_PORT:-8180}:80"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./qr:/qr:ro
depends_on:
ui:
condition: service_started
api:
condition: service_started
restart: unless-stopped
api:
build:
context: ./api
environment:
DATABASE_URL: ${DATABASE_URL}
API_KEYS: ${API_KEYS}
API_KEY_ENCRYPTION_KEY: ${API_KEY_ENCRYPTION_KEY}
RATE_PROVIDER: ${RATE_PROVIDER:-nonlogs}
RATE_STALE_TTL_SECONDS: ${RATE_STALE_TTL_SECONDS:-300}
FOUNDER_PAYMENT_ADDRESS: ${FOUNDER_PAYMENT_ADDRESS}
FOUNDER_VIEW_KEY: ${FOUNDER_VIEW_KEY}
DONATIONS_ENABLED: ${DONATIONS_ENABLED:-false}
OPEN_REGISTRATION: ${OPEN_REGISTRATION:-true}
ADMIN_API_KEY: ${ADMIN_API_KEY:-}
WEBHOOK_ALLOWED_PRIVATE_HOSTS: ${WEBHOOK_ALLOWED_PRIVATE_HOSTS:-}
QR_STORAGE_DIR: ${QR_STORAGE_DIR:-/qr}
MONERO_WALLET_RPC_URLS: ${MONERO_WALLET_RPC_URLS:-http://wallet-rpc-reconciler-1:18083,http://wallet-rpc-reconciler-2:18083,http://wallet-rpc-reconciler-3:18083}
MONERO_WALLET_RPC_USER: ${MONERO_WALLET_RPC_USER}
MONERO_WALLET_RPC_PASSWORD: ${MONERO_WALLET_RPC_PASSWORD}
MONERO_WALLET_RPC_WALLET_PASSWORD: ${MONERO_WALLET_RPC_WALLET_PASSWORD}
MONERO_WALLET_RPC_WALLET_DIR: ${MONERO_WALLET_RPC_WALLET_DIR:-/wallets}
MONERO_DAEMON_URL: ${MONERO_DAEMON_URL:?set MONERO_DAEMON_URL in .env}
GUNICORN_WORKERS: ${GUNICORN_WORKERS:-5}
volumes:
- ./qr:/qr
depends_on:
db:
condition: service_healthy
restart: unless-stopped
reconciler:
build:
context: ./api
command: ["python", "-m", "app.reconciler"]
environment:
DATABASE_URL: ${DATABASE_URL}
API_KEYS: ${API_KEYS}
API_KEY_ENCRYPTION_KEY: ${API_KEY_ENCRYPTION_KEY}
INVOICE_RECONCILE_INTERVAL_SECONDS: ${INVOICE_RECONCILE_INTERVAL_SECONDS}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
WEBHOOK_ALLOWED_PRIVATE_HOSTS: ${WEBHOOK_ALLOWED_PRIVATE_HOSTS:-}
MONERO_WALLET_RPC_URLS: ${MONERO_WALLET_RPC_URLS:-http://wallet-rpc-reconciler-1:18083,http://wallet-rpc-reconciler-2:18083,http://wallet-rpc-reconciler-3:18083}
MONERO_WALLET_RPC_USER: ${MONERO_WALLET_RPC_USER}
MONERO_WALLET_RPC_PASSWORD: ${MONERO_WALLET_RPC_PASSWORD}
MONERO_WALLET_RPC_WALLET_PASSWORD: ${MONERO_WALLET_RPC_WALLET_PASSWORD}
MONERO_WALLET_RPC_WALLET_DIR: ${MONERO_WALLET_RPC_WALLET_DIR:-/wallets}
MONERO_DAEMON_URL: ${MONERO_DAEMON_URL:?set MONERO_DAEMON_URL in .env}
depends_on:
api:
condition: service_started
db:
condition: service_healthy
restart: unless-stopped
# If the webhook target (e.g. your e-commerce API) runs on the same LAN and
# Docker containers cannot resolve its hostname (NAT hairpinning), uncomment
# and set extra_hosts to your reverse proxy's LAN IP:
# extra_hosts:
# - "api.example.com:192.168.1.100"
wownerod:
build:
context: ./docker/monero
args:
MONERO_VERSION: ${MONERO_VERSION:-0.11.3.0}
image: wownero-local:${MONERO_VERSION:-0.11.3.0}
entrypoint: ["wownerod"]
command:
[
"--non-interactive",
"--rpc-bind-ip",
"0.0.0.0",
"--rpc-bind-port",
"34568",
"--confirm-external-bind",
"--prune-blockchain",
"--data-dir",
"/data",
"--log-level",
"0"
]
volumes:
- wownerod_data:/data
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:34568/get_height >/dev/null || exit 1"]
interval: 30s
timeout: 5s
retries: 10
start_period: 60s
restart: unless-stopped
profiles: ["local-daemon"]
wallet-rpc-reconciler-1:
build:
context: ./docker/monero
args:
MONERO_VERSION: ${MONERO_VERSION:-0.11.3.0}
image: wownero-local:${MONERO_VERSION:-0.11.3.0}
command:
[
"wownero-wallet-rpc",
"--non-interactive",
"--rpc-bind-ip",
"0.0.0.0",
"--rpc-bind-port",
"18083",
"--confirm-external-bind",
"--daemon-address",
"${MONERO_DAEMON_URL:?set MONERO_DAEMON_URL in .env}",
"--rpc-login",
"${MONERO_WALLET_RPC_USER}:${MONERO_WALLET_RPC_PASSWORD}",
"--wallet-dir",
"${MONERO_WALLET_RPC_WALLET_DIR:-/wallets}",
"--password",
"${MONERO_WALLET_RPC_WALLET_PASSWORD}",
"--log-level",
"3"
]
volumes:
- ./wallets/reconciler:/wallets
restart: unless-stopped
wallet-rpc-reconciler-2:
build:
context: ./docker/monero
args:
MONERO_VERSION: ${MONERO_VERSION:-0.11.3.0}
image: wownero-local:${MONERO_VERSION:-0.11.3.0}
command:
[
"wownero-wallet-rpc",
"--non-interactive",
"--rpc-bind-ip",
"0.0.0.0",
"--rpc-bind-port",
"18083",
"--confirm-external-bind",
"--daemon-address",
"${MONERO_DAEMON_URL:?set MONERO_DAEMON_URL in .env}",
"--rpc-login",
"${MONERO_WALLET_RPC_USER}:${MONERO_WALLET_RPC_PASSWORD}",
"--wallet-dir",
"${MONERO_WALLET_RPC_WALLET_DIR:-/wallets}",
"--password",
"${MONERO_WALLET_RPC_WALLET_PASSWORD}",
"--log-level",
"3"
]
volumes:
- ./wallets/reconciler:/wallets
restart: unless-stopped
wallet-rpc-reconciler-3:
build:
context: ./docker/monero
args:
MONERO_VERSION: ${MONERO_VERSION:-0.11.3.0}
image: wownero-local:${MONERO_VERSION:-0.11.3.0}
command:
[
"wownero-wallet-rpc",
"--non-interactive",
"--rpc-bind-ip",
"0.0.0.0",
"--rpc-bind-port",
"18083",
"--confirm-external-bind",
"--daemon-address",
"${MONERO_DAEMON_URL:?set MONERO_DAEMON_URL in .env}",
"--rpc-login",
"${MONERO_WALLET_RPC_USER}:${MONERO_WALLET_RPC_PASSWORD}",
"--wallet-dir",
"${MONERO_WALLET_RPC_WALLET_DIR:-/wallets}",
"--password",
"${MONERO_WALLET_RPC_WALLET_PASSWORD}",
"--log-level",
"3"
]
volumes:
- ./wallets/reconciler:/wallets
restart: unless-stopped
ui:
build:
context: ./ui
args:
NEXT_PUBLIC_TURNSTILE_SITE_KEY: ${TURNSTILE_SITE_KEY:-}
NEXT_PUBLIC_SITE_NAME: ${SITE_NAME:-WOW Checkout}
environment:
API_BASE_URL: ${API_BASE_URL:-http://nginx}
NEXT_PUBLIC_SITE_URL: ${SITE_URL:-http://localhost}
NEXT_PUBLIC_DONATIONS_ENABLED: ${DONATIONS_ENABLED:-false}
NEXT_PUBLIC_TURNSTILE_SITE_KEY: ${TURNSTILE_SITE_KEY:-}
TURNSTILE_SECRET_KEY: ${TURNSTILE_SECRET_KEY:-}
RESEND_API_KEY: ${RESEND_API_KEY:-}
CONTACT_EMAIL: ${CONTACT_EMAIL:-sales@such.software}
NEXT_PUBLIC_SITE_NAME: ${SITE_NAME:-WOW Checkout}
depends_on:
api:
condition: service_started
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 3s
retries: 10
db-backup:
build:
context: ./docker/pg_backup
environment:
POSTGRES_HOST: db
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
BACKUP_RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-7}
volumes:
- ./backups/postgres:/backups
depends_on:
db:
condition: service_healthy
restart: unless-stopped
profiles: ["db-backup"]
volumes:
postgres_data:
wownerod_data: