Skip to content

Commit

Permalink
actions: add vpn port to get-configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Aug 1, 2024
1 parent fccdeb9 commit 6f44744
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion imageroot/actions/get-configuration/20read
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#

import os
import json
import sys
import agent
Expand All @@ -26,7 +27,7 @@ else:
foctet=random.randrange(16,31)
soctet=random.randrange(1,254)

config = {'host': '', 'lets_encrypt': False, 'ovpn_network': f'172.{foctet}.{soctet}.0', 'ovpn_netmask': '255.255.255.0', 'ovpn_cn': 'nethsec', 'api_user': 'admin', 'api_password': '', 'loki_retention': 180, 'prometheus_retention': 15}
config = {'host': '', 'lets_encrypt': False, 'ovpn_network': f'172.{foctet}.{soctet}.0', 'ovpn_netmask': '255.255.255.0', 'ovpn_cn': 'nethsec', 'api_user': 'admin', 'api_password': '', 'loki_retention': 180, 'prometheus_retention': 15, 'vpn_port': ''}

characters = list(string.ascii_letters + string.digits + "!@#%^+_")
random.shuffle(characters)
Expand All @@ -35,5 +36,6 @@ else:
password.append(random.choice(characters))
random.shuffle(password)
config["api_password"] = ''.join(password)
config['vpn_port'] = os.environ['TCP_PORTS_RANGE'].split('-')[0]

json.dump(config, fp=sys.stdout)

0 comments on commit 6f44744

Please sign in to comment.