Directory and filename not working together?

Hi everyone,

better to ask here first instead of opening an issue right away.

The documentation is not clear enough, but what about given a filename and a directory to the file provider? If I only use the filename, everything works. If I add the directory, the filename is not read anymore:

Here is the log of both cases:

traefikv2  | time="2019-09-27T11:51:26Z" level=info msg="Starting provider *file.Provider {\"watch\":true,\"filename\":\"/traefik-internal.toml\"}"
traefikv2  | time="2019-09-27T11:51:26Z" level=debug msg="Configuration received from provider file: {\"http\":{},\"tcp\":{},\"tls\":{\"stores\":{\"default\":{\"defaultCertificate\":{\"certFile\":\"/certs/crt\",\"keyFile\":\"/certs/key\"}}}}}" providerName=file
traefikv2  | time="2019-09-27T11:51:37Z" level=debug msg="Serving default certificate for request: \"<stripped-out>\""

and here with both set

traefikv2  | time="2019-09-27T11:56:27Z" level=info msg="Starting provider *file.Provider {\"directory\":\"/traefik.d/\",\"watch\":true,\"filename\":\"/traefik-internal.toml\"}"
traefikv2  | time="2019-09-27T11:56:27Z" level=debug msg="Configuration received from provider file: {\"http\":{},\"tcp\":{},\"tls\":{}}" providerName=file
traefikv2  | time="2019-09-27T11:56:27Z" level=debug msg="No default certificate, generating one"

Is this behaviour a bug, then there should be an issue. If this behaviour is desired, the documentation should reflect that the settings are mutual exclusive.

Best
Andreas

Hello,

It's the expected behavior, could you create a PR to enhance the documentation?

Thanks @Idez, PR is done:

1 Like

For documentation enhancement/bugfixes you can use the branch v2.0 instead of master.

I already rebased your 2 PRs.

Thank you for the help on the documentation :+1:

Thank you. NP. Good that it's so easy to contribute. Other projects go through a totally complicated process to get a PR that is approved, signed (on real paper).

2 Likes