test removing postgres extension

This commit is contained in:
2024-01-13 22:03:13 -06:00
parent 3c7acbab48
commit cabf2a5eca
6 changed files with 30 additions and 65 deletions
+5 -5
View File
@@ -1,8 +1,8 @@
postgresql-hostname: localhost
postgresql-port: 5432
postgresql-database: guacamole_db
postgresql-username: guacamole
postgresql-password: null
# postgresql-hostname: localhost
# postgresql-port: 5432
# postgresql-database: guacamole_db
# postgresql-username: guacamole
# postgresql-password: null
# ldap-hostname: ldap.example.net
# ldap-port: 389
-13
View File
@@ -1,13 +0,0 @@
#!/usr/bin/with-contenv sh
mkdir -p /config/postgres
mkdir -p /var/run/postgresql
chown postgres:postgres /var/run/postgresql
chown -R postgres:postgres /config/postgres
chmod 0700 /config/postgres
if [ -e /config/postgres/postgresql.conf ]; then
echo "Database already configured"
else
s6-setuidgid postgres initdb
fi
+3 -3
View File
@@ -6,9 +6,9 @@ for i in auth-ldap auth-duo auth-header auth-cas auth-openid auth-quickconnect a
done
# if the guacamole version was bumped, delete the contents of the extensions directory - just on the first run
if [ "$(cat /config/.database-version)" != "$GUAC_VER" ]; then
rm -rf ${GUACAMOLE_HOME}/extensions/*
fi
# if [ "$(cat /config/.database-version)" != "$GUAC_VER" ]; then
# rm -rf ${GUACAMOLE_HOME}/extensions/*
# fi
# enable extensions
for i in $(echo "$EXTENSIONS" | tr "," " "); do
+20 -20
View File
@@ -1,29 +1,29 @@
#!/usr/bin/with-contenv sh
until pg_isready; do
echo "Waiting for postgres to come up..."
sleep 1
done
# until pg_isready; do
# echo "Waiting for postgres to come up..."
# sleep 1
# done
# Create database if it does not exist
psql -U postgres -lqt | cut -d \| -f 1 | grep -qw $POSTGRES_DB
if [ $? -ne 0 ]; then
createuser -U postgres $POSTGRES_USER
createdb -U postgres -O $POSTGRES_USER $POSTGRES_DB
cat /app/guacamole/schema/*.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
echo "$GUAC_VER" > /config/.database-version
# psql -U postgres -lqt | cut -d \| -f 1 | grep -qw $POSTGRES_DB
# if [ $? -ne 0 ]; then
# createuser -U postgres $POSTGRES_USER
# createdb -U postgres -O $POSTGRES_USER $POSTGRES_DB
# cat /app/guacamole/schema/*.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
# echo "$GUAC_VER" > /config/.database-version
/etc/cont-init.d/30-defaults.sh
/etc/cont-init.d/50-extensions
else
if [ "$(cat /config/.database-version)" != "$GUAC_VER" ]; then
cat /app/guacamole/schema/upgrade/upgrade-pre-$GUAC_VER.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
echo "$GUAC_VER" > /config/.database-version
# /etc/cont-init.d/30-defaults.sh
# /etc/cont-init.d/50-extensions
# else
# if [ "$(cat /config/.database-version)" != "$GUAC_VER" ]; then
# cat /app/guacamole/schema/upgrade/upgrade-pre-$GUAC_VER.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
# echo "$GUAC_VER" > /config/.database-version
/etc/cont-init.d/30-defaults.sh
/etc/cont-init.d/50-extensions
fi
fi
# /etc/cont-init.d/30-defaults.sh
# /etc/cont-init.d/50-extensions
# fi
# fi
echo "Starting guacamole client..."
s6-setuidgid root catalina.sh run
-4
View File
@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv sh
echo "Starting postgres..."
s6-setuidgid postgres postgres