exoframe icon indicating copy to clipboard operation
exoframe copied to clipboard

Supply Traefik config file

Open harjot1singh opened this issue 7 years ago • 3 comments
trafficstars

Hi, great work!

I noticed that it’s possible to add command line arguments to Traefik within the config, however this can be cumbersome with more than a handful of options.

Is there a way of supplying Traefik with the path of a configuration file?

harjot1singh avatar May 22 '18 23:05 harjot1singh

Hi @Harjot1Singh!

There's no current way to do that, but I'd be open to a PR for that. It's going to be a bit tricky to implement because you need to provide pretty flexible core (see this code for reference).

yamalight avatar May 23 '18 08:05 yamalight

Traefik isn't merging cli options with settings from a config file. check traefik docs

To provide the ability to supply a custom traefik config file we would need to add exoframe specific settings to the provided config file.

Maybe we could create a sample toml config after starting the server in /root/.exoframe/traefik/traefik.toml and add the whole exoframe specific config to the beginning by using toml. Adding an option to disable the config generation at all should also be available.

The file could look like this:

# Dynamic config file for Traefik. This upper part is generated by exoframe. 
# Please add your own changes to the bottom of the file.
# DO NOT EDIT THIS PART BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
[log]
  level = "warning"

[entryPoints]
  [entryPoints.web]
    address = ":80"

[providers]
  [providers.docker]
    endpoint = "unix:///var/run/docker.sock"
    exposedByDefault = false

[certificatesResolvers]
  [certificatesResolvers.httpchallenge]
    [certificatesResolvers.httpchallenge.acme]
      storage = "/etc/traefik/acme/acme.json"
      [certificatesResolvers.httpchallenge.acme.httpChallenge]
        entryPoint = "web"

### add you custom config below this line
[api]
  dashboard = true

anbraten avatar Mar 11 '20 16:03 anbraten

@anbraten that was my plan in the long run - custom config (+folder for user configs) with ability to override. It's quite a task though and so far I didn't have enough time to try and implement that. PRs welcome though 😃

yamalight avatar Mar 11 '20 16:03 yamalight

Closing this as task is done. Docs have their own ticket.

yamalight avatar Dec 05 '23 10:12 yamalight