spiderweb/README.md

146 lines
5.1 KiB
Markdown
Raw Normal View History

2020-03-08 22:09:21 +00:00
SPIDERWEB
2020-02-01 06:12:53 +00:00
===
### Ham radio cluster web viewer for DxSpider
2020-03-14 16:48:56 +00:00
- **Author:** Corrado Gerbaldo - IU1BOW.
- **Mail:** <corrado.gerbaldo@gmail.com>
- **Licensing:** Gpl V3.0 see ["LICENSE"](LICENSE) file.
- **Languages:** This application is written in Python/flask,Javascript and HTML
2020-03-08 22:09:21 +00:00
___
2020-06-02 06:14:37 +00:00
**DXSpider** is a great DX Cluster software that has a usefull telnet interface.
2020-03-08 22:09:21 +00:00
I wrote this application in order to add a web user interface to DXSpider and show the spots collected.
The user could see 50 spots at time and filter them by band, spotter continent and spotted continent.
2020-02-01 06:12:53 +00:00
2020-02-09 09:03:12 +00:00
For this application I've used:
- **Bootstrap** for stylesheet CSS
- **Jquery** In the header you can find the link to MS link
- **qrz.com** For each callsing found you can click on lens and you'll see him on qrz.com
- **www.countryflags.io** I used it for show the country flags
2020-06-02 06:14:37 +00:00
- **cookie-bar.eu** I use it for cookie bar
2020-02-01 06:12:53 +00:00
2020-03-12 17:27:40 +00:00
You can find my web site at [https://dxcluster.iu1bow.it](https://dxcluster.iu1bow.it)
2020-09-20 05:10:13 +00:00
### Changelog
see it on file ["CHANGELOG.md"](docs/CHANGELOG.md)
2020-09-08 07:31:14 +00:00
2020-03-08 22:09:21 +00:00
### Install
**1) DXSpider**
First of all you have to installed [DXspider] (http://www.dxcluster.org/) and connected with some other cluster nodes.
**2) MariaDB / MySQL**
Then you have to install MariaDB on your web server, on the same server where DXSpider is running and configure DXSpider to use it: in your spider folder edit `local/DXVars.pm` adding these lines:
```DXWars.pm
# the SQL database DBI dsn
$dsn = "dbi:mysql:dxcluster:localhost:3306";
$dbuser = "your-user";
$dbpass = "your-password";
```
If you would change some MariaDB parameters, then you can find them in `/etc/mysql/my.cnf` or `/etc/my.cnf`, depending on your distro.
**3) Python / Flask**
2020-10-04 15:05:07 +00:00
First of all you have to install the python3 pip installer
```console
foo@bar:~$ sudo apt install python3-pip
```
This application is based on Flask
2020-03-08 22:09:21 +00:00
To install **Flask**:
```console
2020-10-04 15:05:07 +00:00
foo@bar:~$ pip3 install flask
2020-03-08 22:09:21 +00:00
```
or
```console
2020-10-04 15:05:07 +00:00
foo@bar:~$ sudo -H pip3 install flask --system
2020-03-08 22:09:21 +00:00
```
2020-10-04 15:05:07 +00:00
Then you have to install mysql libraries**:
2020-03-08 22:09:21 +00:00
```console
2020-10-04 15:05:07 +00:00
foo@bar:~$ pip3 install flask_mysqldb
or
foo@bar:~$ sudo -H pip3 install flask_mysqldb --system
2020-03-08 22:09:21 +00:00
```
2020-09-26 16:07:19 +00:00
2020-06-02 06:14:37 +00:00
Finally you have to install matplotlib in order to plots some graphics
```console
2020-10-04 15:05:07 +00:00
foo@bar:~$ pip3 install matplotlib
or
foo@bar:~$ sudo -H pip3 install matplotlib --system
2020-06-02 06:14:37 +00:00
```
2020-03-14 16:48:56 +00:00
**4) Configuration**
2020-09-26 16:07:19 +00:00
In the path `spiderweb/cfg/` rename `config.json.template` in `config.json`:
2020-03-12 17:27:40 +00:00
```console
2020-09-26 16:07:19 +00:00
foo@bar:~$ mv config.json.template config.json
2020-03-12 17:27:40 +00:00
```
2020-10-04 09:13:45 +00:00
then edit it and set the user and password of your database and the menu items.
Othewhise, if you preferr, you could use an utility for edit your configuration and menu. Go in "script" folder and run ./config.sh
2020-03-12 17:27:40 +00:00
2020-10-04 09:13:45 +00:00
```console
foo@bar:~$ cd scripts
foo@bar:~$ ./config.sh
*** DxSpider configuration ***
Configuration file loaded from: ../cfg/config.json
h: help
vc: view config.
ec: edit config.
vm: view menu
em: edit menu
s: save
t: load config. from template
x: exit
Make your choiche:
```
In order to show the right *plots*, you have to generate them!
2020-06-02 06:14:37 +00:00
To do so you have to run *.sh* files inside *scripts* folders, or the better way is to **schedule** them with your **crontab**
```console
foo@bar:~$ crontab -e
```
then edit it in a manner like this:
```crontab
0 23 * * * /foo/bar/spiderweb/scripts/qso_months.sh > /dev/null 2>&1
*/15 * * * * /foo/bar/spiderweb/scripts/propagation_heatmaps.sh > /dev/null 2>&1
```
2020-03-08 22:09:21 +00:00
### Run test
Now you can run your web application with the following command:
```console
2020-10-11 10:05:18 +00:00
foo@bar:~$ python3 webapp.py
2020-03-08 22:09:21 +00:00
```
The flask default port is 5000, so you can see your web app, typing `http://localhost:5000` in your web browser.
2020-06-20 05:03:06 +00:00
Keep in mind that the flask web server, usually is used as a test server.
2020-03-08 22:09:21 +00:00
### Production
If your would run your application a production web server, install it on **Gunicorn** and **NGINX** (obviously you can choose your preferred proxy/web server instead). I'm also using **certbot** in order to manage SSL *Let's encrypt* certificates.
[At this link](https://noviello.it/come-installare-flask-con-gunicorn-e-nginx-su-ubuntu-18-10/) (in italian language) you can find a guide for install certbot, gunicorn and NGINX
After installed it you can configure
2020-09-20 05:10:13 +00:00
**Search engine indexing**
When you are on-line, if you would to index your website on search engines, you have to generate a file named sitemap.xml and put it in /static/ folder. There are many tool to generate sitemap.xml, for example https://www.xml-sitemaps.com/
**Index on MySQL
If you would to increase speed on callsign search, you could define some index on the table 'spot'. You can see more details on 'scripts/create_mysql_index.sql'
2020-03-08 22:09:21 +00:00
~
2020-09-20 09:20:56 +00:00
### Screenshots
Screenshot
----------
2020-09-20 09:34:54 +00:00
<img src="docs/images/01_desktop_main.jpg" width="300"/>
<img src="docs/images/02_desktop_plot.jpg" width="300"/>
2020-09-26 16:07:19 +00:00
<p float="left">
2020-09-20 09:36:11 +00:00
<img src="docs/images/03_mobile_install.jpg" width="200"/>
<img src="docs/images/04_mobile_icon.jpg" width="200"/>
<img src="docs/images/05_mobile_splash.jpg" width="200"/>
<img src="docs/images/06_mobile_main.jpg" width="200"/>
2020-09-26 16:07:19 +00:00
</p>
2020-03-08 22:09:21 +00:00
2020-06-02 06:14:37 +00:00
### TODO
2020-09-20 05:10:13 +00:00
see it on file ["TODO.md"](docs/TODO.md)