Commit Graph

46 Commits

Author SHA1 Message Date
Hemna 9e26df26d6 Added new webchat config option for logging
This patch adds a new config option for the webchat command
to disable url request logging.
2024-03-23 10:46:17 -04:00
Hemna 127d3b3f26 Fixed some logging in webchat 2024-03-22 23:19:54 -04:00
Hemna 2fefa9fcd6 Replace slow rich logging with loguru
This patch removes the rich logging with
the modern loguru logging
2024-03-06 13:00:52 -05:00
Hemna a7e30b0bed Added location for callsign tabs in webchat
This patch adds the new feature of trying to fetch the location
distance and bearing for each callsign in the webchat tabs.
This is handy when out on the go, you can get a general idea
where the other callsign is when chatting with them.

First aprsd webchat tries to fetch the location with aprs.fi
REST api call.  This assumes internet access.  If this fails,
then webchat will send a special message to REPEAT to ask it for
the location information for the callsign.   This will send over
the air.
2024-02-20 10:18:22 -05:00
Hemna d6f0f05315 Added Location info on webchat interface
This patch adds a new popover in the webchat tab to show
the location information for a callsign.

webchat will try to hit aprs.fi to fetch the location from the
callsign's last beacon.  If there is no internet, this will fail
and webchat will send a request to REPEAT callsign for the location
information.
2024-02-06 16:52:56 -05: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 751bbc2514 Fixed another msgNo int issue 2023-09-29 15:40:42 -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 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 29f21a9469 Updated the webchat UI to look like iMessage 2023-09-06 11:20:59 -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 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 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 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 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 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 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 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 7ccfc253cf Removed references to old custom config
Also updated unittests to pass.
2022-12-27 14:30:03 -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 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 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 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 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 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 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 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 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 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