Skip to content

Commit 55905e3

Browse files
committed
Polish DEPLOY.md: fix missing vars and clarify infra vs space
- Add POSTGATE_SYSTEM_TOKEN_SECRET, ASSETS binding to env table - Fix variable types (GITHUB_CLIENT_ID as var, not secret) - Separate Docker-mode vars (POSTGATE_URL/TOKEN) into own table - Clarify infra (direct DB) vs space (via API) distinction - Promote env vars section to top level
1 parent 8c20e30 commit 55905e3

1 file changed

Lines changed: 38 additions & 29 deletions

File tree

DEPLOY.md

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Infrastructure setup (from scratch)
44

5-
All infrastructure operations use the CLI with a **DB alias** (direct PostgreSQL access).
5+
All `ow infra` commands use a **DB alias** with direct PostgreSQL access. This is the only way to bootstrap the platform.
66

77
### 1. Configure CLI alias
88

@@ -53,11 +53,11 @@ ow infra env bind openworkers-api-env DATABASE openworkers-api --type database
5353
ow infra storage create openworkers-api-storage
5454
ow infra env bind openworkers-api-env ASSETS openworkers-api-storage --type assets
5555

56-
# Set variables and secrets
56+
# Set variables and secrets (see environment variables table below)
5757
ow infra env set openworkers-api-env APP_URL https://dash.example.com
58+
ow infra env set openworkers-api-env POSTGATE_SYSTEM_TOKEN_SECRET --secret
5859
ow infra env set openworkers-api-env JWT_ACCESS_SECRET --secret
5960
ow infra env set openworkers-api-env JWT_REFRESH_SECRET --secret
60-
# ... (see environment variables table below)
6161

6262
# Build and upload
6363
cd openworkers-api
@@ -81,18 +81,18 @@ ow infra worker upload openworkers-dash ./dist/openworkers
8181

8282
## Worker mode (subsequent deploys)
8383

84-
Build then upload as a worker:
84+
Once the platform is running, use a **space alias** (goes through the API) for subsequent deploys:
8585

8686
```bash
8787
bun run build
8888
ow <space> worker upload openworkers-api ./build
8989
```
9090

91-
Where `<space>` is the target namespace (`dev`, `infra`, `main`, `ps`, ...).
91+
Where `<space>` is the target space (`dev`, `main`, `ps`, ...).
9292

9393
Create the environment **before** the first upload so the project inherits it automatically. If the worker was already uploaded without an environment, `worker link` will cascade it to the project and all function workers.
9494

95-
### Environment variables
95+
## Environment variables
9696

9797
Secrets are prompted interactively (masked input) when value is omitted:
9898

@@ -104,28 +104,30 @@ ow <space> env set openworkers-api-env APP_URL https://dash.example.com
104104
ow <space> env set openworkers-api-env JWT_ACCESS_SECRET --secret
105105
```
106106

107-
| Variable | Type | Required | Description |
108-
| ---------------------------------- | ------- | -------- | -------------------------------------- |
109-
| `DATABASE` | binding | yes | Database binding (type: database) |
110-
| `APP_URL` | var | yes | Dashboard URL (for OAuth redirects) |
111-
| `JWT_ACCESS_SECRET` | secret | yes | JWT signing secret (>= 32 chars) |
112-
| `JWT_REFRESH_SECRET` | secret | yes | JWT refresh token secret (>= 32 chars) |
113-
| `GITHUB_CLIENT_ID` | secret | no | GitHub OAuth app client ID |
114-
| `GITHUB_CLIENT_SECRET` | secret | no | GitHub OAuth app client secret |
115-
| `MISTRAL_API_KEY` | secret | no | Mistral AI API key |
116-
| `ANTHROPIC_API_KEY` | secret | no | Anthropic API key |
117-
| `SHARED_STORAGE_BUCKET` | secret | no | S3 bucket name |
118-
| `SHARED_STORAGE_ENDPOINT` | secret | no | S3 endpoint URL |
119-
| `SHARED_STORAGE_ACCESS_KEY_ID` | secret | no | S3 access key |
120-
| `SHARED_STORAGE_SECRET_ACCESS_KEY` | secret | no | S3 secret key |
121-
| `SHARED_STORAGE_PUBLIC_URL` | var | no | S3 public URL |
122-
| `EMAIL_PROVIDER` | var | no | Email provider (e.g. `scaleway`) |
123-
| `EMAIL_FROM` | var | no | Sender email address |
124-
| `SCW_SECRET_KEY` | secret | no | Scaleway secret key |
125-
| `SCW_PROJECT_ID` | secret | no | Scaleway project ID |
126-
| `SCW_REGION` | var | no | Scaleway region |
127-
128-
Note: `POSTGATE_URL` and `POSTGATE_TOKEN` are only needed when running outside OpenWorkers (Docker mode). In worker mode, the `DATABASE` binding provides direct database access.
107+
| Variable | Type | Required | Description |
108+
| ---------------------------------- | ------- | -------- | ---------------------------------------- |
109+
| `DATABASE` | binding | yes | Database binding (type: database) |
110+
| `ASSETS` | binding | yes | Assets storage binding (SvelteKit files) |
111+
| `APP_URL` | var | yes | Dashboard URL (for OAuth redirects) |
112+
| `POSTGATE_SYSTEM_TOKEN_SECRET` | secret | yes | System token HMAC secret (>= 32 chars) |
113+
| `JWT_ACCESS_SECRET` | secret | yes | JWT signing secret (>= 32 chars) |
114+
| `JWT_REFRESH_SECRET` | secret | yes | JWT refresh token secret (>= 32 chars) |
115+
| `GITHUB_CLIENT_ID` | var | no | GitHub OAuth app client ID |
116+
| `GITHUB_CLIENT_SECRET` | secret | no | GitHub OAuth app client secret |
117+
| `MISTRAL_API_KEY` | secret | no | Mistral AI API key |
118+
| `ANTHROPIC_API_KEY` | secret | no | Anthropic API key |
119+
| `SHARED_STORAGE_BUCKET` | var | no | S3 bucket name |
120+
| `SHARED_STORAGE_ENDPOINT` | var | no | S3 endpoint URL |
121+
| `SHARED_STORAGE_ACCESS_KEY_ID` | secret | no | S3 access key |
122+
| `SHARED_STORAGE_SECRET_ACCESS_KEY` | secret | no | S3 secret key |
123+
| `SHARED_STORAGE_PUBLIC_URL` | var | no | S3 public URL |
124+
| `EMAIL_PROVIDER` | var | no | Email provider (e.g. `scaleway`) |
125+
| `EMAIL_FROM` | var | no | Sender email address |
126+
| `SCW_SECRET_KEY` | secret | no | Scaleway secret key |
127+
| `SCW_PROJECT_ID` | var | no | Scaleway project ID |
128+
| `SCW_REGION` | var | no | Scaleway region |
129+
130+
In worker mode, the `DATABASE` binding provides direct database access. `POSTGATE_URL` and `POSTGATE_TOKEN` are only needed in Docker mode (see below).
129131

130132
## Docker mode
131133

@@ -143,7 +145,14 @@ bun start
143145

144146
The server listens on `PORT` (default `7000`).
145147

146-
In Docker mode, set `POSTGATE_URL` and `POSTGATE_TOKEN` in `.env` instead of the `DB` binding.
148+
In Docker mode, there is no `DATABASE` binding. Set these additional variables in `.env`:
149+
150+
| Variable | Required | Description |
151+
| ---------------- | -------- | -------------------------------- |
152+
| `POSTGATE_URL` | yes | Postgate HTTP proxy URL |
153+
| `POSTGATE_TOKEN` | yes | Postgate token (`pg_xxx` format) |
154+
155+
All other environment variables from the table above also apply (without the bindings).
147156

148157
## Managing projects
149158

0 commit comments

Comments
 (0)