Skip to content

Latest commit

 

History

History
98 lines (70 loc) · 6.5 KB

README-Mastodon.md

File metadata and controls

98 lines (70 loc) · 6.5 KB

Send a Mastodon Post for each new plane in PlaneFence

This utility enables sending Mastodon posts of new events. Ever since Twitter started to restrict posting about locations of aircraft, are encouraging people to post to Mastodon,

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.

Prerequisites

This is part of the [sdr-enthusiasts/docker-planefence] docker container. Nothing in this document will make sense outside the context of this container.

Signing up for a Mastodon Account and creating an Application

Mastodon is a distributed social media service. This means, that you have your choice of Mastodon servers to create and maintain your account on. Any of them will work (as long as they allow bots), but we recommend joining this one. It's the one where many of us post results of our SDR and radio reception endeavors: https://airwaves.social/

Once you have an account, please do the following:

  • Sign in to Mastodon and go to the home page, for example: https://airwaves.social/home

  • Click Preferences on the bottom right of the page image

  • On the bottom left, click </> Development image

  • Create a new Application by clicking the button, then:

    • Give it a name (for example, "Planefence")
    • Add a URL (if you don't have one, use something like "https://airwaves.social/@myhandle" (replace myhandle by your Mastodon handle))
    • Make sure that the following scopes are selected (important!!!): read, write, follow
    • Press Submit at the bottom of the page image image
  • Open the Application and (important!!!) note the Access Token image image

Note -- the MASTODON_RETENTION_TIME parameter in planefence.config determines the retention time (in days) of any Toots you send to Mastodon. This will help manage storage costs for the operator of the Mastodon server! Note - the default expiration time if the parameter is omitted, is 7 (days). If you want your Toots to never expire, please set the parameter value to off or 0. However, please be cognizant that your Mastodon Server operator is probably paying for disk storage out of their own pocket - so please leave this retention time as short as you can afford.

Configuring Planefence to use Mastodon

Please set the following parameters in your planefence.config file:

MASTODON_SERVER=airwaves.social
MASTODON_ACCESS_TOKEN=vsafdwafewarewdcvdsafwaefaewfdw
PF_MASTODON=ON
PA_MASTODON=ON
PA_MASTODON_VISIBILITY=unlisted
PF_MASTODON_VISIBILITY=unlisted
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 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).

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. Your Planefence and Plane-Alert pages will automatically add a hidden verification link with the rel="me" element as described in the "Verification" tab of your Mastodon Profile Edit page.

image image

Troubleshooting Mastodon verified links

  • If verification fails, please ensure that your Planefence and Plane-Alert webpages are reachable when you press "Save my profile" in Mastodon. This will kick off a new verification attempt.
  • Another thing to check is that your reverse web proxy (if you use one) isn't too aggressive blocking Bots. Specifically, User Agents that start with http.rb should be allowed to pass. Here are a few examples of verification attempts (from the webproxy's access.log):
66.94.123.74 - - [03/Feb/2024:21:00:24 -0500] "GET /planefence/ HTTP/1.1" 200 27716 "-" "http.rb/5.1.1 (Mastodon/4.2.1; +https://airwaves.social/)"
66.94.123.74 - - [03/Feb/2024:21:00:25 -0500] "GET /plane-alert/ HTTP/1.1" 200 524687 "-" "http.rb/5.1.1 (Mastodon/4.2.1; +https://airwave.social/)"

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/.