Something went wrong. Try again.
Items for the sister.systems pds
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879#!/usr/bin/env python3import yaml
COMPOSE_PATH = "/pds/compose.yaml"ENV_FILE = "/pds/sdb.env"
with open(COMPOSE_PATH, "r") as f: compose = yaml.safe_load(f)
web = compose.setdefault("services", {}).setdefault("web", {})
# Ensure the web service loads secrets from /pds/sdb.env.existing_env_files = web.get("env_file", [])if isinstance(existing_env_files, str): existing_env_files = [existing_env_files]if ENV_FILE not in existing_env_files: existing_env_files.append(ENV_FILE)web["env_file"] = existing_env_files
# Remove the plaintext VAULT_APP_PASSWORD from the web service environment.env = web.get("environment", [])web["environment"] = [ entry for entry in env if not ( isinstance(entry, str) and entry.startswith("VAULT_APP_PASSWORD=") )]
# Add the deploy-listener service if missing.services = compose.setdefault("services", {})if "deploy-listener" not in services: services["deploy-listener"] = { "container_name": "sdb-deploy-listener", "build": { "context": "/opt/sdb-atproto", "dockerfile": "Dockerfile.listener", }, "network_mode": "host", "restart": "unless-stopped", "env_file": [ENV_FILE], "environment": [ "PORT=9000", "HOST=127.0.0.1", ], "volumes": [ {"type": "bind", "source": "/opt/sdb-atproto", "target": "/app"}, { "type": "bind", "source": "/var/run/docker.sock", "target": "/var/run/docker.sock", }, { "type": "bind", "source": "/root/.ssh/sdb_atproto_deploy", "target": "/root/.ssh/sdb_atproto_deploy", "read_only": True, }, { "type": "bind", "source": "/pds", "target": "/pds", "read_only": True, }, { "type": "bind", "source": "/opt/sdb-atproto", "target": "/opt/sdb-atproto", "read_only": True, }, ], }
with open(COMPOSE_PATH, "w") as f: yaml.safe_dump(compose, f, default_flow_style=False, sort_keys=False)
print("updated /pds/compose.yaml")