Skip to content

Setup a development environment for FTS

introduction

this tutorial assumes that you are working under windows (tested under 11)

Tools Installation

Install Python

Download python-3.11.1-amd64.exe from the source

Get the IDE: VisualStudio Code

As an integrated Development Environment (IDE) we use VisualStudio Code. Visual Studio Code is integrated with GitHub, in fact you can start editing any file directly in the browser for committing lightweight code changes.

For a more serious collaboration you should install the desktop version: https://code.visualstudio.com/Download with the following plugins:

image

we use the Setting Sync plugin to keep the team setting aligned, ask us for the coordinates of the settings.

Install visual-cpp-build-tools

Get Microsoft C++ Build Tools image

ensure that you have "Desktop development with C++" installed image

Install a source code manager: TortoiseGit

install a source code manager like TortoiseGit

Clone from the https://github.com/orgs/FreeTAKTeam/repositories group FreeTakServer and DigitalPy repositories locally. image

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

Configuration

create a virtual Environment

  • open a command prompt and navigate to the FreeTakServer repo
  • Type:
    py -m venv venv
    

Having set up a virtual environment you now take a look inside the directory of your venv. You will see something like this (on Windows):

.
├── Include
├── Lib
│   └── site-packages
├── pyvenv.cfg
└── Scripts
    ├── activate
    ├── activate.bat
    ├── Activate.ps1
    ├── deactivate.bat
    ├── pip3.10.exe
    ├── pip3.exe
    ├── pip.exe
    ├── python.exe
    └── pythonw.exe
Activate the virtual environment
# In cmd.exe
venv\Scripts\activate.bat
# In PowerShell
venv\Scripts\Activate.ps1

Install FTS locally

show installed packages

pip list
output

image

  • now install dependencies and FreeTAKServer as package
    pip install -e .
    

change directory to DigitalPy dir

cd .../DigitalPy
install dependencies and DigitalPy as package
pip install -e .

Configure VS Code

open VS Code Explorer to the location of the FreeTAKServer project

image

  • change the VSCODE Python Interpreter (ctrl + shift + p).
  • Look for "Python: Select Interpreter".
  • Select the one in your venv/scripts/python.exe
  • Go to "Run and Debug"
  • Select "Create launch.json" file
  • copy this configuration over the created file and configure [YOURPATH] with your actual path
    {
        "version": "0.2.0",
        "configurations": [
          {
            "name": "FTS",
            "type": "python",
            "request": "launch",
            "program": "C:\\[YOURPATH]\\src\\FreeTakServer\\FreeTAKServer\\controllers\\services\\FTS.py",
            "console": "integratedTerminal",
            "justMyCode": false,
            "env": {
              "FTS_CONFIG_PATH": "C:\\[YOURPATH]\\src\\FreeTakServer\\FreeTAKServer\\FTSConfig.yaml",
              "FTS_FIRST_START": "false",
              "PYTHONTRACEMALLOC": "25"
            }
          }
        ]
    }  
    

image

FTS YAML File

In the folder containing the FreeTakServer repo create a file: FTSConfig.yaml

Copy the example FTSConfig.yaml into the file just created

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

  1. Adjust paths to point to point to dir structure
  2. Create a certs folder at the same level
  3. Adjust FTS_CERTS_PATH to point to the newly created dir
  4. Create new directory for the FreeTakServerLogs
  5. Adjust FTS_LOGFILE_PATH to point to the newly created dir

you're Done!

Hit [F5] to run debug