Skip to content

orbisoperations/catalyst-tak-adapter

Repository files navigation

catalyst-tak-adapter

The Catalyst Tak Adapter is a service designed to bridge TAK environments to a rich data integration fabric.

Quick Start

Available Commands

You can use the following commands (via bun run <command> or npm run <command> if using npm):

Command Description
start Start the adapter (index.ts).
dev Start the adapter in watch mode for development.
config:template Generate a template config file (config.template.toml).
test Run all tests.
testw Run all tests in watch mode.
docker-compose Start the app and dependencies using Docker Compose.
build Build the Docker image for the adapter.
prepare Run Husky (for preparing git hooks, e.g., pre-commit hooks).

Setup

  1. Build the project:

    # Using bun
    bun run build
    # Using docker
    docker build -t catalyst-tak-adapter .
  2. Prepare required files:

    • Configuration file (config.toml or custom path)
    • TAK key and certificates in PEM format
    • Storage volume (optional)

    Tip:

    • You can generate a template config file with:
      bun run config:template
      # This will create config.template.toml in the project root
    • An example config is provided as config.example.toml.
    • You can override the config file location by setting the CONFIG_PATH environment variable.
  3. Run the container:

    bun run docker-compose

Configuration & Secrets

  • The adapter loads configuration from a TOML file (default: config.toml in the root, or as set by CONFIG_PATH).
  • Secrets (such as tokens, keys, and sensitive endpoints) can be provided via environment variables. These take precedence over values in the config file.
    • Required secret environment variables for deploymet on Fly.io:
      • FLY_SECRET_TAK_KEY_FILE
      • FLY_SECRET_TAK_CERT_FILE
      • FLY_SECRET_TAK_ENDPOINT
      • FLY_SECRET_TAK_CONNECTION_ID
      • FLY_SECRET_CONSUMER_CATALYST_TOKEN
      • FLY_SECRET_CONSUMER_CATALYST_QUERY
      • FLY_SECRET_PRODUCER_CATALYST_APP_ID
  • See Configuration Guide for all options, defaults, and environment variables.

Development Setup

  1. Set up the TAK development server

    • See Development Guide for full instructions.
    • Clone the CLOUD-RF Tak-Server repo and follow the steps to download and set up the TAK server Docker image.
    • Get your local IP address (for Mac):
      ipconfig getifaddr en0
    • Run the setup script and use your IP address (not localhost).
  2. Configure browser certificates

    • Use Firefox for development.
    • Import the .p12 certificate into Firefox (Settings > Privacy & Security > Certificates).
    • Trust the CA for TAK.
  3. Prepare adapter credentials

    • Copy TAK user credentials into the adapter directory as key.pem and cert.pem.

    • Decrypt the user key if needed:

      openssl rsa -in key.pem -out key.pem
      # Password: atakatak (default)
  4. Run the adapter locally

    bun run index.ts

Deployment

Docker Configuration

The Dockerfile has been updated to support certificate and key file configuration during build time:

ARG TAK_CERT_FILE=tak-admin.cert.pem
ARG TAK_KEY_FILE=tak-admin.key.pem

You can override these defaults during build:

docker build \
  --build-arg TAK_CERT_FILE=your-cert.cert.pem \
  --build-arg TAK_KEY_FILE=your-key.key.pem \
  -t catalyst-tak-adapter .

Fly.io Deployment

Prerequisites:

  • Fly.io account and CLI installed
  • Project configured for Fly.io deployment
  • TAK certificates and keys ready

Deployment Steps:

  1. Set up Fly.io configuration:

    fly launch
  2. Configure certificate files:

    • Ensure your certificate files follow the naming convention:
      • Certificate: *.cert.pem
      • Key: *.key.pem
  3. Deploy with certificate configuration:

    fly deploy \
      --build-arg TAK_CERT_FILE=your-cert.cert.pem \
      --build-arg TAK_KEY_FILE=your-key.key.pem
  4. Set required secrets:

    bun run fly-secrets.ts

For detailed deployment instructions and advanced options, see the Deployment Guide.

Documentation

Detailed documentation is available in the docs directory:

For a complete configuration reference and advanced usage scenarios, please refer to the documentation.

About

Republishing of our TAK adapter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5