Pin attended OpenBao login to the operator tunnel.
Public Ingress is gone, so BAO_ADDR=https://bao.coulomb.social fails before command handoff. The wrapper now uses 127.0.0.1:18200. Assistant: grok Assistant-Session: 01a0a23b-3bf0-7341-b4e5-9dc05f72573a
This commit is contained in:
parent
4b34c239bc
commit
75e5c1af65
4 changed files with 37 additions and 4 deletions
|
|
@ -23,14 +23,25 @@ def reviewed_command(args):
|
|||
return [str(command), *args[1:]]
|
||||
|
||||
|
||||
def main():
|
||||
args = reviewed_command(sys.argv[1:])
|
||||
TUNNEL = 'http://127.0.0.1:18200'
|
||||
|
||||
|
||||
def contained_env():
|
||||
env = os.environ.copy()
|
||||
env['BAO_ADDR'] = TUNNEL
|
||||
env['VAULT_ADDR'] = TUNNEL
|
||||
env.pop('BAO_TOKEN', None)
|
||||
env.pop('VAULT_TOKEN', None)
|
||||
if not any(shutil.which(x) for x in ('xdg-open', 'x-www-browser', 'www-browser')):
|
||||
if not Path('/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe').is_file():
|
||||
raise SystemExit('No supported attended browser launcher is available')
|
||||
env['PATH'] = str(Path(__file__).resolve().parent / 'operator-browser') + os.pathsep + env.get('PATH', '')
|
||||
os.execvpe('warden', ['warden', 'access', 'openbao-platform-admin-login', '--exec', '--', *args], env)
|
||||
return env
|
||||
|
||||
|
||||
def main():
|
||||
args = reviewed_command(sys.argv[1:])
|
||||
os.execvpe('warden', ['warden', 'access', 'openbao-platform-admin-login', '--exec', '--', *args], contained_env())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue