You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`MISTRAL_API_KEY`| secret | no | Mistral AI API key |
118
-
|`SHARED_STORAGE_BUCKET`| var | no | S3 bucket name |
119
-
|`SHARED_STORAGE_ENDPOINT`| var | no | S3 endpoint URL |
120
-
|`SHARED_STORAGE_ACCESS_KEY_ID`| secret | no | S3 access key |
121
-
|`SHARED_STORAGE_SECRET_ACCESS_KEY`| secret | no | S3 secret key |
122
-
|`SHARED_STORAGE_PUBLIC_URL`| var | no | S3 public URL |
123
-
|`EMAIL_PROVIDER`| var | no | Email provider (e.g. `scaleway`) |
124
-
|`EMAIL_FROM`| var | no | Sender email address |
125
-
|`SCW_SECRET_KEY`| secret | no | Scaleway secret key |
126
-
|`SCW_PROJECT_ID`| var | no | Scaleway project ID |
127
-
|`SCW_REGION`| var | no | Scaleway region |
128
-
129
-
In worker mode, the `DATABASE` binding provides direct database access. `POSTGATE_URL` and `POSTGATE_TOKEN` are only needed in Docker mode (see below).
109
+
Bindings (`DATABASE`, `ASSETS`) are set with `ow infra env bind` during the initial setup (see step 5 above). They connect the worker to its database and assets storage at runtime.
110
+
111
+
In worker mode, the `DATABASE` binding provides direct database access — no Postgate HTTP proxy needed. `POSTGATE_URL` and `POSTGATE_TOKEN` are only required in Docker mode, where there are no runtime bindings.
130
112
131
113
## Docker mode
132
114
@@ -144,14 +126,7 @@ bun start
144
126
145
127
The server listens on `PORT` (default `7000`).
146
128
147
-
In Docker mode, there is no `DATABASE` binding. Set these additional variables in `.env`:
All other environment variables from the table above also apply (without the bindings).
129
+
In Docker mode, `POSTGATE_URL` and `POSTGATE_TOKEN` must be set in `.env` to connect to the Postgate HTTP proxy. All other environment variables from the README also apply (without the bindings).
|`SHARED_STORAGE_PUBLIC_URL`| var | yes | S3 public URL |
151
+
|`EMAIL_PROVIDER`| var | no | Email provider (`scaleway`) |
152
+
|`EMAIL_FROM`| var | no | Sender email address |
153
+
|`SCW_SECRET_KEY`| secret | no | Scaleway secret key |
154
+
|`SCW_PROJECT_ID`| var | no | Scaleway project ID |
155
+
|`SCW_REGION`| var | no | Scaleway region |
156
+
157
+
### System tokens
158
+
159
+
When the API executes SQL on a user's database (via `/api/v1/databases/:id/exec`), it authenticates to Postgate using a **system token**. These tokens are deterministic — derived from `HMAC-SHA256(POSTGATE_SYSTEM_TOKEN_SECRET, "system_token:{databaseId}")` — so they don't need to be stored in plain text. Only the hash is persisted in the `database_tokens` table.
160
+
161
+
This means the API can regenerate the token on the fly for any database, as long as `POSTGATE_SYSTEM_TOKEN_SECRET` stays the same. If the secret changes, all system tokens become invalid and must be recreated.
162
+
163
+
### Shared storage
164
+
165
+
The `SHARED_STORAGE_*` variables configure the S3-compatible bucket used to store worker assets (uploaded scripts, static files). Without these, workers cannot be deployed. Any S3-compatible provider works (Cloudflare R2, AWS S3, MinIO, etc.).
166
+
167
+
`SHARED_STORAGE_PUBLIC_URL` is the public-facing URL used to serve assets to clients (e.g. `https://assets.example.com`).
168
+
169
+
### Email
170
+
171
+
The `EMAIL_*` and `SCW_*` variables are optional. When configured, the API can send transactional emails (e.g. invitations). Currently only Scaleway TEM is supported as a provider (`EMAIL_PROVIDER=scaleway`).
172
+
173
+
See [DEPLOY.md](./DEPLOY.md) for deployment instructions.
0 commit comments