Compare commits

...

3 Commits

Author SHA1 Message Date
6aa9511fbe brought package.json back from the grave 2025-11-02 20:57:34 +01:00
ab24f5cf35 npm ci install for prod 2025-11-02 20:48:43 +01:00
2e81ed48c4 more lenient api rate limit 2025-11-02 20:40:59 +01:00
5 changed files with 1624 additions and 440 deletions

View File

@@ -85,7 +85,7 @@ jobs:
- name: Install backend dependencies - name: Install backend dependencies
working-directory: ./backend working-directory: ./backend
run: npm install run: npm ci
- name: Run TypeScript check - name: Run TypeScript check
working-directory: ./backend working-directory: ./backend

View File

@@ -16,7 +16,9 @@ COPY tsconfig.base.json ./
COPY ecosystem.config.cjs ./ COPY ecosystem.config.cjs ./
# Install root dependencies # Install root dependencies
RUN npm install --only=production #RUN npm install --only=production
RUN npm i --package-lock-only
RUN npm ci
# Copy workspace files # Copy workspace files
COPY backend/ ./backend/ COPY backend/ ./backend/
@@ -30,7 +32,7 @@ RUN npm install --workspace=frontend
RUN npm run build --only=production --workspace=backend RUN npm run build --only=production --workspace=backend
# Build frontend # Build frontend
RUN npm run build --workspace=frontend RUN npm run build --only=production --workspace=frontend
# Verify Python and OR-Tools installation # Verify Python and OR-Tools installation
RUN python -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')" RUN python -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"

View File

@@ -72,8 +72,8 @@ const getRateLimitConfig = () => {
return { return {
windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS || '900000'), // 15 minutes default windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS || '900000'), // 15 minutes default
max: isProduction max: isProduction
? parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '100') // Stricter in production ? parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '1000') // Stricter in production
: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '1000'), // More lenient in development : parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '5000'), // More lenient in development
// Development-specific relaxations // Development-specific relaxations
skip: (req: Request) => { skip: (req: Request) => {
@@ -112,7 +112,7 @@ export const apiLimiter = rateLimit({
// Strict limiter for auth endpoints // Strict limiter for auth endpoints
export const authLimiter = rateLimit({ export const authLimiter = rateLimit({
windowMs: 15 * 60 * 1000, windowMs: 15 * 60 * 1000,
max: parseInt(process.env.AUTH_RATE_LIMIT_MAX_REQUESTS || '5'), max: parseInt(process.env.AUTH_RATE_LIMIT_MAX_REQUESTS || '100'),
message: { message: {
error: 'Zu viele Login-Versuche, bitte versuchen Sie es später erneut' error: 'Zu viele Login-Versuche, bitte versuchen Sie es später erneut'
}, },
@@ -135,7 +135,7 @@ export const authLimiter = rateLimit({
// Separate limiter for expensive endpoints // Separate limiter for expensive endpoints
export const expensiveEndpointLimiter = rateLimit({ export const expensiveEndpointLimiter = rateLimit({
windowMs: 15 * 60 * 1000, windowMs: 15 * 60 * 1000,
max: parseInt(process.env.EXPENSIVE_ENDPOINT_LIMIT || '10'), max: parseInt(process.env.EXPENSIVE_ENDPOINT_LIMIT || '100'),
message: { message: {
error: 'Zu viele Anfragen für diese Ressource' error: 'Zu viele Anfragen für diese Ressource'
}, },

View File

@@ -7,7 +7,9 @@
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0", "react-dom": "^19.0.0",
"react-router-dom": "^6.28.0", "react-router-dom": "^6.28.0",
"date-fns": "4.1.0" "date-fns": "4.1.0",
"@vitejs/plugin-react": "^4.3.3",
"vite": "^6.0.7"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "20.19.23", "@types/node": "20.19.23",

2044
package-lock.json generated

File diff suppressed because it is too large Load Diff