first commit

This commit is contained in:
oznu
2017-09-02 00:09:42 +10:00
commit 32588ed555
9 changed files with 127 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
postgresql-hostname: localhost
postgresql-port: 5432
postgresql-database: guacamole_db
postgresql-username: guacamole
postgresql-password: null
enable-clipboard-integration: true
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/with-contenv sh
cp -rn /app/guacamole /config
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/with-contenv sh
mkdir -p /config/postgres
chown 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
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/with-contenv sh
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 -
fi
echo "Starting guacamole client..."
s6-setuidgid root catalina.sh run
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv sh
echo "Starting guacamole guacd..."
s6-setuidgid root guacd -f
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv sh
echo "Starting postgres..."
s6-setuidgid postgres postgres