tools: prepare MIT source for public distribution
Ship MIT notices with published outputs and keep runtime credentials, configuration and history out of source archives. Audit working files, staged blobs and reachable history before publication. Refs #19
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
"""Shared publication/deployment policy for local runtime files; never read their contents."""
|
||||
from pathlib import PurePosixPath
|
||||
|
||||
PRIVATE_NAMES = {"server.json", "worker.json", "server.env", "worker.env", "transport-keys.json", "dashboard-key", "worker-key",
|
||||
"auth.json", ".credentials.json", "snapshot.json", "fleet.json", "history.json", "history.state.json",
|
||||
"history.journal.jsonl", "usage.json", "profile.json", "settings.json", "id_rsa", "id_ecdsa", "id_ed25519"}
|
||||
|
||||
|
||||
def is_private_path(path):
|
||||
p = PurePosixPath(str(path).replace("\\", "/").lower())
|
||||
return (p.name in PRIVATE_NAMES or p.name == ".env" or p.name.startswith(".env.") and p.name != ".env.example"
|
||||
or p.suffix in (".env", ".key", ".pem", ".pfx", ".p12")
|
||||
or any(part in (".claude", ".codex", ".ssh", ".aws", ".azure") for part in p.parts)
|
||||
or len(p.parts) > 1 and p.parts[0] in ("data", "state", "logs", "runs", "history"))
|
||||
Reference in New Issue
Block a user