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
{{ message }}
Repository navigation
Commit a7ea2e7
Browse filesBrowse the repository at this point in the historyBrowse files
[](https://deploy.workers.cloudflare.com/?url=https://github.com/asselstine/factorize)
4
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/asselstine/factorize&path=packages/app)
5
5
6
6
**A no-code software factory for Linear teams.** Factorize turns selected Linear issue changes into coding-agent jobs on your own exe.dev VM, using Herdr to run the agent you choose.
7
7
@@ -21,29 +21,29 @@ Linear webhook → Cloudflare Worker → Durable Object → exe.dev /exec → He
21
21
22
22
## Deploy to Cloudflare
23
23
24
-
Click the **Deploy to Cloudflare** button above to create a copy of this Worker in your own Cloudflare account. Cloudflare provisions the Durable Object binding and configures Workers Builds for the copied repository.
24
+
Click the **Deploy to Cloudflare** button above to create a copy of the app Worker in your own Cloudflare account. The button selects `packages/app` as the Worker root; Cloudflare provisions the Durable Object binding and configures Workers Builds for the copied repository.
25
25
26
26
> The Deploy to Cloudflare button works for public GitHub or GitLab repositories. If you are using a private fork, deploy with Wrangler instead.
27
27
28
28
### Deploy with Wrangler
29
29
30
30
1. Clone the repository and install dependencies.
31
-
2. Set `APP_ORIGIN` in `wrangler.jsonc` to your final HTTPS Worker URL or custom domain.
32
-
3. Create a dedicated OAuth KV namespace with `npx wrangler kv namespace create OAUTH_KV`, then replace `REPLACE_WITH_OAUTH_KV_ID`in `wrangler.jsonc` with its ID.
31
+
2. Set `APP_ORIGIN` in `packages/app/wrangler.jsonc` to your final HTTPS Worker URL or custom domain.
32
+
3. Create a dedicated OAuth KV namespace with `npm exec --workspace=factorize -- wrangler kv namespace create OAUTH_KV`, then set its ID in `packages/app/wrangler.jsonc`.
33
33
4. Configure the Linear OAuth callback as `https://your-domain.example/auth/linear/callback`.
34
34
5. Build assets, add secrets, and deploy:
35
35
36
36
```bash
37
37
npm ci
38
38
npm run build:css
39
39
40
-
npx wrangler secret put LINEAR_CLIENT_ID
41
-
npx wrangler secret put LINEAR_CLIENT_SECRET
42
-
npx wrangler secret put LINEAR_WEBHOOK_SIGNING_SECRET
43
-
npx wrangler secret put CREDENTIAL_ENCRYPTION_KEY
44
-
npx wrangler secret put SESSION_SIGNING_SECRET
40
+
npm exec --workspace=factorize -- wrangler secret put LINEAR_CLIENT_ID
41
+
npm exec --workspace=factorize -- wrangler secret put LINEAR_CLIENT_SECRET
42
+
npm exec --workspace=factorize -- wrangler secret put LINEAR_WEBHOOK_SIGNING_SECRET
43
+
npm exec --workspace=factorize -- wrangler secret put CREDENTIAL_ENCRYPTION_KEY
44
+
npm exec --workspace=factorize -- wrangler secret put SESSION_SIGNING_SECRET
45
45
46
-
npm run deploy
46
+
npm run deploy:app
47
47
```
48
48
49
49
For a headless machine, authenticate first with `npx wrangler login --device --browser=false`, then open the displayed URL and approve the device code from your browser.
@@ -61,7 +61,7 @@ For a headless machine, authenticate first with `npx wrangler login --device --b
@@ -109,7 +109,7 @@ Cloudflare Worker failures can also start flows through the separately deployabl
109
109
|`LINEAR_WEBHOOK_SIGNING_SECRET`| Verifies Linear webhook signatures |
110
110
|`CREDENTIAL_ENCRYPTION_KEY`| Base64-encoded 32-byte key for encrypted credentials |
111
111
|`SESSION_SIGNING_SECRET`| Independent secret for signed browser sessions |
112
-
|`APP_ORIGIN`| Public Worker origin, configured in `wrangler.jsonc`|
112
+
|`APP_ORIGIN`| Public Worker origin, configured in `packages/app/wrangler.jsonc`|
113
113
|`OAUTH_KV`| KV binding containing OAuth clients, grants, refresh tokens, and revocation state |
114
114
115
115
Never commit `.dev.vars` or production secret values. The included `.dev.vars.example` is a safe template.
@@ -119,12 +119,14 @@ Never commit `.dev.vars` or production secret values. The included `.dev.vars.ex
119
119
| Command | What it does |
120
120
| --- | --- |
121
121
|`npm run dev`| Build CSS and start local Wrangler development |
122
-
|`npm run build:css`| Compile Tailwind into `public/styles.css`|
122
+
|`npm run build:css`| Compile Tailwind into `packages/app/public/styles.css`|
123
123
|`npm test`| Run the unit test suite |
124
-
|`npm run check`| Type-check, test, and validate a Wrangler dry-run deploy |
125
-
|`npm run deploy`| Deploy the Worker with Wrangler |
124
+
|`npm run check`| Type-check/test the app and dry-run both Worker deployments |
125
+
|`npm run deploy:app`| Deploy only the `factorize` app Worker |
126
+
|`npm run deploy:tail-relay`| Deploy only the `factorize-tail-relay` Worker |
127
+
|`npm run deploy`| Deploy the app, then the Tail relay; stop on the first failure |
126
128
127
-
GitHub Actions runs `npm run check` on every push and pull request.
129
+
GitHub Actions installs the single root lockfile and runs `npm run check` on every push and pull request. The two packages are independently deployable Cloudflare Workers; the root scripts only provide a unified developer workflow.
Copy file name to clipboardExpand all lines: docs/cloudflare-tail.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Cloudflare Tail flow source
2
2
3
-
Cloudflare Tail is a Factorize flow source for native uncaught Worker exceptions and structured `console.error` failures. Tail Workers require a Workers Paid or Enterprise plan. The relay stays in the same Cloudflare account as the producer Workers; the Factorize flow may be in any account.
3
+
Cloudflare Tail is a Factorize flow source for native uncaught Worker exceptions and structured `console.error` failures. Tail Workers require a Workers Paid or Enterprise plan. The relay is a separate Cloudflare Worker and must be deployed in the same Cloudflare account as the producer Workers; the Factorize app Worker may be in any account.
4
4
5
5
## Configure the flow and relay
6
6
7
7
1. Create a flow, choose **Cloudflare Tail**, and save it. Copy the one-time relay destination and signing secret from the response/flow setup view.
8
-
2.In `factorize-tail-relay`, run `npm install`, set `FACTORIZE_TAIL_DESTINATION` as a Wrangler variable, and run `npx wrangler secret put FACTORIZE_TAIL_SECRET`.
9
-
3.Run `npm run deploy`. Keep the relay name `factorize-tail-relay`; Factorize excludes its own relay traces to prevent loops.
8
+
2.From the repository root, run `npm ci` and set `FACTORIZE_TAIL_DESTINATION` as a Wrangler variable in `packages/tail-relay/wrangler.jsonc`.
9
+
3.Authenticate Wrangler to the producer Workers' Cloudflare account, then run `npm exec --workspace=factorize-tail-relay -- wrangler secret put FACTORIZE_TAIL_SECRET` and `npm run deploy:tail-relay`. Keep the relay name `factorize-tail-relay`; Factorize excludes its own relay traces to prevent loops.
10
10
4. Add the relay to every producer Worker. One relay can consume multiple producers and forwards each event with its `scriptName`:
0 commit comments