diff --git a/conda-store-server/conda_store_server/server/templates/conda-store-ui.html b/conda-store-server/conda_store_server/server/templates/conda-store-ui.html
index 239325011..3ab2d13ef 100644
--- a/conda-store-server/conda_store_server/server/templates/conda-store-ui.html
+++ b/conda-store-server/conda_store_server/server/templates/conda-store-ui.html
@@ -4,6 +4,18 @@
User
-
diff --git a/conda-store-server/hatch_build.py b/conda-store-server/hatch_build.py
index 4b154ad5d..f73b7ae7d 100644
--- a/conda-store-server/hatch_build.py
+++ b/conda-store-server/hatch_build.py
@@ -4,6 +4,7 @@
import pathlib
import urllib.request
import shutil
+import re
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
@@ -56,3 +57,15 @@ def initialize(self, version: str, build_data: Dict[str, Any]) -> None:
source_directory / filename,
destination_directory / filename,
)
+
+ # dirty modifications (bound to break eventually!) to
+ # main.js to enable easy configuration see
+ # conda_store_server/server/templates/conda-store-ui.html
+ # for global variable set
+ with (source_directory / "main.js").open("r") as source_f:
+ content = source_f.read()
+ content = re.sub(
+ '"MISSING_ENV_VAR"', "GLOBAL_CONDA_STORE_STATE", content
+ )
+ with (destination_directory / "main.js").open("w") as dest_f:
+ dest_f.write(content)