Error loading file

I am trying to setup HomeAssistant, which needs network_mode set to Host. And so I created a new servers.toml file but I'm getting an error.

Cannot start the provider *file.Provider: toml: type mismatch for dynamic.RouterTLSConfig: expected table but found bool"

[entryPoints]
  [entryPoints.homeassistant]
    address = ":8123"

[http]
  [http.routers]
    [http.routers.homeassistant]
      entryPoints = ["homeassistant"]
      rule = "Host(`DOMAIN.TLD`)"
      service = "homeassistant"
      tls = true

  [http.services]
    [http.services.homeassistant]
      [[http.services.homeassistant.loadBalancer.servers]]
        url = "http://192.168.1.10:8123"
        passHostHeader = true
        
[tcp]
  [tcp.routers]
    [tcp.routers.homeassistant]
      entryPoints = "http"
      rule = "Host(`DOMAIN.TLD`)"
      service = "homeassistant"
      [tcp.routers.homeassistant.tls]
        passthrough = true

  [tcp.services.homeassistant]
    [[tcp.services.homeassistant.loadBalancer.servers]]
      url = "http://192.168.1.10:8123"
      passHostHeader = true

  [http.middlewares]
    [http.middlewares.homeassistant]
      browserXSSFilter = true
      contentTypeNosniff = true
      forceSTSHeader = true
      SSLHost = "brunoamaral.net"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000

    [http.middlewares.testHeader.headers]
      FrameDeny = true
      SSLRedirect = true

I checked and the toml format is valid, but maybe I am missing something specific to traefik ?

Hello,

  1. in Traefik, the static configuration and the dynamic configuration must be in 2 files.
  2. tls = true is not a valid option for the file provider.
  • traefik.toml:
[entryPoints]
  [entryPoints.homeassistant]
    address = ":8123"

[providers.file]
  directory = "/config"
  • config/dyn.toml:
[http]
  [http.routers]
    [http.routers.homeassistant]
      entryPoints = ["homeassistant"]
      rule = "Host(`DOMAIN.TLD`)"
      service = "homeassistant"
      [http.routers.homeassistant.tls]

  [http.services]
    [http.services.homeassistant]
      [[http.services.homeassistant.loadBalancer.servers]]
        url = "http://192.168.1.10:8123"
        passHostHeader = true
        
[tcp]
  [tcp.routers]
    [tcp.routers.homeassistant]
      entryPoints = "http"
      rule = "Host(`DOMAIN.TLD`)"
      service = "homeassistant"
      [tcp.routers.homeassistant.tls]
        passthrough = true

  [tcp.services.homeassistant]
    [[tcp.services.homeassistant.loadBalancer.servers]]
      url = "http://192.168.1.10:8123"
      passHostHeader = true

  [http.middlewares]
    [http.middlewares.homeassistant]
      browserXSSFilter = true
      contentTypeNosniff = true
      forceSTSHeader = true
      SSLHost = "brunoamaral.net"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000

    [http.middlewares.testHeader.headers]
      FrameDeny = true
      SSLRedirect = true

Thanks again @ldez !

Seems that I also had some stuff that wasn't required by HomeAssistant. Here's the final servers.toml in case someone else is looking for a solution:

[http]
  [http.routers]
    [http.routers.homeassistant]
      entryPoints = ["https"]
      rule = "Host(`DOMAIN.TLD`)"
      service = "homeassistant"
      [http.routers.homeassistant.tls]

  [http.services]
    [http.services.homeassistant]
      [[http.services.homeassistant.loadBalancer.servers]]
        url = "http://192.168.1.10:8123"
        passHostHeader = true

  [tcp.services.homeassistant]
    [[tcp.services.homeassistant.loadBalancer.servers]]
      url = "http://192.168.1.10:8123"
      passHostHeader = true

  [http.middlewares]
    [http.middlewares.homeassistant]
      browserXSSFilter = true
      contentTypeNosniff = true
      forceSTSHeader = true
      SSLHost = "DOMAIN.TLD"
      SSLRedirect = true
      STSIncludeSubdomains = true
      STSPreload = true
      STSSeconds = 315360000

    [http.middlewares.testHeader.headers]
      FrameDeny = true
      SSLRedirect = true