Commit Graph

61 Commits

Author SHA1 Message Date
Stefan Hardegger
5a48ebcfeb Implement shared HTML sanitization configuration
**Backend Changes:**
- Add html-sanitization-config.json with allowedTags, allowedAttributes, and allowedCssProperties
- Create HtmlSanitizationConfigDto for configuration data transfer
- Update HtmlSanitizationService to load configuration from JSON file with fallback
- Add HtmlSanitizationController with public API endpoint at /api/config/html-sanitization
- Update SecurityConfig to allow public access to /api/config/** endpoints

**Frontend Changes:**
- Add configApi.getHtmlSanitizationConfig() to fetch backend configuration
- Create sanitization.ts utility with sanitizeHtml() and sanitizeHtmlSync() functions
- Update story reading page to use shared sanitization configuration
- Add preloadSanitizationConfig() for early configuration loading
- Handle TrustedHTML type conversion and DOMPurify config compatibility

**Benefits:**
- Consistent HTML sanitization rules between frontend and backend
- Centralized configuration in JSON file for easy maintenance
- Automatic fallback to safe defaults if configuration loading fails
- API-driven approach allows runtime configuration updates
- Maintains security while providing flexibility for content formatting

Resolves HTML sanitization inconsistencies and provides foundation for configurable content safety rules.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 16:18:03 +02:00
Stefan Hardegger
f2001e0d0c Add CORS support for production domain
- Add STORYCOVE_CORS_ALLOWED_ORIGINS environment variable to docker-compose.yml
- Include production domain https://storycove.sharyavin.synology.me in allowed origins
- Update SecurityConfig to read from environment variable with fallback
- Maintains localhost support for development while enabling production access
- Fixes "Invalid CORS request" error on deployed application

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 14:58:59 +02:00
Stefan Hardegger
23f31defde Escape nginx variables in docker-compose.yml for Portainer
- Double all $ characters in nginx config ($$host, $$http_upgrade, etc.)
- Prevents Docker Compose from interpreting nginx vars as environment variables
- Fixes "invalid number of arguments in proxy_set_header directive" error
- Ensures proper nginx variable passing in embedded config

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 14:44:55 +02:00
Stefan Hardegger
9f3bee826b Fix nginx configuration for Portainer deployment
- Remove quotes from Connection header value to fix nginx parsing error
- Simplify Cache-Control header to avoid argument parsing issues
- Clean up embedded nginx config formatting for better compatibility
- Resolves "invalid number of arguments in proxy_set_header directive" error

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 14:38:50 +02:00
Stefan Hardegger
c0a2c68d94 trying to fix the nginx config in docker 2025-07-23 14:24:22 +02:00
Stefan Hardegger
f86fbc39d8 isolate network in docker 2025-07-23 14:15:09 +02:00
Stefan Hardegger
ff31bb219f Set Port 2025-07-23 13:57:21 +02:00
Stefan Hardegger
d69bed00a2 MVP Version 2025-07-23 12:28:48 +02:00
Stefan Hardegger
59d29dceaf inital working version 2025-07-22 21:49:40 +02:00
Stefan Hardegger
bebb799784 Backend implementation 2025-07-21 10:46:11 +02:00
Stefan Hardegger
68c7c8115f Intial Setup 2025-07-21 08:47:52 +02:00