logger:
  enable: true
  pretty_backtrace: false
  level: info
  format: json

server:
  port: {{ get_env(name="PORT", default="5150") }}
  binding: 0.0.0.0
  host: {{ get_env(name="APP_BASE_URL", default="http://localhost:5150") }}
  middlewares:
    static:
      enable: true
      must_exist: true
      precompressed: false
      folder:
        uri: "/static"
        path: "assets/static"

workers:
  mode: BackgroundQueue

queue:
  kind: Redis
  uri: {{ get_env(name="REDIS_URL", default="redis://redis:6379") }}
  dangerously_flush: false

mailer:
  smtp:
    enable: {{ get_env(name="SMTP_ENABLE", default="false") }}
    host: '{{ get_env(name="SMTP_HOST", default="localhost") }}'
    port: {{ get_env(name="SMTP_PORT", default="1025") }}
    secure: {{ get_env(name="SMTP_SECURE", default="false") }}
    {% set smtp_user = get_env(name="SMTP_USER", default="") %}
    {% if smtp_user != "" %}
    auth:
      user: '{{ smtp_user }}'
      password: '{{ get_env(name="SMTP_PASSWORD", default="") }}'
    {% endif %}
    {% set smtp_hello_name = get_env(name="SMTP_HELLO_NAME", default="") %}
    {% if smtp_hello_name != "" %}
    hello_name: '{{ smtp_hello_name }}'
    {% endif %}

database:
  uri: {{ get_env(name="DATABASE_URL", default="postgres://termi:termi@db:5432/termi_api") }}
  enable_logging: false
  connect_timeout: {{ get_env(name="DB_CONNECT_TIMEOUT", default="500") }}
  idle_timeout: {{ get_env(name="DB_IDLE_TIMEOUT", default="500") }}
  min_connections: {{ get_env(name="DB_MIN_CONNECTIONS", default="1") }}
  max_connections: {{ get_env(name="DB_MAX_CONNECTIONS", default="10") }}
  auto_migrate: true
  dangerously_truncate: false
  dangerously_recreate: false

auth:
  jwt:
    secret: {{ get_env(name="JWT_SECRET", default="please-change-me") }}
    expiration: {{ get_env(name="JWT_EXPIRATION_SECONDS", default="604800") }}
