4.5 KiB
4.5 KiB
Phase 6: TAK Server Implementation
Goal
Implement the selected TAK-compatible server as a Docker service integrated with the existing NixOS infrastructure.
Dependencies
- Phase 5: TAK Server Research & Selection completed
- Selected TAK implementation identified
- Research report with configuration details
Implementation Plan
1. Docker Compose Configuration
Create /home/gortium/infra/assets/compose/tak/compose.yml following existing patterns:
version: "3.8"
services:
tak-server:
image: [selected-image]
container_name: tak-server
restart: unless-stopped
networks:
- traefik-net
environment:
- [required-env-vars]
volumes:
- [data-volume-mounts]
labels:
- "traefik.enable=true"
# HTTP router with redirect
- "traefik.http.routers.tak-http.rule=Host(`tak.lazyworkhorse.net`)"
- "traefik.http.routers.tak-http.entrypoints=web"
- "traefik.http.routers.tak-http.middlewares=redirect-to-https"
# HTTPS router with TLS
- "traefik.http.routers.tak-https.rule=Host(`tak.lazyworkhorse.net`)"
- "traefik.http.routers.tak-https.entrypoints=websecure"
- "traefik.http.routers.tak-https.tls=true"
- "traefik.http.routers.tak-https.tls.certresolver=njalla"
# Service configuration
- "traefik.http.services.tak.loadbalancer.server.port=[service-port]"
networks:
traefik-net:
external: true
2. Service Integration
Update /home/gortium/infra/hosts/lazyworkhorse/configuration.nix to include TAK service in the services.dockerStacks section:
services.dockerStacks = {
versioncontrol = {
path = self + "/assets/compose/versioncontrol";
ports = [ 2222 ];
};
network = {
path = self + "/assets/compose/network";
envFile = config.age.secrets.containers_env.path;
ports = [ 80 443 ];
};
passwordmanager = {
path = self + "/assets/compose/passwordmanager";
};
ai = {
path = self + "/assets/compose/ai";
envFile = config.age.secrets.containers_env.path;
};
cloudstorage = {
path = self + "/assets/compose/cloudstorage";
envFile = config.age.secrets.containers_env.path;
};
homeautomation = {
path = self + "/assets/compose/homeautomation";
envFile = config.age.secrets.containers_env.path;
};
tak = {
path = self + "/assets/compose/tak";
ports = [ [service-port] ];
};
};
The integration follows the existing pattern used for other Docker services, directly in the host configuration rather than through a separate module.
3. Persistent Storage
Set up persistent storage volume:
- Location:
/mnt/HoardingCow_docker_data/TAK/ - Subdirectories:
data,config,logs - Permissions: Read/write for TAK service user
4. Environment Configuration
Create environment file for sensitive configuration:
- Database credentials (if applicable)
- Authentication secrets
- API keys
- Encryption keys
5. Firewall Configuration
Update firewall to allow required ports:
- TAK service port (typically 8080)
- WebSocket port if separate
- Any additional required ports
Testing Plan
Basic Functionality
- Verify container starts successfully
- Test web interface accessibility
- Validate Traefik routing and TLS
- Confirm persistent storage working
Core Features
- COT message transmission/reception
- Geospatial mapping functionality
- User authentication (if applicable)
- Message persistence
Integration Tests
- Verify with existing Docker services
- Test network connectivity
- Validate firewall rules
- Confirm logging and monitoring
Rollback Plan
If implementation issues arise:
- Stop TAK service:
systemctl stop tak_stack - Remove containers:
docker-compose down - Revert configuration changes
- Review logs and diagnostics
- Address issues before retry
Documentation Requirements
-
Configuration Guide
- Environment variables
- Volume mounts
- Port mappings
- Firewall requirements
-
Usage Guide
- Web interface access
- COT protocol usage
- Geospatial features
- Authentication (if applicable)
-
Troubleshooting
- Common issues
- Log locations
- Diagnostic commands
Timeline
- Configuration complete: [Estimated date]
- Testing completed: [Estimated date]
- Ready for validation: [Estimated date]
- Move to Phase 7: [Estimated date]
Notes
- Follow existing patterns from other services (n8n, Bitwarden, etc.)
- Ensure proper Traefik integration with existing middleware
- Document all configuration decisions
- Test thoroughly before moving to validation phase