initial commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
require('dotenv').config();
|
||||
|
||||
module.exports = {
|
||||
// Server configuration
|
||||
server: {
|
||||
port: process.env.PORT || 3000,
|
||||
nodeEnv: process.env.NODE_ENV || 'development'
|
||||
},
|
||||
|
||||
// Session configuration
|
||||
session: {
|
||||
secret: process.env.SESSION_SECRET || 'change-this-secret',
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
cookie: {
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
httpOnly: true,
|
||||
maxAge: 24 * 60 * 60 * 1000 // 24 hours
|
||||
}
|
||||
},
|
||||
|
||||
// MQTT configuration
|
||||
mqtt: {
|
||||
broker: process.env.MQTT_BROKER || 'mqtt://mqtt.meshtastic.org',
|
||||
port: parseInt(process.env.MQTT_PORT) || 1883,
|
||||
username: process.env.MQTT_USERNAME || 'meshdev',
|
||||
password: process.env.MQTT_PASSWORD || 'large4cats',
|
||||
topic: process.env.MQTT_TOPIC || 'msh/US/#',
|
||||
options: {
|
||||
clientId: `meshtastic-dashboard-${Math.random().toString(16).substr(2, 8)}`,
|
||||
clean: true,
|
||||
reconnectPeriod: 1000,
|
||||
connectTimeout: 30 * 1000
|
||||
}
|
||||
},
|
||||
|
||||
// Data retention configuration
|
||||
dataRetention: {
|
||||
days: parseInt(process.env.DATA_RETENTION_DAYS) || 30,
|
||||
purgeCronSchedule: process.env.PURGE_CRON_SCHEDULE || '0 2 * * *'
|
||||
},
|
||||
|
||||
// Rate limiting configuration
|
||||
rateLimit: {
|
||||
windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS) || 15 * 60 * 1000, // 15 minutes
|
||||
maxRequests: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS) || 100
|
||||
},
|
||||
|
||||
// Logging configuration
|
||||
logging: {
|
||||
level: process.env.LOG_LEVEL || 'info'
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user