Add optional photo providers, layout studio and scoped integrations

This commit is contained in:
Pigway
2026-10-08 23:18:11 +08:00
parent 3643fae86a
commit 69a0841868
38 changed files with 2843 additions and 41 deletions
+18
View File
@@ -0,0 +1,18 @@
"""Atomic mode-0600 secrets; filenames supplied by application code, never callers."""
import os
import tempfile
from pathlib import Path
def save_secret(path, value):
with tempfile.NamedTemporaryFile(mode="w", dir=path.parent, delete=False) as file:
temporary = Path(file.name)
try:
file.write(value)
file.flush()
os.fsync(file.fileno())
temporary.chmod(0o600)
os.replace(temporary, path)
finally:
temporary.unlink(missing_ok=True)