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
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.
This allows the admin interface to see which plugins are registered and
enabled. Enabled is a flag that is set in the setup() method of the
plugin. This gives the plugin developer a chance to disable the plugin
if something isn't right at setup time. This allows aprsd to ignore
plugins that are registered but not emabled.
Since all outbound messages have a send() method that starts
a separate there, there really is no reason for the transmit queue
thread at all. All it did was get a message from the queue and then
call send on it, which would start another thread. This removes that
intermediate TXThread. When you want to send a message just call
send() on the message object.
This patch updates the APRSDPluginBase class to include
standard methods for allowing plugins to create, start, stop
threads that the plugin might need/use. Also update the aprsd-dev
to correctly start the threads and stop them for testing plugin
functionality.
Also added more unit tests and fake objects for unit tests.
This patch refactors how the recieved message processing happens.
We now handle all incoming packets the same. Removed the notification
thread to handle the watchlist packets. This is now done with a
unified plugins architecture that allows different capabilities
via the new plugin structure. All packets sent to us will be
sent through all of the plugins. It's the plugins job to decide what to
do with that packet or ignore it.
Email is no longer a special case for the most part. All email
functions have been migrated to the EmailPlugin, including starting the
EmailThread, which works in the background to check for new emails and
send those to the registered callsign. The EmailPlugin now starts the
EmailThread itself.
All plugins are now build on the new APRSDPluginBase which has a common
set of features. The APRSDPluginBase calls self.setup() upon creation,
which allows all plugins to do whatever they want for initiali startup.
The EmailPlugin uses setup() to start the EmailThread if email is
enabled.
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.
This patch adds a message counter for each plugin. When the regex for
a plugin passes and the message is pass into the plugin for processing,
that message is tracked. This message count is reported by the stats
tracking object now for the web admin ui.
This patch reorganizes the config file layout and options
to make more logical sense as well as make it more readable.
This breaks backwards compatibility.
This patch adds 2 new time plugins to allow admins to use their
opencagedata APIkey or openweathermap API key to fetch the timezone
from the lat/lon GPS coordinates for the callsign requesting the time.
This will enable fetching the time local to the ham radio's last beacon,
and not time local to the aprsd server instance running. If the
location is not found, then the timezone will default to UTC.
The 2 new plugins are
- aprsd.plugins.time.TimeOpenCageDataPlugin
Fetches timezone from lat/lon using the opencagedata api that can be
found here: https://opencagedata.com/dashboard#api-keys
This requires a new ~/.config/aprsd/aprsd.yml entry to specify the
api key.
opencagedata:
apiKey: <the api key hash here>
- aprsd.plugins.time.TimeOWMPlugin
Fetches the timezone from lat/lon using the openweathermap api
that can be found here: https://home.openweathermap.org/api_keys
This requires a new ~/.config/aprsd/aprsd.yml entry to specify the
api key.
openweathermap:
apiKey: <the api key hash here>
The existing time plugin had a hard coded PDT for pacific timezone,
when it wasn't. This patch adds some real timezone conversion from
utc to the tz of the running aprsd server. This will eventually allow
us to use either the tz of the running aprsd and/or the tz of the
calling callsign if we can just get the tz string from the location
beacon of the caller's callsign.
This patch updates the restart_delayed method to accept the count of
messages to restart as well as the most_recent flag that sorts the
messages based on most recent first. If you want the oldest first,
then pass in False
This patch moves all of the plugins out of plugin.py
into their own separate plugins/<plugin>.py file. This
makes it easier to maintain each plugin.
NOTE: You will have to update your ~/.config/aprsd/aprsd.yml
to change the python location path for each plugin enabled.
For example:
OLD:
enabled_plugins:
- aprsd.plugin.EmailPlugin
TO NEW
enabled_plugins:
- aprsd.plugins.email.EmailPlugin
This patch fixes the email.get_email_from_shortcut. It ensures that
if the lookup isn't found in the shortcut list, it simply returns
the original value. This patch also adds a unit test to specifically
test this function to always return the correct value.
This commit adds the new send-message command for sending messages.
This also redoes the logging of sent/rx'd packets to a single method
which is syncrhonized, so we don't get intermixed log messages for
packets.
Also adds email address validation during startup, and
optionally disables the validation via a command line switch. without
email validation for production running aprsd, emails sent can turn up
garbage and cause issues when those emails are received by aprsd
message processing as invalid content.
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.
This patch includes lots of changes to tox environment for
automatically detecting pep8 failures, which can cause python2 vs
python3 failures after install.
The following tox commands have been added
tox -efmt-check - This checks the python syntax and formatting
tox -efmt - Automatically fixes python syntax formatting that
fmt-check complains about.
tox -etype-check - check on types
tox -elint - flake8 run
This patch also changes where the default config file is located.
The new location is ~/.config/aprsd/aprsd.yml
You can now also specify a custom config file on the command line
with the -c or --config option as well.