mirror of
https://github.com/sdr-enthusiasts/docker-planefence.git
synced 2025-12-22 11:17:06 +00:00
remove anything twitter/X related because it doesn't work anymore
This commit is contained in:
@@ -23,7 +23,6 @@ RUN set -xe && \
|
||||
KEPT_PACKAGES+=(lighttpd) && \
|
||||
KEPT_PACKAGES+=(perl) && \
|
||||
KEPT_PACKAGES+=(iputils-ping) && \
|
||||
KEPT_PACKAGES+=(ruby) && \
|
||||
KEPT_PACKAGES+=(php-cgi) && \
|
||||
KEPT_PACKAGES+=(html-xml-utils) && \
|
||||
KEPT_PACKAGES+=(file) && \
|
||||
@@ -36,12 +35,9 @@ RUN set -xe && \
|
||||
KEPT_PIP3_PACKAGES+=(requests) && \
|
||||
KEPT_PIP3_PACKAGES+=(geopy) && \
|
||||
#
|
||||
KEPT_RUBY_PACKAGES+=(twurl) && \
|
||||
#
|
||||
# Install all the apt, pip3, and gem (ruby) packages:
|
||||
apt-get update -q && \
|
||||
apt-get install -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -o Dpkg::Options::="--force-confold" -y --no-install-recommends --no-install-suggests ${TEMP_PACKAGES[@]} ${KEPT_PACKAGES[@]} && \
|
||||
gem install twurl && \
|
||||
pip3 install --break-system-packages --no-cache-dir ${KEPT_PIP3_PACKAGES[@]} && \
|
||||
#
|
||||
# Do this here while we still have git installed:
|
||||
|
||||
@@ -2,67 +2,14 @@
|
||||
|
||||
- [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)
|
||||
- [Summary of License Terms](#summary-of-license-terms)
|
||||
|
||||
|
||||
## TWEETING DISCONTINUED, SWITCH TO MASTODON OR DISCORD
|
||||
|
||||
NOTE -- WE ARE DISCONTINUING ACTIVE SUPPORT FOR SENDING TWITTER NOTIFICATIONS
|
||||
NOTE -- WE HAVE DISCONTINUED SUPPORT FOR SENDING TWITTER NOTIFICATIONS
|
||||
In short, the latest changes and uncertainties to the "X" platform have made it impossible to reliably send out Tweets. Many of us have gotten suspended from the platform because of notifications related to aircraft owned by Elon Musk. Also, the API that we are using will soon be discontinued, and the alternative (paid) options are expensive and not economically viable for the average hobbyist user.
|
||||
|
||||
Instead, consider notifications to Mastodon or Discord. Instructions to set these up can be found:
|
||||
Instead, consider notifications to Mastodon, BlueSky, or Discord. MQTT notifications are also supported. Instructions to set these up can be found:
|
||||
|
||||
- for Mastodon, [here](https://github.com/sdr-enthusiasts/blob/main/README-Mastodon.md)
|
||||
- for Discord, [here](https://github.com/sdr-enthusiasts/blob/main/README-discord-alerts.md)
|
||||
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
## Prerequisites
|
||||
This is part of the [kx1t/docker-planefence] docker container. Nothing in this document will make sense outside the context of this container.
|
||||
|
||||
## Signing up for a Twitter Development Account and getting Twitter Credentials
|
||||
|
||||
You'll need a registered Twitter application. If you've never registered a Twitter application before, do the following:
|
||||
|
||||
- If you need help, [here's a webpage](https://elfsight.com/blog/2020/03/how-to-get-twitter-api-key/) with an excellent graphical walk-through of what you need to do. In short, this is the same as doing the following:
|
||||
|
||||
- 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.
|
||||
|
||||
- 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:
|
||||
```
|
||||
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).
|
||||
|
||||
- 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
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
- for BlueSky and MQTT notifications, see the planefence.config file.
|
||||
|
||||
@@ -88,7 +88,7 @@ In the `docker-compose.yml` file, you should configure the following:
|
||||
- OPTIONAL: If you have a soundcard and microphone, adding NoiseCapt is as easy as hooking up the hardware and running another container. You can add this to your existing `docker-compose.yml` file, or run it on a different machine on the same subnet. Instructions are [here](https://github.com/kx1t/docker-noisecapt).
|
||||
- OPTIONAL for Plane-Alert: You can add custom fields, that (again optionally) are displayed on the Plane-Alert list. See [this discussion](https://github.com/sdr-enthusiasts/docker-planefence/issues/38) on how to do that.
|
||||
- OPTIONAL: The website will apply background pictures if you provide them. Save your .jpg pictures as `/opt/adsb/planefence/config/pf_background.jpg` for Planefence and `/opt/adsb/planefence/config/pa_background.jpg` for Plane-Alert. (You may have to restart the container or do `touch /opt/adsb/planefence/config/planefence.config` in order for these backgrounds to become effective.)
|
||||
- OPTIONAL: Add images of tar1090 to your Tweets in Planefence and Plane-Alert. In order to enable this, simply add the `screenshot` section to your `Docker-compose.yml` file as per the example in this repo's [`docker-compose.yml`](https://github.com/sdr-enthusiasts/docker-planefence/blob/main/docker-compose.yml) file. Note - to simplify configuration, Planefence assumes that the hostname of the screenshotting image is called `screenshot` and that it's reachable under that name from the Planefence container stack.
|
||||
- OPTIONAL: Add images of tar1090 to your notifications in Planefence and Plane-Alert. In order to enable this, simply add the `screenshot` section to your `Docker-compose.yml` file as per the example in this repo's [`docker-compose.yml`](https://github.com/sdr-enthusiasts/docker-planefence/blob/main/docker-compose.yml) file. Note - to simplify configuration, Planefence assumes that the hostname of the screenshotting image is called `screenshot` and that it's reachable under that name from the Planefence container stack.
|
||||
- OPTIONAL: Show [OpenAIP](https://www.openaip.net/map) overlay on Planefence web page heatmap. Enable this by setting the option `PF_OPENAIP_LAYER=ON` in `/opt/adsb/planefence/config/planefence.config`
|
||||
|
||||
---
|
||||
@@ -142,14 +142,14 @@ Planefence and Plane-Alert keep a limited amount of data available. By default,
|
||||
|
||||
The Planefence and Plane-Alert APIs accept awk-style Regular Expressions as arguments. For example, a tail number starting with N, followed by 1 digit, followed by 1 or more digits or letters would be represented by this RegEx: `n[0-9][0-9A-Z]*` . Query arguments are case-insensitive: looking for `n` or for `N` yields the same results.
|
||||
Each query must contain at least one of the parameters listed below. Optionally, the `type` parameter indicates the output type. Accepted values are `json` or `csv`; if omitted, `json` is the default value. (These argument values must be provided in lowercase.)
|
||||
Note that the `call` parameter (see below) will start with `@` followed by the call (tail number or flight number as reported via ADS-B/MLAT/UAT) if the entry was tweeted. So make sure to start your `call` query with `^@?` to include both tweeted an non-tweeted calls.
|
||||
Note that the `call` parameter (see below) will start with `@` followed by the call (tail number or flight number as reported via ADS-B/MLAT/UAT) if a notification was sent for the entry. So make sure to start your `call` query with `^@?`.
|
||||
|
||||
#### Planefence Query parameters
|
||||
|
||||
| Parameter | Description | Example |
|
||||
|---|---|---|
|
||||
| `hex` | Hex ID to return | <https://planeboston.com/planefence/pf_query.php?hex=^A[AB>][A-F0-9]*&type=csv returns a CSV with any Planefence records of which the Hex IDs that start with A, followed by A or B, followed by 0 or more hexadecimal digits |
|
||||
| `tail` | Call sign (flight number or tail) to return | <https://planeboston.com/planefence/pf_query.php?call=^@?AAL[0-9]*&type=json> returns any flights of which the call starts with "AAL" or "@AAL" followed by only numbers. (Note - the call value will start with `@` if the entry was tweeted, in which case the `tweet_url` field contains a link to the tweet.) |
|
||||
| `tail` | Call sign (flight number or tail) to return | <https://planeboston.com/planefence/pf_query.php?call=^@?AAL[0-9]*&type=json> returns any flights of which the call starts with "AAL" or "@AAL" followed by only numbers. (Note - the call value will start with `@` if a notification for the entry was sent, in which case the `tweet_url` field contains a link to the notification (legacy field name - notification is probably NOT to X/Twitter!)) |
|
||||
| `start` | Start time, format `yyyy/MM/dd hh:mm:ss` | <https://planeboston.com/planefence/pf_query.php?start=2021/12/19.*&type=csv> returns all entries that started on Dec 19, 2021. |
|
||||
| `end` | End time, format `yyyy/MM/dd hh:mm:ss` | <https://planeboston.com/planefence/pf_query.php?end=2021/12/19.*&type=csv> returns all entries that ended on Dec 19, 2021. |
|
||||
|
||||
@@ -173,7 +173,7 @@ Note that the `call` parameter (see below) will start with `@` followed by the c
|
||||
- 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.
|
||||
- Plane-alert will appear at <http://myip:8088/plane-alert>
|
||||
- Twitter setup is complex and Elon will ban you if you publish anything about one of his planes. [Here](https://github.com/sdr-enthusiasts/docker-planefence#setting-up-tweeting)'s a description on what to do. We advise you to skip Twitter and send notifications to [Mastodon](README-Mastodon.md) instead.
|
||||
- Sending notifications to X (Twitter) has now been disabled and the corresponding code has been removed. This is done for several reasons (insert politics here), but mainly because there is no longer a free API available to send tweets. Please consider sending notifications to any of the currently supported media, including BlueSky, Mastodon, Discord, and MQTT.
|
||||
- Error "We cannot reach {host} on port 30003". This could be caused by a few things:
|
||||
- Did you set the correct hostname or IP address in `PF_SOCK30003HOST` in `planefence.config`? This can be:
|
||||
- The name of another container in the same Docker compose stack, e.g., `ultrafeeder` or `tar1090`
|
||||
|
||||
@@ -21,8 +21,11 @@ source /scripts/common
|
||||
mkdir -p /run/socket30003
|
||||
#
|
||||
# Load parameters from the config file:
|
||||
#[[ -f /usr/share/planefence/persist/planefence.config ]] && export $(grep -v '^\s*#' /usr/share/planefence/persist/planefence.config | xargs)
|
||||
[[ -f /usr/share/planefence/persist/planefence.config ]] && set -o allexport && source /usr/share/planefence/persist/planefence.config && set +o allexport
|
||||
if [[ -f /usr/share/planefence/persist/planefence.config ]]; then
|
||||
set -o allexport
|
||||
source /usr/share/planefence/persist/planefence.config
|
||||
set +o allexport
|
||||
fi
|
||||
|
||||
# If things went wrong then simply sleep forever.
|
||||
# No need to notify -- .../run/planefence is doing the same thing and is
|
||||
@@ -38,7 +41,7 @@ LOOPTIME=15
|
||||
# set params in socket30003.conf
|
||||
sed -i 's/\(^\s*latitude=\).*/\1'"$FEEDER_LAT"'/' /usr/share/socket30003/socket30003.cfg
|
||||
sed -i 's/\(^\s*longitude=\).*/\1'"$FEEDER_LONG"'/' /usr/share/socket30003/socket30003.cfg
|
||||
[[ "x$PF_SOCK30003HOST" != "x" ]] && sed -i 's|\(^\s*PEER_HOST=\).*|\1'"$PF_SOCK30003HOST"'|' /usr/share/socket30003/socket30003.cfg
|
||||
sed -i 's|\(^\s*PEER_HOST=\).*|\1'"$PF_SOCK30003HOST"'|' /usr/share/socket30003/socket30003.cfg
|
||||
|
||||
if [[ "x$PF_DISTUNIT" != "x" ]]
|
||||
then
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
# plane-alert
|
||||
Monitor ADS-B records for occurrences of planes from a list
|
||||
|
||||
These are extremely minimalist install notes as this repository is mainly meant for my own backup purposes.
|
||||
Since it was not designed to be very portable, simply use this as sample-code to implement your own / something better.
|
||||
As per the license, acknowledgement of the source would be appreciated.
|
||||
|
||||
Based on BASH, runs on Raspberry Pi
|
||||
In order to run this, the following dependencies must be installed:
|
||||
- a working `dump1090` or `dump1090-fa` or `dump1090-mutability` installation
|
||||
- Ted Sluis's `Socket3003` to collect the data from a dump1090 installation: https://github.com/tedsluis/dump1090.socket30003
|
||||
- Install Twurl and configure Twurl for Raspberry Pi (or comment out the part of the script that sends tweets)
|
||||
- You should manually install and start the `88-plane-alert.conf` file for `lighttpd`, or some other way make a web page available that points to the install's `html` directory
|
||||
- I personally would make a directory named `/usr/share/plane-alert`, chown it to `pi:pi`, and recursively copy the repository there
|
||||
|
||||
# How to invoke
|
||||
`/usr/share/plane-alert/plane-alert.sh <filename>`
|
||||
|
||||
The `<filename>` is a full path to one of the log files from Socket30003 - often `/tmp/dump1090-127_0_0_1-yymmdd.txt`
|
||||
|
||||
# LICENSE
|
||||
For full text, see the LICENSE file included with this repository.
|
||||
The following is a short summary of terms. In case of conflict between this text and the terms and conditions set forth in the LICENSE file, those in the LICENSE file shall take precedence.
|
||||
|
||||
Copyright (C) 2021-2025 Ramon F. Kolb
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -1 +0,0 @@
|
||||
13901882
|
||||
@@ -138,28 +138,28 @@ sed -i 's|\(^\s*LOGFILE=\).*|\1'"$LOGFILE"'|' /usr/share/planefence/planefence.c
|
||||
# read the environment variables and put them in the planefence.conf file:
|
||||
[[ -n "$FEEDER_LAT" ]] && sed -i 's/\(^\s*LAT=\).*/\1'"\"$FEEDER_LAT\""'/' /usr/share/planefence/planefence.conf || {
|
||||
"${s6wrap[@]}" echo "Error - \$FEEDER_LAT ($FEEDER_LAT) not defined"
|
||||
while :; do sleep 2073600; done
|
||||
exec sleep infinity
|
||||
}
|
||||
[[ -n "$FEEDER_LONG" ]] && sed -i 's/\(^\s*LON=\).*/\1'"\"$FEEDER_LONG\""'/' /usr/share/planefence/planefence.conf || {
|
||||
"${s6wrap[@]}" echo "Error - \$FEEDER_LONG not defined"
|
||||
while :; do sleep 2073600; done
|
||||
exec sleep infinity
|
||||
}
|
||||
[[ -n "$PF_MAXALT" ]] && sed -i 's/\(^\s*MAXALT=\).*/\1'"\"$PF_MAXALT\""'/' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_MAXDIST" ]] && sed -i 's/\(^\s*DIST=\).*/\1'"\"$PF_MAXDIST\""'/' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_ELEVATION" ]] && sed -i 's/\(^\s*ALTCORR=\).*/\1'"\"$PF_ELEVATION\""'/' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_NAME" ]] && sed -i 's/\(^\s*MY=\).*/\1'"\"$PF_NAME\""'/' /usr/share/planefence/planefence.conf || sed -i 's/\(^\s*MY=\).*/\1\"My\"/' /usr/share/planefence/planefence.conf
|
||||
|
||||
[[ -n "$PF_MAPURL" ]] && sed -i 's|\(^\s*MYURL=\).*|\1'"\"$PF_MAPURL\""'|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*MYURL=\).*|\1|' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_NOISECAPT" ]] && sed -i 's|\(^\s*REMOTENOISE=\).*|\1'"\"$PF_NOISECAPT\""'|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*REMOTENOISE=\).*|\1|' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_FUDGELOC" ]] && sed -i 's|\(^\s*FUDGELOC=\).*|\1'"\"$PF_FUDGELOC\""'|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*FUDGELOC=\).*|\1|' /usr/share/planefence/planefence.conf
|
||||
configure_planefence "MAXALT" "$PF_MAXALT"
|
||||
configure_planefence "DIST" "$PF_MAXDIST"
|
||||
configure_planefence "ALTCORR" "$PF_ELEVATION"
|
||||
configure_planefence "MY" "$PF_NAME"
|
||||
configure_planefence "MYURL" "$PF_MAPURL"
|
||||
configure_planefence "REMOTENOISE" "$PF_NOISECAPT"
|
||||
configure_planefence "FUDGELOC" "$PF_FUDGELOC"
|
||||
chk_enabled "$PF_OPENAIP_LAYER" && sed -i 's|\(^\s*OPENAIP_LAYER=\).*|\1'"\"ON\""'|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*OPENAIP_LAYER=\).*|\1'"\"OFF\""'|' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_TWEET_MINTIME" ]] && sed -i 's|\(^\s*TWEET_MINTIME=\).*|\1'"$PF_TWEET_MINTIME"'|' /usr/share/planefence/planefence.conf
|
||||
[[ "$PF_TWEET_BEHAVIOR" == "PRE" ]] && sed -i 's|\(^\s*TWEET_BEHAVIOR=\).*|\1PRE|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*TWEET_BEHAVIOR=\).*|\1POST|' /usr/share/planefence/planefence.conf
|
||||
chk_enabled "$PF_PLANEALERT" && sed -i 's|\(^\s*PA_LINK=\).*|\1\"'"$PF_PA_LINK"'\"|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*PA_LINK=\).*|\1|' /usr/share/planefence/planefence.conf
|
||||
|
||||
configure_planefence "TWEET_MINTIME" "${PF_NOTIF_MINTIME:-$PF_TWEET_MINTIME}"
|
||||
configure_planefence "TWEET_BEHAVIOR" "${PF_NOTIF_BEHAVIOR:-$PF_TWEET_BEHAVIOR}"
|
||||
if chk_enabled "$PF_PLANEALERT"; then configure_planefence "PA_LINK" "$PA_PF_LINK"; else configure_planefence "PA_LINK" ""; fi
|
||||
configure_planealert "PF_LINK" "$PA_PF_LINK"
|
||||
chk_enabled "$PF_TWEETEVERY" && sed -i 's|\(^\s*TWEETEVERY=\).*|\1true|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*TWEETEVERY=\).*|\1false|' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PA_HISTTIME" ]] && sed -i 's|\(^\s*HISTTIME=\).*|\1\"'"$PA_HISTTIME"'\"|' /usr/share/plane-alert/plane-alert.conf
|
||||
[[ -n "$PF_ALERTHEADER" ]] && sed -i "s|\(^\s*ALERTHEADER=\).*|\1\'$PF_ALERTHEADER\'|" /usr/share/plane-alert/plane-alert.conf
|
||||
if chk_enabled "${PF_NOTIFEVERY:-$PF_TWEETEVERY}"; then configure_planefence "TWEETEVERY" "true"; else configure_planefence "TWEETEVERY" "false"; fi
|
||||
configure_planealert "HISTTIME" "$PA_HISTTIME"
|
||||
configure_planealert "ALERTHEADER" "$PF_ALERTHEADER"
|
||||
|
||||
if [[ -n "$PF_SOCK30003HOST" ]]; then
|
||||
# shellcheck disable=SC2001
|
||||
@@ -182,8 +182,8 @@ else
|
||||
fi
|
||||
#
|
||||
# Deal with duplicates. Put IGNOREDUPES in its place and create (or delete) the link to the ignorelist:
|
||||
[[ -n "$PF_IGNOREDUPES" ]] && sed -i 's|\(^\s*IGNOREDUPES=\).*|\1ON|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*IGNOREDUPES=\).*|\1OFF|' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_COLLAPSEWITHIN" ]] && sed -i 's|\(^\s*COLLAPSEWITHIN=\).*|\1'"$PF_COLLAPSEWITHIN"'|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*IGNOREDUPES=\).*|\1300|' /usr/share/planefence/planefence.conf
|
||||
if chk_enabled "$PF_IGNOREDUPES"; then configure_planefence "IGNOREDUPES" "ON"; else configure_planefence "IGNOREDUPES" "OFF"; fi
|
||||
configure_planefence "COLLAPSEWITHIN" "${PF_COLLAPSEWITHIN:-300}"
|
||||
a="$(sed -n 's/^\s*IGNORELIST=\(.*\)/\1/p' /usr/share/planefence/planefence.conf | sed 's/\"//g')"
|
||||
[[ -n "$a" ]] && ln -sf "$a" /usr/share/planefence/html/ignorelist.txt || rm -f /usr/share/planefence/html/ignorelist.txt
|
||||
unset a
|
||||
@@ -197,58 +197,28 @@ sed -i 's/\(^\s*LON=\).*/\1'"\"$FEEDER_LONG\""'/' /usr/share/planefence/planehea
|
||||
[[ -n "$PF_MAXALT" ]] && sed -i 's/\(^\s*MAXALT=\).*/\1'"\"$PF_MAXALT\""'/' /usr/share/planefence/planeheat.sh
|
||||
[[ -n "$PF_MAXDIST" ]] && sed -i 's/\(^\s*DIST=\).*/\1'"\"$PF_MAXDIST\""'/' /usr/share/planefence/planeheat.sh
|
||||
# -----------------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
# One-time action for builds after 20210218-094500EST: we moved the backup of .twurlrc from /run/planefence to /usr/share/planefence/persist
|
||||
# so /run/* can be TMPFS. As a result, if .twurlrc is still there, move it to its new location.
|
||||
# This one-time action can be obsoleted once all users have moved over.
|
||||
[[ -f /run/planefence/.twurlrc ]] && mv -n /run/planefence/.twurlrc /usr/share/planefence/persist
|
||||
# Now update the .twurlrc in /root if there is a newer version in the persist directory
|
||||
[[ -f /usr/share/planefence/persist/.twurlrc ]] && cp -u /usr/share/planefence/persist/.twurlrc /root
|
||||
# If there's still nothing in the persist directory or it appears out of date, back up the .twurlrc from /root to there
|
||||
[[ -f /root/.twurlrc ]] && cp -n /root/.twurlrc /usr/share/planefence/persist
|
||||
#
|
||||
# -----------------------------------------------------------------------------------
|
||||
#
|
||||
# enable or disable tweeting:
|
||||
#
|
||||
chk_disabled "${PF_TWEET}" && sed -i 's/\(^\s*PLANETWEET=\).*/\1/' /usr/share/planefence/planefence.conf
|
||||
if chk_enabled "${PF_TWEET,,}"; then
|
||||
if [[ ! -f ~/.twurlrc ]]; then
|
||||
"${s6wrap[@]}" echo "Warning: PF_TWEET is set to ON in .env file, but the Twitter account is not configured."
|
||||
"${s6wrap[@]}" echo "Sign up for a developer account at Twitter, create an app, and get a Consumer Key / Secret."
|
||||
"${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."
|
||||
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
|
||||
[[ -n "$PF_TWATTRIB" ]] && sed -i 's|\(^\s*ATTRIB=\).*|\1'"\"$PF_TWATTRIB\""'|' /usr/share/planefence/planefence.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
# Despite the name, this variable also works for Mastodon and Discord notifications:
|
||||
# You can use PF_TWATTRIB/PA_TWATTRIB or PF_ATTRIB/PA_ATTRIB or simply $ATTRIB
|
||||
# If PA_[TW]ATTRIB isn't set, but PF_[TW]ATTRIB has a value, then the latter will also be used for Plane-Alert
|
||||
# Finally, if you set ATTRIB to a value, we will use that for both PA and PF and ignore any PF_[TW]ATTRIB/PA_[TW]ATTRIB values
|
||||
[[ -n "$PF_TWATTRIB$PF_ATTRIB" ]] && configure_planefence "ATTRIB" "\"$PF_TWATTRIB$PF_ATTRIB\""
|
||||
[[ -n "$PA_TWATTRIB$PA_ATTRIB" ]] && configure_planealert "ATTRIB" "\"$PA_TWATTRIB$PA_ATTRIB\""
|
||||
[[ -z "$PA_TWATTRIB$PA_ATTRIB" ]] && [[ -n "$PF_TWATTRIB$PF_ATTRIB" ]] && configure_planealert "ATTRIB" "\"$PF_TWATTRIB$PF_ATTRIB\""
|
||||
[[ -n "$ATTRIB" ]] && configure_both "ATTRIB" "\"$ATTRIB\""
|
||||
if [[ -n "${PF_TWATTRIB:-${PF_ATTRIB:-$ATTRIB}}" ]]; then configure_planefence "ATTRIB" "\"${PF_TWATTRIB:-$PF_ATTRIB}\""; fi
|
||||
if [[ -n "${PA_TWATTRIB:-${PA_ATTRIB:-$ATTRIB}}" ]]; then configure_planealert "ATTRIB" "\"${PA_TWATTRIB:-${PA_ATTRIB:-$ATTRIB}}\""; fi
|
||||
|
||||
# -----------------------------------------------------------------------------------
|
||||
# Set notifications date/time format:
|
||||
[[ -n "$NOTIF_DATEFORMAT" ]] && configure_both "NOTIF_DATEFORMAT" "\"$NOTIF_DATEFORMAT\"" || true
|
||||
|
||||
if [[ -n "$NOTIF_DATEFORMAT" ]]; then configure_both "NOTIF_DATEFORMAT" "\"$NOTIF_DATEFORMAT\""; fi
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
# enable/disable planeheat;
|
||||
chk_disabled "$PF_HEATMAP" && configure_planefence "PLANEHEAT" "OFF" || configure_planefence "PLANEHEAT" "ON"
|
||||
if chk_disabled "$PF_HEATMAP"; then configure_planefence "PLANEHEAT" "OFF"; else configure_planefence "PLANEHEAT" "ON"; fi
|
||||
# Change the heatmap height and width if they are defined in the .env parameter file:
|
||||
[[ -n "$PF_MAPHEIGHT" ]] && sed -i 's|\(^\s*HEATMAPHEIGHT=\).*|\1'"\"$PF_MAPHEIGHT\""'|' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_MAPWIDTH" ]] && sed -i 's|\(^\s*HEATMAPWIDTH=\).*|\1'"\"$PF_MAPWIDTH\""'|' /usr/share/planefence/planefence.conf
|
||||
[[ -n "$PF_MAPZOOM" ]] && sed -i 's|\(^\s*HEATMAPZOOM=\).*|\1'"\"$PF_MAPZOOM\""'|' /usr/share/planefence/planefence.conf
|
||||
configure_planefence "HEATMAPHEIGHT" "$PF_MAPHEIGHT"
|
||||
configure_planefence "HEATMAPWIDTH" "$PF_MAPWIDTH"
|
||||
configure_planefence "HEATMAPZOOM" "$PF_MAPZOOM"
|
||||
#
|
||||
# Also do this for files in the past -- /usr/share/planefence/html/planefence-??????.html
|
||||
if compgen -G "$1/planefence-??????.html" >/dev/null; then
|
||||
@@ -262,12 +232,10 @@ fi
|
||||
# place the screenshotting URL in place:
|
||||
|
||||
if [[ -n "$PF_SCREENSHOTURL" ]]; then
|
||||
sed -i 's|\(^\s*SCREENSHOTURL=\).*|\1'"\"$PF_SCREENSHOTURL\""'|' /usr/share/planefence/planefence.conf
|
||||
sed -i 's|\(^\s*SCREENSHOTURL=\).*|\1'"\"$PF_SCREENSHOTURL\""'|' /usr/share/plane-alert/plane-alert.conf
|
||||
configure_both "SCREENSHOTURL" "\"$PF_SCREENSHOTURL\""
|
||||
fi
|
||||
if [[ -n "$PF_SCREENSHOT_TIMEOUT" ]]; then
|
||||
sed -i 's|\(^\s*SCREENSHOT_TIMEOUT=\).*|\1'"\"$PF_SCREENSHOT_TIMEOUT\""'|' /usr/share/planefence/planefence.conf
|
||||
sed -i 's|\(^\s*SCREENSHOT_TIMEOUT=\).*|\1'"\"$PF_SCREENSHOT_TIMEOUT\""'|' /usr/share/plane-alert/plane-alert.conf
|
||||
configure_both "SCREENSHOT_TIMEOUT" "$PF_SCREENSHOT_TIMEOUT"
|
||||
fi
|
||||
|
||||
# if it still doesn't exist, something went drastically wrong and we need to set $PF_PLANEALERT to OFF!
|
||||
@@ -280,17 +248,11 @@ if [[ ! -f /usr/share/planefence/persist/plane-alert-db.txt ]] && chk_enabled "$
|
||||
fi
|
||||
|
||||
# make sure $PLANEALERT is set to ON in the planefence.conf file, so it will be invoked:
|
||||
chk_enabled "$PF_PLANEALERT" && sed -i 's|\(^\s*PLANEALERT=\).*|\1'"\"ON\""'|' /usr/share/planefence/planefence.conf || sed -i 's|\(^\s*PLANEALERT=\).*|\1'"\"OFF\""'|' /usr/share/planefence/planefence.conf
|
||||
if chk_enabled "$PF_PLANEALERT"; then configure_planefence "PLANEALERT" "ON"; else configure_planefence "PLANEALERT" "OFF"; fi
|
||||
# Go get the plane-alert-db files:
|
||||
/usr/share/plane-alert/get-pa-alertlist.sh
|
||||
/usr/share/plane-alert/get-silhouettes.sh
|
||||
|
||||
# Now make sure that the file containing the twitter IDs is rewritten with 1 ID per line
|
||||
[[ -n "$PF_PA_TWID" ]] && tr , "\n" <<<"$PF_PA_TWID" >/usr/share/plane-alert/plane-alert.twitterid || rm -f /usr/share/plane-alert/plane-alert.twitterid
|
||||
# and write the rest of the parameters into their place
|
||||
[[ -n "$PF_PA_TWID" ]] && [[ "$PF_PA_TWEET" == "DM" ]] && sed -i 's|\(^\s*TWITTER=\).*|\1DM|' /usr/share/plane-alert/plane-alert.conf || sed -i 's|\(^\s*TWITTER=\).*|\1false|' /usr/share/plane-alert/plane-alert.conf
|
||||
[[ "$PF_PA_TWEET" == "TWEET" ]] && sed -i 's|\(^\s*TWITTER=\).*|\1TWEET|' /usr/share/plane-alert/plane-alert.conf
|
||||
[[ "$PF_PA_TWEET" != "TWEET" ]] && [[ "$PF_PA_TWEET" != "DM" ]] && sed -i 's|\(^\s*TWITTER=\).*|\1false|' /usr/share/plane-alert/plane-alert.conf
|
||||
configure_planefence "PF_DISCORD" "$PF_DISCORD"
|
||||
configure_planealert "PA_DISCORD" "$PA_DISCORD"
|
||||
configure_planealert "PA_DISCORD_WEBHOOKS" "\"${PA_DISCORD_WEBHOOKS}\""
|
||||
@@ -306,8 +268,8 @@ configure_planefence "OPENAIPKEY" "$PF_OPENAIPKEY"
|
||||
if [[ -n "$MASTODON_SERVER" ]] && [[ -n "$MASTODON_ACCESS_TOKEN" ]]; then
|
||||
MASTODON_SERVER="${MASTODON_SERVER,,}"
|
||||
# strip http:// https://
|
||||
[[ "${MASTODON_SERVER:0:7}" == "http://" ]] && MASTODON_SERVER="${MASTODON_SERVER:7}" || true
|
||||
[[ "${MASTODON_SERVER:0:8}" == "https://" ]] && MASTODON_SERVER="${MASTODON_SERVER:8}" || true
|
||||
if [[ "${MASTODON_SERVER:0:7}" == "http://" ]]; then MASTODON_SERVER="${MASTODON_SERVER:7}"; fi
|
||||
if [[ "${MASTODON_SERVER:0:8}" == "https://" ]]; then MASTODON_SERVER="${MASTODON_SERVER:8}"; fi
|
||||
mast_result="$(curl -m 5 -sSL -H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" "https://${MASTODON_SERVER}/api/v1/accounts/verify_credentials")"
|
||||
if ! grep -iq "The access token is invalid\|<body class='error'>" <<<"$mast_result" >/dev/null 2>&1; then
|
||||
configure_both "MASTODON_NAME" "$(jq -r '.acct' <<<"$mast_result")"
|
||||
@@ -332,11 +294,10 @@ if [[ -n "$MASTODON_SERVER" ]] && [[ -n "$MASTODON_ACCESS_TOKEN" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -n "$PF_NAME" ]] && sed -i 's|\(^\s*NAME=\).*|\1'"\"$PF_NAME\""'|' /usr/share/plane-alert/plane-alert.conf || sed -i 's|\(^\s*NAME=\).*|\1My|' /usr/share/plane-alert/plane-alert.conf
|
||||
[[ -n "$PF_MAPURL" ]] && sed -i 's|\(^\s*ADSBLINK=\).*|\1'"\"$PF_MAPURL\""'|' /usr/share/plane-alert/plane-alert.conf
|
||||
# removed for now - hardcoding PlaneAlert map zoom to 7 in plane-alert.conf: [[ -n "$PF_MAPZOOM" ]] && sed -i 's|\(^\s*MAPZOOM=\).*|\1'"\"$PF_MAPZOOM\""'|' /usr/share/plane-alert/plane-alert.conf
|
||||
[[ -n "$PF_PARANGE" ]] && sed -i 's|\(^\s*RANGE=\).*|\1'"$PF_PARANGE"'|' /usr/share/plane-alert/plane-alert.conf || sed -i 's|\(^\s*RANGE=\).*|\1999999|' /usr/share/plane-alert/plane-alert.conf
|
||||
[[ -n "$PF_PA_SQUAWKS" ]] && sed -i 's|\(^\s*SQUAWKS=\).*|\1'"$PF_PA_SQUAWKS"'|' /usr/share/plane-alert/plane-alert.conf || sed -i 's|\(^\s*SQUAWKS=\).*|\1|' /usr/share/plane-alert/plane-alert.conf
|
||||
configure_planealert "NAME" "\"${PF_NAME:-My}\""
|
||||
configure_planealert "ADSBLINK" "\"$PF_MAPURL\""
|
||||
configure_planealert "RANGE" "${PF_PARANGE:-999999}"
|
||||
configure_planealert "SQUAWKS" "$PF_PA_SQUAWKS"
|
||||
|
||||
if chk_enabled "$PF_AUTOREFRESH"; then configure_planefence "AUTOREFRESH" "true"; else configure_planefence "AUTOREFRESH" "false"; fi
|
||||
if chk_enabled "${PA_AUTOREFRESH:-$PF_AUTOREFRESH}"; then configure_planealert "AUTOREFRESH" "true"; else configure_planealert "AUTOREFRESH" "false"; fi
|
||||
@@ -346,13 +307,22 @@ if chk_enabled "${PA_AUTOREFRESH:-$PF_AUTOREFRESH}"; then configure_planealert "
|
||||
# Check if the dist/alt/speed units haven't changed. If they have changed,
|
||||
# we need to restart socket30003 so these changes are picked up:
|
||||
# First, give the socket30003 startup routine a headstart so this doesn't compete with it:
|
||||
sleep 1
|
||||
while [[ ! -f /run/socket30003.up ]]; do sleep 1; done
|
||||
if [[ "$PF_DISTUNIT" != $(sed -n 's/^\s*distanceunit=\(.*\)/\1/p' /usr/share/socket30003/socket30003.cfg) ]] ||
|
||||
[[ "$PF_ALTUNIT" != $(sed -n 's/^\s*altitudeunit=\(.*\)/\1/p' /usr/share/socket30003/socket30003.cfg) ]] ||
|
||||
[[ "$PF_SPEEDUNIT" != $(sed -n 's/^\s*speedunit=\(.*\)/\1/p' /usr/share/socket30003/socket30003.cfg) ]]; then
|
||||
[[ "$PF_SPEEDUNIT" != $(sed -n 's/^\s*speedunit=\(.*\)/\1/p' /usr/share/socket30003/socket30003.cfg) ]] ||
|
||||
[[ "$FEEDER_LAT" != $(sed -n 's/^\s*latitude=\(.*\)/\1/p' /usr/share/socket30003/socket30003.cfg) ]] ||
|
||||
[[ "$FEEDER_LONG" != $(sed -n 's/^\s*longitude=\(.*\)/\1/p' /usr/share/socket30003/socket30003.cfg) ]] ||
|
||||
[[ "$PF_SOCK30003HOST" != $(sed -n 's/^\s*PEER_HOST=\(.*\)/\1/p' /usr/share/socket30003/socket30003.cfg) ]] ||
|
||||
[[ "${PF_SOCK30003PORT:-30003}" != $(sed -n 's/^\s*PEER_PORT=\(.*\)/\1/p' /usr/share/socket30003/socket30003.cfg) ]]; then
|
||||
[[ -n "$PF_DISTUNIT" ]] && sed -i 's/\(^\s*distanceunit=\).*/\1'"$PF_DISTUNIT"'/' /usr/share/socket30003/socket30003.cfg
|
||||
[[ -n "$PF_SPEEDUNIT" ]] && sed -i 's/\(^\s*speedunit=\).*/\1'"$PF_SPEEDUNIT"'/' /usr/share/socket30003/socket30003.cfg
|
||||
[[ -n "$PF_ALTUNIT" ]] && sed -i 's/\(^\s*altitudeunit=\).*/\1'"$PF_ALTUNIT"'/' /usr/share/socket30003/socket30003.cfg
|
||||
sed -i 's/\(^\s*latitude=\).*/\1'"$FEEDER_LAT"'/' /usr/share/socket30003/socket30003.cfg
|
||||
sed -i 's/\(^\s*longitude=\).*/\1'"$FEEDER_LONG"'/' /usr/share/socket30003/socket30003.cfg
|
||||
sed -i 's|\(^\s*PEER_HOST=\).*|\1'"$PF_SOCK30003HOST"'|' /usr/share/socket30003/socket30003.cfg
|
||||
sed -i 's|\(^\s*PEER_PORT=\).*|\1'"${PF_SOCK30003PORT:-30003}"'|' /usr/share/socket30003/socket30003.cfg
|
||||
pkill socket30003.pl
|
||||
fi
|
||||
#
|
||||
#--------------------------------------------------------------------------------
|
||||
@@ -367,14 +337,6 @@ fi
|
||||
[[ -f /usr/share/planefence/persist/pf_background.jpg ]] && cp -f /usr/share/planefence/persist/pf_background.jpg /usr/share/planefence/html || rm -f /usr/share/planefence/html/pf_background.jpg
|
||||
[[ -f /usr/share/planefence/persist/pa_background.jpg ]] && cp -f /usr/share/planefence/persist/pa_background.jpg /usr/share/planefence/html/plane-alert || rm -f /usr/share/planefence/html/plane-alert/pa_background.jpg
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
# get the sample planepix file
|
||||
# if curl -L -s https://raw.githubusercontent.com/sdr-enthusiasts/plane-alert-db/main/planepix.txt > /usr/share/planefence/persist/planepix.txt.samplefile
|
||||
# then
|
||||
# chmod a+r /usr/share/planefence/persist/planepix.txt.samplefile
|
||||
# "${s6wrap[@]}" echo "Successfully downloaded planepix sample file to ~/.planefence/planepix.txt.samplefile directory."
|
||||
# "${s6wrap[@]}" echo "To use it, rename it to, or incorporate it into ~/.planefence/planepix.txt. Any entries in this file will replace the tar1090 screenshot with a picture of the plane."
|
||||
# fi
|
||||
#--------------------------------------------------------------------------------
|
||||
# Put the MOTDs in place:
|
||||
configure_planefence "PF_MOTD" "\"$PF_MOTD\""
|
||||
@@ -383,45 +345,45 @@ configure_planealert "PA_MOTD" "\"$PA_MOTD\""
|
||||
#--------------------------------------------------------------------------------
|
||||
# Set TRACKSERVICE and TRACKLIMIT for Planefence and plane-alert.
|
||||
# note that $PF_TRACKSVC has been deprecated/EOL'd
|
||||
[[ -n "${PF_TRACKSERVICE}" ]] && configure_planefence "TRACKSERVICE" "${PF_TRACKSERVICE}" || configure_planefence "TRACKSERVICE" "globe.adsbexchange.com"
|
||||
[[ -n "$PA_TRACKSERVICE" ]] && configure_planealert "TRACKSERVICE" "$PA_TRACKSERVICE" || configure_planealert "TRACKSERVICE" "globe.adsbexchange.com"
|
||||
[[ -n "$PA_TRACKLIMIT" ]] && configure_planealert "TRACKLIMIT" "$PA_TRACKLIMIT" || true
|
||||
chk_disabled "$PA_TRACK_FIRSTSEEN" && configure_planealert "TRACK_FIRSTSEEN" "disabled" || configure_planealert "TRACK_FIRSTSEEN" "enabled"
|
||||
configure_planefence "TRACKSERVICE" "${PF_TRACKSERVICE:-globe.adsbexchange.com}"
|
||||
configure_planealert "TRACKSERVICE" "${PA_TRACKSERVICE:-globe.adsbexchange.com}"
|
||||
configure_planealert "TRACKLIMIT" "$PA_TRACKLIMIT"
|
||||
if chk_disabled "$PA_TRACK_FIRSTSEEN"; then configure_planealert "TRACK_FIRSTSEEN" "disabled"; else configure_planealert "TRACK_FIRSTSEEN" "enabled"; fi
|
||||
#
|
||||
#--------------------------------------------------------------------------------
|
||||
# Configure MQTT notifications for Planefence and plane-alert
|
||||
[[ -n "$PF_MQTT_URL" ]] && configure_planefence "MQTT_URL" "$PF_MQTT_URL" || true
|
||||
[[ -n "$PF_MQTT_CLIENT_ID" ]] && configure_planefence "MQTT_CLIENT_ID" "$PF_MQTT_CLIENT_ID" || true
|
||||
[[ -n "$PF_MQTT_TOPIC" ]] && configure_planefence "MQTT_TOPIC" "$PF_MQTT_TOPIC" || true
|
||||
[[ -n "$PF_MQTT_DATETIME_FORMAT" ]] && configure_planefence "MQTT_DATETIME_FORMAT" "\"$PF_MQTT_DATETIME_FORMAT\"" || true
|
||||
[[ -n "$PF_MQTT_USERNAME" ]] && configure_planefence "MQTT_USERNAME" "$PF_MQTT_USERNAME" || true
|
||||
[[ -n "$PF_MQTT_PASSWORD" ]] && configure_planefence "MQTT_PASSWORD" "$PF_MQTT_PASSWORD" || true
|
||||
[[ -n "$PF_MQTT_QOS" ]] && configure_planefence "MQTT_QOS" "$PF_MQTT_QOS" || true
|
||||
configure_planefence "MQTT_URL" "$PF_MQTT_URL"
|
||||
configure_planefence "MQTT_CLIENT_ID" "$PF_MQTT_CLIENT_ID"
|
||||
configure_planefence "MQTT_TOPIC" "$PF_MQTT_TOPIC"
|
||||
configure_planefence "MQTT_DATETIME_FORMAT" "\"$PF_MQTT_DATETIME_FORMAT\""
|
||||
configure_planefence "MQTT_USERNAME" "$PF_MQTT_USERNAME"
|
||||
configure_planefence "MQTT_PASSWORD" "$PF_MQTT_PASSWORD"
|
||||
configure_planefence "MQTT_QOS" "$PF_MQTT_QOS"
|
||||
|
||||
[[ -n "$PA_MQTT_URL" ]] && configure_planealert "MQTT_URL" "$PA_MQTT_URL" || true
|
||||
[[ -n "$PA_MQTT_CLIENT_ID" ]] && configure_planealert "MQTT_CLIENT_ID" "$PA_MQTT_CLIENT_ID" || true
|
||||
[[ -n "$PA_MQTT_TOPIC" ]] && configure_planealert "MQTT_TOPIC" "$PA_MQTT_TOPIC" || true
|
||||
[[ -n "$PA_MQTT_DATETIME_FORMAT" ]] && configure_planealert "MQTT_DATETIME_FORMAT" "\"$PA_MQTT_DATETIME_FORMAT\"" || true
|
||||
[[ -n "$PA_MQTT_USERNAME" ]] && configure_planealert "MQTT_USERNAME" "$PA_MQTT_USERNAME" || true
|
||||
[[ -n "$PA_MQTT_PASSWORD" ]] && configure_planealert "MQTT_PASSWORD" "$PA_MQTT_PASSWORD" || true
|
||||
[[ -n "$PA_MQTT_QOS" ]] && configure_planealert "MQTT_QOS" "$PA_MQTT_QOS" || true
|
||||
configure_planealert "MQTT_URL" "$PA_MQTT_URL"
|
||||
configure_planealert "MQTT_CLIENT_ID" "$PA_MQTT_CLIENT_ID"
|
||||
configure_planealert "MQTT_TOPIC" "$PA_MQTT_TOPIC"
|
||||
configure_planealert "MQTT_DATETIME_FORMAT" "\"$PA_MQTT_DATETIME_FORMAT\""
|
||||
configure_planealert "MQTT_USERNAME" "$PA_MQTT_USERNAME"
|
||||
configure_planealert "MQTT_PASSWORD" "$PA_MQTT_PASSWORD"
|
||||
configure_planealert "MQTT_QOS" "$PA_MQTT_QOS"
|
||||
#
|
||||
#--------------------------------------------------------------------------------
|
||||
# RSS related parameters:
|
||||
[[ -n "$PF_RSS_SITELINK" ]] && configure_planefence "RSS_SITELINK" "$PF_RSS_SITELINK" || true
|
||||
[[ -n "$PF_RSS_FAVICONLINK" ]] && configure_planefence "RSS_FAVICONLINK" "$PF_RSS_FAVICONLINK" || true
|
||||
[[ -n "$PA_RSS_SITELINK" ]] && configure_planealert "RSS_SITELINK" "$PA_RSS_SITELINK" || true
|
||||
[[ -n "$PA_RSS_FAVICONLINK" ]] && configure_planealert "RSS_FAVICONLINK" "$PA_RSS_FAVICONLINK" || true
|
||||
configure_planefence "RSS_SITELINK" "$PF_RSS_SITELINK"
|
||||
configure_planefence "RSS_FAVICONLINK" "$PF_RSS_FAVICONLINK"
|
||||
configure_planealert "RSS_SITELINK" "$PA_RSS_SITELINK"
|
||||
configure_planealert "RSS_FAVICONLINK" "$PA_RSS_FAVICONLINK"
|
||||
#
|
||||
#--------------------------------------------------------------------------------
|
||||
# BlueSky related parameters:
|
||||
chk_enabled "$PF_BLUESKY_ENABLED" && [[ -n "$BLUESKY_HANDLE" ]] && configure_planefence "BLUESKY_HANDLE" "$BLUESKY_HANDLE" || configure_planefence "BLUESKY_HANDLE" ""
|
||||
chk_enabled "$PF_BLUESKY_ENABLED" && [[ -n "$BLUESKY_APP_PASSWORD" ]] && configure_planefence "BLUESKY_APP_PASSWORD" "$BLUESKY_APP_PASSWORD" || configure_planefence "BLUESKY_APP_PASSWORD" ""
|
||||
chk_enabled "$PF_BLUESKY_ENABLED" && [[ -n "$BLUESKY_API" ]] && configure_planefence "BLUESKY_API" "$BLUESKY_API" || configure_planefence "BLUESKY_API" ""
|
||||
if chk_enabled "$PF_BLUESKY_ENABLED" && [[ -n "$BLUESKY_HANDLE" ]]; then configure_planefence "BLUESKY_HANDLE" "$BLUESKY_HANDLE"; else configure_planefence "BLUESKY_HANDLE" ""; fi
|
||||
if chk_enabled "$PF_BLUESKY_ENABLED" && [[ -n "$BLUESKY_APP_PASSWORD" ]]; then configure_planefence "BLUESKY_APP_PASSWORD" "$BLUESKY_APP_PASSWORD"; else configure_planefence "BLUESKY_APP_PASSWORD" ""; fi
|
||||
if chk_enabled "$PF_BLUESKY_ENABLED" && [[ -n "$BLUESKY_API" ]]; then configure_planefence "BLUESKY_API" "$BLUESKY_API"; else configure_planefence "BLUESKY_API" ""; fi
|
||||
|
||||
chk_enabled "$PA_BLUESKY_ENABLED" && [[ -n "$BLUESKY_HANDLE" ]] && configure_planealert "BLUESKY_HANDLE" "$BLUESKY_HANDLE" || configure_planealert "BLUESKY_HANDLE" ""
|
||||
chk_enabled "$PA_BLUESKY_ENABLED" && [[ -n "$BLUESKY_APP_PASSWORD" ]] && configure_planealert "BLUESKY_APP_PASSWORD" "$BLUESKY_APP_PASSWORD" || configure_planealert "BLUESKY_APP_PASSWORD" ""
|
||||
chk_enabled "$PA_BLUESKY_ENABLED" && [[ -n "$BLUESKY_API" ]] && configure_planealert "BLUESKY_API" "$BLUESKY_API" || configure_planealert "BLUESKY_API" ""
|
||||
if chk_enabled "$PA_BLUESKY_ENABLED" && [[ -n "$BLUESKY_HANDLE" ]]; then configure_planealert "BLUESKY_HANDLE" "$BLUESKY_HANDLE"; else configure_planealert "BLUESKY_HANDLE" ""; fi
|
||||
if chk_enabled "$PA_BLUESKY_ENABLED" && [[ -n "$BLUESKY_APP_PASSWORD" ]]; then configure_planealert "BLUESKY_APP_PASSWORD" "$BLUESKY_APP_PASSWORD"; else configure_planealert "BLUESKY_APP_PASSWORD" ""; fi
|
||||
if chk_enabled "$PA_BLUESKY_ENABLED" && [[ -n "$BLUESKY_API" ]]; then configure_planealert "BLUESKY_API" "$BLUESKY_API"; else configure_planealert "BLUESKY_API" ""; fi
|
||||
#
|
||||
#--------------------------------------------------------------------------------
|
||||
# Make sure that all past map links follow PA/PF_TRACKS
|
||||
|
||||
@@ -60,27 +60,14 @@ PA_TABLESIZE=50
|
||||
PF_MAPURL="http://external-host-name/tar1090"
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
# Send out Tweets for every plane inside the fence
|
||||
# Value can be ON or OFF
|
||||
# In order to configure this, sign up for a Twitter Dev account,
|
||||
# create an app on the Twitter Dev website, and then execute:
|
||||
# "docker exec -it planefence /root/config_tweeting.sh"
|
||||
# NOTE -- TWITTER IS NO LONGER AVAILABLE ever since X started to charge
|
||||
# for API access. Do not use. Note that some of the additional parameters
|
||||
# (e.g., PF_TWEETEVERY) may be used for other notification services as well.
|
||||
PF_TWEET=OFF
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
# If PF_TWEETEVERY=true then every occurrence of a plane will be tweeted (if the rest of the params are set correctly).
|
||||
# Be careful with this in combination with PF_IGNOREDUPES=false as this may result in a lot of Tweets
|
||||
PF_TWEETEVERY=false
|
||||
# If PF_NOTIFEVERY=true then a notification will be sent for every occurrence of a plane (if the rest of the params are set correctly).
|
||||
# Be careful with this in combination with PF_IGNOREDUPES=false as this may result in a lot of notifications!
|
||||
PF_NOTIFEVERY=false
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
#
|
||||
# If you tweet, you can personalize a string at the bottom using PF_TWATTRIB
|
||||
# If you send a notification, you can personalize a string at the bottom using PF_ATTRIB
|
||||
# You can use PF_ATTRIB/PA_ATTRIB or PF_TWATTRIB/PA_TWATTRIB (legacy params) or simply $ATTRIB
|
||||
# If PA_[TW]ATTRIB isn't set, but PF_[TW]ATTRIB has a value, then the latter will also be used for Plane-Alert
|
||||
# Finally, if you set ATTRIB to a value, we will use that for both PA and PF and ignore any PF_[TW]ATTRIB/PA_[TW]ATTRIB values
|
||||
#
|
||||
PF_ATTRIB="#adsb #planefence by kx1t - https://sdr-e.com/docker-planefence"
|
||||
PA_ATTRIB="#adsb #planefence #planealert by kx1t - https://sdr-e.com/docker-planefence"
|
||||
@@ -182,21 +169,8 @@ PF_NOISECAPT=
|
||||
# PF_PLANEALERT enables a feature that monitors for a list of planes anywhere in the Feeder Station's
|
||||
# coverage area.
|
||||
# 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.
|
||||
# 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
|
||||
# an @name to a Twitter ID at https://tweeterid.com/
|
||||
#
|
||||
# PF_PA_TWEET indicates the type of Tweet that is sent by Plane Alert:
|
||||
# false = no tweet is sent; TWEET = a regular Tweet is sent; and DM means a DM is sent
|
||||
# Note - if PF_PA_TWEET=DM but there are no Twitter ID(s) listed in PF_PA_TWID, then no tweets are sent.
|
||||
#
|
||||
##
|
||||
PF_PLANEALERT=ON
|
||||
PF_PA_TWEET=DM
|
||||
PF_PA_TWID=
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
# PF_PARANGE indicates the range for PlaneAlert. If empty or omitted, it will
|
||||
@@ -277,9 +251,9 @@ PF_ALERTLIST=https://raw.githubusercontent.com/sdr-enthusiasts/plane-alert-db/ma
|
||||
# Alternatively, you can set PF_ALERTHEADER to define the header. If this parameter is set, it will overrule any header it may encounter in the alert files.
|
||||
# The syntax of each comma-separated header field for PF_ALERTHEADER or the first line of the first plane-alert-db file, is as follow:
|
||||
# "Text" -- show the text in a column on the website
|
||||
# "$Text" -- show the text in a column on the website, and include the field in a Tweet if Tweeting is configured
|
||||
# "$Text" -- show the text in a column on the website, and include the field in a notification if enabled
|
||||
# "#Text" -- don't show the text in a column on the website
|
||||
# "#$Text" or "$#Text" -- don't show the text in a column on the website, but do include the field in a Tweet if Tweeting is configured
|
||||
# "#$Text" or "$#Text" -- don't show the text in a column on the website, but do include the field in a notification if enabled
|
||||
#
|
||||
# Note -- if you want to show aircraft silhouettes, make sure that the airplane type is in one of the columns,
|
||||
# and that this column has the name "ICAO Type".
|
||||
@@ -308,15 +282,15 @@ PF_OPENAIP_LAYER=OFF
|
||||
PF_OPENAIPKEY=
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
# PF_TWEET_BEHAVIOR determines if a Planefence Tweet is sent after the initial observation or after the last observation within the Fence
|
||||
# PF_NOTIF_BEHAVIOR determines if a Planefence notification is sent after the initial observation or after the last observation within the Fence
|
||||
# Default: POST Valid values: POST, PRE Assumed value if omitted or "not PRE": POST
|
||||
#
|
||||
PF_TWEET_BEHAVIOR=POST
|
||||
PF_NOTIF_BEHAVIOR=POST
|
||||
#
|
||||
# PF_TWEET_MINTIME is the minimum wait time (in seconds) before a tweet is sent, measure from either the
|
||||
# PF_NOTIF_MINTIME is the minimum wait time (in seconds) before a notification is sent, measure from either the
|
||||
# first observation of the aircraft in the fence, or the last observation of the aircraft in the fence
|
||||
# depending on the PF_TWEET_BEHAVIOR setting. Default value is 100 (secs)
|
||||
PF_TWEET_MINTIME=100
|
||||
# depending on the PF_NOTIF_BEHAVIOR setting. Default value is 100 (secs)
|
||||
PF_NOTIF_MINTIME=100
|
||||
#
|
||||
#
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user