Release v0.1.9: enforce Photos API boundary and finalize Server migration
This commit is contained in:
@@ -70,6 +70,13 @@ class Deploy:
|
||||
return json.loads(self.run("inspect", name).stdout)[0]
|
||||
|
||||
def settings(self):
|
||||
if any(
|
||||
self.env.get(key, "").startswith("/volume2/docker/pigway-frame-flow")
|
||||
for key in ("PROD_DATA_DIR", "PROD_CONFIG_DIR")
|
||||
):
|
||||
raise ValueError(
|
||||
"NAS Frame deployment is retired; target the Ubuntu Server"
|
||||
)
|
||||
missing = [key for key in REQUIRED if not self.env.get(key)]
|
||||
if missing:
|
||||
raise ValueError("Missing Variables: " + ", ".join(missing))
|
||||
@@ -118,20 +125,9 @@ class Deploy:
|
||||
or not m.get("RW")
|
||||
):
|
||||
raise ValueError("Production mount mismatch: " + key)
|
||||
photos = self.env.get("PROD_PHOTOS_DIR")
|
||||
if "/photos" in mounts and (
|
||||
not photos
|
||||
or mounts["/photos"]["Source"] != photos
|
||||
or mounts["/photos"]["RW"]
|
||||
):
|
||||
raise ValueError(
|
||||
"Confirm PROD_PHOTOS_DIR for the existing read-only photo mount"
|
||||
)
|
||||
if photos and "/photos" not in mounts:
|
||||
raise ValueError(
|
||||
"Configured photos directory does not match current container"
|
||||
)
|
||||
if set(mounts) != {"/data", "/config"} | ({"/photos"} if photos else set()):
|
||||
if self.env.get("PROD_PHOTOS_DIR") or "/photos" in mounts:
|
||||
raise ValueError("Filesystem photo mounts are retired; use the Photos API")
|
||||
if set(mounts) != {"/data", "/config"}:
|
||||
raise ValueError("Unrecognized persistent mount; review before adopting CD")
|
||||
bindings = old["HostConfig"].get("PortBindings", {}).get("18787/tcp")
|
||||
if bindings != [
|
||||
@@ -180,16 +176,6 @@ class Deploy:
|
||||
)
|
||||
]
|
||||
service["group_add"] = old["HostConfig"].get("GroupAdd") or []
|
||||
if photos:
|
||||
service["volumes"].append(
|
||||
{
|
||||
"type": "bind",
|
||||
"source": photos,
|
||||
"target": "/photos",
|
||||
"read_only": True,
|
||||
"bind": {"create_host_path": False},
|
||||
}
|
||||
)
|
||||
# Adoption must preserve runtime constraints, not silently change them.
|
||||
if (
|
||||
old["Config"]["User"] != service["user"]
|
||||
|
||||
Reference in New Issue
Block a user