Environment variables setup using binary version of Traefik in macOS

Would like to start with that via Docker everything works fine, I have no issues with Traefik, but as it eats 25% (when streaming video) of CPU on M1 Mac, so I have installed it via homebrew (in this case it uses 5% only), so I have hard time trying to set up environment variables when using binary version of Traefik (installed via home-brew) in macOS, for some reason it does not want to use environment variables from plist file:

...
<array>
  <string>/opt/homebrew/opt/traefik/bin/traefik</string>
  <string>--configfile=/Volumes/Prod/Programs/apps/configs/traefik/traefik.yml</string>
  <string>CF_API_EMAIL=myemail@here.com</string>
  <string>CLOUDFLARE_ZONE_API_TOKEN=mysecrettoken</string>
</array>
...

YAML file loads fine, but in logs it shows error that can not find variables (in though in terminal by checking (ps eww -o command | tr ' ' '\n') they are shown:

time="2023-05-12T15:23:35+03:00" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=websecure
time="2023-05-12T15:23:35+03:00" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
time="2023-05-12T15:23:35+03:00" level=error msg="close tcp [::]:443: use of closed network connection" entryPointName=websecure
time="2023-05-12T15:23:35+03:00" level=error msg="close tcp [::]:80: use of closed network connection" entryPointName=web
time="2023-05-12T15:23:37+03:00" level=info msg="Configuration loaded from file: /Volumes/Prod/Programs/apps/configs/traefik/traefik.yml"
time="2023-05-12T15:23:37+03:00" level=error msg="Unable to obtain ACME certificate for domains "pimemima.studio,*.pimemima.studio"" ACME CA="https://acme-v02.api.letsencrypt.org/directory" providerName=cloudflare.acme routerName=un@file rule="Host(un.pimemima.studio)" error="cannot get ACME client cloudflare: some credentials information are missing: CLOUDFLARE_EMAIL,CLOUDFLARE_API_KEY or some credentials information are missing: CLOUDFLARE_DNS_API_TOKEN,CLOUDFLARE_ZONE_API_TOKEN"

The closest topics I found (but did not help):

I have found solution - on macOS it needs in plist file to be configured via executing command with these Environment parameters:

<key>ProgramArguments</key>
<array>
    <string>/bin/zsh</string>
    <string>-c</string>
    <string>CLOUDFLARE_EMAIL=myemail@here.com CLOUDFLARE_DNS_API_TOKEN=mysecrettoken /opt/homebrew/opt/traefik/bin/traefik --configfile=/Volumes/Prod/Programs/apps/configs/traefik/traefik.yml</string>
</array>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.