Configuration
Niuton is configured through config.php at the application root.
Core Settings
php
<?php
// Database
$db_host = 'localhost';
$db_port = '5432';
$db_name = 'niuton_db';
$db_user = 'niuton_user';
$db_pass = 'your_secure_password';
// Application
$app_name = 'Niuton';
$app_url = 'https://your-domain.net';
$app_env = 'production'; // 'development' or 'production'
// File storage
$userdata_path = __DIR__ . '/userdata';
$max_upload_size = '100M';
// Session
$session_lifetime = 86400; // 24 hoursAI Provider Configuration
AI providers are configured through the Settings app (Administration > AI Configuration) or via the niuton_system_config table:
| Config Key | Description | Example |
|---|---|---|
anthropic_api_key | Anthropic API key | sk-ant-... |
openai_api_key | OpenAI API key | sk-... |
gemini_api_key | Google Gemini API key | AI... |
lmstudio_url | LM Studio endpoint | http://192.168.1.100:1234 |
Model Selection
Users can select their preferred models in Settings > Aurora:
- Chat Model — Primary conversational AI
- System Model — Background tasks, tool execution
- Vision Model — Image analysis
- Agent Model — Autonomous task execution
System Configuration
The admin panel provides 24 configuration keys:
| Key | Type | Default | Description |
|---|---|---|---|
maintenance_mode | boolean | false | Enable maintenance mode |
registration_enabled | boolean | true | Allow new user registration |
max_login_attempts | integer | 5 | Before account lockout |
lockout_duration_minutes | integer | 15 | Lockout duration |
default_quota_mb | integer | 500 | Default user storage quota |
shared_room_quota_mb | integer | 200 | Per-room shared file quota |
disabled_apps | json | [] | List of disabled app slugs |
Database Connection
The config file establishes a PDO connection with UTF-8 encoding:
php
$pdo = new PDO(
"pgsql:host=$db_host;port=$db_port;dbname=$db_name",
$db_user,
$db_pass,
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
);
$pdo->exec("SET client_encoding = 'UTF8'");Environment Variables
Apache VirtualHost can set environment variables that override config.php defaults:
apache
SetEnv APP_ENV "development"
SetEnv DB_NAME "niuton_dev"