feat(cabana): mail preview and test send to yourself
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -196,7 +196,7 @@ http:
|
||||
supports_credentials: true
|
||||
```
|
||||
|
||||
The `serve` command also opens the database through [lagoon](../lagoon/README.md) and the uploads bucket through `attach.OpenBucket`, so their settings must be present as well. It then installs [cooler](../cooler/README.md) (`cooler.Install`) before it builds the router: with `http.rate_limit.store: redis` it publishes cooler's Redis-backed store as the `surf.Store`, falling back to a per-instance `surf.MemoryStore` while Redis does not answer. A Redis that is down at start-up is a warning, not a boot failure; a missing or malformed `redis.url` is. It starts the background job worker of [conga](../conga/README.md) in the same process unless `queue.work_in_serve` is `false` (default `true`); set it to `false` when a separate `queue:work` process runs the jobs. The other `queue.*` keys are documented in the conga README.
|
||||
The `serve` command also opens the database through [lagoon](../lagoon/README.md) and the uploads bucket through `attach.OpenBucket`, so their settings must be present as well. It then installs [cooler](../cooler/README.md) (`cooler.Install`) before it builds the router: with `http.rate_limit.store: redis` it publishes cooler's Redis-backed store as the `surf.Store` and as `cooler.Attempter` (for fixed-window admission outside `throttle`, such as the admin mail test-send limit), falling back to a per-instance `surf.MemoryStore` while Redis does not answer. A Redis that is down at start-up is a warning, not a boot failure; a missing or malformed `redis.url` is. It starts the background job worker of [conga](../conga/README.md) in the same process unless `queue.work_in_serve` is `false` (default `true`); set it to `false` when a separate `queue:work` process runs the jobs. The other `queue.*` keys are documented in the conga README.
|
||||
|
||||
## CLI commands
|
||||
|
||||
|
||||
@@ -234,7 +234,14 @@ func installCooler(ctx context.Context, app *backpack.App) (*cooler.Handle, erro
|
||||
}
|
||||
if h.RateLimitRedis() {
|
||||
// longest bucket decay is 1 minute; sweep at 2x (as BuildRouter)
|
||||
if err := app.Publish[Store](h.RateLimitStore(NewMemoryStore(2 * time.Minute))); err != nil {
|
||||
store := h.RateLimitStore(NewMemoryStore(2 * time.Minute))
|
||||
if err := app.Publish[Store](store); err != nil {
|
||||
_ = h.Close()
|
||||
return nil, fmt.Errorf("surf: %w", err)
|
||||
}
|
||||
// cabana looks this up for the mail test-send limit (and any other
|
||||
// fixed-window admission outside BuildRouter's throttle middleware).
|
||||
if err := app.Publish[cooler.Attempter](store); err != nil {
|
||||
_ = h.Close()
|
||||
return nil, fmt.Errorf("surf: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user