1. My Caddy version (caddy version
):
~ # ./caddy version root@srv
v2.0.0-rc.3 h1:z2H/QnaRscip6aZJxwTbghu3zhC88Vo8l/K57WUce4Q=
2. How I run Caddy:
~ # ./caddy run root@srv
2020/04/23 07:43:07.316 INFO admin admin endpoint started {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["localhost:2019", "[::1]:2019", "127.0.0.1:2019"]}
2020/04/23 07:43:07.316 INFO serving initial configuration
a. System environment:
Ubuntu 18.04
d. My complete Caddyfile or JSON config:
No configuration file (but I would like to have one, please read “what I tried” below)
3. The problem I’m having:
I would like to start caddy without any configuration (it will be provided later via the API), but only with the API listening on all interfaces beside localhost
.
5. What I already tried:
The best solution for me would be to have a minimalist Caddyfile
which would just configure the API interface and port. I hoped that
{
admin {
listen :2020
}
}
would do the job, but I get a
~ # ./caddy run
2020/04/23 07:47:39.051 INFO using adjacent Caddyfile
run: adapting config using caddyfile: admin: Caddyfile:2 - Error during parsing: Wrong argument count or unexpected line ending after 'admin'
I then tried to push via the API the following config (derived from the Caddyfile above) and it worked
{
"admin": {
"listen": ":2020"
}
}
OK, so maybe that would be OK to have in the Caddyfile
then? But no:
~ # ./caddy run
2020/04/23 07:52:29.717 INFO using adjacent Caddyfile
run: loading initial config: loading new config: starting caddy administration endpoint: parsing admin listener address: invalid start port: strconv.ParseUint: parsing "": invalid syntax