Skip to content

Commit d409456

Browse files
authored
Update __init__.py
update env vars
1 parent 96f67a7 commit d409456

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/jupyter_pgadmin_proxy/__init__.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,19 @@ def _get_env(port, base_url):
2020
Returns:
2121
[Dict]: Containing environment settings to launch the Web application.
2222
"""
23+
logger.info(f"pgAdmin ENV: {base_url}pgadmin4/")
2324

24-
return {
25-
"PGADMIN_RUN_PORT": str(port),
26-
"PGADMIN_URL_PREFIX": f"{base_url}pgadmin/".lstrip("/"),
25+
default_email = os.getenv("PGADMIN_DEFAULT_EMAIL", "[email protected]")
26+
setup_email = os.getenv("PGADMIN_SETUP_EMAIL", "[email protected]")
27+
return {
28+
"PGADMIN_SERVER_MODE": 'True',
29+
"PGADMIN_DEFAULT_EMAIL": default_email,
30+
"PGADMIN_SETUP_EMAIL": setup_email,
31+
"PGADMIN_SETUP_PASSWORD": "",
32+
"PGADMIN_LISTEN_PORT": str(port),
33+
"APPLICATION_ROOT": f"{base_url}pgadmin4/",
34+
"SCRIPT_NAME": f"{base_url}pgadmin4/",
35+
"REMOTE_USER": os.getenv("USER", os.getenv("NB_USER", "nobody")),
2736
}
2837

2938

0 commit comments

Comments
 (0)