Remove Trino: Superset reads fuel-db directly as fuel_ro (PD-14)
trino/ deleted; the role trino_ro becomes fuel_ro, its password read from a secret file at connect time; dashboards' SQL and column list for PostgreSQL; the Compose project is renamed petrolyst, with volumes pinned to their old names. AGENTS.md points to the architecture context. Not deployed: the next deploy needs README's one-time steps first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
686318dfac
commit
8405706ed8
25 files changed
+453
-410
No files matched your search
@@ -5,21 +5,24 @@
|
||||
# Loaders log in as their own role but act as fuel_owner (README
|
||||
# "Data loaders"): the default privileges below cover only what
|
||||
# fuel_owner itself creates, not what its members create.
|
||||
# trino_ro what Trino connects as: read-only, also on tables created later.
|
||||
# fuel_ro what Superset and the Petrolyst server read as: SELECT on public,
|
||||
# also on tables created later. Read-only by default as well: a
|
||||
# second lock behind the grants.
|
||||
set -euo pipefail
|
||||
|
||||
trino_password=$(cat /run/secrets/fuel_db_trino_password)
|
||||
ro_password=$(cat /run/secrets/fuel_db_ro_password)
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \
|
||||
-v trino_password="$trino_password" <<'SQL'
|
||||
-v ro_password="$ro_password" <<'SQL'
|
||||
CREATE ROLE fuel_owner NOLOGIN;
|
||||
ALTER DATABASE fuel OWNER TO fuel_owner;
|
||||
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
|
||||
|
||||
CREATE ROLE trino_ro LOGIN PASSWORD :'trino_password';
|
||||
GRANT CONNECT ON DATABASE fuel TO trino_ro;
|
||||
GRANT USAGE ON SCHEMA public TO trino_ro;
|
||||
GRANT SELECT ON ALL TABLES IN SCHEMA public TO trino_ro;
|
||||
CREATE ROLE fuel_ro LOGIN PASSWORD :'ro_password';
|
||||
ALTER ROLE fuel_ro SET default_transaction_read_only = on;
|
||||
GRANT CONNECT ON DATABASE fuel TO fuel_ro;
|
||||
GRANT USAGE ON SCHEMA public TO fuel_ro;
|
||||
GRANT SELECT ON ALL TABLES IN SCHEMA public TO fuel_ro;
|
||||
ALTER DEFAULT PRIVILEGES FOR ROLE fuel_owner IN SCHEMA public
|
||||
GRANT SELECT ON TABLES TO trino_ro;
|
||||
GRANT SELECT ON TABLES TO fuel_ro;
|
||||
SQL
|
||||
Reference in new issue
Block a user