Add bilingual support for notifications and automatic HTTPS
Implement bilingual text for push notifications, allowing users to receive them in their preferred language. Automatically configure HTTPS with Let's Encrypt for custom domains to ensure persistent subscriptions. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 94f06aee-a5cf-45df-979e-f940cce77214 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/yEFtMKN Replit-Helium-Checkpoint-Created: true
This commit is contained in:
+20
-5
@@ -102,15 +102,29 @@ services:
|
||||
LOCAL_DOMAIN: ${LOCAL_DOMAIN:-tx.local}
|
||||
LOCAL_IP: ${LOCAL_IP:-127.0.0.1}
|
||||
HTTPS_MODE: ${HTTPS_MODE:-local}
|
||||
# Pick the Caddyfile at boot. We auto-fall-back to the cert-free
|
||||
# Caddyfile.skip when HTTPS_MODE=skip OR when /certs is missing
|
||||
# the keypair, so a fresh `./start.sh` works on hosts that don't
|
||||
# have mkcert without any extra wiring.
|
||||
PUBLIC_DOMAIN: ${PUBLIC_DOMAIN:-}
|
||||
ACME_EMAIL: ${ACME_EMAIL:-}
|
||||
# Pick the Caddyfile at boot:
|
||||
# * HTTPS_MODE=auto → Caddyfile.auto (Let's Encrypt for PUBLIC_DOMAIN)
|
||||
# * HTTPS_MODE=skip → Caddyfile.skip (plain HTTP, dev only)
|
||||
# * /certs missing → Caddyfile.skip (graceful fall-back)
|
||||
# * otherwise → Caddyfile (BYO cert under /certs)
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
if [ "$${HTTPS_MODE}" = "skip" ] || [ ! -f /certs/local-cert.pem ] || [ ! -f /certs/local-key.pem ]; then
|
||||
if [ "$${HTTPS_MODE}" = "auto" ]; then
|
||||
if [ -z "$${PUBLIC_DOMAIN}" ]; then
|
||||
echo "HTTPS_MODE=auto requires PUBLIC_DOMAIN to be set (e.g. tx.example.com)" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "$${ACME_EMAIL}" ]; then
|
||||
export ACME_EMAIL_DIRECTIVE="email $${ACME_EMAIL}"
|
||||
else
|
||||
export ACME_EMAIL_DIRECTIVE=""
|
||||
fi
|
||||
exec caddy run --config /etc/caddy/Caddyfile.auto --adapter caddyfile
|
||||
elif [ "$${HTTPS_MODE}" = "skip" ] || [ ! -f /certs/local-cert.pem ] || [ ! -f /certs/local-key.pem ]; then
|
||||
exec caddy run --config /etc/caddy/Caddyfile.skip --adapter caddyfile
|
||||
else
|
||||
exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
|
||||
@@ -129,6 +143,7 @@ services:
|
||||
volumes:
|
||||
- ./docker/Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- ./docker/Caddyfile.skip:/etc/caddy/Caddyfile.skip:ro
|
||||
- ./docker/Caddyfile.auto:/etc/caddy/Caddyfile.auto:ro
|
||||
- ./certs:/certs:ro
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
|
||||
Reference in New Issue
Block a user