Server Infrastructure Updates: - Added response sanitization middleware (fixes Date serialization) - Added CSRF protection middleware (double-submit cookie pattern) - Enhanced rate limiting (public, form, auth limiters) - Added cache control middleware for static assets - Added cookie parser for CSRF support Route Organization: - Reorganized routes for website (auth, documents, blog, newsletter) - Separated admin routes with /admin prefix - Added koha routes for donations - Added demo routes for interactive demonstrations - Dev/test routes only in development environment Config Updates: - Updated app config for website platform - Added website-specific configuration options Model Updates: - Updated model exports for website collections - Added blog, media, newsletter models These changes support the website platform while maintaining the underlying Tractatus governance framework.
52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
/**
|
|
* Application Configuration
|
|
*/
|
|
|
|
module.exports = {
|
|
// Server
|
|
port: process.env.PORT || 9000,
|
|
env: process.env.NODE_ENV || 'development',
|
|
appName: process.env.APP_NAME || 'Tractatus',
|
|
|
|
// MongoDB
|
|
mongodb: {
|
|
uri: process.env.MONGODB_URI || 'mongodb://localhost:27017/tractatus_dev',
|
|
db: process.env.MONGODB_DB || 'tractatus_dev'
|
|
},
|
|
|
|
// JWT
|
|
jwt: {
|
|
secret: process.env.JWT_SECRET || 'CHANGE_THIS_IN_PRODUCTION',
|
|
expiry: process.env.JWT_EXPIRY || '7d'
|
|
},
|
|
|
|
// Admin
|
|
admin: {
|
|
email: process.env.ADMIN_EMAIL || 'john.stroh.nz@pm.me'
|
|
},
|
|
|
|
// Logging
|
|
logging: {
|
|
level: process.env.LOG_LEVEL || 'info',
|
|
file: process.env.LOG_FILE || 'logs/app.log'
|
|
},
|
|
|
|
// Feature Flags
|
|
features: {
|
|
aiCuration: process.env.ENABLE_AI_CURATION === 'true',
|
|
mediaTriage: process.env.ENABLE_MEDIA_TRIAGE === 'true',
|
|
caseSubmissions: process.env.ENABLE_CASE_SUBMISSIONS === 'true'
|
|
},
|
|
|
|
// Security
|
|
security: {
|
|
rateLimitWindowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS || '900000'), // 15 min
|
|
rateLimitMaxRequests: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '100')
|
|
},
|
|
|
|
// CORS
|
|
cors: {
|
|
origin: process.env.CORS_ORIGIN || '*',
|
|
credentials: true
|
|
}
|
|
};
|