Skip to content

Commit

Permalink
fix: add missing ISSUER_2FA default
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaile committed Nov 5, 2024
1 parent 53eb48f commit d798e08
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions imageroot/update-module.d/11set_twofa_provider
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env python3

#
# Copyright (C) 2024 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#

# sets a 2FA provider in the config.env file
with open('config.env', 'a+') as file:
already_exists = False
fqdn = ''
while line := file.readline():
if line.startswith('FQDN'):
fqdn = line.split('=')[1].strip()
if line.startswith('ISSUER_2FA'):
already_exists = True
if not already_exists:
file.write(f'ISSUER_2FA={fqdn}\n')

0 comments on commit d798e08

Please sign in to comment.