Commit Graph

13 Commits

Author SHA1 Message Date
Hemna e175f77347 Use Gray instead of Black for code formatting.
The Black code formatter sucks with respect to function
declarations with a lot of params.  Completely unreadable.
2021-08-23 13:32:09 -04:00
Hemna 840c8a990e Put in a fix for aprslib parse exceptions
This patch adds a fix for the aprslib consumer function
to ensure that we don't bail when logging a ParseError
2021-08-13 10:31:45 -04:00
Hemna 1a1fcba1c4 Add new watchlist feature
This patch adds a new optional feature called Watch list.
Aprsd will filter IN all aprs packets from a list of callsigns.
APRSD will keep track of the last time a callsign has been seen.
When the configured timeout value has been reached, the next time
a callsign is seen, APRSD will send the next packet from that callsign
through the new notification plugins list.

The new BaseNotifyPlugin is the default core APRSD notify based plugin.
When it gets a packet it will construct a reply message to be sent
to the configured alert callsign to alert them that the seen callsign
is now on the APRS network.

This basically acts as a notification that your watched callsign list is
available on APRS.

The new configuration options:
aprsd:
    watch_list:
        # The callsign to send a message to once a watch list callsign
        # is now seen on APRS-IS
        alert_callsign: NOCALL
        # The time in seconds to wait for notification.
        # The default is 12 hours.
        alert_time_seconds: 43200
        # The list of callsigns to watch for
        callsigns:
          - WB4BOR
          - KFART
        # Enable/disable this feature
        enabled: false
        # The list of notify based plugins to load for
        # processing a new seen packet from a callsign.
        enabled_plugins:
        - aprsd.plugins.notify.BaseNotifyPlugin

This patch also adds a new section in the Admin UI for showing the
watch list and the age of the last seen packet for each callsing since
APRSD startup.
2021-07-16 08:31:38 -04:00
Hemna bf8d2c6088 Reworked the stats dict output and healthcheck
This patch reworks the stats object dict and includes more data.
Also includes aprsis last update timestamp (from last recieved message).
This is used to help determine if the aprsis server connection is still
alive and well.
2021-04-01 23:12:25 -04:00
Hemna d1a2a14370 Added showing APRS-IS server to stats
This patch updates the client.py to collect which APRS-IS server
that aprsd is connected to and displays that info on the stats web page.
2021-03-30 10:43:31 -04:00
Hemna 3dd23fa2ad Added a fix for failed logins to APRS-IS
This patch adds a check for a failed login to ARPS due to
LoginError.  This accounts for bad accounts or username/password
failures.  aprsd server will exit immediately upon failed login now.
2021-01-12 09:31:04 -05:00
Hemna ac4c3d6562 Extend APRS.IS object to change login string
This patch copies the aprslib.inet IS object's _send_login()
method so we can change the login app identification string.
2021-01-11 13:08:30 -05:00
Hemna 231c15b1af Lots of fixes 2021-01-08 20:58:18 -05:00
Hemna 4c0150dd97 Added more pre-commit hook tests
also added pre-commit job for tox.
2021-01-08 20:57:58 -05:00
Hemna 2e90c0bdbb Creation of MsgTrack object and other stuff
This patch adds the new MsgTrack object replacing the
global ack_dict.  the ack_dict was not thread safe.
the new MsgTrack is a singleton object that keeps track of
all outbound TextMessage objects.  When a TextMessage.send() is called
it is added to the MsgTrack object, and when an ack is received for that
message, the message is removed from the MsgTrack object.

TODO:  Add an automatic mechanism for saving the messages in MsgTrack
so that when CTRL-C is called to exit aprsd server, then the MsgTrack
state is saved to storage.   When aprsd server is started up again, add
the option to try and reload state of MsgTrack.

This patch also reworked the email thread into an APRSDThread object
that can exit gracefully with CTRL-C.

NOTE: Don't call sleep() with a long time (greater than 5 seconds), as
it causes a delay in exiting aprsd until the last sleep() finishes.
Since aprsd has so many threads now for processing incoming messages and
outgoing messages, we need to coordinate all thread operations so that
they don't block the exiting of the app.
2020-12-29 10:40:38 -05:00
Hemna f65707cb8c reworked threading
This patch reworks the threading code for processing
messages.   This patch also extends the aprslib IS class
to allow us to stop processing the consumer packets when
someone hits CTRL-C correctly.  Alloing the app to exit.
2020-12-24 13:40:59 -05:00
Hemna 3261710bf8 Fixed send-message with email command and others
This patch fixes a minor issue with the new send-message command
You now should use nargs to send the email command because it includes
a - as the start.  click assumed that any -<foo>  looks ike an argument.
So call aprsd with

aprsd send-command <callsign> -- -wb sendmap

This patch also adds -h as a help option for aprsd to make it simpler to
type.

This patch adds the VersionPlugin so you can remotely request the
version of aprsd that's running.
2020-12-20 12:21:30 -05:00
Hemna 08c73a17d1 Major refactor
This branch refactors the majority of main.py out into individual
modules to compartmentalize the code.  Migrated all email related
features unti email.py, sending of messages into messaging.py

Also refactored all of the socket code to use aprslib for all APRS-IS
communication as well as message/packet processing.

Moved the email command into it's own Plugin.
2020-12-18 16:21:35 -05:00