Configuration
Environment variables, user management, and role configuration.
Environment Variables
Database
| Variable | Default | Description |
|---|---|---|
| DB_HOST | localhost | MySQL host |
| DB_PORT | 3306 | MySQL port |
| DB_USER | — | Database username |
| DB_PASS | — | Database password |
| DB_NAME | gsnoc | Database name |
| DB_POOL | 10 | Connection pool size |
Authentication
| Variable | Description |
|---|---|
| SESSION_SECRET | 32-byte secret for iron-session AES-256 encryption |
| SESSION_TTL | Session lifetime in seconds (default: 86400) |
AI
| Variable | Description |
|---|---|
| OPENAI_API_KEY | OpenAI API key for NLQ, email drafting, and RCA |
| OPENAI_MODEL | Model to use (default: gpt-4o) |
Notifications
| Variable | Description |
|---|---|
| TELEGRAM_BOT_TOKEN | Bot token for alert delivery |
| TELEGRAM_CHAT_ID | Target chat or channel ID |
User Management
Users are stored in config/users.json. Passwords are hashed with bcrypt (cost 12):
[
{
"username": "admin",
"passwordHash": "$2b$12$...",
"role": "admin"
}
]
Add a user with the CLI helper:
npm run add-user -- --username operator1 --role operator
Roles
| Role | Permissions |
|---|---|
| admin | Full access: config, users, all features |
| operator | Read/write on tickets, carriers, detection |
| viewer | Read-only access to dashboards and CDR |