Setup a development environment for FTS
introduction
this tutorial assumes that you are working under windows (tested under 11)
Tools Installation
Get the IDE: PyCharm
As an integrated Development Environment (IDE) some people use PyCharm.
Clone the Project Repositories
Clone from the FreeTAKTeam/repositories group
FreeTakServer
and DigitalPy
repositories locally.
This can be done from within PyCharm
.
It can also be done from the command line.
git clone https://github.com/FreeTAKTeam/FreeTakServer.git fts
git clone https://github.com/FreeTAKTeam/DigitalPy dipy
Some other optional repositories:
git clone https://github.com/FreeTAKTeam/FreeTAKServer-User-Docs fts-docs
git clone https://github.com/FreeTAKTeam/UI.git fts-ui
Create a virtual Environment
Here we use a conda
variant, micromamba
.
Detailed installation instructions can be found here.
With micromamba
installed we can set up a virtual environment:
mamba env create -y -f fts_user/docs/HowToHelp/fts-dev-env.yml
This environment definition is not seminal. The dependencies used here are copied from the following sources:
FreeTakServer
- FreeTakServer/pyproject.toml
- FreeTakServer/setup.py
- FreeTAKServer/.../mission/test-requirements.txt
- FreeTAKServer/.../mission/requirements.txt
- FreeTakServer/requirements.txt
DigitalPy
name: fts-dev
channels:
- conda-forge
dependencies:
- coverage>=7.3.2
- coveralls>=1.8.0
- email-validator>=2.1.0.post1
- flake8>=6.1.0
- flake8-print>=5.0.0
- flask>=3.0.0
- flask-login>=0.6.3
- flask-migrate>=4.0.5
- flask-wtf>=1.2.1
- flask-testing>=0.8.0
- lxml>=4.9.3
- nose>=1.3.7
- pluggy>=1.3.0
- pathlib>=1.0.1
- pep8-naming>=0.13.3
- platformdirs>=4.0.0
- pycairo>=1.25.1
- python=3.11
- selenium>=4.15.2
- setuptools>=68.2.2
- tabulate>=0.9.0
- tox>=4.11.4
- vim>=9.0.2059
- waitress>=2.1.2
- pytest>=7.4.3
- pytest-pep8>=1.0.6
- pytest-cov>=4.1.0
- pip>=23.3.1
- pip:
- pytak>=6.2.0
- randomize>=0.14
Activate the virtual environment
mamba activate fts-dev
Install FTS Locally
Install dependencies and DigitalPy as package
pushd dipy
pip install -e .
popd
Configure PyCharm
FTS YAML File
In the folder containing the FreeTakServer working repository create a file.
Populate that file, FTSConfig.yaml
, with the following:
System:
#FTS_DATABASE_TYPE: SQLite
FTS_CONNECTION_MESSAGE: Welcome to FreeTAKServer FreeTAKServer-2.X alpha.
The Parrot is not dead. It’s just resting
#FTS_OPTIMIZE_API: True
#FTS_MAINLOOP_DELAY: 1
Addresses:
#FTS_COT_PORT: 8087
#FTS_SSLCOT_PORT: 8089
FTS_DP_ADDRESS: 192.168.100.105
FTS_USER_ADDRESS: 192.168.100.105
#FTS_API_PORT: 19023
#FTS_FED_PORT: 9000
#FTS_API_ADDRESS: 0.0.0.0
FTS_FIRST_START: false
Filesystem:
FTS_DB_PATH: [PATH]\\FreeTakServer\\FreeTAKServer.db
#FTS_COT_TO_DB: True
FTS_MAINPATH: [PATH]\\FreeTakServer\\FreeTAKServer
FTS_CERTS_PATH: [PATH]\\FreeTakServer\\FreeTAKServerCerts
FTS_EXCHECK_PATH: [PATH]\\FreeTakServer\\ExCheck
FTS_EXCHECK_TEMPLATE_PATH: [PATH]\\FreeTakServer\\ExCheck\\template
FTS_EXCHECK_CHECKLIST_PATH: [PATH]\\FreeTakServer\\ExCheck\\checklist
FTS_DATAPACKAGE_PATH: [PATH]\\FreeTakServer\\FreeTAKServerDataPackageFolder
FTS_LOGFILE_PATH: [PATH]\\FreeTakServer\\FreeTakServerLogs
FTS_CORE_COMPONENTS_PATH: \\home\\ariel\\Workspace\\FTAK\\FreeTakServer\\FreeTAKServer\\components\\core
FTS_EXTERNAL_COMPONENTS_PATH: [PATH]\\FreeTakServer\\components\\extended
FTS_CLIENT_PACKAGES: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\clientPackages
Certs:
FTS_SERVER_KEYDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\server.key
FTS_SERVER_PEMDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\server.pem
FTS_TESTCLIENT_PEMDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\Client.pem
FTS_TESTCLIENT_KEYDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\Client.key
FTS_UNENCRYPTED_KEYDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\server.key.unencrypted
FTS_SERVER_P12DIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\server.p12
FTS_CADIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\ca.pem
FTS_CAKEYDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\ca.key
FTS_FEDERATION_CERTDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\server.pem
FTS_FEDERATION_KEYDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\server.key
FTS_CRLDIR: [PATH]\\FreeTakServer\\FreeTAKServerCerts\\FTS_CRL.json
FTS_FEDERATION_KEYPASS: demopassfed
FTS_CLIENT_CERT_PASSWORD: demopasscert
FTS_WEBSOCKET_KEY: YourWebsocketKey
- Adjust paths to point to point to dir structure
- Create a certs folder at the same level
- Adjust FTS_CERTS_PATH to point to the newly created dir
- Create new directory for the FreeTakServerLogs
- Adjust FTS_LOGFILE_PATH to point to the newly created dir