-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
PERTI configuration is managed through load/config.php. This file is not committed to version control for security.
Copy the example file to create your configuration:
cp load/config.example.php load/config.php// MySQL (PERTI Application Database)
define('DB_HOST', 'localhost');
define('DB_NAME', 'perti');
define('DB_USER', 'perti_user');
define('DB_PASS', 'your_secure_password');// Azure SQL Server connection
define('ADL_SERVER', 'your-server.database.windows.net');
define('ADL_DATABASE', 'VATSIM_ADL');
define('ADL_USERNAME', 'your_username');
define('ADL_PASSWORD', 'your_password');// VATSIM_TMI (Traffic Management Initiatives)
define('TMI_SERVER', 'your-server.database.windows.net');
define('TMI_DATABASE', 'VATSIM_TMI');
define('TMI_USERNAME', 'your_username');
define('TMI_PASSWORD', 'your_password');// PostGIS spatial queries (boundaries, route geometry)
define('GIS_HOST', 'your-server.postgres.database.azure.com');
define('GIS_DATABASE', 'vatcscc_gis');
define('GIS_USERNAME', 'your_username');
define('GIS_PASSWORD', 'your_password');
define('GIS_PORT', 5432);Register an application at VATSIM Connect to obtain credentials:
// VATSIM Connect OAuth
define('VATSIM_OAUTH_URL', 'https://auth.vatsim.net');
define('VATSIM_CLIENT_ID', 'your_client_id');
define('VATSIM_CLIENT_SECRET', 'your_client_secret');
define('VATSIM_REDIRECT_URI', 'https://your-domain.com/login/callback.php');// Site configuration
define('SITE_NAME', 'vATCSCC PERTI');
define('SITE_URL', 'https://perti.vatcscc.org');
define('TIMEZONE', 'UTC');// Discord webhook for TMI notifications
define('DISCORD_WEBHOOK_URL', 'https://discord.com/api/webhooks/...');
define('DISCORD_TMI_CHANNEL', 'webhook_url_for_tmi_channel');// Feature toggles
define('FEATURE_WEATHER_RADAR', true);
define('FEATURE_SUA_DISPLAY', true);
define('FEATURE_DEMAND_ANALYSIS', true);
// TMI features
define('DISCORD_MULTI_ORG_ENABLED', true); // Multi-organization Discord posting
define('TMI_STAGING_REQUIRED', false); // Require staging before publishing
// GIS mode switch (default: 1)
define('USE_GIS_DAEMONS', 1); // Set to 0 to use Azure SQL spatial instead of PostGIS// ADL Archive daemon only starts if storage connection is configured
define('ADL_ARCHIVE_STORAGE_CONN', 'your_blob_storage_connection_string');For PHP endpoints that only need MySQL (plans, sheets, reviews), add before include connect.php:
define('PERTI_MYSQL_ONLY', true); // Skips 5 Azure SQL connections (~500-1000ms saved)Important: Never apply PERTI_MYSQL_ONLY to files that use $conn_adl, $conn_tmi, $conn_swim, $conn_ref, or $conn_gis. Always grep for these before adding the flag.
// Development/debugging (set false in production)
define('DEBUG_MODE', false);
define('SHOW_ERRORS', false);
define('LOG_QUERIES', false);define('DEBUG_MODE', true);
define('SHOW_ERRORS', true);
define('DB_HOST', 'localhost');define('DEBUG_MODE', false);
define('SHOW_ERRORS', false);
define('DB_HOST', getenv('MYSQL_HOST') ?: 'production-server');For Azure App Service, use application settings:
// Read from environment variables with fallbacks
define('ADL_SERVER', getenv('ADL_SERVER') ?: 'default-server');
define('ADL_DATABASE', getenv('ADL_DATABASE') ?: 'VATSIM_ADL');
define('ADL_USERNAME', getenv('ADL_USERNAME') ?: 'default_user');
define('ADL_PASSWORD', getenv('ADL_PASSWORD') ?: '');The daemon reads from load/config.php automatically. Additional settings:
| Setting | Default | Description |
|---|---|---|
| Interval | 15s | Time between VATSIM API calls |
| Timeout | 30s | HTTP request timeout |
| Lock file | scripts/vatsim_adl.lock |
Prevents duplicate instances |
| Log file | scripts/vatsim_adl.log |
Daemon output log |
Command-line options:
php parse_queue_daemon.php --loop # Continuous mode
php parse_queue_daemon.php --batch=100 # Custom batch size
php parse_queue_daemon.php --interval=10 # Custom interval (seconds)python atis_daemon.py --once # Single run
python atis_daemon.py --airports KJFK,KLAX # Filter airports
python atis_daemon.py # Continuous (default)// Path to navigation data CSVs
define('NAVDATA_PATH', __DIR__ . '/../assets/data/');// FAA playbook route data
define('PLAYBOOK_CSV', __DIR__ . '/../assets/data/playbook_routes.csv');// Iowa Environmental Mesonet tile server
define('IEM_TILE_URL', 'https://mesonet.agron.iastate.edu/cache/tile.py');
define('IEM_RADAR_PRODUCT', 'nexrad-n0q'); // Base reflectivity// Aviation weather sources
define('AWC_SIGMET_URL', 'https://aviationweather.gov/api/data/sigmet');
define('AWC_AIRMET_URL', 'https://aviationweather.gov/api/data/airmet');// Session settings
define('SESSION_LIFETIME', 86400); // 24 hours
define('SESSION_PATH', __DIR__ . '/../sessions/');// Force HTTPS in production
define('FORCE_HTTPS', true);// Allowed origins for API requests
define('CORS_ORIGINS', [
'https://perti.vatcscc.org',
'https://your-custom-domain.com'
]);Create a test script to validate your configuration:
<?php
// test_config.php
require_once 'load/config.php';
$checks = [
'DB_HOST' => defined('DB_HOST'),
'ADL_SERVER' => defined('ADL_SERVER'),
'VATSIM_CLIENT_ID' => defined('VATSIM_CLIENT_ID'),
];
foreach ($checks as $const => $defined) {
echo "$const: " . ($defined ? "OK" : "MISSING") . "\n";
}- Getting Started - Initial setup guide
- Deployment - Azure deployment configuration
- Troubleshooting - Configuration issues
PERTI - Virtual Air Traffic Control System Command Center Production Site | GitHub | Report Issue
Last updated: 2026-02-25
Home Navigation Helper (NEW)
Comprehensive Guides
Getting Started
Architecture
Algorithms & Processing
- Algorithms Overview
- Algorithm ETA Calculation
- Algorithm Trajectory Tiering
- Algorithm Zone Detection
- Algorithm Route Parsing
- Algorithm Data Refresh
SWIM API (Public/External)
- SWIM API
- SWIM Routes API
- SWIM Playbook API
- SWIM Route Data Integration
- Building Route Processing
- CDM Connector Guide
PERTI API (Internal)
Features
Walkthroughs
Operations
Development
Analysis
- Analysis (index)
- ETA Accuracy (Jan-Mar 2026)
Reference