fae8064557
b9c4f73b (the cc-creds session) committed this session's uncommitted register edits together with its own
R-1118..R-1122, so main carried two rows each for R-1118..R-1122. This session's five move to R-1124..R-1128
(R-1123 stays); the CLOSED-ITEMS section for the three closed rows lands here. Evidence:
audits/tester1-limits-filebrowser-2026-10-17/.
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
23 lines
1.7 KiB
Bash
Executable File
23 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# fbprobe.sh — R-977, run INSIDE a guest. Prints only HTTP status codes and the box's recorded state — never a password.
|
|
# The default credential is FileBrowser's public default; it goes to curl on STDIN as a header, never on a command line.
|
|
# fbprobe.sh probe the default login's status + the box's recorded state + FileBrowser's start time
|
|
# fbprobe.sh recreate remove FileBrowser AND its data volume (what a lost volume looks like), then wait up to
|
|
# 10 min for the box itself to bring FileBrowser back (no hand start), probing each minute
|
|
set -u
|
|
S=/var/lib/docker/volumes/felhom-controller-data/_data/data/settings.json
|
|
state() { python3 -c "import json;d=json.load(open('$S'));print(d.get('filebrowser_admin_state'), d.get('filebrowser_admin_decided_at'))"; }
|
|
probe() {
|
|
ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}' filebrowser 2>/dev/null | awk '{print $1}')
|
|
if [ -z "$ip" ]; then echo "default login: (filebrowser not running)"; return; fi
|
|
code=$(printf 'X-Password: admin\n' | curl -s -o /dev/null -w '%{http_code}' --max-time 10 -X POST -H @- "http://$ip:80/api/auth/login?username=admin")
|
|
echo "default login -> HTTP $code | box state: $(state) | filebrowser started $(docker inspect -f '{{.State.StartedAt}}' filebrowser)"
|
|
}
|
|
case "$1" in
|
|
probe) probe ;;
|
|
recreate)
|
|
echo "volume before: $(docker volume ls -q | grep -c '^filebrowser_filebrowser_data$')"
|
|
docker stop filebrowser >/dev/null && docker rm filebrowser >/dev/null && docker volume rm filebrowser_filebrowser_data >/dev/null && echo "removed filebrowser + filebrowser_filebrowser_data at $(date -u +%T)"
|
|
for i in $(seq 1 10); do sleep 60; echo "+${i}m: $(probe)"; done ;;
|
|
esac
|