-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd: Fix paths when using an env file #4296
cmd: Fix paths when using an env file #4296
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. (Sorry for how long it's taking me to get around to this issue.)
I'm very sensitive about adding new exported identifiers, and in this case I think we can avoid it. The function is only called in one place, so I think it'd be fair to just move that logic directly into the loadEnvFromFile()
function, or, if you still want a separate function, move it next to loadEnvFromFile()
and leave it unexported. (I don't think it needs to be a separate function though, personally.)
That sound alright?
813ebf8
to
e6fc152
Compare
e6fc152
to
57bc70b
Compare
I agree that exporting this function isn't really necessary. Exporting it brings the risk of someone using it at a wrong spot in the future. The logic has been moved to |
Much better - thanks so much! |
Description
Fix the behaviour of the environment variables
XDG_DATA_HOME
andXDG_CONFIG_HOME
when supplied through an env file to match the expected one.For further information, check #4273
Related Issues
Resolves #4273
Testing
--envfile
./home/user/.local/share/caddy/<files and/or folders>
--envfile
, Caddy should use the environment variablesXDG_DATA_HOME
andXDG_CONFIG_HOME
from the env file instead (instead) of the system ones. This should cause Caddy to create its files/directories at the location specified in the env file./home/user/.local/share/caddy/autosave.json
Caddy now uses/home/user/caddydata/caddy/autosave.json
, whenXDG_CONFIG_HOME
was set to/home/user/caddydata
in the env file.