1. The problem I’m having:
Without having updated my Caddyfile, I appear to have inadvertently upgraded to V2 (on Digital Ocean Ubuntu 20.04.5) and, in Firefox for https://theviewfromafar.com/ the message it gives is "unable to connect.
caddy version
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
The previous version ran swimmingly for months.
2. Error messages and/or full log output:
root@viewfromafar:~# caddy stop
2023/03/02 17:16:51.592 WARN failed using API to stop instance {"error": "performing request: Post \"http://localhost:2019/stop\": dial tcp [::1]:2019: connect: connection refused"}
stop: performing request: Post "http://localhost:2019/stop": dial tcp [::1]:2019: connect: connection refused
root@viewfromafar:~#
root@viewfromafar:~# caddy start
2023/03/02 17:17:17.457 INFO using adjacent Caddyfile
2023/03/02 17:17:17.459 WARN input is not formatted with 'caddy fmt' {"adapter": "caddyfile", "file": "Caddyfile", "line": 2}
2023/03/02 17:17:17.461 INFO admin admin endpoint started {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["[::1]:2019", "127.0.0.1:2019", "localhost:2019"]}
2023/03/02 17:17:17.461 INFO http server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2023/03/02 17:17:17.461 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2023/03/02 17:17:17.464 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000574cb0"}
2023/03/02 17:17:17.464 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc000574cb0"}
run: loading initial config: loading new config: loading http app module: provision http: server srv0: setting up route handlers: route 0: loading handler modules: position 0: loading module 'subroute': provision http.handlers.subroute: setting up subroutes: route 0: loading matcher modules: module name 'expression': provision http.matchers.expression: compiling CEL program: ERROR: <input>:1:57: Syntax error: extraneous input '||' expecting {'[', '{', '(', '.', '-', '!', 'true', 'false', 'null', NUM_FLOAT, NUM_INT, NUM_UINT, STRING, BYTES, IDENTIFIER}
| caddyPlaceholder(request, "http.request.uri.query") == || caddyPlaceholder(request, "http.request.uri.query") == tab=links || caddyPlaceholder(request, "http.request.uri.query") == tab=about
| ........................................................^
ERROR: <input>:1:118: Syntax error: token recognition error at: '=l'
| caddyPlaceholder(request, "http.request.uri.query") == || caddyPlaceholder(request, "http.request.uri.query") == tab=links || caddyPlaceholder(request, "http.request.uri.query") == tab=about
| .....................................................................................................................^
ERROR: <input>:1:120: Syntax error: mismatched input 'inks' expecting <EOF>
| caddyPlaceholder(request, "http.request.uri.query") == || caddyPlaceholder(request, "http.request.uri.query") == tab=links || caddyPlaceholder(request, "http.request.uri.query") == tab=about
| .......................................................................................................................^
ERROR: <input>:1:186: Syntax error: token recognition error at: '=a'
| caddyPlaceholder(request, "http.request.uri.query") == || caddyPlaceholder(request, "http.request.uri.query") == tab=links || caddyPlaceholder(request, "http.request.uri.query") == tab=about
| .........................................................................................................................................................................................^
start: caddy process exited with error: exit status 1
root@viewfromafar:~#
3. Caddy version:
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
4. How I installed and ran Caddy:
a. System environment:
Digital Ocean Ubuntu 20.04.5
b. Command:
caddy start
c. Service/unit/compose file:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
theviewfromafar.com {
@shouldRedir {
path /sbwTweet
expression {query} == "" || {query} == "tab=links" || {query} == "tab=about"
}
redir @shouldRedir http://theviewfromafar.com{uri}
reverse_proxy http://oldschool.scripting.com {
header_up Host {upstream_hostport}
}
log
}
5. Links to relevant resources:
In addition to reclaiming caddy as v2, to function I need to make this change:
in the Caddyfile path I need to change
/sbwTweet
to /
sbwaters@rnymedia.com
Also, while I love what you do, and have been a caddy supporter for some time now, I would dearly love to find a caddy/ubuntu poweruser sitting on the other side of a virtual office partition that I could call upon to roll up sleeves and assist. I ceased to be a programmer and a junior webmaster years ago and, at age 75, I need occasionally to be able to buy someone a virtual drink or two from time to time to log in, survey the landscape, save my ass. The time has come for me just to update and run webpages. Do you have pointers to powe rusers for hire?