Skip to content

Commit

Permalink
configure-module: add nethvoice domain http route
Browse files Browse the repository at this point in the history
  • Loading branch information
Amygos committed Feb 9, 2024
1 parent b212159 commit 7d8af13
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions imageroot/actions/configure-module/30traefik
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,16 @@ default_traefik_id = agent.resolve_agent_id('traefik@node')
if default_traefik_id is None:
sys.exit(2)

# Configure Traefik to route "/nethvoice" or /$BRAND_NAME
# Configure Traefik to route "/"
response = agent.tasks.run(
agent_id=agent.resolve_agent_id('traefik@node'),
action='set-route',
data={
'instance': os.environ['MODULE_ID'] + '-wizard',
'url': 'http://127.0.0.1:' + os.environ["APACHE_PORT"] + '/' + os.environ["BRAND_NAME"].lower(),
'url': 'http://127.0.0.1:' + os.environ["APACHE_PORT"] + '/',
'http2https': os.environ["TRAEFIK_HTTP2HTTPS"] == "true",
'lets_encrypt': lets_encrypt,
'host': os.environ["NETHVOICE_HOST"],
'path': '/' + os.environ["BRAND_NAME"].lower(),
},
)

# Check if traefik configuration has been successfull
agent.assert_exp(response['exit_code'] == 0)

# Configure Traefik to route "/freepbx" path requests to the webapp service
response = agent.tasks.run(
agent_id=agent.resolve_agent_id('traefik@node'),
action='set-route',
data={
'instance': os.environ['MODULE_ID'] + '-freepbx',
'url': 'http://127.0.0.1:' + os.environ["APACHE_PORT"] + '/freepbx',
'http2https': os.environ["TRAEFIK_HTTP2HTTPS"] == "true",
'lets_encrypt': lets_encrypt,
'host': os.environ["NETHVOICE_HOST"],
'path': '/freepbx',
'host': os.environ["NETHVOICE_HOST"]
},
)

Expand Down

0 comments on commit 7d8af13

Please sign in to comment.