Skip to content

Commit 0c5e9db

Browse files
pull[bot]github-actions[bot]
authored andcommitted
feat: update mgmt api docs
1 parent 05e0667 commit 0c5e9db

File tree

4 files changed

+103
-34
lines changed

4 files changed

+103
-34
lines changed

apps/docs/CONTRIBUTING.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,19 @@ Keep code lines short to avoid scrolling. For example, you can split long shell
197197

198198
Optionally specify a filename for the codeblock by including it after the opening backticks and language specifier:
199199

200-
```md
200+
````md
201201
```ts environment.ts
202+
202203
```
204+
````
203205

204206
Optionally highlight lines by using `mark=${lineNumber}`.
205207

206-
```md
208+
````md
207209
```js mark=12:13
210+
208211
```
212+
````
209213

210214
### Footnotes
211215

@@ -243,7 +247,7 @@ Don't nest lists more than two deep.
243247
3. List item
244248
- List item
245249
- List item
246-
<!-- DON'T ADD ANOTHER LEVEL OF NESTING -->
250+
<!-- DON'T ADD ANOTHER LEVEL OF NESTING -->
247251
- Overly nested list item
248252
```
249253

apps/docs/content/guides/self-hosting/docker.mdx

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
title: "Self-Hosting with Docker"
3-
description: "Learn how to configure and deploy Supabase with Docker."
4-
subtitle: "Learn how to configure and deploy Supabase with Docker."
5-
tocVideo: "FqiQKRKsfZE"
2+
title: 'Self-Hosting with Docker'
3+
description: 'Learn how to configure and deploy Supabase with Docker.'
4+
subtitle: 'Learn how to configure and deploy Supabase with Docker.'
5+
tocVideo: 'FqiQKRKsfZE'
66
---
77

88
Docker is the easiest way to get started with self-hosted Supabase. It should only take you a few minutes to get up and running. This guide assumes you are running the command from the machine you intend to host from.
99

1010
## Contents
11+
1112
1. [Before you begin](#before-you-begin)
1213
2. [Installing and running Supabase](#installing-and-running-supabase)
1314
3. [Accessing your services](#accessing-supabase-studio)
@@ -142,12 +143,14 @@ The default tenant ID is `your-tenant-id`, and the default password is `your-sup
142143
By default, the database is not accessible from outside the local machine but the pooler is. You can [change this](#exposing-your-postgres-database) by updating the `docker-compose.yml` file.
143144

144145
## Updating your services
146+
145147
For security reasons, we "pin" the versions of each service in the docker-compose file (these versions are updated ~monthly). If you want to update any services immediately, you can do so by updating the version number in the docker compose file and then running `docker compose pull`. You can find all the latest docker images in the [Supabase Docker Hub](https://hub.docker.com/u/supabase).
146148

147149
You should update your services frequently to get the latest features and bug fixes and security patches. Note that you will need to restart the services to pick up the changes, which will result in some downtime for your services.
148150

149151
**Example**
150152
You'll want to update the Studio(Dashboard) frequently to get the latest features and bug fixes. To update the Dashboard:
153+
151154
1. Visit the [supabase/studio](https://hub.docker.com/r/supabase/studio/tags) image in the [Supabase Docker Hub](https://hub.docker.com/u/supabase)
152155
2. Find the latest version (tag) number. It will look something like `20241029-46e1e40`
153156
3. Update the `image` field in the `docker-compose.yml` file to the new version. It should look like this: `image: supabase/studio:20241028-a265374`
@@ -158,6 +161,7 @@ You'll want to update the Studio(Dashboard) frequently to get the latest feature
158161
While we provided you with some example secrets for getting started, you should NEVER deploy your Supabase setup using the defaults we have provided. Please follow all of the steps in this section to ensure you have a secure setup, and then [restart all services](#restarting-all-services) to pick up the changes.
159162

160163
### Generate API keys
164+
161165
We need to generate secure keys for accessing your services. We'll use the `JWT Secret` to generate `anon` and `service` API keys using the form below.
162166

163167
1. **Obtain a Secret**: Use the 40-character secret provided, or create your own. If creating, ensure it's a strong, random string of 40 characters.
@@ -170,8 +174,8 @@ We need to generate secure keys for accessing your services. We'll use the `JWT
170174

171175
Run this form twice to generate new `anon` and `service` API keys. Replace the values in the `./docker/.env` file:
172176

173-
- `ANON_KEY` - replace with an `anon` key
174-
- `SERVICE_ROLE_KEY` - replace with a `service` key
177+
- `ANON_KEY` - replace with an `anon` key
178+
- `SERVICE_ROLE_KEY` - replace with a `service` key
175179

176180
You will need to [restart](#restarting-all-services) the services for the changes to take effect.
177181

@@ -191,19 +195,20 @@ You will need to [restart](#restarting-all-services) the services for the change
191195

192196
The Dashboard is protected with basic authentication. The default user and password MUST be updated before using Supabase in production.
193197
Update the following values in the `./docker/.env` file:
194-
- `DASHBOARD_USERNAME`: The default username for the Dashboard
195-
- `DASHBOARD_PASSWORD`: The default password for the Dashboard
198+
199+
- `DASHBOARD_USERNAME`: The default username for the Dashboard
200+
- `DASHBOARD_PASSWORD`: The default password for the Dashboard
196201

197202
You can also add more credentials for multiple users in `./docker/volumes/api/kong.yml`. For example:
198203

199204
```yaml docker/volumes/api/kong.yml
200205
basicauth_credentials:
201-
- consumer: DASHBOARD
202-
username: user_one
203-
password: password_one
204-
- consumer: DASHBOARD
205-
username: user_two
206-
password: password_two
206+
- consumer: DASHBOARD
207+
username: user_one
208+
password: password_one
209+
- consumer: DASHBOARD
210+
username: user_two
211+
password: password_two
207212
```
208213
209214
You will need to [restart](#restarting-all-services) the services for the changes to take effect.
@@ -297,23 +302,22 @@ Each system has a number of configuration options which can be found in the rele
297302
- [Kong](https://docs.konghq.com/gateway/latest/install/docker/)
298303
- [Supavisor](https://supabase.github.io/supavisor/development/docs/)
299304

300-
These configuration items are generally added to the `env` section of each service, inside the `docker-compose.yml` section. If these configuration items are sensitive, they should be stored in a [secret manager](/docs/guides/self-hosting#managing-your-secrets) or using an `.env` file and then referenced using the `${}` syntax.
301-
305+
These configuration items are generally added to the `env` section of each service, inside the `docker-compose.yml` section. If these configuration items are sensitive, they should be stored in a [secret manager](/docs/guides/self-hosting#managing-your-secrets) or using an `.env` file and then referenced using the `${}` syntax.
302306

303307
<CH.Code>
304308

305-
```yml docker-compose.yml
309+
```yml docker-compose.yml
306310
services:
307311
rest:
308312
image: postgrest/postgrest
309313
environment:
310314
PGRST_JWT_SECRET: ${JWT_SECRET}
311-
```
315+
```
312316
313-
```bash .env
314-
## Never check your secrets into version control
317+
```bash .env
318+
## Never check your secrets into version control
315319
`${JWT_SECRET}`
316-
```
320+
```
317321

318322
</CH.Code>
319323

@@ -341,11 +345,10 @@ We recommend using [AWS SES](https://aws.amazon.com/ses/). It's extremely cheap
341345
By default all files are stored locally on the server. You can configure the Storage service to use S3 by updating the following environment variables:
342346

343347
```yaml docker-compose.yml
344-
storage:
345-
environment:
346-
STORAGE_BACKEND=s3
347-
GLOBAL_S3_BUCKET=name-of-your-s3-bucket
348-
REGION=region-of-your-s3-bucket
348+
storage:
349+
environment: STORAGE_BACKEND=s3
350+
GLOBAL_S3_BUCKET=name-of-your-s3-bucket
351+
REGION=region-of-your-s3-bucket
349352
```
350353
351354
You can find all the available options in the [storage repository](https://github.com/supabase/storage-api/blob/master/.env.sample). Restart the `storage` service to pick up the changes: `docker compose restart storage --no-deps`
@@ -369,9 +372,9 @@ If you need direct access to the Postgres database without going through Supavis
369372
# supavisor:
370373
# ports:
371374
# ...
372-
db:
373-
ports:
374-
- ${POSTGRES_PORT}:${POSTGRES_PORT}
375+
db:
376+
ports:
377+
- ${POSTGRES_PORT}:${POSTGRES_PORT}
375378
```
376379

377380
This is less-secure, so please make sure you are running a firewall in front of your server.
@@ -394,7 +397,6 @@ All data in analytics will be deleted when you run the commands below.
394397

395398
</Admonition>
396399

397-
398400
```sh
399401
### Destroy analytics to transition to postgres self hosted solution without other data loss
400402
@@ -422,6 +424,7 @@ A minimal setup working on Ubuntu, hosted on DigitalOcean.
422424
</div>
423425

424426
### Demo using DigitalOcean
427+
425428
1. A DigitalOcean Droplet with 1 GB memory and 25 GB solid-state drive (SSD) is sufficient to start
426429
2. To access the Dashboard, use the ipv4 IP address of your Droplet.
427430
3. If you're unable to access Dashboard, run `docker compose ps` to see if the Studio service is running and healthy.

apps/docs/spec/api_v1_openapi.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,25 @@
336336
"operationId": "v1-list-all-snippets",
337337
"summary": "Lists SQL snippets for the logged in user",
338338
"parameters": [
339+
{ "name": "cursor", "required": false, "in": "query", "schema": { "type": "string" } },
340+
{
341+
"name": "limit",
342+
"required": false,
343+
"in": "query",
344+
"schema": { "type": "string", "minimum": 1, "maximum": 100 }
345+
},
346+
{
347+
"name": "sort_by",
348+
"required": false,
349+
"in": "query",
350+
"schema": { "enum": ["name", "inserted_at"], "type": "string" }
351+
},
352+
{
353+
"name": "sort_order",
354+
"required": false,
355+
"in": "query",
356+
"schema": { "enum": ["asc", "desc"], "type": "string" }
357+
},
339358
{
340359
"name": "project_ref",
341360
"required": false,
@@ -3062,7 +3081,8 @@
30623081
"SnippetList": {
30633082
"type": "object",
30643083
"properties": {
3065-
"data": { "type": "array", "items": { "$ref": "#/components/schemas/SnippetMeta" } }
3084+
"data": { "type": "array", "items": { "$ref": "#/components/schemas/SnippetMeta" } },
3085+
"cursor": { "type": "string" }
30663086
},
30673087
"required": ["data"]
30683088
},

apps/docs/spec/transforms/api_v1_openapi_deparsed.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,42 @@
990990
"operationId": "v1-list-all-snippets",
991991
"summary": "Lists SQL snippets for the logged in user",
992992
"parameters": [
993+
{
994+
"name": "cursor",
995+
"required": false,
996+
"in": "query",
997+
"schema": {
998+
"type": "string"
999+
}
1000+
},
1001+
{
1002+
"name": "limit",
1003+
"required": false,
1004+
"in": "query",
1005+
"schema": {
1006+
"type": "string",
1007+
"minimum": 1,
1008+
"maximum": 100
1009+
}
1010+
},
1011+
{
1012+
"name": "sort_by",
1013+
"required": false,
1014+
"in": "query",
1015+
"schema": {
1016+
"enum": ["name", "inserted_at"],
1017+
"type": "string"
1018+
}
1019+
},
1020+
{
1021+
"name": "sort_order",
1022+
"required": false,
1023+
"in": "query",
1024+
"schema": {
1025+
"enum": ["asc", "desc"],
1026+
"type": "string"
1027+
}
1028+
},
9931029
{
9941030
"name": "project_ref",
9951031
"required": false,
@@ -1087,6 +1123,9 @@
10871123
"updated_by"
10881124
]
10891125
}
1126+
},
1127+
"cursor": {
1128+
"type": "string"
10901129
}
10911130
},
10921131
"required": ["data"]
@@ -10798,6 +10837,9 @@
1079810837
"updated_by"
1079910838
]
1080010839
}
10840+
},
10841+
"cursor": {
10842+
"type": "string"
1080110843
}
1080210844
},
1080310845
"required": ["data"]

0 commit comments

Comments
 (0)