Publish curated Unraid-AppOps-Gateway source from 4f159a7e60d5becc5218ef4c541e2005d733a537

This commit is contained in:
Public Source Publisher committed 2026-10-03 18:14:21 +00:00
1 parent ec6f5b559f
commit 235d8fd493
7 files changed
+783 -50

No files matched your search

+10 -1
View File
@@ -149,12 +149,16 @@ def test_embedded_registry_writer_uses_protected_aliases_and_preserves_code(
repositories = tmp_path / "repositories"
bare = repositories / "jens" / "example.git"
bare.mkdir(parents=True)
state = tmp_path / "controller-state"
state.mkdir(mode=0o700)
backups = state / "registry-backups"
paths = {
"/controller-config/projects.json": readonly,
"/controller-hub-releases/controller-config/projects.json": registry,
"/opt/gitea-deploy/projects.json": old_registry,
"/mnt/cache/appdata/gitea-deploy-runners/controller/projects.json": old_host_registry,
"/mnt/cache/appdata/gitea-deploy-runners/deploy.lock": tmp_path / "deploy.lock",
"/mnt/cache/appdata/gitea-deploy-runners/state/registry-backups": backups,
"/gitea-repositories": repositories,
}
@@ -175,7 +179,12 @@ def test_embedded_registry_writer_uses_protected_aliases_and_preserves_code(
exec(compile(tree, "registry-writer", "exec"), {"Path": fixture_path})
assert json.loads(registry.read_text()) == {"jens/example": project}
assert registry.stat().st_mode & 0o777 == 0o600
assert list(registry.parent.glob("projects.json.appops-backup-*"))
backup_files = list(backups.glob("projects.json.appops-backup-*"))
assert len(backup_files) == 1
assert backup_files[0].read_bytes() == b"{}\n"
assert backup_files[0].stat().st_mode & 0o777 == 0o600
assert backups.stat().st_mode & 0o777 == 0o700
assert not list(registry.parent.glob("projects.json.appops-backup-*"))
else:
with pytest.raises(SystemExit) as error:
exec(compile(tree, "registry-writer", "exec"), {"Path": fixture_path})