Commit Graph

597 Commits

Author SHA1 Message Date
Hemna 81169600bd Set a default password for admin
This patch sets a default password of "password" for the admin webui.
2023-10-06 15:32:31 -04:00
Hemna 746eeb81b0 Fix path for KISS clients
The kiss client send method was always forcing the config
path.  If a packet has a path specified in it, that will
override the config setting for the kiss client setting in the config.
2023-10-05 18:00:45 -04:00
Hemna f41488b48a Added packet_dupe_timeout conf
This patch adds the new packet_dump_timeout config option, defaulting to
60 seconds.   If the same packet matching the from, to, msgNo is RX'd
within that timeout the packet is considered a dupe and will be
dropped.  Ack packets are not subject to dupe checking.
2023-10-05 13:56:02 -04:00
Hemna ddd4d25e9d Add ability to change path on every TX packet
This patch adds the ability to webchat to set the path
on every outbound packet for the KISS clients as well as
the fake client.  The path dropdown includes the options for
Default path (which will default to the config setting)
WIDE1-1,WIDE2-1
ARISS
2023-10-05 10:33:07 -04:00
Hemna 544600a96b Make Packet objects hashable
This patch makes the packet key a property of the Packet object and
makes packet objects comparable and hashable.
2023-10-03 16:01:43 -04:00
Hemna 59cec1317d Don't process AckPackets as dupes
If we RX an AckPacket, then send it on for processing.  There is no need
to check for a dupe.
2023-10-02 08:42:00 -04:00
Hemna 751bbc2514 Fixed another msgNo int issue 2023-09-29 15:40:42 -04:00
Hemna 9bdfd166fd Fixed issue with packet tracker and msgNO Counter
The packet msgNo field is a string, but is typically is an integer
counter to keep track of a specific packet id.  The counter was
returning an int, but the packet.msgNo is a string.  So, when trying to
delete a packet from the packet tracker, the key for accessing the
packet is the msgNo, which has to be a string.  Passing an int, will
cause the packet tracker to not find the packet, and hence silently
fail.

This patch forces the msgNo counter to be a string.
2023-09-29 10:04:15 -04:00
Hemna f79b88ec1b Fixed import of Mutablemapping
python 3.10 moved it to collections.abc
2023-09-28 15:30:54 -04:00
Hemna 99a0f877f4 pep8 fixes 2023-09-28 12:34:01 -04:00
Hemna 4f87d5da12 rewrote packet_list and drop dupe packets
This patch rewrites the packet_list internally to be a dictionary
instead of a list for very fast lookups.  This was needed to test for
duplicate packets already in the list.

This patch drops packets that have the same data and are < 60 seconds
in age from the last time we got the packet.   On RF based clients
we can get dupes!!
2023-09-28 12:19:18 -04:00
Hemna 0d7e50d2ba Log a warning on dupe
This patch logs a warning if we detect a dupe packet inbound.
2023-09-27 15:45:39 -04:00
Hemna 1f6c55d2bf Fix for dupe packets.
Sometimes over KISS clients (RF), we can get duplicate packets
due to having many digipeters in range of the TNC that aprsd is
connected to.   We will now filter out any dupe packets that aprsd
is still in the process of doing it's 3 acks.
2023-09-27 14:55:47 -04:00
Hemna c9dc4f67d4 minor cleanup prior to release 2023-09-26 15:27:51 -04:00
Hemna 788a72c643 Webchat: fix input maxlength
This changes the maxlength of the input message box to 67 characters.
Also changes the GPS beacon text.
2023-09-26 12:53:08 -04:00
Hemna 82d25915fc WebChat: cleanup some console.logs 2023-09-26 12:07:28 -04:00
Hemna 12dfdefb62 WebChat: flash a dupe message 2023-09-26 12:00:02 -04:00
Hemna d63c6854af Webchat: Fix issue accessing msg.id
After the refactor of the messages object in webchat, we are sending
a direct json dict version of the packet now.  This means there is no
msg.id in the dict, but msg.msgNo instead.  This should help fix
the display of dupes.
2023-09-26 11:04:59 -04:00
Hemna 6b083d4c4d Webchat: Fix chat css on older browsers
Some older browswers can't handle the new css syntax
for a subclass in the same css definition.
2023-09-26 10:47:53 -04:00
Hemna ff358987a9 WebChat: new tab should get focus
When a new tab is created it now gets the focus.
2023-09-26 10:31:00 -04:00
Hemna 3f5dbe0a12 Webchat: Fix pep8 errors 2023-09-21 18:34:03 -04:00
Hemna 9635893934 Webchat: Added tab notifications and raw packet
This patch adds an auto mouseover hover popover for displaying
the raw APRS packet.

This patch also adds the notification counter for an unselected tab.
2023-09-21 16:29:15 -04:00
Hemna f151ae4348 WebChat: Prevent sending message without callsign
This patch adds raising an error if the user doesn't set the
to call callsign when sending a message.
2023-09-15 14:32:22 -04:00
Hemna 7130ca2fd9 WebChat: fixed content area scrolling
This patch fixes some issues when switching between tabs.
2023-09-15 14:12:55 -04:00
Hemna b393060edb Webchat: tweaks to UI for expanding chat
This patch changes the layout containers a bit.  Moved the tabs to the
header section and made the tab contents fill the rest of the height of
the browser and it is the only portion that scrolls.
2023-09-15 11:34:38 -04:00
Hemna f770c5ffd5 Webchat: Fixed bug deleteing first tab
This patch fixes a UI issue when the user delets the first tab and the
remaining tabs aren't refreshed/shown.
2023-09-15 09:13:51 -04:00
Hemna ef206b1283 Ensure Keepalive doesn't reset client at startup
This patch ensures that the keepalive thread doesn't try and
reset/restart the aprs connection at startup.
2023-09-14 16:46:00 -04:00
Hemna 140fa4ace4 Ensure parse_delta_str doesn't puke
This patch fixes an issue where the parse_delta_str regex doesn't
match anything.
2023-09-14 16:23:49 -04:00
Hemna 81a19dd101 WebChat: Send GPS Beacon working
This patch adds back in the jquery toast plugin that used to come as
part of the fomantic ui js code.
2023-09-13 12:05:40 -04:00
Hemna 1400e3e711 webchat: got active tab onclick working
This patch adds the ability to click on the already existing active tab
and have it populate the to_call input box.
2023-09-12 16:37:06 -04:00
Hemna 8a90d5480a webchat: set to_call to value of tab when selected
This patch will set the to_call form field to the callsign of the
tab when the tab is activated in the UI.

NOTE: still need to populate it when clicking on the already active
tab.
2023-09-12 15:44:34 -04:00
Hemna b4e02c760e Center the webchat input form
This patch centers the input form for the webchat page over the
center of the page.
2023-09-10 12:13:05 -04:00
Hemna ba6b410795 Update index.html to use chat.css 2023-09-10 11:12:38 -04:00
Hemna 70ddc44b5c Deleted webchat mobile pages
removed user-agents package dependency
2023-09-08 15:45:32 -04:00
Hemna 852760220f Added close X on webchat tabs
This patch adds an X on each tab as a way to close the conversation
and nuke the local storage for the conversation.
2023-09-08 12:43:33 -04:00
Hemna 14e984c9b4 Reworked webchat with new UI
This patch reworks the webchat UI to work in both desktop
and mobile layouts.  Comprimises were made, but there is 1
codebase now between both desktop and mobile.
This patch also includes the new imessage/sms chat look.
2023-09-08 11:19:24 -04:00
Hemna 29f21a9469 Updated the webchat UI to look like iMessage 2023-09-06 11:20:59 -04:00
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
Hemna 8b73372b6e Added rpc server for listen
Added the ability to start the rpc server for fetching stats from the
listen command.  If the rpc server is enabled in config, the rpc
server will now start.
2023-06-21 18:48:08 -04:00
Hemna 26c1e7afbb Update location plugin and reworked requirements
Added geopy as a dependency for the location plugin.
The us weather service API is now broken upstream.

Reworked the requirements.txt and dev-requirements.txt files
2023-06-15 16:08:28 -04:00
Hemna 4e99e30f16 Ensure conf is imported for threads/tx
Import the conf for threads/tx.py to ensure that the
msg_rate_limit_period is defined prior to the conf entry
being referenced.
2023-05-05 11:07:23 -04:00
Hemna 5694cabd93 cleanup some debug messages 2023-04-25 14:29:26 -04:00
Hemna e21e2a7c50 Fixed loading of plugins for server
Some instances the plugins failed to load
2023-04-20 14:31:50 -04:00
Hemna 17d9c06b07 Don't load help plugin for listen command
This patch disables loading the help plugin for the listen command.
2023-04-17 15:37:48 -04:00
Hemna 0ec41f7605 Change listen command plugins
The listen command now adds the --load-plugins, which is false by
default, to load all the plugins as defined in the config file.
2023-04-17 15:01:57 -04:00
Hemna 483afce5ad Update Listen command
This patch updates the aprsd listen command to add the packet-plugins
argument which allows enabling a single plugin to work against the
packets recieved from the aprsis network.
2023-04-17 10:51:17 -04:00
Hemna 840b0aba97 Add ratelimiting for acks and other packets
This patch adds basic ratelimiting to sending out AckPackets
and non AckPackets.  This provides a basic way to prevent
aprsd from sending out packets as fast as possible, which isn't
great for a bandwidth limited network.

This patch also adds some keepalive checks to all threads in the
threadslist as well as the network client objects (apris, kiss)
2023-01-18 13:00:10 -05:00
Hemna 4aa4a4b5d3 Import RejectPacket 2023-01-16 11:38:48 -05:00
Hemna c68b270ee2 Add support to Reject messages.
This patch adds support for receiving reject messages.
2023-01-14 12:41:22 -05:00
Hemna c5aba17ad1 Ensure server command main thread doesn't exit
This patch adds join calls on the running threads to prevent
the main thread from exiting prematurely.
2023-01-07 14:57:25 -05:00
Hemna 233d49bb4c Fixed save directory default 2023-01-03 15:38:19 -05:00
Hemna 6391c7eed6 Fixed pep8 failure 2023-01-03 09:01:53 -05:00
Hemna 0758a58101 Cleaned up KISS interfaces use of old config 2023-01-02 14:20:13 -05:00
Hemna a5520b2cd3 reworked usage of importlib.metadata
For whatever reason passing in group in python 3.9.x
fails for importlib_metadata.entry_points.  This patch
fetches all and filters through them to get the real
oslo.config.opts entry points now.  This is to find all
of the config options of aprsd and the plugins
2023-01-02 14:13:49 -05:00
Hemna c5acdba6de Updated Healthcheck to use rpc to call aprsd
After adding the rpc service for aprsd server and separating the
admin web REST interface, healthcheck no longer worked.   The stats
are available via rpc now.
2022-12-31 16:52:50 -05:00
Hemna ed284a42cc Added ObjectPacket
This patch adds the ObjectPacket.  This is used by the REPEAT plugins
to send out an object in message packet to let radios tune directly
to the station.
2022-12-30 09:44:25 -05:00
Hemna 3d0bb8ae8e Update regex processing and regex for plugins
The regex search is now by default case insensitive.
Also update each core plugin to better match the command.

ping plugin can now match on
p
p foo
ping
pIng

Weather plugins can now match on
w
wx
wX
Wx KM6LYW
weather
WeaTher
2022-12-29 14:34:46 -05:00
Hemna 83d2e708eb Change ordering of starting up of server command
This patch moves the plugin manager to early in the startup
process so that the plugins get loaded, which also means each
plugin's custom config settings will be in the CONF object.
This allows dumping the entire CONF with all the plugin settings.
2022-12-29 14:15:56 -05:00
Hemna c929689647 Update documentation and README
This updates the documentation in prep for 3.0.0
2022-12-28 16:50:34 -05:00
Hemna ff392395ed Decouple admin web interface from server command
This patch introduces rpyc based RPC client/server for
the flask web interface to call into the running aprsd server
command to fetch stats, logs, etc to send to the browser.

This allows running the web interface via gunicorn command
gunicorn -k gevent --reload --threads 10 -w 1 aprsd.flask:app --log-level DEBUG
2022-12-28 15:55:09 -05:00
Hemna e9a954a8fd Fix some unit tests and loading of CONF w/o file 2022-12-27 15:31:49 -05:00
Hemna f4a6dfc8a0 Added missing conf 2022-12-27 14:46:41 -05:00
Hemna 7ccfc253cf Removed references to old custom config
Also updated unittests to pass.
2022-12-27 14:30:03 -05:00
Hemna e13ca0061a Convert config to oslo_config
This patch is the initial conversion of the custom config
and config file yaml format to oslo_config's configuration mechanism.

The resulting config format is now an ini type file.

The default location is ~/.config/aprsd/aprsd.conf

This is a backwards incompatible change.  You will have to rebuild
the config file and edit it.

Also any aprsd plugins can now define config options in code and
add an setup.cfg entry_point definition
oslo_config.opts  =
  foo.conf = foo.conf:list_opts
2022-12-24 16:51:40 -05:00
Hemna bbcd7c8a5b Fix Rain reporting in WeatherPacket send.
Made a fix for a rain setting of 1.04 inches, the packet
has to be r104 instead of r001
2022-12-22 09:42:30 -05:00
Hemna 4a65f52939 Removed Packet.send()
This patch decouples sending a message from the internals of
the Packet classes.  This allows the rest of the code to use
Packet objects as type hints in methods to enforce Packets
in the plugins.

The send method was moved to a single place in the threads.tx.send()
2022-12-21 16:26:36 -05:00
Hemna f464ff0785 Removed watchlist plugins
All plugins can be loaded with the enabled_plugins
Also added unit tests for the PluginManager
2022-12-21 11:18:26 -05:00
Hemna 2ca36362ec Fix PluginManager.get_plugins
This patch fixes the result of get_plugins to be a list correctly.
2022-12-21 10:05:27 -05:00
Hemna 7dfa4e6dbf Cleaned up PluginManager
Added a separate pluggy track for normal plugins
and watch list plugins.
2022-12-20 16:19:05 -05:00
Hemna 220fb58f97 Cleaned up PluginManager
Added a separate pluggy track for normal plugins
and watch list plugins.
2022-12-20 15:13:13 -05:00
Hemna 088cbb81ed Update routing for weatherpacket
update the routing to
WIDE1-1, WIDE2-1
2022-12-20 11:51:47 -05:00
Hemna f19043ecd9 Fix some WeatherPacket formatting 2022-12-19 21:27:05 -05:00
Hemna a1188d29d4 Fix pep8 violation 2022-12-19 20:41:57 -05:00
Hemna d01392f6a5 Add packet filtering for aprsd listen
Now aprsd listen can filter by packet types.
2022-12-19 17:28:18 -05:00
Hemna 899a6e5363 Added WeatherPacket encoding
This patch adds the ability to output a correctly formatted
APRS weather packet for sending.
2022-12-19 14:04:14 -05:00
Hemna ad0d89db40 Updated webchat and listen for queue based RX
This patch updates both the webchat and listen commands
to be able to use the new queue based packet RX processing.

APRSD used to start a thread for every packet received, now
packets are pushed into a queue for processing by other threads
already running.
2022-12-19 10:28:22 -05:00
Hemna e37f99a6dd reworked collecting and reporting stats
This is the start of the cleanup of reporting of
packet stats
2022-12-18 21:54:34 -05:00
Hemna 9fc5356456 Removed unused threading code 2022-12-18 09:14:12 -05:00
Hemna 123b3ffa81 Change RX packet processing to enqueu
This changes the RX thread to send the packet into a queue instead of
starting a new thread for every packet.
2022-12-18 08:52:58 -05:00
Hemna 1187f1ed73 Make tracking objectstores work w/o initializing
This changes the objectstore to test to see if the config has been
set or not.  if not, then it doesn't try to save/load from disk.
2022-12-17 20:06:28 -05:00
Hemna c201c93b5d Cleaned up packet transmit class attributes
This patch cleans up the Packet class attributes used to
keep track of how many times packets have been sent and
the last time they were sent.  This is used by the PacketTracker
and the tx threads for transmitting packets
2022-12-17 18:06:24 -05:00
Hemna f1de7bc681 Fix packets timestamp to int
Python's default timestamp is a float.
APRS packet expect to have an old style unix integer
timestamp.
2022-12-16 15:58:03 -05:00
Hemna 6030cb394b More messaging -> packets cleanup
Fixed the unit tests and the notify plugin
2022-12-16 15:58:03 -05:00
Hemna bfc0a5a1e9 Cleaned out all references to messaging
The messaging.py now is nothing but a shell that
contains a link to packets.NULL_MESSAGE to help maintain
some backwards compatibility with plugins.

Packets dataclass has fully replaced messaging objects.
2022-12-16 15:58:02 -05:00
Hemna 59e5af8ee5 Added contructing a GPSPacket for sending
This patch adds the needed code to construct the raw output
string for sending a GPSPacket.

TODO: Need to incorporate speed, course, rng, position ambiguity ?
TODO: Need to add option to 'compress' the output location data.
2022-12-16 15:58:02 -05:00
Hemna 1b49f128a9 cleanup webchat 2022-12-16 15:58:02 -05:00
Hemna 94fb481014 Reworked all packet processing
This patch reworks all the packet processing to use the new
Packets objects.  Nuked all of the messaging classes.

backwards incompatible changes
all messaging.py classes are now gone and replaced by
packets.py classes
2022-12-16 15:58:02 -05:00
Hemna 67a441d443 Updated plugins and plugin interfaces for Packet
This patch updates unit tests as well as the Plugin filter()
interface to accept a packets.Packet object instead of a
packet dictionary.
2022-12-16 15:58:02 -05:00
Hemna 082db7325d Started using dataclasses to describe packets
This patch adds new Packet classes to describe the
incoming packets parsed out from aprslib.
2022-12-16 15:58:02 -05:00
Hemna 9571b0bb38 Fixed position report for webchat beacon
With more testing of the webchat beaconing, found a problem
with the packet format for the beacon.  This patch fixes the
packet format of the beacon.

Also added a timeout when trying to get the GPS location in the browser,
otherwise it could never come back.
2022-12-16 12:01:35 -05:00
Hemna 19e5cfa9cc Add unit tests for webchat 2022-12-14 08:26:12 -05:00
Hemna 9d19502dd8 Fix for Collections change in 3.10
python 3.10 moved a module in the collections package
breaking backwards compatibility.  this patch puts a fix in
to account for it.
2022-12-12 20:45:19 -05:00
Hemna f2b1ad35f9 change from device-detector to user-agents
the device detector was taking 1 minute on a raspi to parse out the
user-agent string from the browser.  user-agents takes 2 seconds,
which still isn't great, but 'doable' for the webchat interface.
2022-12-07 13:40:08 -05:00
Hemna 51b80cd4ea Refactored threads a bit
This patch refactors the rx threads a bit to reuse some code
responsible for processing acks when packets are received.

This also eliminates a custom thread in the webchat command for
processing received packets now that there is common code in the base
classes.
2022-12-02 16:26:48 -05:00
Hemna 480094b0d4 Mark packets as acked in MsgTracker
This patch updates webchat to track the msgs recieved as tracked
and acked, so the TX thread can stop trying to send.
2022-12-02 14:58:32 -05:00
Hemna 726c8f4f2f remove dev setting for template 2022-12-02 14:20:52 -05:00
Hemna ee96108324 Add GPS beacon to mobile page
This patch adds the GPS beacon button to the mobile layout.
2022-11-30 15:17:28 -05:00
Hemna 5067f745ca Allow werkzeug for admin interface.
This patch enables werkzeug for socketio for the admin interface
2022-11-30 14:31:44 -05:00
Hemna f9e7195e25 Add support for mobile browsers for webchat
This patch adds initial support for changing the UI for webchat
based if the browser is on a mobile device.
2022-11-30 14:14:51 -05:00
Hemna 44696fbc56 Ignore callsign case while processing packets
This patch fixes an issue where aprsd was deciding if it was
supposed to process a packet destined for itself or not.  It was
making a case sensitive comparison.  This patch makes that comparison
case insensitive for the callsign itself.
2022-11-30 13:57:25 -05:00
Hemna 1a1d00242b Send GPS Beacon from webchat interface
This patchset allow getting the GPS coordinates from the browser's
geolocation API (which can be denied by user), then send's the GPS
coordinates to aprsd via socketio and then aprsd sends a beacon.

This allows the APRS network to know the location of the person running
the webchat app via browser so packets can get routed back to it.
2022-11-25 13:25:09 -05:00
Hemna d4bf0f1e3c Remove email validation
The package/library being used for email validation is basically
defunct now.
2022-11-25 09:29:41 -05:00
Hemna 5acddbd466 Fixed failing unit tests
This patch re-adds in the pytz lib for the generic time plugins.
2022-11-23 13:28:38 -05:00
Hemna 528bdb99e7 Removed TimeOpenCageDataPlugin
This patch removes the TimeOpenCageDataPlugin as it's been superceded
by the aprsd-timeopencage-plugin
2022-11-23 13:02:46 -05:00
Hemna fc1ca52593 Dump config with aprsd dev test-plugin
This patch adds the dumping of the config read for the
aprsd dev test-plugin command
2022-11-23 13:02:46 -05:00
Hemna 7d970cbe70 Got webchat working with KISS tcp
This patch reworks the KISS client to get rid of
aioax25 as it was too difficult to work with due to
heavy use of asyncio.

Switched to the kiss3 pypi library.
2022-11-23 13:01:43 -05:00
Hemna d717a22717 Added click auto_envvar_prefix
This allows setting environment variables that are
prefixed with APRSD_
2022-11-23 13:01:06 -05:00
Hemna 9b0c626b59 Update aprsd thread base class to use queue
This patch updates the main aprsd threads class to use
a shared queue to notify all aprsd thread classes they need
to exit.  This ensures any closing down of sockets, etc happens from
inside the context of the thread itself, not the MainThread that
calls stop.
2022-11-23 13:01:06 -05:00
Hemna 967959e7b3 Update packets to use wrapt
This patch updates the aprsd/packets.py to use wrapt for it's method
lock synchornization.
2022-11-23 13:01:06 -05:00
Hemna 2ce50d8861 Try sending raw APRSFrames to aioax25
This seems to work sending out, but still getting
third-party dropped packets as response from the local repeater.
2022-11-23 13:01:06 -05:00
Hemna ad79ed1261 Use new aprsd.callsign as the main callsign
This patch changes how aprsd identifies itself when connected to
any client, which is not relying on the login for each client.
There are 3 supported clients currently
aprsis,
tcpkiss
serialkiss.

Each client has their own potential login/callsign to connect
to the remote.  This patch tells aprsd to use the new config option
aprsd.callsign as a means to identify itself.  It will accept
packets as <aprsd.callsign> and reply as <aprsd.callsign> regardless
of which client object is being used to connect to the remote.

Note: this breaks backwards compatibility.  This patch now requires
the new config option
aprsd:
  callsign: <callsign>
2022-11-23 13:01:01 -05:00
Hemna 5f28788180 Fixed access to threads refactor 2022-11-23 13:00:37 -05:00
Hemna 585d55f10d Added webchat command
This patch adds the new aprsd webchat command which shows
a new webpage that allows you to aprsd chat with multiple
callsigns
2022-11-23 13:00:36 -05:00
Hemna 1ccb2f7695 Moved log.py to logging
Also renamed logging/logging.py to logging/rich.py
2022-11-23 13:00:36 -05:00
Hemna a62843920a Moved trace.py to utils
This patch moves trace.py to the utils directory
2022-11-23 13:00:36 -05:00
Hemna 29b84b453b Fixed pep8 errors 2022-11-23 13:00:36 -05:00
Hemna 347a6d69f7 Refactored threads.py
This patch creates a threads directory and separates out
the contents of threads.py into separate files in the
threads directory to make it easier to find and maintain.
2022-11-23 13:00:36 -05:00
Hemna bed060f1c5 Refactor utils to directory
This patch moves the utils.py to utils/__init__.py
and fuzzyclock.py to utils
and separates the ring_buffer to it's own file in utils
2022-11-23 13:00:36 -05:00
Walter A. Boring IV fdc8bfafc0
Merge pull request #96 from ranguli/fix-pypi-scraping
Fix #92 (PyPI scraping)
2022-11-01 14:01:37 -04:00
ranguli 9ffd320353 Fix PyPI scraping 2022-10-27 12:33:31 -02:30
ranguli cc2918377e Fix typo on exception 2022-10-26 16:46:50 -02:30
Hemna 1c052a63c0 Fixed up config option checking for KISS
This patch updates the config option checking for
required fields in the config yaml file.  Specifically
for the existence of the aprsd: section
and the required fields for the 3 supported client types
apris,
kiss serial,
kiss tcp
2022-02-21 16:04:33 -05:00
Hemna e739441268 Fix logging issue with log messages
This patch changes the base Message class to
ensure that all printing of the message class only
outputs the message in the truncated and bad word filtering
enabled in the log.
2022-02-11 10:03:02 -05:00
Hemna 6257c9ea90 FIX: logging exceptions
This patch fixes the logging of exceptions in the email
plugin.
2022-01-26 14:39:14 -05:00
Hemna e8100d8777 Removed debug code 2022-01-07 15:17:16 -05:00
Hemna 764730c123 Updated list-plugins
This patch updates the README.rst with the new format for
`aprsd list-plugins`.
2021-12-15 10:48:16 -05:00
Hemna 2f6e7e17e8 Added unit tests for dev test-plugin
Also added a check to make sure that the aprs_login
parameter is passed in for use as the fromcallsign.
2021-12-12 16:35:26 -05:00
Hemna a7bbde4a43 Send Message command defaults to config
The APRS_LOGIN and APRS_PASSWORD arguments now fallback
to the config file if it exists.

First it checks the passed in parameters, then checks the
environement vars, then checks the parsed config to find the
login and password.

This patch also adds unit tests for the send-message command to
check the fallback.
2021-12-12 16:13:08 -05:00
Hemna 3b9970c0e7 Fixed an KISS config disabled issue
This patch fixes a small bug when both KISS interfaces are disabled.
2021-12-11 07:46:43 -05:00
Hemna e57a2e2ffc Fixed a bug with multiple notify plugins enabled
This patch fixes an issue with the processing of packets
and updateing the watchlist.  Previously after the
notify plugin processed the packet it would update the watchlist.
This doesn't work when there are more than 1 notify plugins
enabled, only the first notify plugin seeing the packet will
recognize that the callsign is old.
2021-12-10 14:20:57 -05:00
Hemna 592b328956 Unify the logging to file and stdout
This patch updates the logging facility to ensure that
logging to a file works even when --quiet mode is selected.
Also update the listen and list-plugins command to show
a console.status line while waiting for results to come in.
2021-12-10 10:49:09 -05:00
Hemna cd62db95c1 Added new feature to list-plugins command
This patch updates the ouput of the list-plugins command.
This also adds the ability to show the available plugins
to install that are published packages on pypi.org.

This also shows the list of installed packages from pypi.org
2021-12-08 17:16:17 -05:00
Hemna 440c8d54ad Tightened up the packet logging 2021-12-07 15:00:38 -05:00
Hemna 8ea00e9888 Added unit tests for USWeatherPlugin, USMetarPlugin 2021-12-07 13:31:58 -05:00
Hemna 0ad791bdd9 Added NotifyPlugin unit tests and more
This patch restructures the unit tests for plugins.
This also adds unit tests for the NotifyPlugin
2021-12-07 11:25:14 -05:00
Hemna 96cc07d15f Small cleanup on packet logging
This patch reduces some of the leading whitespace
to the message/packet logging to the log file.
2021-12-06 14:35:49 -05:00
Hemna d3dd08714b Reduced the APRSIS connection reset to 2 minutes
The time in which the KeepAlive Thread would reset the APRS-IS
socket connection used to be 5 minutes.   This patch changes
that to 2 minutes.
2021-12-06 14:34:22 -05:00
Hemna 055835cb3c Fixed the NotifyPlugin
The watchlist notify plugin is supposed to send an APRS message
to the configured callsign.  This patch makes sure that the
message is sent to the notify_callsign
2021-12-06 14:11:34 -05:00
Hemna b5b286e75c Fixed some pep8 errors 2021-12-03 09:10:33 -05:00
Hemna 1233137caf Add tracing for dev command
This patch enables tracing output in the log for the dev
test-plugin command
2021-12-03 08:53:08 -05:00
Hemna 1d5f76defc Added python rich library based logging.
The python rich library is extensive and has a really nice
log format that is easier to read and has built in formatting
and coloring of the log output.

To enable rich logging add rich_logging: True in the config file.
2021-12-03 08:05:03 -05:00
Hemna 5e50792e80 fixed the failure during loading for objectstore
This patch fixes a silent failure of loading data from the objectstore
2021-11-13 15:07:28 -05:00
Hemna 6fb610582d Fixed dev command missing initialization
This patch fixes a few issues when running test-plugin command.
It was missing some initialization of the stats and packets classes.
2021-11-13 09:56:19 -05:00
Hemna bda2ef00dd Fix admin logging tab 2021-11-12 12:17:45 -05:00
Hemna 446484e631 Added new list-plugins command
This patch adds the new list-plugins command that shows the
list of built in plugins for APRSD.
2021-11-12 11:36:22 -05:00
Hemna a8a6b1aa07 Don't require check-version command to have a config
This patch removes the need for check-version to have a
config file.
2021-11-12 10:23:27 -05:00
Hemna 8842fb1b44 Healthcheck command doesn't need the aprsd.yml config
This patch updates the healthcheck command to not require
the aprsd.yml config file to exist.   The healthcheck
calls a running aprsd, collects the stats to determine if it's
healthy.
2021-11-10 11:52:51 -05:00
Hemna 152132b0ed Fix test failures 2021-11-10 11:51:21 -05:00
Hemna 7787dc1be4 Removed requirement for aprs.fi key
This removed the requirement of running APRSD for specifying
the aprs.fi key in the config file.  The plugins that need the
key have been updated to set enabled = False when the key is missing.
2021-11-10 11:01:10 -05:00
Hemna 9469410929 Removed stock plugin. 2021-11-09 15:02:54 -05:00
Hemna 88db485eb4 Removed the stock plugin
This patch removed the built in stock plugin from APRSD.
This helps clean up the requirement tree from the yfinance
python module that pulled in a lot of other requirements.

The stock plugin is it's own separate repo and module now.

https://github.com/hemna/aprsd-stock-plugin

https://pypi.org/project/aprsd-stock-plugin/
2021-11-09 14:53:20 -05:00