mirror of
https://github.com/sdr-enthusiasts/docker-planefence.git
synced 2025-12-22 11:17:06 +00:00
@@ -18,7 +18,7 @@ If you think that we included parts of your software but we didn't attribute you
|
||||
|
||||
- Many thanks to @Wiedehopf, @Mikenye and @fredclausen for all of their coding advice and troubleshooting. Without them the learning curve would have been much steeper!
|
||||
|
||||
- Especially @Wiedehopf who spent many hours optimizing PlaneFence and Plane-Alert for speed, which resulting in a 90% reduction of runtime! He also helped with timezone conversion when upgrading from Python2 to Python3
|
||||
- Especially @Wiedehopf who spent many hours optimizing Planefence and Plane-Alert for speed, which resulting in a 90% reduction of runtime! He also helped with timezone conversion when upgrading from Python2 to Python3
|
||||
|
||||
- Sorttable.js is Copyright (c) 2013 Tyler Uebele. Released under the MIT license. See included LICENSE.txt or http://opensource.org/licenses/MIT.
|
||||
The latest version is available at https://github.com/tyleruebele/sort-table
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Send a Mastodon Post for each new plane in PlaneFence
|
||||
# Send a Mastodon Post for each new plane in Planefence
|
||||
|
||||
- [Send a Mastodon Post for each new plane in PlaneFence](#send-a-mastodon-post-for-each-new-plane-in-planefence)
|
||||
- [Send a Mastodon Post for each new plane in Planefence](#send-a-mastodon-post-for-each-new-plane-in-planefence)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Signing up for a Mastodon Account and creating an Application](#signing-up-for-a-mastodon-account-and-creating-an-application)
|
||||
- [Configuring Planefence to use Mastodon](#configuring-planefence-to-use-mastodon)
|
||||
@@ -13,7 +13,7 @@ This utility enables sending Mastodon posts of new events. Ever since Twitter st
|
||||
There are two major parts to install this. Each of these parts is described below.
|
||||
|
||||
- You must have a Mastodon account and create an Application in it.
|
||||
- You must follow the instructions below to configure PlaneFence to use the credentials that Mastodon provides you during this sign-up process.
|
||||
- You must follow the instructions below to configure Planefence to use the credentials that Mastodon provides you during this sign-up process.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -61,7 +61,7 @@ MASTODON_RETENTION_TIME=7
|
||||
```
|
||||
|
||||
- Replace the values with the applicable server name and access token.
|
||||
- If `PF_MASTODON` is not set to `ON`, then no PlaneFence Mastodon notifications will be sent.
|
||||
- If `PF_MASTODON` is not set to `ON`, then no Planefence Mastodon notifications will be sent.
|
||||
- If `PA_MASTODON` is not set to `ON`, then no Plane-Alert Mastodon notifications will be sent.
|
||||
- `Px_MASTODON_VISIBILITY` can be `public` (visible in everyone's feed), `unlisted` (only visible on your profile page), or `private` (invisible to anyone except for you).
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Send a message to Discord for each new plane in PlaneFence
|
||||
# Send a message to Discord for each new plane in Planefence
|
||||
|
||||
Setting up Discord notifications involves only two simple steps:
|
||||
|
||||
- Create a Webhook
|
||||
- Configure PlaneFence
|
||||
- Configure Planefence
|
||||
|
||||
We'll go into the details of each step below.
|
||||
|
||||
## Table of Contents
|
||||
- [Send a message to Discord for each new plane in PlaneFence](#send-a-message-to-discord-for-each-new-plane-in-planefence)
|
||||
- [Send a message to Discord for each new plane in Planefence](#send-a-message-to-discord-for-each-new-plane-in-planefence)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Creating a Webhook URL](#creating-a-webhook-url)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Send a Tweet for each new plane in PlaneFence
|
||||
# Send a Tweet for each new plane in Planefence
|
||||
|
||||
- [Send a Tweet for each new plane in PlaneFence](#send-a-tweet-for-each-new-plane-in-planefence)
|
||||
- [Send a Tweet for each new plane in Planefence](#send-a-tweet-for-each-new-plane-in-planefence)
|
||||
- [TWEETING DISCONTINUED, SWITCH TO MASTODON OR DISCORD](#tweeting-discontinued-switch-to-mastodon-or-discord)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Signing up for a Twitter Development Account and getting Twitter Credentials](#signing-up-for-a-twitter-development-account-and-getting-twitter-credentials)
|
||||
@@ -19,12 +19,12 @@ Instead, consider notifications to Mastodon or Discord. Instructions to set thes
|
||||
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
This utility enables tweeting of new events. It consists of a BASH shell script that monitors today's planes as written by PlaneFence, and sends out a tweet for every new plane using [Twurl](https://github.com/twitter/twurl).
|
||||
This utility enables tweeting of new events. It consists of a BASH shell script that monitors today's planes as written by Planefence, and sends out a tweet for every new plane using [Twurl](https://github.com/twitter/twurl).
|
||||
|
||||
There are two major parts to install this. Each of these parts is described below.
|
||||
|
||||
- You must apply for your own Twitter Developer Account and create an app.
|
||||
- You must follow the instructions below to configure PlaneFence to use the credentials that Twitter provides you during this sign-up process.
|
||||
- You must follow the instructions below to configure Planefence to use the credentials that Twitter provides you during this sign-up process.
|
||||
|
||||
## Prerequisites
|
||||
This is part of the [kx1t/docker-planefence] docker container. Nothing in this document will make sense outside the context of this container.
|
||||
@@ -38,20 +38,20 @@ You'll need a registered Twitter application. If you've never registered a Twitt
|
||||
- Go to https://developer.twitter.com/en/apps and sign in to your Twitter account. Click "Create an app".
|
||||
|
||||
- If you've previously registered a Twitter application, it should be listed at https://apps.twitter.com/.
|
||||
- Once you've registered an application, make sure to set your application's Access Level to "Read, Write and Access Direct Messages". If you don't, PlaneFence's tweets *will* fail.
|
||||
- Once you've registered an application, make sure to set your application's Access Level to "Read, Write and Access Direct Messages". If you don't, Planefence's tweets *will* fail.
|
||||
|
||||
- A mobile phone number must be associated with your account in order to obtain write privileges. If your carrier is not supported by Twitter and you are unable to add a number, contact Twitter using https://support.twitter.com/forms/platform, selecting the last checkbox. Some users have reported success adding their number using the mobile site, https://mobile.twitter.com/settings, which seems to bypass the carrier check at the moment.
|
||||
|
||||
- Copy your `Consumer API keys` to a secure spot. Don't lose them - you will need them in the next step.
|
||||
|
||||
Now, you're ready to authorize PlaneFence to send out tweets. Give the following command from the host machine's command line, while PlaneFence is running and follow the instructions:
|
||||
Now, you're ready to authorize Planefence to send out tweets. Give the following command from the host machine's command line, while Planefence is running and follow the instructions:
|
||||
```
|
||||
docker exec -it planefence /root/config_tweeting.sh
|
||||
```
|
||||
|
||||
- Last, don't forget to edit `planefence.config` and set `PF_TWEET=ON`. Note -- this parameter ONLY concerns general PlaneFence tweeting and doesn't affect Plane-Alert tweeting (see below).
|
||||
- Last, don't forget to edit `planefence.config` and set `PF_TWEET=ON`. Note -- this parameter ONLY concerns general Planefence tweeting and doesn't affect Plane-Alert tweeting (see below).
|
||||
|
||||
- If you also want Plane-Alert to send Twitter DM's, please read the instructions in `planefence.config` on how to enable this. Configuring Twitter as described above is a prerequisite for Plane-Alert tweets to work, however if you don't want to send any general PlaneFence tweets, you can leave `PF_TWEET=OFF`
|
||||
- If you also want Plane-Alert to send Twitter DM's, please read the instructions in `planefence.config` on how to enable this. Configuring Twitter as described above is a prerequisite for Plane-Alert tweets to work, however if you don't want to send any general Planefence tweets, you can leave `PF_TWEET=OFF`
|
||||
|
||||
# Summary of License Terms
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
12
README.md
12
README.md
@@ -3,7 +3,7 @@
|
||||
- [Docker-Planefence](#docker-planefence)
|
||||
- [What is it?](#what-is-it)
|
||||
- [Who is it for?](#who-is-it-for)
|
||||
- [Install PlaneFence - Prerequisites](#install-planefence---prerequisites)
|
||||
- [Install Planefence - Prerequisites](#install-planefence---prerequisites)
|
||||
- [Getting ready](#getting-ready)
|
||||
- [Planefence Configuration](#planefence-configuration)
|
||||
- [Initial docker configuration](#initial-docker-configuration)
|
||||
@@ -44,14 +44,14 @@ Here are some assumptions or prerequisites:
|
||||
- You use `docker compose`. This README has been written assuming `docker compose`. If you don't have it, feel free to `apt-get install` it. It should be easy to convert the `docker-compose.yml` instructions to a command-line `docker run` string, but you are on your own to do this.
|
||||
- Further support is provided at the #planefence channel at the [SDR Enthusiasts Discord Server](https://discord.gg/VDT25xNZzV). If you need immediate help, please tag "@k1xt" to your message.
|
||||
|
||||
## Install PlaneFence - Prerequisites
|
||||
## Install Planefence - Prerequisites
|
||||
|
||||
Note - this guide assumes that `/home/pi` is your home directory. If it is not (for example, Ubuntu builds use `/home/ubuntu` as their default account), please change all mentions of `/home/pi` to the applicable home directory path.
|
||||
|
||||
There must already be an instance of `ultrafeeder`, `tar1090`, `dump1090[-fa]`, or `readsb` connected to a SDR somewhere in reach of your Planefence machine:
|
||||
|
||||
- This could be in the same stack of containers, separately on the same machine, or even on another machine.
|
||||
- It is important to enable SBS data on port 30003 on that instance. PlaneFence will use this to get its data. See the [Troubleshooting](#troubleshooting) section for help to get this done.
|
||||
- It is important to enable SBS data on port 30003 on that instance. Planefence will use this to get its data. See the [Troubleshooting](#troubleshooting) section for help to get this done.
|
||||
|
||||
### Getting ready
|
||||
|
||||
@@ -81,7 +81,7 @@ In the `docker-compose.yml` file, you should configure the following:
|
||||
- After you start the container for the first time, it will create a few directories with setup files. You MUST edit these setup files before things will work!
|
||||
- MANDATORY: First -- copy the template config file in place: `sudo cp /opt/adsb/planefence/config/planefence.config-RENAME-and-EDIT-me /opt/adsb/planefence/config/planefence.config`
|
||||
- MANDATORY: `sudo nano /opt/adsb/planefence/config/planefence.config` Go through all parameters - their function is explained in this file. Edit to your liking and save/exit using `ctrl-x`. THIS IS THE MOST IMPORTANT AND MANDATORY CONFIG FILE TO EDIT !!!
|
||||
- OPTIONAL: `sudo nano /opt/adsb/planefence/config/planefence-ignore.txt`. In this file, you can add aircraft that PlaneFence will ignore. If there are specific planes that fly too often over your home, add them here. Use 1 line per entry, and the entry can be a ICAO, flight number, etc. You can even use regular expressions if you want. Be careful -- we use this file as an input to a "grep" filter. If you put something that is broad (`.*` for example), then ALL PLANES will be filtered out.
|
||||
- OPTIONAL: `sudo nano /opt/adsb/planefence/config/planefence-ignore.txt`. In this file, you can add aircraft that Planefence will ignore. If there are specific planes that fly too often over your home, add them here. Use 1 line per entry, and the entry can be a ICAO, flight number, etc. You can even use regular expressions if you want. Be careful -- we use this file as an input to a "grep" filter. If you put something that is broad (`.*` for example), then ALL PLANES will be filtered out.
|
||||
- OPTIONAL: `sudo nano /opt/adsb/planefence/config/airlinecodes.txt`. This file maps the first 3 characters of the flight number to the names of the airlines. We scraped this list from a Wikipedia page, and it is by no means complete. Feel free to add more to them -- please add an issue at <https://github.com/sdr-enthusiasts/docker-planefence/issues> so we can add your changes to the default file.
|
||||
- OPTIONAL: `sudo nano /opt/adsb/planefence/config/plane-alert-db.txt`. This is the list of tracking aircraft of Plane-Alert. It is prefilled with the planes of a number of "interesting" political players. Feel free to add your own, delete what you don't want to see, etc. Just follow the same format.
|
||||
- OPTIONAL: If you have multiple containers running on different web port, and you would like to consolidate them all under a single host name, then you should consider installing a "reverse web proxy". This can be done quickly and easily - see instructions [here](https://github.com/sdr-enthusiasts/docker-planefence/blob/main/README-nginx-rev-proxy.md).
|
||||
@@ -133,7 +133,7 @@ Also note that after adding exclusions, any pre-existing entries for those exclu
|
||||
|
||||
### Introduction
|
||||
|
||||
Planefence and Plane-Alert keep a limited amount of data available. By default, PlaneFence keeps 2 weeks of data around, while Plane-Alert isn't time limited. This data is accessible using a REST interface that makes use of HTTP GET. You can access this API from the directory where your Planefence or Plane-Alert web pages are deployed. For example:
|
||||
Planefence and Plane-Alert keep a limited amount of data available. By default, Planefence keeps 2 weeks of data around, while Plane-Alert isn't time limited. This data is accessible using a REST interface that makes use of HTTP GET. You can access this API from the directory where your Planefence or Plane-Alert web pages are deployed. For example:
|
||||
|
||||
- If Planefence is available at <https://planefence.com/planefence>, then you can reach the Planefence API at <https://planefence.com/planefence/pf-query.php>
|
||||
- If Plane-Alert is available at <https://planefence.com/plane-alert>, then you can reach the Plane-Alert API at <https://planefence.com/plane-alert/pa-query.php>
|
||||
@@ -168,7 +168,7 @@ Note that the `call` parameter (see below) will start with `@` followed by the c
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Be patient. Some of the files won't get initialized until the first "event" happens: a plane is in PlaneFence range or is detected by Plane-Alert. This includes the planes table and the heatmap.
|
||||
- Be patient. Some of the files won't get initialized until the first "event" happens: a plane is in Planefence range or is detected by Plane-Alert. This includes the planes table and the heatmap.
|
||||
- If your system doesn't behave as expected: check, check, double-check. Did you configure the correct container in `docker-compose.yml`? Did you edit the `planefence.config` file?
|
||||
- Check the logs: `docker logs -f planefence`. Some "complaining" about lost connections or files not found is normal, and will correct itself after a few minutes of operation. The logs will be quite explicit if it wants you to take action
|
||||
- Check the website: <http://myip:8088> should update every 80 seconds (starting about 80 seconds after the initial startup). The top of the website shows a last-updated time and the number of messages received from the feeder station.
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
#!/command/with-contenv bash
|
||||
#shellcheck shell=bash disable=SC1091,SC2015,SC2154
|
||||
|
||||
source /scripts/common
|
||||
|
||||
LOOPTIME=$(sed -n 's/\(^\s*PF_INTERVAL=\)\(.*\)/\2/p' /usr/share/planefence/persist/planefence.config)
|
||||
LOOPTIME="${LOOPTIME:-60}"
|
||||
|
||||
PLANEFENCEDIR=/usr/share/planefence
|
||||
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Planefence started as an s6 service" || true
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Planefence build: $(grep 'PF_NAME' /usr/share/planefence/persist/planefence.config | awk -F '=' '{ print $2 }' | tr -dc '[:alnum:]')_bld_$([[ -f /usr/share/planefence/branch ]] && cat /usr/share/planefence/branch || cat /root/.buildtime)" || true
|
||||
# -----------------------------------------------------------------------------------
|
||||
# Copyright 2020-2025 Ramon F. Kolb - licensed under the terms and conditions
|
||||
# of GPLv3. The terms and conditions of this license are included with the Github
|
||||
@@ -20,44 +11,57 @@ PLANEFENCEDIR=/usr/share/planefence
|
||||
# Dump1090.Socket30003 by Ted Sluis: https://github.com/tedsluis/dump1090.socket30003
|
||||
# These packages may incorporate other software and license terms.
|
||||
#
|
||||
# Programmers note: when using sed for URLs or file names, make sure NOT to use '/'
|
||||
# as command separator, but use something else instead, for example '|'
|
||||
#
|
||||
# -----------------------------------------------------------------------------------
|
||||
#
|
||||
# We moved the initialization sequence to /usr/share/planefence/prep-planefence.sh
|
||||
# because then we can re-run the sequence if we detect changes to the config file
|
||||
# Also, this time needs to be sourced otherwise it won't pick up $LOOPTIME as variables
|
||||
# can't be exported back to parent processes.
|
||||
|
||||
source /scripts/common
|
||||
|
||||
LOOPTIME=$(sed -n 's/\(^\s*PF_INTERVAL=\)\(.*\)/\2/p' /usr/share/planefence/persist/planefence.config)
|
||||
LOOPTIME="${LOOPTIME:-60}"
|
||||
|
||||
PLANEFENCEDIR=/usr/share/planefence
|
||||
|
||||
if [[ "$LOGLEVEL" != "ERROR" ]]; then
|
||||
"${s6wrap[@]}" echo "Planefence started as an s6 service"
|
||||
"${s6wrap[@]}" echo "Planefence build: $(grep 'PF_NAME' /usr/share/planefence/persist/planefence.config | awk -F '=' '{ print $2 }' | tr -dc '[:alnum:]')_bld_$([[ -f /usr/share/planefence/branch ]] && cat /usr/share/planefence/branch || cat /root/.buildtime)"
|
||||
fi
|
||||
|
||||
source /usr/share/planefence/prep-planefence.sh
|
||||
#--------------------------------------------------------------------------------
|
||||
# Now loop forever, after waiting for 1 cycle. The wait is so socket30003 can actually collect some data before we try to call Planefence
|
||||
# We are randomizing the initial looptime in case there are multiple Planefence instances running. That way the load will be spread out a bit
|
||||
#
|
||||
#
|
||||
#
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Planefence is deployed and will be starting in $LOOPTIME..." || "${s6wrap[@]}" echo "Planefence is deployed. Note that LOGLEVEL is set to \"ERROR\". Only failures and error messages will be written to the Docker Logs." || true
|
||||
sleep "$LOOPTIME"
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Planefence starting its initial run now" || true
|
||||
initial_looptime="$(( RANDOM % (LOOPTIME*2) ))"
|
||||
|
||||
if [[ "$LOGLEVEL" != "ERROR" ]]; then
|
||||
"${s6wrap[@]}" echo "Planefence is deployed and will first run at $(date -d "+$initial_looptime secs" +"%F %T %Z") (in $initial_looptime secs)"
|
||||
else
|
||||
"${s6wrap[@]}" echo "Planefence is deployed. Note that LOGLEVEL is set to \"ERROR\". Only failures and error messages will be written to the Docker Logs."
|
||||
fi
|
||||
sleep "$initial_looptime"
|
||||
if [[ "$LOGLEVEL" != "ERROR" ]]; then "${s6wrap[@]}" echo "Planefence starting its initial run now"; fi
|
||||
|
||||
while true
|
||||
do
|
||||
LOOPTIME=$(sed -n 's/\(^\s*PF_INTERVAL=\)\(.*\)/\2/p' /usr/share/planefence/persist/planefence.config)
|
||||
[[ "$LOOPTIME" == "" ]] && LOOPTIME=60
|
||||
sleep "$LOOPTIME" &
|
||||
if [[ $(find /run/socket30003/ -name "dump1090-*-$(date +%y%m%d).txt") ]]
|
||||
then
|
||||
starttime=$(date +%s)
|
||||
# BASETIME is used for run time measurements
|
||||
# shellcheck disable=SC2155
|
||||
if [[ -n "$TIMING" ]]; then export BASETIME=$(date +%s.%2N); else unset BASETIME; fi
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Starting Planefence run..." || true
|
||||
$PLANEFENCEDIR/planefence.sh
|
||||
endtime=$(date +%s)
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Planefence ran for $((endtime - starttime)) secs and will be running again at $(date -d @$(( starttime + LOOPTIME )) +"%Y/%m/%d %H:%M:%S")." || true
|
||||
else
|
||||
"${s6wrap[@]}" echo "/run/socket30003/dump1090-*-(date +%y%m%d).txt not found."
|
||||
"${s6wrap[@]}" echo "If this continues to happen after 5-10 minutes, check this:"
|
||||
"${s6wrap[@]}" echo "Is \"socket30003\" running? Is your feeder producing data?"
|
||||
if [[ $(find /run/socket30003/ -name "dump1090-*-$(date +%y%m%d).txt") ]] && [[ -f /run/socket30003.up ]]; then
|
||||
starttime=$(date +%s)
|
||||
# BASETIME is used for run time measurements
|
||||
# shellcheck disable=SC2155
|
||||
if [[ -n "$TIMING" ]]; then export BASETIME=$(date +%s.%2N); else unset BASETIME; fi
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Starting Planefence run..." || true
|
||||
$PLANEFENCEDIR/planefence.sh
|
||||
endtime=$(date +%s)
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Planefence ran for $((endtime - starttime)) secs and will be running again at $(date -d @$(( starttime + LOOPTIME )) +"%F %T %Z")." || true
|
||||
else
|
||||
"${s6wrap[@]}" echo "/run/socket30003/dump1090-*-(date +%y%m%d).txt not found or socket30003 not running."
|
||||
"${s6wrap[@]}" echo "If this continues to happen after 5-10 minutes, check your \$PF_SOCK30003HOST setting and check your data source"
|
||||
"${s6wrap[@]}" echo "We will try again at $(date -d @$(( starttime + LOOPTIME )) +"%F %T %Z")."
|
||||
fi
|
||||
# [ -z "$TESTTIME" ] && LOOPTIME="$TESTTIME" # debug code
|
||||
wait
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
#!/command/with-contenv bash
|
||||
#shellcheck shell=bash
|
||||
#shellcheck shell=bash disable=SC1091,SC2154,SC2015
|
||||
|
||||
# redirect stderr to stdout so it's picked up in the docker logs
|
||||
exec 2>&1
|
||||
# all errors will show a line number and the command used to produce the error
|
||||
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd)/$(basename "$0")"
|
||||
trap 'echo -e "[ERROR] $SCRIPT_PATH in line $LINENO when executing: $BASH_COMMAND"' ERR
|
||||
source /scripts/common
|
||||
|
||||
APPNAME="$(hostname)/socket30003"
|
||||
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && echo "[$APPNAME][$(date)] Socket30003 started as an s6 service" || true
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Socket30003 started as an s6 service" || true
|
||||
|
||||
# -----------------------------------------------------------------------------------
|
||||
# Copyright 2020-2025 Ramon F. Kolb - licensed under the terms and conditions
|
||||
@@ -32,7 +27,7 @@ mkdir -p /run/socket30003
|
||||
# If things went wrong then simply sleep forever.
|
||||
# No need to notify -- .../run/planefence is doing the same thing and is
|
||||
# screaming all over the logs by now.
|
||||
if [[ "x$FEEDER_LAT" == "x" ]] || [[ "$FEEDER_LAT" == "90.12345" ]]
|
||||
if [[ -z "$FEEDER_LAT" ]] || [[ "$FEEDER_LAT" == "90.12345" ]]
|
||||
then
|
||||
sleep infinity
|
||||
fi
|
||||
@@ -63,42 +58,47 @@ then
|
||||
else
|
||||
sed -i 's/\(^\s*speedunit=\).*/\1knotph/' /usr/share/socket30003/socket30003.cfg
|
||||
fi
|
||||
[[ "x$PF_SOCK30003PORT" == "x" ]] && PF_SOCK30003PORT=30003 || true
|
||||
|
||||
PF_SOCK30003PORT="${PF_SOCK30003PORT:-30003}"
|
||||
sed -i 's|\(^\s*PEER_PORT=\).*|\1'"$PF_SOCK30003PORT"'|' /usr/share/socket30003/socket30003.cfg
|
||||
|
||||
# -----------------------------------------------------------------------------------
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
# Now start dump1090.socket30003 in a loop that restarts it $LOOPTIME seconds after it exits or crashes:
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && echo "[$APPNAME][$(date)] socket30003 starting its initial run now" || true
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "socket30003 starting its initial run now" || true
|
||||
while true
|
||||
do
|
||||
|
||||
# First make sure that $PF_SOCK30003HOST is defined
|
||||
if [[ "x$PF_SOCK30003HOST" == "x" ]]
|
||||
if [[ -z "$PF_SOCK30003HOST" ]]
|
||||
then
|
||||
echo "[$APPNAME][$(date)] \$PF_SOCK30003HOST is not set in the .env or docker-compose.yml file. Cannot run! Please update and restart the container."
|
||||
"${s6wrap[@]}" echo "\$PF_SOCK30003HOST is not set in the .env or docker-compose.yml file. Cannot run! Please update and restart the container."
|
||||
else
|
||||
# if $PF_SOCK30003HOST is defined, then check if we can reach it. Execute socket30003 if we can reach it, complain if we can't
|
||||
# we do this inside this endless loop so it will show in the logs regularly
|
||||
if timeout --preserve-status 5 netcat -z -v $PF_SOCK30003HOST $PF_SOCK30003PORT >/dev/null 2>&1
|
||||
if timeout --preserve-status 5 netcat -z -v "$PF_SOCK30003HOST" "$PF_SOCK30003PORT" >/dev/null 2>&1
|
||||
then
|
||||
sleep .4 # delay startup a little bit as to not interrupt file pruning
|
||||
echo "[$APPNAME][$(date)] socket30003 starting up."
|
||||
/usr/share/socket30003/socket30003.pl >/dev/null 2>&1 && [[ ! -f /tmp/socket-cleanup ]] && echo "[$APPNAME][$(date)] /usr/share/socket30003/socket30003.pl exited with code $?"
|
||||
"${s6wrap[@]}" echo "socket30003 starting up."
|
||||
touch /run/socket30003.up
|
||||
/usr/share/socket30003/socket30003.pl >/dev/null 2>&1
|
||||
exitcode="$?"
|
||||
if [[ ! -f /tmp/socket-cleanup ]]; then "${s6wrap[@]}" echo "/usr/share/socket30003/socket30003.pl exited with code $exitcode"; fi
|
||||
rm -f /run/socket30003.up
|
||||
else
|
||||
echo "[$APPNAME][$(date)] We cannot reach \"$PF_SOCK30003HOST\" on port $PF_SOCK30003PORT."
|
||||
echo "[$APPNAME][$(date)] If this error keeps on repeating, please make sure that"
|
||||
echo "[$APPNAME][$(date)] readsb/dump1090[-fa]/tar1090 is running and producing SBS data on port $PF_SOCK30003PORT!"
|
||||
"${s6wrap[@]}" echo "We cannot reach \"$PF_SOCK30003HOST\" on port $PF_SOCK30003PORT."
|
||||
"${s6wrap[@]}" echo "If this error keeps on repeating, please make sure that"
|
||||
"${s6wrap[@]}" echo "readsb/dump1090[-fa]/ultrafeeder is running and producing SBS data on port $PF_SOCK30003PORT!"
|
||||
fi
|
||||
fi
|
||||
if [[ ! -f /tmp/socket-cleanup ]]
|
||||
then
|
||||
echo "[$APPNAME][$(date)] socket30003 has exited... restarting in $LOOPTIME"
|
||||
"${s6wrap[@]}" echo "socket30003 has exited... restarting in $LOOPTIME"
|
||||
sleep $LOOPTIME
|
||||
else
|
||||
sleep 1s
|
||||
rm -f /tmp/socket-cleanup
|
||||
fi
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && echo "[$APPNAME][$(date)] socket30003 restarting now" || true
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "socket30003 restarting now" || true
|
||||
done
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</section>
|
||||
|
||||
<div class="footer">
|
||||
<hr/>Plane-Alert is part of <a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank">KX1T's PlaneFence Open Source Project</a>, available on GitHub. Support is available on the #Planefence channel of the SDR Enthusiasts Discord Server. Click the Chat icon below to join.
|
||||
<hr/>Plane-Alert is part of <a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank">KX1T's Planefence Open Source Project</a>, available on GitHub. Support is available on the #Planefence channel of the SDR Enthusiasts Discord Server. Click the Chat icon below to join.
|
||||
<br/>© Copyright 2020-2025 by Ramón F. Kolb. Please see <a href="attribution.txt" target="_blank">here</a> for attributions to our contributors and open source packages used.
|
||||
<br/><img src="https://img.shields.io/github/actions/workflow/status/sdr-enthusiasts/docker-planefence/deploy.yml?branch=main">
|
||||
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/sdr-enthusiasts/docker-planefence">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# pf_php.sh -- Script to be called from PHP - returns REGEX subset of PlaneFence
|
||||
# pf_php.sh -- Script to be called from PHP - returns REGEX subset of Planefence
|
||||
#
|
||||
# Usage: pf_php.sh [hex=<regex>] [call=<regex>] [start=<regex>] [end=<regex>] file=<inputfiles>
|
||||
# File argument is always required and at least 1 additional argument is required.
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
SCREENSHOTURL="http://screenshot:5042"
|
||||
SCREENSHOT_TIMEOUT=45
|
||||
# ---------------------------------------------------------------------
|
||||
# PF_LINK is a URL that points from the Plane Alert web page to the PlaneFence webpage
|
||||
# PF_LINK is a URL that points from the Plane Alert web page to the Planefence webpage
|
||||
# If empty, it's omitted
|
||||
PF_LINK=
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
</tbody></table>
|
||||
|
||||
<div class="footer">
|
||||
<hr/>Plane-Alert version ##VERSION## is part of <a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank">KX1T's PlaneFence Open Source Project</a>, available under the GPLv3 license on <a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank">Github</a>. Support is available on the #Planefence channel of the SDR Enthusiasts Discord Server. Click the Chat icon below to join.
|
||||
<hr/>Plane-Alert version ##VERSION## is part of <a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank">KX1T's Planefence Open Source Project</a>, available under the GPLv3 license on <a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank">Github</a>. Support is available on the #Planefence channel of the SDR Enthusiasts Discord Server. Click the Chat icon below to join.
|
||||
<br/>Build: ##BUILD##. © Copyright 2020 - 2025 by Ramón F. Kolb, kx1t. Please see <a href="../attribution.txt" target="_blank">here</a> for attributions to our contributors and open source packages used.
|
||||
<br/><a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank"><img src="https://img.shields.io/github/actions/workflow/status/sdr-enthusiasts/docker-planefence/deploy.yml"></a>
|
||||
<a href="https://discord.gg/VDT25xNZzV"><img src="https://img.shields.io/discord/734090820684349521" alt="discord"></a>
|
||||
|
||||
@@ -17,7 +17,7 @@ echo "[$APPNAME][$(date)] Running config_tweeting"
|
||||
#
|
||||
# -----------------------------------------------------------------------------------
|
||||
|
||||
echo Configure Tweeting for PlaneFence
|
||||
echo Configure Tweeting for Planefence
|
||||
echo
|
||||
echo Prerequisite -- you should already have signed up for an Developer Account
|
||||
echo with Twitter, and created an application with Read/Write/Direct message
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# NOISE2FENCE -- a script for extracting recorded noise values from NOISECAPT
|
||||
# and adding them to CSV files that have been created by PlaneFence
|
||||
# and adding them to CSV files that have been created by Planefence
|
||||
#
|
||||
# Copyright 2020-2025 Ramon F. Kolb - licensed under the terms and conditions
|
||||
# of GPLv3. The terms and conditions of this license are included with the Github
|
||||
@@ -52,7 +52,7 @@ LOG ()
|
||||
}
|
||||
|
||||
if [ "$1" != "" ] && [ "$1" != "reset" ]
|
||||
then # $1 contains the date for which we want to run PlaneFence
|
||||
then # $1 contains the date for which we want to run Planefence
|
||||
NOISEDATE=$(date --date="$1" '+%y%m%d')
|
||||
else
|
||||
NOISEDATE=$(date --date="today" '+%y%m%d')
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# PF_ALERT - a Bash shell script to send a notification to the Notification Server when a plane is detected in the
|
||||
# user-defined fence area.
|
||||
#
|
||||
# This script is distributed as part of the PlaneFence package and is dependent
|
||||
# This script is distributed as part of the Planefence package and is dependent
|
||||
# on that package for its execution.
|
||||
#
|
||||
# Copyright 2020-2025 by Ramon F. Kolb (kx1t) - licensed under the terms and conditions
|
||||
@@ -210,7 +210,7 @@ if [[ -f "$CSVFILE" ]]; then
|
||||
LINK="$(twurl -r "status=$TWEET" /1.1/statuses/update.json 2>&1 | tee -a /tmp/tweets.log | jq '.entities."urls" | .[] | .url' | tr -d '\"')"
|
||||
fi
|
||||
|
||||
[[ "${LINK:0:12}" == "https://t.co" ]] && echo "PlaneFence Tweet generated successfully with content: $TWEET" || echo "PlaneFence Tweet error. Twitter returned: $(tail -1 /tmp/tweets.log)"
|
||||
[[ "${LINK:0:12}" == "https://t.co" ]] && echo "Planefence Tweet generated successfully with content: $TWEET" || echo "Planefence Tweet error. Twitter returned: $(tail -1 /tmp/tweets.log)"
|
||||
else
|
||||
LOG "(A tweet would have been sent but \$TWEETON=\"$TWEETON\")"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# pf_php.sh -- Script to be called from PHP - returns REGEX subset of PlaneFence
|
||||
# pf_php.sh -- Script to be called from PHP - returns REGEX subset of Planefence
|
||||
#
|
||||
# Usage: pf_php.sh [hex=<regex>] [call=<regex>] [start=<regex>] [end=<regex>] file=<inputfiles>
|
||||
# File argument is always required and at least 1 additional argument is required.
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
#shellcheck shell=bash
|
||||
#shellcheck disable=SC1091,SC2154
|
||||
# planefence-rss.sh
|
||||
# A script to generate RSS feeds from PlaneFence CSV files
|
||||
# A script to generate RSS feeds from Planefence CSV files
|
||||
#
|
||||
# Usage: ./planefence-rss.sh
|
||||
#
|
||||
# This script is distributed as part of the PlaneFence package and is dependent
|
||||
# This script is distributed as part of the Planefence package and is dependent
|
||||
# on that package for its execution.
|
||||
#
|
||||
# Based on a script provided by @randomrobbie - https://github.com/sdr-enthusiasts/docker-planefence/issues/211
|
||||
@@ -26,7 +26,7 @@ PLANEFENCEDIR=/usr/share/planefence
|
||||
FENCEDATE=$(date --date="today" '+%y%m%d')
|
||||
|
||||
# Site configuration - you can modify these
|
||||
SITE_TITLE="PlaneFence Aircraft Detections"
|
||||
SITE_TITLE="Planefence Aircraft Detections"
|
||||
SITE_DESC="Recent aircraft detected within range of our ADS-B receiver"
|
||||
SITE_LINK="${RSS_SITELINK}" # Replace with your actual URL
|
||||
SITE_IMAGE="${RSS_FAVICONLINK}" # Optional site image
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
# STRONGLY RECOMMENDED to RTFM! See explanation below and README.md for explanation of what these do.
|
||||
#
|
||||
#
|
||||
# The web directory you want PlaneFence to write to:
|
||||
# The web directory you want Planefence to write to:
|
||||
|
||||
OUTFILEDIR=/usr/share/planefence/html
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
#
|
||||
# Twitter handle for PlaneTweet. Comment this out if PlaneTweet is not available or disabled
|
||||
# NOTE - if this field is defined and not empty, PlaneFence WILL try to invoke PlaneTweet to send a tweet!
|
||||
# NOTE - if this field is defined and not empty, Planefence WILL try to invoke PlaneTweet to send a tweet!
|
||||
# By default it's disabled. If enabled, note that tweeting will ONLY work if you also follow the PlaneTweet
|
||||
# instructions for installation and set-up.
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
#
|
||||
# PlaneHeat is an add-on that gets installed by default. It tracks a daily heatmap for planes that fly inside the
|
||||
# PlaneFence coverage area. If you don't want to use it, set PLANEHEAT=OFF.
|
||||
# Planefence coverage area. If you don't want to use it, set PLANEHEAT=OFF.
|
||||
# Normally, you don't need to update this parameter unless you moved 'planeheat.sh' to some other location,
|
||||
# which we don't recommend doing unless you know which other files to move with it.
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
|
||||
TWEETEVERY=false
|
||||
|
||||
# PA_LINK is a URL that points from the PlaneFence web page to the Plane Alert webpage
|
||||
# PA_LINK is a URL that points from the Planefence web page to the Plane Alert webpage
|
||||
# If empty, it's omitted
|
||||
|
||||
PA_LINK=
|
||||
|
||||
@@ -34,7 +34,7 @@ source /scripts/common
|
||||
|
||||
# We need to define the directory where the config file is located:
|
||||
|
||||
[[ "$BASETIME" != "" ]] && echo "0. $(bc -l <<< "$(date +%s.%2N) - $BASETIME")s -- started PlaneFence" || true
|
||||
[[ "$BASETIME" != "" ]] && echo "0. $(bc -l <<< "$(date +%s.%2N) - $BASETIME")s -- started Planefence" || true
|
||||
|
||||
PLANEFENCEDIR=/usr/share/planefence
|
||||
|
||||
@@ -43,10 +43,10 @@ if [[ -f "/run/planefence/last-config-change" ]] && [[ -f "/usr/share/planefence
|
||||
# if... the date-last-changed of config file on the exposed volume ... is newer than the last time we read it ... then ... rerun the prep routine (which will update the last-config-change)
|
||||
[[ "$(stat -c %Y /usr/share/planefence/persist/planefence.config)" -gt "$(</run/planefence/last-config-change)" ]] && /usr/share/planefence/prep-planefence.sh
|
||||
fi
|
||||
# FENCEDATE will be the date [yymmdd] that we want to process PlaneFence for.
|
||||
# FENCEDATE will be the date [yymmdd] that we want to process Planefence for.
|
||||
# The default value is 'today'.
|
||||
|
||||
if [[ -n "$1" ]] && [[ "$1" != "reset" ]]; then # $1 contains the date for which we want to run PlaneFence
|
||||
if [[ -n "$1" ]] && [[ "$1" != "reset" ]]; then # $1 contains the date for which we want to run Planefence
|
||||
FENCEDATE=$(date --date="$1" '+%y%m%d')
|
||||
else
|
||||
FENCEDATE=$(date --date="today" '+%y%m%d')
|
||||
@@ -63,7 +63,7 @@ fi
|
||||
if [[ -f "$PLANEFENCEDIR/planefence.conf" ]]; then
|
||||
source "$PLANEFENCEDIR/planefence.conf"
|
||||
else
|
||||
echo $PLANEFENCEDIR/planefence.conf is missing. We need it to run PlaneFence!
|
||||
echo $PLANEFENCEDIR/planefence.conf is missing. We need it to run Planefence!
|
||||
exit 2
|
||||
fi
|
||||
|
||||
@@ -486,7 +486,7 @@ EOF
|
||||
exec 3>&-
|
||||
}
|
||||
|
||||
# Function to write the PlaneFence history file
|
||||
# Function to write the Planefence history file
|
||||
LOG "Defining WRITEHTMLHISTORY"
|
||||
WRITEHTMLHISTORY () {
|
||||
# -----------------------------------------
|
||||
@@ -537,7 +537,7 @@ PRUNESTARTFILE=/run/socket30003/.lastprunecount
|
||||
LASTFENCEFILE=/usr/share/planefence/persist/.internal/lastfencedate
|
||||
|
||||
# Here we go for real:
|
||||
LOG "Initiating PlaneFence"
|
||||
LOG "Initiating Planefence"
|
||||
LOG "FENCEDATE=$FENCEDATE"
|
||||
# First - if there's any command line argument, we need to do a full run discarding all cached items
|
||||
if [[ "$1" != "" ]]; then
|
||||
@@ -634,7 +634,7 @@ elif [[ $(find $PRUNESTARTFILE -mmin +$PRUNEMINS | wc -l) == 1 ]]; then
|
||||
echo $READLINES > $PRUNESTARTFILE
|
||||
fi
|
||||
|
||||
# Now write the $CURRCOUNT back to the TMP file for use next time PlaneFence is invoked:
|
||||
# Now write the $CURRCOUNT back to the TMP file for use next time Planefence is invoked:
|
||||
echo "$CURRCOUNT" > "$TMPLINES"
|
||||
|
||||
if [[ "$LASTFENCEDATE" != "$FENCEDATE" ]]; then
|
||||
@@ -890,7 +890,7 @@ cat <<EOF >>"$OUTFILEHTMTMP"
|
||||
<!-- plugin to make JQuery table columns resizable by the user: -->
|
||||
<script src="scripts/colResizable-1.6.min.js"></script>
|
||||
|
||||
<title>ADS-B 1090 MHz PlaneFence</title>
|
||||
<title>ADS-B 1090 MHz Planefence</title>
|
||||
EOF
|
||||
|
||||
if [[ -f "$PLANEHEATHTML" ]]; then
|
||||
@@ -1083,7 +1083,7 @@ if chk_enabled "$PLANEHEAT" && [[ -f "$PLANEHEATHTML" ]]; then
|
||||
<summary style="font-weight: 900; font: 14px/1.4 'Helvetica Neue', Arial, sans-serif;">Heatmap</summary>
|
||||
<ul>
|
||||
<li>This heatmap reflects passing frequency and does not indicate perceived noise levels
|
||||
<li>The heatmap is limited to the coverage area of PlaneFence, for any aircraft listed in the table above
|
||||
<li>The heatmap is limited to the coverage area of Planefence, for any aircraft listed in the table above
|
||||
$( [[ -d "$OUTFILEDIR/../heatmap" ]] && printf "<li>For a heatmap of all planes in range of the station, please click <a href=\"../heatmap\" target=\"_blank\">here</a>" )
|
||||
</ul>
|
||||
EOF
|
||||
@@ -1123,7 +1123,7 @@ LOG "Done writing history"
|
||||
|
||||
cat <<EOF >>"$OUTFILEHTMTMP"
|
||||
<div class="footer">
|
||||
<hr/>PlaneFence $VERSION is part of <a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank">KX1T's PlaneFence Open Source Project</a>, available on GitHub. Support is available on the #Planefence channel of the SDR Enthusiasts Discord Server. Click the Chat icon below to join.
|
||||
<hr/>Planefence $VERSION is part of <a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank">KX1T's Planefence Open Source Project</a>, available on GitHub. Support is available on the #Planefence channel of the SDR Enthusiasts Discord Server. Click the Chat icon below to join.
|
||||
$(if [[ -f /root/.buildtime ]]; then printf " Build: %s" "$([[ -f /usr/share/planefence/branch ]] && cat /usr/share/planefence/branch || cat /root/.buildtime)"; fi)
|
||||
<br/>© Copyright 2020-2025 by Ramón F. Kolb, kx1t. Please see <a href="attribution.txt" target="_blank">here</a> for attributions to our contributors and open source packages used.
|
||||
<br/><a href="https://github.com/sdr-enthusiasts/docker-planefence" target="_blank"><img src="https://img.shields.io/github/actions/workflow/status/sdr-enthusiasts/docker-planefence/deploy.yml"></a>
|
||||
@@ -1160,5 +1160,5 @@ echo "$FENCEDATE" > "$LASTFENCEFILE"
|
||||
# Currently, planefence_notify.sh and planefence-rss.sh are the only background processes that are invoked, and those have a time limit of 120 secs
|
||||
wait $!
|
||||
|
||||
LOG "Finishing PlaneFence... sayonara!"
|
||||
LOG "Finishing Planefence... sayonara!"
|
||||
[[ "$BASETIME" != "" ]] && echo "17. $(bc -l <<< "$(date +%s.%2N) - $BASETIME")s -- done final cleanup" || true
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# Note: this script is meant to be run as a daemon using SYSTEMD
|
||||
# If run manually, it will continuously loop to listen for new planes
|
||||
#
|
||||
# This script is distributed as part of the PlaneFence package and is dependent
|
||||
# This script is distributed as part of the Planefence package and is dependent
|
||||
# on that package for its execution.
|
||||
#
|
||||
# Copyright 2020-2025 Ramon F. Kolb - licensed under the terms and conditions
|
||||
@@ -153,7 +153,7 @@ getRoute() {
|
||||
echo "$response"
|
||||
}
|
||||
|
||||
if [ "$1" != "" ] && [ "$1" != "reset" ]; then # $1 contains the date for which we want to run PlaneFence
|
||||
if [ "$1" != "" ] && [ "$1" != "reset" ]; then # $1 contains the date for which we want to run Planefence
|
||||
TWEETDATE=$(date --date="$1" '+%y%m%d')
|
||||
else
|
||||
TWEETDATE=$(date --date="today" '+%y%m%d')
|
||||
@@ -430,7 +430,7 @@ if [ -f "$CSVFILE" ]; then
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2028
|
||||
[[ "${LINK:0:12}" == "https://t.co" ]] && "${s6wrap[@]}" echo "Planefence post to Twitter generated successfully. Tweet available at: $LINK" || "${s6wrap[@]}" echo "PlaneFence Tweet error. Twitter returned:\n$(tail -1 /tmp/tweets.log)"
|
||||
[[ "${LINK:0:12}" == "https://t.co" ]] && "${s6wrap[@]}" echo "Planefence post to Twitter generated successfully. Tweet available at: $LINK" || "${s6wrap[@]}" echo "Planefence Tweet error. Twitter returned:\n$(tail -1 /tmp/tweets.log)"
|
||||
rm -f $snapfile
|
||||
|
||||
else
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# shellcheck shell=bash disable=SC1091,SC2001,SC2015
|
||||
# PLANEHEAT - a Bash shell script to render a heatmap based on Planefence CSV entries
|
||||
# Only to be used in the context of PlaneFence -- the code to create whole websites was removed from this version of the file
|
||||
# Only to be used in the context of Planefence -- the code to create whole websites was removed from this version of the file
|
||||
#
|
||||
# Usage: ./planeheat.sh [date]
|
||||
#
|
||||
@@ -35,7 +35,7 @@
|
||||
# -----------------------------------------------------------------------------------
|
||||
# Only change the variables below if you know what you are doing.
|
||||
if [ "$1" != "" ] && [ "$1" != "reset" ]
|
||||
then # $1 contains the date for which we want to run PlaneFence
|
||||
then # $1 contains the date for which we want to run Planefence
|
||||
FENCEDATE=$(date --date="$1" '+%y%m%d')
|
||||
else
|
||||
FENCEDATE=$(date --date=today '+%y%m%d')
|
||||
|
||||
@@ -38,7 +38,7 @@ function configure_both() {
|
||||
configure_planealert "$1" "$2"
|
||||
}
|
||||
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Running PlaneFence configuration - either the container is restarted or a config change was detected." || true
|
||||
[[ "$LOGLEVEL" != "ERROR" ]] && "${s6wrap[@]}" echo "Running Planefence configuration - either the container is restarted or a config change was detected." || true
|
||||
# Sometimes, variables are passed in through .env in the Docker-compose directory
|
||||
# However, if there is a planefence.config file in the ..../persist directory
|
||||
# (by default exposed to ~/.planefence) then export all of those variables as well
|
||||
@@ -94,7 +94,7 @@ mkdir -p /usr/share/planefence/html/plane-alert
|
||||
# Sync the plane-alert DB with a preference for newer versions on the persist volume:
|
||||
cp -n /usr/share/plane-alert/plane-alert-db.txt /usr/share/planefence/persist
|
||||
#
|
||||
# LOOPTIME is the time between two runs of PlaneFence (in seconds)
|
||||
# LOOPTIME is the time between two runs of Planefence (in seconds)
|
||||
if [[ "$PF_INTERVAL" != "" ]]; then
|
||||
export LOOPTIME=$PF_INTERVAL
|
||||
|
||||
@@ -112,7 +112,7 @@ mkdir -p /run/planefence
|
||||
if [[ -z "$FEEDER_LAT" ]] || [[ "$FEEDER_LAT" == "90.12345" ]]; then
|
||||
sleep 10s
|
||||
"${s6wrap[@]}" echo "----------------------------------------------------------"
|
||||
"${s6wrap[@]}" echo "!!! STOP !!!! You haven\'t configured FEEDER_LON and/or FEEDER_LAT for PlaneFence !!!!"
|
||||
"${s6wrap[@]}" echo "!!! STOP !!!! You haven\'t configured FEEDER_LON and/or FEEDER_LAT for Planefence !!!!"
|
||||
"${s6wrap[@]}" echo "Planefence will not run unless you edit it configuration."
|
||||
"${s6wrap[@]}" echo "You can do this by pressing CTRL-c now and typing:"
|
||||
"${s6wrap[@]}" echo "sudo nano -l ~/.planefence/planefence.config"
|
||||
@@ -170,7 +170,7 @@ if [[ -n "$PF_SOCK30003HOST" ]]; then
|
||||
else
|
||||
sleep 10s
|
||||
"${s6wrap[@]}" echo "----------------------------------------------------------"
|
||||
"${s6wrap[@]}" echo "!!! STOP !!!! You haven't configured PF_SOCK30003HOST for PlaneFence !!!!"
|
||||
"${s6wrap[@]}" echo "!!! STOP !!!! You haven't configured PF_SOCK30003HOST for Planefence !!!!"
|
||||
"${s6wrap[@]}" echo "Planefence will not run unless you edit it configuration."
|
||||
"${s6wrap[@]}" echo "You can do this by pressing CTRL-c now and typing:"
|
||||
"${s6wrap[@]}" echo "sudo nano -l ~/planefence/planefence.config"
|
||||
@@ -220,7 +220,7 @@ if chk_enabled "${PF_TWEET,,}"; then
|
||||
"${s6wrap[@]}" echo "Then run this from the host machine: \"docker exec -it planefence /root/config_tweeting.sh\""
|
||||
"${s6wrap[@]}" echo "For more information on how to sign up for a Twitter Developer Account, see this link:"
|
||||
"${s6wrap[@]}" echo "https://elfsight.com/blog/2020/03/how-to-get-twitter-api-key/"
|
||||
"${s6wrap[@]}" echo "PlaneFence will continue to start without Twitter functionality."
|
||||
"${s6wrap[@]}" echo "Planefence will continue to start without Twitter functionality."
|
||||
sed -i 's/\(^\s*PLANETWEET=\).*/\1/' /usr/share/planefence/planefence.conf
|
||||
else
|
||||
sed -i 's|\(^\s*PLANETWEET=\).*|\1'"$(sed -n '/profiles:/{n;p;}' /root/.twurlrc | tr -d '[:blank:][=:=]')"'|' /usr/share/planefence/planefence.conf
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/command/with-contenv python3
|
||||
|
||||
# Send Discord Alerts is a utility for PlaneFence
|
||||
# Send Discord Alerts is a utility for Planefence
|
||||
#
|
||||
# Usage: ./send-discord-alert.py <inputfile>
|
||||
#
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
} else { $outputtype = ""; }
|
||||
|
||||
if (strcmp($hex . $tail . $name . $equipment . $timestamp . $call . $lat . $lon , "") == 0) {
|
||||
echo "<html><body><H1>PlaneFence Query Interface</H1>";
|
||||
echo "<html><body><H1>Planefence Query Interface</H1>";
|
||||
echo "<h3>Usage: http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . "?hex=regex&tail=regex&name=regex&equipment=regex&timestamp=regex&call=regex&lat=regex&lon=regex&type=csv|json</h3>";
|
||||
echo "This will read the PlaneFence database and return matching records in JSON format.<br />";
|
||||
echo "This will read the Planefence database and return matching records in JSON format.<br />";
|
||||
echo "<br />";
|
||||
echo "At least one argument of hex, tail, name, equipment, timestamp, call, lat, lon must be present.<br />";
|
||||
echo "It will do a "fuzzy" match, or you can use a Regular Expression.<br />";
|
||||
@@ -50,7 +50,7 @@
|
||||
echo "will return records of tail N141NE, N142NE, N143NE, and that have a timestamp that contains 2021/12/20 - 2021/21/29.<br />";
|
||||
echo "<br />";
|
||||
echo "Note that the date range is limited to the data available to Plane-Alert.<hr />";
|
||||
echo "(C)opyright 2021-2025 by kx1t, available under GPL3 as defined at <a href=https://github.com/sdr-enthusiasts/docker-planefence>the PlaneFence repository at GitHub</a>.<br />";
|
||||
echo "(C)opyright 2021-2025 by kx1t, available under GPL3 as defined at <a href=https://github.com/sdr-enthusiasts/docker-planefence>the Planefence repository at GitHub</a>.<br />";
|
||||
echo "<hr>" . $hex . $tail . $name . $equipment . $timestamp . $call . $lat . $lon;
|
||||
echo "</body></html>";
|
||||
} else {
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
} else { $outputtype = ""; }
|
||||
|
||||
if (strcmp($hex . $call . $start . $end , "") == 0) {
|
||||
echo "<html><body><H1>PlaneFence Query Interface</H1>";
|
||||
echo "<html><body><H1>Planefence Query Interface</H1>";
|
||||
echo "<h3>Usage: http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . "?hex=regex&call=regex&start=regex&end=regex&type=csv|json</h3>";
|
||||
echo "This will read the PlaneFence database and return matching records in JSON format.<br />";
|
||||
echo "This will read the Planefence database and return matching records in JSON format.<br />";
|
||||
echo "<br />";
|
||||
echo "At least one argument of hex, call, start, end must be present.<br />";
|
||||
echo "It will do a "fuzzy" match, or you can use a Regular Expression.<br />";
|
||||
@@ -33,8 +33,8 @@
|
||||
echo "<b>http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . "?hex=^A[DE]&start=2021/12/1[345]</b><br />";
|
||||
echo "will return records of which the Hex ID starts with A followed by a D or E, and that have a start date/time that contains 2021/12/13, 2021/12/14, or 2021/12/15.<br />";
|
||||
echo "<br />";
|
||||
echo "Note that the date range is limited to the data available to PlaneFence. By default, this is set to the last 14 days.<hr />";
|
||||
echo "(C)opyright 2021-2025 by kx1t, available under GPL3 as defined at <a href=https://github.com/sdr-enthusiasts/docker-planefence>the PlaneFence repository at GitHub</a>.<br />";
|
||||
echo "Note that the date range is limited to the data available to Planefence. By default, this is set to the last 14 days.<hr />";
|
||||
echo "(C)opyright 2021-2025 by kx1t, available under GPL3 as defined at <a href=https://github.com/sdr-enthusiasts/docker-planefence>the Planefence repository at GitHub</a>.<br />";
|
||||
echo "</body></html>";
|
||||
} else {
|
||||
if (strcmp($outputtype, "csv") == 0) {
|
||||
|
||||
@@ -32,7 +32,7 @@ PF_MAXDIST=2.0
|
||||
PF_NAME="MY"
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
# How often does PlaneFence check for new planes, in seconds.
|
||||
# How often does Planefence check for new planes, in seconds.
|
||||
# Strongly advice this value not to be less than 60 seconds
|
||||
PF_INTERVAL=80
|
||||
#
|
||||
@@ -118,7 +118,7 @@ PF_SPEEDUNIT=knotph
|
||||
#
|
||||
# If you have set up "tar1090" as your mapping app of choice, and you are showing
|
||||
# MLAT data on the map, then we recommend using tar1090 as your data source. That
|
||||
# way PlaneFence will also take aircraft received using MLAT into account.
|
||||
# way Planefence will also take aircraft received using MLAT into account.
|
||||
PF_SOCK30003HOST=readsb
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
@@ -181,7 +181,7 @@ PF_NOISECAPT=
|
||||
# PF_PLANEALERT=ON means that you can find a ./plane-alert sub-page of your planefence web page.
|
||||
#
|
||||
# Plane-Alert can also send Twitter DMs when a plane on the alert list is detected.
|
||||
# This assumes that you already configured PlaneFence for Twitter use, see "PF_TWEET" above and also README.md.
|
||||
# This assumes that you already configured Planefence for Twitter use, see "PF_TWEET" above and also README.md.
|
||||
# For Plane-Alert tweeting to be on, PF_PA_TWID must contain one or more Twitter IDs. Multiple Twitter IDs should be comma separated.
|
||||
# For example, FP_PA_TWID=12345678 or FP_PA_TWID=12345678,23456789,34567890
|
||||
# IMPORTANT: these are NOT @names, but numeric account IDs. You can convert
|
||||
@@ -221,7 +221,7 @@ PF_CHECKREMOTEDB=
|
||||
# ~/.planefence/planefence-ignore.txt for this
|
||||
#
|
||||
# If PF_IGNOREDUPES is not set, then PF_COLLAPSEWITHIN contains the minimum number of
|
||||
# seconds between two observations for PlaneFence to consider them separate entries.
|
||||
# seconds between two observations for Planefence to consider them separate entries.
|
||||
# Observations within less than PF_COLLAPSEWITHIN seconds will be collapsed. If omitted,
|
||||
# the value is assumed to be 300 seconds
|
||||
PF_IGNOREDUPES=
|
||||
@@ -317,8 +317,8 @@ PF_TWEET_MINTIME=100
|
||||
#
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
# PA_LINK is a URL that points from the PlaneFence web page to the Plane Alert webpage.
|
||||
# Similarly, PA_PF_LINK is a URL that points from the Plane Alert page to the PlaneFence web page.
|
||||
# PA_LINK is a URL that points from the Planefence web page to the Plane Alert webpage.
|
||||
# Similarly, PA_PF_LINK is a URL that points from the Plane Alert page to the Planefence web page.
|
||||
# The default values will work in most circumstances
|
||||
# If empty, it's omitted
|
||||
PF_PA_LINK="plane-alert"
|
||||
|
||||
Reference in New Issue
Block a user