1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-04 16:01:15 -05:00
Commit Graph

212 Commits

Author SHA1 Message Date
d3ee1b78bc Fixed issue when RX ack
This patch ensures that after we get an ACK, then proessing of the ack
message is complete and we don't try and send the ack through plugin
filtering.

Created send_ack_direct for the send-message command.

Also added logic to the send-message command to ensure we wait for an
ack from the command sent to APRSD and we also wait for a response
message and send an ack to that response before we exit.
2020-12-20 16:35:23 -05:00
0992ab8176 Updated the aprsd-slack-plugin required version
this patch updates the docker-compose file to use
the 1.0.2 or > version of aprsd-slack-plugin
2020-12-20 15:29:16 -05:00
6a61765eba Updated README.rst
This patch updates the README.rst with sample help and output from
various commands
2020-12-20 12:36:47 -05:00
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
John
a566990a2f
Update .gitignore
I want to add some tests but before that I want git to ignore the venv folder and all the Idea (Pycharm) settings that get created in the home folder by default.
2020-12-19 17:25:27 -08:00
Craig Lamparter
923e1a7c3d
Merge pull request #23 from craigerl/aprslib
Major refactor
2020-12-19 14:00:01 -08:00
fa51f8fdf2 Big patch
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.
2020-12-19 16:35:53 -05:00
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
79d2139fe1
Merge pull request #24 from craigerl/docker_alpine
Updated the Dockerfile to use alpine
2020-12-17 10:22:22 -05:00
b5fb248b46 Updated the Dockerfile to use alpine
The ubuntu images were running about 533MB in size, so
I refactored the Dockerfiles to use alpine linux, and they run
about 130MB.
2020-12-17 10:16:58 -05:00
3002ac2e89
Merge pull request #22 from craigerl/fix_email
Fix unknown characterset emails
2020-12-15 18:05:28 -05:00
96bae795a5 Fix unknown characterset emails
Some emails that had an unknown character set.  when that happens
we can't decode the body of the message properly, so the default body
string was being used, and was attempting to be decoded.  Only byte
strings can be decoded, so the default string is now labeled as a byte
encoding.
2020-12-15 17:59:17 -05:00
b4526f3a0e
Merge pull request #21 from craigerl/readme
Readme
2020-12-15 12:09:31 -05:00
8a6273867c Updated loggin timestamp to include []
Added timestamp inside of [] for easier parsing
2020-12-15 11:10:46 -05:00
21253ff6e7 Updated README with a TOC
This patch updates the README.rst to include an index table at the top
as well as a section describing building and using the docker container
2020-12-15 10:51:02 -05:00
57fe08758f
Merge pull request #19 from craigerl/docker
Updates for building containers
2020-12-15 10:35:13 -05:00
861fde6f83 Updates for building containers
This patch updates the Dockerfile for building the official container
image and includes the ability to load external pypi modules as plugins
at container startup.
2020-12-15 10:32:53 -05:00
ba61178b14
Merge pull request #18 from craigerl/plugin_fix
Don't use the dirname for the plugin path search
2020-12-15 09:36:38 -05:00
63079a817d Don't use the dirname for the plugin path search 2020-12-15 09:30:10 -05:00
ec140995c2
Merge pull request #17 from craigerl/fix_plugin
Reworked Plugin loading
2020-12-15 07:53:56 -05:00
1385f5ee27 Reworked Plugin loading
This patch reworked the loading of plugins.  Python2 is dead.
Previously was using the imp module to easily load the plugins from
a separate directory, which is a bit of a pita.  Found a python3 lib
that takes care of the difference between py3.3, 3.4 and 3.5+ module
loading called "thesmuggler"
2020-12-15 07:50:10 -05:00
3ffa4165f0 Updated README with development information 2020-12-14 16:06:07 -05:00
eba093b62a Fixed an issue with weather plugin
Weather plugin had an invalid call to rstrip()
2020-12-14 14:18:12 -05:00
e1edbe6c62 Rewrote the README.md to README.rst
This patch rewrote the README.md file to an README.rst
so that pypi might be able to consume it.
2020-12-14 11:35:10 -05:00
Craig Lamparter
28363d0814
Merge pull request #16 from hemna/plugins_fix
Fixed the usage string after plugins introduced
2020-12-13 20:31:18 -08:00
2873e35f14 Fixed the usage string after plugins introduced
This patch fixes the Usage string for a call message
that isn't matched by any plugin.

Plugin object now must impleent a 'command_name' attribute
that is the usage string for that plugin.
2020-12-13 21:51:39 -05:00
Craig Lamparter
ccad85a8bf
Merge pull request #15 from hemna/plugins
Created plugin.py for Command Plugins
2020-12-13 18:06:35 -08:00
d09a66006b Created plugin.py for Command Plugins
This patch adds the new APRSD Command Plugin architecture.
All Comand plugins must implement the same object API, which includes
plugin object is subclass of APRSDPluginBase
version attribute
command_regex attribute
command method

When an APRS command is detected, then the regex is run against
the command.  If the command_regex matches, then the plugin's
command() method will be called.   If the command() method returns
a string, then that string is sent as a reply to the APRS caller.

A new aprs.yml config section is added to support selecting
which plugins to enable.

If you want all plugins enabled, then omit "enabled_plugins" entirely
from the aprs section of the config.

To load custom plugins:
1) create a directory with an __init__.py file
2) Add a plugin.py file that contains your plugin

Look at the exmaples directory for an example plugin.
2020-12-13 20:57:30 -05:00
Craig Lamparter
8c9c12b3fc
Merge pull request #14 from hemna/socket_select
Refactor networking and commands
2020-12-12 09:10:52 -08:00
00d99bc2c4 Refactor networking and commands
This patch refactors the socket management
to use select, as well as refactor all of the
commands into a COMMAND_ENVELOPE dictionary.

This patch also adds the Dockerfile and
docker-compose.yml files
2020-12-11 19:29:18 -05:00
Craig Lamparter
43509ea9e6 get rid of some debug statements 2020-12-11 10:23:14 -08:00
Craig Lamparter
bb1a2ee61a yet another unicode problem, in resend_email fixed 2020-12-11 09:49:26 -08:00
Craig Lamparter
d3bb44feec reset default email check delay to 60, fix a few comments 2020-12-11 06:53:38 -08:00
Craig Lamparter
40472ca7d6
Merge pull request #13 from hemna/test
Update tox environment to fix formatting python errors
2020-12-11 06:19:16 -08:00
53b8f21535 Update tox environment to fix formatting python errors
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.
2020-12-11 08:47:56 -05:00
Craig Lamparter
2bebd83449 fixed fortune. yet another unicode issue, tested in py3 and py2 2020-12-10 15:54:38 -08:00
Craig Lamparter
c5517a7cb5 lose some logging statements 2020-12-10 15:29:29 -08:00
Craig Lamparter
86bf42802c completely off urllib now, tested locate/weather in py2 and py3 2020-12-10 15:15:19 -08:00
Craig Lamparter
b38f561b84 add urllib import back until i replace all calls with requests 2020-12-10 12:19:40 -08:00
Craig Lamparter
ad0f96d1aa cleaned up weather code after switch to requests ... from urllib. works on py2 and py3 2020-12-10 10:21:31 -08:00
Craig Lamparter
00432cf5bb switch from urlib to requests for weather, tested in py3 and py2. still need to update locate, and all other http calls 2020-12-10 10:11:35 -08:00
Craig Lamparter
4b09fad876 imap tags are unicode in py3. .decode tags 2020-12-10 09:10:59 -08:00
Craig Lamparter
9cd65424f8
Update INSTALL.txt 2020-12-09 08:05:08 -08:00
Craig Lamparter
9dcb73b2a1
Merge pull request #12 from hemna/click
Click
2020-12-09 07:33:25 -08:00
50fb090557 Initial conversion to click 2020-12-09 09:47:37 -05:00
craigerl
b553987350 Reconnect on socket timeout 2020-12-09 09:40:23 -05:00
Craig Lamparter
735cb3a557 clean up code around closed_socket and reconnect 2020-12-09 09:34:34 -05:00
Craig Lamparter
ef132d8037 Update INSTALL.txt 2020-12-09 09:32:27 -05:00
51832ea75e Fixed all pep8 errors and some py3 errors
This introduced the six lib which can translate common
py2 vs py3 incompatibilities.
https://six.readthedocs.io/
2020-12-09 09:31:36 -05:00
craigerl
b552f9611f fix check_email_thread to do proper threading, take delay as arg 2020-12-09 09:27:44 -05:00