-
Notifications
You must be signed in to change notification settings - Fork 86
The web GUI
As promised, Pat comes with both a command-line interface and a Web GUI.
Before you start using the GUI you'll first have to configure via the command-line.
Start Pat in http mode:
$ pat http
2016/03/15 01:34:40 Starting HTTP service (http://localhost:8080)...
Pat now acts as a HTTP server that you can connect to with your favorite browser. Try it out, http://localhost:8080/.
You can control the active listeners with the --listen, -l
option:
$ pat --listen winmor,ardop,ax25,telnet http
2016/03/15 01:40:49 ft897 ready. Dial frequency is 5.347.00 MHz.
2016/03/15 01:40:50 WINMOR TNC v1.5.7.0 initialized
2016/03/15 01:40:50 ARDOP TNC (ARDOP TNC_0.4.3.8-BPQ) initialized
2016/03/15 01:40:50 Listening for incoming traffic (winmor,ardop,telnet,ax25)...
Tip: Instead of manually starting Pat from the terminal, consider running it as a background service.
By default Pat only listens for connections from the local machine. This is due to security concerns.
Either set "http_addr": ":8080"
in the config or start http with the --addr, -a
argument (See pat help http
). This will allow Pat to accept HTTP connections from other devices/computers on your network.
Due to new security recommendations that are being adopted by major web browsers, some features may not be available when you use the web GUI over a network connection.
These features are:
- Desktop notifications on new messages
- Geolocation for position reporting
In addition to requiring explicit user permissions, these Powerful Features are gradually being deprecated (phased out) on Insecure Origins by web browsers in an effort to make the web more secure.
In layman's terms, an insecure origin is a non-encrypted web server. With the exceptions of services available on loopback devices such as localhost
, the web application must be served with HTTPS to make use of these features.
Chrome/Chromium is one of the first browsers to deprecate powerful features on insecure origins.
For affected users, there are several workarounds to consider:
- Use a SSH tunnel
- Run a reverse HTTP proxy on localhost
- Enable "Insecure origins treated as secure" flag in Chrome [chrome://flags/#unsafely-treat-insecure-origin-as-secure] Add your PAT server, complete with protocol and port eg. http://patserver.local:8080
Support for HTTPS may be added in the future, but it will most likely be impractical for most users. It may even be illegal on some network, such as wireless networks on amateur radio frequency bands.
The debian packages comes with a systemd unit file that enables users to run Pat's web GUI as a system service. This will require systemd, which is used by most Linux distributions to manage services.
Start Pat as a system service:
$ sudo systemctl start pat@YOUR-LINUX-USERNAME
Enable automatic startup on boot:
$ sudo systemctl enable pat@YOUR-LINUX-USERNAME
Also included in the debian packages are systemd unit files for ARDOPc and AX.25, which will allow you to control ARDOPc and kissattach as any other background service.
To install these:
sudo /usr/share/pat/ax25/install-systemd-ax25-unit.bash
sudo /usr/share/pat/ardopc/install-systemd-ardop-unit.bash
See AX.25 on Linux for details on how to configure AX.25 ports as a systemd service.
For ARDOP, see Configuring ARDOPc to start at boot.
Pat's command-line interface composeform
command (e.g. pat composeform --template 'GENERAL Forms/GPS Position Report'
) only supports simple text-based forms (found in .txt
files in the forms directory).
The web GUI supports much more powerful HTML form composition (under Action/Compose and then select Template at the bottom of the New messsage popup).
In addition to user input of form fields, HTML forms also include automatic substitution of several insertion tags. Each of these tags, enclosed in curly braces in the HTML form, has a value substituted. The insertion tags currently implemented by Pat include:
Tag | Description |
---|---|
{MsgSender} | Message sender call sign |
{Callsign} | ditto |
{ProgramVersion} | Pat version |
{DateTime} | Current local date and time |
{UDateTime} | Current UTC date and time |
{Date} | local date |
{UDate} | UTC date |
{UDTG} | UTC date/time formatted like 021504Z Jan 2006 |
{Time} | Current local time |
{UTime} | Current UTC time |
{GPS} | GPS position in degrees-minutes-sections.fraction with Easting and Northing (see note) |
{GPS_DECIMAL} | GPS position in decimal degrees with Easting and Northing |
{GPS_SIGNED_DECIMAL} | GPS position in signed decimal |
{Latitude} | Latitude in signed decimal |
{latitude} | ditto |
{Longitude} | Longitude in signed decimal |
{longitude} | ditto |
{GridSquare} | Maidenhead Grid Square |
{GPSValid} | Is GPS position valid? YES or NO |
By default, in order to protect user privacy, GPS positions from GPSd are disabled unless you make the following changes to your config.json by setting enable_http
to allow the web UI to see GPS position data and allow_forms
to allow GPS location insertion in form templates as in the example:
"gpsd": {
"enable_http": true,
"allow_forms": true,
"use_server_time": false,
"addr": "localhost:2947"
},