---
global:
  checkNewVersion: true
  sendAnonymousUsage: true

################################################################
# EntryPoints configuration
################################################################
entryPoints:
  web:       
    address: :80
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https

  websecure: 
    address: :443

{% if traefik_token is defined %}
pilot:
  token: "{{ traefik_token }}"
{% endif %}

################################################################
# Traefik logs configuration
################################################################
log:
  level: WARN
  format: common

################################################################
# Access logs configuration
################################################################
accessLog:
  format: common

################################################################
# API and dashboard configuration
################################################################
api:
  dashboard: true

################################################################
# Ping configuration
################################################################

# Enable ping
# ping:
  # Name of the related entry point
  #
  # Optional
  # Default: "traefik"
  #
  # entryPoint: traefik

################################################################
# Docker configuration backend
################################################################

providers:
  # File configuration for non-docker containers
  file:
    directory: "/etc/traefik/dynamic"

  # Enable Docker configuration backend
  docker:
    endpoint: "unix:///var/run/docker.sock"
    swarmMode: true
    exposedByDefault: false
    network: "traefik"

certificatesResolvers:
  lets-encrypt:
    acme:
      caServer: "{{ lets_encrypt_url|default('https://acme-v02.api.letsencrypt.org/directory') }}"
      email: "kacper@kadet.net"
      storage: "/etc/traefik/acme/lets-encrypt.json"
      dnsChallenge: 
        provider: ovh
  lets-encrypt-tls:
    acme:
      caServer: "{{ lets_encrypt_url|default('https://acme-v02.api.letsencrypt.org/directory') }}"
      email: "kacper@kadet.net"
      storage: "/etc/traefik/acme/lets-encrypt-tls.json"
      tlsChallenge: {}