diff --git a/backend/.env.development.example b/backend/.env.development.example index 24ee6f0..e0e2432 100644 --- a/backend/.env.development.example +++ b/backend/.env.development.example @@ -71,3 +71,8 @@ CLOUDFLARE_TURN_API_TOKEN=your-turn-api-token-here # Beta Testing # Auto-assign SUPPORTER tier to new registrations during beta BETA_AUTO_SUPPORTER=false + +# Event Check-in +# Enable date restriction for check-in (event dates ±1 day) +# Set to 'false' for testing or events where QR code access is controlled manually +ENABLE_CHECKIN_DATE_RESTRICTION=false diff --git a/backend/.env.production.example b/backend/.env.production.example index b1b29e9..3e2c460 100644 --- a/backend/.env.production.example +++ b/backend/.env.production.example @@ -71,3 +71,8 @@ CLOUDFLARE_TURN_API_TOKEN=your-production-turn-api-token-here # Beta Testing # Auto-assign SUPPORTER tier to new registrations during beta BETA_AUTO_SUPPORTER=false + +# Event Check-in +# Enable date restriction for check-in (event dates ±1 day) +# Set to 'false' for testing or events where QR code access is controlled manually +ENABLE_CHECKIN_DATE_RESTRICTION=false diff --git a/backend/src/routes/events.js b/backend/src/routes/events.js index 329a305..624a3e6 100644 --- a/backend/src/routes/events.js +++ b/backend/src/routes/events.js @@ -239,9 +239,9 @@ router.post('/checkin/:token', authenticate, async (req, res, next) => { const event = checkinToken.event; - // Validate dates (only in production) - const isProduction = process.env.NODE_ENV === 'production'; - if (isProduction) { + // Validate dates (only if date restriction is enabled) + const enableDateRestriction = process.env.ENABLE_CHECKIN_DATE_RESTRICTION === 'true'; + if (enableDateRestriction) { const now = new Date(); const validFrom = new Date(event.startDate); validFrom.setDate(validFrom.getDate() - 1); diff --git a/docker-compose.yml b/docker-compose.yml index 9442e28..b01ac8e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,15 +34,17 @@ services: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/conf.d.prod:/etc/nginx/conf.d:ro - ./ssl:/etc/nginx/ssl:ro + - app_logs_prod:/var/log/nginx-app ports: - "80:80" - "443:443" restart: always + command: ["/bin/sh", "-c", "nginx -g 'daemon off;' 2>&1 | tee -a /var/log/nginx-app/nginx.log"] logging: driver: "json-file" options: - max-size: "10m" - max-file: "3" + max-size: "50m" + max-file: "10" deploy: resources: limits: @@ -175,13 +177,15 @@ services: - LOG_LEVEL=warn depends_on: - db-prod - command: ["node", "src/server.js"] + command: ["sh", "-c", "node src/server.js 2>&1 | tee -a /var/log/app/backend.log"] restart: always + volumes: + - app_logs_prod:/var/log/app logging: driver: "json-file" options: - max-size: "10m" - max-file: "3" + max-size: "50m" + max-file: "10" deploy: resources: limits: @@ -248,6 +252,9 @@ volumes: postgres_data_prod: external: true name: slc_postgres_prod_data + app_logs_prod: + external: true + name: slc_logs_prod networks: slc_network: