mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-09-18 17:27:24 +00:00
allow to adjust the log level for all caddy instances
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
{
|
||||
admin off
|
||||
|
||||
auto_https disable_redirects
|
||||
|
||||
storage file_system {
|
||||
@@ -9,8 +11,19 @@
|
||||
# trusted_proxies placeholder
|
||||
}
|
||||
|
||||
# The endpoint below is plain http on purpose, so limit it to h1 to avoid caddy warning that
|
||||
# HTTP/2 and HTTP/3 were skipped. Excluding the `http` logger would also hide acme messages.
|
||||
servers :23973 {
|
||||
protocols h1
|
||||
}
|
||||
|
||||
# apache-port protocols placeholder
|
||||
|
||||
log {
|
||||
level ERROR
|
||||
level {$CADDY_LOG_LEVEL}
|
||||
# Below ERROR, caddy prints 'admin endpoint disabled' on every start, which is expected
|
||||
# since we set `admin off` above.
|
||||
exclude admin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ if [ -z "$NC_DOMAIN" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CADDY_LOG_LEVEL="$(echo "$AIO_LOG_LEVEL" | tr '[:lower:]' '[:upper:]')"
|
||||
export CADDY_LOG_LEVEL
|
||||
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
export AIO_ACCESS_LOG=/proc/self/fd/1
|
||||
else
|
||||
@@ -64,6 +66,13 @@ else
|
||||
fi
|
||||
echo "$CADDYFILE" > /tmp/Caddyfile
|
||||
|
||||
# In case of reverse proxies the APACHE_PORT listener is plain http, so limit it to h1 to avoid
|
||||
# caddy warning that HTTP/2 and HTTP/3 were skipped. See the Caddyfile for further details.
|
||||
if [ "$APACHE_PORT" != '443' ]; then
|
||||
CADDYFILE="$(sed "s|# apache-port protocols placeholder|servers :$APACHE_PORT {\n\t\tprotocols h1\n\t}|" /tmp/Caddyfile)"
|
||||
echo "$CADDYFILE" > /tmp/Caddyfile
|
||||
fi
|
||||
|
||||
# Remove additional domain if not given
|
||||
if [ -z "$ADDITIONAL_TRUSTED_DOMAIN" ]; then
|
||||
CADDYFILE="$(sed '/ADDITIONAL_TRUSTED_DOMAIN/d' /tmp/Caddyfile)"
|
||||
|
||||
Reference in New Issue
Block a user