Fix storage path issues and React error #130

Backend fixes:
- Add STORAGE_PATH environment variable support
- Fix absolute path references in all backend services
- Update Docker configuration with correct storage path

Frontend fixes:
- Remove individual ErrorBoundary wrappers to fix React error #130
- Remove unused ErrorBoundary import
- Simplify route structure to prevent component mounting issues

This resolves:
- 500 errors when creating events due to storage permission issues
- React error #130 that occurred during event creation
- Consistent storage path handling across all services

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-07 13:20:40 +02:00
parent 2e10374e2c
commit 2e7cba9e8a
7 changed files with 31 additions and 21 deletions
+5 -4
View File
@@ -5,10 +5,11 @@ const { db } = require('../database/db');
const { generateThumbnail } = require('./imageProcessor');
const logger = require('../utils/logger');
const WATCH_PATH = path.join(__dirname, '../../../storage/events/active');
const getStoragePath = () => process.env.STORAGE_PATH || path.join(__dirname, '../../../storage');
const WATCH_PATH = () => path.join(getStoragePath(), 'events/active');
function startFileWatcher() {
const watcher = chokidar.watch(WATCH_PATH, {
const watcher = chokidar.watch(WATCH_PATH(), {
ignored: /(^|[\/\\])\../, // ignore dotfiles
persistent: true,
awaitWriteFinish: {
@@ -37,7 +38,7 @@ function startFileWatcher() {
}
async function processNewPhoto(filePath) {
const relativePath = path.relative(WATCH_PATH, filePath);
const relativePath = path.relative(WATCH_PATH(), filePath);
const pathParts = relativePath.split(path.sep);
if (pathParts.length < 2) return; // Not in correct folder structure
@@ -73,7 +74,7 @@ async function processNewPhoto(filePath) {
}
async function removePhoto(filePath) {
const relativePath = path.relative(WATCH_PATH, filePath);
const relativePath = path.relative(WATCH_PATH(), filePath);
// Remove from database
await db('photos').where({ path: relativePath }).delete();