fix: quarantine unavailable upstream routes and harden upgrades
This commit is contained in:
1 parent
9acc69d4c7
commit
59907cebdf
8 files changed
+424
-3
No files matched your search
@@ -26,8 +26,12 @@ def fail(message):
|
||||
|
||||
|
||||
def execute(command, capture=False, data=None):
|
||||
result = subprocess.run(command, cwd=HERE, input=data, capture_output=capture,
|
||||
text=True, encoding="utf-8", errors="replace")
|
||||
# Never let docker compose or a diagnostic command consume the caller's
|
||||
# shell stdin. This is especially important when deploy.py is invoked from
|
||||
# an SSH heredoc; only an explicit data payload may be sent to a process.
|
||||
options = {"input": data} if data is not None else {"stdin": subprocess.DEVNULL}
|
||||
result = subprocess.run(command, cwd=HERE, capture_output=capture,
|
||||
text=True, encoding="utf-8", errors="replace", **options)
|
||||
if result.returncode:
|
||||
# Compose error output can contain expanded credentials. Do not echo it.
|
||||
fail("Command failed: " + " ".join(command[:3]) + ". Check local configuration/permissions; do not share secrets.")
|
||||
|
||||
Reference in new issue
Block a user