mirror of
https://github.com/sdr-enthusiasts/docker-planefence.git
synced 2025-12-23 19:30:31 +00:00
updates and bug fixes
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
- [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)
|
||||
- [Automatic verification checkmark of your Mastodon account](#automatic-verification-checkmark-of-your-mastodon-account)
|
||||
- [Configuring Planefence to use Mastodon](#configuring-planefence-to-use-mastodon)
|
||||
- [Summary of License Terms](#summary-of-license-terms)
|
||||
|
||||
@@ -45,6 +46,10 @@ Once you have an account, please do the following:
|
||||
|
||||

|
||||
|
||||
## Automatic verification checkmark of your Mastodon account
|
||||
|
||||
If you add a link to your public Planefence or Plane-Alert page in the Extra Fields section of your Public Profile on Mastodon, you will get automatic account verification (with a cool green checkmark) for your Mastodon account.
|
||||
|
||||
## Configuring Planefence to use Mastodon
|
||||
|
||||
Please set the following parameters in your `planefence.config` file:
|
||||
|
||||
@@ -26,10 +26,11 @@ else
|
||||
# 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
|
||||
result="$(curl -sS -H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" "https://${MASTODON_SERVER}/api/v1/apps/verify_credentials")"
|
||||
result="$(curl -m 5 -sSL -H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" "https://${MASTODON_SERVER}/api/v1/apps/verify_credentials")"
|
||||
acct="$(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'>" <<< "$result" >/dev/null 2>&1
|
||||
then
|
||||
echo "[$(date)][$APPNAME] Mastodon configured correctly for $(jq -r '.acct' <<< "$result")'s application $(jq '.name' <<< "$result") / website $(jq '.website' <<< "$result")"
|
||||
echo "[$(date)][$APPNAME] Mastodon configured correctly for $(jq -r '.acct' <<< "$acct")'s application $(jq '.name' <<< "$result") / website $(jq '.website' <<< "$result")"
|
||||
[[ "${PF_MASTODON,,}" == "on" ]] && echo "[$(date)][$APPNAME] Mastodon enabled for Planefence" || echo "[$(date)][$APPNAME] Mastodon disabled for Planefence"
|
||||
[[ "${PA_MASTODON,,}" == "on" ]] && echo "[$(date)][$APPNAME] Mastodon enabled for Plane-Alert" || echo "[$(date)][$APPNAME] Mastodon disabled for Plane-Alert"
|
||||
else
|
||||
|
||||
@@ -134,7 +134,7 @@ set -a
|
||||
set +a
|
||||
# MASTODON parameters for MASTODON notifications as an alternative to Twitter:
|
||||
# MASTODON_SERVER contains the mastodon server name, for example "airwaves.social"
|
||||
# MASTODON_NAMEE contains the @ name of the Mastodon account
|
||||
# MASTODON_NAME contains the @ name of the Mastodon account
|
||||
MASTODON_SERVER=
|
||||
MASTODON_ACCESS_TOKEN=
|
||||
MASTODON_VISIBILITY=unlisted
|
||||
|
||||
@@ -353,7 +353,7 @@ set +a
|
||||
# MASTODON parameters for MASTODON notifications as an alternative to Twitter:
|
||||
# MASTODON_SERVER contains the mastodon server name, for example "airwaves.social"
|
||||
# MASTODON_ACCESS_TOKEN contains the mastodon access token needed for posting
|
||||
# MASTODON_NAMEE contains the @ name of the Mastodon account
|
||||
# MASTODON_NAME contains the @ name of the Mastodon account
|
||||
MASTODON_SERVER=
|
||||
MASTODON_ACCESS_TOKEN=
|
||||
MASTODON_VISIBILITY=unlisted
|
||||
|
||||
@@ -299,7 +299,7 @@ then
|
||||
# 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
|
||||
mast_result="$(curl -m 5 -sSL -H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" "https://${MASTODON_SERVER}/api/v1/apps/verify_credentials")"
|
||||
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")"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user