From 98be1c89db58c0d3d086707a182551bd78aaf25f Mon Sep 17 00:00:00 2001 From: Y Date: Sun, 17 Dec 2017 12:52:44 +0100 Subject: [PATCH] setup and configuration information --- README.md | 6 ++++++ TODO.md | 1 + extra/setup/setup.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 extra/setup/setup.py diff --git a/README.md b/README.md index db4221b..f8ef74a 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,9 @@ Interesting [filtering entries](https://www.freedesktop.org/software/systemd/man * `_PID`: process ID of the systemd unit’s main process * `MESSAGE`: the actual message of the log entry * `__REALTIME_TIMESTAMP`: Python `datetime` of the log entry, formatted as: `YYYY-MM-DD HH:MM:SS:µµµµµµ` + +The `/etc/pyruse` directory is where system-specific files are looked-for: +* the `pyruse.json` file that contains the configuration, +* the `pyruse/actions` and `pyruse/filters` subfolders, which may contain additional actions and filters. + +Instead of using `/etc/pyruse`, an alternate directory may be specified with the `PYRUSE_EXTRA` environment variable. diff --git a/TODO.md b/TODO.md index 4a10857..7e5845b 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,6 @@ # TODO +* Improve documentation, especially on the contents of `pyruse.json`. * Maybe switch from storing the daily journal in a file, to storing it in a database. * Maybe switch from Step.run() recursion to Step.run()-in-a-loop to avoid too-deep call stacks. * Eventually make the code more elegant, as I learn more about Python… diff --git a/extra/setup/setup.py b/extra/setup/setup.py new file mode 100644 index 0000000..ec5b5fd --- /dev/null +++ b/extra/setup/setup.py @@ -0,0 +1,33 @@ +from distutils.core import setup + +setup( + name='pyruse', + version='1.0', + license='GPL-3', + description='Route systemd-journal logs to filters and actions (ban, report…)', + long_description=''' +================ +Python peruser of systemd-journal +================ + +This program is intended to be used as a lightweight replacement for both epylog and fail2ban. + +The wanted features are these: + +* Peruse all log entries from systemd’s journal, and only those (ie: no log files). +* Passively wait on new entries; no active polling. +* Filter-out uninteresting log lines according to the settings. +* Act on matches in the journal, with some pre-defined actions. +* Create a daily report with 2 parts: + - events of interest (according to the settings), + - and other non-filtered-out log entries. +* Send an immediate email when something important happens (according to the settings). + ''', + author='Yves G.', + author_email='theYinYeti@yalis.fr', + maintainer='Yves G.', + maintainer_email='theYinYeti@yalis.fr', + url='https://yalis.fr/git/yves/pyruse', + download_url='https://yalis.fr/git/yves/pyruse', + packages=['pyruse', 'pyruse.actions', 'pyruse.filters'], +)