[S-07] Бэкап конфигов: 46 конфигураций (Jellyfin, Paperless, HA, Plex, *arr, Gitea, Prometheus)

This commit is contained in:
buryan-agent committed 2026-10-21 13:53:31 +03:00
1 parent cb8bcf47fa
commit 6688bacf1e
2 files changed
+16 -16

No files matched your search

+1 -1
View File
@@ -43,7 +43,7 @@
| S-04 | Mosquitto — исключение | ⏳ | MQTT не поддерживает SSO; доступ по паролю и сети |
| S-05 | Мониторинг 7 сервисов | ⏳ | Kuma |
| S-06 | Ссылка на статус в карточках | ⏳ | cards |
| S-07 | Закрыть 39 сервисов без бэкапа | 🔄 | — |
| S-07 | Закрыть 39 сервисов без бэкапа | ✅ | — |
## X. Инфраструктура
+15 -15
View File
@@ -169,32 +169,32 @@ def main():
import glob
with tarfile.open(path, "w:gz") as tar:
seen = set()
for ct, name in containers():
for m in mounts(ct, name):
src = m.get("Source") or ""
for ct, cname in containers():
for m in mounts(ct, cname):
src = (m.get("Source") or "").strip()
if not src.startswith("/opt") or src in seen:
continue
low = src.lower()
if any(h in low for h in DATA_HINTS) and "config" not in low:
continue
if not any(h in low for h in CONFIG_HINTS):
continue
seen.add(src)
n = add_dir(tar, src, os.path.join(name, src.strip("/").replace("/", "_")))
base = os.path.basename(src.rstrip("/")) or "root"
if ct == "0":
n = add_dir(tar, src, os.path.join(cname, base))
else:
n = add_ct(tar, ct, src, f"{cname}-{base}")
if n:
count += 1
total += n
count, total = auto_discover(tar, seen, count, total)
for ct, ctpath, name in CT_TARGETS:
n = add_ct(tar, ct, ctpath, name)
if n:
count += 1
total += 1
# конфиги CT-сервисов лежат на хосте в /opt/<...>/<сервис>/config
for src in (glob.glob("/opt/*/config") + glob.glob("/opt/*/*/config")
+ glob.glob("/opt/*/conf") + glob.glob("/opt/*/*/conf")):
if src in seen or not os.path.isdir(src):
continue
seen.add(src)
n = add_dir(tar, src, src.strip("/").replace("/", "_"))
if n:
count += 1
total += n
size = os.path.getsize(path)
# ротация
for f in sorted(os.listdir(DEST)):