From abec56258f7f9bd4715fa439094daa206fb45346 Mon Sep 17 00:00:00 2001 From: Edoardo Spadoni Date: Tue, 13 Jun 2023 10:28:31 +0200 Subject: [PATCH] added new ENVs for new controller (#10) Co-authored-by: Giacomo Sanchietti --- imageroot/actions/configure-module/20configure | 4 ++-- imageroot/actions/create-module/20initialize | 3 ++- imageroot/systemd/controller-api.service | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/imageroot/actions/configure-module/20configure b/imageroot/actions/configure-module/20configure index cb5de31..90d3587 100755 --- a/imageroot/actions/configure-module/20configure +++ b/imageroot/actions/configure-module/20configure @@ -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') diff --git a/imageroot/actions/create-module/20initialize b/imageroot/actions/create-module/20initialize index 3f2c52e..1cdc654 100755 --- a/imageroot/actions/create-module/20initialize +++ b/imageroot/actions/create-module/20initialize @@ -37,6 +37,7 @@ 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 @@ -44,7 +45,7 @@ PROXY_BIND_UI=127.0.0.1 EOF cat << EOF > secret.env -API_SECRET=$secret +SECRET_JWT=$secret EOF mkdir -p clients diff --git a/imageroot/systemd/controller-api.service b/imageroot/systemd/controller-api.service index 18c191e..db4c432 100644 --- a/imageroot/systemd/controller-api.service +++ b/imageroot/systemd/controller-api.service @@ -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 \