Skip to content

Commit c242267

Browse files
committed
add environment variable to be able to hide icon
1 parent 1573e58 commit c242267

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
PGDATABASE: postgres
1717
PGUSER: postgres
1818
PGPASSWORD: postgres
19+
# PGADMIN_ENABLED: 'false'
1920
volumes:
2021
- "${PWD}:/home/jovyan/jupyter-pgadmin-proxy"
2122
postgres:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "jupyter-pgadmin-proxy"
7-
version = "0.0.1"
7+
version = "0.0.2"
88
authors = [
99
{ name="Matus Kosut", email="[email protected]" },
1010
{ name="Diepiriye Okujagu", email="[email protected]" },

src/jupyter_pgadmin_proxy/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
logger.setLevel("INFO")
1111

1212

13+
TRUTHY = ("true", "1", "yes", "on", "y")
14+
15+
16+
def truthy(val):
17+
return str(val).strip('"').strip("'").lower() in TRUTHY
18+
19+
1320
def _get_env(port, base_url):
1421
"""
1522
Returns a dict containing environment settings to launch the Web App.
@@ -94,6 +101,7 @@ def run_app():
94101
# "request_headers_override": {"X-Script-Name": "{base_url}pgadmin"},
95102
"launcher_entry": {
96103
"title": "pgAdmin4",
97-
"icon_path": icon_path
104+
"icon_path": icon_path,
105+
"enabled": truthy(os.getenv("PGADMIN_ENABLED", "true")),
98106
},
99107
}

0 commit comments

Comments
 (0)