From 86872bc6483ca940764d5ed33e84f51e01d0521a Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Fri, 26 Feb 2021 11:10:27 -0500 Subject: [PATCH] standalone postgres --- extra/guacamole.yml | 27 +++++++++++++++++++++++---- scripts/subinstallers/gen_prod_env.sh | 11 ++++++++++- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/extra/guacamole.yml b/extra/guacamole.yml index 62efd14..dbacf4b 100644 --- a/extra/guacamole.yml +++ b/extra/guacamole.yml @@ -13,6 +13,26 @@ services: - ../../mistborn_volumes/extra/guacamole/drive:/drive:rw - ../../mistborn_volumes/extra/guacamole/record:/record:rw + + # postgres + guac_postgres: + container_name: mistborn_production_guac_postgres + env_file: + - ../.envs/.production/.guacamole + environment: + PGDATA: /var/lib/postgresql/data/guacamole + #POSTGRES_DB: guacamole_db + #POSTGRES_PASSWORD: ChooseYourOwnPasswordHere1234 + #POSTGRES_USER: guacamole_user + image: postgres + networks: + guacnetwork: + restart: unless-stopped + volumes: + - ../../mistborn_volumes/extra/guacamole/init:/docker-entrypoint-initdb.d:ro + - ../../mistborn_volumes/extra/guacamole/data:/var/lib/postgresql/data:rw + + # guacamole guacamole: container_name: mistborn_production_guacamole @@ -31,20 +51,19 @@ services: environment: GUACD_HOSTNAME: guacd GUACD_PORT: 4822 - POSTGRES_HOSTNAME: postgres #GUACAMOLE_HOME: /config env_file: - - ../.envs/.production/.postgres + - ../.envs/.production/.guacamole image: guacamole/guacamole links: - guacd networks: guacnetwork: - ports: + #ports: ## enable next line if not using nginx ## - 8080:8080/tcp # Guacamole is on :8080/guacamole, not /. ## enable next line when using nginx - - 8080/tcp + #- 8080/tcp restart: unless-stopped # networks diff --git a/scripts/subinstallers/gen_prod_env.sh b/scripts/subinstallers/gen_prod_env.sh index 0ed9c3b..818f64b 100755 --- a/scripts/subinstallers/gen_prod_env.sh +++ b/scripts/subinstallers/gen_prod_env.sh @@ -29,7 +29,6 @@ POSTGRES_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([s echo "POSTGRES_HOST=postgres" > $POSTGRES_PROD_FILE echo "POSTGRES_PORT=5432" >> $POSTGRES_PROD_FILE echo "POSTGRES_DB=mistborn" >> $POSTGRES_PROD_FILE -echo "POSTGRES_DATABASE=mistborn" >> $POSTGRES_PROD_FILE echo "POSTGRES_USER=prod" >> $POSTGRES_PROD_FILE echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> $POSTGRES_PROD_FILE @@ -79,3 +78,13 @@ sed -i "s/JVB_AUTH_PASSWORD.*/JVB_AUTH_PASSWORD=$(python3 -c "import secrets; im sed -i "s/JIGASI_XMPP_PASSWORD.*/JIGASI_XMPP_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE" sed -i "s/JIBRI_RECORDER_PASSWORD.*/JIBRI_RECORDER_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE" sed -i "s/JIBRI_XMPP_PASSWORD.*/JIBRI_XMPP_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")/" "$JITSI_PROD_FILE" + +# Guacamole +GUAC_PROD_FILE="./.envs/.production/.guacamole" +GUAC_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))") +echo "POSTGRES_HOST=guac_postgres" > $GUAC_PROD_FILE +echo "POSTGRES_PORT=5432" >> $GUAC_PROD_FILE +echo "POSTGRES_DB=guacamole_db" >> $GUAC_PROD_FILE +echo "POSTGRES_DATABASE=guacamole_db" >> $GUAC_PROD_FILE +echo "POSTGRES_USER=guac_user" >> $GUAC_PROD_FILE +echo "POSTGRES_PASSWORD=$GUAC_PASSWORD" >> $GUAC_PROD_FILE \ No newline at end of file