Preserve Photos deployment configuration and verify source dependencies

This commit is contained in:
Pigway
2026-10-08 19:25:37 +08:00
parent bb452649b8
commit 0b9b548d20
5 changed files with 100 additions and 0 deletions
+3
View File
@@ -376,6 +376,9 @@ class Deploy:
service["image"] = image
proposed = self.secret_config()
service["environment"].update(proposed)
for key in ("SYNOLOGY_PHOTOS_URL", "SYNOLOGY_PHOTOS_CERT_SHA256"):
if self.env.get(key):
service["environment"][key] = self.env[key]
service["environment"].update(
KOKONNA_MOCK=self.env["PROD_MOCK"],
KOKONNA_WRITE_ENABLED=self.env["PROD_WRITE_ENABLED"],
+19
View File
@@ -1,5 +1,6 @@
"""Read-only HTTP smoke checks. No frame writes; token read from env/private .env."""
import json
import os
from pathlib import Path
from urllib.request import Request, urlopen
@@ -26,4 +27,22 @@ for path in [
body = response.read()
print(path, "HTTP", response.status, "bytes", len(body))
assert response.status == 200
# A restored job is not usable merely because the scheduler is ready.
request = Request(
base + "/api/v1/photo-sources", headers={"Authorization": "Bearer " + token}
)
with urlopen(request, timeout=15) as response:
sources = json.load(response)
if any(source.get("enabled") and source.get("people_filter") for source in sources):
request = Request(
base + "/api/v1/integrations/synology-photos",
headers={"Authorization": "Bearer " + token},
)
with urlopen(request, timeout=15) as response:
photos = json.load(response)
if not photos.get("configured") or not photos.get("connected"):
raise RuntimeError(
"Enabled people-filtered photo source requires Photos connection"
)
print("Synology Photos dependency configured and connected")
print("Read-only smoke checks passed")