GNU bug report logs -
#57575
[PATCH] gnu: fail2ban-service-type: Improve extra-content fields.
Previous Next
Reported by: muradm <mail <at> muradm.net>
Date: Sun, 4 Sep 2022 11:25:02 UTC
Severity: normal
Tags: patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57575 in the body.
You can then email your comments to 57575 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#57575
; Package
guix-patches
.
(Sun, 04 Sep 2022 11:25:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
muradm <mail <at> muradm.net>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Sun, 04 Sep 2022 11:25:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* gnu/services/security.scm:
(fail2ban-jail-configuration)[extra-content]: Change to text-config.
(fail2ban-configuration)[extra-content]: Change to text-config.
* gnu/doc/guix.texi: Update type of extra-content fields.
---
doc/guix.texi | 4 ++--
gnu/services/security.scm | 15 ++++-----------
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 80ca017599..b0a309efc2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -36619,7 +36619,7 @@ extensions.
@item @code{extra-jails} (default: @code{()}) (type: list-of-fail2ban-jail-configurations)
Instances of @code{<fail2ban-jail-configuration>} explicitly provided.
-@item @code{extra-content} (type: maybe-string)
+@item @code{extra-content} (default: @code{()}) (type: text-config)
Extra raw content to add to the end of the @file{jail.local} file.
@end table
@@ -36747,7 +36747,7 @@ The file names of the log files to be monitored.
@item @code{action} (default: @code{()}) (type: list-of-fail2ban-jail-actions)
A list of @code{<fail2ban-jail-action-configuration>}.
-@item @code{extra-content} (type: maybe-string)
+@item @code{extra-content} (default: @code{()}) (type: text-config)
Extra content for the jail configuration.
@end table
diff --git a/gnu/services/security.scm b/gnu/services/security.scm
index fd5bf19730..e6b59442ca 100644
--- a/gnu/services/security.scm
+++ b/gnu/services/security.scm
@@ -179,11 +179,6 @@ (define (fail2ban-jail-configuration-serialize-list-of-fail2ban-jail-actions fie
(define (fail2ban-jail-configuration-serialize-symbol field-name value)
(fail2ban-jail-configuration-serialize-string field-name (symbol->string value)))
-(define (fail2ban-jail-configuration-serialize-extra-content field-name value)
- (if (maybe-value-set? value)
- (string-append "\n" value "\n")
- ""))
-
(define-maybe integer (prefix fail2ban-jail-configuration-))
(define-maybe string (prefix fail2ban-jail-configuration-))
(define-maybe boolean (prefix fail2ban-jail-configuration-))
@@ -281,9 +276,9 @@ (define-configuration fail2ban-jail-configuration
(list-of-fail2ban-jail-actions '())
"A list of @code{<fail2ban-jail-action-configuration>}.")
(extra-content
- maybe-string
+ (text-config '())
"Extra content for the jail configuration."
- fail2ban-jail-configuration-serialize-extra-content)
+ serialize-text-config)
(prefix fail2ban-jail-configuration-))
(define list-of-fail2ban-jail-configurations?
@@ -312,7 +307,7 @@ (define-configuration/no-serialization fail2ban-configuration
(list-of-fail2ban-jail-configurations '())
"Instances of @code{<fail2ban-jail-configuration>} explicitly provided.")
(extra-content
- maybe-string
+ (text-config '())
"Extra raw content to add to the end of the @file{jail.local} file."))
(define (serialize-fail2ban-configuration config)
@@ -322,9 +317,7 @@ (define (serialize-fail2ban-configuration config)
(interpose
(append (map serialize-fail2ban-jail-configuration
(append jails extra-jails))
- (list (if (maybe-value-set? extra-content)
- extra-content
- ""))))))
+ (list (serialize-text-config 'extra-content extra-content))))))
(define (config->fail2ban-etc-directory config)
(let* ((fail2ban (fail2ban-configuration-fail2ban config))
--
2.37.2
Reply sent
to
Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:
You have taken responsibility.
(Wed, 14 Sep 2022 15:33:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
muradm <mail <at> muradm.net>
:
bug acknowledged by developer.
(Wed, 14 Sep 2022 15:33:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 57575-done <at> debbugs.gnu.org (full text, mbox):
Hi muradm!
muradm <mail <at> muradm.net> writes:
> * gnu/services/security.scm:
Nitpick: you do not need ':' after file name before the procedure in
parens.
I did the following adjustments to the doc, to clarify:
--8<---------------cut here---------------start------------->8---
2 files changed, 10 insertions(+), 6 deletions(-)
doc/guix.texi | 6 ++++--
gnu/services/security.scm | 10 ++++++----
modified doc/guix.texi
@@ -36629,7 +36629,8 @@ extensions.
Instances of @code{<fail2ban-jail-configuration>} explicitly provided.
@item @code{extra-content} (default: @code{()}) (type: text-config)
-Extra raw content to add to the end of the @file{jail.local} file.
+Extra raw content to add to the end of the @file{jail.local} file,
+provided as a list of file-like objects.
@end table
@@ -36757,7 +36758,8 @@ The file names of the log files to be monitored.
A list of @code{<fail2ban-jail-action-configuration>}.
@item @code{extra-content} (default: @code{()}) (type: text-config)
-Extra content for the jail configuration.
+Extra content for the jail configuration, provided as a list of file-like
+objects.
@end table
modified gnu/services/security.scm
@@ -199,7 +199,7 @@ (define-configuration fail2ban-jail-configuration
"Backend to use to detect changes in the @code{log-path}. The default is
'auto. To consult the defaults of the jail configuration, refer to the
@file{/etc/fail2ban/jail.conf} file of the @code{fail2ban} package."
-fail2ban-jail-configuration-serialize-backend)
+ fail2ban-jail-configuration-serialize-backend)
(max-retry
maybe-integer
"The number of failures before a host get banned
@@ -268,7 +268,7 @@ (define-configuration fail2ban-jail-configuration
maybe-symbol
"The encoding of the log files handled by the jail.
Possible values are: @code{'ascii}, @code{'utf-8} and @code{'auto}."
-fail2ban-jail-configuration-serialize-log-encoding)
+ fail2ban-jail-configuration-serialize-log-encoding)
(log-path
(list-of-strings '())
"The file names of the log files to be monitored.")
@@ -277,7 +277,8 @@ (define-configuration fail2ban-jail-configuration
"A list of @code{<fail2ban-jail-action-configuration>}.")
(extra-content
(text-config '())
- "Extra content for the jail configuration."
+ "Extra content for the jail configuration, provided as a list of file-like
+objects."
serialize-text-config)
(prefix fail2ban-jail-configuration-))
@@ -308,7 +309,8 @@ (define-configuration/no-serialization fail2ban-configuration
"Instances of @code{<fail2ban-jail-configuration>} explicitly provided.")
(extra-content
(text-config '())
- "Extra raw content to add to the end of the @file{jail.local} file."))
+ "Extra raw content to add to the end of the @file{jail.local} file,
+provided as a list of file-like objects."))
(define (serialize-fail2ban-configuration config)
(let* ((jails (fail2ban-configuration-jails config))
--8<---------------cut here---------------end--------------->8---
Ran the fail2ban system tests, and pushed!
Thank you.
Closing.
Maxim
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 13 Oct 2022 11:24:13 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 192 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.