Skip to content

Commit

Permalink
Merge pull request #1312 from jemrobinson/1311-fix-guacamole-dashboard
Browse files Browse the repository at this point in the history
Fix Guacamole database
  • Loading branch information
jemrobinson authored Oct 6, 2022
2 parents 9c5da28 + 975ce4e commit 19ec094
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ write_files:
content: |
{{guacamole_synchronise_database.sh}}
- path: "/opt/postgresql/scripts/db_permissions.sql"
permissions: "0444"
content: |
{{guacamole_db_permissions.sql}}
- path: "/opt/postgresql/scripts/db_update.sql"
permissions: "0444"
content: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ write_files:
permissions: "0644"
content: |
# Run user synchronisation every 10 minutes
*/10 * * * * postgres pg_ldap_sync -c /etc/postgresql/12/main/pg-ldap-sync.yaml -vv
*/10 * * * * postgres /usr/local/bin/pg_ldap_sync -vvv -c /etc/postgresql/12/main/pg-ldap-sync.yaml 2>&1 | logger -t SafeHaven
- path: "/etc/cron.d/runonce"
permissions: "0644"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SELECT
guacamole_connection.connection_name,
guacamole_entity.name
FROM
guacamole_connection_permission
JOIN guacamole_connection ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id
JOIN guacamole_user_group ON guacamole_user_group.entity_id = guacamole_connection_permission.entity_id
JOIN guacamole_user_group_member ON guacamole_user_group_member.user_group_id = guacamole_user_group.user_group_id
JOIN guacamole_entity ON guacamole_entity.entity_id = guacamole_user_group_member.member_entity_id
WHERE
connection_name LIKE 'Desktop:%'
AND permission = 'READ';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash
echo "Running LDAP synchronisation..." | tee >(logger -t SafeHaven)
pg_ldap_sync -c /opt/pg-ldap-sync/configuration.yaml -vv | logger -t SafeHaven
/usr/local/bin/pg_ldap_sync -vvv -c /opt/pg-ldap-sync/configuration.yaml 2>&1 | logger -t SafeHaven
echo "Updating database..." | tee >(logger -t SafeHaven)
su guacamoledaemon -c "docker-compose -f /opt/guacamole/docker-compose.yaml exec -T postgres psql -U guacamole -f /scripts/db_update.sql" | logger -t SafeHaven
echo "Finished database synchronisation" | tee >(logger -t SafeHaven)

0 comments on commit 19ec094

Please sign in to comment.