Skip to content

Commit a3f1eb2

Browse files
authored
chore(docs): Admin requirements for creating worker groups (#2925)
Adds documentation for creating additional worker groups via the admin API endpoint, including how to make users admin (new vs existing users), and clarifies that ADMIN_EMAILS only applies on signup.
1 parent ab4b50b commit a3f1eb2

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

docs/deployment/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Now you can trigger tasks against the staging environment by setting the `TRIGGE
180180
TRIGGER_SECRET_KEY="tr_stg_abcd123"
181181
```
182182

183-
Currently, we only support two environments: `prod` and `staging`. Multiple environments are on our roadmap which you can track [here](https://feedback.trigger.dev/p/more-environments).
183+
For additional environments beyond `prod` and `staging`, you can use [preview branches](/deployment/preview-branches), which allow you to create isolated environments for each branch of your code.
184184

185185
## Local builds
186186

docs/guides/examples/puppeteer.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ In this example we use [Puppeteer](https://pptr.dev/) with a [BrowserBase](https
153153
<Warning>
154154
When web scraping, you MUST use the technique below which uses a proxy with Puppeteer. Direct
155155
scraping without using `browserWSEndpoint` is prohibited and will result in account suspension.
156+
Screenshots are also prohibited when scraping.
156157
</Warning>
157158

158159
### Task code

docs/how-it-works.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ When you run `npx trigger.dev@latest dev`, we run your task code locally on your
430430

431431
## Staging and production environments
432432

433-
Trigger.dev supports deploying to multiple "deployed" environments, such as staging and production. This allows you to test your tasks in a staging environment before deploying them to production. You can deploy to a new environment by running `npx trigger.dev@latest deploy --env <env>`, where `<env>` is the name of the environment you want to deploy to. Each environment has its own API Key, which you can use to trigger tasks in that environment.
433+
Trigger.dev supports deploying to `prod` and `staging` environments. This allows you to test your tasks in a staging environment before deploying them to production. You can deploy to a different environment by running `npx trigger.dev@latest deploy --env <env>`, where `<env>` is either `prod` or `staging`. Each environment has its own API Key, which you can use to trigger tasks in that environment.
434+
435+
For additional isolated environments, you can use [preview branches](/deployment/preview-branches), which allow you to create separate environments for each branch of your code.
434436

435437
## OpenTelemetry
436438

docs/self-hosting/docker.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,30 @@ docker compose down
184184
docker compose up -d
185185
```
186186
187+
### Creating additional worker groups
188+
189+
To create additional worker groups beyond the bootstrap group, use the admin API endpoint. This requires admin privileges.
190+
191+
**Making a user admin:**
192+
- **New users**: Set `ADMIN_EMAILS` environment variable (regex pattern) before user creation.
193+
- **Existing users**: Set `admin = true` in the `user` table in your database.
194+
195+
**Creating a worker group:**
196+
197+
```bash
198+
api_url=http://localhost:8030
199+
wg_name=my-worker
200+
admin_pat=tr_pat_...
201+
202+
curl -X POST \
203+
"$api_url/admin/api/v1/workers" \
204+
-H "Authorization: Bearer $admin_pat" \
205+
-H "Content-Type: application/json" \
206+
-d "{\"name\": \"$wg_name\"}"
207+
```
208+
209+
The response includes a `token` field if the worker group is newly created.
210+
187211
## Registry setup
188212
189213
The registry is used to store and pull deployment images. When testing the stack locally, the defaults should work out of the box.

docs/self-hosting/env/webapp.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,5 @@ mode: "wide"
142142
| `OPENAI_API_KEY` | No || OpenAI API key. |
143143
| `MACHINE_PRESETS_OVERRIDE_PATH` | No || Path to machine presets override file. See [machine overrides](/self-hosting/overview#machine-overrides). |
144144
| `APP_ENV` | No | `NODE_ENV` | App environment. Used for things like the title tag. |
145-
| `ADMIN_EMAILS` | No || Regex of user emails to automatically promote to admin. |
145+
| `ADMIN_EMAILS` | No || Regex of user emails to automatically promote to admin on signup. Does not apply to existing users. |
146146
| `EVENT_LOOP_MONITOR_ENABLED` | No | 1 | Node.js event loop lag monitor. |

0 commit comments

Comments
 (0)