Commit Graph

25 Commits

Author SHA1 Message Date
2acbc4e248 docs: Moved finisched FeatureRequest, Update README.md 2025-11-30 17:36:54 +01:00
6b603112de docs: README.md aktualisiert - ENV-Struktur & Telegram dokumentiert
- Docker Structure: Neue ENV-Verwaltung erklärt (2 zentrale .env Dateien)
- Environment Variables: Vollständige Tabelle mit allen Variablen
- Telegram-Konfiguration dokumentiert
- Phase 6 als abgeschlossen markiert in FEATURE_PLAN-telegram.md
2025-11-30 13:26:54 +01:00
dd71dcab44 feat: ENV-Struktur massiv vereinfacht (Phase 6)
- Von 16 .env Dateien auf 2 zentrale reduziert
  * docker/dev/.env - Development Secrets
  * docker/prod/.env - Production Secrets

- Alle ENV-Variablen jetzt in docker-compose.yml environment sections
- .env COPY aus allen Dockerfiles entfernt (wurden durch volume mounts überschrieben)
- Frontend env.sh umgeschrieben: Liest ENV-Variablen statt .env Datei
- CLIENT_URL komplett entfernt (wurde nirgendwo verwendet)

- Fix: management.js nutzt platform_name statt name (DB-Schema korrekt)

ENV-Handling jetzt deutlich einfacher und wartbarer!
Von 4 Frontend ENV-Variablen auf 3 reduziert (API_URL, PUBLIC_HOST, INTERNAL_HOST)
2025-11-30 13:19:24 +01:00
d76b4b2c9c docs(telegram): complete Phase 5 documentation and security improvements
- Updated README.md with Telegram features section in 'Latest Features'
- Added Telegram environment variables to Environment Variables table
- Updated FEATURE_PLAN-telegram.md: marked Phases 1-5 as completed
- Updated status table with completion dates (Phase 1-4: done, Phase 5: docs complete)

OpenAPI Documentation:
- Added swagger tags to reorder route (Management Portal)
- Added swagger tags to consent routes (Consent Management)
- Regenerated openapi.json with correct tags (no more 'default' category)

Environment Configuration:
- Updated .env.backend.example with Telegram variables and session secret
- Created docker/dev/.env.example with Telegram configuration template
- Created docker/prod/.env.example with production environment template
- Moved secrets from docker-compose.yml to .env files (gitignored)
- Changed docker/dev/docker-compose.yml to use placeholders: ${TELEGRAM_BOT_TOKEN}

Security Enhancements:
- Disabled test message on server start by default (TELEGRAM_SEND_TEST_ON_START=false)
- Extended pre-commit hook to detect hardcoded Telegram secrets
- Hook prevents commit if TELEGRAM_BOT_TOKEN or TELEGRAM_CHAT_ID are hardcoded
- All secrets must use environment variable placeholders

Phase 5 fully completed and documented.
2025-11-30 11:40:59 +01:00
e4ddd229b8 feat: Public/Internal Host Separation
Implemented subdomain-based feature separation for production deployment.

**Backend:**
- New hostGate middleware for host-based API protection
- Public host blocks: /api/admin, /api/groups, /api/slideshow, /api/auth
- Public host allows: /api/upload, /api/manage, /api/social-media/platforms
- Rate limiting: 20 uploads/hour on public host (publicUploadLimiter)
- Audit log enhancement: source_host, source_type tracking
- Database migration 009: Added source tracking columns

**Frontend:**
- Host detection utility (hostDetection.js) with feature flags
- React code splitting with lazy loading for internal features
- Conditional routing: Internal routes only mounted on internal host
- 404 page: Host-specific messaging and navbar
- Clipboard fallback for HTTP environments

**Configuration:**
- Environment variables: PUBLIC_HOST, INTERNAL_HOST, ENABLE_HOST_RESTRICTION
- Docker dev setup: HOST variables, TRUST_PROXY_HOPS configuration
- Frontend .env.development: DANGEROUSLY_DISABLE_HOST_CHECK for Webpack

**Testing:**
- 20/20 hostGate unit tests passing
- Local testing guide in README.dev.md
- /etc/hosts setup for public.test.local, internal.test.local

**Bug Fixes:**
- Fixed clipboard API not available on HTTP
- Fixed missing PUBLIC_HOST in frontend env-config.js
- Fixed wrong navbar on 404 page for public host
- Fixed social media platforms loading in UUID management

**Documentation:**
- CHANGELOG.md: Complete feature documentation
- README.md: Feature overview
- README.dev.md: Host-separation testing guide
- TESTING-HOST-SEPARATION.md: Integration note
2025-11-25 22:02:53 +01:00
b912670cab fix: enforce session cookie behavior in prod 2025-11-24 20:00:52 +01:00
6332b82c6a Feature Request: admin session security
- replace bearer auth with session+CSRF flow and add admin user directory

- update frontend moderation flow, force password change gate, and new CLI

- refresh changelog/docs/feature plan + ensure swagger dev experience
2025-11-23 21:18:42 +01:00
cdb2aa95e6 feat: Add comprehensive test suite and admin API authentication
🧪 Testing Infrastructure (45 tests, 100% passing)
- Implemented Jest + Supertest framework for automated testing
- Unit tests: 5 tests for auth middleware (100% coverage)
- Integration tests: 40 tests covering admin, consent, migration, upload APIs
- Test execution time: ~10 seconds for full suite
- Coverage: 26% statements, 15% branches (realistic start)
- In-memory SQLite database for isolated testing
- Singleton server pattern for fast test execution
- Automatic cleanup and teardown

🔒 Admin API Authentication
- Bearer token authentication for all admin endpoints
- requireAdminAuth middleware with ADMIN_API_KEY validation
- Protected routes: /api/admin/*, /api/system/migration/migrate|rollback
- Complete authentication guide in AUTHENTICATION.md
- HTTP 403 for missing/invalid tokens, 500 if not configured
- Ready for production with token rotation support

📋 API Route Documentation
- Single Source of Truth: backend/src/routes/routeMappings.js
- Comprehensive route overview in backend/src/routes/README.md
- Express routing order documented (specific before generic)
- Frontend integration guide with authentication examples
- OpenAPI auto-generation integrated

🐛 Bug Fixes
- Fixed SQLite connection not properly awaited (caused test hangs)
- Fixed upload validation checking req.files.file before req.files
- Fixed Express route order (consent before admin router)
- Fixed test environment using /tmp for uploads (permission issues)

📚 Documentation Updates
- Updated README.md with testing and authentication features
- Updated README.dev.md with testing section and API development guide
- Updated CHANGELOG.md with complete feature documentation
- Updated FEATURE_PLAN-autogen-openapi.md (status: 100% complete)
- Added frontend/MIGRATION-GUIDE.md for frontend team

🚀 Frontend Impact
Frontend needs to add Bearer token to all /api/admin/* calls.
See frontend/MIGRATION-GUIDE.md for detailed instructions.

Test Status:  45/45 passing (100%)
Backend:  Production ready
Frontend: ⚠️ Migration required (see MIGRATION-GUIDE.md)
2025-11-16 18:08:48 +01:00
ede45aafdd docs: Update README and CHANGELOG for Phase 2 completion
README.md:
- Updated Phase 2 completion date: Nov 11-14 → Nov 11-15
- Added new section: Modular UI Architecture (Nov 15)
- Listed all reusable components and their modes
- Added code reduction metrics (62% reduction, -227 net lines)
- Removed outdated 'email link' mention

CHANGELOG.md:
- Complete rewrite for feature/SocialMedia branch
- Added Phase 1: Social Media Consent Management (Nov 9-10)
  * Backend: Migrations, APIs, validation
  * Frontend: ConsentCheckboxes, ConsentBadges, filters
  * Testing results and GDPR compliance
- Added Phase 2 Backend: Management Portal (Nov 11)
  * Management APIs, security features, audit log
  * Rate limiting and brute-force protection
- Added Phase 2 Frontend: Management Portal UI (Nov 13-14)
  * ManagementPortalPage, component reuse
  * Upload success integration
- Added Phase 2 UI Refactoring (Nov 15)
  * 4 new modular components (686 lines)
  * Multi-mode support (upload/edit/moderate)
  * Code reduction metrics
  * UI consistency patterns
  * Bug fixes

All documentation now accurately reflects Nov 9-15 work.
2025-11-15 18:45:16 +01:00
324c46d735 feat(phase2): Complete Management Portal with reusable ConsentCheckboxes
Phase 2 Frontend completed (Tasks 12-17, 19-20) - 14. Nov 2025

Backend Enhancements:
- Enhanced PUT /api/manage/:token/consents to support creating new consents
- INSERT new consent row when restoring consent for platform not selected during upload
- Enables granting consents for previously unselected platforms

Frontend Refactoring (Code Deduplizierung):
- Extended ConsentCheckboxes component for both modes (upload & manage)
- Removed ~150 lines of duplicated consent UI code from ManagementPortalPage
- New mode prop: 'upload' (default) | 'manage'
- Dynamic hint texts and validation rules based on mode
- Workshop consent required only in upload mode

ManagementPortalPage Updates:
- Replaced custom consent UI with reusable ConsentCheckboxes component
- New state currentConsents tracks checkbox values
- New handler handleConsentChange() computes changes vs original
- Local change collection with batch save on button click
- Email link for social media post deletion (mailto workaround)
- Save/Discard buttons only visible when pending changes exist

ConsentBadges Fix:
- Now correctly displays only active (non-revoked) consents
- Updates properly after consent revocation

Documentation:
- Updated FEATURE_PLAN with Phase 2 Frontend completion status
- Added refactoring section documenting code deduplizierung
- Updated README with Management Portal features
- Documented email backend solution requirement (future work)

Results:
 100% consistent UI between upload and management
 Zero code duplication for consent handling
 ConsentBadges correctly filters revoked consents
 Backend supports granting new consents after upload
 Management link displayed on upload success page
 All manual tests passed

Tasks Completed:
- Task 12: Management Portal UI (/manage/:token)
- Task 13: Consent Management (revoke/restore)
- Task 14: Metadata Editor (title/description)
- Task 15: Image Management (add/delete)
- Task 16: Group Deletion (with confirmation)
- Task 17: Upload Success Page (management link)
- Task 19: Documentation updates
- Task 20: nginx routing configuration

Pending:
- Task 18: E2E Testing (formal test suite)
2025-11-14 14:38:03 +01:00
b892259f69 docs(phase2): Update documentation for Phase 2 Backend (Task 19)
- Updated FEATURE_PLAN-social-media.md:
  * Phase 2 Backend status: 100% complete (Tasks 2-11)
  * Added Phase 2 backend implementation results
  * 4 new commits documented (c18c258, 2d49f0b, 0dce5fd, 0f77db6)
  * New files: management.js, rateLimiter.js, auditLog.js, ManagementAuditLogRepository.js, Migration 007
  * All 8 Management Portal APIs documented with test results
  * Security features: Rate-limiting, brute-force protection, audit logging
  * Frontend status: Tasks 12-18 pending

- Updated README.md:
  * Added Phase 2 Backend features to 'Latest Features' section
  * Documented all Management Portal API endpoints
  * Documented Management Audit-Log API endpoints
  * Added security features documentation
  * Extended database schema with management_audit_log table

Phase 2 Backend: 11/20 tasks complete, ready for frontend implementation
2025-11-11 21:29:19 +01:00
901ecc7633 docs: Phase 1 complete - Update documentation for social media consent system
 Phase 1 Complete (Nov 9-10, 2025):
- GDPR-compliant consent management fully implemented
- Mandatory workshop display consent + optional social media consents
- Consent badges, filtering, and CSV/JSON export in moderation panel
- Automatic migration system fixed (inline comments handling)
- GDPR compliance validated: 72 production groups with display_in_workshop = 0
- All features tested and production-ready

Documentation Updates:
- FEATURE_PLAN-social-media.md: All Phase 1 tasks marked complete
- README.md: Added consent system to features, updated database schema, new API endpoints
- README.dev.md: Complete developer guide with debugging, testing, and troubleshooting

Technical Achievements:
- 12 commits over 2 days (faster than 4-5 day estimate)
- Zero GDPR violations (retroactive consent fix validated)
- Zero breaking changes to existing functionality

Ready for Code Review and Production Deployment
2025-11-10 17:56:04 +01:00
57ce0ff2aa feat: Slideshow optimization with intelligent preloading and chronological sorting
- Add intelligent image preloading (useImagePreloader hook)
- Eliminate duplicate image display issue
- Remove visible loading delays in slideshow
- Implement chronological group sorting (year → upload date)
- Add cache management with LRU strategy (max 10 images)
- Add 3s timeout for slow connections with graceful fallback
- Add debug logging in development mode

Performance improvements:
- 0ms load time for pre-cached images (vs 200-1500ms before)
- Seamless transitions with no visual artifacts
- Better UX on production servers with slower internet

Fixes:
- Fixed: Duplicate image display in slideshow (network latency)
- Fixed: Flickering transitions between images
- Fixed: Random group order replaced with chronological

Files changed:
- NEW: frontend/src/hooks/useImagePreloader.js
- MODIFIED: frontend/src/Components/Pages/SlideshowPage.js
- UPDATED: README.md, CHANGELOG.md, docs/FEATURE_PLAN-preload-image.md
2025-11-09 13:23:27 +01:00
1b4629cca3 changed admin, Link to gitea, LoadingLogo 2025-11-09 11:55:31 +01:00
4ee1b76d77 docs: Finalize automatic cleanup feature documentation
- Update README.md with comprehensive feature description
  - Add automatic cleanup and deletion log to features list
  - Document countdown display and 7-day retention policy
  - Add Testing section with test-cleanup.sh instructions
  - Update API endpoints with new admin routes

- Update CHANGELOG.md with complete feature overview
  - Backend: Services, Repositories, Scheduler, API endpoints
  - Frontend: DeletionLogSection, countdown, SweetAlert2 feedback
  - Infrastructure: nginx config updates
  - Testing: Comprehensive test tools and documentation

- Update TODO.md marking feature as completed

- Update FEATURE_PLAN with final status
  - All 11 tasks completed (100%)
  - Bug fixes documented
  - Deployment checklist updated
  - Final timeline and statistics

- Organize test files into tests/ directory
  - Move TESTING-CLEANUP.md to tests/
  - Move test-cleanup.sh to tests/

Feature is now complete and ready for merge.
2025-11-08 14:45:13 +01:00
4f58b04a0f feat(db): Add deletion_log table and cleanup indexes
Phase 1 Complete - Database Schema

- Add deletion_log table for audit trail (no personal data)
- Add performance indexes for cleanup queries:
  - idx_groups_approved
  - idx_groups_cleanup (approved, upload_date)
  - idx_deletion_log_deleted_at (DESC)
  - idx_deletion_log_year
- Table structure: group_id, year, image_count, upload_date, deleted_at, deletion_reason, total_file_size

Tasks completed:  1.1,  1.2
2025-11-08 12:05:34 +01:00
d2f2fe158d docs: Update documentation for image descriptions feature
- README.md: Add image descriptions to Latest Features section
- CHANGELOG.md: Document complete implementation details
- FEATURE_PLAN: Mark status as Implemented (ready for testing)

All 8 phases complete: Backend + Frontend + Testing + Docs 
2025-11-07 18:39:48 +01:00
2678ad9b12 🚀 Refactor: Saubere Docker-Struktur mit getrennten dev/prod Umgebungen
- Neue Docker-Struktur: docker/{dev,prod}/ für klare Trennung
- Entfernt: docker-compose.override.yml (problematisch)
- Hinzugefügt: ./dev.sh und ./prod.sh Scripts für einfache Bedienung
- Container-spezifische Konfigurationen in docker/{dev,prod}/*/config/
- Aktualisierte READMEs für neue Struktur
- Backend-Daten in .gitignore hinzugefügt
- Bereinigt: Veraltete Dockerfiles und Konfigurationsdateien

Jetzt: Wartungsfreundlich, keine Verwirrung zwischen Umgebungen
2025-11-05 23:00:25 +01:00
5b4e7b21fa docs: update README.md with new reordering features
🆕 Added feature highlights:
- Drag-and-Drop Image Reordering for admins
- Touch-friendly interface with mobile optimization
- Slideshow integration with custom ordering
- Admin panel for content curation
- Optimistic UI updates with error recovery

Updated 'What's New' section with January 2025 features
Enhanced feature list with technical capabilities
2025-11-03 21:24:29 +01:00
4440b969f3 docs: add preview image feature documentation to README
- Added Preview Image Optimization to features list
- New section explaining automatic thumbnail generation
- Technical specifications: 800px JPEG, 85% quality, 96-98% size reduction
- Performance benefits: ~30x faster gallery loading
- Smart image loading: previews for galleries, originals for slideshow
- Updated API endpoints section with /api/previews and /api/download
- Updated database schema showing preview_path column
- Enhanced storage architecture diagram
2025-11-01 12:29:51 +01:00
9406b725c1 removed old css in ImageGallery.css 2025-10-28 20:04:42 +01:00
a0d74f795a feat: Complete frontend refactoring and development environment setup
Major Frontend Refactoring:
- Replace ImagePreviewGallery with unified ImageGallery/ImageGalleryCard components
  - Support 4 display modes: group, moderation, preview, single-image
  - Add hidePreview prop to conditionally hide group preview images
  - Unified grid layout with responsive 3/2/1 column design

- Remove 15+ legacy files and components
  - Delete UploadedImagePage, SocialMedia components, old upload components
  - Remove unused CSS files (GroupCard.css, Image.css/scss)
  - Clean up /upload/:image_url route from App.js

- Fix image preview functionality in MultiUploadPage
  - Convert File objects to blob URLs with URL.createObjectURL()
  - Add proper memory cleanup with URL.revokeObjectURL()

- Improve page navigation and layout
  - Fix GroupsOverviewPage to route to /groups/:groupId detail page
  - Adjust PublicGroupImagesPage spacing and layout
  - Fix ModerationGroupsPage duplicate stats section

CSS Refactoring:
- Rename GroupCard.css → ImageGallery.css with updated class names
- Maintain backward compatibility with legacy class names
- Fix grid stretching with fixed 3-column layout

Development Environment:
- Add docker-compose.override.yml for local development
- Create Dockerfile.dev with hot-reload support
- Add start-dev.sh and nginx.dev.conf
- Update README.dev.md with development setup instructions

Production Build:
- Fix frontend/Dockerfile multi-stage build (as → AS)
- Update prod.sh to explicitly use docker-compose.yml (ignore override)
- Resolve node:18-alpine image corruption issue
- Backend Dockerfile improvements for Node 14 compatibility

Documentation:
- Update TODO.md marking completed frontend tasks
- Clean up docs/images directory
- Update README.md with current project status

All changes tested and verified in both development and production environments.
2025-10-27 22:22:52 +01:00
24c1de1666 IMP: Eigene Verzeichnisse für Uploads und Datenbank
- README aktualisiert, um die neuen Verzeichnisse zu reflektieren
- Konstanten für Verzeichnispfade in 'constants.js' hinzugefügt
- 'DatabaseManager.js' angepasst, um die neuen Datenbankverzeichnisse zu verwenden
- Routen für Batch-Upload, Download und Upload aktualisiert, um die neuen Pfade zu berücksichtigen
- 'MigrationService.js' hinzugefügt, um vorhandene Daten in die neuen Verzeichnisse zu migrieren
- Hilfsfunktionen in 'groupStorage.js' und 'initiate-resources.js' angepasst
- 'docker-compose.yml' und 'prod.sh' aktualisiert, um die neuen Verzeichnisse zu berücksichtigen
2025-10-18 14:23:12 +02:00
48bf6f2074 Initial Commit 2025-10-15 21:33:00 +02:00
7ea96bfeca Initial commit 2025-10-15 21:25:52 +02:00