feat(security): add operator rotation and recovery commands
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
+38
-1
@@ -26,7 +26,44 @@ def command(args, *, input=None):
|
||||
|
||||
|
||||
def compose(*args, input=None):
|
||||
return command(["docker", "compose", *args], input=input)
|
||||
if args[0] == "exec" and "controller" in args:
|
||||
from scripts.operator_task import prepare
|
||||
|
||||
prepare()
|
||||
result = command(["docker", "compose", *args], input=input)
|
||||
# A restarted native container can get a new network namespace. Rejoin
|
||||
# its TLS gateway explicitly instead of keeping an obsolete loopback hop.
|
||||
native = {
|
||||
"postgres",
|
||||
"cache",
|
||||
"broker",
|
||||
"s3",
|
||||
"lb",
|
||||
"otel",
|
||||
"prometheus",
|
||||
"loki",
|
||||
"tempo",
|
||||
"grafana",
|
||||
}
|
||||
if args[0] in {"restart", "up"}:
|
||||
targets = sorted(native.intersection(args[1:]))
|
||||
if targets:
|
||||
command(
|
||||
[
|
||||
"docker",
|
||||
"compose",
|
||||
"up",
|
||||
"-d",
|
||||
"--no-deps",
|
||||
"--force-recreate",
|
||||
*[role + "-tls" for role in targets],
|
||||
]
|
||||
)
|
||||
if "lb" in targets:
|
||||
command(
|
||||
["docker", "compose", "up", "-d", "--no-deps", "identity-lb"]
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
def sql(query, *, database="messenger"):
|
||||
|
||||
Reference in New Issue
Block a user