Skip to content

Commit add9cad

Browse files
committed
updates
1 parent be390bc commit add9cad

28 files changed

+288
-75
lines changed

.github/workflows/debian.yml

+10-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Debian package
1+
name: Build Debian Package
22

33
on:
44
push:
@@ -15,36 +15,19 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@master
1717

18-
- name: Install packaging dependencies
19-
run: |
20-
sudo apt-get update -qq
21-
sudo apt-get install -y \
22-
python3 python3-dev python3-pip python3-venv python3-all \
23-
dh-python debhelper devscripts dput software-properties-common \
24-
python3-distutils python3-setuptools python3-wheel python3-stdeb \
25-
python3-all
18+
- name: Install Debian Package Building Dependencies
19+
run: sudo bash debian/install_pkg_build_deps.sh
2620

27-
- name: Build Debian/Apt sdist_dsc
28-
run: |
29-
python3 -m pip install .
30-
rm -Rf deb_dist/*
31-
python3 setup.py --command-packages=stdeb.command sdist_dsc
21+
- name: Create Debian Package
22+
run: make clean package
3223

33-
- name: Build Debian/Apt bdist_deb
34-
run: |
35-
python3 -m pip install .
36-
export REPO_NAME=$(echo ${{ github.repository }} | awk -F"/" '{print $2}')
37-
python3 setup.py --command-packages=stdeb.command bdist_deb
38-
ls -al deb_dist/
39-
cp deb_dist/python3-${REPO_NAME}_*_all.deb deb_dist/python3-${REPO_NAME}_latest_all.deb
40-
41-
- uses: actions/upload-artifact@master
24+
- name: Upload Artifacts to GitHub
25+
uses: actions/upload-artifact@master
4226
with:
4327
name: artifact-deb
44-
path: |
45-
deb_dist/*.deb
28+
path: deb_dist/*.deb
4629

47-
- name: Create Release
30+
- name: Create GitHub Release
4831
id: create_release
4932
uses: actions/create-release@master
5033
env:
@@ -55,7 +38,7 @@ jobs:
5538
draft: false
5639
prerelease: false
5740

58-
- name: Upload Release Asset
41+
- name: Upload Release Asset to GitHub
5942
id: upload-release-asset
6043
uses: svenstaro/upload-release-action@v2
6144
with:

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## ADSBCOT 8.0.0
2+
3+
Happy Summer Solstice!
4+
5+
16
## ADSBCOT 7.0.1
27

38
- Fixes #42: ADSBCOT CoT Events are not showing up in iTAK.

Makefile

+39-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
# Makefile from https://github.com/snstac/pytak
2+
# PyTAK Makefile
13
#
2-
# Copyright Sensors & Signals LLC https://www.snstac.com
4+
# Copyright Sensors & Signals LLC https://www.snstac.com/
35
#
46
# Licensed under the Apache License, Version 2.0 (the "License");
57
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
7-
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
8+
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
99
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,10 +14,14 @@
1414
# limitations under the License.
1515
#
1616

17-
this_app = adsbcot
18-
.DEFAULT_GOAL := all
17+
REPO_NAME ?= $(shell echo $(wildcard */__init__.py) | awk -F'/' '{print $$1}')
18+
SHELL := /bin/bash
19+
.DEFAULT_GOAL := editable
20+
# postinst = $(wildcard debian/*.postinst.sh)
21+
# service = $(wildcard debian/*.service)
1922

20-
all: editable
23+
prepare:
24+
mkdir -p build/
2125

2226
develop:
2327
python3 setup.py develop
@@ -26,13 +30,13 @@ editable:
2630
python3 -m pip install -e .
2731

2832
install_test_requirements:
29-
python3 -m pip install -r requirements_test.txt
33+
python3 -m pip install -r requirements_test.txt
3034

3135
install:
3236
python3 setup.py install
3337

3438
uninstall:
35-
python3 -m pip uninstall -y $(this_app)
39+
python3 -m pip uninstall -y $(REPO_NAME)
3640

3741
reinstall: uninstall install
3842

@@ -43,16 +47,16 @@ clean:
4347
@rm -rf *.egg* build dist *.py[oc] */*.py[co] cover doctest_pypi.cfg \
4448
nosetests.xml pylint.log output.xml flake8.log tests.log \
4549
test-result.xml htmlcov fab.log .coverage __pycache__ \
46-
*/__pycache__
50+
*/__pycache__ deb_dist .mypy_cache
4751

4852
pep8:
49-
flake8 --max-line-length=88 --extend-ignore=E203 --exit-zero $(this_app)/*.py
53+
flake8 --max-line-length=88 --extend-ignore=E203 --exit-zero $(REPO_NAME)/*.py
5054

5155
flake8: pep8
5256

5357
lint:
5458
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
55-
--max-line-length=88 -r n $(this_app)/*.py || exit 0
59+
--max-line-length=88 -r n $(REPO_NAME)/*.py || exit 0
5660

5761
pylint: lint
5862

@@ -68,11 +72,32 @@ pytest:
6872
test: editable install_test_requirements pytest
6973

7074
test_cov:
71-
pytest --cov=$(this_app) --cov-report term-missing
75+
pytest --cov=$(REPO_NAME) --cov-report term-missing
7276

7377
black:
7478
black .
7579

7680
mkdocs:
7781
pip install -r docs/requirements.txt
78-
mkdocs serve
82+
mkdocs serve
83+
84+
deb_dist:
85+
python3 setup.py --command-packages=stdeb.command sdist_dsc
86+
87+
deb_custom:
88+
cp debian/$(REPO_NAME).conf $(wildcard deb_dist/*/debian)/$(REPO_NAME).default
89+
cp debian/$(REPO_NAME).postinst $(wildcard deb_dist/*/debian)/$(REPO_NAME).postinst
90+
cp debian/$(REPO_NAME).service $(wildcard deb_dist/*/debian)/$(REPO_NAME).service
91+
92+
bdist_deb: deb_dist deb_custom
93+
cd deb_dist/$(REPO_NAME)-*/ && dpkg-buildpackage -rfakeroot -uc -us
94+
95+
faux_latest:
96+
cp deb_dist/$(REPO_NAME)_*-1_all.deb deb_dist/$(REPO_NAME)_latest_all.deb
97+
cp deb_dist/$(REPO_NAME)_*-1_all.deb deb_dist/python3-$(REPO_NAME)_latest_all.deb
98+
99+
package: bdist_deb faux_latest
100+
101+
extract:
102+
dpkg-deb -e $(wildcard deb_dist/*latest_all.deb) deb_dist/extract
103+
dpkg-deb -x $(wildcard deb_dist/*latest_all.deb) deb_dist/extract

README.rst README.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
.. image:: https://adsbxcot.readthedocs.io/en/latest/atak_screenshot_with_pytak_logo-x25.png
2-
:alt: ATAK screenshot with PyTAK logo.
1+
![ATAK screenshot with PyTAK logo.](https://adsbcot.readthedocs.io/en/latest/media/atak_screenshot_with_pytak_logo-x25.png)
32

4-
Display Aircraft in TAK
5-
************************
3+
# Display Aircraft in TAK - ADS-B to TAK Gateway
64

75
ADSBCOT is software for monitoring and analyzing aviation surveillance data via the Team Awareness Kit (TAK) ecosystem of products.
86

@@ -12,14 +10,15 @@ ADSBCOT has been evaluated with WinTAK, iTAK, ATAK & TAK Server.
1210

1311
ADSBCOT is in active use today in a variety of missions.
1412

15-
`Documentation is available here. <https://adsbcot.rtfd.io>`_
13+
[Documentation is available here.](https://adsbcot.rtfd.io)
1614

17-
Use ADS-B Aggregators? Check out my sister software `ADSBXCOT <https://adsbxcot.rtfd.io>`_.
1815

19-
Want a turn-key ADS-B to TAK Gateway? Check out `AirTAK <https://www.snstac.com/store/p/airtak-v1>`_.
16+
Use ADS-B Aggregators? Check out my sister software [ADSBXCOT](https://adsbxcot.rtfd.io).
2017

21-
License
22-
=======
18+
Want a turn-key ADS-B to TAK Gateway? Check out [AirTAK](https://www.snstac.com/store/p/airtak-v1).
19+
20+
21+
## Copyright & License
2322

2423
Copyright Sensors & Signals LLC https://www.snstac.com
2524

debian/adsbcot.conf

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# adsbcot.conf from https://github.com/snstac/adsbcot
2+
#
3+
# Debian specific runtime configuration for aiscot.
4+
#
5+
# Copyright Sensors & Signals LLC https://www.snstac.com
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
# AISCOT Configuration: https://aiscot.rtfd.io/
21+
# Change values here, and restart with: sudo systemctl restart aiscot
22+
23+
# Enable or Disable the AISCOT software daemon.
24+
# ENABLED=1
25+
26+
# URL to CoT destination. Must be a URL, e.g. tcp://1.2.3.4:1234 or tls://...:1234, etc.
27+
# COT_URL=udp+wo://239.2.3.1:6969
28+
29+
# AIS UDP Listen Port, for use with Over-the-air (RF) AIS.
30+
# AIS_PORT=5050
31+
32+
# CoT Stale period ("timeout"), in seconds.
33+
# COT_STALE=3600
34+
35+
# Override COT Event Type ("marker type").
36+
# COT_TYPE=a-u-S-X-M
37+
38+
# If using AISHUB or other AIS aggregators, set URL of feed.
39+
# FEED_URL=
40+
41+
# Known Craft hints file. CSV file containing callsign/marker hints.
42+
# KNOWN_CRAFT=
43+
44+
# If using KNOWN_CRAFT, still include other craft not in our KNOWN_CRAFT list.
45+
# INCLUDE_ALL_CRAFT=
46+
47+
# Ignore AIS from Aids to Naviation (buoys, etc).
48+
# IGNORE_ATON=
49+
50+
51+
# PyTAK Configuration: https://pytak.rtfd.io/
52+
# Change values here, and restart with: sudo systemctl restart aiscot
53+
54+
# Sets TAK Protocol to use for CoT output.
55+
# TAK_PROTO=0
56+
57+
# Sets debug-level logging. Any value other than 0 is considered True. False if unset.
58+
# DEBUG=
59+
60+
# TAK Data Packages containing TAK Server connection settings, TLS certificates, etc.
61+
# PREF_PACKAGE=
62+
63+
# Path to a file containing the unencrypted plain-text PEM format Client Certificate.
64+
# This file can contain both the Client Cert & Client Key, or the Client Cert alone.
65+
# In the later case (cert alone), PYTAK_TLS_CLIENT_KEY must be set to the Client Key.
66+
# PYTAK_TLS_CLIENT_CERT=
67+
68+
# Path to a file containing the unencrypted plain-text PEM format Client Private Key
69+
# for the associated PYTAK_TLS_CLIENT_CERT.
70+
# PYTAK_TLS_CLIENT_KEY=
71+
72+
# Password for password protected certificates or password protected Private Keys.
73+
# PYTAK_TLS_CLIENT_PASSWORD=
74+
75+
# Disable destination TLS Certificate Verification.
76+
# PYTAK_TLS_DONT_VERIFY=
77+
78+
# Disable destination TLS Certificate Common Name (CN) Verification.
79+
# PYTAK_TLS_DONT_CHECK_HOSTNAME=
80+
81+
# File containing the CA Trust Store to use for remote certificate verification.
82+
# PYTAK_TLS_CLIENT_CAFILE=
83+
84+
# Expected hostname or CN of the connected server. Not used unless verifying hostname.
85+
# PYTAK_TLS_SERVER_EXPECTED_HOSTNAME=
86+

debian/adsbcot.postinst

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
# adsbcot.postinst from https://github.com/snstac/adsbcot
3+
#
4+
# Copyright Sensors & Signals LLC https://www.snstac.com
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
echo "adsbcot Post Install"
20+
21+
# shellcheck source=adsbcot.conf
22+
[ -f "/etc/default/adsbcot" ] && . /etc/default/adsbcot
23+
24+
# Sane defaults:
25+
[ -z "$SERVER_HOME" ] && SERVER_HOME=/run/adsbcot
26+
[ -z "$SERVER_USER" ] && SERVER_USER=adsbcot
27+
[ -z "$SERVER_NAME" ] && SERVER_NAME="ADS-B to TAK Gateway System User"
28+
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=adsbcot
29+
30+
# Groups that the user will be added to, if undefined, then none.
31+
ADDGROUP=""
32+
33+
# create user to avoid running server as root
34+
# 1. create group if not existing
35+
if ! getent group | grep -q "^$SERVER_GROUP:" ; then
36+
echo -n "Adding group $SERVER_GROUP.."
37+
addgroup --quiet --system "$SERVER_GROUP" 2>/dev/null ||true
38+
echo "..done"
39+
fi
40+
# 2. create homedir if not existing
41+
test -d "$SERVER_HOME" || mkdir "$SERVER_HOME"
42+
# 3. create user if not existing
43+
if ! getent passwd | grep -q "^$SERVER_USER:"; then
44+
echo -n "Adding system user $SERVER_USER.."
45+
adduser --quiet \
46+
--system \
47+
--ingroup "$SERVER_GROUP" \
48+
--no-create-home \
49+
--disabled-password \
50+
"$SERVER_USER" 2>/dev/null || true
51+
echo "..done"
52+
fi
53+
# 4. adjust passwd entry
54+
usermod -c "$SERVER_NAME" \
55+
-d "$SERVER_HOME" \
56+
-g "$SERVER_GROUP" \
57+
"$SERVER_USER"
58+
# 5. adjust file and directory permissions
59+
if ! dpkg-statoverride --list "$SERVER_HOME" >/dev/null
60+
then
61+
chown -R "$SERVER_USER":adm "$SERVER_HOME"
62+
chmod u=rwx,g=rxs,o= "$SERVER_HOME"
63+
fi
64+
# 6. Add the user to the ADDGROUP group
65+
if test -n "$ADDGROUP"
66+
then
67+
if ! groups "$SERVER_USER" | cut -d: -f2 | \
68+
grep -qw "$ADDGROUP"; then
69+
adduser "$SERVER_USER" "$ADDGROUP"
70+
fi
71+
fi
72+
73+
systemctl enable adsbcot.service
74+
75+
echo "---- adsbcot Install Complete ----"
76+
echo "Documentation: https://adsbcot.rtfd.io/"
77+
echo "Configure: sudo nano /etc/default/adsbcot"
78+
echo "Start: sudo systemctl start adsbcot.service"
79+
echo "Logs: sudo journalctl -fu adsbcot"
80+
81+
exit 0

0 commit comments

Comments
 (0)