[kimi-task] [feat] Add CORS config for Matrix frontend origin #679

Closed
opened 2026-03-21 03:12:11 +00:00 by kimi · 1 comment
Collaborator

Epic: Matrix Unification

Task

Update the CORS middleware configuration to allow requests from the Matrix frontend.
The Matrix runs on a different origin (Replit) and needs to call Dashboard APIs.

Files

  • src/dashboard/app.py — update CORSMiddleware allowed_origins
  • src/config.py — add matrix_frontend_url setting with default

Acceptance Criteria

  • New config setting: matrix_frontend_url (default: empty, meaning disabled)
  • When set, adds that origin to CORS allowed_origins
  • Also allows Tailscale IPs (100.x.x.x pattern) by default for dev
  • Existing CORS behavior unchanged when matrix_frontend_url is empty
  • tox -e unit passes
  • tox -e lint passes

Context

The Matrix frontend at 100.124.176.28:8080 (Tailnet) will call Dashboard APIs.
Also alexanderwhitestone.com when deployed as the public frontend.

## Epic: Matrix Unification ## Task Update the CORS middleware configuration to allow requests from the Matrix frontend. The Matrix runs on a different origin (Replit) and needs to call Dashboard APIs. ## Files - src/dashboard/app.py — update CORSMiddleware allowed_origins - src/config.py — add matrix_frontend_url setting with default ## Acceptance Criteria - [ ] New config setting: matrix_frontend_url (default: empty, meaning disabled) - [ ] When set, adds that origin to CORS allowed_origins - [ ] Also allows Tailscale IPs (100.x.x.x pattern) by default for dev - [ ] Existing CORS behavior unchanged when matrix_frontend_url is empty - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context The Matrix frontend at 100.124.176.28:8080 (Tailnet) will call Dashboard APIs. Also alexanderwhitestone.com when deployed as the public frontend.
kimi self-assigned this 2026-03-21 03:12:11 +00:00
Author
Collaborator

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/741

Summary

Implemented CORS configuration for Matrix frontend origin:

  1. src/config.py: Added matrix_frontend_url setting (default: empty/disabled)
  2. src/dashboard/app.py: Updated _get_cors_origins() to include Matrix frontend URL when set
  3. src/dashboard/app.py: Added allow_origin_regex for Tailscale IPs (100.x.x.x pattern)

Usage

Set MATRIX_FRONTEND_URL environment variable or add to .env:

MATRIX_FRONTEND_URL=http://100.124.176.28:8080

Or for the public frontend:

MATRIX_FRONTEND_URL=https://alexanderwhitestone.com

Tailscale IPs (100.x.x.x) are automatically allowed via regex pattern.

All tests pass: tox -e unit (2535 passed), tox -e lint (clean)

PR created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/741 ## Summary Implemented CORS configuration for Matrix frontend origin: 1. **src/config.py**: Added `matrix_frontend_url` setting (default: empty/disabled) 2. **src/dashboard/app.py**: Updated `_get_cors_origins()` to include Matrix frontend URL when set 3. **src/dashboard/app.py**: Added `allow_origin_regex` for Tailscale IPs (100.x.x.x pattern) ## Usage Set `MATRIX_FRONTEND_URL` environment variable or add to `.env`: ``` MATRIX_FRONTEND_URL=http://100.124.176.28:8080 ``` Or for the public frontend: ``` MATRIX_FRONTEND_URL=https://alexanderwhitestone.com ``` Tailscale IPs (100.x.x.x) are automatically allowed via regex pattern. All tests pass: `tox -e unit` (2535 passed), `tox -e lint` (clean)
kimi closed this issue 2026-03-21 14:56:43 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#679