Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Updates the consumers with both an anon key and a service key

Paul Copplestone027e7f7b97bb
diff --git a/docker/README.md b/docker/README.md
index bf27ce6c14f..0c747bb20d2 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -13,7 +13,7 @@ You can run Supabase on your local machine using `docker-compose`:
import { createClient } from '@supabase/supabase-js'
const SUPABASE_URL = 'http://localhost:8000'
-const SUPABASE_KEY = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTYwMzk2ODgzNCwiZXhwIjoyNTUwNjUzNjM0LCJhdWQiOiIiLCJzdWIiOiIiLCJSb2xlIjoicG9zdGdyZXMifQ.magCcozTMKNrl76Tj2dsM7XTl_YH0v0ilajzAvIlw3U'
+const SUPABASE_KEY = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTYwMzk2ODgzNCwiZXhwIjoxNjIwNzQyMTM1LCJhdWQiOiIiLCJzdWIiOiIiLCJSb2xlIjoiYW5vbiIsImp0aSI6ImQ1N2ZkMjFlLTNkYjQtNDk3YS1hNGViLTI4ZDY3Yzg2NjEwMiJ9.Uc0w024BLhWjMAAdzMJfkMxaFa82N-6pBxAtEGzrXCQ'
const supabase = createClient(SUPABASE_URL, SUPABASE_KEY)
```
@@ -21,8 +21,8 @@ const supabase = createClient(SUPABASE_URL, SUPABASE_KEY)
Accessing the services directly:
- Kong: http://localhost:8000
- - GoTrue: http://localhost:8000/auth/v1/
- - PostgREST: http://localhost:8000/rest/v1/
- - Realtime: http://localhost:8000/realtime/v1/
+ - GoTrue: http://localhost:8000/auth/v1/?apikey=XXX
+ - PostgREST: http://localhost:8000/rest/v1/?apikey=XXX
+ - Realtime: http://localhost:8000/realtime/v1/?apikey=XXX
- Postgres: http://localhost:5432
diff --git a/docker/dockerfiles/kong/kong.yml b/docker/dockerfiles/kong/kong.yml
index 76302f5d43a..1adfb5c8c58 100644
--- a/docker/dockerfiles/kong/kong.yml
+++ b/docker/dockerfiles/kong/kong.yml
@@ -40,6 +40,9 @@ services:
config:
hide_credentials: true
consumers:
-- username: 'private-key'
+- username: 'anon-key'
keyauth_credentials:
- - key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTYwMzk2ODgzNCwiZXhwIjoyNTUwNjUzNjM0LCJhdWQiOiIiLCJzdWIiOiIiLCJSb2xlIjoicG9zdGdyZXMifQ.magCcozTMKNrl76Tj2dsM7XTl_YH0v0ilajzAvIlw3U
+ - key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTYwMzk2ODgzNCwiZXhwIjoxNjIwNzQyMTM1LCJhdWQiOiIiLCJzdWIiOiIiLCJSb2xlIjoiYW5vbiIsImp0aSI6ImQ1N2ZkMjFlLTNkYjQtNDk3YS1hNGViLTI4ZDY3Yzg2NjEwMiJ9.Uc0w024BLhWjMAAdzMJfkMxaFa82N-6pBxAtEGzrXCQ
+- username: 'service-key'
+ keyauth_credentials:
+ - key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTYwMzk2ODgzNCwiZXhwIjoxNjIwNzQyMTU1LCJhdWQiOiIiLCJzdWIiOiIiLCJSb2xlIjoic2VydmljZV9yb2xlIiwianRpIjoiOTk4MzJiYmItNDdhNS00NzJhLTgxMDQtYzY4ZGVjZDQyZDVlIn0.zQXx74dQyhpkcqZOMxsx961DPsDz4-nWxTLrCAd-ioI
diff --git a/web/docs/guides/self-hosting.mdx b/web/docs/guides/self-hosting.mdx
index 9498737ddfb..e590c84fa6a 100644
--- a/web/docs/guides/self-hosting.mdx
+++ b/web/docs/guides/self-hosting.mdx
@@ -82,20 +82,34 @@ docker-compose up
**Important**
-Make sure you update the default passwords and secrets before running in Production:
-
-- Postgres
- - [POSTGRES_PASSWORD](https://github.com/supabase/supabase/blob/3efd909fe86dd3540195b85054b611f3aa1d0de6/docker/docker-compose.yml#L80)
-- Realtime
- - [DB_PASSWORD](https://github.com/supabase/supabase/blob/3efd909fe86dd3540195b85054b611f3aa1d0de6/docker/docker-compose.yml#L60)
- - [JWT_SECRET](https://github.com/supabase/supabase/blob/3efd909fe86dd3540195b85054b611f3aa1d0de6/docker/docker-compose.yml#L66)
-- PostgREST
- - [PGRST_DB_URI](https://github.com/supabase/supabase/blob/3efd909fe86dd3540195b85054b611f3aa1d0de6/docker/docker-compose.yml#L44)
- - [PGRST_JWT_SECRET](https://github.com/supabase/supabase/blob/3efd909fe86dd3540195b85054b611f3aa1d0de6/docker/docker-compose.yml#L47)
-- GoTrue
- - [DATABASE_URL](https://github.com/supabase/supabase/blob/3efd909fe86dd3540195b85054b611f3aa1d0de6/docker/docker-compose.yml#L32)
- - [GOTRUE_OPERATOR_TOKEN](https://github.com/supabase/supabase/blob/3efd909fe86dd3540195b85054b611f3aa1d0de6/docker/docker-compose.yml#L31)
- - [GOTRUE_JWT_SECRET](https://github.com/supabase/supabase/blob/3efd909fe86dd3540195b85054b611f3aa1d0de6/docker/docker-compose.yml#L19)
+Make sure you update the default [passwords and secrets](https://github.com/supabase/supabase/blob/master/docker/.env)
+before running in Production.
+After you have regenerated the JWT secret, you will need to encode a new `anon` and `service_role` API key and update
+them [here](https://github.com/supabase/supabase/blob/9131e670f2679b9305a67f54c15bdab17b2cfd5a/docker/dockerfiles/kong/kong.yml#L42). For example, using [jsonwebtoken.io](https://www.jsonwebtoken.io/).
+
+The data you will need to encode includes:
+
+```bash
+# anon Payload:
+{
+ "iss": "supabase",
+ "iat": 1603968834,
+ "exp": 2550653634,
+ "aud": "",
+ "sub": "",
+ "Role": "anon"
+}
+# service_role Payload:
+{
+ "iss": "supabase",
+ "iat": 1603968834,
+ "exp": 2550653634,
+ "aud": "",
+ "sub": "",
+ "Role": "service_role"
+}
+```
+
## Configuring each service