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.
This commit is contained in:
@@ -180,7 +180,7 @@ Now you can trigger tasks against the staging environment by setting the `TRIGGE
|
||||
TRIGGER_SECRET_KEY="tr_stg_abcd123"
|
||||
```
|
||||
|
||||
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).
|
||||
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.
|
||||
|
||||
## Local builds
|
||||
|
||||
|
||||
@@ -153,6 +153,7 @@ In this example we use [Puppeteer](https://pptr.dev/) with a [BrowserBase](https
|
||||
<Warning>
|
||||
When web scraping, you MUST use the technique below which uses a proxy with Puppeteer. Direct
|
||||
scraping without using `browserWSEndpoint` is prohibited and will result in account suspension.
|
||||
Screenshots are also prohibited when scraping.
|
||||
</Warning>
|
||||
|
||||
### Task code
|
||||
|
||||
@@ -430,7 +430,9 @@ When you run `npx trigger.dev@latest dev`, we run your task code locally on your
|
||||
|
||||
## Staging and production environments
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
## OpenTelemetry
|
||||
|
||||
|
||||
@@ -184,6 +184,30 @@ docker compose down
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Creating additional worker groups
|
||||
|
||||
To create additional worker groups beyond the bootstrap group, use the admin API endpoint. This requires admin privileges.
|
||||
|
||||
**Making a user admin:**
|
||||
- **New users**: Set `ADMIN_EMAILS` environment variable (regex pattern) before user creation.
|
||||
- **Existing users**: Set `admin = true` in the `user` table in your database.
|
||||
|
||||
**Creating a worker group:**
|
||||
|
||||
```bash
|
||||
api_url=http://localhost:8030
|
||||
wg_name=my-worker
|
||||
admin_pat=tr_pat_...
|
||||
|
||||
curl -X POST \
|
||||
"$api_url/admin/api/v1/workers" \
|
||||
-H "Authorization: Bearer $admin_pat" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"name\": \"$wg_name\"}"
|
||||
```
|
||||
|
||||
The response includes a `token` field if the worker group is newly created.
|
||||
|
||||
## Registry setup
|
||||
|
||||
The registry is used to store and pull deployment images. When testing the stack locally, the defaults should work out of the box.
|
||||
|
||||
Vendored
+1
-1
@@ -142,5 +142,5 @@ mode: "wide"
|
||||
| `OPENAI_API_KEY` | No | — | OpenAI API key. |
|
||||
| `MACHINE_PRESETS_OVERRIDE_PATH` | No | — | Path to machine presets override file. See [machine overrides](/self-hosting/overview#machine-overrides). |
|
||||
| `APP_ENV` | No | `NODE_ENV` | App environment. Used for things like the title tag. |
|
||||
| `ADMIN_EMAILS` | No | — | Regex of user emails to automatically promote to admin. |
|
||||
| `ADMIN_EMAILS` | No | — | Regex of user emails to automatically promote to admin on signup. Does not apply to existing users. |
|
||||
| `EVENT_LOOP_MONITOR_ENABLED` | No | 1 | Node.js event loop lag monitor. |
|
||||
Reference in New Issue
Block a user