Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
adde openresty_url to conf
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Mar 27, 2023
1 parent 4033d00 commit ce2d78f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion VirtualMachineService/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ def __init__(self, config):

try:
self.RE_BACKEND_URL = cfg["forc"]["forc_url"]
backend_url_host = self.RE_BACKEND_URL.split(":")
self.FORC_URL = cfg["forc"].get("openresty_url", None) or f"https:{backend_url_host[1]}/"

self.FORC_API_KEY = os.environ.get("FORC_API_KEY", None)
self.FORC_ALLOWED = {}
self.FORC_HTTPS = cfg["forc"].get("forc_https", True)
Expand All @@ -291,6 +294,7 @@ def __init__(self, config):
):
raise ValueError
LOG.info(msg=f"Forc-Backend url loaded: {self.RE_BACKEND_URL}")
LOG.info(msg=f"Forc-Frontend Url loaded: {self.FORC_URL}")
except ValueError as ve:
LOG.exception(ve)
LOG.info(
Expand Down Expand Up @@ -1386,13 +1390,16 @@ def create_and_deploy_playbook(
def has_forc(self):
return self.RE_BACKEND_URL is not None

def get_forc_url(self):
def set_forc_url(self):
if self.RE_BACKEND_URL is None:
return ""
else:
url = self.RE_BACKEND_URL.split(":")
return f"https:{url[1]}/"

def get_forc_url(self):
return self.FORC_URL

def cross_check_forc_image(self, tags):
get_url = f"{self.RE_BACKEND_URL}{self.TEMPLATES_URL}"
try:
Expand Down
1 change: 1 addition & 0 deletions VirtualMachineService/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ bibigrid:

forc:
forc_url:
openresty_url:
forc_https: True
github_playbooks_repo:
forc_remote_id:
Expand Down

0 comments on commit ce2d78f

Please sign in to comment.