Compare commits

...
Author SHA1 Message Date
Ian Renton 1d0129f7bb Merge remote-tracking branch 'origin/main' 2026-09-24 06:38:58 +01:00
Ian Renton 02d08c17cd Release 2.2 2026-09-24 06:38:39 +01:00
Ian Renton e88295cf4b Release 2.2 2026-09-24 06:37:58 +01:00
ian bb9ad4e1f2 Alert DX calls should be allowed to wrap 2026-09-23 21:30:37 +00:00
Ian Renton 9a0a3b938c Fix satellite grid display 2026-09-23 22:13:45 +01:00
Ian Renton c26482f06b Improve the way hamsat alerts work, and add the ability to detect satellite names from spot comments. Closes #149 2026-09-23 22:08:36 +01:00
Ian Renton 981fea57ed Rationalise docs part 5 #151 2026-09-23 21:42:22 +01:00
Ian Renton 5db79ec85a Rationalise docs part 4 #151 2026-09-23 18:25:05 +01:00
Ian Renton 2d14342089 Rationalise docs part 3 #151 2026-09-23 17:50:04 +01:00
Ian Renton c9d0a7652c Rationalise docs part 2 #151 2026-09-23 17:42:06 +01:00
Ian Renton b45a6d8b78 Rationalise docs part 1 #151 2026-09-23 17:31:44 +01:00
Ian Renton 31c7c2095e Improve some error handling. Closes #150 2026-09-23 17:30:12 +01:00
ian 5bdd79c247 Update docs/clients.md 2026-09-23 14:54:07 +00:00
ian ae6733e853 Update docs/clients.md 2026-09-23 14:53:45 +00:00
Ian Renton f8343dd036 Extract some common code into telnet_spot_provier as a base class for DX cluster and RBN 2026-09-22 18:35:05 +01:00
Ian Renton 9067f545af Telnet clients disconnecting shouldn't log an exception 2026-09-20 20:51:01 +01:00
Ian Renton 6037e742cc Fix mojibake in DX cluster and RBN spot comments where the source uses UTF-8 2026-09-20 19:11:53 +01:00
54 changed files with 1348 additions and 1103 deletions
+7 -24
View File
@@ -1,4 +1,4 @@
# ![Spothole](/static/img/logo.png) # ![Spothole](https://git.ianrenton.com/ian/spothole/raw/branch/main/static/img/logo.png)
Spothole is a utility to aggregate "spots" from amateur radio DX clusters and xOTA spotting sites, and provide an open Spothole is a utility to aggregate "spots" from amateur radio DX clusters and xOTA spotting sites, and provide an open
JSON API as well as a website to browse the data, and its own telnet server for integration with desktop loggers. JSON API as well as a website to browse the data, and its own telnet server for integration with desktop loggers.
@@ -17,42 +17,25 @@ individual data source presents its data.
Spothole itself is also open source, Public Domain licenced code that anyone can take and modify. Spothole itself is also open source, Public Domain licenced code that anyone can take and modify.
Supported data sources include DX Clusters, the Reverse Beacon Network (RBN), the APRS Internet Service (APRS-IS), POTA, You can read more about Spothole on [the "Help" pages of the main server instance](https://spothole.app/help).
SOTA, WWFF, GMA, WWBOTA, HEMA, Parks 'n' Peaks, ZLOTA, WOTA, BOTA, LLOTA, WWTOTA, Tiles on the Air, the UK Packet
Repeater Network, NG3K, and any site based on the xOTA software by nischu. It also integrates with QRZ.com and HamQTH,
retrieves solar data from various sources, provides information about upcoming contests, and more.
You can read more about Spothole on [the "About" page of the main server instance](https://spothole.app/about).
![Screenshot](/images/screenshot2.png) ![Screenshot](/images/screenshot2.png)
![Screenshot](/images/screenshot3.png)
## Accessing the public version ## Accessing the public version
You can access the public version's web interface at [https://spothole.app](https://spothole.app), and You can access the public version's web interface at [https://spothole.app](https://spothole.app), and
see [https://spothole.app/apidocs](https://spothole.app/apidocs) for the API details. see [https://spothole.app/apidocs](https://spothole.app/apidocs) for the API details.
This is a Progressive Web App, so you can also "install" it to your Android or iOS device by accessing it in Chrome or
Safari respectively, and following the menu-driven process for installing PWAs.
You are more than welcome to use the data and the API that Spothole provides to power your own software, to run your own You are more than welcome to use the data and the API that Spothole provides to power your own software, to run your own
Spothole server, or to modify it in any way. More details can be found in the following sections: Spothole server, or to modify it in any way. More details can be found
in [the "Help" pages of the main server instance](https://spothole.app/help).
* [Embedding Spothole in another website](docs/embedding.md) ![Screenshot](/images/screenshot3.png)
* [Writing your own client](docs/clients.md)
* [Running your own copy](docs/running.md)
* [nginx reverse proxy configuration](docs/nginx.md)
* [systemd service file](docs/systemd.md)
* [Running in Docker](docs/docker.md)
* [Use of multiple cluster logins](docs/multicluster.md)
* [Modifying the source code](docs/modifying.md)
![Screenshot](/images/screenshot4.png)
## Thanks ## Thanks
[Spothole's "About" page](https://spothole.app/about) contains the full details of the thanks I owe to the various [Spothole's "Thanks" page](https://spothole.app/help/thanks) contains the full details of the thanks I owe to the
various
programme teams, software library providers, bug fixers etc. The extra detail below contains the extra detail of programme teams, software library providers, bug fixers etc. The extra detail below contains the extra detail of
specific files in this repository which are not all my own work and may be subject to other licences. specific files in this repository which are not all my own work and may be subject to other licences.
+3 -3
View File
@@ -52,11 +52,11 @@ def get_activity_ref_info(activity_name, ref_id):
if activity_name.upper() == ActivityName.DTMBA: if activity_name.upper() == ActivityName.DTMBA:
ref_id = ref_id.replace("-", "").replace(" ", "") ref_id = ref_id.replace("-", "").replace(" ", "")
### NO DATA ACTIVITIES ### ### NO REFERENCE ACTIVITIES ###
# #
# If the activity is HEMA or BIWOTA, we have no way to either generate useful data or look it up on a # If the activity doesn't have references, we have no way to either generate useful data or look it up on a
# reference list, so just skip the lookup here. # reference list, so just skip the lookup here.
if activity_name.upper() == ActivityName.HEMA or activity_name.upper() == ActivityName.BIWOTA: if not activity.has_refs:
return activity_ref return activity_ref
### PROGRAMMATIC DATA GENERATION INSTEAD OF LOOKUPS ### ### PROGRAMMATIC DATA GENERATION INSTEAD OF LOOKUPS ###
+1 -1
View File
@@ -2,7 +2,7 @@ from core.config import SERVER_OWNER_CALLSIGN
from data.band import Band from data.band import Band
# General software # General software
SOFTWARE_VERSION = "2.2-pre" SOFTWARE_VERSION = "2.2"
# HTTP headers used for spot providers that use HTTP # HTTP headers used for spot providers that use HTTP
HTTP_HEADERS = {"User-Agent": f"Spothole v{SOFTWARE_VERSION} (operated by {SERVER_OWNER_CALLSIGN})"} HTTP_HEADERS = {"User-Agent": f"Spothole v{SOFTWARE_VERSION} (operated by {SERVER_OWNER_CALLSIGN})"}
+1
View File
@@ -163,6 +163,7 @@ class ActivityRefType(str, Enum):
BUILDING = "BUILDING" BUILDING = "BUILDING"
REGION = "REGION" REGION = "REGION"
GRID = "GRID" GRID = "GRID"
SATELLITE = "SATELLITE"
TOILET = "TOILET" TOILET = "TOILET"
+10
View File
@@ -156,3 +156,13 @@ def get_callsign_object_from_pyhamtools_callinfo(callsign, callinfo):
except (KeyError, ValueError): except (KeyError, ValueError):
# Unknown callsign, can't look anything up, return a Callsign object with basic data so that gets cached # Unknown callsign, can't look anything up, return a Callsign object with basic data so that gets cached
return Callsign(call=callsign) return Callsign(call=callsign)
def decode_telnet_bytes(data: bytes) -> str:
"""Decode a line of text received from a telnet connection, which might be UTF-8 or Latin-1 depending on the
whims of the server owner."""
try:
return data.decode("utf-8")
except UnicodeDecodeError:
return data.decode("latin-1")
+7 -5
View File
@@ -20,9 +20,7 @@ ACTIVITIES: dict[ActivityName, Activity] = {
sig_type=ActivityType.TRADITIONAL, sig_type=ActivityType.TRADITIONAL,
has_refs=False, has_refs=False,
refs_globally_unique=False, refs_globally_unique=False,
# DXpedition stations are never really spotted with "DXpedition" in the comments, but we can assign comment_names=["DXPEDITION"],
# this activity to a spot other ways.
comment_names=[],
icon="fa-book-atlas", icon="fa-book-atlas",
alerts_possible=True, alerts_possible=True,
), ),
@@ -30,8 +28,12 @@ ACTIVITIES: dict[ActivityName, Activity] = {
name=ActivityName.SATELLITE, name=ActivityName.SATELLITE,
description="Amateur Radio Satellite", description="Amateur Radio Satellite",
sig_type=ActivityType.TRADITIONAL, sig_type=ActivityType.TRADITIONAL,
has_refs=False, # Satellite "references" are the names of the satellites themselves. This is not an exhaustive list, it just
refs_globally_unique=False, # matches some of the most commonly used amateur radio satellites so they can be picked out of spot comments.
has_refs=True,
refs_globally_unique=True,
ref_type=ActivityRefType.SATELLITE,
ref_regex=r"ISS|AO-(?:7|27|73|91|95|123)|QO-100|QO100|QO 100|RS-44|SO-50",
comment_names=[], comment_names=[],
icon="fa-satellite", icon="fa-satellite",
alerts_possible=True, alerts_possible=True,
+34 -6
View File
@@ -5,6 +5,7 @@ from dataclasses import dataclass, field
from datetime import datetime, timedelta from datetime import datetime, timedelta
import pytz import pytz
from pyhamtools.locator import locator_to_latlong, latlong_to_locator
from core.activity_lookup_helper import populate_missing_activity_ref_info from core.activity_lookup_helper import populate_missing_activity_ref_info
from core.activity_utils import get_icon_for_activity from core.activity_utils import get_icon_for_activity
@@ -40,6 +41,11 @@ class Alert:
dx_cq_zone: int | None = None dx_cq_zone: int | None = None
# ITU zone of the DX operator # ITU zone of the DX operator
dx_itu_zone: int | None = None dx_itu_zone: int | None = None
# Maidenhead grid locator for the DX. This could be from a geographical reference e.g. POTA or grid.
dx_grid: str | None = None
# Latitude & longitude of the DX, in degrees. This could be from a geographical reference e.g. POTA or grid.
dx_latitude: float | None = None
dx_longitude: float | None = None
# General alert info # General alert info
@@ -108,8 +114,7 @@ class Alert:
if self.received_time and not self.received_time_iso: if self.received_time and not self.received_time_iso:
self.received_time_iso = datetime.fromtimestamp(self.received_time, pytz.UTC).isoformat() self.received_time_iso = datetime.fromtimestamp(self.received_time, pytz.UTC).isoformat()
# DX country, continent, zones etc. from callsign. CQ/ITU zone are better looked up with a location but we don't # DX country, continent, zones etc. from callsign.
# have a real location for alerts.
if self.dx_calls and self.dx_calls[0]: if self.dx_calls and self.dx_calls[0]:
call_info = get_call_info(self.dx_calls[0], credentials) call_info = get_call_info(self.dx_calls[0], credentials)
if self.dx_calls and self.dx_calls[0] and not self.dx_country: if self.dx_calls and self.dx_calls[0] and not self.dx_country:
@@ -125,18 +130,41 @@ class Alert:
if self.dx_dxcc_id and not self.dx_flag: if self.dx_dxcc_id and not self.dx_flag:
self.dx_flag = get_flag_for_dxcc(self.dx_dxcc_id) self.dx_flag = get_flag_for_dxcc(self.dx_dxcc_id)
# Fetch activity data. In case a particular API doesn't provide a full set of name, lat, lon & grid for a # Fetch activity data, and set a real position if we can get one.
# reference in its initial call, we use this code to populate the rest of the data. This includes working
# out grid refs from WAB and WAI, which count as an activity even though there's no real lookup, just maths
if self.sig_refs: if self.sig_refs:
for activity_ref in self.sig_refs: for activity_ref in self.sig_refs:
populate_missing_activity_ref_info(activity_ref) activity_ref = populate_missing_activity_ref_info(activity_ref)
# If the alert itself doesn't have location yet, but the activity ref does, extract it
if activity_ref.grid and not self.dx_grid:
self.dx_grid = activity_ref.grid
if (
activity_ref.latitude
and not self.dx_latitude
and activity_ref.longitude
and not self.dx_longitude
):
self.dx_latitude = activity_ref.latitude
self.dx_longitude = activity_ref.longitude
# If the spot itself doesn't have an activity yet, but we have at least one activity reference, take that # If the spot itself doesn't have an activity yet, but we have at least one activity reference, take that
# reference's activity and apply it to the whole spot. # reference's activity and apply it to the whole spot.
if self.sig_refs and self.sig_refs[0] and not self.sig: if self.sig_refs and self.sig_refs[0] and not self.sig:
self.sig = self.sig_refs[0].sig self.sig = self.sig_refs[0].sig
# DX Grid to lat/lon and vice versa in case one is missing
if self.dx_grid and (not self.dx_latitude or not self.dx_longitude):
try:
ll = locator_to_latlong(self.dx_grid)
self.dx_latitude = ll[0]
self.dx_longitude = ll[1]
except Exception:
logger.debug("Invalid grid received for spot", exc_info=True)
if self.dx_latitude and self.dx_longitude and not self.dx_grid:
try:
self.dx_grid = latlong_to_locator(self.dx_latitude, self.dx_longitude, 8)
except Exception:
logger.debug("Invalid lat/lon received for spot", exc_info=True)
# Create an ID based on the source and source ID if possible, as these guaranee uniqueness. If there is no # Create an ID based on the source and source ID if possible, as these guaranee uniqueness. If there is no
# source ID, use a combination of callsign and start time. Excluding things like the comment here allows for # source ID, use a combination of callsign and start time. Excluding things like the comment here allows for
# user updates of their alert comments without duplicating in the system. # user updates of their alert comments without duplicating in the system.
-39
View File
@@ -1,39 +0,0 @@
## Writing your own client
One of the key strengths of Spothole is that the API is well-defined and open to anyone to use. This means you can build
your own software that uses data from Spothole.
As well as the main API endpoints to fetch spots and alerts, with various possible query parameters, there are also
Server-Sent Events (SSE) API endpoints to receive a live feed, plus various utility lookup endpoints for things like
callsign and park data.
Various approaches exist to writing your own client, but in general:
* Refer to the API docs. These are built on an OpenAPI definition file (`/static/apidocs/openapi.yml`), which you can
automatically use to generate a client skeleton using various software.
* Call the main "spots" or "alerts" API endpoints to get the data you want. For example, your app could call
`https://spothole.app/api/v2/spots` once every few minutes. Apply filters if necessary.
* Call the "options" API to get an idea of which bands, modes etc. the server knows about. You might want to do that
first before calling the spots/alerts APIs, to allow you to populate your filters correctly.
* Refer to the provided HTML/JS interface for a reference on different approaches. For example, the "alerts"/"upcoming"
page simply query the main spot API on a timer, whereas the spots, map and bands pages combine this approach with
using the Server-Sent Events (SSE) endpoint to update live.
* Let me know if you get stuck, I'm happy to help.
Please don't hammer the API with an unnecessarily high request rate. For example, Spothole only queries the POTA API
once every two minutes, so if your client is interested in POTA data there's no need to poll Spothole any more often
than that.
If you absolutely must be informed within seconds of a spot arriving in Spothole, please use the SSE endpoints instead,
e.g. `https://spothole.app/api/v2/spots/stream`.
If you want to handle different types of spot or alert differently within your client, please consider making a single
request to the Spothole API to retrieve all the data, then filtering on your side. For example, call
`https://spothole.app/api/v2/spots?sig=POTA,SOTA` rather than making two separate calls to
`https://spothole.app/api/v2/spots?sig=POTA` and `https://spothole.app/api/v2/spots?sig=SOTA`.
Remember, here at Spothole Inc. we offer an industry-standard "five nines" uptime on our server, with our own unique
twist: we don't tell you which side of the decimal point the nines start! (Translation: This is a hobby project.
`spothole.app` runs on the same server as my blog and other stuff. It might go down without warning. By all means base
your own project on data from the main server if you like, but if you want any control over reliability and downtime,
please run your own copy instead.)
-41
View File
@@ -1,41 +0,0 @@
## Embedding Spothole in another website
You can embed Spothole's web interface in another website, e.g. for use as part of a ham radio custom dashboard.
URL parameters can be used to trigger an "embedded" mode which hides the headers, footers and settings. In this mode,
you provide configuration for the various filter and display options via additional URL parameters. Any settings that
the user has set for Spothole are ignored. This is so that the embedding site can select, for example, their choice of
dark mode or activity filters, which will not impact how Spothole appears when the user accesses it directly. Effectively, it
becomes separate to their normal Spothole settings.
Setting `embedded` to true is important for the rest of the settings to be applied; otherwise, the user's defaults will
be used in preference to the URL params.
These are supplied with the URL to the page you want to embed, for example for an embedded version of the band map in
dark mode, use `https://spothole.app/bands?embedded=true&dark-mode=true`. For an embedded version of the main spots/home
page in the system light/dark mode, use `https://spothole.app/?embedded=true`. For dark mode showing 70cm TOTA spots
only, use `https://spothole.app/?embedded=true&dark-mode=true&sig=TOTA&band=70cm`. Providing no URL params causes the
page to be loaded in the normal way it would when accessed directly in the user's browser.
The supported parameters are as follows. Generally these match the equivalent parameters in the real Spothole API, where
a mapping exists.
| Name | Allowed Values | Default | Example | Description |
|------------------|-------------------------|---------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `embedded` | `true`, `false` | `false` | `?embedded=true` | Enables embedded mode. |
| `color_scheme` | `light`, `dark`, `auto` | `auto` | `?color_scheme=dark` | Forces light or dark mode in preference to the operating system default. |
| `time_zone` | `UTC`, `local` | `UTC` | `?time_zone=local` | Sets times to be in UTC or local time. |
| `limit` | 10, 25, 50, 100 | 50 | `?limit=50` | Sets the number of spots that will be displayed on the main spots page |
| `limit` | 25, 50, 100, 200, 500 | 100 | `?limit=100` | Sets the number of alerts that will be displayed on the alerts page |
| `max_age` | 300, 600, 1800, 3600 | 1800 | `?max_age=1800` | Sets the maximum age of spots displayed on the map and bands pages, in seconds. |
| `band` | Comma-separated list | (all) | `?band=20m,40m` | Sets the list of bands that will be shown on the spots, bands and map pages. Available options match the labels of the buttons in the standard web interface. |
| `sig` | Comma-separated list | (all) | `?sig=POTA,SOTA,NO_SIG` | Sets the list of activities that will be shown on the spots, bands and map pages. Available options match the labels of the buttons in the standard web interface. |
| `source` | Comma-separated list | (all) | `?source=Cluster` | Sets the list of sources that will be shown on any spot or alert pages. Available options match the labels of the buttons in the standard web interface. |
| `mode_type` | Comma-separated list | (all) | `?mode_type=PHONE,CW` | Sets the list of mode types that will be shown on the spots, bands and map pages. Available options match the labels of the buttons in the standard web interface. |
| `dx_continent` | Comma-separated list | (all) | `?dx_continent=NA,SA` | Sets the list of DX Continents that will be shown on any spot or alert pages. Available options match the labels of the buttons in the standard web interface. |
| `de_continent` | Comma-separated list | (all) | `?de_continent=EU` | Sets the list of DE Continents that will be shown on the spots, bands and map pages. Available options match the labels of the buttons in the standard web interface. |
| `map-center-lat` | Numeric (decimal) | (auto) | `?map-center-lat=51.5` | Sets the initial latitude of the map centre on the map page. If omitted, the map auto-fits to the loaded spots. |
| `map-center-lon` | Numeric (decimal) | (auto) | `?map-center-lon=-0.1` | Sets the initial longitude of the map centre on the map page. If omitted, the map auto-fits to the loaded spots. |
| `map-zoom` | Numeric (integer) | (auto) | `?map-zoom=6` | Sets the initial zoom level of the map on the map page. If omitted, the map auto-fits to the loaded spots. |
See the comment at the end of the next section regarding reliability and uptime of the "main" server.
-79
View File
@@ -1,79 +0,0 @@
## Modifying the source code
Spothole is Public Domain licenced, so you can grab the source code and start modifying it for your own needs.
Contributions of code back to the main repository are encouraged, but completely optional.
### Code structure
To navigate your way around the source code, this list may help.
*Python back-end code*
* `/core` - Core classes and utilities
* `/data` - Data storage classes
* `/providers/spot` - Classes providing spots by accessing the APIs of other services
* `/providers/alert` - Classes providing alerts by accessing the APIs of other services
* `/providers/solarconditions` - Classes providing solar and propagation by accessing the APIs of other services
* `/providers/staticdata` - Classes providing static lookup data by accessing bundled data files or the APIs of other
services
* `/providers/callsign` - Classes providing callsign lookup data by accessing bundled data files or the APIs of other
services
* `/providers/activityrefdata` - Classes providing activity reference lookup data by accessing bundled data files or
the APIs of other services
* `/webserver` - Classes for running Spothole's own web server
* `/telnetserver` - Classes for running Spothole's telnet server
* `spothole.py` - Main application script
*Templates*
* `/templates` - Templates used for constructing Spothole's user-targeted HTML pages
*HTML/JS/CSS front-end code*
* `/static` - Root for static files served by the web server. These are all served from a path starting `/static/`.
* `/static/apidocs` - Contains the OpenAPI spec (`openapi.yml`)
* `/static/audio` - Audio files used by the web front-end
* `/static/css` - CSS files used by the web front-end
* `/static/img` - image files used by the web front-end
* `/static/js` - JavaScript used by the web front-end
* `/static/vendor` - Third-party libraries (CSS, JS, fonts and images)
*Miscellaneous*
* `/` - pip `requirements.txt`, config, README, etc.
* `/docs` - Documentation
* `/images` - Image sources
* `/datafiles` - Local data files, used by some providers when the data will never change and/or is not easily available
online in a format Spothole can handle
* `/cache` - Directory where Spothole stores all the data it uses that should be persisted to disk. Created on first
run.
### Extending the server
Spothole is designed to be easily extensible. If you want to write your own spot provider, for example, simply add a
module to the `providers.spot` package containing your class. (Currently, in order to be loaded correctly, the module
(file) name should be the same as the class name, but lower case.)
Your class should extend "SpotProvider"; if it operates by polling an HTTP Server on a timer, it can instead extend "
HTTPSpotProvider" where some of the work is done for you.
The class will need to implement a constructor that takes in the `provider_config` and provides it to the superclass
constructor, while also taking any other config parameters it needs.
If you're extending the base `SpotProvider` class, you will need to implement `start()` and `stop()` methods that start
and stop a separate thread which handles the provider's processing needs. The thread should call `submit()` or
`submit_batch()` when it has one or more spots to report.
If you're extending the `HTTPSpotProvider` class, you will need to provide a URI to query and an interval to the
superclass constructor. You'll then need to implement the `http_response_to_spots()` method which is called when new
data is retrieved. Your implementation should then call `submit()` or `submit_batch()` when it has one or more spots to
report.
When constructing spots, use the comments in the Spot class and the existing implementations as an example. All
parameters are optional, but you will at least want to provide a `time` (which must be timezone-aware) and a `dx_call`.
Finally, simply add the appropriate config to the `spot_providers` section of `config.yml`, and your provider should be
instantiated on startup.
The same approach as above is also used for alerts, and other types of providers. Give me a shout if you need any
advice.
-96
View File
@@ -1,96 +0,0 @@
## Multiple cluster nodes with different settings
Dan, S50U has written in with his Spothole cluster settings. He is using a cluster node which provides RBN spots, and
uses different SSIDs on his callsign to get different settings when logged into the same cluster node. For example:
```
-
class: "DXCluster"
name: "S50CLX"
enabled: true
host: "s50clx.si"
port: 41112
login_prompt: "login: "
login_callsign: "callsign-10"
```
Telnet to DXSpider and log in with "callsign-10" and execute the following commands:
`CLEAR/SPOTS ALL` (delete all previous filters)<br/>
`UNSET/ANN` (stop announce messages)<br/>
`UNSET/WCY` (stop wcy messages)<br/>
`UNSET/WWV` (stop wwv messages)<br/>
`SET/DX` (enable human DX spots)
```
-
class: "DXCluster"
name: "RBN CW"
enabled: true
host: "s50clx.si"
port: 41112
login_prompt: "login: "
login_callsign: "callsign-11"
allow_rbn_spots: true
enabled_by_default_in_web_ui: false
```
Telnet to DXSpider and log in with "callsign-11" and execute the following commands:
`CLEAR/SPOTS ALL` (delete all previous filters)<br/>
`UNSET/ANN` (stop announce messages)<br/>
`UNSET/WCY` (stop wcy messages)<br/>
`UNSET/WWV` (stop wwv messages)<br/>
`UNSET/DX` (stop human DX spots)<br/>
`SET/SKIMMER CW` (enable CW RBN spots)
```
-
class: "DXCluster"
name: "RBN RTTY"
enabled: true
host: "s50clx.si"
port: 41112
login_prompt: "login: "
login_callsign: "callsign-12"
allow_rbn_spots: true
enabled_by_default_in_web_ui: false
```
Telnet to DXSpider and log in with "callsign-12" and execute the following commands:
`CLEAR/SPOTS ALL` (delete all previous filters)<br/>
`UNSET/ANN` (stop announce messages)<br/>
`UNSET/WCY` (stop wcy messages)<br/>
`UNSET/WWV` (stop wwv messages)<br/>
`UNSET/DX` (stop human DX spots)<br/>
`SET/SKIMMER RTTY` (enable RTTY RBN spots)
```
-
class: "DXCluster"
name: "RBN FT4/8"
enabled: true
host: "s50clx.si"
port: 41112
login_prompt: "login: "
login_callsign: "callsign-13"
allow_rbn_spots: true
enabled_by_default_in_web_ui: false
```
Telnet to DXSpider and log in with "callsign-13" and execute the following commands:
`CLEAR/SPOTS ALL` (delete all previous filters)<br/>
`UNSET/ANN` (stop announce messages)<br/>
`UNSET/WCY` (stop wcy messages)<br/>
`UNSET/WWV` (stop wwv messages)<br/>
`UNSET/DX` (stop human DX spots)<br/>
`SET/SKIMMER FT` (enable FT RBN spots)
For each callsign-SSID, we also specify our basic information with commands:
`SET/NAME Spothole10`, Spothole11... etc.<br/>
`SET/QTH Cerkno`<br/>
`SET/QRA JN66XD`<br/>
`SET/HOME S50CLX`
-118
View File
@@ -1,118 +0,0 @@
## nginx Reverse Proxy configuration
Web servers generally serve their pages from port 80. However, it's best not to serve Spothole's web interface directly
on port 80, as that requires root privileges on a Linux system. It also and prevents us using HTTPS to serve a secure
site, since Spothole itself doesn't directly support acting as an HTTPS server. The normal solution to this is to use a
"reverse proxy" setup, where a general web server handles HTTP and HTTP requests (to port 80 & 443 respectively), then
passes on the request to the back-end application (in this case Spothole). nginx is a common choice for this general web
server.
To set up nginx as a reverse proxy that sits in front of Spothole, first ensure it's installed e.g.
`sudo apt install nginx`, and enabled e.g. `sudo systemd enable nginx`.
Create a file at `/etc/nginx/sites-available/` called `spothole`. Give it the following contents, replacing
`spothole.app` with the domain name on which you want to run Spothole. If you changed the port on which Spothole runs,
update that on the "proxy_pass" line, and if you installed Spothole somewhere other than `/home/spothole/spothole`,
adjust the alias location for serving static files.
(The latter section, configuring the nginx server to serve static files directly, improves efficiency because it saves
Spothole itself from serving JS, CSS etc. files. If you can't do this for some reason, e.g. your nginx and spothole are
on different computers, you can omit the `location /static/ {}` block.)
```nginx
server {
server_name spothole.app;
# Global proxy settings
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_connect_timeout 10s;
proxy_buffering on;
# Pass on IP address and host information to Spothole, in case logging this information is required
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
# Wellknown area for Lets Encrypt
location /.well-known/ {
alias /var/www/html/.well-known/;
}
# Load static assets directly from the Spothole static directory
location /static/ {
alias /home/spothole/spothole/static/;
expires 1h;
add_header Cache-Control "public, max-age=3600, must-revalidate";
}
# SSE endpoints
location ~ ^/api/v\d*/(spots|alerts)/stream/? {
proxy_pass http://127.0.0.1:8080;
# Remove buffering, remove caching, add suitable timeouts for SSE API calls
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 24h;
proxy_send_timeout 24h;
proxy_set_header X-Accel-Buffering no;
add_header Cache-Control no-store always;
# Allow cross-origin requests to API
proxy_hide_header Access-Control-Allow-Origin;
add_header Access-Control-Allow-Origin * always;
}
# Other API endpoints
location /api/ {
proxy_pass http://127.0.0.1:8080;
# Remove buffering, remove caching, add suitable timeouts for API calls
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 30s;
add_header Cache-Control no-store always;
# Allow cross-origin requests to API
proxy_hide_header Access-Control-Allow-Origin;
add_header Access-Control-Allow-Origin * always;
}
# Templated pages
location / {
proxy_pass http://127.0.0.1:8080;
proxy_read_timeout 30s;
add_header Cache-Control "no-cache, must-revalidate" always;
}
}
```
One further change you might want to make to the file above is the `add_header Access-Control-Allow-Origin` statements.
These are what's used on my own Spothole server to make sure that other third-party web-based software can get the data
from my instance, and applies to any endpoint underneath `/api`. If you want *your* Spothole instance to be set up the
same way, so that others can write software in JavaScript that can access it, leave this intact. But if you want your
Spothole instance to only be usable by scripts running on the web server you write, you can remove these lines. (Note
that this doesn't stop other people writing *non-web-based* software that accesses your Spothole API&mdash;the
enforcement of cross-origin headers only happens within the user's browser. If you need to lock your instance down so
that no-one else can access it with *any* software, that's an aspect of nginx or firewall config that you will need to
find help with elsewhere.)
Now, make a symbolic link to enable the site:
```bash
cd /etc/nginx/sites-enabled
sudo ln -sf ../sites-available/spothole
```
Test that your nginx config isn't broken using `nginx -t`. If it works, restart nginx with
`sudo systemctl restart nginx`.
If you haven't already done so, set up a DNS entry to make sure requests for your domain name end up at the server
that's running Spothole.
You should now be able to access the web interface by going to the domain from your browser.
Once that's working, [install certbot](https://certbot.eff.org/instructions?ws=nginx&os=snap) onto your server. Run it
as root, and when prompted pick your domain name from the list. After a few seconds, it should successfully provision a
certificate and modify your nginx config files automatically. You should then be able to access the site via HTTPS.
-54
View File
@@ -1,54 +0,0 @@
## Running your own copy
If you want to run a copy of Spothole with different configuration settings than the main instance, you can download it
and run it on your own local machine or server.
You will require Python version 3.10 or later. If you encounter an error about `gdal-config` during the following
process, you will also need `libgdal-dev` installed.
To download and set up Spothole on a Debian server, run the following commands. Other operating systems will likely be
similar.
```bash
git clone ssh://git@git.ianrenton.com/ian/spothole.git
cd spothole
python3 -m venv ./.venv
source .venv/bin/activate
pip install -r requirements.txt
deactivate
cp config-example.yml config.yml
```
Then edit `config.yml` in your text editor of choice to set up the software as you like it. Mostly, this will involve
enabling or disabling the various providers of spot and alert data.
By default, all outdoor programme providers are enabled, as is one cluster node and the NG3K DXpedition data. The RBN
spot providers are turned off by default due to the volume of traffic from CW/RTTY/FT8 skimmers, and the APRS and Packet
spot providers are off by default on the assumption that Spothole users want a spot with a human at the other end of it,
but all can be easily re-enabled.
Other parameters you will want to update include the base URL to your instance, and whether you want to serve a full
web-based DX cluster interface or just the API endpoints for client software to use.
`config.yml` has an entry for a Clublog API key. If provided, this will allow Spothole to retrieve some more information
about DX spots. The software will work just fine without it, but you may find a few country flags etc. are less accurate
or missing. Clublog API keys are free, but you'll need to get your own by submitting a helpdesk ticket and explaining
what you'll use it for. The admin team are happy with the rate of requests made by my Spothole server, so unless you
change the source code of yours to radically increase the rate of querying Clublog, I'm sure they will be fine with your
server too.
Once you're happy with the content of `config.yml`, you can proceed to running the software.
To run the software this time and any future times you want to run it directly from the command line:
```bash
source .venv/bin/activate
python3 spothole.py
```
The software can take a few seconds to start up, particularly if it's been run previously and has a large amount of
cache data to sort through. This is normal, don't panic! Once you see `You can access your copy of Spothole at
http://localhost:8080` in the log, your server is good to go.
If you see some errors on startup, check your configuration, e.g. in case you have specified a port for the web server
that is already in use by something else.
-34
View File
@@ -1,34 +0,0 @@
## systemd configuration
If you want Spothole to run automatically on startup on a Linux distribution that uses `systemd`, follow the
instructions here. For distros that don't use `systemd`, or Windows/OSX/etc., you can find generic instructions for your
OS online.
Create a file at `/etc/systemd/system/spothole.service`. Give it the following content, adjusting for the user you want
to run it as and the directory in which you have installed it:
```
[Unit]
Description=Spothole
After=syslog.target network.target
[Service]
Type=simple
User=spothole
WorkingDirectory=/home/spothole/spothole
ExecStart=/home/spothole/spothole/.venv/bin/python /home/spothole/spothole/spothole.py --serve-in-foreground
Restart=on-abort
[Install]
WantedBy=multi-user.target
```
Run the following:
```bash
sudo systemctl daemon-reload
sudo systemctl enable spothole
sudo systemctl start spothole
```
Check the service has started up correctly with `sudo journalctl -u spothole -f`.
+9 -6
View File
@@ -22,17 +22,20 @@ class Hamsat(HTTPAlertProvider):
# Iterate through source data # Iterate through source data
for source_alert in http_response.json()["data"]: for source_alert in http_response.json()["data"]:
# Convert to our alert format # Convert to our alert format
freqs_modes = source_alert.get("mode", "") freqs_modes = source_alert.get("mode") or ""
if "mhz" in source_alert: mhz = source_alert.get("mhz")
if "mhz_direction" in source_alert: if mhz is not None:
freqs_modes = f"{source_alert['mhz']!s} {source_alert['mhz_direction']}, {freqs_modes}" mhz_direction = source_alert.get("mhz_direction")
if mhz_direction is not None:
freqs_modes = f"{mhz!s} {mhz_direction}, {freqs_modes}"
else: else:
freqs_modes = f"{source_alert['mhz']!s}, {freqs_modes}" freqs_modes = f"{mhz!s}, {freqs_modes}"
alert = Alert( alert = Alert(
source=self.name, source=self.name,
source_id=source_alert["id"], source_id=source_alert["id"],
dx_calls=[source_alert["callsign"].upper()], dx_calls=[source_alert["callsign"].upper()],
dx_grid=source_alert["grids"][0],
freqs_modes=freqs_modes, freqs_modes=freqs_modes,
comment=source_alert["comment"], comment=source_alert["comment"],
sig=ActivityName.SATELLITE, sig=ActivityName.SATELLITE,
@@ -40,7 +43,7 @@ class Hamsat(HTTPAlertProvider):
sig_refs=[ sig_refs=[
ActivityRef( ActivityRef(
sig=ActivityName.SATELLITE, sig=ActivityName.SATELLITE,
id=f"{source_alert['satellite']['name']} from {source_alert['grids'][0]}", id=source_alert["satellite"]["name"],
) )
], ],
start_time=datetime.strptime(source_alert["aos_at"], "%Y-%m-%dT%H:%M:%SZ") start_time=datetime.strptime(source_alert["aos_at"], "%Y-%m-%dT%H:%M:%SZ")
+4
View File
@@ -1,6 +1,7 @@
import logging import logging
import urllib.parse import urllib.parse
from datetime import datetime, timedelta from datetime import datetime, timedelta
from xml.parsers.expat import ExpatError
import pytz import pytz
import xmltodict import xmltodict
@@ -60,6 +61,9 @@ class HamQTH(APIQueryCallsignDataProvider):
# Log this failure at debug level only, not our problem if user entered the wrong password. # Log this failure at debug level only, not our problem if user entered the wrong password.
logger.debug("HamQTH login details incorrect, failed to look up with HamQTH.") logger.debug("HamQTH login details incorrect, failed to look up with HamQTH.")
return None return None
except ExpatError:
logger.warning("HamQTH provided blank or malformed content when trying to authenticate")
return None
except Exception: except Exception:
logger.exception("Exception when getting HamQTH session key") logger.exception("Exception when getting HamQTH session key")
return None return None
+4
View File
@@ -1,6 +1,7 @@
import logging import logging
import urllib.parse import urllib.parse
from datetime import datetime, timedelta from datetime import datetime, timedelta
from xml.parsers.expat import ExpatError
import pytz import pytz
import xmltodict import xmltodict
@@ -56,6 +57,9 @@ class QRZ(APIQueryCallsignDataProvider):
# Log this failure at debug level only, not our problem if user entered the wrong password. # Log this failure at debug level only, not our problem if user entered the wrong password.
logger.debug("QRZ.com login details incorrect, failed to look up with QRZ.") logger.debug("QRZ.com login details incorrect, failed to look up with QRZ.")
return None return None
except ExpatError:
logger.warning("QRZ.com provided blank or malformed content when trying to authenticate")
return None
except Exception: except Exception:
logger.exception("Exception when getting QRZ.com session key") logger.exception("Exception when getting QRZ.com session key")
return None return None
+16 -98
View File
@@ -1,20 +1,17 @@
import logging import logging
import re import re
import socket
from datetime import datetime from datetime import datetime
from threading import Event, Lock, Thread
import pytz import pytz
import telnetlib3
from core.config import SERVER_OWNER_CALLSIGN from core.config import SERVER_OWNER_CALLSIGN
from data.spot import Spot from data.spot import Spot
from providers.spot.spot_provider import SpotProvider from providers.spot.telnet_spot_provider import TelnetSpotProvider
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class DXCluster(SpotProvider): class DXCluster(TelnetSpotProvider):
"""Spot provider for a DX Cluster. Hostname, port, login_prompt, login_callsign and allow_rbn_spots are provided in config. """Spot provider for a DX Cluster. Hostname, port, login_prompt, login_callsign and allow_rbn_spots are provided in config.
See config-example.yml for examples.""" See config-example.yml for examples."""
@@ -31,80 +28,29 @@ class DXCluster(SpotProvider):
"""Constructor requires hostname and port""" """Constructor requires hostname and port"""
name = provider_config.get("name", "Cluster") name = provider_config.get("name", "Cluster")
super().__init__(name, provider_config) allow_rbn_spots = provider_config.get("allow_rbn_spots", False)
self._hostname = provider_config["host"] self._spot_line_pattern = self._LINE_PATTERN_ALLOW_RBN if allow_rbn_spots else self._LINE_PATTERN_EXCLUDE_RBN
self._port = provider_config["port"] super().__init__(
self._login_prompt = provider_config.get("login_prompt", "login:") name,
self._login_callsign = provider_config.get("login_callsign", SERVER_OWNER_CALLSIGN) provider_config,
self._allow_rbn_spots = provider_config.get("allow_rbn_spots", False) host=provider_config["host"],
self._spot_line_pattern = ( port=provider_config["port"],
self._LINE_PATTERN_ALLOW_RBN if self._allow_rbn_spots else self._LINE_PATTERN_EXCLUDE_RBN login_prompt=provider_config.get("login_prompt", "login:"),
login_response=provider_config.get("login_callsign", SERVER_OWNER_CALLSIGN),
) )
self._telnet = None
self._telnet_lock = Lock()
self._thread = None
self._stop_event = Event()
def start(self): def _parse_line(self, line):
self._thread = Thread(target=self._handle, name=f"DXClusterSpotProvider-{self.name}", daemon=True) match = self._spot_line_pattern.match(line)
self._thread.start() if not match:
return None
def stop(self):
self._stop_event.set()
with self._telnet_lock:
if self._telnet:
try:
self._telnet.sock.shutdown(socket.SHUT_RDWR)
except (AttributeError, OSError):
pass
self._telnet.close()
if self._thread:
self._thread.join(timeout=5)
if self._thread.is_alive():
logger.warning(f"DX Cluster {self._hostname} worker thread did not exit on time and will be killed.")
def _handle(self):
while not self._stop_event.is_set():
connected = False
while not connected and not self._stop_event.is_set():
try:
self.status = "Connecting"
logger.info(f"DX Cluster {self._hostname} connecting...")
new_telnet = telnetlib3.Telnet(self._hostname, self._port)
with self._telnet_lock:
self._telnet = new_telnet
if self._stop_event.is_set():
# stop() was called while we were connecting, close the connection rather than trying to
# read when we know it won't work
new_telnet.close()
break
self._telnet.read_until(self._login_prompt.encode("latin-1"))
self._telnet.write(f"{self._login_callsign}\n".encode("latin-1"))
connected = True
logger.info(f"DX Cluster {self._hostname} connected.")
except ConnectionRefusedError:
self.status = "Error"
logger.warning(f"Connection refused to DX cluster {self._hostname}")
self._stop_event.wait(timeout=300)
except Exception:
self.status = "Error"
logger.exception(f"Exception while connecting to DX Cluster Provider ({self._hostname}).")
self._stop_event.wait(timeout=5)
self.status = "Waiting for Data"
while connected and not self._stop_event.is_set():
try:
# Check new telnet info against regular expression
telnet_output = self._telnet.read_until("\n".encode("latin-1"))
match = self._spot_line_pattern.match(telnet_output.decode("latin-1"))
if match:
spot_time = datetime.strptime(match.group(5), "%H%MZ").replace(tzinfo=pytz.UTC) spot_time = datetime.strptime(match.group(5), "%H%MZ").replace(tzinfo=pytz.UTC)
spot_datetime = datetime.combine( spot_datetime = datetime.combine(
datetime.now(pytz.UTC).date(), datetime.now(pytz.UTC).date(),
spot_time.time(), spot_time.time(),
tzinfo=pytz.UTC, tzinfo=pytz.UTC,
) )
spot = Spot( return Spot(
source=self.name, source=self.name,
dx_call=match.group(3), dx_call=match.group(3),
de_call=match.group(1), de_call=match.group(1),
@@ -112,31 +58,3 @@ class DXCluster(SpotProvider):
comment=match.group(4).strip(), comment=match.group(4).strip(),
time=spot_datetime.timestamp(), time=spot_datetime.timestamp(),
) )
# Add to our list
self._submit(spot)
self.status = "OK"
self.last_update_time = datetime.now(pytz.UTC)
logger.debug(f"Data received from DX Cluster {self._hostname}.")
except EOFError:
connected = False
if not self._stop_event.is_set():
self.status = "Restarting"
logger.warning(f"Disconnected from DX Cluster {self._hostname}. Reconnecting...")
self._stop_event.wait(timeout=5)
else:
logger.info(f"DX Cluster {self._hostname} shutting down...")
self.status = "Shutting down"
except Exception:
connected = False
if not self._stop_event.is_set():
self.status = "Error"
logger.exception(f"Exception in DX Cluster Provider ({self._hostname})")
self._stop_event.wait(timeout=5)
else:
logger.info(f"DX Cluster {self._hostname} shutting down...")
self.status = "Shutting down"
self.status = "Disconnected"
+16 -89
View File
@@ -1,22 +1,19 @@
import logging import logging
import re import re
import socket
from datetime import datetime from datetime import datetime
from threading import Event, Lock, Thread
import pytz import pytz
import telnetlib3
from core.config import SERVER_OWNER_CALLSIGN from core.config import SERVER_OWNER_CALLSIGN
from data.spot import Spot from data.spot import Spot
from providers.spot.spot_provider import SpotProvider from providers.spot.telnet_spot_provider import TelnetSpotProvider
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class RBN(SpotProvider): class RBN(TelnetSpotProvider):
"""Spot provider for the Reverse Beacon Network. Connects to a single port, if you want both CW/RTTY (port 7000) and FT8 """Spot provider for the Reverse Beacon Network. Connects to a single port, if you want both CW/RTTY (port 7000) and FT8
(port 7001) you need to instantiate two copies of this. The port is provided as an argument to the constructor.""" (port 7001) you need to instantiate two copies of this. The port is provided in config."""
_LINE_PATTERN = re.compile( _LINE_PATTERN = re.compile(
r"^DX de ([a-z0-9/]+)-.*:\s+([0-9.]+)\s+([a-z0-9/]+)\s+(.*)\s+(\d{4}Z)", r"^DX de ([a-z0-9/]+)-.*:\s+([0-9.]+)\s+([a-z0-9/]+)\s+(.*)\s+(\d{4}Z)",
@@ -27,69 +24,27 @@ class RBN(SpotProvider):
"""Constructor requires port number.""" """Constructor requires port number."""
name = provider_config.get("name", "RBN") name = provider_config.get("name", "RBN")
super().__init__(name, provider_config) super().__init__(
self._port = provider_config["port"] name,
self._telnet = None provider_config,
self._telnet_lock = Lock() host="telnet.reversebeacon.net",
self._thread = None port=provider_config["port"],
self._stop_event = Event() login_prompt="Please enter your call: ",
login_response=SERVER_OWNER_CALLSIGN,
)
def start(self): def _parse_line(self, line):
self._thread = Thread(target=self._handle, name=f"RBNSpotProvider-{self.name}", daemon=True) match = self._LINE_PATTERN.match(line)
self._thread.start() if not match:
return None
def stop(self):
self._stop_event.set()
with self._telnet_lock:
if self._telnet:
try:
self._telnet.sock.shutdown(socket.SHUT_RDWR)
except (AttributeError, OSError):
pass
self._telnet.close()
if self._thread:
self._thread.join(timeout=5)
if self._thread.is_alive():
logger.warning(f"RBN (port {self._port!s}) worker thread did not exit on time and will be killed.")
def _handle(self):
while not self._stop_event.is_set():
connected = False
while not connected and not self._stop_event.is_set():
try:
self.status = "Connecting"
logger.info(f"RBN port {self._port!s} connecting...")
new_telnet = telnetlib3.Telnet("telnet.reversebeacon.net", self._port)
with self._telnet_lock:
self._telnet = new_telnet
if self._stop_event.is_set():
# stop() was called while we were connecting, close the connection rather than trying to
# read when we know it won't work
new_telnet.close()
break
self._telnet.read_until("Please enter your call: ".encode("latin-1"))
self._telnet.write(f"{SERVER_OWNER_CALLSIGN}\n".encode("latin-1"))
connected = True
logger.info(f"RBN port {self._port!s} connected.")
except Exception:
self.status = "Error"
logger.exception(f"Exception while connecting to RBN (port {self._port!s}).")
self._stop_event.wait(timeout=5)
self.status = "Waiting for Data"
while connected and not self._stop_event.is_set():
try:
# Check new telnet info against regular expression
telnet_output = self._telnet.read_until("\n".encode("latin-1"))
match = self._LINE_PATTERN.match(telnet_output.decode("latin-1"))
if match:
spot_time = datetime.strptime(match.group(5), "%H%MZ").replace(tzinfo=pytz.UTC) spot_time = datetime.strptime(match.group(5), "%H%MZ").replace(tzinfo=pytz.UTC)
spot_datetime = datetime.combine( spot_datetime = datetime.combine(
datetime.now(pytz.UTC).date(), datetime.now(pytz.UTC).date(),
spot_time.time(), spot_time.time(),
tzinfo=pytz.UTC, tzinfo=pytz.UTC,
) )
spot = Spot( return Spot(
source=self.name, source=self.name,
dx_call=match.group(3), dx_call=match.group(3),
de_call=match.group(1), de_call=match.group(1),
@@ -97,31 +52,3 @@ class RBN(SpotProvider):
comment=match.group(4).strip(), comment=match.group(4).strip(),
time=spot_datetime.timestamp(), time=spot_datetime.timestamp(),
) )
# Add to our list
self._submit(spot)
self.status = "OK"
self.last_update_time = datetime.now(pytz.UTC)
logger.debug(f"Data received from RBN on port {self._port!s}.")
except EOFError:
connected = False
if not self._stop_event.is_set():
self.status = "Restarting"
logger.warning(f"Disconnected from RBN provider (port {self._port!s}). Reconnecting...")
self._stop_event.wait(timeout=5)
else:
logger.info(f"RBN provider (port {self._port!s}) shutting down...")
self.status = "Shutting down"
except Exception:
connected = False
if not self._stop_event.is_set():
self.status = "Error"
logger.exception(f"Exception in RBN provider (port {self._port!s})")
self._stop_event.wait(timeout=5)
else:
logger.info(f"RBN provider (port {self._port!s}) shutting down...")
self.status = "Shutting down"
self.status = "Disconnected"
+117
View File
@@ -0,0 +1,117 @@
import logging
import socket
from datetime import datetime
from threading import Event, Lock, Thread
import pytz
import telnetlib3
from core.utils import decode_telnet_bytes
from providers.spot.spot_provider import SpotProvider
logger = logging.getLogger(__name__)
class TelnetSpotProvider(SpotProvider):
"""Base class for spot providers that connect to a telnet server to receive spots."""
def __init__(self, name, provider_config, host, port, login_prompt, login_response):
"""Constructor. host/port are the telnet server to connect to. login_prompt is the text to wait for before
logging in, and login_response is the callsign to send in response."""
super().__init__(name, provider_config)
self._host = host
self._port = port
self._login_prompt = login_prompt
self._login_response = login_response
self._telnet = None
self._telnet_lock = Lock()
self._thread = None
self._stop_event = Event()
def _parse_line(self, line):
"""Parse a line of telnet output and return a Spot, or None if the line did not contain a spot. Subclasses
must implement this method."""
raise NotImplementedError("Subclasses must implement this method")
def start(self):
self._thread = Thread(target=self._handle, name=f"{self.name}SpotProvider", daemon=True)
self._thread.start()
def stop(self):
self._stop_event.set()
with self._telnet_lock:
if self._telnet:
try:
self._telnet.sock.shutdown(socket.SHUT_RDWR)
except (AttributeError, OSError):
pass
self._telnet.close()
if self._thread:
self._thread.join(timeout=5)
if self._thread.is_alive():
logger.warning(f"{self.name} worker thread did not exit on time and will be killed.")
def _handle(self):
while not self._stop_event.is_set():
connected = False
while not connected and not self._stop_event.is_set():
try:
self.status = "Connecting"
logger.info(f"{self.name} connecting to {self._host}:{self._port!s}...")
new_telnet = telnetlib3.Telnet(self._host, self._port)
with self._telnet_lock:
self._telnet = new_telnet
if self._stop_event.is_set():
# stop() was called while we were connecting, close the connection rather than trying to
# read when we know it won't work
new_telnet.close()
break
self._telnet.read_until(self._login_prompt.encode("latin-1"))
self._telnet.write(f"{self._login_response}\n".encode("latin-1"))
connected = True
logger.info(f"{self.name} connected.")
except ConnectionRefusedError:
self.status = "Error"
logger.warning(f"Connection refused to {self.name} ({self._host}:{self._port!s}).")
self._stop_event.wait(timeout=300)
except Exception:
self.status = "Error"
logger.exception(f"Exception while connecting to {self.name} ({self._host}:{self._port!s}).")
self._stop_event.wait(timeout=5)
self.status = "Waiting for Data"
while connected and not self._stop_event.is_set():
try:
# Check new telnet info against regular expression
telnet_output = self._telnet.read_until("\n".encode("latin-1"))
spot = self._parse_line(decode_telnet_bytes(telnet_output))
if spot:
# Add to our list
self._submit(spot)
self.status = "OK"
self.last_update_time = datetime.now(pytz.UTC)
logger.debug(f"Data received from {self.name}.")
except EOFError:
connected = False
if not self._stop_event.is_set():
self.status = "Restarting"
logger.warning(f"Disconnected from {self.name}. Reconnecting...")
self._stop_event.wait(timeout=5)
else:
logger.info(f"{self.name} shutting down...")
self.status = "Shutting down"
except Exception:
connected = False
if not self._stop_event.is_set():
self.status = "Error"
logger.exception(f"Exception in {self.name}")
self._stop_event.wait(timeout=5)
else:
logger.info(f"{self.name} shutting down...")
self.status = "Shutting down"
self.status = "Disconnected"
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "spothole" name = "spothole"
version = "2.2-pre" version = "2.2"
authors = [ authors = [
{ name = "Ian Renton", email = "ian@ianrenton.com" }, { name = "Ian Renton", email = "ian@ianrenton.com" },
] ]
+23 -7
View File
@@ -3,15 +3,15 @@ openapi: 3.1.0
info: info:
title: Spothole API title: Spothole API
description: |- description: |-
Spothole is a utility to aggregate "spots" from amateur radio DX clusters and xOTA spotting sites, and provide an open JSON API as well as a website to browse the data. Spothole is a utility to aggregate "spots" from amateur radio DX clusters and xOTA spotting sites, and provide an open JSON API as well as a website to browse the data. This page is an OpenAPI specification which describes Spothole's API. Clients can use this API to retrieve all the spots, alerts, and other information known to Spothole.
While there are other web-based interfaces to DX clusters, and sites that aggregate spots from various outdoor activity programmes for amateur radio, Spothole differentiates itself by supporting a large number of data sources, and by being "API first" rather than just providing a web front-end. This allows other software to be built on top of it. Spothole itself is also open source, Public Domain licenced code that anyone can take and modify. You can find out more information about Spothole at https://spothole.app/help, and specifically about creating a client to this API at https://spothole.app/help/usage/clients.
The API calls described below allow third-party software to access data from Spothole, and receive data on spots and alerts in a consistent format regardless of the data sources used by Spothole itself. Utility calls are also provided for general data lookups. The API provided by https://spothole.app is provided free of charge, and no authentication is required. By using it, you accept the following:
* You wrote the client code yourself, OR, if you got an AI to write it for you, you promise to read and understand what it wrote before contacting me about any problems.
Please note that the data coming out of Spothole is only as good as the data going in. People mis-hear and make typos when spotting callsigns all the time, and there are plenty of areas where Spothole's location data may be inaccurate. If you are doing something where accuracy is important, such as contesting, you should not rely on Spothole's data to fill in any gaps in your log. * You set a sensible refresh rate and will not try to take down the server by bombarding it with tons of requests.
* There is no uptime guarantee. This is a hobby project and sometimes I will accidentally break stuff.
Spothole's source code is located at https://git.ianrenton.com/ian/spothole and the README there provides setup instructions if you would like to run your own copy. A demonstration server of Spothole is located at https://spothole.app. The README also contains some examples of how you could query the API of the demonstration server to integrate the data into your own apps. * Trans rights are human rights.
## Changelog ## Changelog
@@ -21,6 +21,7 @@ info:
* Removed `alert_type` from alert data. Contest, DXpedition and Satellite alerts now give those values in `sig` instead, alongside the existing outdoor activity programmes. Teeeeechnically a breaking change but AlertType is so new I doubt anyone is using it yet, so slipped this one in anyway. Sorry :) * Removed `alert_type` from alert data. Contest, DXpedition and Satellite alerts now give those values in `sig` instead, alongside the existing outdoor activity programmes. Teeeeechnically a breaking change but AlertType is so new I doubt anyone is using it yet, so slipped this one in anyway. Sorry :)
* Added QRP, RaDAR Rally, /AM and /MM activities * Added QRP, RaDAR Rally, /AM and /MM activities
* Added `has_refs` and `alerts_possible` to Activity data * Added `has_refs` and `alerts_possible` to Activity data
* Added `dx_grid`, `dx_latitude` and `dx_longitude` to alert data
### 2.1 ### 2.1
@@ -1452,6 +1453,21 @@ components:
type: integer type: integer
description: ITU zone of the DX operator description: ITU zone of the DX operator
example: 14 example: 14
dx_grid:
type: string
description: >
Maidenhead grid locator for the activator's location, if known.
example: IO91aa
dx_latitude:
type: number
description: >
Latitude of the activator's location, if known, in degrees.
example: 51.2345
dx_longitude:
type: number
description: >
Longitude of the activator's location, if known, in degrees.
example: -1.2345
freqs_modes: freqs_modes:
type: string type: string
description: An indication of the frequencies and modes that the activation will use, if provided. description: An indication of the frequencies and modes that the activation will use, if provided.
+6 -1
View File
@@ -266,6 +266,11 @@ function addAlertRowsToTable(tbody, alerts) {
} else { } else {
items[i] = `${escapeHtml(a["sig_refs"][i]["id"])}` items[i] = `${escapeHtml(a["sig_refs"][i]["id"])}`
} }
// If this is a satellite alert the ref will just be the satellite, but DX grid is also important, so
// show that if we can.
if (a["sig_refs"][i]["sig"] === "Satellite" && a["dx_grid"] != null) {
items[i] += " from " + a["dx_grid"];
}
} }
activityRefs = items.join(", "); activityRefs = items.join(", ");
} }
@@ -278,7 +283,7 @@ function addAlertRowsToTable(tbody, alerts) {
$tr.append(`<td class='nowrap'>${end_time_formatted}</td>`); $tr.append(`<td class='nowrap'>${end_time_formatted}</td>`);
} }
if (showDX) { if (showDX) {
$tr.append(`<td class='nowrap'><span class='flag-wrapper hideonmobile' title='${dx_country}'>${dx_flag}</span>${dx_calls_html}${dx_country_html}</td>`); $tr.append(`<td><span class='flag-wrapper hideonmobile' title='${dx_country}'>${dx_flag}</span>${dx_calls_html}${dx_country_html}</td>`);
} }
if (showFreqsModes) { if (showFreqsModes) {
$tr.append(`<td class='hideonmobile'>${freqsModesText}</td>`); $tr.append(`<td class='hideonmobile'>${freqsModesText}</td>`);
+6
View File
@@ -123,13 +123,19 @@ class TelnetServer:
except asyncio.CancelledError: except asyncio.CancelledError:
pass pass
except (TimeoutError, ConnectionResetError):
logger.debug("Telnet client connection timed out or was reset by client")
except Exception: except Exception:
logger.exception("Exception handling telnet client") logger.exception("Exception handling telnet client")
finally: finally:
logger.debug("Telnet client disconnected") logger.debug("Telnet client disconnected")
self._clients.remove(writer) self._clients.remove(writer)
try:
writer.close() writer.close()
await writer.wait_closed() await writer.wait_closed()
except (TimeoutError, ConnectionResetError, OSError):
# Socket already closed or timed out, don't care as we were getting rid of it anyway
pass
def stop(self): def stop(self):
"""Stops the telnet server""" """Stops the telnet server"""
-236
View File
@@ -1,236 +0,0 @@
{% extends "base.html" %}
{% block content %}
<div id="info-container" class="mt-4">
<h2 class="mt-4 mb-4">About Spothole</h2>
<p>Spothole is a utility to aggregate "spots" from amateur radio DX clusters and xOTA spotting sites, and provide an
open JSON API as well as a website to browse the data.</p>
<p>While there are several other web-based interfaces to DX clusters, and sites that aggregate spots from various
outdoor activity programmes for amateur radio, Spothole differentiates itself by supporting a larger number of
data sources, and by being "API first" rather than just providing a web front-end. This allows other software to
be built on top of it.</p>
<p>The API is deliberately well-defined with an <a href="/apidocs/openapi.yml">OpenAPI specification</a> and <a
href="/apidocs">API documentation</a>. The API delivers spots in a consistent format regardless of the data
source, freeing developers from needing to know how each individual data source presents its data.</p>
<p>Spothole itself is also open source, Public Domain licenced code that anyone can take and modify. <a
href="https://git.ianrenton.com/ian/spothole/">The source code is here</a>.</p>
<p>The software was written by <a href="https://ianrenton.com">Ian Renton, MØTRT</a> with code contributions by
Steven, M1SDH. The full list of thanks due to others can be found at the bottom of this page.</p>
<p>This server is running Spothole version {{software_version}}.</p>
<h2 class="mt-4 mb-4">Using Spothole</h2>
<p>There are a number of different ways to use Spothole, depending on what you want to do with it and your level of
technical skill:</p>
<ol>
<li>You can <b>use it on the web</b>, like you are (probably) doing right now. This is how most people use it,
to look up spots and alerts, and make interesting QSOs.
</li>
<li>If you are using an Android or iOS device, you can <b>"install" it on your device</b>. Spothole is a
Progressive Web App, meaning it's not delivered through app stores, but if you open the page on Chrome
(Android) or Safari (iOS) there will be an option in the menu to install it. It will then appear in your
main app menu.
</li>
<li>You can <b>embed the web interface in another website</b> to show its spots in a custom dashboard or the
like. The usage is explained in more detail in the <a
href="https://git.ianrenton.com/ian/spothole/src/branch/main/README.md">README file</a>.
</li>
{% if telnet_server_enabled %}
<li>You can use it as a traditional telnet-based source of spots, similar to DXSpider and other software, <b>in
your desktop logging application</b>. To do this, set up your logger with the server address
<code>{{ telnet_server_address }}</code> and port <code>{{ telnet_server_port }}</code>. You can also access
it from a terminal with <code>telnet {{ telnet_server_address }} {{ telnet_server_port }}</code>.
</li>
{% end %}
<li>You can <b>write your own client using the Spothole API</b>, using the main Spothole instance to provide
data, and do whatever you like with it. The README contains guidance on how to do this, and the full API
docs are linked above. You can also find reference implementations in the form of Spothole's own web-based
front end, plus my other two tools built on Spothole: <a href="https://fieldspotter.radio">Field Spotter</a>
and the <a href="https://qsomap.m0trt.radio">QSO Map Tool</a>.
</li>
<li>If you want to <b>run your own version of Spothole</b> so you can customise the configuration, such as
enabling sources that I disable on the main instance, you can do that too. The README contains not only
advice on how to set up Spothole but how to get it auto-starting with systemd, using an nginx reverse proxy,
and setting up HTTPS support with certbot.
</li>
<li>Finally, you can of course download the source code and <b>develop Spothole to meet your needs</b>. Whether
you contribute your changes back to the main repository is up to you. As usual, the README file contains
some advice on the structure of the repository, and how to get started writing your own spot provider.
</li>
</ol>
<h2 id="faq" class="mt-4">FAQ</h2>
<h4 class="mt-4">"Spots"? "DX Clusters"? What does any of this mean?</h4>
<p>This is a tool for amateur ("ham") radio users. Many amateur radio operators like to make contacts with others
who are doing something more interesting than sitting in their home "shack", such as people in rarely-seen
countries, remote islands, or on mountaintops. Such operators are often "spotted", i.e. when someone speaks to
them, they will put the details such as their operating frequency into an online system, to let others know
where to find them. A DX Cluster is one type of those systems. Most outdoor radio awards programmes, such as
"Parks on the Air" (POTA) have their own websites for posting spots.</p>
<p>Spothole is an "aggregator" for those spots, so it checks lots of different services for data, and brings it all
together in one place. So no matter what kinds of interesting spots you are looking for, you can find them
here.</p>
<p>As well as spots, it also provides a similar feed of "alerts". This is where amateur radio users who are going to
interesting places soon will announce their intentions.</p>
<h4 class="mt-4">What are "DX", "DE" and modes?</h4>
<p>In amateur radio terminology, the "DX" contact is the "interesting" one that is using the frequency shown and
looking for callers. They might be on a remote island or just in a local park, but either way it's interesting
enough that someone has "spotted" them. The callsign listed under "DE" is the person who entered the spot of the
"DX" operator. "Modes" are the type of communication they are using. For example you might see "CW" which is
Morse Code, or voice "modes" like SSB or FM, or more exotic "data" modes which are used for computer-to-computer
communication.</p>
<h4 class="mt-4">What data sources are supported?</h4>
<p>Spothole can retrieve spots from: <a href="https://www.dxcluster.info/telnet/">Telnet-based DX clusters</a>, the
<a href="https://www.reversebeacon.net/">Reverse Beacon Network (RBN)</a>, the <a
href="https://www.aprs-is.net/">APRS Internet Service (APRS-IS)</a>, <a href="https://pota.app">POTA</a>,
<a href="https://www.sota.org.uk/">SOTA</a>, <a href="https://wwff.co/">WWFF</a>, <a
href="https://www.cqgma.org/">GMA</a>, <a href="https://wwbota.net/">WWBOTA</a>, <a
href="http://www.hema.org.uk/">HEMA</a>, <a href="https://www.parksnpeaks.org/">Parks 'n' Peaks</a>, <a
href="https://ontheair.nz">ZLOTA</a>, <a href="https://www.wota.org.uk/">WOTA</a>, <a
href="https://llota.app">LLOTA</a>, <a href="https://wwtota.com">WWTOTA</a>, <a
href="https://tilesontheair.com/">Tiles on the Air</a>, the <a href="https://ukpacketradio.network/">UK
Packet Repeater Network</a>, and any site based on the <a href="https://github.com/nischu/xOTA">xOTA
software by nischu</a>.</p>
<p>Spothole can retrieve alerts from: <a href="https://www.ng3k.com/">NG3K</a>, <a href="https://pota.app">POTA</a>,
<a href="https://www.sota.org.uk/">SOTA</a>, <a href="https://wwff.co/">WWFF</a>, <a
href="https://www.parksnpeaks.org/">Parks 'n' Peaks</a>, <a href="https://www.wota.org.uk/">WOTA</a> and
<a href="https://www.beachesontheair.com/">BOTA</a>. It also fetches contest dates from
<a href="https://contestcalendar.com/">WA7BNM Contest Calendar</a> and RSGB contest calendars.</p>
<p>Spothole can retrieve solar and propagation condition data from <a href="https://www.hamqsl.com">HamQSL</a>, the
<a href="https://www.swpc.noaa.gov/">NOAA Space Weather Prediction Center</a>, the <a
href="https://giro.uml.edu/">Lowell GIRO Data Center</a> and <a href="https://prop.kc2g.com/">prop.kc2g.com</a>
by KC2G.</p>
<p>Spothole can also perform lookups for callsign data on behalf of the user from <a
href="https://qrz.com">QRZ.com</a> and <a href="https://hamqth.com">HamQTH</a>.</p>
<p>Note that the server owner has not necessarily enabled all these data sources. In particular it is common to
disable RBN, to avoid the server being swamped with FT8 traffic, and to disable APRS-IS and UK Packet Net so
that the server only displays stations where there is likely to be an operator physically present for a QSO.</p>
<p>Between the various data sources, the following activities / special interest groups are supported: Contests,
DXpeditions, Aeronautical Mobile, Maritime Mobile, EME/Moonbounce, Amateur Satellite, QRP, Parks on the Air
(POTA), Summits on the Air (SOTA), Worldwide Flora & Fauna (WWFF), Global Mountain Activity (GMA), Worldwide
Bunkers on the Air (WWBOTA), HuMPs Excluding Marilyns Award (HEMA), Islands on the Air (IOTA), Mills on the Air
(MOTA), the Amateur Radio Lighthouse Society (ARLHS), International Lighthouse Lightship Weekend (ILLW), Silos
on the Air (SIOTA), World Castles Award (WCA), New Zealand on the Air (ZLOTA), Keith Roget Memorial National
Parks Award (KRMNPA), South Australia National Parks and Conservation Parks Award (SANPCPA), Wainwrights on the
Air (WOTA), Beaches on the Air (BOTA), Lagos y Lagunas On the Air (LLOTA), Towers on the Air, Tiles on
the Air, Worked All Britain (WAB), Worked All Ireland (WAI), Diploma Municipios de España (DME), Diploma
Faros de España (FEA), Diploma Muesos de España (DMUE), Diploma Castillos de España (DCE), Diploma Monumentos y
Vestigios de España (DMVE), Diploma Estaciones de Ferrocarril de España (DEFE), Diploma Teatri Musei e Belle
Arti (DTMBA), British Inland Waterways on the Air (BIWOTA), Castles on the Air (COTA), Polish Gmina Award (PGA),
Diplôme des Moulins de France (DMF), RaDAR Rally, and Toilets on the Air.</p>
<p>As of the time of writing in August 2026, I think Spothole captures most radio programmes that have a
defined, downloadable reference list, and almost certainly those that have a spotting/alerting API. If you know
of one I've missed, please let me know!</p>
<h4 class="mt-4">Why can I filter spots by both Activity and Source? Isn't that basically the same thing?</h4>
<p>Mostly, but not quite. While POTA spots generally come from the POTA source and so on, there are a few
exceptions:</p>
<ol>
<li>Sources like GMA and Parks 'n' Peaks provide spots for multiple different programmes (activities).</li>
<li>Cluster spots may name activities in their comment, in which case the source remains the Cluster, but an
activity is assigned.
</li>
<li>Some activities, such as Worked all Britain (WAB), don't have their own spotting site and can <em>only</em>
be identified through comments on spots retrieved from other sources.
</li>
</ol>
<p>Spothole's web interface exists not just for the end user, but also as a reference implementation for the API, so
I have chosen to demonstrate both methods of filtering.</p>
<h4 class="mt-4">How is this better than DXheat, DXsummit, POTA's own website, etc?</h4>
<p>It's probably not? But it's nice to have choice.</p>
<p>I think it's got three key advantages over those sites:</p>
<ol>
<li>It provides a public, <a href="/apidocs">well-documented API</a> with an <a href="/apidocs/openapi.yml">OpenAPI
specification</a>. Other sites don't have official APIs or don't bother documenting them publicly, because
they want people to use their web page. I like Spothole's web page, but you don't have to use it&mdash;if
you're a programmer, you can build your own software on Spothole's API. Spothole does the hard work of
taking all the various data sources and providing a consistent, well-documented data set. You can then do
the fun bit of writing your own application.
</li>
<li>It grabs data from a lot more sources. I've seen other sites that pull in DX Cluster and POTA spots
together, but nothing on the scale of what Spothole supports.
</li>
<li>Spothole is open source, so anyone can contribute the code to support a new data source or add new features,
and share them with the community.
</li>
</ol>
<h4 class="mt-4">Why does this website ask me if I want to install it?</h4>
<p>Spothole is a Progressive Web App, which means you can install it on an Android or iOS device by opening the site
in Chrome or Safari respectively, and clicking "Install" on the pop-up panel. It'll only prompt you once, so if
you dismiss the prompt and change your mind, you'll find an Install / Add to Home Screen option on your
browser's menu.</p>
<p>Installing Spothole on your phone is completely optional, the website works exactly the same way as the "app"
does.</p>
<h4 class="mt-4">Why hasn't my spot/alert shown up yet?</h4>
<p>To avoid putting too much load on the various servers that Spothole connects to, the Spothole server only polls
them once every two minutes for spots, and once every 30 minutes for alerts. (Some sources, such as DX clusters,
RBN, APRS-IS and WWBOTA use a non-polling mechanism, and their updates will therefore arrive more quickly.) Then
if you are using the web interface, that has its own rate at which it fetches the data from Spothole. This is
instant for the main spots list, with new spots appearing immediately at the top of the list, while the map and
bands displays update once a minute, and the alerts display updates once every 5 minutes. So you could be
waiting around three minutes to see a newly added spot, or 40 minutes to see a newly added alert.</p>
<h4 class="mt-4">What licence does Spothole use?</h4>
<p>Spothole's source code is licenced under the Public Domain. You can write a Spothole client, run your own server,
modify it however you like, you can claim you wrote it and charge people £1000 for a copy, I don't really mind.
(Please don't do the last one. But if you're using my code for something cool, it would be nice to hear from
you!)</p>
<h4 class="mt-4">What commands are supported in the telnet server?</h4>
<p>Currently, <code>exit</code>, and nothing else. Support for some DXSpider-like commands may be added to Spothole
in due course, but at the moment if you want to add Spothole as a telnet cluster data source to your desktop
logging application, that application must handle filtering itself.</p>
<h2 id="accuracy" class="mt-4">Data Accuracy</h2>
<p>Please note that the data coming out of Spothole is only as good as the data going in. People mis-hear and make
typos when spotting callsigns all the time. There are also plenty of cases where Spothole's data, particularly
location data, may be inaccurate. For example, there are POTA parks that span multiple US states, countries that
span multiple CQ zones, portable operators with no requirement to sign /P, etc. If you are doing something where
accuracy is important, such as contesting, you should not rely on Spothole's data to fill in any gaps in your
log.</p>
<p>In the Spothole user interface, under "Your Data", you can enter your credentials for QRZ.com and/or HamQTH if
you have them. This allows Spothole to augment its data with lookups from these services. See the following
section, Privacy, for details of how these are handled. If you are looking at the map and see lots of spots in
the geographic centre of countries, allowing these lookups will help. For QRZ.com a paid account is required to
look up operator locations.</p>
<h2 id="privacy" class="mt-4">Privacy</h2>
<p>Spothole collects no data about you on a permanent basis. All spots and alerts are "timed out" and deleted from
the system after a set interval, which by default is one hour for spots and one week for alerts.</p>
<p>Settings you select from Spothole's menus are sent to the server, in order to provide the data with the requested
filters. They are also stored in your browser's local storage, so that your preferences are remembered between
sessions.</p>
<p>The data you provide can optionally include your login credentials for QRZ.com and HamQTH. You can provide these
in the "Your Data" menu of most pages. If you do, Spothole will augment the data it produces with lookups from
these
services, which can for example provide more accurate markers on the map tab, and operator names when you mouse
over a DX callsign. Spothole will still work fine if you don't provide these. The values you enter are sent to
Spothole via HTTPS so are protected in transit, though of course you do have to trust Spothole with this
sensitive data in order to use this feature.</p>
<p>Any data you send as part of a query, such as your QRZ or HamQTH credentials, is used only for the lifetime of
that
query and is not saved anywhere apart from your own device.</p>
<p>Spothole uses no trackers, no ads, and no cookies.</p>
{% if len(web_ui_options["support_button_html"]) > 0 %}
<p><strong>Caveat: </strong> The owner of this server has chosen to inject their own content into the "spots" page.
This is designed for a "donate" or "support this server" button. The functionality of this injected content is
the responsibility of the server owner, rather than the Spothole software.</p>
{% end %}
<p>Spothole is open source, so you can audit <a href="https://git.ianrenton.com/ian/spothole">the code</a> if you
like.</p>
<h2 class="mt-4">Thanks</h2>
<p>This project would not have been possible without those volunteers who have taken it upon themselves to run DX
clusters, xOTA programmes, DXpedition lists, callsign lookup databases, solar conditions and propagation
modelling software, and other online tools on which Spothole's data is based. The vast majority of these are not
profit-seeking and are made purely for the love of the hobby and to help others in the community. Spothole is
standing on the shoulders of giants, who deserve a huge amount of thanks for all the work they put in.</p>
<p>The following people have specifically helped develop Spothole either by contributing code, requesting features,
or helping squash bugs: Steven M1SDH, Dan S50U, Matt W1CDN, Norby LX1NO, Andrew VK3ARR, Mario DL4MFM, Mark M5TEA,
Michael G7VJR, Rob G7LAS, Ed DD5LP, Raph F4LUB, Luc ON7KEC, Richard GD4OFB, Daniel PY2TDB, Alan VK1AO,
Andrew WK1AD, Ullrich DF5WC, Wayne N3CDF, Jonathan G4IVV, Erik N2EPE, Sorin YO9TSN, Matt HB9HWI, Priit ES1TEB,
Leigh KG7WED, Jouni OH3CUF, Onno VK6FLAB, and Bruce WA7BNM. (If I've forgotten you, let me know!)</p>
<p>Spothole is also dependent on a number of Python libraries, such as pyhamtools, and many JavaScript
libraries, as well as the Font Awesome icon set and flag icons from the Noto Color Emoji set, and MIT-licenced
GeoJSON files for CQ and ITU zones from HA8TKS.</p>
<p>The project's name was suggested by Harm DK4HAA.</p>
<p>This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around
the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.</p>
</div>
<script>$(document).ready(function () {
$("#nav-link-about").addClass("active");
}); <!-- highlight active page in nav --></script>
{% end %}
@@ -77,7 +77,7 @@
</div> </div>
<script src="/static/js/add-spot.js?v=1789927308"></script> <script src="/static/js/add-spot.js?v=1790228319"></script>
<script>$(document).ready(function () { <script>$(document).ready(function () {
$("#nav-link-add-spot").addClass("active"); $("#nav-link-add-spot").addClass("active");
}); <!-- highlight active page in nav --></script> }); <!-- highlight active page in nav --></script>
+1 -1
View File
@@ -85,7 +85,7 @@
</div> </div>
<script src="/static/js/alerts.js?v=1789927308"></script> <script src="/static/js/alerts.js?v=1790228319"></script>
<script>$(document).ready(function () { <script>$(document).ready(function () {
$("#nav-link-alerts").addClass("active"); $("#nav-link-alerts").addClass("active");
}); <!-- highlight active page in nav --></script> }); <!-- highlight active page in nav --></script>
+2 -2
View File
@@ -76,8 +76,8 @@
</div> </div>
<script src="/static/js/spotsbandsandmap.js?v=1789927308"></script> <script src="/static/js/spotsbandsandmap.js?v=1790228319"></script>
<script src="/static/js/bands.js?v=1789927308"></script> <script src="/static/js/bands.js?v=1790228319"></script>
<script>$(document).ready(function () { <script>$(document).ready(function () {
$("#nav-link-bands").addClass("active"); $("#nav-link-bands").addClass("active");
}); <!-- highlight active page in nav --></script> }); <!-- highlight active page in nav --></script>
+9 -9
View File
@@ -1,6 +1,6 @@
{% extends "skeleton.html" %} {% extends "skeleton.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/css/style.css?v=1789927308" type="text/css"> <link rel="stylesheet" href="/static/css/style.css?v=1790228319" type="text/css">
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet"> <link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet"> <link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet"> <link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
@@ -16,10 +16,10 @@
window.fetchEventSource = fetchEventSource; window.fetchEventSource = fetchEventSource;
</script> </script>
<script src="/static/js/utils.js?v=1789927308"></script> <script src="/static/js/utils.js?v=1790228319"></script>
<script src="/static/js/ui-ham.js?v=1789927308"></script> <script src="/static/js/ui-ham.js?v=1790228319"></script>
<script src="/static/js/geo.js?v=1789927308"></script> <script src="/static/js/geo.js?v=1790228319"></script>
<script src="/static/js/common.js?v=1789927308"></script> <script src="/static/js/common.js?v=1790228319"></script>
{% end %} {% end %}
{% block body %} {% block body %}
<div class="container"> <div class="container">
@@ -51,8 +51,8 @@
class="fa-solid fa-sun"></i> Conditions</a></li> class="fa-solid fa-sun"></i> Conditions</a></li>
<li class="nav-item ms-4"><a href="/status" class="nav-link" id="nav-link-status"><i <li class="nav-item ms-4"><a href="/status" class="nav-link" id="nav-link-status"><i
class="fa-solid fa-chart-simple"></i> Status</a></li> class="fa-solid fa-chart-simple"></i> Status</a></li>
<li class="nav-item ms-4"><a href="/about" class="nav-link" id="nav-link-about"><i <li class="nav-item ms-4"><a href="/help" class="nav-link" id="nav-link-help"><i
class="fa-solid fa-circle-info"></i> About</a></li> class="fa-solid fa-circle-question"></i> Help</a></li>
<li class="nav-item ms-4"><a href="/apidocs" class="nav-link" id="nav-link-api"><i <li class="nav-item ms-4"><a href="/apidocs" class="nav-link" id="nav-link-api"><i
class="fa-solid fa-gear"></i> API</a></li> class="fa-solid fa-gear"></i> API</a></li>
</ul> </ul>
@@ -75,10 +75,10 @@
v{{software_version}}</p> v{{software_version}}</p>
<ul class="nav col-md-4 justify-content-end"> <ul class="nav col-md-4 justify-content-end">
<li class="nav-item"> <li class="nav-item">
<a href="/about#faq" class="nav-link px-3 text-body-secondary">FAQ</a> <a href="/help/faq" class="nav-link px-3 text-body-secondary">FAQ</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="/about#privacy" class="nav-link px-3 text-body-secondary">Privacy</a> <a href="/help/privacy" class="nav-link px-3 text-body-secondary">Privacy</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="https://git.ianrenton.com/ian/spothole" class="nav-link px-3 text-body-secondary">Source <a href="https://git.ianrenton.com/ian/spothole" class="nav-link px-3 text-body-secondary">Source
+1 -1
View File
@@ -27,7 +27,7 @@
</button> </button>
</div> </div>
<div class="mt-1"> <div class="mt-1">
<small>See <a href="/about#privacy">Privacy</a> for more information.</small> <small>See <a href="/help/privacy">Privacy</a> for more information.</small>
</div> </div>
</div> </div>
</div> </div>
+1 -1
View File
@@ -27,7 +27,7 @@
</button> </button>
</div> </div>
<div class="mt-1"> <div class="mt-1">
<small>See <a href="/about#privacy">Privacy</a> for more information.</small> <small>See <a href="/help/privacy">Privacy</a> for more information.</small>
</div> </div>
</div> </div>
</div> </div>
+1 -1
View File
@@ -284,7 +284,7 @@
</div> </div>
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script> <script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
<script src="/static/js/conditions.js?v=1789927308"></script> <script src="/static/js/conditions.js?v=1790228319"></script>
<script>$(document).ready(function () { <script>$(document).ready(function () {
$("#nav-link-conditions").addClass("active"); $("#nav-link-conditions").addClass("active");
}); <!-- highlight active page in nav --></script> }); <!-- highlight active page in nav --></script>
+43
View File
@@ -0,0 +1,43 @@
{% extends "base.html" %}
{% block content %}
<div id="info-container" class="mt-4">
<h2>Help and Information</h2>
<p>Welcome to Spothole's help pages.</p>
<p>Spothole is a utility to aggregate spots from amateur radio DX clusters and xOTA spotting sites, and provide an
open JSON API as well as a website to browse the data. (If that sounds like nonsense to you, I recommend
starting with the <a href="/help/faq">FAQ</a>!)</p>
<p>In the sections below, you can find more information about what Spothole is, and how to use it.</p>
<ul>
<li><a href="/help/about">About Spothole</a></li>
<li><a href="/help/usage">How to use Spothole</a>
<ul>
{% if telnet_server_enabled %}
<li><a href="/help/usage/telnet">Connecting via Telnet</a></li>
{% end %}
<li><a href="/help/usage/clients">Writing your own Client</a></li>
<li><a href="/help/usage/embedding">Embedding Spothole in Another Website</a></li>
<li><a href="/help/usage/running">Running your own Server</a></li>
<ul>
<li><a href="/help/usage/systemd">systemd Configuration</a></li>
<li><a href="/help/usage/nginx">nginx Reverse Proxy Configuration</a></li>
<li><a href="/help/usage/docker">Running using Docker</a></li>
<li><a href="/help/usage/multicluster">Multiple Cluster Nodes with Different Settings</a></li>
</ul>
<li><a href="/help/usage/modifying">Modifying the Source Code</a></li>
</ul>
</li>
<li><a href="/help/sources">Supported Data Sources</a></li>
<li><a href="/help/faq">Frequently Asked Questions (FAQ)</a></li>
<li><a href="/apidocs">API Documentation</a></li>
<li><a href="/help/accuracy">Data Accuracy</a></li>
<li><a href="/help/privacy">Privacy</a></li>
<li><a href="/help/thanks">Thanks</a></li>
</ul>
</div>
<script>$(document).ready(function () {
$("#nav-link-help").addClass("active");
}); <!-- highlight active page in nav --></script>
{% end %}
+18
View File
@@ -0,0 +1,18 @@
{% extends "help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">About Spothole</h2>
<p>Spothole is a utility to aggregate "spots" from amateur radio DX clusters and xOTA spotting sites, and provide an
open JSON API as well as a website to browse the data.</p>
<p>While there are several other web-based interfaces to DX clusters, and sites that aggregate spots from various
outdoor activity programmes for amateur radio, Spothole differentiates itself by supporting a larger number of
data sources, and by being "API first" rather than just providing a web front-end. This allows other software to
be built on top of it.</p>
<p>The API is deliberately well-defined with an <a href="/apidocs/openapi.yml">OpenAPI specification</a> and <a
href="/apidocs">API documentation</a>. The API delivers spots in a consistent format regardless of the data
source, freeing developers from needing to know how each individual data source presents its data.</p>
<p>Spothole itself is also open source, Public Domain licenced code that anyone can take and modify. <a
href="https://git.ianrenton.com/ian/spothole/">The source code is here</a>.</p>
<p>This server is running Spothole version {{software_version}}.</p>
{% end %}
+17
View File
@@ -0,0 +1,17 @@
{% extends "help_page.html" %}
{% block help_content %}
<h2 class="mt-4">Data Accuracy</h2>
<p>Please note that the data coming out of Spothole is only as good as the data going in. People mis-hear and make
typos when spotting callsigns all the time. There are also plenty of cases where Spothole's data, particularly
location data, may be inaccurate. For example, there are POTA parks that span multiple US states, countries that
span multiple CQ zones, portable operators with no requirement to sign /P, etc. If you are doing something where
accuracy is important, such as contesting, you should not rely on Spothole's data to fill in any gaps in your
log.</p>
<p>In the Spothole user interface, under "Your Data", you can enter your credentials for QRZ.com and/or HamQTH if
you have them. This allows Spothole to augment its data with lookups from these services. See the <a
href="/help/privacy">Privacy</a> section for details of how these are handled. If you are looking at the
map and see lots of spots in the geographic centre of countries, allowing these lookups will help. For QRZ.com a
paid account is required to look up operator locations.</p>
{% end %}
+81
View File
@@ -0,0 +1,81 @@
{% extends "help_page.html" %}
{% block help_content %}
<h2 class="mt-4">Frequently Asked Questions (FAQ)</h2>
<h4 class="mt-4">"Spots"? "DX Clusters"? What does any of this mean?</h4>
<p>This is a tool for amateur ("ham") radio users. Many amateur radio operators like to make contacts with others
who are doing something more interesting than sitting in their home "shack", such as people in rarely-seen
countries, remote islands, or on mountaintops. Such operators are often "spotted", i.e. when someone speaks to
them, they will put the details such as their operating frequency into an online system, to let others know
where to find them. A DX Cluster is one type of those systems. Most outdoor radio awards programmes, such as
"Parks on the Air" (POTA) have their own websites for posting spots.</p>
<p>Spothole is an "aggregator" for those spots, so it checks lots of different services for data, and brings it all
together in one place. So no matter what kinds of interesting spots you are looking for, you can find them
here.</p>
<p>As well as spots, it also provides a similar feed of "alerts". This is where amateur radio users who are going to
interesting places soon will announce their intentions.</p>
<h4 class="mt-4">What are "DX", "DE" and modes?</h4>
<p>In amateur radio terminology, the "DX" contact is the "interesting" one that is using the frequency shown and
looking for callers. They might be on a remote island or just in a local park, but either way it's interesting
enough that someone has "spotted" them. The callsign listed under "DE" is the person who entered the spot of the
"DX" operator. "Modes" are the type of communication they are using. For example you might see "CW" which is
Morse Code, or voice "modes" like SSB or FM, or more exotic "data" modes which are used for computer-to-computer
communication.</p>
<h4 class="mt-4">Why can I filter spots by both Activity and Source? Isn't that basically the same thing?</h4>
<p>Mostly, but not quite. While POTA spots generally come from the POTA source and so on, there are a few
exceptions:</p>
<ol>
<li>Sources like GMA and Parks 'n' Peaks provide spots for multiple different programmes (activities).</li>
<li>Cluster spots may name activities in their comment, in which case the source remains the Cluster, but an
activity is assigned.
</li>
<li>Some activities, such as Worked all Britain (WAB), don't have their own spotting site and can <em>only</em>
be identified through comments on spots retrieved from other sources.
</li>
</ol>
<p>Spothole's web interface exists not just for the end user, but also as a reference implementation for the API, so
I have chosen to demonstrate both methods of filtering.</p>
<h4 class="mt-4">How is this better than DXheat, DXsummit, POTA's own website, etc?</h4>
<p>It's probably not? But it's nice to have choice.</p>
<p>I think it's got three key advantages over those sites:</p>
<ol>
<li>It provides a public, <a href="/apidocs">well-documented API</a> with an <a href="/apidocs/openapi.yml">OpenAPI
specification</a>. Other sites don't have official APIs or don't bother documenting them publicly, because
they want people to use their web page. I like Spothole's web page, but you don't have to use it&mdash;if
you're a programmer, you can build your own software on Spothole's API. Spothole does the hard work of
taking all the various data sources and providing a consistent, well-documented data set. You can then do
the fun bit of writing your own application.
</li>
<li>It grabs data from a lot more sources. I've seen other sites that pull in DX Cluster and POTA spots
together, but nothing on the scale of what Spothole supports.
</li>
<li>Spothole is open source, so anyone can contribute the code to support a new data source or add new features,
and share them with the community.
</li>
</ol>
<h4 class="mt-4">Why does this website ask me if I want to install it?</h4>
<p>Spothole is a Progressive Web App, which means you can install it on an Android or iOS device by opening the site
in Chrome or Safari respectively, and clicking "Install" on the pop-up panel. It'll only prompt you once, so if
you dismiss the prompt and change your mind, you'll find an Install / Add to Home Screen option on your
browser's menu.</p>
<p>Installing Spothole on your phone is completely optional, the website works exactly the same way as the "app"
does.</p>
<h4 class="mt-4">Why hasn't my spot/alert shown up yet?</h4>
<p>To avoid putting too much load on the various servers that Spothole connects to, the Spothole server only polls
them once every two minutes for spots, and once every 30 minutes for alerts. (Some sources, such as DX clusters,
RBN, APRS-IS and WWBOTA use a non-polling mechanism, and their updates will therefore arrive more quickly.) Then
if you are using the web interface, that has its own rate at which it fetches the data from Spothole. This is
instant for the main spots list, with new spots appearing immediately at the top of the list, while the map and
bands displays update once a minute, and the alerts display updates once every 5 minutes. So you could be
waiting around three minutes to see a newly added spot, or 40 minutes to see a newly added alert.</p>
<h4 class="mt-4">What licence does Spothole use?</h4>
<p>Spothole's source code is licenced under the Public Domain. You can write a Spothole client, run your own server,
modify it however you like, you can claim you wrote it and charge people £1000 for a copy, I don't really mind.
(Please don't do the last one. But if you're using my code for something cool, it would be nice to hear from
you!)</p>
<h4 class="mt-4">What commands are supported in the telnet server?</h4>
<p>Currently, <code>exit</code>, and nothing else. Support for some DXSpider-like commands may be added to Spothole
in due course, but at the moment if you want to add Spothole as a telnet cluster data source to your desktop
logging application, that application must handle filtering itself.</p>
{% end %}
+14
View File
@@ -0,0 +1,14 @@
{% extends "../base.html" %}
{% block content %}
<div id="info-container" class="mt-4">
<p class="small mb-0"><a href="/help">&laquo; Spothole Help</a></p>
{% block help_content %}{% end %}
<p class="small mt-4"><a href="/help">&laquo; Back</a></p>
</div>
<script>$(document).ready(function () {
$("#nav-link-help").addClass("active");
}); <!-- highlight active page in nav --></script>
{% end %}
+29
View File
@@ -0,0 +1,29 @@
{% extends "help_page.html" %}
{% block help_content %}
<h2 class="mt-4">Privacy</h2>
<p>Spothole collects no data about you on a permanent basis. All spots and alerts are "timed out" and deleted from
the system after a set interval, which by default is one hour for spots and one week for alerts.</p>
<p>Settings you select from Spothole's menus are sent to the server, in order to provide the data with the requested
filters. They are also stored in your browser's local storage, so that your preferences are remembered between
sessions.</p>
<p>The data you provide can optionally include your login credentials for QRZ.com and HamQTH. You can provide these
in the "Your Data" menu of most pages. If you do, Spothole will augment the data it produces with lookups from
these
services, which can for example provide more accurate markers on the map tab, and operator names when you mouse
over a DX callsign. Spothole will still work fine if you don't provide these. The values you enter are sent to
Spothole via HTTPS so are protected in transit, though of course you do have to trust Spothole with this
sensitive data in order to use this feature.</p>
<p>Any data you send as part of a query, such as your QRZ or HamQTH credentials, is used only for the lifetime of
that
query and is not saved anywhere apart from your own device.</p>
<p>Spothole uses no trackers, no ads, and no cookies.</p>
{% if len(web_ui_options["support_button_html"]) > 0 %}
<p><strong>Caveat: </strong> The owner of this server has chosen to inject their own content into the "spots" page.
This is designed for a "donate" or "support this server" button. The functionality of this injected content is
the responsibility of the server owner, rather than the Spothole software.</p>
{% end %}
<p>Spothole is open source, so you can audit <a href="https://git.ianrenton.com/ian/spothole">the code</a> if you
like.</p>
{% end %}
+47
View File
@@ -0,0 +1,47 @@
{% extends "help_page.html" %}
{% block help_content %}
<h2 class="mt-4">Supported Data Sources</h2>
<p>Spothole can retrieve spots from: <a href="https://www.dxcluster.info/telnet/">Telnet-based DX clusters</a>, the
<a href="https://www.reversebeacon.net/">Reverse Beacon Network (RBN)</a>, the <a
href="https://www.aprs-is.net/">APRS Internet Service (APRS-IS)</a>, <a href="https://pota.app">POTA</a>,
<a href="https://www.sota.org.uk/">SOTA</a>, <a href="https://wwff.co/">WWFF</a>, <a
href="https://www.cqgma.org/">GMA</a>, <a href="https://wwbota.net/">WWBOTA</a>, <a
href="http://www.hema.org.uk/">HEMA</a>, <a href="https://www.parksnpeaks.org/">Parks 'n' Peaks</a>, <a
href="https://ontheair.nz">ZLOTA</a>, <a href="https://www.wota.org.uk/">WOTA</a>, <a
href="https://llota.app">LLOTA</a>, <a href="https://wwtota.com">WWTOTA</a>, <a
href="https://tilesontheair.com/">Tiles on the Air</a>, the <a href="https://ukpacketradio.network/">UK
Packet Repeater Network</a>, and any site based on the <a href="https://github.com/nischu/xOTA">xOTA
software by nischu</a>.</p>
<p>Spothole can retrieve alerts from: <a href="https://www.ng3k.com/">NG3K</a>, <a href="https://pota.app">POTA</a>,
<a href="https://www.sota.org.uk/">SOTA</a>, <a href="https://wwff.co/">WWFF</a>, <a
href="https://www.parksnpeaks.org/">Parks 'n' Peaks</a>, <a href="https://www.wota.org.uk/">WOTA</a> and
<a href="https://www.beachesontheair.com/">BOTA</a>. It also fetches contest dates from
<a href="https://contestcalendar.com/">WA7BNM Contest Calendar</a> and RSGB contest calendars.</p>
<p>Spothole can retrieve solar and propagation condition data from <a href="https://www.hamqsl.com">HamQSL</a>, the
<a href="https://www.swpc.noaa.gov/">NOAA Space Weather Prediction Center</a>, the <a
href="https://giro.uml.edu/">Lowell GIRO Data Center</a> and <a href="https://prop.kc2g.com/">prop.kc2g.com</a>
by KC2G.</p>
<p>Spothole can also perform lookups for callsign data on behalf of the user from <a
href="https://qrz.com">QRZ.com</a> and <a href="https://hamqth.com">HamQTH</a>.</p>
<p>Note that the server owner has not necessarily enabled all these data sources. In particular it is common to
disable RBN, to avoid the server being swamped with FT8 traffic, and to disable APRS-IS and UK Packet Net so
that the server only displays stations where there is likely to be an operator physically present for a QSO.</p>
<p>Between the various data sources, the following activities / special interest groups are supported: Contests,
DXpeditions, Aeronautical Mobile, Maritime Mobile, EME/Moonbounce, Amateur Satellite, QRP, Parks on the Air
(POTA), Summits on the Air (SOTA), Worldwide Flora & Fauna (WWFF), Global Mountain Activity (GMA), Worldwide
Bunkers on the Air (WWBOTA), HuMPs Excluding Marilyns Award (HEMA), Islands on the Air (IOTA), Mills on the Air
(MOTA), the Amateur Radio Lighthouse Society (ARLHS), International Lighthouse Lightship Weekend (ILLW), Silos
on the Air (SIOTA), World Castles Award (WCA), New Zealand on the Air (ZLOTA), Keith Roget Memorial National
Parks Award (KRMNPA), South Australia National Parks and Conservation Parks Award (SANPCPA), Wainwrights on the
Air (WOTA), Beaches on the Air (BOTA), Lagos y Lagunas On the Air (LLOTA), Towers on the Air, Tiles on
the Air, Worked All Britain (WAB), Worked All Ireland (WAI), Diploma Municipios de España (DME), Diploma
Faros de España (FEA), Diploma Muesos de España (DMUE), Diploma Castillos de España (DCE), Diploma Monumentos y
Vestigios de España (DMVE), Diploma Estaciones de Ferrocarril de España (DEFE), Diploma Teatri Musei e Belle
Arti (DTMBA), British Inland Waterways on the Air (BIWOTA), Castles on the Air (COTA), Polish Gmina Award (PGA),
Diplôme des Moulins de France (DMF), RaDAR Rally, and Toilets on the Air.</p>
<p>As of the time of writing in August 2026, I think Spothole captures most radio programmes that have a
defined, downloadable reference list, and almost certainly those that have a spotting/alerting API. If you know
of one I've missed, please let me know!</p>
{% end %}
+24
View File
@@ -0,0 +1,24 @@
{% extends "help_page.html" %}
{% block help_content %}
<h2 class="mt-4">Thanks</h2>
<p>The software was written by <a href="https://ianrenton.com">Ian Renton, MØTRT</a> with code contributions by
Steven, M1SDH.</p>
<p>This project would not have been possible without those volunteers who have taken it upon themselves to run DX
clusters, xOTA programmes, DXpedition lists, callsign lookup databases, solar conditions and propagation
modelling software, and other online tools on which Spothole's data is based. The vast majority of these are not
profit-seeking and are made purely for the love of the hobby and to help others in the community. Spothole is
standing on the shoulders of giants, who deserve a huge amount of thanks for all the work they put in.</p>
<p>The following people have specifically helped develop Spothole either by contributing code, requesting features,
or helping squash bugs: Steven M1SDH, Dan S50U, Matt W1CDN, Norby LX1NO, Andrew VK3ARR, Mario DL4MFM, Mark M5TEA,
Michael G7VJR, Rob G7LAS, Ed DD5LP, Raph F4LUB, Luc ON7KEC, Richard GD4OFB, Daniel PY2TDB, Alan VK1AO,
Andrew WK1AD, Ullrich DF5WC, Wayne N3CDF, Jonathan G4IVV, Erik N2EPE, Sorin YO9TSN, Matt HB9HWI, Priit ES1TEB,
Leigh KG7WED, Jouni OH3CUF, Onno VK6FLAB, and Bruce WA7BNM. (If I've forgotten you, let me know!)</p>
<p>Spothole is also dependent on a number of Python libraries, such as pyhamtools, and many JavaScript
libraries, as well as the Font Awesome icon set and flag icons from the Noto Color Emoji set, and MIT-licenced
GeoJSON files for CQ and ITU zones from HA8TKS.</p>
<p>The project's name was suggested by Harm DK4HAA.</p>
<p>This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around
the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.</p>
{% end %}
+49
View File
@@ -0,0 +1,49 @@
{% extends "help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">How to use Spothole</h2>
<p>There are a number of different ways to use Spothole, depending on what you want to do with it and your level of
technical skill:</p>
<ol>
<li>You can <b>use it on the web</b>, like you are (probably) doing right now. This is how most people use it,
to look up spots and alerts, and make interesting QSOs.
</li>
<li>If you are using an Android or iOS device, you can <b>"install" it on your device</b>. Spothole is a
Progressive Web App, meaning it's not delivered through app stores, but if you open the page on Chrome
(Android) or Safari (iOS) there will be an option in the menu to install it. It will then appear in your
main app menu.
</li>
<li>You can <b>embed the web interface in another website</b> to show its spots in a custom dashboard or the
like. The usage is explained in more detail on the <a href="/help/usage/embedding">Embedding Spothole in
Another Website</a> page.
</li>
{% if telnet_server_enabled %}
<li>You can use it as a traditional telnet-based source of spots, similar to DXSpider and other software, <b>in
your desktop logging application</b>. To do this, set up your logger with the server address
<code>{{ telnet_server_address }}</code> and port <code>{{ telnet_server_port }}</code>. You can also access
it from a terminal with <code>telnet {{ telnet_server_address }} {{ telnet_server_port }}</code>.
</li>
{% end %}
<li>You can <b>write your own client using the Spothole API</b>, using the main Spothole instance to provide
data, and do whatever you like with it. The <a href="/help/usage/clients">Writing your own Client</a> page
contains guidance on how to do this, and the full API docs can be found <a href="/apidocs">here</a>. You can
also find reference implementations in the form
of Spothole's own web-based front end, plus my other two tools built on Spothole: <a
href="https://fieldspotter.radio">Field Spotter</a> and the <a href="https://qsomap.m0trt.radio">QSO
Map Tool</a>.
</li>
<li>If you want to <b>run your own version of Spothole</b> so you can customise the configuration, such as
enabling sources that I disable on the main instance, you can do that too. The <a
href="/help/usage/running">Running your own Copy</a> page explains how to set up Spothole, and
there are further pages on how to get it <a href="/help/usage/systemd">auto-starting with systemd</a>,
<a href="/help/usage/nginx">using an nginx reverse proxy and setting up HTTPS support with certbot</a>, or
<a href="/help/usage/docker">running it using Docker</a>.
</li>
<li>Finally, you can of course download the source code and <b>develop Spothole to meet your needs</b>. Whether
you contribute your changes back to the main repository is up to you. The <a
href="/help/usage/modifying">Modifying the Source Code</a> page contains some advice on the
structure of the repository, and how to get started writing your own spot provider.
</li>
</ol>
{% end %}
+53
View File
@@ -0,0 +1,53 @@
{% extends "../help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">Writing your own Client</h2>
<div class="alert alert-primary" role="alert">
<i class="fa-solid fa-circle-info"></i> <strong>Writing a Spothole client using AI?</strong><br/>The price of
creating a service with a nice API in 2025 is that a lot of people are going to vibe-code themselves a personal
ham radio dashboard using this data. That's fine, I can't stop you doing that, and I do appreciate the freedom of
creativity it gives to people who otherwise wouldn't create software. <em>However</em>, if an AI wrote your code and
it doesn't work, please don't jump straight to emailing me. Either take the time to understand the code yourself
first, or else ask your AI to fix its own mess. Thanks!
</div>
<p>One of the key strengths of Spothole is that the API is well-defined and open to anyone to use. This means you can
build your own software that uses data from Spothole.</p>
<p>As well as the main API endpoints to fetch spots and alerts, with various possible query parameters, there are also
Server-Sent Events (SSE) API endpoints to receive a live feed, plus various utility lookup endpoints for things like
callsign and park data.</p>
<p>Various approaches exist to writing your own client, but in general:</p>
<ul>
<li>Refer to the API docs. These are built on an OpenAPI definition file (<code>/static/apidocs/openapi.yml</code>),
which you can automatically use to generate a client skeleton using various software.
</li>
<li>Call the main "spots" or "alerts" API endpoints to get the data you want. For example, your app could call
<code>https://spothole.app/api/v2/spots</code> once every few minutes. Apply filters if necessary.
</li>
<li>Call the "options" API to get an idea of which bands, modes etc. the server knows about. You might want to do
that first before calling the spots/alerts APIs, to allow you to populate your filters correctly.
</li>
<li>Refer to the provided HTML/JS interface for a reference on different approaches. For example, the
"alerts"/"upcoming" page simply query the main spot API on a timer, whereas the spots, map and bands pages
combine this approach with using the Server-Sent Events (SSE) endpoint to update live.
</li>
<li>Let me know if you get stuck, I'm happy to help.</li>
</ul>
<p>Please don't hammer the API with an unnecessarily high request rate. For example, Spothole only queries the POTA API
once every two minutes, so if your client is interested in POTA data there's no need to poll Spothole any more often
than that.</p>
<p>If you absolutely must be informed within seconds of a spot arriving in Spothole, please use the SSE endpoints
instead, e.g. <code>https://spothole.app/api/v2/spots/stream</code>.</p>
<p>If you want to handle different types of spot or alert differently within your client, please consider making a
single request to the Spothole API to retrieve all the data, then filtering on your side. For example, call
<code>https://spothole.app/api/v2/spots?sig=POTA,SOTA</code> rather than making two separate calls to
<code>https://spothole.app/api/v2/spots?sig=POTA</code> and <code>https://spothole.app/api/v2/spots?sig=SOTA</code>.
</p>
<p>Remember, here at Spothole Inc. we offer an industry-standard "five nines" uptime on our server, with our own unique
twist: we don't tell you which side of the decimal point the nines start! (Translation: This is a hobby project.
<code>spothole.app</code> runs on the same server as my blog and other stuff. It might go down without warning. By
all means base your own project on data from the main server if you like, but if you want any control over
reliability and downtime, please run your own copy instead.)</p>
{% end %}
@@ -1,11 +1,11 @@
## Running using Docker {% extends "../help_page.html" %}
{% block help_content %}
Spothole comes with a Docker configuration to make it easy to run it in a containerised environment. To set it up using <h2 class="mt-4 mb-4">Running using Docker</h2>
Docker, the easiest way is to use a Docker Compose file. Create a new directory such as `/opt/docker/spothole` and <p>Spothole comes with a Docker configuration to make it easy to run it in a containerised environment. To set it up
create a `compose.yaml` file inside it with the following contents: using Docker, the easiest way is to use a Docker Compose file. Create a new directory such as <code>/opt/docker/spothole</code>
and create a <code>compose.yaml</code> file inside it with the following contents:</p>
```yaml <pre><code>services:
services:
spothole: spothole:
container_name: spothole container_name: spothole
build: build:
@@ -17,34 +17,29 @@ services:
volumes: volumes:
- ./config.yml:/app/config.yml - ./config.yml:/app/config.yml
- ./cache:/app/cache - ./cache:/app/cache
``` </code></pre>
<p>You can replace <code>#main</code> with any other branch or tag reference, for example <code>#1.5</code> to pin the
build to tagged version 1.5.</p>
<p>Save the file. You will still need to create a copy of <code>config-example.yml</code> and name it
<code>config.yml</code>, though with the Docker setup nothing has actually been downloaded yet, so you will have to
copy the example from the repository some other way, e.g. <a
href="https://git.ianrenton.com/ian/spothole/src/branch/main/config-example.yml">from the repo in a web
browser</a>.</p>
<p>With that in place, run <code>docker compose up</code> and you should be good to go. To detach, press <code>d</code>
or run the command with the <code>-d</code> flag.</p>
You can replace `#main` with any other branch or tag reference, for example `#1.5` to pin the build to tagged version <h3 class="mt-4">nginx Reverse Proxy with Docker</h3>
1.5. <p>In a containerised setup, it's typical to run an nginx reverse proxy in one container, alongside certbot for renewal
of HTTPS certificates, and then applications like Spothole in a separate container. In this case, there are a couple
Save the file. You will still need to create a copy of `config-example.yml` and name it `config.yml`, though with the of variations of the docker compose file above, and the nginx reverse proxy configuration covered <a
Docker setup nothing has actually been downloaded yet, so you will have to copy the example from the repository some href="/help/usage/nginx">here</a>, that you will want to make.</p>
other way, <ol>
e.g. [from the repo in a web browser](https://git.ianrenton.com/ian/spothole/src/branch/main/config-example.yml). <li>A port mapping is no longer required in the docker compose file; nginx will access into the docker container
directly on e.g. <code>http://spothole:8080</code></li>
With that in place, run `docker compose up` and you should be good to go. To detach, press `d` or run the command with <li>Spothole and nginx will need to be on the same docker network.</li>
the `-d` flag. </ol>
<p>So your <code>compose.yaml</code> might look like this:</p>
### nginx Reverse Proxy with Docker <pre><code>services:
In a containerised setup, it's typical to run an nginx reverse proxy in one container, alongside certbot for renewal of
HTTPS certificates, and then applications like Spothole in a separate container. In this case, there are a couple of
variations of the docker compose file above, and the nginx reverse proxy configuration covered [here](./nginx.md), that
you will want to make.
1. A port mapping is no longer required in the docker compose file; nginx will access into the docker container directly
on e.g. `http://spothole:8080`
2. Spothole and nginx will need to be on the same docker network.
So your `compose.yaml` might look like this:
```yaml
services:
spothole: spothole:
container_name: spothole container_name: spothole
build: build:
@@ -59,14 +54,11 @@ services:
networks: networks:
docker-network: docker-network:
external: true external: true
``` </code></pre>
<p>In your nginx site configuration, you'll want to refer to the Spothole container directly, and drop the block that
In your nginx site configuration, you'll want to refer to the Spothole container directly, and drop the block that allows nginx to access static files directly, as these will be inaccessible in another container. So you may end up
allows nginx to access static files directly, as these will be inaccessible in another container. So you may end up with with something like:</p>
something like: <pre><code>server {
```nginx
server {
server_name spothole.app; server_name spothole.app;
# Global proxy settings # Global proxy settings
@@ -145,19 +137,16 @@ server {
listen [::]:80; listen [::]:80;
return 404; return 404;
} }
``` </code></pre>
<p>If desired, you could even change the port on which Spothole runs from 8080 to a plain 80, in which case your
<code>proxy_pass</code> statements could drop the <code>:8080</code> suffix. Since Spothole is in a container, it
can serve HTTP on port 80 if desired, because it doesn't conflict with the host system.</p>
If desired, you could even change the port on which Spothole runs from 8080 to a plain 80, in which case your <h3 class="mt-4">Restoring the static files bypass</h3>
`proxy_pass` statements could drop the `:8080` suffix. Since Spothole is in a container, it can serve HTTP on port 80 if <p>If you would still like to bypass Spothole's web server for the static files, and serve them with nginx, you can do.
desired, because it doesn't conflict with the host system. The easiest way is to run another nginx container to serve the files, so your Spothole <code>compose.yaml</code>
becomes:</p>
### Restoring the static files bypass <pre><code>services:
If you would still like to bypass Spothole's web server for the static files, and serve them with nginx, you can do. The
easiest way is to run another nginx container to serve the files, so your Spothole `compose.yaml` becomes:
```yaml
services:
spothole: spothole:
container_name: spothole container_name: spothole
build: build:
@@ -183,16 +172,15 @@ services:
networks: networks:
docker-network: docker-network:
external: true external: true
``` </code></pre>
<p>Then you can re-add the block that handles the <code>/static</code> path in your nginx reverse proxy config, but this
Then you can re-add the block that handles the `/static` path in your nginx reverse proxy config, but this time point it time point it at the new container rather than at a filesystem path:</p>
at the new container rather than at a filesystem path: <pre><code> # Load static assets from the spothole-static-nginx container
```nginx
# Load static assets from the spothole-static-nginx container
location /static/ { location /static/ {
proxy_pass http://spothole-static-nginx/; proxy_pass http://spothole-static-nginx/;
expires 1h; expires 1h;
add_header Cache-Control "public, max-age=3600, must-revalidate"; add_header Cache-Control "public, max-age=3600, must-revalidate";
} }
``` </code></pre>
{% end %}
+162
View File
@@ -0,0 +1,162 @@
{% extends "../help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">Embedding Spothole in Another Website</h2>
<p>You can embed Spothole's web interface in another website, e.g. for use as part of a ham radio custom dashboard.</p>
<p>URL parameters can be used to trigger an "embedded" mode which hides the headers, footers and settings. In this mode,
you provide configuration for the various filter and display options via additional URL parameters. Any settings
that the user has set for Spothole are ignored. This is so that the embedding site can select, for example, their
choice of dark mode or activity filters, which will not impact how Spothole appears when the user accesses it
directly. Effectively, it becomes separate to their normal Spothole settings.</p>
<p>Setting <code>embedded</code> to true is important for the rest of the settings to be applied; otherwise, the user's
defaults will be used in preference to the URL params.</p>
<p>These are supplied with the URL to the page you want to embed, for example for an embedded version of the band map in
dark mode, use <code>https://spothole.app/bands?embedded=true&amp;dark-mode=true</code>. For an embedded version of
the main spots/home page in the system light/dark mode, use <code>https://spothole.app/?embedded=true</code>. For
dark mode showing 70cm TOTA spots only, use <code>https://spothole.app/?embedded=true&amp;dark-mode=true&amp;sig=TOTA&amp;band=70cm</code>.
Providing no URL params causes the page to be loaded in the normal way it would when accessed directly in the user's
browser.</p>
<p>The supported parameters are as follows. Generally these match the equivalent parameters in the real Spothole API,
where a mapping exists.</p>
<div class="table-responsive">
<table class="table table-sm table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Allowed Values</th>
<th>Default</th>
<th>Example</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>embedded</code></td>
<td><code>true</code>, <code>false</code></td>
<td><code>false</code></td>
<td><code>?embedded=true</code></td>
<td>Enables embedded mode.</td>
</tr>
<tr>
<td><code>color_scheme</code></td>
<td><code>light</code>, <code>dark</code>, <code>auto</code></td>
<td><code>auto</code></td>
<td><code>?color_scheme=dark</code></td>
<td>Forces light or dark mode in preference to the operating system default.</td>
</tr>
<tr>
<td><code>time_zone</code></td>
<td><code>UTC</code>, <code>local</code></td>
<td><code>UTC</code></td>
<td><code>?time_zone=local</code></td>
<td>Sets times to be in UTC or local time.</td>
</tr>
<tr>
<td><code>limit</code></td>
<td>10, 25, 50, 100</td>
<td>50</td>
<td><code>?limit=50</code></td>
<td>Sets the number of spots that will be displayed on the main spots page</td>
</tr>
<tr>
<td><code>limit</code></td>
<td>25, 50, 100, 200, 500</td>
<td>100</td>
<td><code>?limit=100</code></td>
<td>Sets the number of alerts that will be displayed on the alerts page</td>
</tr>
<tr>
<td><code>max_age</code></td>
<td>300, 600, 1800, 3600</td>
<td>1800</td>
<td><code>?max_age=1800</code></td>
<td>Sets the maximum age of spots displayed on the map and bands pages, in seconds.</td>
</tr>
<tr>
<td><code>band</code></td>
<td>Comma-separated list</td>
<td>(all)</td>
<td><code>?band=20m,40m</code></td>
<td>Sets the list of bands that will be shown on the spots, bands and map pages. Available options match the
labels of the buttons in the standard web interface.
</td>
</tr>
<tr>
<td><code>sig</code></td>
<td>Comma-separated list</td>
<td>(all)</td>
<td><code>?sig=POTA,SOTA,NO_SIG</code></td>
<td>Sets the list of activities that will be shown on the spots, bands and map pages. Available options
match the labels of the buttons in the standard web interface.
</td>
</tr>
<tr>
<td><code>source</code></td>
<td>Comma-separated list</td>
<td>(all)</td>
<td><code>?source=Cluster</code></td>
<td>Sets the list of sources that will be shown on any spot or alert pages. Available options match the
labels of the buttons in the standard web interface.
</td>
</tr>
<tr>
<td><code>mode_type</code></td>
<td>Comma-separated list</td>
<td>(all)</td>
<td><code>?mode_type=PHONE,CW</code></td>
<td>Sets the list of mode types that will be shown on the spots, bands and map pages. Available options
match the labels of the buttons in the standard web interface.
</td>
</tr>
<tr>
<td><code>dx_continent</code></td>
<td>Comma-separated list</td>
<td>(all)</td>
<td><code>?dx_continent=NA,SA</code></td>
<td>Sets the list of DX Continents that will be shown on any spot or alert pages. Available options match
the labels of the buttons in the standard web interface.
</td>
</tr>
<tr>
<td><code>de_continent</code></td>
<td>Comma-separated list</td>
<td>(all)</td>
<td><code>?de_continent=EU</code></td>
<td>Sets the list of DE Continents that will be shown on the spots, bands and map pages. Available options
match the labels of the buttons in the standard web interface.
</td>
</tr>
<tr>
<td><code>map-center-lat</code></td>
<td>Numeric (decimal)</td>
<td>(auto)</td>
<td><code>?map-center-lat=51.5</code></td>
<td>Sets the initial latitude of the map centre on the map page. If omitted, the map auto-fits to the loaded
spots.
</td>
</tr>
<tr>
<td><code>map-center-lon</code></td>
<td>Numeric (decimal)</td>
<td>(auto)</td>
<td><code>?map-center-lon=-0.1</code></td>
<td>Sets the initial longitude of the map centre on the map page. If omitted, the map auto-fits to the
loaded spots.
</td>
</tr>
<tr>
<td><code>map-zoom</code></td>
<td>Numeric (integer)</td>
<td>(auto)</td>
<td><code>?map-zoom=6</code></td>
<td>Sets the initial zoom level of the map on the map page. If omitted, the map auto-fits to the loaded
spots.
</td>
</tr>
</tbody>
</table>
</div>
<p>See the comment at the end of the <a href="/help/usage/clients">Writing your own Client</a> page regarding
reliability and uptime of the "main" server.</p>
{% end %}
+105
View File
@@ -0,0 +1,105 @@
{% extends "../help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">Modifying the source code</h2>
<p>Spothole is Public Domain licenced, so you can grab the source code and start modifying it for your own needs.
Contributions of code back to the main repository are encouraged, but completely optional.</p>
<p>The source code can be found at <a href="https://git.ianrenton.com/ian/spothole">https://git.ianrenton.com/ian/spothole</a>.
</p>
<p>I'm sorry this isn't on GitHub. There's too much noise on there now it's been given over to Copilot agents. If you
want to contribute code changes, that unfortunately means you'll have to sign up for an account on my Forgejo
server (linked above), or email me patch files the old-fashioned way. I'd hoped that Forgejo federation would be
working soon, so that at least you could use a Codeberg account rather than a new login specifically for my
instance, but unfortunately we're still waiting on that one!</p>
<h3 class="mt-4">Code structure</h3>
<p>To navigate your way around the source code, this list may help.</p>
<p><em>Python back-end code</em></p>
<ul>
<li><code>/core</code> - Core classes and utilities</li>
<li><code>/data</code> - Data storage classes</li>
<li><code>/providers/spot</code> - Classes providing spots by accessing the APIs of other services</li>
<li><code>/providers/alert</code> - Classes providing alerts by accessing the APIs of other services</li>
<li><code>/providers/solarconditions</code> - Classes providing solar and propagation by accessing the APIs of other
services
</li>
<li><code>/providers/staticdata</code> - Classes providing static lookup data by accessing bundled data files or the
APIs of other services
</li>
<li><code>/providers/callsign</code> - Classes providing callsign lookup data by accessing bundled data files or the
APIs of other services
</li>
<li><code>/providers/activityrefdata</code> - Classes providing activity reference lookup data by accessing bundled
data files or the APIs of other services
</li>
<li><code>/webserver</code> - Classes for running Spothole's own web server</li>
<li><code>/telnetserver</code> - Classes for running Spothole's telnet server</li>
<li><code>spothole.py</code> - Main application script</li>
</ul>
<p><em>Templates</em></p>
<ul>
<li><code>/templates</code> - Templates used for constructing Spothole's user-targeted HTML pages</li>
</ul>
<p><em>HTML/JS/CSS front-end code</em></p>
<ul>
<li><code>/static</code> - Root for static files served by the web server. These are all served from a path starting
<code>/static/</code>.
</li>
<li><code>/static/apidocs</code> - Contains the OpenAPI spec (<code>openapi.yml</code>)</li>
<li><code>/static/audio</code> - Audio files used by the web front-end</li>
<li><code>/static/css</code> - CSS files used by the web front-end</li>
<li><code>/static/img</code> - image files used by the web front-end</li>
<li><code>/static/js</code> - JavaScript used by the web front-end</li>
<li><code>/static/vendor</code> - Third-party libraries (CSS, JS, fonts and images)</li>
</ul>
<p><em>Miscellaneous</em></p>
<ul>
<li><code>/</code> - pip <code>requirements.txt</code>, config, README, etc.</li>
<li><code>/docs</code> - Documentation</li>
<li><code>/images</code> - Image sources</li>
<li><code>/datafiles</code> - Local data files, used by some providers when the data will never change and/or is not
easily available online in a format Spothole can handle
</li>
<li><code>/cache</code> - Directory where Spothole stores all the data it uses that should be persisted to disk.
Created on first run.
</li>
</ul>
<h3 class="mt-4">Extending the server</h3>
<p>Spothole is designed to be easily extensible. If you want to write your own spot provider, for example, simply add a
module to the <code>providers.spot</code> package containing your class. (Currently, in order to be loaded
correctly, the module
(file) name should be the same as the class name, but lower case.)</p>
<p>Your class should extend "SpotProvider"; if it operates by polling an HTTP Server on a timer, it can instead extend "
HTTPSpotProvider" where some of the work is done for you.</p>
<p>The class will need to implement a constructor that takes in the <code>provider_config</code> and provides it to the
superclass
constructor, while also taking any other config parameters it needs.</p>
<p>If you're extending the base <code>SpotProvider</code> class, you will need to implement <code>start()</code> and
<code>stop()</code> methods that start
and stop a separate thread which handles the provider's processing needs. The thread should call
<code>submit()</code> or
<code>submit_batch()</code> when it has one or more spots to report.</p>
<p>If you're extending the <code>HTTPSpotProvider</code> class, you will need to provide a URI to query and an interval
to the
superclass constructor. You'll then need to implement the <code>http_response_to_spots()</code> method which is
called when new
data is retrieved. Your implementation should then call <code>submit()</code> or <code>submit_batch()</code> when it
has one or more spots to
report.</p>
<p>When constructing spots, use the comments in the Spot class and the existing implementations as an example. All
parameters are optional, but you will at least want to provide a <code>time</code> (which must be timezone-aware)
and a <code>dx_call</code>.</p>
<p>Finally, simply add the appropriate config to the <code>spot_providers</code> section of <code>config.yml</code>, and
your provider should be
instantiated on startup.</p>
<p>The same approach as above is also used for alerts, and other types of providers. Give me a shout if you need any
advice.</p>
{% end %}
+83
View File
@@ -0,0 +1,83 @@
{% extends "../help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">Multiple Cluster Nodes with Different Settings</h2>
<p>Dan, S50U has written in with his Spothole cluster settings. He is using a cluster node which provides RBN spots, and
uses different SSIDs on his callsign to get different settings when logged into the same cluster node. For
example:</p>
<pre><code> -
class: "DXCluster"
name: "S50CLX"
enabled: true
host: "s50clx.si"
port: 41112
login_prompt: "login: "
login_callsign: "callsign-10"
</code></pre>
<p>Telnet to DXSpider and log in with "callsign-10" and execute the following commands:</p>
<p><code>CLEAR/SPOTS ALL</code> (delete all previous filters)<br/>
<code>UNSET/ANN</code> (stop announce messages)<br/>
<code>UNSET/WCY</code> (stop wcy messages)<br/>
<code>UNSET/WWV</code> (stop wwv messages)<br/>
<code>SET/DX</code> (enable human DX spots)</p>
<pre><code> -
class: "DXCluster"
name: "RBN CW"
enabled: true
host: "s50clx.si"
port: 41112
login_prompt: "login: "
login_callsign: "callsign-11"
allow_rbn_spots: true
enabled_by_default_in_web_ui: false
</code></pre>
<p>Telnet to DXSpider and log in with "callsign-11" and execute the following commands:</p>
<p><code>CLEAR/SPOTS ALL</code> (delete all previous filters)<br/>
<code>UNSET/ANN</code> (stop announce messages)<br/>
<code>UNSET/WCY</code> (stop wcy messages)<br/>
<code>UNSET/WWV</code> (stop wwv messages)<br/>
<code>UNSET/DX</code> (stop human DX spots)<br/>
<code>SET/SKIMMER CW</code> (enable CW RBN spots)</p>
<pre><code> -
class: "DXCluster"
name: "RBN RTTY"
enabled: true
host: "s50clx.si"
port: 41112
login_prompt: "login: "
login_callsign: "callsign-12"
allow_rbn_spots: true
enabled_by_default_in_web_ui: false
</code></pre>
<p>Telnet to DXSpider and log in with "callsign-12" and execute the following commands:</p>
<p><code>CLEAR/SPOTS ALL</code> (delete all previous filters)<br/>
<code>UNSET/ANN</code> (stop announce messages)<br/>
<code>UNSET/WCY</code> (stop wcy messages)<br/>
<code>UNSET/WWV</code> (stop wwv messages)<br/>
<code>UNSET/DX</code> (stop human DX spots)<br/>
<code>SET/SKIMMER RTTY</code> (enable RTTY RBN spots)</p>
<pre><code> -
class: "DXCluster"
name: "RBN FT4/8"
enabled: true
host: "s50clx.si"
port: 41112
login_prompt: "login: "
login_callsign: "callsign-13"
allow_rbn_spots: true
enabled_by_default_in_web_ui: false
</code></pre>
<p>Telnet to DXSpider and log in with "callsign-13" and execute the following commands:</p>
<p><code>CLEAR/SPOTS ALL</code> (delete all previous filters)<br/>
<code>UNSET/ANN</code> (stop announce messages)<br/>
<code>UNSET/WCY</code> (stop wcy messages)<br/>
<code>UNSET/WWV</code> (stop wwv messages)<br/>
<code>UNSET/DX</code> (stop human DX spots)<br/>
<code>SET/SKIMMER FT</code> (enable FT RBN spots)</p>
<p>For each callsign-SSID, we also specify our basic information with commands:</p>
<p><code>SET/NAME Spothole10</code>, Spothole11... etc.<br/>
<code>SET/QTH Cerkno</code><br/>
<code>SET/QRA JN66XD</code><br/>
<code>SET/HOME S50CLX</code></p>
{% end %}
+112
View File
@@ -0,0 +1,112 @@
{% extends "../help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">nginx Reverse Proxy Configuration</h2>
<p>Web servers generally serve their pages from port 80. However, it's best not to serve Spothole's web interface
directly on port 80, as that requires root privileges on a Linux system. It also and prevents us using HTTPS to
serve a secure site, since Spothole itself doesn't directly support acting as an HTTPS server. The normal solution
to this is to use a "reverse proxy" setup, where a general web server handles HTTP and HTTP requests (to port 80
&amp; 443 respectively), then passes on the request to the back-end application (in this case Spothole). nginx is a
common choice for this general web server.</p>
<p>To set up nginx as a reverse proxy that sits in front of Spothole, first ensure it's installed e.g.
<code>sudo apt install nginx</code>, and enabled e.g. <code>sudo systemd enable nginx</code>.</p>
<p>Create a file at <code>/etc/nginx/sites-available/</code> called <code>spothole</code>. Give it the following
contents, replacing <code>spothole.app</code> with the domain name on which you want to run Spothole. If you changed
the port on which Spothole runs, update that on the "proxy_pass" line, and if you installed Spothole somewhere other
than <code>/home/spothole/spothole</code>, adjust the alias location for serving static files.</p>
<p>(The latter section, configuring the nginx server to serve static files directly, improves efficiency because it
saves Spothole itself from serving JS, CSS etc. files. If you can't do this for some reason, e.g. your nginx and
spothole are on different computers, you can omit the <code>location /static/ {}</code> block.)</p>
<pre><code>server {
server_name spothole.app;
# Global proxy settings
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_connect_timeout 10s;
proxy_buffering on;
# Pass on IP address and host information to Spothole, in case logging this information is required
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
# Wellknown area for Lets Encrypt
location /.well-known/ {
alias /var/www/html/.well-known/;
}
# Load static assets directly from the Spothole static directory
location /static/ {
alias /home/spothole/spothole/static/;
expires 1h;
add_header Cache-Control "public, max-age=3600, must-revalidate";
}
# SSE endpoints
location ~ ^/api/v\d*/(spots|alerts)/stream/? {
proxy_pass http://127.0.0.1:8080;
# Remove buffering, remove caching, add suitable timeouts for SSE API calls
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 24h;
proxy_send_timeout 24h;
proxy_set_header X-Accel-Buffering no;
add_header Cache-Control no-store always;
# Allow cross-origin requests to API
proxy_hide_header Access-Control-Allow-Origin;
add_header Access-Control-Allow-Origin * always;
}
# Other API endpoints
location /api/ {
proxy_pass http://127.0.0.1:8080;
# Remove buffering, remove caching, add suitable timeouts for API calls
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 30s;
add_header Cache-Control no-store always;
# Allow cross-origin requests to API
proxy_hide_header Access-Control-Allow-Origin;
add_header Access-Control-Allow-Origin * always;
}
# Templated pages
location / {
proxy_pass http://127.0.0.1:8080;
proxy_read_timeout 30s;
add_header Cache-Control "no-cache, must-revalidate" always;
}
}
</code></pre>
<p>One further change you might want to make to the file above is the <code>add_header
Access-Control-Allow-Origin</code> statements. These are what's used on my own Spothole server to make sure that
other third-party web-based software can get the data from my instance, and applies to any endpoint underneath
<code>/api</code>. If you want <em>your</em> Spothole instance to be set up the same way, so that others can write
software in JavaScript that can access it, leave this intact. But if you want your Spothole instance to only be
usable by scripts running on the web server you write, you can remove these lines. (Note that this doesn't stop
other people writing <em>non-web-based</em> software that accesses your Spothole API&mdash;the enforcement of
cross-origin headers only happens within the user's browser. If you need to lock your instance down so that no-one
else can access it with <em>any</em> software, that's an aspect of nginx or firewall config that you will need to
find help with elsewhere.)</p>
<p>Now, make a symbolic link to enable the site:</p>
<pre><code>cd /etc/nginx/sites-enabled
sudo ln -sf ../sites-available/spothole
</code></pre>
<p>Test that your nginx config isn't broken using <code>nginx -t</code>. If it works, restart nginx with
<code>sudo systemctl restart nginx</code>.</p>
<p>If you haven't already done so, set up a DNS entry to make sure requests for your domain name end up at the server
that's running Spothole.</p>
<p>You should now be able to access the web interface by going to the domain from your browser.</p>
<p>Once that's working, <a href="https://certbot.eff.org/instructions?ws=nginx&amp;os=snap">install certbot</a> onto
your server. Run it as root, and when prompted pick your domain name from the list. After a few seconds, it should
successfully provision a certificate and modify your nginx config files automatically. You should then be able to
access the site via HTTPS.
</p>
{% end %}
+44
View File
@@ -0,0 +1,44 @@
{% extends "../help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">Running your own Server</h2>
<p>If you want to run a copy of Spothole with different configuration settings than the main instance, you can download
it and run it on your own local machine or server.</p>
<p>You will require Python version 3.10 or later. If you encounter an error about <code>gdal-config</code> during the
following process, you will also need <code>libgdal-dev</code> installed.</p>
<p>To download and set up Spothole on a Debian server, run the following commands. Other operating systems will likely
be similar.</p>
<pre><code>git clone ssh://git@git.ianrenton.com/ian/spothole.git
cd spothole
python3 -m venv ./.venv
source .venv/bin/activate
pip install -r requirements.txt
deactivate
cp config-example.yml config.yml
</code></pre>
<p>Then edit <code>config.yml</code> in your text editor of choice to set up the software as you like it. Mostly, this
will involve enabling or disabling the various providers of spot and alert data.</p>
<p>By default, all outdoor programme providers are enabled, as is one cluster node and the NG3K DXpedition data. The RBN
spot providers are turned off by default due to the volume of traffic from CW/RTTY/FT8 skimmers, and the APRS and
Packet spot providers are off by default on the assumption that Spothole users want a spot with a human at the other
end of it, but all can be easily re-enabled.</p>
<p>Other parameters you will want to update include the base URL to your instance, and whether you want to serve a full
web-based DX cluster interface or just the API endpoints for client software to use.</p>
<p><code>config.yml</code> has an entry for a Clublog API key. If provided, this will allow Spothole to retrieve some
more information about DX spots. The software will work just fine without it, but you may find a few country flags
etc. are less accurate or missing. Clublog API keys are free, but you'll need to get your own by submitting a
helpdesk ticket and explaining what you'll use it for. The admin team are happy with the rate of requests made by my
Spothole server, so unless you change the source code of yours to radically increase the rate of querying Clublog,
I'm sure they will be fine with your server too.</p>
<p>Once you're happy with the content of <code>config.yml</code>, you can proceed to running the software.</p>
<p>To run the software this time and any future times you want to run it directly from the command line:</p>
<pre><code>source .venv/bin/activate
python3 spothole.py
</code></pre>
<p>The software can take a few seconds to start up, particularly if it's been run previously and has a large amount of
cache data to sort through. This is normal, don't panic! Once you see <code>You can access your copy of Spothole at
http://localhost:8080</code> in the log, your server is good to go.</p>
<p>If you see some errors on startup, check your configuration, e.g. in case you have specified a port for the web
server that is already in use by something else.</p>
{% end %}
+31
View File
@@ -0,0 +1,31 @@
{% extends "../help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">systemd Configuration</h2>
<p>If you want Spothole to run automatically on startup on a Linux distribution that uses <code>systemd</code>, follow
the instructions here. For distros that don't use <code>systemd</code>, or Windows/OSX/etc., you can find generic
instructions for your OS online.</p>
<p>Create a file at <code>/etc/systemd/system/spothole.service</code>. Give it the following content, adjusting for the
user you want to run it as and the directory in which you have installed it:</p>
<pre><code>[Unit]
Description=Spothole
After=syslog.target network.target
[Service]
Type=simple
User=spothole
WorkingDirectory=/home/spothole/spothole
ExecStart=/home/spothole/spothole/.venv/bin/python /home/spothole/spothole/spothole.py --serve-in-foreground
Restart=on-abort
[Install]
WantedBy=multi-user.target
</code></pre>
<p>Run the following:</p>
<pre><code>sudo systemctl daemon-reload
sudo systemctl enable spothole
sudo systemctl start spothole
</code></pre>
<p>Check the service has started up correctly with <code>sudo journalctl -u spothole -f</code>.</p>
{% end %}
+22
View File
@@ -0,0 +1,22 @@
{% extends "../help_page.html" %}
{% block help_content %}
<h2 class="mt-4 mb-4">Using the Telnet Server</h2>
{% if telnet_server_enabled %}
<p>As well as a web interface and an HTTP API, Spothole offers a telnet server. This can be used to integrate Spothole's
data into a traditional desktop logging program. The data Spothole produces is compatible with DXSpider, and
therefore many loggers should accept it with no problems.</p>
<p>This is a relatively new feature however, so if you run into problems, please do let me know.</p>
<p>The one caveat with the Spothole telnet server is that <em>it does not support any commands</em>, other than <code>exit</code>.
You cannot therefore issue commands to retrieve past entries, set up filters, etc. If you need to filter the data,
many desktop logging programs support this client-side, so hopefully this is not too big of an obstacle.
</p>
<p>To access Spothole via telnet, set up your logger with the server address <code>{{ telnet_server_address }}</code>
and port <code>{{ telnet_server_port }}</code>. You can also access it from a terminal with <code>telnet {{
telnet_server_address }} {{ telnet_server_port }}</code></p>
{% else %}
<p>The telnet server on this instance of Spothole is disabled. If you need telnet access, please use a different
Spothole server, or run your own.</p>
{% end %}
{% end %}
+3 -3
View File
@@ -8,7 +8,7 @@
other than a rough guide. In particular, if you are seeing lots of spots in the centre of a country, please other than a rough guide. In particular, if you are seeing lots of spots in the centre of a country, please
consider opening the "Your Data" menu and providing QRZ.com and/or HamQTH credentials so that Spothole can find consider opening the "Your Data" menu and providing QRZ.com and/or HamQTH credentials so that Spothole can find
more accurate locations for these spots. More information can be found in the more accurate locations for these spots. More information can be found in the
<a href="/about#accuracy" class="alert-link">Data Accuracy section of the About page</a>. <a href="/help/accuracy" class="alert-link">Data Accuracy section of the Spothole Help</a>.
<button type="button" id="map-intro-box-dismiss" class="btn-close" data-bs-dismiss="alert" <button type="button" id="map-intro-box-dismiss" class="btn-close" data-bs-dismiss="alert"
aria-label="Close"></button> aria-label="Close"></button>
</div> </div>
@@ -113,8 +113,8 @@
const CARTODB_API_KEY = "{{ web_ui_options.get('cartodb_api_key', '') }}"; const CARTODB_API_KEY = "{{ web_ui_options.get('cartodb_api_key', '') }}";
</script> </script>
<script src="/static/js/spotsbandsandmap.js?v=1789927308"></script> <script src="/static/js/spotsbandsandmap.js?v=1790228319"></script>
<script src="/static/js/map.js?v=1789927308"></script> <script src="/static/js/map.js?v=1790228319"></script>
<script>$(document).ready(function () { <script>$(document).ready(function () {
$("#nav-link-map").addClass("active"); $("#nav-link-map").addClass("active");
}); <!-- highlight active page in nav --></script> }); <!-- highlight active page in nav --></script>
+6 -6
View File
@@ -5,10 +5,10 @@
<div class="alert alert-primary alert-dismissible fade show" role="alert"> <div class="alert alert-primary alert-dismissible fade show" role="alert">
<i class="fa-solid fa-circle-info"></i> <strong>What is Spothole?</strong><br/>Spothole is an aggregator of <i class="fa-solid fa-circle-info"></i> <strong>What is Spothole?</strong><br/>Spothole is an aggregator of
amateur radio spots from DX clusters and outdoor activity programmes. It's free for anyone to use and includes amateur radio spots from DX clusters and outdoor activity programmes. It's free for anyone to use and includes
an API that developers can build other applications on. For more information, check out the <a href="/about" an API that developers can build other applications on. For more information, check out the <a href="/help"
class="alert-link">"About" class="alert-link">Help
page</a>. If that sounds like nonsense to you, you can visit <a href="/about#faq" class="alert-link">the FAQ pages</a>. If that sounds like nonsense to you, you can visit <a href="/help/faq" class="alert-link">the FAQ
section</a> to learn more. page</a> to learn more.
<button type="button" id="intro-box-dismiss" class="btn-close" data-bs-dismiss="alert" <button type="button" id="intro-box-dismiss" class="btn-close" data-bs-dismiss="alert"
aria-label="Close"></button> aria-label="Close"></button>
</div> </div>
@@ -125,8 +125,8 @@
</div> </div>
<script src="/static/js/spotsbandsandmap.js?v=1789927308"></script> <script src="/static/js/spotsbandsandmap.js?v=1790228319"></script>
<script src="/static/js/spots.js?v=1789927308"></script> <script src="/static/js/spots.js?v=1790228319"></script>
<script>$(document).ready(function () { <script>$(document).ready(function () {
$("#nav-link-spots").addClass("active"); $("#nav-link-spots").addClass("active");
}); <!-- highlight active page in nav --></script> }); <!-- highlight active page in nav --></script>
+1 -1
View File
@@ -96,7 +96,7 @@
</div> </div>
</div> </div>
<script src="/static/js/status.js?v=1789927308"></script> <script src="/static/js/status.js?v=1790228319"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$("#nav-link-status").addClass("active"); $("#nav-link-status").addClass("active");
+31 -35
View File
@@ -193,48 +193,44 @@ class WebServer:
) )
] ]
else: else:
ui_routes = [ ui_pages = [
(r"/", PageTemplateHandler, {"template_name": "spots"}), "map",
( "bands",
r"/map", "alerts",
PageTemplateHandler, "conditions",
{"template_name": "map"}, "status",
), "help",
( "help/about",
r"/bands", "help/usage",
PageTemplateHandler, "help/usage/clients",
{"template_name": "bands"}, "help/usage/telnet",
), "help/usage/embedding",
( "help/usage/running",
r"/alerts", "help/usage/docker",
PageTemplateHandler, "help/usage/nginx",
{"template_name": "alerts"}, "help/usage/systemd",
), "help/usage/multicluster",
( "help/usage/modifying",
r"/conditions", "help/sources",
PageTemplateHandler, "help/faq",
{"template_name": "conditions"}, "help/accuracy",
), "help/privacy",
( "help/thanks",
r"/status",
PageTemplateHandler,
{"template_name": "status"},
),
(
r"/about",
PageTemplateHandler,
{"template_name": "about"},
),
] ]
# Only allow the Add Spot page if spotting is allowed # Only allow the Add Spot page if spotting is allowed
if ALLOW_SPOTTING: if ALLOW_SPOTTING:
ui_routes += [ ui_pages.append("add-spot")
ui_routes = [
( (
r"/add-spot", rf"/{page}",
PageTemplateHandler, PageTemplateHandler,
{"template_name": "add_spot"}, {"template_name": page},
) )
for page in ui_pages
] ]
# One awkward outlier, the home page - we need to serve a route from "/" but can't call a template "/.html"
# so we add this one separately, the template is called "spots"
ui_routes += [(r"/", PageTemplateHandler, {"template_name": "spots"})]
# API docs, Prometheus metrics, webapp manifest and static assets are always available regardless of API-only # API docs, Prometheus metrics, webapp manifest and static assets are always available regardless of API-only
# mode. # mode.