feat(config): add configurable check-in date restriction and persistent logging
- Add ENABLE_CHECKIN_DATE_RESTRICTION environment variable to allow flexible check-in testing - Replace NODE_ENV check with configurable flag in check-in validation logic - Implement persistent logging with external Docker volumes (slc_logs_prod) - Configure backend-prod and nginx-prod to write logs to /var/log/app/ and /var/log/nginx-app/ - Increase log rotation limits (50MB, 10 files) for better debugging - Update .env.example files with new check-in configuration
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user