prod changes
Some checks failed
CI / Check Style (push) Has been cancelled
CI / Run Clippy (push) Has been cancelled
CI / Run Tests (push) Has been cancelled

This commit is contained in:
2026-06-30 23:08:00 +00:00
parent 98e4210900
commit 7900b7e176
3 changed files with 27 additions and 24 deletions

1
.gitignore vendored
View File

@@ -28,3 +28,4 @@ favicon_io.zip
# Tailwind standalone binary (downloaded via `make tailwind`) # Tailwind standalone binary (downloaded via `make tailwind`)
bin/tailwindcss bin/tailwindcss
node_modules/ node_modules/
*.pem

View File

@@ -1,16 +1,14 @@
logger: logger:
enable: true enable: true
pretty_backtrace: false pretty_backtrace: false
level: "{{ get_env(name="LOG_LEVEL", default="info") }}" level: {{ get_env(name="LOG_LEVEL", default="info") | json_encode() }}
format: "{{ get_env(name="LOG_FORMAT", default="compact") }}" format: {{ get_env(name="LOG_FORMAT", default="compact") | json_encode() }}
server: server:
port: {{ get_env(name="PORT", default="5150") }} port: {{ get_env(name="PORT", default="5150") }}
binding: "{{ get_env(name="SERVER_BINDING", default="0.0.0.0") }}" binding: {{ get_env(name="SERVER_BINDING", default="0.0.0.0") | json_encode() }}
host: "{{ get_env(name="APP_HOST") }}" host: {{ get_env(name="APP_HOST") | json_encode() }}
middlewares: middlewares:
# gzip/br compression for text responses (HTML, CSS, JS) — Lighthouse
# "Document request latency: No compression applied".
compression: compression:
enable: true enable: true
static: static:
@@ -23,21 +21,21 @@ server:
fallback: "assets/static/404.html" fallback: "assets/static/404.html"
workers: workers:
mode: "{{ get_env(name="WORKER_MODE", default="BackgroundAsync") }}" mode: {{ get_env(name="WORKER_MODE", default="BackgroundAsync") | json_encode() }}
mailer: mailer:
stub: {{ get_env(name="MAILER_STUB", default="true") }} stub: {{ get_env(name="MAILER_STUB", default="true") }}
smtp: smtp:
enable: {{ get_env(name="SMTP_ENABLE", default="false") }} enable: {{ get_env(name="SMTP_ENABLE", default="false") }}
host: "{{ get_env(name="SMTP_HOST", default="localhost") }}" host: {{ get_env(name="SMTP_HOST", default="localhost") | json_encode() }}
port: {{ get_env(name="SMTP_PORT", default="1025") }} port: {{ get_env(name="SMTP_PORT", default="1025") }}
secure: {{ get_env(name="SMTP_SECURE", default="false") }} secure: {{ get_env(name="SMTP_SECURE", default="false") }}
auth: auth:
user: "{{ get_env(name="SMTP_USER", default="") }}" user: {{ get_env(name="SMTP_USER", default="") | json_encode() }}
password: "{{ get_env(name="SMTP_PASSWORD", default="") }}" password: {{ get_env(name="SMTP_PASSWORD", default="") | json_encode() }}
database: database:
uri: "{{ get_env(name="DATABASE_URL") }}" uri: {{ get_env(name="DATABASE_URL") | json_encode() }}
enable_logging: {{ get_env(name="DB_ENABLE_LOGGING", default="false") }} enable_logging: {{ get_env(name="DB_ENABLE_LOGGING", default="false") }}
connect_timeout: {{ get_env(name="DB_CONNECT_TIMEOUT", default="500") }} connect_timeout: {{ get_env(name="DB_CONNECT_TIMEOUT", default="500") }}
idle_timeout: {{ get_env(name="DB_IDLE_TIMEOUT", default="500") }} idle_timeout: {{ get_env(name="DB_IDLE_TIMEOUT", default="500") }}
@@ -53,31 +51,29 @@ auth:
- from: Cookie - from: Cookie
name: auth_token name: auth_token
- from: Bearer - from: Bearer
secret: "{{ get_env(name="JWT_SECRET") }}" secret: {{ get_env(name="JWT_SECRET") | json_encode() }}
expiration: {{ get_env(name="JWT_EXPIRATION", default="604800") }} expiration: {{ get_env(name="JWT_EXPIRATION", default="604800") }}
settings: settings:
admin_email: "{{ get_env(name="ADMIN_EMAIL", default="") }}" admin_email: {{ get_env(name="ADMIN_EMAIL", default="") | json_encode() }}
uploads_root: "{{ get_env(name="UPLOADS_ROOT", default="data/uploads") }}" uploads_root: {{ get_env(name="UPLOADS_ROOT", default="data/uploads") | json_encode() }}
# loco-oauth2 social login. All values must come from the environment in prod;
# OAUTH_REDIRECT_URL / OAUTH_PROTECTED_URL must use the real public origin.
initializers: initializers:
oauth2: oauth2:
secret_key: "{{ get_env(name="OAUTH_PRIVATE_KEY") }}" secret_key: {{ get_env(name="OAUTH_PRIVATE_KEY") | json_encode() }}
authorization_code: authorization_code:
- client_identifier: google - client_identifier: google
client_credentials: client_credentials:
client_id: "{{ get_env(name="OAUTH_CLIENT_ID") }}" client_id: {{ get_env(name="OAUTH_CLIENT_ID") | json_encode() }}
client_secret: "{{ get_env(name="OAUTH_CLIENT_SECRET") }}" client_secret: {{ get_env(name="OAUTH_CLIENT_SECRET") | json_encode() }}
url_config: url_config:
auth_url: "{{ get_env(name="OAUTH_AUTH_URL", default="https://accounts.google.com/o/oauth2/auth") }}" auth_url: {{ get_env(name="OAUTH_AUTH_URL", default="https://accounts.google.com/o/oauth2/auth") | json_encode() }}
token_url: "{{ get_env(name="OAUTH_TOKEN_URL", default="https://www.googleapis.com/oauth2/v3/token") }}" token_url: {{ get_env(name="OAUTH_TOKEN_URL", default="https://www.googleapis.com/oauth2/v3/token") | json_encode() }}
redirect_url: "{{ get_env(name="OAUTH_REDIRECT_URL") }}" redirect_url: {{ get_env(name="OAUTH_REDIRECT_URL") | json_encode() }}
profile_url: "{{ get_env(name="OAUTH_PROFILE_URL", default="https://openidconnect.googleapis.com/v1/userinfo") }}" profile_url: {{ get_env(name="OAUTH_PROFILE_URL", default="https://openidconnect.googleapis.com/v1/userinfo") | json_encode() }}
scopes: scopes:
- "https://www.googleapis.com/auth/userinfo.email" - "https://www.googleapis.com/auth/userinfo.email"
- "https://www.googleapis.com/auth/userinfo.profile" - "https://www.googleapis.com/auth/userinfo.profile"
cookie_config: cookie_config:
protected_url: "{{ get_env(name="OAUTH_PROTECTED_URL") }}" protected_url: {{ get_env(name="OAUTH_PROTECTED_URL") | json_encode() }}
timeout_seconds: 600 timeout_seconds: 600

View File

@@ -8,7 +8,12 @@ services:
- .env.production - .env.production
environment: environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
JWT_SECRET: "${JWT_SECRET:?JWT_SECRET must be set}"
OAUTH_CLIENT_SECRET: "${OAUTH_CLIENT_SECRET:?OAUTH_CLIENT_SECRET must be set}"
SMTP_PASSWORD: "${SMTP_PASSWORD:?SMTP_PASSWORD must be set}"
ADMIN_PASSWORD: "${ADMIN_PASSWORD:?ADMIN_PASSWORD must be set}"
volumes: volumes:
- ./config:/usr/app/config:ro
- kompress_eshop_data:/usr/app/data - kompress_eshop_data:/usr/app/data
networks: networks:
- kompress_eshop-net - kompress_eshop-net
@@ -22,6 +27,7 @@ services:
timeout: 5s timeout: 5s
retries: 3 retries: 3
start_period: 20s start_period: 20s
command: ["start"]
postgres: postgres:
image: postgres:16-alpine image: postgres:16-alpine