-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
269 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,4 @@ __pycache__ | |
known_craft.csv | ||
.mypy_cache/ | ||
.pytest_cache/config.ini | ||
config.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# dronecot.conf from https://github.com/snstac/dronecot | ||
# | ||
# Debian specific runtime configuration for dronecot. | ||
# | ||
# Copyright Sensors & Signals LLC https://www.snstac.com | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# DroneCOT Configuration: https://dronecot.rtfd.io/ | ||
# Change values here, and restart with: sudo systemctl restart dronecot | ||
|
||
# Enable or Disable the dronecot software daemon. | ||
# ENABLED=1 | ||
|
||
# URL to CoT destination. Must be a URL, e.g. tcp://1.2.3.4:1234 or tls://...:1234, etc. | ||
# COT_URL=udp+wo://239.2.3.1:6969 | ||
|
||
# CoT Stale period ("timeout"), in seconds. | ||
# COT_STALE=3600 | ||
|
||
# Override COT Event Type ("marker type"). | ||
# COT_TYPE=a-u-S-X-M | ||
|
||
|
||
|
||
# PyTAK Configuration: https://pytak.rtfd.io/ | ||
# Change values here, and restart with: sudo systemctl restart aiscot | ||
|
||
# Sets TAK Protocol to use for CoT output. | ||
# TAK_PROTO=0 | ||
|
||
# Sets debug-level logging. Any value other than 0 is considered True. False if unset. | ||
# DEBUG= | ||
|
||
# TAK Data Packages containing TAK Server connection settings, TLS certificates, etc. | ||
# PREF_PACKAGE= | ||
|
||
# Path to a file containing the unencrypted plain-text PEM format Client Certificate. | ||
# This file can contain both the Client Cert & Client Key, or the Client Cert alone. | ||
# In the later case (cert alone), PYTAK_TLS_CLIENT_KEY must be set to the Client Key. | ||
# PYTAK_TLS_CLIENT_CERT= | ||
|
||
# Path to a file containing the unencrypted plain-text PEM format Client Private Key | ||
# for the associated PYTAK_TLS_CLIENT_CERT. | ||
# PYTAK_TLS_CLIENT_KEY= | ||
|
||
# Password for password protected certificates or password protected Private Keys. | ||
# PYTAK_TLS_CLIENT_PASSWORD= | ||
|
||
# Disable destination TLS Certificate Verification. | ||
# PYTAK_TLS_DONT_VERIFY= | ||
|
||
# Disable destination TLS Certificate Common Name (CN) Verification. | ||
# PYTAK_TLS_DONT_CHECK_HOSTNAME= | ||
|
||
# File containing the CA Trust Store to use for remote certificate verification. | ||
# PYTAK_TLS_CLIENT_CAFILE= | ||
|
||
# Expected hostname or CN of the connected server. Not used unless verifying hostname. | ||
# PYTAK_TLS_SERVER_EXPECTED_HOSTNAME= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
# dronecot.postinst from https://github.com/snstac/dronecot | ||
# | ||
# Copyright Sensors & Signals LLC https://www.snstac.com | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
echo "dronecot Post Install" | ||
|
||
# shellcheck source=dronecot.conf | ||
[ -f "/etc/default/dronecot" ] && . /etc/default/dronecot | ||
|
||
# Sane defaults: | ||
[ -z "$SERVER_HOME" ] && SERVER_HOME=/run/dronecot | ||
[ -z "$SERVER_USER" ] && SERVER_USER=dronecot | ||
[ -z "$SERVER_NAME" ] && SERVER_NAME="Remote ID to TAK Gateway System User" | ||
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=dronecot | ||
|
||
# Groups that the user will be added to, if undefined, then none. | ||
ADDGROUP="" | ||
|
||
# create user to avoid running server as root | ||
# 1. create group if not existing | ||
if ! getent group | grep -q "^$SERVER_GROUP:" ; then | ||
echo -n "Adding group $SERVER_GROUP.." | ||
addgroup --quiet --system "$SERVER_GROUP" 2>/dev/null ||true | ||
echo "..done" | ||
fi | ||
# 2. create homedir if not existing | ||
test -d "$SERVER_HOME" || mkdir "$SERVER_HOME" | ||
# 3. create user if not existing | ||
if ! getent passwd | grep -q "^$SERVER_USER:"; then | ||
echo -n "Adding system user $SERVER_USER.." | ||
adduser --quiet \ | ||
--system \ | ||
--ingroup "$SERVER_GROUP" \ | ||
--no-create-home \ | ||
--disabled-password \ | ||
"$SERVER_USER" 2>/dev/null || true | ||
echo "..done" | ||
fi | ||
# 4. adjust passwd entry | ||
usermod -c "$SERVER_NAME" \ | ||
-d "$SERVER_HOME" \ | ||
-g "$SERVER_GROUP" \ | ||
"$SERVER_USER" | ||
# 5. adjust file and directory permissions | ||
if ! dpkg-statoverride --list "$SERVER_HOME" >/dev/null | ||
then | ||
chown -R "$SERVER_USER":adm "$SERVER_HOME" | ||
chmod u=rwx,g=rxs,o= "$SERVER_HOME" | ||
fi | ||
# 6. Add the user to the ADDGROUP group | ||
if test -n "$ADDGROUP" | ||
then | ||
if ! groups "$SERVER_USER" | cut -d: -f2 | \ | ||
grep -qw "$ADDGROUP"; then | ||
adduser "$SERVER_USER" "$ADDGROUP" | ||
fi | ||
fi | ||
|
||
systemctl enable dronecot.service | ||
|
||
echo "---- dronecot Install Complete ----" | ||
echo "Documentation: https://dronecot.rtfd.io/" | ||
echo "Configure: sudo nano /etc/default/dronecot" | ||
echo "Start: sudo systemctl start dronecot.service" | ||
echo "Logs: sudo journalctl -fu dronecot" | ||
|
||
exit 0 |
Oops, something went wrong.