This commit is contained in:
2025-10-13 11:06:48 +02:00
parent 87564a61a4
commit 3eb75340a2
5 changed files with 40 additions and 13 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.env

View File

@@ -23,9 +23,9 @@ services:
# https://www.pgadmin.org/ # https://www.pgadmin.org/
pgadmin: pgadmin:
image: dpage/pgadmin4:${PGADMIN_VERSION:-8.11} image: dpage/pgadmin4:${PGADMIN_VERSION:-9.8}
depends_on: depends_on:
postgresql: database:
condition: service_healthy condition: service_healthy
restart: "no" restart: "no"
configs: configs:
@@ -108,6 +108,11 @@ services:
profiles: profiles:
- bi - bi
# ----------------------------------------------------------------------
# Documents
#
# ----------------------------------------------------------------------
# CouchDB # CouchDB
# Single-node document database # Single-node document database
# https://couchdb.apache.org/ # https://couchdb.apache.org/
@@ -120,6 +125,8 @@ services:
environment: environment:
COUCHDB_USER: ${DB_ROOT_USER:-admin} COUCHDB_USER: ${DB_ROOT_USER:-admin}
COUCHDB_PASSWORD: ${DB_ROOT_PASSWORD:-!ChangeMe!} COUCHDB_PASSWORD: ${DB_ROOT_PASSWORD:-!ChangeMe!}
profiles:
- documents
# MongoDB # MongoDB
# #
@@ -136,6 +143,8 @@ services:
environment: environment:
MONGODB_INITDB_ROOT_USERNAME: ${DB_ROOT_USER:-admin} MONGODB_INITDB_ROOT_USERNAME: ${DB_ROOT_USER:-admin}
MONGODB_INITDB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-!ChangeMe!} MONGODB_INITDB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-!ChangeMe!}
profiles:
- documents
# Redis # Redis
# In-memory key-value database # In-memory key-value database
@@ -171,6 +180,8 @@ services:
- neo4j_logs:/logs - neo4j_logs:/logs
environment: environment:
NEO4J_AUTH: neo4j/${DB_ROOT_PASSWORD:-!ChangeMe!} NEO4J_AUTH: neo4j/${DB_ROOT_PASSWORD:-!ChangeMe!}
profiles:
- graph
# PostGraphile # PostGraphile
# Instant GraphQL API # Instant GraphQL API
@@ -238,13 +249,10 @@ services:
ports: ports:
- 3005:3005 - 3005:3005
environment: environment:
PGRST_DB_URI: postgres://${POSTGREST_USER:-postgrest}:${DB_PASSWORD}@${POSTGREST_HOST:-database}:${POSTGREST_DB_PORT:-5432}/${COMPOSE_PROJECT_NAME} PGRST_DB_URI: postgres://${POSTGREST_USER:-postgrest}:9012@${POSTGREST_HOST:-database}:${POSTGREST_DB_PORT:-5432}/${COMPOSE_PROJECT_NAME}
PGRST_DB_SCHEMAS: ${POSTGREST_DB_SCHEMAS:-public} PGRST_DB_SCHEMAS: ${POSTGREST_DB_SCHEMAS:-public}
PGRST_DB_ANON_ROLE: ${POSTGREST_DB_ANON_ROLE:-role_web} PGRST_DB_ANON_ROLE: ${POSTGREST_DB_ANON_ROLE:-role_web}
PGRST_JWT_SECRET: ${POSTGREST_JWT_SECRET:-ABCDEFGHIJKLMNOPQRSTUVWXYZ} PGRST_JWT_SECRET: ${POSTGREST_JWT_SECRET:-ChangeMeChangeMeChangeMeChangeMe}
PGRST_DB_USE_LEGACY_GUCS: ${POSTGREST_DB_USE_LEGACY_GUCS:-false}
PGRST_APP_SETTINGS_JWT_SECRET: ${POSTGREST_APP_SETTINGS_JWT_SECRET}
PGRST_APP_SETTINGS_JWT_EXP: ${POSTGREST_APP_SETTINGS_JWT_EXP}
PGRST_ADMIN_SERVER_PORT: 3055 PGRST_ADMIN_SERVER_PORT: 3055
PGRST_SERVER_PORT: 3005 PGRST_SERVER_PORT: 3005
profiles: profiles:

View File

@@ -1,6 +1,23 @@
create role postgrest noinherit login password 'motdepasse'; create role postgrest nosuperuser nocreatedb nocreaterole noinherit noreplication nobypassrls
grant role_web to postgrest; login password '9012';
-- Postgraphile -- postgrest est le rôle utilisé par l'application pour se connecter à la base.
create role postgraphile inherit login password 'motdepasse'; -- Il doit être configuré pour avoir un accès très limité.
grant role_web to postgraphile; -- Il s'agit d'un caméléon dont la tâche est de « devenir » un autre utilisateur pour servir des requêtes HTTP authentifiées.
-- Roles sans login. Il faut se connecter d'abord avec l'utilisateur postgrest.
-- Puis celui-ci usurpe une des identités suivantes suivant le role présent dans le JWT.
-- Lorsqu'une demande contient un JWT valide avec une revendication de rôle,
-- PostgREST passera au rôle de base de données avec ce nom pendant la durée de la demande HTTP avec la commande :
-- SET LOCAL ROLE adherent;
create role anonyme nologin;
create role adherent nologin;
-- L'utilisateur postgrest peut se connecter en tant que ...
grant anonyme to postgrest;
grant adherent to postgrest;
grant usage on schema public to anonyme;
alter default privileges in schema public
grant select on tables to anonyme;

View File

@@ -0,0 +1 @@
create role postgraphile inherit login password 'motdepasse';

View File

@@ -6,7 +6,7 @@
"Host": "database", "Host": "database",
"Port": 5432, "Port": 5432,
"MaintenanceDB": "postgres", "MaintenanceDB": "postgres",
"Username": "postgres", "Username": "sql",
"UseSSHTunnel": 0, "UseSSHTunnel": 0,
"TunnelPort": "22", "TunnelPort": "22",
"TunnelAuthentication": 0, "TunnelAuthentication": 0,