mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
### Summary of Changes We need a way to tell if our email service is working. So, we set up a route that will be periodically hit by uptime kuma. This route tries to sign up to stack auth. Upon signing up, an verification email will be sent. We use resend to check the inbox and return a success if the email is found. We use resend to setup a test email domain, and we query that domain to see if the email has been received. In test environments/dev, we use inbucket instead. This route also requires a secret token, which can be configured via `.env` variables. ### Necessary config changes Note we add several new environment variables which will need to be populated in prod. Also, the [config settings for resend](https://resend.com/docs/send-with-smtp) are as follows: 1. **Host:** `smtp.resend.com` 2. **Port:** `465` 3. **Username:** `resend` 4. **Password:** `<RESEND_API_KEY>` These may need to be set up in docker to enable emails being sent out to resend. To set this up with uptime kuma, follow the steps below: 1. Create a new monitor 2. Set the monitor type to `HTTP(s)` 3. The URL should hit the `/health/email` endpoint. 4. Suggested request timeout is at least 120 seconds. Reading emails from the resend inbox can take a bit of time. 5. In headers, set the header as below: ``` { "authorization": "Bearer <STACK_EMAIL_MONITOR_SECRET_TOKEN>" } ``` |
||
|---|---|---|
| .. | ||
| prisma | ||
| scripts | ||
| src | ||
| .env | ||
| .env.development | ||
| .eslintrc.cjs | ||
| .gitignore | ||
| instrumentation-client.ts | ||
| LICENSE | ||
| next.config.mjs | ||
| package.json | ||
| prisma.config.ts | ||
| tsconfig.json | ||
| vercel.json | ||
| vitest.config.ts | ||
| vitest.setup.ts | ||