feat: enforce postgres tls and separate database roles
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
DATABASE_URL="$(cat /run/tls/database_url)"
|
||||
export DATABASE_URL
|
||||
npx prisma migrate deploy
|
||||
PGPASSWORD="$(node -p 'new URL(process.env.DATABASE_URL).password')"
|
||||
export PGPASSWORD
|
||||
psql -X -v ON_ERROR_STOP=1 \
|
||||
'host=postgres dbname=messenger user=migrate sslmode=verify-full sslrootcert=/run/tls/ca.crt' \
|
||||
-f /app/infra/postgres/grants.sql
|
||||
Reference in New Issue
Block a user