Plan for 1.1
by Konstantin Ryabitsev
Hi, all:
This is a quick plan for 1.1. In addition to everyone's excellent work,
I'd like to work on the following before rolling out 1.1:
Rip out autoconf
================
Epylog is not popular enough to warrant a full-blown installer. ;)
Eventually, I may replace it with setuptools, but for now we'll let the
installation be handled by distros.
Add logsources.conf
===================
It always bugged me that we define log sources in each module
configuration file and have to resort to nasty tricks like
/var/log/[foo/]maillog[.#]. I will add a logsources.conf with a simple
format like:
------------8<--------------
[maillog]
source = /var/log/maillog
rotated = /var/log/maillog*
tsformat = traditional
[messages]
source = /var/log/messages
rotated = /var/log/messages*
tsformat = date-rfc3339
------------8<---------------
Then, in the module config files, use:
files = $maillog, $messages
Anything starting with $ will be interpreted to be a reference to what's
defined in logsources.conf. Anything else will be considered old-style
logfile definition.
Drop support for external modules
=================================
It was really only there for compatibility with DULog. Now it just makes
life hard for no real purpose.
This should be small enough subset of features to not get too bogged
down in a massive rewrite, but it'll get things going.
Best,
--
Konstantin Ryabitsev
LinuxFoundation.org
Montréal, Québec
12 years, 5 months
[epylog] Revert "Committing so I can work on this from elsewhere."
by Konstantin Ryabitsev
commit 7379b33d99c2639767722e070db43f1a22a8d136
Author: Konstantin Ryabitsev <mricon(a)kernel.org>
Date: Wed Jan 25 11:47:36 2012 -0500
Revert "Committing so I can work on this from elsewhere."
Moving to its own branch.
py/epylog/__init__.py | 9 -----
py/epylog/log.py | 89 +++++++++++++-----------------------------------
py/epylog/module.py | 7 ----
3 files changed, 24 insertions(+), 81 deletions(-)
---
diff --git a/py/epylog/__init__.py b/py/epylog/__init__.py
index f42b799..ea1827a 100644
--- a/py/epylog/__init__.py
+++ b/py/epylog/__init__.py
@@ -125,15 +125,6 @@ class NoSuchLogError(exceptions.Exception):
logger.put(5, '!NoSuchLogError: %s' % message)
self.args = message
-class EmptyLogError(exceptions.Exception):
- """
- This exception is raised when Epylog finds an empty logfile.
- """
- def __init__(self, message, logger):
- exceptions.Exception.__init__(self)
- logger.put(5, '!EmptyLogError: %s' % message)
- self.args = message
-
class GenericError(exceptions.Exception):
"""
This exception is raised for all other Epylog conditions.
diff --git a/py/epylog/log.py b/py/epylog/log.py
index d96ddd7..30b2e39 100644
--- a/py/epylog/log.py
+++ b/py/epylog/log.py
@@ -145,18 +145,19 @@ class LogTracker:
logger.put(5, '>LogTracker.get_offset_map')
omap = []
for log in self.logs:
- start_stamp = log.loglist[0].start_stamp
+ entry = log.entry
+ inode = log.getinode()
if log.orange.endix != 0:
offset = 0
else:
offset = log.orange.end_offset
- omap.append([log.entry, start_stamp, offset])
+ omap.append([entry, inode, offset])
logger.put(5, 'omap follows')
logger.put(5, omap)
logger.put(5, '<LogTracker.get_offset_map')
return omap
- def set_start_offset_by_entry(self, entry, inode, start_stamp, offset):
+ def set_start_offset_by_entry(self, entry, inode, offset):
"""
Takes an entry, inode, and suggested offset, and sets the omap
entries accordingly. If the inode doesn't match the one in the
@@ -170,31 +171,16 @@ class LogTracker:
logger.put(5, 'offset=%d' % offset)
if entry in self.entries:
log = self._get_log_by_entry(entry)
- ##
- # Deprecated. Here only for compatibility with 1.0.3. Kill after
- # a bit
- if inode:
- if log.getinode() != inode:
- logger.put(3, 'Inodes do not match. Assuming logrotation')
- try:
- log.set_range_param(1, offset, 0)
- except epylog.OutOfRangeError:
- logger.put(3, 'No rotated file in place. Set offset to 0')
- log.set_range_param(0, 0, 0)
- else:
- logger.put(3, 'Inodes match, setting offset to "%d"' % offset)
- log.set_range_param(0, offset, 0)
- elif start_stamp:
+ if log.getinode() != inode:
+ logger.put(3, 'Inodes do not match. Assuming logrotation')
try:
- (logfile, ix) = log.get_logfile_by_start_stamp(start_stamp)
- logger.put(3, 'Stored offsets belong to %s'
- % logfile.filename)
- log.set_range_param(ix, offset, 0)
-
- except epylog.NoSuchLogError:
- logger.put(3, 'Could not find a matching rotated file.')
- logger.put(3, 'Setting offsets to 0 on the most current')
+ log.set_range_param(1, offset, 0)
+ except epylog.OutOfRangeError:
+ logger.put(3, 'No rotated file in place. Set offset to 0')
log.set_range_param(0, 0, 0)
+ else:
+ logger.put(3, 'Inodes match, setting offset to "%d"' % offset)
+ log.set_range_param(0, offset, 0)
else:
msg = 'No such log entry "%s"' % entry
raise epylog.NoSuchLogError(msg, logger)
@@ -450,19 +436,10 @@ class Log:
self.entry = entry
filename = self._get_filename()
logger.puthang(3, 'Initializing the logfile "%s"' % filename)
- self.loglist = []
- self.cur_rot_ix = 0
- try:
- logfile = LogFile(filename, tmpprefix, monthmap, logger)
- logger.put(3, 'Appending logfile to the loglist')
- self.loglist.append(logfile)
- except epylog.EmptyLogError:
- logger.endhang(3)
- logger.puthang(3, '%s is empty, using the previous rotated log'
- % filename)
- self._init_next_rotfile()
- logfile = self.loglist[0]
+ logfile = LogFile(filename, tmpprefix, monthmap, logger)
logger.endhang(3)
+ logger.put(3, 'Appending logfile to the loglist')
+ self.loglist = [logfile]
self.orange = OffsetRange(0, 0, 0, logfile.end_offset, logger)
logger.endhang(3)
self.lp = None
@@ -511,25 +488,6 @@ class Log:
logger.put(5, 'inode=%d' % inode)
logger.put(5, '<Log.getinode')
return inode
-
- def get_logfile_by_start_stamp(self, start_stamp):
- logger = self.logger
- logger.put(5, '>Log.get_logfile_by_start_stamp')
- ix = 0
- # this loop will either return or exit via a NoSuchLogError
- while 1:
- try:
- logfile = self.loglist[ix]
- except IndexError:
- logfile = self._init_next_rotfile()
-
- logger.put(5, 'Looking at %s' % logfile.filename)
- if logfile.start_stamp == start_stamp:
- logger.put(5, '<Log.get_logfile_by_start_stamp')
- return (logfile, ix)
- ix += 1
-
-
def nextline(self):
"""
@@ -847,24 +805,24 @@ class Log:
"""
logger = self.logger
logger.put(5, '>Log._init_next_rotfile')
- self.cur_rot_ix += 1
- rotname = self._get_rotname_by_ix(self.cur_rot_ix)
+ ix = len(self.loglist)
+ rotname = self._get_rotname_by_ix(ix)
try:
logger.put(3, 'Initializing log for rotated file "%s"' % rotname)
rotlog = LogFile(rotname, self.tmpprefix, self.monthmap, logger)
- self.loglist.append(rotlog)
except epylog.AccessError:
msg = 'No further rotated files for entry "%s"' % self.entry
raise epylog.NoSuchLogError(msg, logger)
- except epylog.EmptyLogError:
- msg = 'Found an empty rotated log, ignoring it.'
- rotlog = self._init_next_rotfile()
+ self.loglist.append(rotlog)
logger.put(5, '<Log._init_next_rotfile')
return rotlog
def _get_rotname_by_ix(self, ix):
"""
- Figure out the rotated file name by index passed.
+ The good thing about rotated files is that they are exactly at the same
+ position in the log list, as the identifier appended to them by
+ logrotate. E.g. messages.1 will be at position 1, messages.2 at
+ position 2, and just messages at position 0.
"""
logger = self.logger
logger.put(5, '>Log._get_rotname_by_ix')
@@ -1342,7 +1300,8 @@ class LogFile:
logger.put(3, 'Making it 0')
stamp = 0
else:
- raise epylog.EmptyLogError('%s is empty' % self.filename, logger)
+ logger.put(5, 'Nothing in the range')
+ stamp = 0
logger.put(5, '<LogFile._get_stamp')
return stamp
diff --git a/py/epylog/module.py b/py/epylog/module.py
index 600c5a1..7eaded2 100644
--- a/py/epylog/module.py
+++ b/py/epylog/module.py
@@ -123,13 +123,6 @@ class Module:
#
logger.put(0, 'Could not init logfile for entry "%s"' % entry)
continue
- except epylog.NoSuchLogError:
- ##
- # Looks like all logfiles for this log entry are empty.
- # Ignore this log entry.
- logger.put(1, ('No logs found for %s, or they are all empty, '+
- 'ignoring.') % entry)
- continue
logger.put(5, 'Appending the log object to self.logs[]')
self.logs.append(log)
if len(self.logs) == 0:
12 years, 5 months
[epylog/stable-1.0.x] Prep for 1.0.6
by Konstantin Ryabitsev
commit 99132ce6e82c0829f513079b4b6cb3026a5ff3e8
Author: Konstantin Ryabitsev <mricon(a)kernel.org>
Date: Wed Jan 25 10:17:50 2012 -0500
Prep for 1.0.6
ChangeLog | 5 +++++
configure.in | 2 +-
py/epylog/__init__.py | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cf6aa75..a855c09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Epylog-1.0.6
+ * Back out the unfinished work to support timestamped rotation
+ (will be implemented fully in 1.1). Fixes the cron-run problem
+ in 1.0.5.
+
Epylog-1.0.5
* Add systemd-logind support
* Add support for GPG encrypting and signing email reports.
diff --git a/configure.in b/configure.in
index 84e1f77..50c5d4b 100644
--- a/configure.in
+++ b/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script
AC_INIT(epylog.spec)
PACKAGE_TARNAME=epylog
-PACKAGE_VERSION=1.0.5
+PACKAGE_VERSION=1.0.6
dnl Package information.
PACKAGE=$PACKAGE_TARNAME
diff --git a/py/epylog/__init__.py b/py/epylog/__init__.py
index 42ccd02..a8cc68c 100644
--- a/py/epylog/__init__.py
+++ b/py/epylog/__init__.py
@@ -47,7 +47,7 @@ from report import Report
from module import Module
from log import LogTracker
-VERSION = 'Epylog-1.0.5'
+VERSION = 'Epylog-1.0.6'
CHUNK_SIZE = 8192
GREP_LINES = 10000
QUEUE_LIMIT = 500
12 years, 5 months
[epylog] Created tag v1.0.6
by Konstantin Ryabitsev
The signed tag 'v1.0.6' was created.
Tagger: Konstantin Ryabitsev <mricon(a)kernel.org>
Date: Wed Jan 25 10:18:18 2012 -0500
Tagging for 1.0.6
Changes since the last tag 'v1.0.5':
Konstantin Ryabitsev (2):
Revert "Committing so I can work on this from elsewhere."
Prep for 1.0.6
12 years, 5 months
[epylog/stable-1.0.x] Revert "Committing so I can work on this from elsewhere."
by Konstantin Ryabitsev
commit a79f5c50b2e863315dc84a746c1bfd87df46b79b
Author: Konstantin Ryabitsev <mricon(a)kernel.org>
Date: Wed Jan 25 10:04:43 2012 -0500
Revert "Committing so I can work on this from elsewhere."
This is unfinished work to support timestamped rotated logs.
It is better left for 1.1.
py/epylog/__init__.py | 9 -----
py/epylog/log.py | 89 +++++++++++++-----------------------------------
py/epylog/module.py | 7 ----
3 files changed, 24 insertions(+), 81 deletions(-)
---
diff --git a/py/epylog/__init__.py b/py/epylog/__init__.py
index ca17c9a..42ccd02 100644
--- a/py/epylog/__init__.py
+++ b/py/epylog/__init__.py
@@ -125,15 +125,6 @@ class NoSuchLogError(exceptions.Exception):
logger.put(5, '!NoSuchLogError: %s' % message)
self.args = message
-class EmptyLogError(exceptions.Exception):
- """
- This exception is raised when Epylog finds an empty logfile.
- """
- def __init__(self, message, logger):
- exceptions.Exception.__init__(self)
- logger.put(5, '!EmptyLogError: %s' % message)
- self.args = message
-
class GenericError(exceptions.Exception):
"""
This exception is raised for all other Epylog conditions.
diff --git a/py/epylog/log.py b/py/epylog/log.py
index d96ddd7..30b2e39 100644
--- a/py/epylog/log.py
+++ b/py/epylog/log.py
@@ -145,18 +145,19 @@ class LogTracker:
logger.put(5, '>LogTracker.get_offset_map')
omap = []
for log in self.logs:
- start_stamp = log.loglist[0].start_stamp
+ entry = log.entry
+ inode = log.getinode()
if log.orange.endix != 0:
offset = 0
else:
offset = log.orange.end_offset
- omap.append([log.entry, start_stamp, offset])
+ omap.append([entry, inode, offset])
logger.put(5, 'omap follows')
logger.put(5, omap)
logger.put(5, '<LogTracker.get_offset_map')
return omap
- def set_start_offset_by_entry(self, entry, inode, start_stamp, offset):
+ def set_start_offset_by_entry(self, entry, inode, offset):
"""
Takes an entry, inode, and suggested offset, and sets the omap
entries accordingly. If the inode doesn't match the one in the
@@ -170,31 +171,16 @@ class LogTracker:
logger.put(5, 'offset=%d' % offset)
if entry in self.entries:
log = self._get_log_by_entry(entry)
- ##
- # Deprecated. Here only for compatibility with 1.0.3. Kill after
- # a bit
- if inode:
- if log.getinode() != inode:
- logger.put(3, 'Inodes do not match. Assuming logrotation')
- try:
- log.set_range_param(1, offset, 0)
- except epylog.OutOfRangeError:
- logger.put(3, 'No rotated file in place. Set offset to 0')
- log.set_range_param(0, 0, 0)
- else:
- logger.put(3, 'Inodes match, setting offset to "%d"' % offset)
- log.set_range_param(0, offset, 0)
- elif start_stamp:
+ if log.getinode() != inode:
+ logger.put(3, 'Inodes do not match. Assuming logrotation')
try:
- (logfile, ix) = log.get_logfile_by_start_stamp(start_stamp)
- logger.put(3, 'Stored offsets belong to %s'
- % logfile.filename)
- log.set_range_param(ix, offset, 0)
-
- except epylog.NoSuchLogError:
- logger.put(3, 'Could not find a matching rotated file.')
- logger.put(3, 'Setting offsets to 0 on the most current')
+ log.set_range_param(1, offset, 0)
+ except epylog.OutOfRangeError:
+ logger.put(3, 'No rotated file in place. Set offset to 0')
log.set_range_param(0, 0, 0)
+ else:
+ logger.put(3, 'Inodes match, setting offset to "%d"' % offset)
+ log.set_range_param(0, offset, 0)
else:
msg = 'No such log entry "%s"' % entry
raise epylog.NoSuchLogError(msg, logger)
@@ -450,19 +436,10 @@ class Log:
self.entry = entry
filename = self._get_filename()
logger.puthang(3, 'Initializing the logfile "%s"' % filename)
- self.loglist = []
- self.cur_rot_ix = 0
- try:
- logfile = LogFile(filename, tmpprefix, monthmap, logger)
- logger.put(3, 'Appending logfile to the loglist')
- self.loglist.append(logfile)
- except epylog.EmptyLogError:
- logger.endhang(3)
- logger.puthang(3, '%s is empty, using the previous rotated log'
- % filename)
- self._init_next_rotfile()
- logfile = self.loglist[0]
+ logfile = LogFile(filename, tmpprefix, monthmap, logger)
logger.endhang(3)
+ logger.put(3, 'Appending logfile to the loglist')
+ self.loglist = [logfile]
self.orange = OffsetRange(0, 0, 0, logfile.end_offset, logger)
logger.endhang(3)
self.lp = None
@@ -511,25 +488,6 @@ class Log:
logger.put(5, 'inode=%d' % inode)
logger.put(5, '<Log.getinode')
return inode
-
- def get_logfile_by_start_stamp(self, start_stamp):
- logger = self.logger
- logger.put(5, '>Log.get_logfile_by_start_stamp')
- ix = 0
- # this loop will either return or exit via a NoSuchLogError
- while 1:
- try:
- logfile = self.loglist[ix]
- except IndexError:
- logfile = self._init_next_rotfile()
-
- logger.put(5, 'Looking at %s' % logfile.filename)
- if logfile.start_stamp == start_stamp:
- logger.put(5, '<Log.get_logfile_by_start_stamp')
- return (logfile, ix)
- ix += 1
-
-
def nextline(self):
"""
@@ -847,24 +805,24 @@ class Log:
"""
logger = self.logger
logger.put(5, '>Log._init_next_rotfile')
- self.cur_rot_ix += 1
- rotname = self._get_rotname_by_ix(self.cur_rot_ix)
+ ix = len(self.loglist)
+ rotname = self._get_rotname_by_ix(ix)
try:
logger.put(3, 'Initializing log for rotated file "%s"' % rotname)
rotlog = LogFile(rotname, self.tmpprefix, self.monthmap, logger)
- self.loglist.append(rotlog)
except epylog.AccessError:
msg = 'No further rotated files for entry "%s"' % self.entry
raise epylog.NoSuchLogError(msg, logger)
- except epylog.EmptyLogError:
- msg = 'Found an empty rotated log, ignoring it.'
- rotlog = self._init_next_rotfile()
+ self.loglist.append(rotlog)
logger.put(5, '<Log._init_next_rotfile')
return rotlog
def _get_rotname_by_ix(self, ix):
"""
- Figure out the rotated file name by index passed.
+ The good thing about rotated files is that they are exactly at the same
+ position in the log list, as the identifier appended to them by
+ logrotate. E.g. messages.1 will be at position 1, messages.2 at
+ position 2, and just messages at position 0.
"""
logger = self.logger
logger.put(5, '>Log._get_rotname_by_ix')
@@ -1342,7 +1300,8 @@ class LogFile:
logger.put(3, 'Making it 0')
stamp = 0
else:
- raise epylog.EmptyLogError('%s is empty' % self.filename, logger)
+ logger.put(5, 'Nothing in the range')
+ stamp = 0
logger.put(5, '<LogFile._get_stamp')
return stamp
diff --git a/py/epylog/module.py b/py/epylog/module.py
index 600c5a1..7eaded2 100644
--- a/py/epylog/module.py
+++ b/py/epylog/module.py
@@ -123,13 +123,6 @@ class Module:
#
logger.put(0, 'Could not init logfile for entry "%s"' % entry)
continue
- except epylog.NoSuchLogError:
- ##
- # Looks like all logfiles for this log entry are empty.
- # Ignore this log entry.
- logger.put(1, ('No logs found for %s, or they are all empty, '+
- 'ignoring.') % entry)
- continue
logger.put(5, 'Appending the log object to self.logs[]')
self.logs.append(log)
if len(self.logs) == 0:
12 years, 5 months
git tree rebuilt and 1.0.5 is out
by Konstantin Ryabitsev
Hi, all:
Two developments in the last couple of days:
Firstly, I re-converted the tree from SVN to git again. Back in 2005 I
was trying to switch epylog to using kid templates and branched the
stable sources into STABLE-1_0 subversion branch. As I didn't complete
the template work, that resulted in subversion trunk being very badly
broken, to the point of not being useful. It's my fault that I didn't
advertise this fact very publicly.
When Seth converted from subversion to git, he didn't import the
STABLE-1_0 branch, so the git tree didn't have the actually working code
any more. :) Thankfully, he still had the subversion tree stashed away,
so after some git wrangling I was able to re-convert the project and
push it back to the git repository (spamming the world in the process,
sorry!).
You can browse the git tree here:
http://git.fedorahosted.org/git/?p=epylog.git
So, as things are right now:
origin/master
former STABLE-1_0 branch with everyone's post-2005 work re-applied
(for the most part, I omitted a few inconsequential things that
didn't cleanly apply)
origin/stable-1.0.x
former STABLE-1_0 branch
origin/old-svn-trunk
former very broken SVN trunk. Nobody should want this.
I released 1.0.5 today, only adding two features:
* Add systemd-logind to logins module, so Fedora 16 and all other things
using systemd can report logins accurately.
* Add gpg encryption of email reports. Signing also works, though there
appear to be a few kinks, as evolution pretends that it's not a valid
format (thunderbird and mutt have no problem, on the other hand). I will
note that gpg-signing is added for completeness and requires personal
paranoia level set firmly on 11.
You can grab the release here:
https://fedorahosted.org/epylog/
I will also be pushing it to all things Fedora/EPEL in the near future.
Finally, I will be going through the things in master shortly and will
release epylog-1.1 in the near future, which will be the new devel series.
Best,
--
Konstantin Ryabitsev
LinuxFoundation.org
Montréal, Québec
12 years, 5 months
[epylog] Created tag v1.0.5
by Konstantin Ryabitsev
The signed tag 'v1.0.5' was created.
Tagger: Konstantin Ryabitsev <mricon(a)kernel.org>
Date: Tue Jan 24 14:22:40 2012 -0500
Tagging for 1.0.5
Changes:
Konstantin Ryabitsev (283):
New repository initialized by cvs2svn.
Initial revision
Support for -c option
Setting proper defaults
Prepping for a trial RPM release
Bugfixes in set_at_line_start routines.
Eh, stupid shite.
Stupid python2.2
What the hell is code 256?
Another releaselet
Prepping for 0.8
Silly error caught. offset undefined in some circumstances.
Do not try to go back past the start of the file.
Fixing the zero-log bugs.
Blah
upping ver
NoneType fixes.
Upping rel
Stupidity with fgrep -q. :/
Upping ver, plus small fixes.
New firewall module.
DULog->epylog
Big logfile handler rewrite.
Wow, this works!
Prepping for 0.8.5
Small changes and a useful usage()
Blessing for 0.8.5-1
I'm a doofus.
I'm a doofus
Blessing for 0.8.5
Memory-related optimizations small bugfixes in get_html_report
Blessing for 0.8.7
Small addition to the changelog.
Back to elinks, as w3m depends on gtk+
Fix for out-of-order timestamps.
A tidier implementation
Typo.
Upping version
Fixes for fine_locate routines.
Ported some modules.
Log rotation entries can be now specified as a full path.
Stupid bug with log lengths.
Unparsed strings is undefined in some cases.
Upping the version
Upping the version for 0.8.12
Added a few features: - Can now set priorities for modules - Can now add extra configs for modules in [conf] section.
Added changelog
Fixes for mail publisher.
Added internal module support.
New internal module API (incomplete)
Day's work.
Working internal module API.
Bugfixes
Sane threading now in works.
Finished logins module. Fixes to internal module handling routines.
Introducing notices, which takes over annoyances and reboots. Deleting old modules, the ones ported to python.
Many useful changes: - Module testing streamlined - Threads now die sanely instead of just hanging there - Changes to modules.
Moving some files around.
Intermittent commit
Adding mail module and weeder module (rewrites in python)
Testcase for mail module.
Fixes in the mail module.
Happy day, happy-happy day.
Adding ipchains support.
Ipfilter support working. Removing firewalls.mod.pl
Mostly fixes and cleanups.
Neat features added. Optimizations.
Updated manpage.
Screw this, I'm sleepy.
Whole lots of changes.
blah
Small fixes around.
Updated AUTHORS.
Updated ChangeLog.
Updated README
Updated roadmap.
Aaaah. My hands hurt.
Updated epylog-modules.5
Initial commit.
Small changes.
Added multimatch and threads parts.
Added license info.
it's 2003.
Added license and copyright info.
Added copyright and licensing info.
Added licensing and copyright info.
Adding explanation for config values.
Updated spec file.
Stop being stupid, icon.
Cleaning up.
Better mask vals.
Added gconf.
Go ahead. Make my day.
Added a ref note.
Backing up to 0.5 for more testing.
Correct handling of invalid strings.
Duh.
Upping ver.
Let's leave them on by default.
Upping ver.
Fixes to ipchains handling.
Moving mailer routines outside of main code.
Added notification support for file publisher.
Anacron is annoying.
Hunting a bug.
Fixing rotation bug.
Same bug, different day.
Blessing for -1.
Adding more floppy bullshit.
Fixes after running pychecker.
Changes for 0.9.1
Version change.
PCI Errors suck
insmod_errors support.
Reworked to support notice_dist.xml and notice_local.xml
Added support for 'ALL'
Changes to the way notices module operates. Added notice_dist.xml. Changes to weeder.conf and notices.conf
The matching regex now returned as part of the linemap.
Recording changes for 0.9.2
Updates for version 0.9.2
Upping version.
Duh.
Trying %ghost.
Keep trying.
Finalizing %ghost
Adding notice_local.xml so it doesn't require special handling.
Removing %ghost. Dumb idea.
Beginnings of an installer.
Fixes.
Moving some files around.
Big move to autoconf.
Docs need to be moved.
damn pyos.
damn pyos
--exec vs -exec
Better tis way.
site-perl vs site_perl
Defs.
More defs.
remove docs.
Fixed up to work on odd shells.
Updated INSTALL instructions.
Adding an sshd rule.
Almost there.
Does it work?
This seems to work.
Upping release for testing.
Remove print statements.
Adding qmail rules.
another test.
Bounces.
ANother rel update.
Enable_qmail
Blessing for -1.
Split perl module into a separate package.
Blessing for 0.9.3
Forgot version upping.
Boo. Silly bug.
Upping version to CVS.
Working around bug #38.
Woopsie.
More correct this way.
A better solution for bug #38.
Check if the log has an empty range before actually fetching lines from it.
New bug with rotated files, though. :/
Fix for bug #38.
This line shouldn't be here.
Bah. Stop leaving garbage all over the place, icon!
Enhancements.
Normalizing logger calls.
Prepping for 0.9.4
upping the version.
Upping the version.
Blessing for -1.
Fix for http://devel.linux.duke.edu/bugzilla/show_bug.cgi?id=57
Preparing for 0.9.5
recording changes.
Version commit.
Commit for version 0.9.5
Woopsie.
Releasing 0.9.5
Grrr.
Something I've forgotten to change after I've optimized get_line_at_offset.
Attempted switch over to libxml2.
Woops.
Check for libxml2.
Show what we're doing.
Break the line.
Better yet.
My god, what have I done.
Upping version.
Stupid libxml2 on 7.3 is not indentation-consistent. ARGH!
Upping release. Stupid libxml2.
Adding pam_krb5 handling.
Noting the changes.
pam_krb5 handling and testcases.
Let's throw in krb5afs while we're at it.
Throwing in krb5afs for good measure.
Added dovecot and courier-imap handlers.
Upping version.
Final commits for tonight.
Stupid ipv6.
Duh.
Last one. I swear.
Better handling of tempfile for python-2.3
Updating version info.
Let's release it.
Did I forget to commit this?
Accepted Makefile patches from Will Newton.
Hmm... I need to remember to update these!
Version vixes and a few patches (Makefile patch, and #135).
Fix for #146 -- lynx not so worky without .html
Fix for #136 -- accepted a patch from Josko Plazonic.
Attempted fix for #134
Upping version for testing.
Backing out poor solution for #134.
Fix for #204.
Adding preliminary support for handling special modules. Migrating data from weed and notices config files to the modules themselves.
Fix for #210 and a small debugging addition.
Backing out a bunch of changes to branch for STABLE-1_0 and HEAD.
This commit was manufactured by cvs2svn to create branch 'STABLE-1_0'.
Fix for #148.
Loggind changed info.
Prepping for 0.9.7 trial release run. Riabitsev->Ryabitsev, icon@phy->icon@linux.
typo.
Testing.
Backing out the erroneous broken fix for #134 that got in when I was splitting the branches.
Testing.
Marking 1h, 2h, 3w, etc.
More edits.
use --cron in example.
Allow for building versions for python-2.2 and python-2.3.
It doesn't like dashes. :)
Blessing it.
Putting back in the hostbased handling that got lost when branching.
Preparing for 1.0
Oopsie-daisy.
Apparently try: if on one line is not happy. :)
Rudimentary SELinux handling.
And remove, since it's too noisy.
Attempting to extend sorting in packets_mod.
Oopsie-daisy.
It's system, not dest.
Sort ports a little more intelligently.
Smarter, better, faster!
Bugfixes.
Much better handling.
Fool-proof it a little.
Add change about packets module.
Prep for 1.0 release.
Errors reported by Bennett.
Use automatic _pyver determination to make rebuilds simpler.
Docs will be gzipped automatically.
Some more cosmetic changes.
Removing trojan-list handling routines, as it's a dumb feature.
Removing trojan.list functionality, since it's useless anyway.
On the second thought, I'll put it back in. It *can* be useful.
Prepping for 1.0.1
Foo.
A few uncommitted fixes.
Collapses for logins, and fix for monthmap on python-2.4
Prepping for 1.0.2
Preparing for 1.0.3 and Fedora Extras.
Woops.
Accommodate perl_vendorlib
python_sitelib
That was a nice bug. ;)
Adding a few rules.
Some more rules.
Some more default setting tweaks.
Really prepping for 1.0.3
Bleh
Modify version.
Fix for #4 -- be less restrictive about syslog format.
Add an option to not save raw logs with file publisher. Turn off by default, too. (implements #2)
Committing so I can work on this from elsewhere.
1. Rework publishers.py to not use deprecated MimeWriter (rhbz #550802) 2. Set keywords to ignore the files needing to be ignored. 3. Rename the attachment raw.log.gz and mark it as application/x-gzip
Add .gitignore
Add systemd-logind support to logins.
Add gpg-encryption feature for mail publisher.
Add support for gpg-signing the email.
Fix systemd-logind -- different from master.
Prepare for 1.0.5.
12 years, 5 months
[epylog/stable-1.0.x] Prepare for 1.0.5.
by Konstantin Ryabitsev
commit 6785401e70d035f02f3c99034247de100e892919
Author: Konstantin Ryabitsev <mricon(a)kernel.org>
Date: Tue Jan 24 14:19:43 2012 -0500
Prepare for 1.0.5.
ChangeLog | 4 ++++
configure.in | 2 +-
py/epylog/__init__.py | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9e0b3c7..cf6aa75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Epylog-1.0.5
+ * Add systemd-logind support
+ * Add support for GPG encrypting and signing email reports.
+
Epylog-1.0.4
* Be more lenient about syslog format (FC7 changes) (ticket #4)
* Add a "save_rawlogs" option to file publisher, and don't save them
diff --git a/configure.in b/configure.in
index 2a4dfd3..84e1f77 100644
--- a/configure.in
+++ b/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script
AC_INIT(epylog.spec)
PACKAGE_TARNAME=epylog
-PACKAGE_VERSION=1.0.3
+PACKAGE_VERSION=1.0.5
dnl Package information.
PACKAGE=$PACKAGE_TARNAME
diff --git a/py/epylog/__init__.py b/py/epylog/__init__.py
index f42b799..ca17c9a 100644
--- a/py/epylog/__init__.py
+++ b/py/epylog/__init__.py
@@ -47,7 +47,7 @@ from report import Report
from module import Module
from log import LogTracker
-VERSION = 'Epylog-1.0.3'
+VERSION = 'Epylog-1.0.5'
CHUNK_SIZE = 8192
GREP_LINES = 10000
QUEUE_LIMIT = 500
12 years, 5 months
[epylog/stable-1.0.x] Fix systemd-logind -- different from master.
by Konstantin Ryabitsev
commit cb407901eb561e9b7862fbed4fe4b8cdf1c675b5
Author: Konstantin Ryabitsev <mricon(a)kernel.org>
Date: Tue Jan 24 14:18:28 2012 -0500
Fix systemd-logind -- different from master.
modules/logins_mod.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/modules/logins_mod.py b/modules/logins_mod.py
index 695c267..15d4264 100644
--- a/modules/logins_mod.py
+++ b/modules/logins_mod.py
@@ -469,7 +469,7 @@ class logins_mod(InternalModule):
return None
service = 'systemd-logind'
user = mo.group(1)
- restuple = self._mk_restuple(action, system, service, user, '', '', linemap['stamp'])
+ restuple = self._mk_restuple(action, system, service, user, '', 'localhost')
return {restuple: mult}
def courier_open(self, linemap):
12 years, 5 months
[epylog/stable-1.0.x] Add support for gpg-signing the email.
by Konstantin Ryabitsev
commit f9b47cede9d4e33156ca68856c96b39ef0a9472e
Author: Konstantin Ryabitsev <mricon(a)kernel.org>
Date: Tue Jan 24 14:03:57 2012 -0500
Add support for gpg-signing the email.
Caveats:
1. Signed+encrypted emails seem to break evolution
2. Must specify signer, because gpgme seems to think
that all keys are capable of can_sign.
etc/epylog.conf.in | 9 ++++--
man/epylog.conf.5 | 34 +++++++++++++++++++--------
py/epylog/publishers.py | 59 +++++++++++++++++++++++++++++++++++------------
3 files changed, 74 insertions(+), 28 deletions(-)
---
diff --git a/etc/epylog.conf.in b/etc/epylog.conf.in
index 323737d..0495214 100644
--- a/etc/epylog.conf.in
+++ b/etc/epylog.conf.in
@@ -24,12 +24,15 @@ rawlogs_limit = 200
# GPG encryption requires pygpgme installed
#
gpg_encrypt = no
-# If gpg_keyring is omitted, we'll use the default ~/.gnupg for the
+# If gpg_keyringdir is omitted, we'll use the default ~/.gnupg for the
# user running epylog (/root/.gnupg, usually).
-#gpg_keyring = %%pkgconfdir%%/pubring.gpg
+#gpg_keyringdir = %%pkgconfdir%%/gpg/
# List key ids, can be emails or fingerprints. If omitted, we'll
-# encrypt to all keys found in the keyring.
+# encrypt to all keys found in the pubring.
#gpg_recipients = admin1(a)example.com, admin2(a)example.com
+# List key ids that we should use to sign the report.
+# If omitted, the report will not be signed, only encrypted.
+#gpg_signers = epylog(a)logserv.example.com
[file]
method = file
diff --git a/man/epylog.conf.5 b/man/epylog.conf.5
index 9582481..5ab6d07 100644
--- a/man/epylog.conf.5
+++ b/man/epylog.conf.5
@@ -118,20 +118,34 @@ designated administrators. Set to "yes" to enable gpg-encryption of the
mail report. You will need to install mygpgme (installed by default on
all yum-managed systems).
.TP
-.B gpg_keyring
-This is the gpg keyring containing the public keys of recipients. You can
-generate it using the following command:
+.B gpg_keyringdir
+If you don't want to use the default keyring (usually /root/.gnupg), you
+can set up a separate keyring directory for epylog's use. E.g.:
.br
-> gpg --no-default-keyring --keyring=./epylog.gpg --search KEYID
-.br
-This will query the keyserver and display all matching keys, which you can
-then import into epylog's pubring. You can repeat this operation multiple
-times if you need to encrypt to several recipients.
+> mkdir -m 0700 /etc/epylog/gpg
.TP
.B gpg_recipients
List of PGP key id's to use when encrypting the report. The keys must be in
-the keyring specified in gpg_keyring. If this option is omitted, epylog will
-encrypt to all keys found in the keyring.
+the pubring specified in gpg_keyringdir. If this option is omitted, epylog
+will encrypt to all keys found in the pubring. To add a public key to a
+keyring, you can use the following command.
+.br
+> gpg [--homedir=/etc/epylog/gpg] --import pubkey.gpg
+.br
+You can generate the pubkey.gpg file by running "gpg --export KEYID" on your
+workstation, or you can use "gpg --search" to import the public keys from
+the keyserver.
+.TP
+.B gpg_signers
+To use the signing option, you will first need to generate a private key:
+.br
+> gpg [--homedir=/etc/epylog/gpg] --gen-key
+.br
+Create a \fBsign-only RSA key\fR and leave the passphrase empty. You can then
+use "gpg --export" to export the key you have generated and import it on the
+workstation where you read mail.
+.br
+If gpg_signers is not set, the report will not be signed.
.SH "File Publisher"
.TP
diff --git a/py/epylog/publishers.py b/py/epylog/publishers.py
index 4ae4d53..a0ed333 100644
--- a/py/epylog/publishers.py
+++ b/py/epylog/publishers.py
@@ -207,26 +207,33 @@ class MailPublisher:
self.gpg_encrypt = config.getboolean(self.section, 'gpg_encrypt')
try:
- # Copy the keyring specified into tmpprefix
- gpg_keyring = config.get(self.section, 'gpg_keyring')
- logger.put(5, 'Copying %s into %s' % (gpg_keyring, self.tmpprefix))
- shutil.copyfile(gpg_keyring, os.path.join(self.tmpprefix, 'pubring.gpg'))
- self.gpg_keyringdir = self.tmpprefix
+ self.gpg_keyringdir = config.get(self.section, 'gpg_keyringdir')
except:
self.gpg_keyringdir = None
try:
gpg_recipients = config.get(self.section, 'gpg_recipients')
- addrs = gpg_recipients.split(',')
+ keyids = gpg_recipients.split(',')
self.gpg_recipients = []
- for addr in addrs:
- addr = addr.strip()
- logger.put(5, 'adding gpg_recipient=%s' % addr)
- self.gpg_recipients.append(addr)
+ for keyid in keyids:
+ keyid = keyid.strip()
+ logger.put(5, 'adding gpg_recipient=%s' % keyid)
+ self.gpg_recipients.append(keyid)
except:
# Will use all recipients found in the keyring
self.gpg_recipients = None
+ try:
+ gpg_signers = config.get(self.section, 'gpg_signers')
+ keyids = gpg_signers.split(',')
+ self.gpg_signers = []
+ for keyid in keyids:
+ keyid = keyid.strip()
+ logger.put(5, 'adding gpg_signer=%s' % keyid)
+ self.gpg_signers.append(keyid)
+ except:
+ self.gpg_signers = None
+
except:
self.gpg_encrypt = 0
@@ -351,24 +358,43 @@ class MailPublisher:
ctx.armor = True
recipients = []
+ signers = []
logger.put(5, 'self.gpg_recipients = %s' % self.gpg_recipients)
+ logger.put(5, 'self.gpg_signers = %s' % self.gpg_signers)
if self.gpg_recipients is not None:
for recipient in self.gpg_recipients:
- logger.puthang(5, 'Looking for a key for %s' % recipient)
+ logger.puthang(5, 'Looking for an encryption key for %s' % recipient)
recipients.append(ctx.get_key(recipient))
logger.endhang(5)
else:
- logger.put(5, 'Looking for all keys in the keyring')
for key in ctx.keylist():
for subkey in key.subkeys:
if subkey.can_encrypt:
- logger.put(5, 'Found key=%s' % subkey.keyid)
+ logger.put(5, 'Found can_encrypt key=%s' % subkey.keyid)
recipients.append(key)
break
- ctx.encrypt(recipients, gpgme.ENCRYPT_ALWAYS_TRUST,
- cleartext, ciphertext)
+ if self.gpg_signers is not None:
+ for signer in self.gpg_signers:
+ logger.puthang(5, 'Looking for a signing key for %s' % signer)
+ signers.append(ctx.get_key(signer))
+ logger.endhang(5)
+
+ if len(signers) > 0:
+ logger.puthang(3, 'Encrypting and signing the report')
+ ctx.signers = signers
+ ctx.encrypt_sign(recipients, gpgme.ENCRYPT_ALWAYS_TRUST,
+ cleartext, ciphertext)
+ logger.endhang(3)
+
+ else:
+ logger.puthang(3, 'Encrypting the report')
+ ctx.encrypt(recipients, gpgme.ENCRYPT_ALWAYS_TRUST,
+ cleartext, ciphertext)
+ logger.endhang(3)
+
+ logger.puthang(5, 'Creating the MIME envelope for PGP')
gpg_envelope_part = MIMEMultipart('encrypted')
gpg_envelope_part.set_param('protocol', 'application/pgp-encrypted',
@@ -391,8 +417,11 @@ class MailPublisher:
gpg_envelope_part.attach(gpg_mime_version_part)
gpg_envelope_part.attach(gpg_payload_part)
+ # envelope becomes the new root part
root_part = gpg_envelope_part
+ logger.endhang(5)
+
except ImportError:
logger.endhang(3)
logger.put(0, 'Install pygpgme for GPG encryption support.')
12 years, 5 months