build(dev): connect as non-superuser role so row-level security applies
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
e9c7394c8b
commit
c615c21af1
2 files changed
+12
-5
No files matched your search
+5
-5
@@ -4,13 +4,13 @@ services:
|
||||
timescaledb:
|
||||
image: timescale/timescaledb:2.30.1-pg16
|
||||
environment:
|
||||
POSTGRES_USER: uptime
|
||||
POSTGRES_PASSWORD: uptime
|
||||
POSTGRES_DB: uptime
|
||||
POSTGRES_PASSWORD: postgres
|
||||
ports: ["5432:5432"]
|
||||
volumes: [pgdata:/var/lib/postgresql/data]
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
- ./deploy/dev/postgres-init.sql:/docker-entrypoint-initdb.d/10-uptime.sql:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready", "-U", "uptime"]
|
||||
test: ["CMD", "pg_isready", "-U", "uptime", "-d", "uptime"]
|
||||
interval: 2s
|
||||
retries: 30
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
-- Superusers bypass row-level security even with FORCE, so the application
|
||||
-- must connect as an ordinary role for tenant isolation to be enforced.
|
||||
CREATE ROLE uptime LOGIN PASSWORD 'uptime';
|
||||
CREATE DATABASE uptime OWNER uptime;
|
||||
\connect uptime
|
||||
CREATE EXTENSION IF NOT EXISTS timescaledb;
|
||||
CREATE EXTENSION IF NOT EXISTS citext;
|
||||
Reference in new issue
Block a user