Skip to content

Commit

Permalink
no admin injection
Browse files Browse the repository at this point in the history
  • Loading branch information
pieroit committed Dec 6, 2023
1 parent e06d732 commit 5678b56
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/cat/routes/static/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ def get_injected_admin():
# - CORE_HOST
# - CORE_PORT
# - CORE_USE_SECURE_PROTOCOLS
cat_core_config = json.dumps({
"CORE_HOST": os.getenv("CORE_HOST", "localhost"),
"CORE_PORT": os.getenv("CORE_PORT", "1865"),
"CORE_USE_SECURE_PROTOCOLS": os.getenv("CORE_USE_SECURE_PROTOCOLS", ""),
})
#cat_core_config = json.dumps({
# "CORE_HOST": os.getenv("CORE_HOST", "localhost"),
# "CORE_PORT": os.getenv("CORE_PORT", "1865"),
# "CORE_USE_SECURE_PROTOCOLS": os.getenv("CORE_USE_SECURE_PROTOCOLS", ""),
#})

# the admin sttic build is created during docker build from this repo:
# https://github.com/cheshire-cat-ai/admin-vue
Expand All @@ -38,10 +38,10 @@ def get_injected_admin():
html = f.read()

# TODO: this is ugly, should be done with beautiful soup or a template
regex = re.compile(
r"catCoreConfig = (\{.*?\})", flags=re.MULTILINE | re.DOTALL)
default_config = re.search(regex, html).group(1)
html = html.replace(default_config, cat_core_config)
#regex = re.compile(
# r"catCoreConfig = (\{.*?\})", flags=re.MULTILINE | re.DOTALL)
#default_config = re.search(regex, html).group(1)
#html = html.replace(default_config, cat_core_config)

return HTMLResponse(html)

Expand Down

0 comments on commit 5678b56

Please sign in to comment.