Package: cotproxy
Cursor on Target Transformation ProxyCOTProxy is an in-line Cursor-on-Target (CoT) transformation proxy forTAK Products.
CoT can be modified as it travels from one TAK Product to another over a network.How does it work?Given a matching UID & Transform, CoT Event characteristics can be changed, including
Callsign, Type, Icon, Video, et al. COTProxy’s transform configurations are
managed via theCOTProxyWebfront-end, installed separately.Concept of Operations CONOPS:Support This ProjectHelp: Emailtakhelp@undef.netor Signal/WhatsApp: +1-310-621-9598This project has been developed for the Disaster Response, Public Safety and
Frontline Healthcare community. All contributions further project development and
ensure ongoing support.ConfigurationCOTProxy can be configured using an INI-style config file, or using
Environment Variables. Configuration Parameters are as follows:CPAPI_URL: URL of COTProxyWeb API. Default =http://localhost:10415/LISTEN_URL: Protocol, Local IP & Port to listen for CoT Events. Default =udp://0.0.0.0:8087.PASS_ALL: If True, will pass everything, Transformed or not. Default =False.AUTO_ADD: If True, will automatically create Transforms and Objects for all COT Events. Default =False.Optional special parameters for importing legacyknown_craft.csvfiles:KNOWN_CRAFT_FILE: [optional] Path to existing Known Craft file to use when seeding COTProxyWeb database. Default =known_craft.csv.SEED_FAA_REG: [optional] If True, will set Tail/N-Number on seeded ICAO Hexs from FAA database. Default =True.TLS & other configuration options, see:PyTAK.Example ConfigTo use any of these example configurations, save the indented code block to the file/etc/config.iniand start
COTProxy withcotproxy-c/etc/config.ini.Example - Send modified CoT to a TAK Server using TLS:[cotproxy]
; ^-- [cotproxy] must always the the first line of config file.

; Listen for CoT at TCP Port 8087 on all network interfaces:
LISTEN_URL=tcp://0.0.0.0:8087

; Send modified CoT to our TAK Server using TLS:
COT_URL=tls://takserver.example.com:8089

; TLS Cert & Key
PYTAK_TLS_CLIENT_CERT=/etc/cotproxy.cert.pem
PYTAK_TLS_CLIENT_KEY=/etc/cotproxy.key.pemExample - Send modified CoT to ATAK Mesh Multicast:[cotproxy]
; ^-- [cotproxy] must always the the first line of config file.

; Listen for CoT at TCP Port 8087 on all network interfaces:
LISTEN_URL=tcp://0.0.0.0:8087

; ATAK Multicast Group & Port:
COT_URL=udp://239.2.3.1:6969RunningCOTProxy should be started as a background sevice (‘run forever’, daemon, etc).
Most modern Linux-based operating systems use thesystemdSystem and Service Manager.CentOS, Debian, Ubuntu, RaspberryOS, RaspbianThese instructions will create, enable and start a service on Linux.Download the example cotproxy systemd service definition:$ sudo wget --output-document=/etc/systemd/system/cotproxy.service https://raw.githubusercontent.com/ampledata/cotproxy/main/cotproxy.service2. Create the/etc/config.inifile and add an appropriate configuration, seeConfigurationsection of the README for config examples:$ sudo nano /etc/config.iniEnable cotproxy systemd service:$ sudo systemctl daemon-reload
$ sudo systemctl enable cotproxy
$ sudo systemctl start cotproxyYou can view cotproxy logs with:$ sudo journalctl-xefInstallationDebian, Ubuntu, RaspberryOS, RaspbianCOTProxy is available as a.debpackage:$ sudo apt update
$ wget https://github.com/ampledata/pytak/releases/latest/download/python3-pytak_latest_all.deb
$ sudo apt install -f ./python3-pytak_latest_all.deb
$ wget https://github.com/ampledata/cotproxy/releases/latest/download/python3-cotproxy_latest_all.deb
$ sudo apt install -f ./python3-cotproxy_latest_all.debCentOS, RedHatInstall from the Python Package Index (PyPI):$ python3 -m pip install cotproxyDevelopersInstall from GitHub source:$ git clone https://github.com/ampledata/cotproxy.git
$ cd cotproxy/
$ python3 setup.py installInstall with PyEnvPyEnv is an alternative installation method that bypasses the system built-in Python environment on Linux & MacOS. PyEnv
works by installing its own Python binary & libraries, and keeping installed modules isolated from system modules. This
is the authors preferred method of installation.PyEnv - DebianInstall required packages:$ sudo apt-get install make build-essential libssl-dev zlib1g-dev \
    libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
    libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \
    libffi-dev liblzma-dev git
$ curl https://pyenv.run | bashAdd the following to your ~/.bashrc and restart your shell:export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"Once back in:$ pyenv install 3.9.13
...Catch up on your expense reports, have a snack, stay hydrated...
$ pyenv shell 3.9.13
$ pyenv virtualenv pytakenv
$ pyenv activate pytakenv
$ python3 -m pip install --upgrade pip
$ mkdir ~/src
$ cd ~/src
$ git clone https://github.com/ampledata/cotproxy.git
$ cd cotproxy
$ python3 setup.py install
$ cd ~/src
$ git clone https://github.com/ampledata/cotproxyweb.git
$ cd cotproxyweb
$ python3 -m pip install -r requirements.txt
$ bash setup.sh
... When prompted, select an admin password. ...You should now be able to connect to port :8000/admin from a web browser.Seed COTProxy Transforms frome existing Known Craft file, given a Known Craft
file namedknown_ps.csv:$ CPAPI_URL="http://localhost:8000/" KNOWN_CRAFT=known_ps.csv cotproxy-seedPyEnv - CentOS 7Update packages:sudo yum update
sudo yum check-updateInstall required packages:sudo yum groupinstall -y "Development Tools"
sudo yum install -y zlib zlib-devel bzip2-devel openssl-devel sqlite-devel \
    readline-devel libffi-devel lzma-sdk-devel ncurses-devel gdbm-devel \
    db4-devel expat-devel libpcap-devel xz-devel pcre-devel wgetInstall updated SQLite:mkdir -p ~/src
cd ~/src
wget https://www.sqlite.org/2019/sqlite-autoconf-3290000.tar.gz
tar zxvf sqlite-autoconf-3290000.tar.gz
cd sqlite-autoconf-3290000
./configure
make
sudo make installInstall PyEnv:curl https://pyenv.run | bashUpdate~/.bash_profile:The following chunk of code should be appended to the end of your~/.bash_profile,
either using a text editor likevi,vim,nanoorpico. Once added,
reload your environment by running:source~/.bash_profile:export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PATH=/opt/sqlite/bin:$PATH
export LD_LIBRARY_PATH=/opt/sqlite/lib
export LD_RUN_PATH=/opt/sqlite/lib
export C_INCLUDE_PATH=/opt/sqlite/include
export CPLUS_INCLUDE_PATH=/opt/sqlite/includeInstall Python 3.9 environment:pyenv install 3.9.13
pyenv shell 3.9.13
pyenv virtualenv cpenvInstall cotproxy:mkdir -p ~/src
cd ~/src
wget https://github.com/ampledata/cotproxy/archive/refs/tags/v1.0.0b2.tar.gz
tar -zvxf v1.0.0b2.tar.gz
cd cotproxy-1.0.0b2/
python3 setup.py installInstall & Initialize cotproxyweb:mkdir -p ~/src
cd ~/src
git clone https://github.com/ampledata/cotproxyweb.git
cd cotproxyweb/
python3 -m pip install -r requirements.txt
python3 manage.py migrate
python3 manage.py createsuperuser \
--username admin --email admin@undef.net
python3 manage.py runserver 0:8000From here follow theRunningsection of the README.SourceGithub:https://github.com/ampledata/cotproxyAuthorGreg Albrecht W2GMDoss@undef.nethttps://ampledata.org/CopyrightCOTProxy is Copyright 2022 Greg AlbrechtLicenseCOTProxy is licensed under the Apache License, Version 2.0. See LICENSE for details.