fix(stage): accept persisted ADMIN human role in maintenance
Stage author bootstrap (dedicated repair) / bootstrap (push) Successful in 1m5s
Deploy Canina / deploy (push) Successful in 2m41s

This commit is contained in:
Canina Automation committed 2026-10-28 21:08:40 +00:00
1 parent a0d588ba12
commit 69dd6922f6
3 files changed
+15 -1

No files matched your search

+6
View File
@@ -62,6 +62,12 @@ def run(env=os.environ, call=subprocess.run):
database_info = json.loads(command(['docker', 'inspect', op.STAGE], capture_output=True).stdout)[0]
op.check_identity(database_info)
validate_runtime_url(values.get('DATABASE_URL', ''), database_info)
# Dedicated maintenance scope uses the independently verified canonical name.
# Preserve credentials, remove only the already validated default schema hint.
from urllib.parse import urlparse
runtime_url = urlparse(values['DATABASE_URL'])
credentials = runtime_url.netloc.rsplit('@', 1)[0] + '@' if '@' in runtime_url.netloc else ''
values['DATABASE_URL'] = runtime_url._replace(netloc=credentials + op.STAGE + ':5432', query='').geturl()
if any('\n' in v or '\r' in v for v in values.values()): raise ValueError('Multiline env refused')
live_env = evidence / 'stage.env'
op.private_write(live_env, '\n'.join(k + '=' + v for k, v in values.items()).encode())