Overview
TheMainConfig class is the central configuration system for FreeTAKServer. It provides a singleton instance that manages all server configuration through multiple sources:
- Default values
- YAML configuration file
- Environment variables
- Built-in defaults
- YAML configuration file (
FTSConfig.yaml) - Environment variables (highest priority)
Configuration Methods
FreeTAKServer supports three methods for configuration:YAML Configuration File
The default configuration file location is/opt/fts/FTSConfig.yaml. You can override this with the FTS_CONFIG_PATH environment variable.
Environment Variables
All configuration options can be set via environment variables. Environment variables override YAML settings.Programmatic Access
System Configuration
Core system settings that control server behavior.Server version information (read-only)
TAK API version supported (read-only)
Unique identifier for this FreeTAKServer node. Auto-generated as 32-character alphanumeric string if not specified.Environment variable:
FTS_NODE_IDSecret key used for cryptographic operations and session management. Change this in production!Environment variable:
FTS_SECRET_KEYEnable API optimizations for better performanceEnvironment variable:
FTS_OPTIMIZE_APINumber of milliseconds to wait between each iteration of the main event loop.
- Decreasing this value increases CPU usage and server performance
- Increasing this value decreases CPU usage and server performance
FTS_MAINLOOP_DELAYBuffer size in bytes for receiving data from clientsEnvironment variable:
FTS_DATA_RECEPTION_BUFFERMaximum time in seconds to wait for data receptionEnvironment variable:
FTS_MAX_RECEPTION_TIMELogging level for the server. Valid values:
debug, info, warning, error, criticalEnvironment variable: FTS_LOG_LEVELMessage sent to clients upon successful connection. Set to
None to disable.Environment variable: FTS_CONNECTION_MESSAGERadius in meters within which users will receive emergency notifications. Set to
0 for unlimited range.Environment variable: FTS_EMERGENCY_RADIUSNetwork Configuration
Network addresses and port settings for various services.TCP port for unencrypted CoT (Cursor on Target) serviceEnvironment variable:
FTS_COT_PORTTCP port for SSL/TLS encrypted CoT serviceEnvironment variable:
FTS_SSLCOT_PORTHTTP port for TAK API service (unencrypted)Environment variable:
FTS_HTTP_TAK_API_PORTHTTPS port for TAK API service (encrypted)Environment variable:
FTS_HTTPS_TAK_API_PORTPort for the REST API serviceEnvironment variable:
FTS_API_PORTIP address for the REST API service to bind to. Use
0.0.0.0 to listen on all interfaces.Environment variable: FTS_API_ADDRESSPort for federation serviceEnvironment variable:
FTS_FED_PORTIP address used for data package service. Auto-detected by default. Must be set correctly for private data packages to work.Environment variable:
FTS_DP_ADDRESSIP address that clients should use to connect. Auto-detected by default. Should match the IP used in TAK device connection settings.Environment variable:
FTS_USER_ADDRESSIP address for CLI access
List of IP addresses allowed to access the CLI interfaceEnvironment variable:
FTS_CLI_WHITELIST (colon or comma separated)Routing and Integration
Configuration for the internal message routing and integration system.Number of routing worker processes to spawn for handling messagesEnvironment variable:
FTS_NUM_ROUTING_WORKERSPort for routing proxy to subscribe to requestsEnvironment variable:
FTS_ROUTING_PROXY_SUBSCRIBE_PORTIP address for routing proxy subscriberEnvironment variable:
FTS_ROUTING_PROXY_SUBSCRIBE_IPPort for routing proxy to publish responsesEnvironment variable:
FTS_ROUTING_PROXY_PUBLISHER_PORTIP address for routing proxy publisherEnvironment variable:
FTS_ROUTING_PROXY_PUBLISHER_IPPort for routing proxy to send requests to workersEnvironment variable:
FTS_ROUTING_PROXY_SERVER_PORTIP address for routing proxy request serverEnvironment variable:
FTS_ROUTING_PROXY_SERVER_IPPort for integration manager to receive worker responsesEnvironment variable:
FTS_INTEGRATION_MANAGER_PULLER_PORTAddress for integration manager pullerEnvironment variable:
FTS_INTEGRATION_MANAGER_PULLER_ADDRESSPort for integration manager to publish messagesEnvironment variable:
FTS_INTEGRATION_MANAGER_PUBLISHER_PORTAddress for integration manager publisherEnvironment variable:
FTS_INTEGRATION_MANAGER_PUBLISHER_ADDRESSFilesystem Paths
Paths for data persistence, logs, and certificates.Root directory for all FreeTAKServer persistent dataEnvironment variable:
FTS_PERSISTENCE_PATHPath to the SQLite database fileEnvironment variable:
FTS_DB_PATHWhether to save Cursor on Target (CoT) messages to the databaseEnvironment variable:
FTS_COT_TO_DBDirectory for server log filesEnvironment variable:
FTS_LOGFILE_PATHDirectory for storing uploaded data packagesEnvironment variable:
FTS_DATAPACKAGE_PATHDirectory containing SSL/TLS certificatesEnvironment variable:
FTS_CERTS_PATHDirectory for backing up client certificate packagesEnvironment variable:
FTS_CLIENT_PACKAGES_PATHDirectory for TAK Enterprise Sync data
Root directory for ExCheck (checklist) dataEnvironment variable:
FTS_EXCHECK_PATHDirectory for ExCheck templatesEnvironment variable:
FTS_EXCHECK_TEMPLATE_PATHDirectory for ExCheck checklistsEnvironment variable:
FTS_EXCHECK_CHECKLIST_PATHRoot path of the FreeTAKServer installationEnvironment variable:
FTS_MAINPATHPath to user persistence file
Component Paths
Configuration for locating core and extended components.Path to core componentsEnvironment variable:
FTS_CORE_COMPONENTS_PATHImport root for core componentsEnvironment variable:
FTS_CORE_COMPONENTS_IMPORT_ROOTPath to internal componentsEnvironment variable:
FTS_INTERNAL_COMPONENTS_PATHImport root for internal componentsEnvironment variable:
FTS_INTERNAL_COMPONENTS_IMPORT_ROOTPath to external/extended componentsEnvironment variable:
FTS_EXTERNAL_COMPONENTS_PATHImport root for external componentsEnvironment variable:
FTS_EXTERNAL_COMPONENTS_IMPORT_ROOTExample Configurations
Development Setup
Production Setup
Docker/Container Setup
Configuration Validation
FreeTAKServer validates paths specified in configuration to ensure they are accessible and writable. If a path cannot be accessed, the server will exit with an error message.Path Sanitization
All paths ending withPATH or DIR in the YAML configuration are automatically sanitized and validated:
- Normalized to prevent directory traversal
- Checked for existence
- Checked for write permissions
Best Practices
The
MainLoopDelay setting directly impacts CPU usage vs. responsiveness. Test different values to find the right balance for your deployment.- Use environment variables for sensitive configuration like secret keys
- Keep YAML configuration files outside the web root
- Regularly back up your persistence path (
/opt/ftsby default) - Use appropriate log levels:
debugfor development,infoorwarningfor production - Ensure all paths have proper filesystem permissions