einschmidt / hassio-addons

Home Assistant addons
MIT License
38 stars 4 forks source link

custom_binary_path does not seem to work #41

Closed bpolaszek closed 9 months ago

bpolaszek commented 9 months ago

Hello there! 👋

I have set up a new HA instance using Home Assistant OS on a RPI4. I'd like to use a custom binary (already built on that same RPI4 using another image and xcaddy) which notably uses the dns.providers.cloudflare module but it doesn't seem to be picked by the addon. This binary is located in /usr/local/bin/caddy and I also symlinked it within /share/caddy/caddy.

Here's the configuration:

Capture d’écran 2024-01-21 à 18 24 12

And here are the logs (I'm using a custom Caddyfile with cloudflare TLS directives):

INFO: Prepare Caddy...
INFO: Use built-in Caddy
v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
INFO: Prepare Caddyfile...
INFO: Caddyfile found at /share/caddy/Caddyfile
INFO: Run Caddy...
{"level":"info","ts":1705857369.2064111,"msg":"using provided configuration","config_file":"/share/caddy/Caddyfile","config_adapter":""}
Error: adapting config using caddyfile: parsing caddyfile tokens for 'tls': getting module named 'dns.providers.cloudflare': module not registered: dns.providers.cloudflare, at /share/caddy/Caddyfile:3
INFO: Service caddy exited with code 1 (by signal 0)

It gets a caddy 2.7.6 which doesn't find the dns.providers.cloudflare module. However, here's what I get from my terminal:

[core-ssh ~]$ caddy version
v2.7.5 h1:HoysvZkLcN2xJExEepaFHK92Qgs7xAiCFydN5x5Hs6Q=
[core-ssh ~]$ caddy list-modules | grep cloudflare
dns.providers.cloudflare

I probably set something wrong, could you help me spot what?

einschmidt commented 9 months ago

Hi @bpolaszek

I will have to check if the addon is able to reach the /usr folder at all. Until that check is done, could you try the following?

From your provided logs I can see that the custom caddy binary hasn't been picked up at all. Plus, using the provided path, the add-on may look into the add-on /usr folder, which doesn't hold your custom binary.

bpolaszek commented 9 months ago

Hi @einschmidt,

Thanks for your quick reply. Indeed after rebooting the /usr/local/bin/caddy file was removed anyway. Your solution works! Putting the real caddy binary at /share/caddy/caddy did the trick.

Sorry for disturbing. Have a nice day! Ben