Skip to content

Commit

Permalink
Merge pull request #70 from NethServer/restoreFix
Browse files Browse the repository at this point in the history
Restoration Error Due to Misconfigured Environment Variables NethServer/dev#6995
  • Loading branch information
stephdl authored Sep 2, 2024
2 parents cb8fee9 + e211fe0 commit a0f37de
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
4 changes: 0 additions & 4 deletions imageroot/actions/configure-module/20traefik
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ h2hs = data.get("http2https", True)
agent.set_env("TRAEFIK_PATH", path)
agent.set_env("TRAEFIK_HTTP2HTTPS", h2hs)

# Make sure everything is saved inside the environment file
# just before starting systemd unit
agent.dump_env()

# Find default traefik instance for current node
default_traefik_id = agent.resolve_agent_id('traefik@node')
if default_traefik_id is None:
Expand Down
4 changes: 0 additions & 4 deletions imageroot/actions/create-module/10configure
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,3 @@ nginx_tcp_port = env_tcp_ports[1]
# Setup configuration from user input.
agent.set_env("SFTPGO_TCP_PORT", sftpgo_tcp_port)
agent.set_env("NGINX_TCP_PORT", nginx_tcp_port)

# Make sure everything is saved inside the environment file
# just before starting systemd unit
agent.dump_env()
15 changes: 2 additions & 13 deletions imageroot/actions/restore-module/06copyenv
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,7 @@ original_environment = request['environment']
for evar in [
"TRAEFIK_PATH",
"TRAEFIK_HTTP2HTTPS",
"SFTP_TCP_PORT",
"SFTPGO_SERVICE",
]:
agent.set_env(evar, original_environment[evar])

# sftp uses the first one, sftpgo uses the second random port, nginx the third one
env_tcp_ports = os.environ["TCP_PORTS"].split(',')
sftp_tcp_port = env_tcp_ports[0]
sftpgo_tcp_port = env_tcp_ports[1]
nginx_tcp_port = env_tcp_ports[2]
# Talk with agent using file descriptor.
# Setup configuration from user input.
agent.set_env("SFTP_TCP_PORT", sftp_tcp_port)
agent.set_env("SFTPGO_TCP_PORT", sftpgo_tcp_port)
agent.set_env("NGINX_TCP_PORT", nginx_tcp_port)

agent.dump_env()

0 comments on commit a0f37de

Please sign in to comment.