Skip to content

Commit

Permalink
Merge pull request #3 from huntdatacenter/env-enabled
Browse files Browse the repository at this point in the history
add environment variable to be able to hide icon
  • Loading branch information
matuskosut authored Jun 25, 2023
2 parents 1573e58 + c242267 commit e0aa784
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
PGDATABASE: postgres
PGUSER: postgres
PGPASSWORD: postgres
# PGADMIN_ENABLED: 'false'
volumes:
- "${PWD}:/home/jovyan/jupyter-pgadmin-proxy"
postgres:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "jupyter-pgadmin-proxy"
version = "0.0.1"
version = "0.0.2"
authors = [
{ name="Matus Kosut", email="[email protected]" },
{ name="Diepiriye Okujagu", email="[email protected]" },
Expand Down
10 changes: 9 additions & 1 deletion src/jupyter_pgadmin_proxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
logger.setLevel("INFO")


TRUTHY = ("true", "1", "yes", "on", "y")


def truthy(val):
return str(val).strip('"').strip("'").lower() in TRUTHY


def _get_env(port, base_url):
"""
Returns a dict containing environment settings to launch the Web App.
Expand Down Expand Up @@ -94,6 +101,7 @@ def run_app():
# "request_headers_override": {"X-Script-Name": "{base_url}pgadmin"},
"launcher_entry": {
"title": "pgAdmin4",
"icon_path": icon_path
"icon_path": icon_path,
"enabled": truthy(os.getenv("PGADMIN_ENABLED", "true")),
},
}

0 comments on commit e0aa784

Please sign in to comment.