You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The official Caddy docs describe that a relative filepath is from the file calling import:
Its contents will replace this line as if that file's contents appeared here to begin with.
If the pattern is a filename or glob, it is always relative to the file the import appears in.
This was not my experience with CDP however.
I assume despite CADDY_DOCKER_CADDYFILE_PATH, CDP is importing this snippet from a different location? I did not see any mention of this gotcha when searching the README for keywords like import, snippets, cwd, working.
I searched the issues and came across this response:
The import paths are relative to the CWD, which inside the container is /srv I believe.
So I recommend using absolute paths instead.
Using absolute paths does work, as does changing working_dir for the CDP container to the directory for CADDY_DOCKER_CADDYFILE_PATH (although I'm not sure if changing that risks breaking something else?).
Upstream Caddy works fine without setting the working_dir despite changing the Caddyfile location with caddy run --config /path/to/Caddyfile.
If using absolute paths for import, any imports within those imported files will be relative to that file though 👍
The text was updated successfully, but these errors were encountered:
The official Caddy docs describe that a relative filepath is from the file calling
import
:This was not my experience with CDP however.
I assume despite
CADDY_DOCKER_CADDYFILE_PATH
, CDP is importing this snippet from a different location? I did not see any mention of this gotcha when searching the README for keywords likeimport
,snippets
,cwd
,working
.I searched the issues and came across this response:
Using absolute paths does work, as does changing
working_dir
for the CDP container to the directory forCADDY_DOCKER_CADDYFILE_PATH
(although I'm not sure if changing that risks breaking something else?).Upstream Caddy works fine without setting the
working_dir
despite changing the Caddyfile location withcaddy run --config /path/to/Caddyfile
.If using absolute paths for
import
, any imports within those imported files will be relative to that file though 👍The text was updated successfully, but these errors were encountered: