Commit Graph

410 Commits

Author SHA1 Message Date
Hemna 7292744a78 Restore previous conversations in webchat
This patch saves the webchat conversations messages in the browser's
local storage.  When the user comes back to the page, the
conversations are restored.
2023-09-05 14:14:52 -04:00
Hemna 008b2ab09e recreate client during reset()
This patch re-creates the client object during a client.reset() call.
2023-09-01 16:11:19 -04:00
Hemna a9e8050ae6 Removed admin_web.py
This patch removes the old admin_web.py.   Use the aprsd.wsgi
for the admin interface.
2023-09-01 14:38:55 -04:00
Hemna 82f77b7a6a Removed some RPC server log noise 2023-08-28 09:19:54 -04:00
Hemna 570fdb98a7 Fixed admin page packet date
The date timestamp was always showing as 1970.  Had to adjust
the javascript conversion from epoch to Date object
2023-08-28 09:18:50 -04:00
Hemna 9582812041 RPC Server logs the client IP on failed auth
this patch adds an error log for the client IP of who connects
to the rpc server without proper auth key.
2023-08-23 13:48:09 -04:00
Hemna 859f904602 Start keepalive thread first
This patch changes the order of the threads starting.  The Keepalive
thread's job is to test the aprsis/kiss client to see if it's up and
running, and then issue a reset if it's down.   On SIGINT, the keepalive
might issue that reset in the middle of a shutdown, which might cause
things to hang when everything should be shutting down.  Making the
KeepaliveThread first, means it will be the first to be shut down as
well, preventing the next loop from resetting the client.
2023-08-23 13:45:46 -04:00
Hemna 34311f0fbd fixed an issue in the mobile webchat
The global socket var wasn't defined globally in send-message-mobile.js
2023-08-23 13:15:50 -04:00
Hemna 2416f0ea1a Added dupe checkig code to webchat mobile 2023-08-22 16:03:27 -04:00
Hemna 377842c2ec click on the div after added. 2023-08-22 13:46:43 -04:00
Hemna a8dd9ce012 Webchat suppress to display of dupe messages
This patch updates the web ui for webchat to suppress the displaying
of duplicate recieved messages.  Dupes can happen over the KISS
interface due to packets being encapsulated by nearby repeaters into 3rd
party packets.

When a dupe message is recieved, the dupe message is flashed 3 times.
2023-08-22 13:37:43 -04:00
Hemna 1d6a667987 Convert webchat internet urls to local static urls 2023-08-22 12:51:50 -04:00
Hemna 2e9a204c74 Make use of webchat gps config options
This patch makes use of the gps settings in the webchat section.
If the user sets the latitude and longitude in the config file, then
the gps beacon button will be enabled.  The gps button will still be
enabled if the http connection is over SSL.
2023-08-22 12:31:44 -04:00
Hemna f922b3f97b Added new webchat config section
This patch adds a new webchat config section to specify:
web_ip (the ip address to listen on)
web_port
latitude (latitude to use for the GPS beacon button)
longitude (long to use for the GPS beacon button)
2023-08-22 12:01:34 -04:00
Hemna 8dd3b05bb1 fixed webchat logging.logformat typeoh
This fixes a problem with webchat when specifying the logfile
in aprsd config
2023-08-15 21:49:43 -04:00
Hemna 33c7871dbe Forcefully allow development webchat flask
This patch adds the force werkzeug to allow development environment
to allow aprsd webchat to work from inside of systemd
2023-08-15 17:42:56 -04:00
Hemna ae9e4d31ad Added support for ThirdParty packet types
The kiss clients now detect if the incomming packet is a third party
packet and then sends up the subpacket instead of the encapsulated
packet up to the consumer.
2023-08-15 14:24:03 -04:00
Hemna 65a5a90458 Disable the Send GPS Beacon button
This patch disables the 'Send GPS Beacon' button for the webchat
command if the browser isn't connected over https
2023-08-14 18:45:13 -04:00
Hemna 182887c20a Removed adhoc ssl support in webchat
This immediately breaks the beacon button.
This patch removes the dep for pyopenssl and cryptography
so that aprsd install on the rpi.

Unfortunately in order for the web page to get the Lat/Lon, the
browser must be connected over SSL.  Will have to create a workaround
for this later.
2023-08-14 18:34:25 -04:00
Hemna db9e1d23d1 Fixed pep8 failures 2023-08-07 11:07:01 -04:00
Hemna 986df391b2 re-enable USWeatherPlugin to use mapClick
The old MApClick.php api seems to work...re-enabling
2023-07-31 21:53:02 -04:00
Hemna 9ebf2f9a30 Fix sending packets over KISS interface
The KISS client sends the path as part of the headers, so we had
to strip out the path from the payload of each message so the path
wouldn't get listed twice.
2023-07-28 17:25:06 -04:00
Hemna 011cfc55e1 Use config web_ip for running admin ui from module
When running the web admin interface with
'python -m aprsd.wsgi' the Flask app global now uses
the web_ip config entry for listening.  Also disabled
debug output.
2023-07-26 08:47:22 -04:00
Hemna e0c3c5cbbf remove loop log 2023-07-25 20:45:55 -04:00
Hemna 26f354b3a9 Max out the client reconnect backoff to 5
This patch adjusts the backoff mechanism for aprs client
reconnect to a max backoff sleep of 5 seconds.   This prevents
an exponential backoff when connection retrying.
2023-07-24 17:03:29 -04:00
Hemna c7d629f88a Use CONF.admin.web_port for single launch web admin
This patch changes the non uwsgi launch of the admin page
to use the config for the web port
2023-07-24 09:39:16 -04:00
Hemna 099b87e250 Fixed sio namespace registration 2023-07-23 20:22:48 -04:00
Hemna 4664ead9e7 Fixed pep8 2023-07-23 19:34:02 -04:00
Hemna e51a501544 change port to 8000 2023-07-23 19:19:55 -04:00
Hemna 89576a3c43 replacement of flask-socketio with python-socketio
This patch starts the work to replace flask-socketio with
python-socketio so that uwsgi can be used instead of gunicorn.
uwsgi can support websockets.

Have to rework webchat command next
2023-07-23 18:54:23 -04:00
Hemna 5383b698ea Change how fetch-stats gets it's defaults
The defaults come from the aprsd.conf CONF attributes now.
2023-07-22 17:05:11 -04:00
Hemna cbef93b327 Ensure fetch-stats ip is a string 2023-07-22 16:41:54 -04:00
Hemna 6ae55fc9a1 Add info logging for rpc server calls 2023-07-20 16:43:31 -04:00
Hemna 588e140a7f updated wsgi config default /config/aprsd.conf
This patch changes wsgi.py to default to /config/aprsd.conf

It's assumed that this will be used as a docker container
2023-07-20 15:59:44 -04:00
Hemna d3a93b735d Added timing after each thread loop
This is to help keep track of which non-blocking threads are still
alive.

The RPC Server thread blocks, so the time will always increase.
2023-07-20 14:44:46 -04:00
Hemna 6a6e854caf Removed flask-classful from webchat
This patch removed the dependency on flask-classful.  This required
making all of the flask web routing non class based.

This patch also changes the aprsis class to allow retries for failed
connections when the aprsis servers are full and not responding to
login requests.
2023-07-20 14:34:31 -04:00
Hemna e1183a7e30 Remove flask pinning
Also removed need for flask-classful. Created new
aprsd/wsgi.py for the web admin interface.
2023-07-20 14:34:31 -04:00
Hemna 35d41582ee Moved logging to log for wsgi.py
Added wsgi.py to be used with gunicorn to start aprsd's web admin
interface.

gunicorn -b :8080 "aprsd.wsgi:app"
2023-07-16 16:32:39 -04:00
Hemna 565ffe3f72 Changed weather plugin regex pattern
The weather plugins used to match on w, but now require wx
2023-07-15 18:22:24 -04:00
Hemna 0bd11d05c6 Limit the float values to 3 decimal places 2023-07-14 11:35:32 -04:00
Hemna aa547cbef5 Fixed rain numbers from aprslib 2023-07-14 10:42:36 -04:00
Hemna 7f2aba702a Fixed rpc client initialization 2023-07-13 14:58:12 -04:00
Hemna 63bf82aab5 Fix in for aprslib issue #80
aprslib incorrectly decodes weather packets and doesn't provide
wind_speed or wind_direction from the CSE/SPD 7 bytes in the APRS
packet.  This patch puts a temporary fix in place until the
aprslib pull request lands and is released.

https://github.com/rossengeorgiev/aprs-python/issues/80

https://github.com/rossengeorgiev/aprs-python/pull/81
2023-07-13 14:35:55 -04:00
Hemna 005675cb46 Fixed pep8 errors 2023-07-10 11:01:41 -04:00
Hemna 191e1ff552 Populate stats object with threads info
This patch adds the thread names and state to the stats object
so the aprsd fetch-stats command can show it.
2023-07-10 10:44:24 -04:00
Hemna 0a14b07fae added counts to the fetch-stats table 2023-07-09 21:29:29 -04:00
Hemna b2e621da4b Added the fetch-stats command
You can now fetch and view the stats of a live running aprsd server
if it has enabled the rpc server in the config file's rpc_settings
block.
You just have to match the magic word as specified in the config file to
authorize against the rpc server.

aprsd fetch-stats --ip-address <ip of aprsd> --port <port> --magic-word
<magic word>
2023-07-09 21:06:57 -04:00
Hemna fe0d71de4d Replace ratelimiter with rush
This patch replaces the ratelimiter library with rush for rate limiting
as the ratelimiter package doesn't work with python 3.11.

This patch also refactors the flask.pu to admin_web.py and
aprsd.py to main.py
2023-07-08 17:30:22 -04:00
Hemna 80b85e648f Fixed unit tests for Location plugin 2023-06-22 09:06:55 -04:00
Hemna 5bc589f21f Fixed pep8 violation
This patch fixes a pep8 violation in the location plugin
2023-06-21 18:51:53 -04:00