mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-24 16:24:32 +00:00
Rationalise docs part 5 #151
This commit is contained in:
@@ -5,7 +5,7 @@ info:
|
|||||||
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. 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.
|
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.
|
||||||
|
|
||||||
You can find out more information about Spothole at https://spothole.app/help.
|
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 provided by https://spothole.app is provided free of charge, and no authentication is required. By using it, you accept the following:
|
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.
|
* 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.
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/add-spot.js?v=1790184305"></script>
|
<script src="/static/js/add-spot.js?v=1790196142"></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>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/alerts.js?v=1790184306"></script>
|
<script src="/static/js/alerts.js?v=1790196142"></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>
|
||||||
|
|||||||
@@ -76,8 +76,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1790184305"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1790196142"></script>
|
||||||
<script src="/static/js/bands.js?v=1790184305"></script>
|
<script src="/static/js/bands.js?v=1790196142"></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>
|
||||||
|
|||||||
+5
-5
@@ -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=1790184305" type="text/css">
|
<link rel="stylesheet" href="/static/css/style.css?v=1790196142" 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=1790184305"></script>
|
<script src="/static/js/utils.js?v=1790196142"></script>
|
||||||
<script src="/static/js/ui-ham.js?v=1790184305"></script>
|
<script src="/static/js/ui-ham.js?v=1790196142"></script>
|
||||||
<script src="/static/js/geo.js?v=1790184305"></script>
|
<script src="/static/js/geo.js?v=1790196142"></script>
|
||||||
<script src="/static/js/common.js?v=1790184305"></script>
|
<script src="/static/js/common.js?v=1790196142"></script>
|
||||||
{% end %}
|
{% end %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -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=1790184305"></script>
|
<script src="/static/js/conditions.js?v=1790196142"></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>
|
||||||
|
|||||||
@@ -1,25 +1,30 @@
|
|||||||
{% extends "../base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div id="info-container" class="mt-4">
|
<div id="info-container" class="mt-4">
|
||||||
|
<h2>Help and Information</h2>
|
||||||
<p>Welcome to Spothole's help pages.</p>
|
<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
|
<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>
|
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>
|
<p>In the sections below, you can find more information about what Spothole is, and how to use it.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/help/about">About Spothole</a></li>
|
<li><a href="/help/about">About Spothole</a></li>
|
||||||
<li><a href="/help/using">How To Use Spothole</a>
|
<li><a href="/help/usage">How to use Spothole</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/help/usage/clients">Writing Your Own Client</a></li>
|
{% if telnet_server_enabled %}
|
||||||
<li><a href="/help/usage/embedding">Embedding Spothole In Another Website</a></li>
|
<li><a href="/help/usage/telnet">Connecting via Telnet</a></li>
|
||||||
<li><a href="/help/usage/running">Running Your Own Copy</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>
|
<ul>
|
||||||
<li><a href="/help/usage/systemd">systemd Configuration</a></li>
|
<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/nginx">nginx Reverse Proxy Configuration</a></li>
|
||||||
<li><a href="/help/usage/docker">Running Using Docker</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>
|
<li><a href="/help/usage/multicluster">Multiple Cluster Nodes with Different Settings</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="/help/usage/modifying">Modifying The Source Code</a></li>
|
<li><a href="/help/usage/modifying">Modifying the Source Code</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="/help/sources">Supported Data Sources</a></li>
|
<li><a href="/help/sources">Supported Data Sources</a></li>
|
||||||
@@ -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 %}
|
||||||
@@ -1,42 +1,53 @@
|
|||||||
{% extends "../help_page.html" %}
|
{% extends "../help_page.html" %}
|
||||||
{% block help_content %}
|
{% block help_content %}
|
||||||
|
|
||||||
<h2 class="mt-4 mb-4">Writing your own client</h2>
|
<h2 class="mt-4 mb-4">Writing your own Client</h2>
|
||||||
<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>
|
<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
|
<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
|
Server-Sent Events (SSE) API endpoints to receive a live feed, plus various utility lookup endpoints for things like
|
||||||
callsign and park data.</p>
|
callsign and park data.</p>
|
||||||
<p>Various approaches exist to writing your own client, but in general:</p>
|
<p>Various approaches exist to writing your own client, but in general:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Refer to the API docs. These are built on an OpenAPI definition file (<code>/static/apidocs/openapi.yml</code>), which you can
|
<li>Refer to the API docs. These are built on an OpenAPI definition file (<code>/static/apidocs/openapi.yml</code>),
|
||||||
automatically use to generate a client skeleton using various software.</li>
|
which you can automatically use to generate a client skeleton using various software.
|
||||||
<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.
|
|
||||||
<ul>
|
|
||||||
<li>Caveat: If you have vibe-coded a client, do not contact me until you have read and understood the code using your actual Human Intelligence.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
</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>
|
</ul>
|
||||||
<p>Please don't hammer the API with an unnecessarily high request rate. For example, Spothole only queries the POTA API
|
<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
|
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>
|
than that.</p>
|
||||||
<p>If you absolutely must be informed within seconds of a spot arriving in Spothole, please use the SSE endpoints instead,
|
<p>If you absolutely must be informed within seconds of a spot arriving in Spothole, please use the SSE endpoints
|
||||||
e.g. <code>https://spothole.app/api/v2/spots/stream</code>.</p>
|
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
|
<p>If you want to handle different types of spot or alert differently within your client, please consider making a
|
||||||
request to the Spothole API to retrieve all the data, then filtering on your side. For example, call
|
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,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>
|
<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
|
<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.
|
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
|
<code>spothole.app</code> runs on the same server as my blog and other stuff. It might go down without warning. By
|
||||||
your own project on data from the main server if you like, but if you want any control over reliability and downtime,
|
all means base your own project on data from the main server if you like, but if you want any control over
|
||||||
please run your own copy instead.)</p>
|
reliability and downtime, please run your own copy instead.)</p>
|
||||||
|
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
{% block help_content %}
|
{% block help_content %}
|
||||||
|
|
||||||
<h2 class="mt-4 mb-4">Running using Docker</h2>
|
<h2 class="mt-4 mb-4">Running using Docker</h2>
|
||||||
<p>Spothole comes with a Docker configuration to make it easy to run it in a containerised environment. To set it up using
|
<p>Spothole comes with a Docker configuration to make it easy to run it in a containerised environment. To set it up
|
||||||
Docker, the easiest way is to use a Docker Compose file. Create a new directory such as <code>/opt/docker/spothole</code> and
|
using Docker, the easiest way is to use a Docker Compose file. Create a new directory such as <code>/opt/docker/spothole</code>
|
||||||
create a <code>compose.yaml</code> file inside it with the following contents:</p>
|
and create a <code>compose.yaml</code> file inside it with the following contents:</p>
|
||||||
<pre><code>services:
|
<pre><code>services:
|
||||||
spothole:
|
spothole:
|
||||||
container_name: spothole
|
container_name: spothole
|
||||||
@@ -18,23 +18,24 @@ create a <code>compose.yaml</code> file inside it with the following contents:</
|
|||||||
- ./config.yml:/app/config.yml
|
- ./config.yml:/app/config.yml
|
||||||
- ./cache:/app/cache
|
- ./cache:/app/cache
|
||||||
</code></pre>
|
</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
|
<p>You can replace <code>#main</code> with any other branch or tag reference, for example <code>#1.5</code> to pin the
|
||||||
1.5.</p>
|
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
|
<p>Save the file. You will still need to create a copy of <code>config-example.yml</code> and name it
|
||||||
Docker setup nothing has actually been downloaded yet, so you will have to copy the example from the repository some
|
<code>config.yml</code>, though with the Docker setup nothing has actually been downloaded yet, so you will have to
|
||||||
other way,
|
copy the example from the repository some other way, e.g. <a
|
||||||
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>
|
href="https://git.ianrenton.com/ian/spothole/src/branch/main/config-example.yml">from the repo in a web
|
||||||
<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
|
browser</a>.</p>
|
||||||
the <code>-d</code> flag.</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>
|
||||||
|
|
||||||
<h3 class="mt-4">nginx Reverse Proxy with Docker</h3>
|
<h3 class="mt-4">nginx Reverse Proxy with Docker</h3>
|
||||||
<p>In a containerised setup, it's typical to run an nginx reverse proxy in one container, alongside certbot for renewal of
|
<p>In a containerised setup, it's typical to run an nginx reverse proxy in one container, alongside certbot for renewal
|
||||||
HTTPS certificates, and then applications like Spothole in a separate container. In this case, there are a couple of
|
of HTTPS certificates, and then applications like Spothole in a separate container. In this case, there are a couple
|
||||||
variations of the docker compose file above, and the nginx reverse proxy configuration covered <a href="/help/usage/nginx">here</a>, that
|
of variations of the docker compose file above, and the nginx reverse proxy configuration covered <a
|
||||||
you will want to make.</p>
|
href="/help/usage/nginx">here</a>, that you will want to make.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>A port mapping is no longer required in the docker compose file; nginx will access into the docker container directly
|
<li>A port mapping is no longer required in the docker compose file; nginx will access into the docker container
|
||||||
on e.g. <code>http://spothole:8080</code></li>
|
directly on e.g. <code>http://spothole:8080</code></li>
|
||||||
<li>Spothole and nginx will need to be on the same docker network.</li>
|
<li>Spothole and nginx will need to be on the same docker network.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<p>So your <code>compose.yaml</code> might look like this:</p>
|
<p>So your <code>compose.yaml</code> might look like this:</p>
|
||||||
@@ -55,8 +56,8 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>In your nginx site configuration, you'll want to refer to the Spothole container directly, and drop the block that
|
<p>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 with
|
allows nginx to access static files directly, as these will be inaccessible in another container. So you may end up
|
||||||
something like:</p>
|
with something like:</p>
|
||||||
<pre><code>server {
|
<pre><code>server {
|
||||||
server_name spothole.app;
|
server_name spothole.app;
|
||||||
|
|
||||||
@@ -138,12 +139,13 @@ server {
|
|||||||
}
|
}
|
||||||
</code></pre>
|
</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
|
<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
|
<code>proxy_pass</code> statements could drop the <code>:8080</code> suffix. Since Spothole is in a container, it
|
||||||
desired, because it doesn't conflict with the host system.</p>
|
can serve HTTP on port 80 if desired, because it doesn't conflict with the host system.</p>
|
||||||
|
|
||||||
<h3 class="mt-4">Restoring the static files bypass</h3>
|
<h3 class="mt-4">Restoring the static files bypass</h3>
|
||||||
<p>If you would still like to bypass Spothole's web server for the static files, and serve them with nginx, you can do. The
|
<p>If you would still like to bypass Spothole's web server for the static files, and serve them with nginx, you can do.
|
||||||
easiest way is to run another nginx container to serve the files, so your Spothole <code>compose.yaml</code> becomes:</p>
|
The easiest way is to run another nginx container to serve the files, so your Spothole <code>compose.yaml</code>
|
||||||
|
becomes:</p>
|
||||||
<pre><code>services:
|
<pre><code>services:
|
||||||
spothole:
|
spothole:
|
||||||
container_name: spothole
|
container_name: spothole
|
||||||
@@ -171,8 +173,8 @@ networks:
|
|||||||
docker-network:
|
docker-network:
|
||||||
external: true
|
external: true
|
||||||
</code></pre>
|
</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 time point it
|
<p>Then you can re-add the block that handles the <code>/static</code> path in your nginx reverse proxy config, but this
|
||||||
at the new container rather than at a filesystem path:</p>
|
time point it at the new container rather than at a filesystem path:</p>
|
||||||
<pre><code> # Load static assets from the spothole-static-nginx container
|
<pre><code> # 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/;
|
||||||
|
|||||||
+152
-132
@@ -1,142 +1,162 @@
|
|||||||
{% extends "../help_page.html" %}
|
{% extends "../help_page.html" %}
|
||||||
{% block help_content %}
|
{% block help_content %}
|
||||||
|
|
||||||
<h2 class="mt-4 mb-4">Embedding Spothole in another website</h2>
|
<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>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,
|
<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
|
you provide configuration for the various filter and display options via additional URL parameters. Any settings
|
||||||
the user has set for Spothole are ignored. This is so that the embedding site can select, for example, their choice of
|
that the user has set for Spothole are ignored. This is so that the embedding site can select, for example, their
|
||||||
dark mode or activity filters, which will not impact how Spothole appears when the user accesses it directly. Effectively, it
|
choice of dark mode or activity filters, which will not impact how Spothole appears when the user accesses it
|
||||||
becomes separate to their normal Spothole settings.</p>
|
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
|
<p>Setting <code>embedded</code> to true is important for the rest of the settings to be applied; otherwise, the user's
|
||||||
be used in preference to the URL params.</p>
|
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
|
<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&dark-mode=true</code>. For an embedded version of the main spots/home
|
dark mode, use <code>https://spothole.app/bands?embedded=true&dark-mode=true</code>. For an embedded version of
|
||||||
page in the system light/dark mode, use <code>https://spothole.app/?embedded=true</code>. For dark mode showing 70cm TOTA spots
|
the main spots/home page in the system light/dark mode, use <code>https://spothole.app/?embedded=true</code>. For
|
||||||
only, use <code>https://spothole.app/?embedded=true&dark-mode=true&sig=TOTA&band=70cm</code>. Providing no URL params causes the
|
dark mode showing 70cm TOTA spots only, use <code>https://spothole.app/?embedded=true&dark-mode=true&sig=TOTA&band=70cm</code>.
|
||||||
page to be loaded in the normal way it would when accessed directly in the user's browser.</p>
|
Providing no URL params causes the page to be loaded in the normal way it would when accessed directly in the user's
|
||||||
<p>The supported parameters are as follows. Generally these match the equivalent parameters in the real Spothole API, where
|
browser.</p>
|
||||||
a mapping exists.</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">
|
<div class="table-responsive">
|
||||||
<table class="table table-sm table-bordered">
|
<table class="table table-sm table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Allowed Values</th>
|
<th>Allowed Values</th>
|
||||||
<th>Default</th>
|
<th>Default</th>
|
||||||
<th>Example</th>
|
<th>Example</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>embedded</code></td>
|
<td><code>embedded</code></td>
|
||||||
<td><code>true</code>, <code>false</code></td>
|
<td><code>true</code>, <code>false</code></td>
|
||||||
<td><code>false</code></td>
|
<td><code>false</code></td>
|
||||||
<td><code>?embedded=true</code></td>
|
<td><code>?embedded=true</code></td>
|
||||||
<td>Enables embedded mode.</td>
|
<td>Enables embedded mode.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>color_scheme</code></td>
|
<td><code>color_scheme</code></td>
|
||||||
<td><code>light</code>, <code>dark</code>, <code>auto</code></td>
|
<td><code>light</code>, <code>dark</code>, <code>auto</code></td>
|
||||||
<td><code>auto</code></td>
|
<td><code>auto</code></td>
|
||||||
<td><code>?color_scheme=dark</code></td>
|
<td><code>?color_scheme=dark</code></td>
|
||||||
<td>Forces light or dark mode in preference to the operating system default.</td>
|
<td>Forces light or dark mode in preference to the operating system default.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>time_zone</code></td>
|
<td><code>time_zone</code></td>
|
||||||
<td><code>UTC</code>, <code>local</code></td>
|
<td><code>UTC</code>, <code>local</code></td>
|
||||||
<td><code>UTC</code></td>
|
<td><code>UTC</code></td>
|
||||||
<td><code>?time_zone=local</code></td>
|
<td><code>?time_zone=local</code></td>
|
||||||
<td>Sets times to be in UTC or local time.</td>
|
<td>Sets times to be in UTC or local time.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>limit</code></td>
|
<td><code>limit</code></td>
|
||||||
<td>10, 25, 50, 100</td>
|
<td>10, 25, 50, 100</td>
|
||||||
<td>50</td>
|
<td>50</td>
|
||||||
<td><code>?limit=50</code></td>
|
<td><code>?limit=50</code></td>
|
||||||
<td>Sets the number of spots that will be displayed on the main spots page</td>
|
<td>Sets the number of spots that will be displayed on the main spots page</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>limit</code></td>
|
<td><code>limit</code></td>
|
||||||
<td>25, 50, 100, 200, 500</td>
|
<td>25, 50, 100, 200, 500</td>
|
||||||
<td>100</td>
|
<td>100</td>
|
||||||
<td><code>?limit=100</code></td>
|
<td><code>?limit=100</code></td>
|
||||||
<td>Sets the number of alerts that will be displayed on the alerts page</td>
|
<td>Sets the number of alerts that will be displayed on the alerts page</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>max_age</code></td>
|
<td><code>max_age</code></td>
|
||||||
<td>300, 600, 1800, 3600</td>
|
<td>300, 600, 1800, 3600</td>
|
||||||
<td>1800</td>
|
<td>1800</td>
|
||||||
<td><code>?max_age=1800</code></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>
|
<td>Sets the maximum age of spots displayed on the map and bands pages, in seconds.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>band</code></td>
|
<td><code>band</code></td>
|
||||||
<td>Comma-separated list</td>
|
<td>Comma-separated list</td>
|
||||||
<td>(all)</td>
|
<td>(all)</td>
|
||||||
<td><code>?band=20m,40m</code></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>
|
<td>Sets the list of bands that will be shown on the spots, bands and map pages. Available options match the
|
||||||
</tr>
|
labels of the buttons in the standard web interface.
|
||||||
<tr>
|
</td>
|
||||||
<td><code>sig</code></td>
|
</tr>
|
||||||
<td>Comma-separated list</td>
|
<tr>
|
||||||
<td>(all)</td>
|
<td><code>sig</code></td>
|
||||||
<td><code>?sig=POTA,SOTA,NO_SIG</code></td>
|
<td>Comma-separated list</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>
|
<td>(all)</td>
|
||||||
</tr>
|
<td><code>?sig=POTA,SOTA,NO_SIG</code></td>
|
||||||
<tr>
|
<td>Sets the list of activities that will be shown on the spots, bands and map pages. Available options
|
||||||
<td><code>source</code></td>
|
match the labels of the buttons in the standard web interface.
|
||||||
<td>Comma-separated list</td>
|
</td>
|
||||||
<td>(all)</td>
|
</tr>
|
||||||
<td><code>?source=Cluster</code></td>
|
<tr>
|
||||||
<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>
|
<td><code>source</code></td>
|
||||||
</tr>
|
<td>Comma-separated list</td>
|
||||||
<tr>
|
<td>(all)</td>
|
||||||
<td><code>mode_type</code></td>
|
<td><code>?source=Cluster</code></td>
|
||||||
<td>Comma-separated list</td>
|
<td>Sets the list of sources that will be shown on any spot or alert pages. Available options match the
|
||||||
<td>(all)</td>
|
labels of the buttons in the standard web interface.
|
||||||
<td><code>?mode_type=PHONE,CW</code></td>
|
</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>
|
<tr>
|
||||||
<tr>
|
<td><code>mode_type</code></td>
|
||||||
<td><code>dx_continent</code></td>
|
<td>Comma-separated list</td>
|
||||||
<td>Comma-separated list</td>
|
<td>(all)</td>
|
||||||
<td>(all)</td>
|
<td><code>?mode_type=PHONE,CW</code></td>
|
||||||
<td><code>?dx_continent=NA,SA</code></td>
|
<td>Sets the list of mode types that will be shown on the spots, bands and map pages. Available options
|
||||||
<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>
|
match the labels of the buttons in the standard web interface.
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td><code>de_continent</code></td>
|
<tr>
|
||||||
<td>Comma-separated list</td>
|
<td><code>dx_continent</code></td>
|
||||||
<td>(all)</td>
|
<td>Comma-separated list</td>
|
||||||
<td><code>?de_continent=EU</code></td>
|
<td>(all)</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>
|
<td><code>?dx_continent=NA,SA</code></td>
|
||||||
</tr>
|
<td>Sets the list of DX Continents that will be shown on any spot or alert pages. Available options match
|
||||||
<tr>
|
the labels of the buttons in the standard web interface.
|
||||||
<td><code>map-center-lat</code></td>
|
</td>
|
||||||
<td>Numeric (decimal)</td>
|
</tr>
|
||||||
<td>(auto)</td>
|
<tr>
|
||||||
<td><code>?map-center-lat=51.5</code></td>
|
<td><code>de_continent</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>
|
<td>Comma-separated list</td>
|
||||||
</tr>
|
<td>(all)</td>
|
||||||
<tr>
|
<td><code>?de_continent=EU</code></td>
|
||||||
<td><code>map-center-lon</code></td>
|
<td>Sets the list of DE Continents that will be shown on the spots, bands and map pages. Available options
|
||||||
<td>Numeric (decimal)</td>
|
match the labels of the buttons in the standard web interface.
|
||||||
<td>(auto)</td>
|
</td>
|
||||||
<td><code>?map-center-lon=-0.1</code></td>
|
</tr>
|
||||||
<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-center-lat</code></td>
|
||||||
<tr>
|
<td>Numeric (decimal)</td>
|
||||||
<td><code>map-zoom</code></td>
|
<td>(auto)</td>
|
||||||
<td>Numeric (integer)</td>
|
<td><code>?map-center-lat=51.5</code></td>
|
||||||
<td>(auto)</td>
|
<td>Sets the initial latitude of the map centre on the map page. If omitted, the map auto-fits to the loaded
|
||||||
<td><code>?map-zoom=6</code></td>
|
spots.
|
||||||
<td>Sets the initial zoom level of the map on the map page. If omitted, the map auto-fits to the loaded spots.</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
<tr>
|
||||||
</table>
|
<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>
|
</div>
|
||||||
<p>See the comment at the end of the next section regarding reliability and uptime of the "main" server.</p>
|
<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 %}
|
{% end %}
|
||||||
|
|||||||
@@ -3,7 +3,10 @@
|
|||||||
|
|
||||||
<h2 class="mt-4 mb-4">Modifying the source code</h2>
|
<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.
|
<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>
|
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>
|
||||||
|
|
||||||
<h3 class="mt-4">Code structure</h3>
|
<h3 class="mt-4">Code structure</h3>
|
||||||
<p>To navigate your way around the source code, this list may help.</p>
|
<p>To navigate your way around the source code, this list may help.</p>
|
||||||
@@ -14,13 +17,18 @@ Contributions of code back to the main repository are encouraged, but completely
|
|||||||
<li><code>/data</code> - Data storage classes</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/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/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/solarconditions</code> - Classes providing solar and propagation by accessing the APIs of other
|
||||||
<li><code>/providers/staticdata</code> - Classes providing static lookup data by accessing bundled data files or the APIs of other
|
services
|
||||||
services</li>
|
</li>
|
||||||
<li><code>/providers/callsign</code> - Classes providing callsign lookup data by accessing bundled data files or the APIs of other
|
<li><code>/providers/staticdata</code> - Classes providing static lookup data by accessing bundled data files or the
|
||||||
services</li>
|
APIs of other services
|
||||||
<li><code>/providers/activityrefdata</code> - Classes providing activity reference lookup data by accessing bundled data files or
|
</li>
|
||||||
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>/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>/telnetserver</code> - Classes for running Spothole's telnet server</li>
|
||||||
<li><code>spothole.py</code> - Main application script</li>
|
<li><code>spothole.py</code> - Main application script</li>
|
||||||
@@ -33,7 +41,9 @@ Contributions of code back to the main repository are encouraged, but completely
|
|||||||
|
|
||||||
<p><em>HTML/JS/CSS front-end code</em></p>
|
<p><em>HTML/JS/CSS front-end code</em></p>
|
||||||
<ul>
|
<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</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/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/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/css</code> - CSS files used by the web front-end</li>
|
||||||
@@ -47,32 +57,43 @@ Contributions of code back to the main repository are encouraged, but completely
|
|||||||
<li><code>/</code> - pip <code>requirements.txt</code>, config, README, etc.</li>
|
<li><code>/</code> - pip <code>requirements.txt</code>, config, README, etc.</li>
|
||||||
<li><code>/docs</code> - Documentation</li>
|
<li><code>/docs</code> - Documentation</li>
|
||||||
<li><code>/images</code> - Image sources</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
|
<li><code>/datafiles</code> - Local data files, used by some providers when the data will never change and/or is not
|
||||||
online in a format Spothole can handle</li>
|
easily available online in a format Spothole can handle
|
||||||
<li><code>/cache</code> - Directory where Spothole stores all the data it uses that should be persisted to disk. Created on first
|
</li>
|
||||||
run.</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>
|
</ul>
|
||||||
|
|
||||||
<h3 class="mt-4">Extending the server</h3>
|
<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
|
<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
|
module to the <code>providers.spot</code> package containing your class. (Currently, in order to be loaded
|
||||||
(file) name should be the same as the class name, but lower case.)</p>
|
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 "
|
<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>
|
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
|
<p>The class will need to implement a constructor that takes in the <code>provider_config</code> and provides it to the
|
||||||
constructor, while also taking any other config parameters it needs.</p>
|
superclass
|
||||||
<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
|
constructor, while also taking any other config parameters it needs.</p>
|
||||||
and stop a separate thread which handles the provider's processing needs. The thread should call <code>submit()</code> or
|
<p>If you're extending the base <code>SpotProvider</code> class, you will need to implement <code>start()</code> and
|
||||||
<code>submit_batch()</code> when it has one or more spots to report.</p>
|
<code>stop()</code> methods that start
|
||||||
<p>If you're extending the <code>HTTPSpotProvider</code> class, you will need to provide a URI to query and an interval to the
|
and stop a separate thread which handles the provider's processing needs. The thread should call
|
||||||
superclass constructor. You'll then need to implement the <code>http_response_to_spots()</code> method which is called when new
|
<code>submit()</code> or
|
||||||
data is retrieved. Your implementation should then call <code>submit()</code> or <code>submit_batch()</code> when it has one or more spots to
|
<code>submit_batch()</code> when it has one or more spots to report.</p>
|
||||||
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
|
<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>
|
parameters are optional, but you will at least want to provide a <code>time</code> (which must be timezone-aware)
|
||||||
<p>Finally, simply add the appropriate config to the <code>spot_providers</code> section of <code>config.yml</code>, and your provider should be
|
and a <code>dx_call</code>.</p>
|
||||||
instantiated on startup.</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
|
<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>
|
advice.</p>
|
||||||
|
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
{% extends "../help_page.html" %}
|
{% extends "../help_page.html" %}
|
||||||
{% block help_content %}
|
{% block help_content %}
|
||||||
|
|
||||||
<h2 class="mt-4 mb-4">Multiple cluster nodes with different settings</h2>
|
<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
|
<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>
|
uses different SSIDs on his callsign to get different settings when logged into the same cluster node. For
|
||||||
|
example:</p>
|
||||||
<pre><code> -
|
<pre><code> -
|
||||||
class: "DXCluster"
|
class: "DXCluster"
|
||||||
name: "S50CLX"
|
name: "S50CLX"
|
||||||
@@ -15,10 +16,10 @@ uses different SSIDs on his callsign to get different settings when logged into
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Telnet to DXSpider and log in with "callsign-10" and execute the following commands:</p>
|
<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/>
|
<p><code>CLEAR/SPOTS ALL</code> (delete all previous filters)<br/>
|
||||||
<code>UNSET/ANN</code> (stop announce messages)<br/>
|
<code>UNSET/ANN</code> (stop announce messages)<br/>
|
||||||
<code>UNSET/WCY</code> (stop wcy messages)<br/>
|
<code>UNSET/WCY</code> (stop wcy messages)<br/>
|
||||||
<code>UNSET/WWV</code> (stop wwv messages)<br/>
|
<code>UNSET/WWV</code> (stop wwv messages)<br/>
|
||||||
<code>SET/DX</code> (enable human DX spots)</p>
|
<code>SET/DX</code> (enable human DX spots)</p>
|
||||||
<pre><code> -
|
<pre><code> -
|
||||||
class: "DXCluster"
|
class: "DXCluster"
|
||||||
name: "RBN CW"
|
name: "RBN CW"
|
||||||
@@ -32,11 +33,11 @@ uses different SSIDs on his callsign to get different settings when logged into
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Telnet to DXSpider and log in with "callsign-11" and execute the following commands:</p>
|
<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/>
|
<p><code>CLEAR/SPOTS ALL</code> (delete all previous filters)<br/>
|
||||||
<code>UNSET/ANN</code> (stop announce messages)<br/>
|
<code>UNSET/ANN</code> (stop announce messages)<br/>
|
||||||
<code>UNSET/WCY</code> (stop wcy messages)<br/>
|
<code>UNSET/WCY</code> (stop wcy messages)<br/>
|
||||||
<code>UNSET/WWV</code> (stop wwv messages)<br/>
|
<code>UNSET/WWV</code> (stop wwv messages)<br/>
|
||||||
<code>UNSET/DX</code> (stop human DX spots)<br/>
|
<code>UNSET/DX</code> (stop human DX spots)<br/>
|
||||||
<code>SET/SKIMMER CW</code> (enable CW RBN spots)</p>
|
<code>SET/SKIMMER CW</code> (enable CW RBN spots)</p>
|
||||||
<pre><code> -
|
<pre><code> -
|
||||||
class: "DXCluster"
|
class: "DXCluster"
|
||||||
name: "RBN RTTY"
|
name: "RBN RTTY"
|
||||||
@@ -50,11 +51,11 @@ uses different SSIDs on his callsign to get different settings when logged into
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Telnet to DXSpider and log in with "callsign-12" and execute the following commands:</p>
|
<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/>
|
<p><code>CLEAR/SPOTS ALL</code> (delete all previous filters)<br/>
|
||||||
<code>UNSET/ANN</code> (stop announce messages)<br/>
|
<code>UNSET/ANN</code> (stop announce messages)<br/>
|
||||||
<code>UNSET/WCY</code> (stop wcy messages)<br/>
|
<code>UNSET/WCY</code> (stop wcy messages)<br/>
|
||||||
<code>UNSET/WWV</code> (stop wwv messages)<br/>
|
<code>UNSET/WWV</code> (stop wwv messages)<br/>
|
||||||
<code>UNSET/DX</code> (stop human DX spots)<br/>
|
<code>UNSET/DX</code> (stop human DX spots)<br/>
|
||||||
<code>SET/SKIMMER RTTY</code> (enable RTTY RBN spots)</p>
|
<code>SET/SKIMMER RTTY</code> (enable RTTY RBN spots)</p>
|
||||||
<pre><code> -
|
<pre><code> -
|
||||||
class: "DXCluster"
|
class: "DXCluster"
|
||||||
name: "RBN FT4/8"
|
name: "RBN FT4/8"
|
||||||
@@ -68,15 +69,15 @@ uses different SSIDs on his callsign to get different settings when logged into
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Telnet to DXSpider and log in with "callsign-13" and execute the following commands:</p>
|
<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/>
|
<p><code>CLEAR/SPOTS ALL</code> (delete all previous filters)<br/>
|
||||||
<code>UNSET/ANN</code> (stop announce messages)<br/>
|
<code>UNSET/ANN</code> (stop announce messages)<br/>
|
||||||
<code>UNSET/WCY</code> (stop wcy messages)<br/>
|
<code>UNSET/WCY</code> (stop wcy messages)<br/>
|
||||||
<code>UNSET/WWV</code> (stop wwv messages)<br/>
|
<code>UNSET/WWV</code> (stop wwv messages)<br/>
|
||||||
<code>UNSET/DX</code> (stop human DX spots)<br/>
|
<code>UNSET/DX</code> (stop human DX spots)<br/>
|
||||||
<code>SET/SKIMMER FT</code> (enable FT RBN spots)</p>
|
<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>For each callsign-SSID, we also specify our basic information with commands:</p>
|
||||||
<p><code>SET/NAME Spothole10</code>, Spothole11... etc.<br/>
|
<p><code>SET/NAME Spothole10</code>, Spothole11... etc.<br/>
|
||||||
<code>SET/QTH Cerkno</code><br/>
|
<code>SET/QTH Cerkno</code><br/>
|
||||||
<code>SET/QRA JN66XD</code><br/>
|
<code>SET/QRA JN66XD</code><br/>
|
||||||
<code>SET/HOME S50CLX</code></p>
|
<code>SET/HOME S50CLX</code></p>
|
||||||
|
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
{% extends "../help_page.html" %}
|
{% extends "../help_page.html" %}
|
||||||
{% block help_content %}
|
{% block help_content %}
|
||||||
|
|
||||||
<h2 class="mt-4 mb-4">nginx Reverse Proxy configuration</h2>
|
<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
|
<p>Web servers generally serve their pages from port 80. However, it's best not to serve Spothole's web interface
|
||||||
on port 80, as that requires root privileges on a Linux system. It also and prevents us using HTTPS to serve a secure
|
directly on port 80, as that requires root privileges on a Linux system. It also and prevents us using HTTPS to
|
||||||
site, since Spothole itself doesn't directly support acting as an HTTPS server. The normal solution to this is to use a
|
serve a secure site, since Spothole itself doesn't directly support acting as an HTTPS server. The normal solution
|
||||||
"reverse proxy" setup, where a general web server handles HTTP and HTTP requests (to port 80 & 443 respectively), then
|
to this is to use a "reverse proxy" setup, where a general web server handles HTTP and HTTP requests (to port 80
|
||||||
passes on the request to the back-end application (in this case Spothole). nginx is a common choice for this general web
|
& 443 respectively), then passes on the request to the back-end application (in this case Spothole). nginx is a
|
||||||
server.</p>
|
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.
|
<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>
|
<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
|
<p>Create a file at <code>/etc/nginx/sites-available/</code> called <code>spothole</code>. Give it the following
|
||||||
<code>spothole.app</code> with the domain name on which you want to run Spothole. If you changed the port on which Spothole runs,
|
contents, replacing <code>spothole.app</code> with the domain name on which you want to run Spothole. If you changed
|
||||||
update that on the "proxy_pass" line, and if you installed Spothole somewhere other than <code>/home/spothole/spothole</code>,
|
the port on which Spothole runs, update that on the "proxy_pass" line, and if you installed Spothole somewhere other
|
||||||
adjust the alias location for serving static files.</p>
|
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
|
<p>(The latter section, configuring the nginx server to serve static files directly, improves efficiency because it
|
||||||
Spothole itself from serving JS, CSS etc. files. If you can't do this for some reason, e.g. your nginx and spothole are
|
saves Spothole itself from serving JS, CSS etc. files. If you can't do this for some reason, e.g. your nginx and
|
||||||
on different computers, you can omit the <code>location /static/ {}</code> block.)</p>
|
spothole are on different computers, you can omit the <code>location /static/ {}</code> block.)</p>
|
||||||
<pre><code>server {
|
<pre><code>server {
|
||||||
server_name spothole.app;
|
server_name spothole.app;
|
||||||
|
|
||||||
@@ -84,26 +84,29 @@ on different computers, you can omit the <code>location /static/ {}</code> block
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</code></pre>
|
</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.
|
<p>One further change you might want to make to the file above is the <code>add_header
|
||||||
These are what's used on my own Spothole server to make sure that other third-party web-based software can get the data
|
Access-Control-Allow-Origin</code> statements. These are what's used on my own Spothole server to make sure that
|
||||||
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
|
other third-party web-based software can get the data from my instance, and applies to any endpoint underneath
|
||||||
same way, so that others can write software in JavaScript that can access it, leave this intact. But if you want your
|
<code>/api</code>. If you want <em>your</em> Spothole instance to be set up the same way, so that others can write
|
||||||
Spothole instance to only be usable by scripts running on the web server you write, you can remove these lines. (Note
|
software in JavaScript that can access it, leave this intact. But if you want your Spothole instance to only be
|
||||||
that this doesn't stop other people writing <em>non-web-based</em> software that accesses your Spothole API—the
|
usable by scripts running on the web server you write, you can remove these lines. (Note that this doesn't stop
|
||||||
enforcement of cross-origin headers only happens within the user's browser. If you need to lock your instance down so
|
other people writing <em>non-web-based</em> software that accesses your Spothole API—the enforcement of
|
||||||
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
|
cross-origin headers only happens within the user's browser. If you need to lock your instance down so that no-one
|
||||||
find help with elsewhere.)</p>
|
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>
|
<p>Now, make a symbolic link to enable the site:</p>
|
||||||
<pre><code>cd /etc/nginx/sites-enabled
|
<pre><code>cd /etc/nginx/sites-enabled
|
||||||
sudo ln -sf ../sites-available/spothole
|
sudo ln -sf ../sites-available/spothole
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Test that your nginx config isn't broken using <code>nginx -t</code>. If it works, restart nginx with
|
<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>
|
<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
|
<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>
|
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>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&os=snap">install certbot</a> onto your server. Run it
|
<p>Once that's working, <a href="https://certbot.eff.org/instructions?ws=nginx&os=snap">install certbot</a> onto
|
||||||
as root, and when prompted pick your domain name from the list. After a few seconds, it should successfully provision a
|
your server. Run it as root, and when prompted pick your domain name from the list. After a few seconds, it should
|
||||||
certificate and modify your nginx config files automatically. You should then be able to access the site via HTTPS.</p>
|
successfully provision a certificate and modify your nginx config files automatically. You should then be able to
|
||||||
|
access the site via HTTPS.
|
||||||
|
</p>
|
||||||
|
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{% extends "../help_page.html" %}
|
{% extends "../help_page.html" %}
|
||||||
{% block help_content %}
|
{% block help_content %}
|
||||||
|
|
||||||
<h2 class="mt-4 mb-4">Running your own copy</h2>
|
<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
|
<p>If you want to run a copy of Spothole with different configuration settings than the main instance, you can download
|
||||||
and run it on your own local machine or server.</p>
|
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
|
<p>You will require Python version 3.10 or later. If you encounter an error about <code>gdal-config</code> during the
|
||||||
process, you will also need <code>libgdal-dev</code> installed.</p>
|
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
|
<p>To download and set up Spothole on a Debian server, run the following commands. Other operating systems will likely
|
||||||
similar.</p>
|
be similar.</p>
|
||||||
<pre><code>git clone ssh://git@git.ianrenton.com/ian/spothole.git
|
<pre><code>git clone ssh://git@git.ianrenton.com/ian/spothole.git
|
||||||
cd spothole
|
cd spothole
|
||||||
python3 -m venv ./.venv
|
python3 -m venv ./.venv
|
||||||
@@ -16,29 +16,29 @@ pip install -r requirements.txt
|
|||||||
deactivate
|
deactivate
|
||||||
cp config-example.yml config.yml
|
cp config-example.yml config.yml
|
||||||
</code></pre>
|
</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
|
<p>Then edit <code>config.yml</code> in your text editor of choice to set up the software as you like it. Mostly, this
|
||||||
enabling or disabling the various providers of spot and alert data.</p>
|
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
|
<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 turned off by default due to the volume of traffic from CW/RTTY/FT8 skimmers, and the APRS and
|
||||||
spot providers are off by default on the assumption that Spothole users want a spot with a human at the other end of it,
|
Packet spot providers are off by default on the assumption that Spothole users want a spot with a human at the other
|
||||||
but all can be easily re-enabled.</p>
|
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
|
<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>
|
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
|
<p><code>config.yml</code> has an entry for a Clublog API key. If provided, this will allow Spothole to retrieve some
|
||||||
about DX spots. The software will work just fine without it, but you may find a few country flags etc. are less accurate
|
more information about DX spots. The software will work just fine without it, but you may find a few country flags
|
||||||
or missing. Clublog API keys are free, but you'll need to get your own by submitting a helpdesk ticket and explaining
|
etc. are less accurate or missing. Clublog API keys are free, but you'll need to get your own by submitting a
|
||||||
what you'll use it for. The admin team are happy with the rate of requests made by my Spothole server, so unless you
|
helpdesk ticket and explaining what you'll use it for. The admin team are happy with the rate of requests made by my
|
||||||
change the source code of yours to radically increase the rate of querying Clublog, I'm sure they will be fine with your
|
Spothole server, so unless you change the source code of yours to radically increase the rate of querying Clublog,
|
||||||
server too.</p>
|
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>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>
|
<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
|
<pre><code>source .venv/bin/activate
|
||||||
python3 spothole.py
|
python3 spothole.py
|
||||||
</code></pre>
|
</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
|
<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
|
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>
|
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
|
<p>If you see some errors on startup, check your configuration, e.g. in case you have specified a port for the web
|
||||||
that is already in use by something else.</p>
|
server that is already in use by something else.</p>
|
||||||
|
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{% extends "../help_page.html" %}
|
{% extends "../help_page.html" %}
|
||||||
{% block help_content %}
|
{% block help_content %}
|
||||||
|
|
||||||
<h2 class="mt-4 mb-4">systemd configuration</h2>
|
<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
|
<p>If you want Spothole to run automatically on startup on a Linux distribution that uses <code>systemd</code>, follow
|
||||||
instructions here. For distros that don't use <code>systemd</code>, or Windows/OSX/etc., you can find generic instructions for your
|
the instructions here. For distros that don't use <code>systemd</code>, or Windows/OSX/etc., you can find generic
|
||||||
OS online.</p>
|
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
|
<p>Create a file at <code>/etc/systemd/system/spothole.service</code>. Give it the following content, adjusting for the
|
||||||
to run it as and the directory in which you have installed it:</p>
|
user you want to run it as and the directory in which you have installed it:</p>
|
||||||
<pre><code>[Unit]
|
<pre><code>[Unit]
|
||||||
Description=Spothole
|
Description=Spothole
|
||||||
After=syslog.target network.target
|
After=syslog.target network.target
|
||||||
|
|||||||
@@ -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 %}
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{% 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 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 help section 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 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>
|
|
||||||
|
|
||||||
{% end %}
|
|
||||||
+2
-2
@@ -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=1790184306"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1790196142"></script>
|
||||||
<script src="/static/js/map.js?v=1790184306"></script>
|
<script src="/static/js/map.js?v=1790196142"></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>
|
||||||
|
|||||||
@@ -125,8 +125,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1790184305"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1790196142"></script>
|
||||||
<script src="/static/js/spots.js?v=1790184305"></script>
|
<script src="/static/js/spots.js?v=1790196142"></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>
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/status.js?v=1790184305"></script>
|
<script src="/static/js/status.js?v=1790196142"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#nav-link-status").addClass("active");
|
$("#nav-link-status").addClass("active");
|
||||||
|
|||||||
+37
-72
@@ -4,7 +4,7 @@ import os
|
|||||||
import threading
|
import threading
|
||||||
|
|
||||||
import tornado
|
import tornado
|
||||||
from tornado.web import RedirectHandler, StaticFileHandler
|
from tornado.web import StaticFileHandler
|
||||||
|
|
||||||
from core.config import (
|
from core.config import (
|
||||||
ALLOW_SPOTTING,
|
ALLOW_SPOTTING,
|
||||||
@@ -193,79 +193,44 @@ class WebServer:
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
ui_routes = (
|
ui_pages = [
|
||||||
[
|
"map",
|
||||||
(r"/", PageTemplateHandler, {"template_name": "spots"}),
|
"bands",
|
||||||
(
|
"alerts",
|
||||||
r"/map",
|
"conditions",
|
||||||
PageTemplateHandler,
|
"status",
|
||||||
{"template_name": "map"},
|
"help",
|
||||||
),
|
"help/about",
|
||||||
(
|
"help/usage",
|
||||||
r"/bands",
|
"help/usage/clients",
|
||||||
PageTemplateHandler,
|
"help/usage/telnet",
|
||||||
{"template_name": "bands"},
|
"help/usage/embedding",
|
||||||
),
|
"help/usage/running",
|
||||||
(
|
"help/usage/docker",
|
||||||
r"/alerts",
|
"help/usage/nginx",
|
||||||
PageTemplateHandler,
|
"help/usage/systemd",
|
||||||
{"template_name": "alerts"},
|
"help/usage/multicluster",
|
||||||
),
|
"help/usage/modifying",
|
||||||
(
|
"help/sources",
|
||||||
r"/conditions",
|
"help/faq",
|
||||||
PageTemplateHandler,
|
"help/accuracy",
|
||||||
{"template_name": "conditions"},
|
"help/privacy",
|
||||||
),
|
"help/thanks",
|
||||||
(
|
]
|
||||||
r"/status",
|
|
||||||
PageTemplateHandler,
|
|
||||||
{"template_name": "status"},
|
|
||||||
),
|
|
||||||
(
|
|
||||||
r"/help",
|
|
||||||
PageTemplateHandler,
|
|
||||||
{"template_name": "help/index"},
|
|
||||||
),
|
|
||||||
]
|
|
||||||
+ [
|
|
||||||
(
|
|
||||||
rf"/help/{page}",
|
|
||||||
PageTemplateHandler,
|
|
||||||
{"template_name": f"help/{page}"},
|
|
||||||
)
|
|
||||||
for page in ["about", "using", "sources", "faq", "accuracy", "privacy", "thanks"]
|
|
||||||
]
|
|
||||||
+ [
|
|
||||||
(
|
|
||||||
rf"/help/usage/{page}",
|
|
||||||
PageTemplateHandler,
|
|
||||||
{"template_name": f"help/usage/{page}"},
|
|
||||||
)
|
|
||||||
for page in [
|
|
||||||
"running",
|
|
||||||
"docker",
|
|
||||||
"systemd",
|
|
||||||
"nginx",
|
|
||||||
"multicluster",
|
|
||||||
"clients",
|
|
||||||
"embedding",
|
|
||||||
"modifying",
|
|
||||||
]
|
|
||||||
]
|
|
||||||
+ [
|
|
||||||
# Old "About" page URL, redirect for the benefit of existing links & bookmarks
|
|
||||||
(r"/about", RedirectHandler, {"url": "/help"}),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# 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",
|
(
|
||||||
PageTemplateHandler,
|
rf"/{page}",
|
||||||
{"template_name": "add_spot"},
|
PageTemplateHandler,
|
||||||
)
|
{"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.
|
||||||
|
|||||||
Reference in New Issue
Block a user