I’m trying to create a script to launch a new server with my configuration, including Caddy of course. And I also wish to keep the configuration outside the server, to edit it with my computer for instance and then push the changes on the server.
To that end, I wanted to create symbolic links between the configuration folder (for instance stored in the home folder) and the Caddyfile, store in
/etc/caddy (I followed this guide). Whenever I want to make changes to this file, I push and pull the modification through git.
Unfortunately, I can’t launch the caddy service using this symlinked file. When I try to start the service, I have this error :
Jan 26 12:24:49 voiretmanger caddy: 2018/01/26 12:24:49 loading Caddyfile via flag: open /etc/caddy/Caddyfile: permission denied
I made sure the file belonged to the correct user and group and had the correct permissions, but unfortunately, the symbolic link itself is root, so I guess it’s the cause of the problem.
Is there a better way to do what I want ? Or a way to convince Caddy to use my linked Caddyfile ?
EDIT : if needed, all the configuration is detailed here : https://github.com/nicolinuxfr/config-server/blob/master/tools/install.sh