From 53b7cc22d0834c07da0a57c5e5f239d1d6e5d236 Mon Sep 17 00:00:00 2001 From: Joop Boonen Date: Thu, 31 Jul 2025 13:15:46 +0200 Subject: [PATCH] Elephant-shed is now using pgadmin instead of omnidb, as omnidb isn't supported any more --- debian/control | 11 +++++------ debian/elephant-shed-omnidb.install | 1 - debian/elephant-shed-omnidb.postinst | 15 --------------- debian/elephant-shed-pgadmin.postinst | 14 ++++++++++++++ doc/chapter/installation.md | 2 +- omnidb/wsgi.py | 10 ---------- portal/elephant-shed.conf | 16 +--------------- portal/template/portalmain.html | 4 ++-- rpm/elephant-shed.spec | 1 - vagrant/tasks/packages.yml | 4 ++-- 10 files changed, 25 insertions(+), 53 deletions(-) delete mode 100644 debian/elephant-shed-omnidb.install delete mode 100644 debian/elephant-shed-omnidb.postinst create mode 100644 debian/elephant-shed-pgadmin.postinst delete mode 100644 omnidb/wsgi.py diff --git a/debian/control b/debian/control index f5f3cab..bf6fd3c 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Architecture: all Depends: elephant-shed-cockpit, elephant-shed-grafana, - elephant-shed-omnidb , + elephant-shed-pgadmin, elephant-shed-pgbackrest, elephant-shed-pgbadger, elephant-shed-portal, @@ -67,16 +67,15 @@ Description: PostgreSQL dashboard -- PostgreSQL integration . This package provides the integration with PostgreSQL. -Package: elephant-shed-omnidb +Package: elephant-shed-pgadmin Architecture: all -Build-Profiles: Depends: - omnidb-server, + pgadmin4-web, ${misc:Depends}, -Description: PostgreSQL dashboard -- OmniDB integration +Description: PostgreSQL dashboard -- Pgadmin integration The Elephant Shed is a web-based PostgreSQL management front-end. . - This meta package provides the integration with OmniDB. + This meta package provides the integration with Pgadmin. Package: elephant-shed-pgbadger Architecture: all diff --git a/debian/elephant-shed-omnidb.install b/debian/elephant-shed-omnidb.install deleted file mode 100644 index e8bf3b0..0000000 --- a/debian/elephant-shed-omnidb.install +++ /dev/null @@ -1 +0,0 @@ -omnidb/wsgi.py /usr/share/elephant-shed/omnidb diff --git a/debian/elephant-shed-omnidb.postinst b/debian/elephant-shed-omnidb.postinst deleted file mode 100644 index ddc99f7..0000000 --- a/debian/elephant-shed-omnidb.postinst +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -eu - -case $1 in - configure) - echo Starting omnidb-server once to initialize /var/lib/omnidb/.omnidb/omnidb-server/ ... - systemctl start omnidb-server - sleep 5 - systemctl stop omnidb-server - systemctl disable omnidb-server - ;; -esac - -#DEBHELPER# diff --git a/debian/elephant-shed-pgadmin.postinst b/debian/elephant-shed-pgadmin.postinst new file mode 100644 index 0000000..7ade8ee --- /dev/null +++ b/debian/elephant-shed-pgadmin.postinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -eu + +case $1 in + configure) + echo "Configure pgadmin to use basicauth as authentication" + sed -i 's/^MASTER_PASSWORD_REQUIRED.*/MASTER_PASSWORD_REQUIRED = False/g' /usr/pgadmin4/web/config.py + sed -i 's/^AUTHENTICATION_SOURCES.*/AUTHENTICATION_SOURCES = ['\''webserver'\'','\''internal'\'']/g' /usr/pgadmin4/web/config.py + export PGADMIN_SETUP_PASSWORD="pgadmin"; export PGADMIN_SETUP_EMAIL="admin@localhost.lan"; /usr/pgadmin4/bin/setup-web.sh --yes + ;; +esac + +#DEBHELPER# diff --git a/doc/chapter/installation.md b/doc/chapter/installation.md index 0ef8ef1..a692fe8 100644 --- a/doc/chapter/installation.md +++ b/doc/chapter/installation.md @@ -12,7 +12,7 @@ Elephant Shed consists of the following Debian packages and their dependencies: * `elephant-shed-grafana`: Preconfigured Prometheus datasource and dashboard that includes various system and PostgreSQL metrics. - * `elephant-shed-omnidb`: + * `elephant-shed-Pgadmin`: Configuration files for OmniDB. * `elephant-shed-pgbackrest`: Systemd service files and generators, helper scripts and preset configuration. diff --git a/omnidb/wsgi.py b/omnidb/wsgi.py deleted file mode 100644 index be612cc..0000000 --- a/omnidb/wsgi.py +++ /dev/null @@ -1,10 +0,0 @@ -import os - -from OmniDB import custom_settings -custom_settings.DEV_MODE = False -custom_settings.HOME_DIR = os.path.join(os.path.expanduser('~'), '.omnidb', 'omnidb-server') -custom_settings.PATH = '/omnidb/' - -from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OmniDB.settings") -application = get_wsgi_application() diff --git a/portal/elephant-shed.conf b/portal/elephant-shed.conf index d708d74..2cb62da 100644 --- a/portal/elephant-shed.conf +++ b/portal/elephant-shed.conf @@ -80,20 +80,6 @@ - - WSGIDaemonProcess omnidb user=omnidb group=omnidb - WSGIScriptAlias /omnidb /usr/share/elephant-shed/omnidb/wsgi.py process-group=omnidb - Alias /omnidb/static /usr/lib/python3/dist-packages/OmniDB_app/static - - - Require all granted - - - - Require all granted - - - ProxyPreserveHost On ProxyPass http://127.0.0.1:8888/powa @@ -126,7 +112,7 @@
\
\ \ -\ +\ \ \ \ diff --git a/portal/template/portalmain.html b/portal/template/portalmain.html index d16cec6..7eccf32 100644 --- a/portal/template/portalmain.html +++ b/portal/template/portalmain.html @@ -19,8 +19,8 @@
diff --git a/rpm/elephant-shed.spec b/rpm/elephant-shed.spec index 620472c..302243d 100644 --- a/rpm/elephant-shed.spec +++ b/rpm/elephant-shed.spec @@ -199,7 +199,6 @@ rm -rf %{buildroot} # install in subpackages using the Debian files for inst in debian/*.install; do pkg=$(basename $inst .install) - [ "$pkg" = "elephant-shed-omnidb" ] && continue # not supported on RH yet echo "### Reading $pkg files list from $inst ###" while read file dir; do case $file in diff --git a/vagrant/tasks/packages.yml b/vagrant/tasks/packages.yml index a0c10e3..3f07bcc 100644 --- a/vagrant/tasks/packages.yml +++ b/vagrant/tasks/packages.yml @@ -75,8 +75,8 @@ # elephant shed # separate tasks, so we can see the progress better -- name: Install elephant-shed-omnidb - package: state=present name=elephant-shed-omnidb +- name: Install elephant-shed-pgadmin + package: state=present name=elephant-shed-pgadmin when: 'ansible_distribution_release != "stretch"' - name: Install elephant-shed-portal package: state=present name=elephant-shed-portal