Files
buryan-infra/ops/sso/2026-10-19-vecher/03-firefly-compose-indent.sh
T

39 lines
1.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Довожу Firefly: отступ 6 пробелов (как у соседних) и пересоздание контейнера
set -uo pipefail
CT=110
F=/opt/lifestyle-lxc/docker-compose.yml
echo "=== 1. ЧЕМ МОЖНО ПЕРЕСОЗДАТЬ ==="
pct exec $CT -- bash -c "command -v docker-compose; docker-compose version 2>/dev/null | head -2; docker compose version 2>/dev/null | head -1" | sed 's/^/ /'
echo
echo "=== 2. ВЫРАВНИВАЮ ПО СОСЕДНИМ (6 пробелов) ==="
pct exec $CT -- python3 - <<'PY'
p = "/opt/lifestyle-lxc/docker-compose.yml"
src = open(p, encoding="utf-8").read().split("\n")
out = []
for ln in src:
s = ln.strip()
if s.startswith("- AUTHENTICATION_"):
out.append(" " + s) # ровно как у APP_KEY и DB_*
else:
out.append(ln)
open(p, "w", encoding="utf-8").write("\n".join(out))
print(" выровнено")
PY
pct exec $CT -- bash -c "grep -n 'APP_KEY\|AUTHENTICATION' $F" | sed 's/^/ /'
echo
echo "=== 3. ПРОВЕРКА ЧЕРЕЗ docker-compose (v1) ==="
pct exec $CT -- bash -c "cd /opt/lifestyle-lxc && docker-compose config 2>/dev/null | grep -A4 'environment' | head -20" | sed 's/^/ /'
echo
echo "=== 4. ПЕРЕСОЗДАЮ КОНТЕЙНЕР FIREFLY ==="
pct exec $CT -- bash -c "cd /opt/lifestyle-lxc && docker-compose up -d firefly 2>&1 | tail -3" | sed 's/^/ /'
sleep 25
echo " состояние: $(pct exec $CT -- docker inspect firefly --format '{{.State.Status}}')"
echo " переменные входа:"
pct exec $CT -- docker inspect firefly --format '{{range .Config.Env}}{{println .}}{{end}}' 2>/dev/null | grep -iE 'AUTHENTICATION' | sed 's/^/ /'
echo " ответ службы: $(curl -s -o /dev/null -w '%{http_code}' --max-time 15 http://192.168.1.110:8080/)"