Commit Graph

312 Commits

Author SHA1 Message Date
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