admin-log: adapt clementine tip/vs content onto main

This commit is contained in:
Hernâni Marques 2026-09-07 17:43:45 +02:00
parent ba863f8a93
commit d8dbc6242b
No known key found for this signature in database
7 changed files with 111 additions and 23 deletions

View file

@ -151,6 +151,7 @@ EXPECT_CONTAINERS=(
koopa-castopod
koopa-bonfire
koopa-lemmy-proxy
koopa-decidim
koopa-prime-jellyfin
koopa-prime-qbittorrent
koopa-forgejo
@ -173,6 +174,7 @@ OPTIONAL_CONTAINERS=(
koopa-castopod
koopa-bonfire
koopa-lemmy-proxy
koopa-decidim
koopa-paivana
)
@ -185,6 +187,7 @@ PROBES=(
"castopod|http://127.0.0.1:9020/|200,302,303,307,308"
"bonfire|http://127.0.0.1:9021/|200,302,303,307,308"
"lemmy|http://127.0.0.1:9026/|200,302,303,307,308"
"decidim|http://127.0.0.1:9027/|200,301,302,303,307,308"
"prime|http://127.0.0.1:9022/|200,302,303,307,308"
"bt|http://127.0.0.1:9023/|200,302,303,307,308,401"
"paivana|http://127.0.0.1:9025/|200,302,303,307,308"
@ -193,7 +196,7 @@ PROBES=(
"tops-ng3|http://127.0.0.1:9092/|200,302,303"
)
OPTIONAL_PROBES=(castopod bonfire lemmy prime bt paivana tops-ng1 tops-ng2 tops-ng3)
OPTIONAL_PROBES=(castopod bonfire lemmy decidim prime bt paivana tops-ng1 tops-ng2 tops-ng3)
C_OK=; C_WARN=; C_FAIL=; C_DIM=; C_RST=; C_BOLD=
# colors only when writing for a tty later; snapshots are plain + optional ANSI if COLLECT_COLOR=1
@ -277,6 +280,34 @@ do_collect() {
record WARN "systemctl not available"
fi
# Reboot survival: linger + enabled user units (public stacks).
if command -v loginctl >/dev/null 2>&1; then
linger_st=$(loginctl show-user "$(id -un)" -p Linger --value 2>/dev/null || echo no)
if [ "${linger_st}" = "yes" ]; then
record OK "linger=yes ($(id -un))"
else
record FAIL "linger=${linger_st} (user units will not start after reboot without login)"
fi
else
record WARN "loginctl not available (cannot check linger)"
fi
if command -v systemctl >/dev/null 2>&1 && [ "$(id -u 2>/dev/null)" != "0" ]; then
local u en
for u in \
container-koopa-lemmy-db.service \
container-koopa-lemmy.service \
container-koopa-decidim-db.service \
container-koopa-decidim.service
do
en=$(systemctl --user is-enabled "${u}" 2>/dev/null || echo unknown)
if [ "${en}" = "enabled" ]; then
record OK "unit ${u} enabled"
else
record WARN "unit ${u} is ${en} (will not start on reboot)"
fi
done
fi
if command -v ss >/dev/null 2>&1; then
listen_blob=$(ss -lnt 2>/dev/null | awk '{print $4}' || true)
for port in 9000 9001 9010 9011 9012 9024 9200; do
@ -286,7 +317,7 @@ do_collect() {
record FAIL "nothing listening on :${port}"
fi
done
for port in 9020 9021 9022 9023 9025 9026 9090 9091 9092 8080 9080; do
for port in 9020 9021 9022 9023 9025 9026 9027 9090 9091 9092 8080 9080; do
if printf '%s\n' "${listen_blob}" | grep -qE "[:.]${port}\$"; then
record OK "listen :${port} (optional)"
else
@ -323,7 +354,7 @@ do_collect() {
fi
fi
done
for dep in koopa-forgejo-db koopa-castopod-mariadb koopa-castopod-redis koopa-bonfire-db koopa-lemmy-db; do
for dep in koopa-forgejo-db koopa-castopod-mariadb koopa-castopod-redis koopa-bonfire-db koopa-lemmy-db koopa-decidim-db koopa-decidim-redis; do
if printf '%s\n' "${running_names}" | grep -qxF "${dep}"; then
record INFO "dep ${dep} running"
else