From 4be9a0dcdaebd55e245b191fe5b946b5fac6ac87 Mon Sep 17 00:00:00 2001 From: Robert Middleswarth <72569+rmiddle@users.noreply.github.com> Date: Sun, 16 Apr 2023 17:16:49 -0400 Subject: [PATCH] Update PgAdmin to fix folder premission issues. --- template/apps/pgadmin.json | 3 ++- tools/install_pgadmin.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 tools/install_pgadmin.sh diff --git a/template/apps/pgadmin.json b/template/apps/pgadmin.json index d42eb02..7d8f2c6 100644 --- a/template/apps/pgadmin.json +++ b/template/apps/pgadmin.json @@ -35,6 +35,7 @@ "image_arm64": "dpage/pgadmin4:latest", "image_amd64": "dpage/pgadmin4:latest", "logo": "https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/images/pgadmin.png", + "preInstallScript": "install_pgadmin.sh", "name": "pgadmin", "platform": "linux", "ports": [ @@ -45,7 +46,7 @@ "type": 1, "volumes": [ { - "bind": "/portainer/Files/AppData/Config/pgAdmin", + "bind": "/portainer/Files/AppData/Config/pgadmin", "container": "/var/lib/pgadmin" } ], diff --git a/tools/install_pgadmin.sh b/tools/install_pgadmin.sh new file mode 100755 index 0000000..137c903 --- /dev/null +++ b/tools/install_pgadmin.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +function error { + echo -e "\\e[91m$1\\e[39m" + exit 1 +} + +echo "Creating directory..." +sudo mkdir -p /portainer/Files/AppData/Config/pgadmin || error "Failed to create pgadmin folder!" +sudo mkdir -p /portainer/Files/AppData/Config/pgadmin || error "Failed to create pgadmin folder!" +sudo chown -R 5050:root /portainer/Files/AppData/Config/pgadmin || error "Failed to create pgadmin folder!" +echo "Setup complete. You can now install the PgAdmin using the App Template."