Service Architecture
FreeTAKServer implements a modular service architecture where each service runs independently and communicates through a central integration manager. All services extend theDigitalPyService base class from the DigitalPy framework.
Available Services
TCP CoT Service
The TCP CoT Service handles unencrypted Cursor on Target traffic over TCP connections. Implementation:FreeTAKServer/services/tcp_cot_service/
Service Details
Service Details
Main Class:
TCPCoTServiceMainKey Features
Key Features
- Protocol: TCP/IP without encryption
- Port: Default 8087
- Format: XML-based CoT messages
- Use Case: Development, testing, local networks
- Multi-threaded: Concurrent client handling via thread pools
Controllers
Controllers
Located in
FreeTAKServer/services/tcp_cot_service/controllers/:- TCPSocketController: Manages TCP socket creation and binding
- ReceiveConnections: Accepts incoming client connections
- ClientConnectionController: Handles new client setup
- ClientReceptionHandler: Receives data from connected clients
- SendDataController: Sends CoT messages to clients
- ClientDisconnectionController: Handles client disconnection cleanup
- SendComponentDataController: Sends data from component processing
Connection Flow
Connection Flow
SSL CoT Service
The SSL CoT Service provides encrypted CoT traffic using SSL/TLS certificates. Implementation:FreeTAKServer/services/ssl_cot_service/
Service Details
Service Details
Main Class:
SSLCoTServiceControllerFeatures:- SSL/TLS encrypted connections
- X.509 certificate authentication
- Default port: 8089
- Client certificate validation
Certificate Management
Certificate Management
FTS uses the Certificate Locations:
AtakOfTheCerts utility for certificate generation:- CA Certificate:
certs/ca.pem - Server Certificate:
certs/server.pem - Client Certificates:
certs/clients/{username}.pem
Security Features
Security Features
- Mutual TLS: Both server and client authentication
- Certificate Validation: Verify client certificates against CA
- Encrypted Transport: All CoT data encrypted in transit
- Certificate Revocation: Support for certificate blacklisting
REST API Service
The REST API Service provides a web-based interface for CoT manipulation, system management, and integration. Implementation:FreeTAKServer/services/rest_api_service/
Service Details
Service Details
Main Class: Ports:
RestAPIServiceMainFramework: Flask with SocketIO- HTTP: Default 19023
- WebSocket: Same port as HTTP
API Endpoints
API Endpoints
The REST API is organized into blueprints:Core Endpoints:
/ManagePresence- Position/presence management/ManageEmergency- Emergency alerts/ManageGeoObject- Geographic objects (markers, shapes)/ManageRoute- Route planning/ManageChat- Chat messages/VideoStream- Video stream management/Sensor- Sensor data/ExCheck- Checklist management
/APIUser- User authentication/ManageConnection- Connection management/Health- Health checks
WebSocket Support
WebSocket Support
Real-time updates via Socket.IO:Event Types:
cotEvent- New CoT messagepresence- Position updateschat- Chat messagesemergency- Emergency alerts
Authentication
Authentication
Methods:
- Session-based: Flask-Login sessions
- Token-based: API key authentication
- Certificate-based: Client certificate validation
HTTP TAK API Service
Implements the TAK server HTTP API for compatibility with TAK clients. Implementation:FreeTAKServer/services/http_tak_api_service/
Service Details
Service Details
Main Class:
HTTPTakAPIPurpose: Provides TAK-compatible HTTP endpoints for:- Mission package synchronization
- Data package upload/download
- Video stream metadata
- CoT query API
Key Endpoints
Key Endpoints
Marti API Compatibility:
GET /Marti/api/sync/metadata/{hash}- Get package metadataGET /Marti/api/sync/content- Download packagePUT /Marti/api/sync/upload- Upload data packageGET /Marti/api/missions- List missionsGET /Marti/api/missions/{name}- Get mission detailsPOST /Marti/api/missions/{name}/changes- Submit mission changes
Data Package Handling
Data Package Handling
HTTPS TAK API Service
Secure version of the HTTP TAK API Service with SSL/TLS encryption. Implementation:FreeTAKServer/services/https_tak_api_service/
Service Details
Service Details
Main Class:
HTTPSTakAPIFeatures:- All HTTP TAK API endpoints over HTTPS
- Certificate-based client authentication
- Encrypted data package transfers
Configuration
Configuration
Service Communication
Integration Manager Pattern
Services communicate through a central integration manager using ZeroMQ:Message Flow
Service Lifecycle
Initialization
Shutdown
Service Configuration
Configuration File
Services are configured viaconfig.ini:
Environment Variables
Override configuration with environment variables:Performance Considerations
Thread Pool Configuration
Connection Limits
Database Connection Pooling
Monitoring and Health Checks
Health Check Endpoint
Telemetry
Troubleshooting
Common Issues
Port Already in Use
Port Already in Use
Certificate Errors
Certificate Errors
Database Connection Failures
Database Connection Failures
High Memory Usage
High Memory Usage
- Reduce thread pool sizes
- Enable database connection pooling
- Implement message rate limiting
- Monitor for memory leaks in custom components
Related Documentation
Architecture
Understand FTS architecture
Components
Explore the component system
Configuration
Configure FTS services
API Reference
REST API documentation