Skip to content

Commit

Permalink
added new ENVs for new controller (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: Giacomo Sanchietti <[email protected]>
  • Loading branch information
edospadoni and gsanchietti authored Jun 13, 2023
1 parent cdfdd72 commit abec562
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions imageroot/actions/configure-module/20configure
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ with open('config.json', 'w') as config:
config.write(json.dumps(request))

with open('config.env', 'w') as env:
env.write(f'API_USER={request["api_user"]}\n')
env.write(f'API_PASSWORD={request["api_password"]}\n')
env.write(f'ADMIN_USER={request["api_user"]}\n')
env.write(f'ADMIN_PASSWORD={request["api_password"]}\n')
env.write(f'OVPN_NETWORK={request["ovpn_network"]}\n')
env.write(f'OVPN_NETMASK={request["ovpn_netmask"]}\n')
env.write(f'OVPN_CN={request["ovpn_cn"]}\n')
Expand Down
3 changes: 2 additions & 1 deletion imageroot/actions/create-module/20initialize
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ OVPN_UDP_PORT=$ovpn_udp_port
OVPN_TUN=nsc$num
API_PORT=$api_port
API_BIND_IP=127.0.0.1
LISTEN_ADDRESS=127.0.0.1:$api_port
UI_PORT=$ui_port
UI_BIND_IP=127.0.0.1
PROXY_PORT=$proxy_port
PROXY_BIND_UI=127.0.0.1
EOF

cat << EOF > secret.env
API_SECRET=$secret
SECRET_JWT=$secret
EOF

mkdir -p clients
1 change: 1 addition & 0 deletions imageroot/systemd/controller-api.service
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ExecStart=/usr/bin/podman run \
--cgroups=no-conmon \
--pod-id-file %t/MODULE_ID.pod-id \
--replace -d --name MODULE_ID-api \
--volume MODULE_ID-credentials:/nethsecurity-api/credentials/:z \
--volumes-from=MODULE_ID-vpn \
--network=host \
--env-file=/var/lib/nethserver/MODULE_ID/state/network.env \
Expand Down

0 comments on commit abec562

Please sign in to comment.