Browse Source
new: [odoo-tecnativa] add support of restricted postgres access
new: [odoo-tecnativa] add support of restricted postgres access
Valentin Lab
3 months ago
4 changed files with 102 additions and 1 deletions
-
54odoo-tecnativa/hooks/postgres_database-relation-joined
-
29odoo-tecnativa/lib/common
-
3odoo-tecnativa/metadata.yml
-
17odoo-tecnativa/resources/opt/odoo/common/entrypoint.d/20-postgres-wait
@ -0,0 +1,17 @@ |
|||||
|
#!/bin/bash |
||||
|
if [ "$WAIT_DB" != true ]; then |
||||
|
log INFO Not waiting for a postgres server |
||||
|
exit 0 |
||||
|
fi |
||||
|
|
||||
|
log INFO Waiting until postgres is listening at $PGHOST... |
||||
|
while true; do |
||||
|
if [ -n "$PGDATABASE" ]; then |
||||
|
echo "SELECT 1;" | psql "$PGDATABASE" |
||||
|
else |
||||
|
# Assumes that your access level to postgres includes the |
||||
|
# right to list databases |
||||
|
psql -l |
||||
|
fi > /dev/null 2>&1 && break |
||||
|
sleep 1 |
||||
|
done |
Write
Preview
Loading…
Cancel
Save
Reference in new issue