File tree Expand file tree Collapse file tree 6 files changed +10
-25
lines changed Expand file tree Collapse file tree 6 files changed +10
-25
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ services:
10
10
- postgres_data:/var/lib/postgresql/data:rw
11
11
environment :
12
12
PGRST_AUTHENTICATOR_PASS : ${PGRST_AUTHENTICATOR_PASS:?} # Included for the migrations to use
13
- PGRST_JWT_SECRET : ${PGRST_JWT_SECRET:?} # Used in initial migration to set JWT secret in db
14
13
POSTGRES_DB : app
15
14
POSTGRES_PASSWORD : ${POSTGRES_PASSWORD:?}
16
15
POSTGRES_USER : ${POSTGRES_USER:?}
@@ -30,13 +29,8 @@ services:
30
29
postgres :
31
30
condition : service_healthy
32
31
environment :
33
- PGRST_APP_SETTINGS_JWT_EXP : 3600
34
- PGRST_APP_SETTINGS_JWT_SECRET : ${PGRST_JWT_SECRET:?}
35
32
PGRST_DB_ANON_ROLE : anon
36
- PGRST_DB_SCHEMAS : api
37
33
PGRST_DB_URI : postgres://authenticator:${PGRST_AUTHENTICATOR_PASS:?}@postgres:5432/app
38
- PGRST_JWT_SECRET : ${PGRST_JWT_SECRET:?}
39
- PGRST_OPENAPI_MODE : ignore-privileges
40
34
41
35
swagger-ui :
42
36
image : swaggerapi/swagger-ui:v5.20.1
Original file line number Diff line number Diff line change 1
1
# 🚀 Getting Started
2
2
3
+ <video controls width =" 100% " >
4
+ <source src =" /superstack/assets/getting-started.mp4 " type =" video/mp4 " >
5
+ Your browser does not support the video tag.
6
+ Music: https://www.bensound.com
7
+ License code: UZG5X7IWWLQOQEU1
8
+ Artist: : Lunar Years
9
+ </video >
10
+
3
11
SuperStack uses Docker, so make sure [ Docker is
4
12
installed] ( https://docs.docker.com/get-docker/ ) before you begin.
5
13
Original file line number Diff line number Diff line change 26
26
You can also run SQL directly from the command line:
27
27
28
28
```
29
- bin/postgres psql -c 'select * from api. movie;'
29
+ bin/postgres psql -c 'select * from movie;'
30
30
```
31
31
32
32
## ⚙️ Customize psql Behavior
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ PGUSER=admin # Used by psql
5
5
PGPASS = pass
6
6
7
7
# PostgREST
8
- PGRST_JWT_SECRET = your-ultra-secret-jwt-key-123456 # must be at least 32 chars
9
8
PGRST_AUTHENTICATOR_PASS = pass
10
9
11
10
# Caddy
Original file line number Diff line number Diff line change 1
1
-- Initial migrations to setup PostgREST
2
2
3
3
-- Set values here to reduce the chance of env vars being logged
4
- \set pgrst_jwt_secret ' $PGRST_JWT_SECRET'
5
4
\set pgrst_authenticator_pass ' $PGRST_AUTHENTICATOR_PASS'
6
5
7
- -- Set the JWT secret in the db - despite it being set in the PGRST_JWT_SECRET
8
- -- env var, this appears to be also required
9
- alter system set pgrst .jwt_secret = :' pgrst_jwt_secret' ;
10
-
11
6
begin ;
12
7
13
8
-- Create authenticator and anonymous roles. The authenticator role is used for
14
9
-- connecting to the database. Anon is for non-authenticated users.
15
10
create role authenticator noinherit login password :' pgrst_authenticator_pass' ;
16
11
create role anon;
17
- -- Allow the authenticator role to switch to anon.
18
- grant anon to authenticator;
19
-
20
- -- Create the default schema. I'd prefer to let the developer create schemas,
21
- -- but PostgREST won't start without at least one schema in PGRST_DB_SCHEMAS.
22
- create schema api ;
23
- comment on schema api is ' SuperStack API
24
-
25
- Main API schema for the SuperStack application. Contains all database
26
- functions, views, and tables exposed through PostgREST. Designed for use as a
27
- REST API interface, with endpoints documented via Swagger UI. This schema
28
- defines the public contract between the database and clients.' ;
12
+ grant anon to authenticator; -- Allow authenticator to switch to anon.
29
13
30
14
commit ;
You can’t perform that action at this time.
0 commit comments