Author SHA1 Message Date
kiskaadee b528c7be1a fix(deps): bump certifi to 2026.10.23 (CVE-2026-115557)
Remediate compromised eMudhra/emSign intermediate CA private keys
by bumping certifi to 2026.10.23
2026-10-26 20:31:48 -05:00
5 changed files with 42 additions and 270 deletions

No files matched your search

+18 -171
View File
@@ -1,186 +1,33 @@
# bdinvite
Interactive digital birthday invitation with real-time RSVP management, dynamic OpenStreetMap location previews, and an administrative dashboard.
Interactive digital birthday invitation with RSVP.
## Overview
**bdinvite** is a production self-hosted web application delivering two coordinated experiences:
A mobile-first invitation app with animated golden bokeh particles, an RSVP form with semantic state feedback, a live countdown timer, and an admin dashboard for managing responses and invitation content.
1. **Guest Experience (`/birthday/`)**:
- Mobile-first vertical composition mimicking a physical luxury invitation card.
- Ambient golden bokeh particle canvas (Canvas 2D) with accessibility support (`prefers-reduced-motion`).
- Phone-normalized RSVP submission flow with explicit semantic state feedback (`SUCCESS`, `DUPLICATE`, `ERROR`).
- Timezone-aware countdown timer (`NOS VEMOS EN DD:HH:MM:SS`).
- Dynamic OpenStreetMap venue preview tile crop with direct Google Maps navigation links.
- **Guest**: `demos.roadtotech.me/birthday/`
- **Admin**: `demos.roadtotech.me/birthday/admin` (Authelia-protected)
2. **Admin Experience (`/birthday/admin`)**:
- Reverse-proxy authentication boundary via Authelia ForwardAuth (`Remote-User`).
- Live RSVP roster with search filtering, inline editing, and permanent deletion.
- Event-timezone formatted registration timestamps.
- One-click CSV export (`rsvps.csv`).
- Live configuration editor with hierarchical text preview and on-demand map generation.
## Stack
- **Guest URL**: `https://demos.roadtotech.me/birthday/`
- **Admin URL**: `https://demos.roadtotech.me/birthday/admin` (Authelia SSO protected)
| Layer | Technology |
|---|---|
| Frontend | React, Vite, TypeScript, Canvas 2D, CSS Modules |
| Backend | FastAPI, SQLAlchemy, Pydantic, SQLite (WAL) |
| Infrastructure | Docker (multi-stage), Traefik, Authelia SSO |
---
## Documentation
## Architecture & System Design
- [Frontend Specification](specs/front.md)
- [Backend Specification](specs/backend.md)
- [Infrastructure Specification](specs/infra.md)
- [Roadmap](ROADMAP.md)
The application runs as a **single unified container**:
- **Frontend**: React 18 SPA built with Vite, TypeScript, and CSS Modules.
- **Backend**: FastAPI (Python 3.11+) powered by Uvicorn, SQLAlchemy 2.0, and Pydantic v2.
- **Persistence**: SQLite with Write-Ahead Logging (`WAL`) mode mounted on `./data/bdinvite.db`.
- **Static Assets & Routing**: FastAPI serves API routes under `/birthday/api/`, static assets under `/birthday/assets/`, and fallback SPA catch-all routing for React Router.
- **Security Boundary**: Traefik intercepts `/birthday/admin` and `/birthday/api/admin` with Authelia ForwardAuth middleware, injecting `Remote-User`. Every backend admin endpoint independently asserts this header.
## Experiments
```text
HTTPS Requests (*.roadtotech.me)
│
▼
┌───────────────────────┐
│ Traefik v3.6 │
└───────────┬───────────┘
│
┌───────────────────────┴───────────────────────┐
│ │
Public Routes Admin Routes
(/birthday, /birthday/api/*) (/birthday/admin, /birthday/api/admin/*)
│ │
│ ┌───────────▼───────────┐
│ │ Authelia ForwardAuth│
│ └───────────┬───────────┘
│ │ (Injects Remote-User)
└───────────────────────┬───────────────────────┘
│
▼
┌───────────────────────────┐
│ bdinvite Container │
│ │
│ ┌─────────────────────┐ │
│ │ FastAPI + Uvicorn │ │
│ │ (Port 8000) │ │
│ └──────────┬──────────┘ │
│ │ │
│ ┌──────┴──────┐ │
│ ▼ ▼ │
│ React SPA SQLite DB │
│ (static) (WAL Mode) │
└───────────────────────────┘
```
---
## API Summary
All endpoints are prefixed with `/birthday/api/`.
### Public Endpoints
| Method | Path | Description |
|---|---|---|
| `GET` | `/birthday/api/config` | Retrieves the active invitation configuration |
| `POST` | `/birthday/api/rsvp` | Submits an RSVP (validates 10-digit Colombian phone format) |
| `GET` | `/birthday/api/map-preview.png` | Serves stitched OpenStreetMap tile preview image |
### Admin Endpoints (Requires `Remote-User`)
| Method | Path | Description |
|---|---|---|
| `GET` | `/birthday/api/admin/rsvps` | Lists confirmed guests (supports `?search=<term>`) |
| `PATCH` | `/birthday/api/admin/rsvps/{id}` | Updates name, phone, or email for an RSVP record |
| `DELETE` | `/birthday/api/admin/rsvps/{id}` | Permanently deletes an RSVP record (`204 No Content`) |
| `GET` | `/birthday/api/admin/export` | Downloads the guest roster as a formatted CSV |
| `GET` | `/birthday/api/admin/config` | Fetches complete editable configuration |
| `PUT` | `/birthday/api/admin/config` | Updates singleton configuration and triggers map preview update |
| `POST` | `/birthday/api/admin/map-preview/generate` | Generates or regenerates OSM preview tiles from Google Maps URL |
---
## Development & Toolchain
### Prerequisites
- [Nix](https://nixos.org/) with `direnv` (recommended), or:
- Node.js 20+
- Python 3.11+
- [uv](https://docs.astral.sh/uv/)
- [Biome](https://biomejs.dev/)
If using `direnv`, simply allow the environment in the project root:
```bash
direnv allow
```
Or enter the Nix development shell:
```bash
nix-shell
```
### Backend Setup
```bash
cd backend
# Install dependencies and create virtual environment
uv sync
# Run development server with live reload
uv run uvicorn app.main:app --reload --port 8000
# Run unit and integration tests
uv run pytest
# Run strict type checker
uv run pyright
# Run linter
uv run ruff check
```
### Frontend Setup
```bash
cd frontend
# Install dependencies
npm install
# Start Vite dev server (runs on http://localhost:5173/birthday/)
npm run dev
# Run TypeScript type check and production build
npm run build
# Run Biome linter and formatter checks
npm run lint
```
### Running with Docker Locally
Build and run the multi-stage production container locally:
```bash
docker compose build
docker compose up -d
```
---
## Documentation & References
- [Frontend Specification](specs/front.md) — Visual principles, particle system, and component behaviors
- [Backend Specification](specs/backend.md) — Data schemas, phone normalization rules, and API contracts
- [Infrastructure Specification](specs/infra.md) — NixOS homelab host, Traefik labels, and deployment architecture
- [Project Roadmap](ROADMAP.md) — Phased progress, completed milestones, and future enhancements
- [SSO Graphify Benchmark](experiments/bdinvite-sso-graphify-benchmark/README.md) — Retrospective and archived evidence from an 8-checkpoint agent benchmark
---
## Staged Features
- **Phase 6 OIDC Authentication**: An application-level OpenID Connect authorization code flow (with signed session cookies and headless browser Playwright testing) has been implemented and verified in branch `feat/sso-auth` ([PR #2](https://gitea.roadtotech.me/kiskaadee/bdinvite/pulls/2)). Deployment is staged pending the homelab Authelia identity provider rework.
---
- [SSO Graphify Benchmark](experiments/bdinvite-sso-graphify-benchmark/README.md) — Retrospective and archived evidence from an 8-checkpoint agent implementation benchmark.
## License
[Unlicense](UNLICENSE) — Public Domain.
[Unlicense](UNLICENSE) — public domain.
+5 -21
View File
@@ -21,9 +21,7 @@
- [x] Admin endpoints with `Remote-User` guard
- [x] CSV export endpoint
- [x] SPA catch-all route
- [x] Backend tests (25 unit/integration tests passing)
- [x] OpenStreetMap preview tile generator and geocoding fallback (`app/services/map_preview.py`)
- [x] Admin RSVP update (`PATCH`) and delete (`DELETE`) endpoints
- [x] Backend tests (15 unit/integration tests passing)
## Phase 2 — Frontend Scaffolding
@@ -44,7 +42,7 @@
- [x] Submission state machine (`SUBMITTING` → `SUCCESS` | `DUPLICATE` | `ERROR`)
- [x] Confirmation section: personalized message
- [x] Countdown timer (timezone-aware, `NOS VEMOS EN DD:HH:MM:SS`)
- [x] Dynamic map preview (circular OpenStreetMap stitched preview, link to `mapUrl`)
- [x] Map preview (circular static image, link to `mapUrl`)
- [x] Venue info (compact name + address)
- [x] `sessionStorage` post-RSVP state preservation
- [x] Accessibility (semantic HTML, keyboard nav, aria-live, focus states)
@@ -56,13 +54,11 @@
- [x] Admin layout shell (header, navigation)
- [x] RSVP table with total count
- [x] Search/filter RSVPs
- [x] Inline RSVP editing and permanent deletion with modal confirmation
- [x] Display of registration timestamps in configured event timezone
- [x] CSV export download button
- [x] Config editor form (flat fields, Pydantic-validated)
- [x] Map preview generator trigger button and status feedback
- [x] Text preview of invitation content
## Phase 5 — Infrastructure & Deployment
- [x] Dockerfile (multi-stage build)
@@ -74,22 +70,10 @@
- [ ] Post-deployment verification
- [ ] Authelia admin route verification
## Phase 6 — Application-Level OIDC Authentication (Staged)
Implemented and verified in branch `feat/sso-auth` ([PR #2](https://gitea.roadtotech.me/kiskaadee/bdinvite/pulls/2)), pending Homelab Authelia OIDC provider rework:
- [x] Decouple admin auth from reverse-proxy `Remote-User` header injection
- [x] OpenID Connect Authorization Code flow (`/birthday/api/auth/login`, `/callback`, `/logout`, `/me`)
- [x] Thread-safe in-memory `SessionStore` with expiration and cleanup
- [x] Cryptographically signed session cookie (HMAC-SHA256, `HttpOnly`, `SameSite=Lax`)
- [x] Frontend session expiration handling (lock card + re-login modal)
- [x] Headless browser E2E test with mock OIDC IdP (110 passing assertions)
- [ ] Configure Authelia OIDC client in `~/Homelab/Core/config/authelia/configuration.yml`
- [ ] Merge PR #2 and deploy to production
## Future
- [ ] Font selection (visual comparison of candidates)
- [x] Application-owned map preview asset (replace URL with static file)
- [ ] Miniature rendered invitation preview in admin config editor
- [ ] Guest count toggle / attendance status indicator
- [ ] Enhanced admin features (edit/delete RSVP, attendance status, guest count)
- [ ] CSV import
+4 -4
View File
@@ -1,5 +1,5 @@
version = 1
revision = 3
revision = 5
requires-python = ">=3.11"
resolution-markers = [
"python_full_version >= '3.14'",
@@ -90,11 +90,11 @@ dev = [
[[package]]
name = "certifi"
version = "2026.7.22"
version = "2026.10.23"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" }
sdist = { url = "https://files.pythonhosted.org/packages/fd/11/b524cbd9bbdaca58608e4cf4053fd463417549e1959fa8d3aa18319f9555/certifi-2026.10.23.tar.gz", hash = "sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd", size = 136225, upload-time = "2026-10-23T11:36:16.478Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" },
{ url = "https://files.pythonhosted.org/packages/32/d1/a3652fe2c19134d0d15922177821d863cbd7e842d53a21bbe7e8e3a1b5ac/certifi-2026.10.23-py3-none-any.whl", hash = "sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1", size = 135082, upload-time = "2026-10-23T11:36:14.763Z" },
]
[[package]]
+5 -59
View File
@@ -43,8 +43,6 @@ flowchart LR
```
backend/
├── pyproject.toml
├── uv.lock
├── pyrightconfig.json
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI app, lifespan, static file mount, SPA catch-all
@@ -56,19 +54,15 @@ backend/
│ │ ├── __init__.py
│ │ ├── rsvp.py # POST /birthday/api/rsvp
│ │ ├── config.py # GET /birthday/api/config
│ │ └── admin.py # Admin endpoints (RSVP CRUD, config, map preview)
│ │ └── admin.py # Admin endpoints
│ └── services/
│ ├── __init__.py
│ ├── rsvp.py # RSVP business logic + phone normalization
│ ├── config.py # Config CRUD + seed defaults
│ └── map_preview.py # Google Maps URL resolution & OSM preview stitching
│ └── config.py # Config CRUD + seed defaults
└── tests/
├── __init__.py
├── conftest.py # Shared fixtures, test database, mock client
├── test_rsvp.py # Public RSVP endpoint & validation tests
├── test_config.py # Config endpoints & timezone tests
├── test_admin.py # Admin auth, RSVP update/delete, and CSV export
└── test_map_preview.py # Coordinate resolution & tile generation
├── test_rsvp.py
└── test_config.py
```
---
@@ -141,8 +135,6 @@ flowchart LR
end
subgraph Admin["Admin (Remote-User required)"]
C["GET /birthday/api/admin/rsvps"]
C1["PATCH /birthday/api/admin/rsvps/{id}"]
C2["DELETE /birthday/api/admin/rsvps/{id}"]
D["GET /birthday/api/admin/export"]
E["GET /birthday/api/admin/config"]
F["PUT /birthday/api/admin/config"]
@@ -241,49 +233,6 @@ List all RSVPs.
}
```
#### `PATCH /birthday/api/admin/rsvps/{rsvp_id}`
Update details for an existing RSVP record (name, phone, or email).
- **Auth:** `Remote-User` header required
- **Path parameter:** `rsvp_id: int`
- **Request body (`RSVPUpdate`):**
```json
{
"name": "Ana María García",
"phone": "3009876543",
"email": "anamaria@example.com"
}
```
All fields are optional in the payload, but non-empty strings are required if present.
- **Validation:** Phone is normalized using the same 10-digit Colombian format rule (§7).
- **Responses:**
- `200` — Returns updated `RSVPAdminItem`:
```json
{
"id": 1,
"name": "Ana María García",
"phone": "3009876543",
"email": "anamaria@example.com",
"created_at": "2026-09-30T12:00:00Z"
}
```
- `400` — Validation error on supplied fields.
- `404` — `{"detail": "No se encontró el registro con ID {rsvp_id}"}` if not found.
- `409` — `{"detail": "El número de teléfono ya está registrado para otro asistente."}` if the new phone conflicts with an existing RSVP.
- `401` — Unauthenticated (`Remote-User` missing).
#### `DELETE /birthday/api/admin/rsvps/{rsvp_id}`
Permanently delete an RSVP record by identifier.
- **Auth:** `Remote-User` header required
- **Path parameter:** `rsvp_id: int`
- **Responses:**
- `204` — No Content (record successfully deleted).
- `404` — `{"detail": "No se encontró el registro con ID {rsvp_id}"}` if not found.
- `401` — Unauthenticated (`Remote-User` missing).
#### `GET /birthday/api/admin/export`
Download all RSVPs as CSV.
@@ -501,13 +450,11 @@ version = "0.1.0"
description = "Birthday Invitation RSVP Backend"
requires-python = ">=3.11"
dependencies = [
"fastapi[standard]>=0.115.0",
"fastapi>=0.115.0",
"uvicorn>=0.30.0",
"sqlalchemy>=2.0.0",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
"pillow>=10.0.0",
"httpx>=0.27.0",
]
[dependency-groups]
@@ -515,6 +462,5 @@ dev = [
"httpx>=0.27.0",
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"pyright>=1.1.0",
]
```
+10 -15
View File
@@ -348,7 +348,7 @@ The map is rendered as a clean, circular preview widget linked to the external n
- **Hover/Active**: Scales smoothly (`transform: scale(1.05)`), border brightens
- **Venue Copy**: Clean text block listing venue name and address
- **External Link**: Text link `VER UBICACIÓN ↗` opening `map_url` in a new tab (`target="_blank" rel="noopener noreferrer"`)
- **Asset**: Served via `map_preview_url` (pointing to `/birthday/api/map-preview.png`), dynamically generated on the backend from OpenStreetMap stitched tiles with a cache-busting timestamp `?t=...`
- **Asset**: Uses `map_preview_url` (v1 configurable URL, architected for future self-hosted static asset)
---
@@ -416,31 +416,26 @@ interface Particle {
Served under route `/birthday/admin` and protected at the reverse-proxy level by Authelia ForwardAuth.
### 14.1 RSVP Management Table
### 14.1 RSVP Table View
- **Total Count**: Live tally of confirmed invitees
- **Search Bar**: Debounced substring filtering by name, phone, or email
- **Table Columns & Interactions**:
- **Name**: Displayed as text; converted to inline `<input>` during edit mode
- **Phone**: Formatted as Colombian mobile (`300 123 4567`); validates 10-digit format during inline editing
- **Email**: Displayed as text (or em-dash if omitted); validates email format during edit
- **Submission Date/Time**: Converted from stored UTC to the event's configured timezone (`event_timezone`, e.g., `America/Bogota`) using Colombian Spanish locale (`es-CO`)
- **Actions**:
- **Editar**: Triggers row edit mode with Save / Cancel controls; displays inline conflict errors if the phone number is already registered
- **Eliminar**: Opens a confirmation dialog and permanently removes the record via `DELETE /birthday/api/admin/rsvps/{id}`
- **Search Bar**: Substring filtering by name, phone, or email
- **Table Columns**:
- Name
- Phone (formatted Colombian mobile)
- Email (or em-dash if omitted)
- Submission Date/Time (converted from UTC to browser-local)
- **CSV Export**: *"Descargar CSV"* button triggering `GET /birthday/api/admin/export`
### 14.2 Configuration Editor
A flat form allowing the host to edit dynamic invitation data:
- Honoree Name
- Event Date, Event Time, Event Timezone (validated against IANA database)
- Event Date, Event Time, Event Timezone
- Invitation Title & Intro Copy
- Venue Name & Address Lines
- Map Preview URL & External Map URL
- RSVP Button Copy & Feedback Messages
**Special Features:**
- **On-Demand Map Generation**: Button to trigger `POST /birthday/api/admin/map-preview/generate`, resolving coordinates, writing a freshly stitched OpenStreetMap tile preview to disk, and reporting resolved coordinates with timestamp cache-busting.
- **Hierarchical Text Preview**: Real-time structured preview of the invitation typographic hierarchy before saving.
Includes a **Text Preview** block showing the hierarchical composition of the text fields before saving.
---