-
-
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
caddy validate
fail as unprivileged user since 2.9.0, when using a privileged log path
#6788
Comments
Well, part of the validation is to ensure that the config will load and run successfully. So ignoring errors would defeat the purpose. If we ignore that error, your config won't work when you go to run it. |
So you mean |
Yes, again; the point of validate is to ensure that when you go to run your server, it has the highest likelihood of running successfully. Since it will have to have a place to write the log files, it needs to have the directory for them.
If you only want to verify your config syntax, use |
@mholt does this apply for validating because i am getting:
with the following file:{
"apps": {
"http": {
"servers": {
"default": {
"listen": [
":80"
],
"routes": [ {
"handle": [ {
"body": "hello world",
"handler": "static_response",
"status_code": 200
}
]
}
]
}
}
}
}
} |
|
To clarify, caddy adapt is for any config adapter (not just Caddyfile). You will have to use the --adapter flag for any adapter that isn't Caddyfile. |
Or rather, adapt is for any non-JSON config, to turn it into JSON. |
Given
Caddyfile
:Running
caddy validate ./Caddyfile
as an unprivileged user succeeds with caddy 2.8.4, but fails for both 2.9.0 and 2.9.1. Error message:Expected behavior: Exit with 0 successfully and never try to create or modify the log file path.
caddy validate
should be a "dry run".Use case: I'm using
caddy validate
in a NixOS builder sandbox to check the validity (syntax, typo on option names and etc) before deploying to the production server. So I want it to be relatively easy to do the check in a developing environment, without the need to setup a production-compatible environment.I guess it's caused by #6314 ? cc @ririsoft
The text was updated successfully, but these errors were encountered: