f7c668
From 77fae8c48bbe0f4499f4d8ed91b268568c64cd7c Mon Sep 17 00:00:00 2001
f7c668
From: Christian Heimes <cheimes@redhat.com>
f7c668
Date: Thu, 11 Jun 2020 11:17:25 +0200
f7c668
Subject: [PATCH] Move ipa-epn systemd files and run RPM hooks
f7c668
f7c668
The init/systemd directory is for server only and not part of
f7c668
CLIENT_ONLY builds.
f7c668
f7c668
It's necesary to run pre/post installation hooks to make systemd aware
f7c668
of new files.
f7c668
f7c668
Fixes: https://pagure.io/freeipa/issue/8367
f7c668
Signed-off-by: Christian Heimes <cheimes@redhat.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
Reviewed-By: Francois Cami <fcami@redhat.com>
f7c668
---
f7c668
 .gitignore                                    |  4 +--
f7c668
 client/Makefile.am                            |  1 +
f7c668
 client/share/Makefile.am                      |  5 ++++
f7c668
 {install => client}/share/expire_msg.template |  0
f7c668
 client/systemd/Makefile.am                    | 27 +++++++++++++++++++
f7c668
 {init => client}/systemd/ipa-epn.service.in   |  0
f7c668
 {init => client}/systemd/ipa-epn.timer.in     |  0
f7c668
 configure.ac                                  | 24 +++++++++++++++--
f7c668
 freeipa.spec.in                               | 15 +++++++++++
f7c668
 init/systemd/Makefile.am                      |  8 +++---
f7c668
 install/share/Makefile.am                     |  5 ----
f7c668
 server.m4                                     | 19 -------------
f7c668
 12 files changed, 76 insertions(+), 32 deletions(-)
f7c668
 rename {install => client}/share/expire_msg.template (100%)
f7c668
 create mode 100644 client/systemd/Makefile.am
f7c668
 rename {init => client}/systemd/ipa-epn.service.in (100%)
f7c668
 rename {init => client}/systemd/ipa-epn.timer.in (100%)
f7c668
f7c668
#diff --git a/.gitignore b/.gitignore
f7c668
#index 6584c3b4f..4cedb1ff2 100644
f7c668
#--- a/.gitignore
f7c668
#+++ b/.gitignore
f7c668
#@@ -94,8 +94,6 @@ freeipa2-dev-doc
f7c668
# /init/ipa_memcached
f7c668
# /init/systemd/ipa-custodia.service
f7c668
# /init/systemd/ipa.service
f7c668
#-/init/systemd/ipa-epn.service
f7c668
#-/init/systemd/ipa-epn.timer
f7c668
# /init/tmpfilesd/ipa.conf
f7c668
# 
f7c668
# !/install/ui/doc/Makefile.in
f7c668
#@@ -116,6 +114,8 @@ freeipa2-dev-doc
f7c668
# /client/ipa-getkeytab
f7c668
# /client/ipa-join
f7c668
# /client/ipa-rmkeytab
f7c668
#+/client/systemd/ipa-epn.service
f7c668
#+/client/systemd/ipa-epn.timer
f7c668
# 
f7c668
# /ipaplatform/override.py
f7c668
# /ipapython/version.py
f7c668
diff --git a/client/Makefile.am b/client/Makefile.am
f7c668
index 858a9369e..87da87fcd 100644
f7c668
--- a/client/Makefile.am
f7c668
+++ b/client/Makefile.am
f7c668
@@ -95,6 +95,7 @@ SUBDIRS =			\
f7c668
 	share		        \
f7c668
 	man			\
f7c668
 	sysconfig	        \
f7c668
+	systemd			\
f7c668
 	$(NULL)
f7c668
 #       init                    
f7c668
 
f7c668
diff --git a/client/share/Makefile.am b/client/share/Makefile.am
f7c668
index 6d4a62d5e..1402a3a9d 100644
f7c668
--- a/client/share/Makefile.am
f7c668
+++ b/client/share/Makefile.am
f7c668
@@ -4,3 +4,8 @@ appdir = $(IPA_DATA_DIR)/client
f7c668
 dist_app_DATA =				\
f7c668
 	freeipa.template		\
f7c668
 	$(NULL)
f7c668
+
f7c668
+epnconfdir = $(IPA_SYSCONF_DIR)/epn
f7c668
+dist_epnconf_DATA =			\
f7c668
+	expire_msg.template	\
f7c668
+	$(NULL)
f7c668
diff --git a/install/share/expire_msg.template b/client/share/expire_msg.template
f7c668
similarity index 100%
f7c668
rename from install/share/expire_msg.template
f7c668
rename to client/share/expire_msg.template
f7c668
diff --git a/client/systemd/Makefile.am b/client/systemd/Makefile.am
f7c668
new file mode 100644
f7c668
index 000000000..1f591be83
f7c668
--- /dev/null
f7c668
+++ b/client/systemd/Makefile.am
f7c668
@@ -0,0 +1,27 @@
f7c668
+# This file will be processed with automake-1.7 to create Makefile.in
f7c668
+#
f7c668
+AUTOMAKE_OPTIONS = 1.7
f7c668
+
f7c668
+NULL =
f7c668
+
f7c668
+dist_noinst_DATA = 			\
f7c668
+	ipa-epn.service.in		\
f7c668
+	ipa-epn.timer.in		\
f7c668
+	$(NULL)
f7c668
+
f7c668
+systemdsystemunit_DATA = 	\
f7c668
+	ipa-epn.service			\
f7c668
+	ipa-epn.timer		\
f7c668
+	$(NULL)
f7c668
+
f7c668
+CLEANFILES = $(systemdsystemunit_DATA)
f7c668
+
f7c668
+%: %.in Makefile
f7c668
+	sed \
f7c668
+		-e 's|@bindir[@]|$(bindir)|g' \
f7c668
+		-e 's|@IPA_SYSCONF_DIR[@]|$(IPA_SYSCONF_DIR)|g' \
f7c668
+		-e 's|@localstatedir[@]|$(localstatedir)|g' \
f7c668
+		-e 's|@sbindir[@]|$(sbindir)|g' \
f7c668
+		-e 's|@libexecdir[@]|$(libexecdir)|g' \
f7c668
+		-e 's|@sysconfenvdir[@]|$(sysconfenvdir)|g' \
f7c668
+		'$(srcdir)/$@.in' >$@
f7c668
diff --git a/init/systemd/ipa-epn.service.in b/client/systemd/ipa-epn.service.in
f7c668
similarity index 100%
f7c668
rename from init/systemd/ipa-epn.service.in
f7c668
rename to client/systemd/ipa-epn.service.in
f7c668
diff --git a/init/systemd/ipa-epn.timer.in b/client/systemd/ipa-epn.timer.in
f7c668
similarity index 100%
f7c668
rename from init/systemd/ipa-epn.timer.in
f7c668
rename to client/systemd/ipa-epn.timer.in
f7c668
diff --git a/configure.ac b/configure.ac
f7c668
index 5ec529088..586b2532a 100644
f7c668
--- a/configure.ac
f7c668
+++ b/configure.ac
f7c668
@@ -220,6 +220,25 @@ AC_ARG_WITH([runstatedir],
f7c668
             [runstatedir="/run"])
f7c668
 AC_SUBST([runstatedir])
f7c668
 
f7c668
+dnl ---------------------------------------------------------------------------
f7c668
+dnl - Check for systemd directories
f7c668
+dnl ---------------------------------------------------------------------------
f7c668
+
f7c668
+PKG_CHECK_EXISTS([systemd], [], [AC_MSG_ERROR([systemd not found])])
f7c668
+AC_ARG_WITH([systemdsystemunitdir],
f7c668
+            AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
f7c668
+               [Directory for systemd service files]),
f7c668
+            [systemdsystemunitdir=$with_systemdsystemunitdir],
f7c668
+        [systemdsystemunitdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=systemdsystemunitdir systemd)])
f7c668
+AC_SUBST([systemdsystemunitdir])
f7c668
+
f7c668
+AC_ARG_WITH([systemdtmpfilesdir],
f7c668
+            AS_HELP_STRING([--with-systemdtmpfilesdir=DIR],
f7c668
+               [Directory for systemd-tmpfiles configuration files]),
f7c668
+            [systemdtmpfilesdir=$with_systemdtmpfilesdir],
f7c668
+        [systemdtmpfilesdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=tmpfilesdir systemd)])
f7c668
+AC_SUBST([systemdtmpfilesdir])
f7c668
+
f7c668
 dnl ---------------------------------------------------------------------------
f7c668
 dnl - Server-only configuration
f7c668
 dnl ---------------------------------------------------------------------------
f7c668
@@ -544,6 +563,7 @@ AC_CONFIG_FILES([
f7c668
     client/share/Makefile
f7c668
     client/man/Makefile
f7c668
     client/sysconfig/Makefile
f7c668
+    client/systemd/Makefile
f7c668
     contrib/completion/Makefile
f7c668
     contrib/Makefile
f7c668
     daemons/dnssec/Makefile
f7c668
@@ -637,13 +657,13 @@ echo "
f7c668
         jslint:                   ${JSLINT}
f7c668
         LDAP libs:                ${LDAP_LIBS}
f7c668
         OpenSSL crypto libs:      ${CRYPTO_LIBS}
f7c668
-        KRB5 libs:                ${KRB5_LIBS}"
f7c668
+        KRB5 libs:                ${KRB5_LIBS}
f7c668
+        systemdsystemunitdir:     ${systemdsystemunitdir}"
f7c668
 
f7c668
 AM_COND_IF([ENABLE_SERVER], [
f7c668
     echo "\
f7c668
         KRAD libs:                ${KRAD_LIBS}
f7c668
         krb5rundir:               ${krb5rundir}
f7c668
-        systemdsystemunitdir:     ${systemdsystemunitdir}
f7c668
         systemdtmpfilesdir:       ${systemdtmpfilesdir}
f7c668
         build mode:               server & client"
f7c668
 ], [
f7c668
diff --git a/freeipa.spec.in b/freeipa.spec.in
f7c668
index cec57e64e..1d8f4e6aa 100755
f7c668
--- a/freeipa.spec.in
f7c668
+++ b/freeipa.spec.in
f7c668
@@ -586,6 +586,10 @@ on the machine enrolled into a FreeIPA environment
f7c668
 %package client-epn
f7c668
 Summary: Tools to configure Expiring Password Notification in IPA
f7c668
 Group: System Environment/Base
f7c668
+Requires: systemd-units
f7c668
+Requires(post): systemd-units
f7c668
+Requires(preun): systemd-units
f7c668
+Requires(postun): systemd-units
f7c668
 Requires: %{name}-client = %{version}-%{release}
f7c668
 
f7c668
 %description client-epn
f7c668
@@ -1003,6 +1007,17 @@ fi
f7c668
 # ONLY_CLIENT
f7c668
 %endif
f7c668
 
f7c668
+%preun client-epn
f7c668
+%systemd_preun ipa-epn.service
f7c668
+%systemd_preun ipa-epn.timer
f7c668
+
f7c668
+%postun client-epn
f7c668
+%systemd_postun ipa-epn.service
f7c668
+%systemd_postun ipa-epn.timer
f7c668
+
f7c668
+%post client-epn
f7c668
+%systemd_post ipa-epn.service
f7c668
+%systemd_post ipa-epn.timer
f7c668
 
f7c668
 %post client
f7c668
 if [ $1 -gt 1 ] ; then
f7c668
diff --git a/init/systemd/Makefile.am b/init/systemd/Makefile.am
f7c668
index 5053dbff6..175178787 100644
f7c668
--- a/init/systemd/Makefile.am
f7c668
+++ b/init/systemd/Makefile.am
f7c668
@@ -2,17 +2,17 @@
f7c668
 #
f7c668
 AUTOMAKE_OPTIONS = 1.7
f7c668
 
f7c668
+NULL =
f7c668
+
f7c668
 dist_noinst_DATA = 			\
f7c668
 	ipa-custodia.service.in		\
f7c668
 	ipa.service.in			\
f7c668
-	ipa-epn.service.in		\
f7c668
-	ipa-epn.timer.in
f7c668
+	$(NULL)
f7c668
 
f7c668
 systemdsystemunit_DATA = 	\
f7c668
 	ipa-custodia.service	\
f7c668
 	ipa.service				\
f7c668
-	ipa-epn.service			\
f7c668
-	ipa-epn.timer
f7c668
+	$(NULL)
f7c668
 
f7c668
 CLEANFILES = $(systemdsystemunit_DATA)
f7c668
 
f7c668
diff --git a/install/share/Makefile.am b/install/share/Makefile.am
f7c668
index 496e81288..e95796dfb 100644
f7c668
--- a/install/share/Makefile.am
f7c668
+++ b/install/share/Makefile.am
f7c668
@@ -106,8 +106,3 @@ dist_app_DATA =				\
f7c668
 kdcproxyconfdir = $(IPA_SYSCONF_DIR)/kdcproxy
f7c668
 dist_kdcproxyconf_DATA =			\
f7c668
 	kdcproxy.conf
f7c668
-
f7c668
-epnconfdir = $(IPA_SYSCONF_DIR)/epn
f7c668
-dist_epnconf_DATA =			\
f7c668
-	expire_msg.template	\
f7c668
-	$(NULL)
f7c668
diff --git a/server.m4 b/server.m4
f7c668
index d35823e80..842d599d2 100644
f7c668
--- a/server.m4
f7c668
+++ b/server.m4
f7c668
@@ -153,22 +153,3 @@ dnl Check for libverto
f7c668
 dnl ---------------------------------------------------------------------------
f7c668
 
f7c668
 PKG_CHECK_MODULES([LIBVERTO], [libverto])
f7c668
-
f7c668
-dnl ---------------------------------------------------------------------------
f7c668
-dnl - Check for systemd directories
f7c668
-dnl ---------------------------------------------------------------------------
f7c668
-
f7c668
-PKG_CHECK_EXISTS([systemd], [], [AC_MSG_ERROR([systemd not found])])
f7c668
-AC_ARG_WITH([systemdsystemunitdir],
f7c668
-            AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
f7c668
-               [Directory for systemd service files]),
f7c668
-            [systemdsystemunitdir=$with_systemdsystemunitdir],
f7c668
-        [systemdsystemunitdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=systemdsystemunitdir systemd)])
f7c668
-AC_SUBST([systemdsystemunitdir])
f7c668
-
f7c668
-AC_ARG_WITH([systemdtmpfilesdir],
f7c668
-            AS_HELP_STRING([--with-systemdtmpfilesdir=DIR],
f7c668
-               [Directory for systemd-tmpfiles configuration files]),
f7c668
-            [systemdtmpfilesdir=$with_systemdtmpfilesdir],
f7c668
-        [systemdtmpfilesdir=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=tmpfilesdir systemd)])
f7c668
-AC_SUBST([systemdtmpfilesdir])
f7c668
-- 
f7c668
2.26.2
f7c668
f7c668
From 23e2935e5c5cb402dd4f6f44eaa4b013e6a8188a Mon Sep 17 00:00:00 2001
f7c668
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
f7c668
Date: Mon, 22 Jun 2020 16:39:02 +0200
f7c668
Subject: [PATCH] EPN: ship the configuration file.
f7c668
MIME-Version: 1.0
f7c668
Content-Type: text/plain; charset=UTF-8
f7c668
Content-Transfer-Encoding: 8bit
f7c668
f7c668
Ship and install /etc/ipa/epn.conf.
f7c668
Minor fixes to the associated man page.
f7c668
f7c668
Fixes: https://pagure.io/freeipa/issue/8374
f7c668
Signed-off-by: François Cami <fcami@redhat.com>
f7c668
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
---
f7c668
 client/man/epn.conf.5    |  5 ++--
f7c668
 client/share/Makefile.am |  7 +++++-
f7c668
 client/share/epn.conf    | 54 ++++++++++++++++++++++++++++++++++++++++
f7c668
 freeipa.spec.in          |  4 ++-
f7c668
 4 files changed, 65 insertions(+), 5 deletions(-)
f7c668
 create mode 100644 client/share/epn.conf
f7c668
f7c668
diff --git a/client/man/epn.conf.5 b/client/man/epn.conf.5
f7c668
index 38e99e25d..14f5dbb75 100644
f7c668
--- a/client/man/epn.conf.5
f7c668
+++ b/client/man/epn.conf.5
f7c668
@@ -71,11 +71,10 @@ Specifies the From e-mail address value in the e-mails sent. The default is
f7c668
 root@localhost. Bounces will be sent here.
f7c668
 .TP
f7c668
 .B smtp_delay <milliseconds>
f7c668
-Time to wait, in milliseconds, between each e-mail sent to try to avoid overloading the mail queue.
f7c668
+Time to wait, in milliseconds, between each e-mail sent to try to avoid overloading the mail queue. The default is 0.
f7c668
 .TP
f7c668
 .B mail_from <address>
f7c668
-Specifies the From: e-mal address value in the e-mails sent. The default is
f7c668
-noreply@ipadefaultemaildomain. This value can be found by running
f7c668
+Specifies the From: e-mail address value in the e-mails sent. The default is noreply@ipadefaultemaildomain. This value can be found by running
f7c668
 .I ipa config-show
f7c668
 .TP
f7c668
 .B notify_ttls <list of days>
f7c668
diff --git a/client/share/Makefile.am b/client/share/Makefile.am
f7c668
index 1402a3a9d..472242e62 100644
f7c668
--- a/client/share/Makefile.am
f7c668
+++ b/client/share/Makefile.am
f7c668
@@ -5,7 +5,12 @@ dist_app_DATA =				\
f7c668
 	freeipa.template		\
f7c668
 	$(NULL)
f7c668
 
f7c668
-epnconfdir = $(IPA_SYSCONF_DIR)/epn
f7c668
+epnconfdir = $(IPA_SYSCONF_DIR)
f7c668
 dist_epnconf_DATA =			\
f7c668
+	epn.conf			\
f7c668
+	$(NULL)
f7c668
+
f7c668
+epntemplatedir = $(IPA_SYSCONF_DIR)/epn
f7c668
+dist_epntemplate_DATA =			\
f7c668
 	expire_msg.template	\
f7c668
 	$(NULL)
f7c668
diff --git a/client/share/epn.conf b/client/share/epn.conf
f7c668
new file mode 100644
f7c668
index 000000000..0e590dfc3
f7c668
--- /dev/null
f7c668
+++ b/client/share/epn.conf
f7c668
@@ -0,0 +1,54 @@
f7c668
+# Global IPA-EPN [0] configuration file.
f7c668
+# For a complete explanation of each parameter, see the epn.conf(5)
f7c668
+# manual page.
f7c668
+# For best results, change no more than a single parameter at a time,
f7c668
+# and test if ipa-epn(1) still works as intended, using --dry-run when
f7c668
+# it makes sense.
f7c668
+#
f7c668
+# [0] https://github.com/freeipa/freeipa/blob/master/doc/designs/expiring-password-notification.md
f7c668
+
f7c668
+[global]
f7c668
+
f7c668
+# Specifies the SMTP server to use. 
f7c668
+smtp_server = localhost
f7c668
+
f7c668
+# Specifies the SMTP port.
f7c668
+smtp_port = 25
f7c668
+
f7c668
+# Specifies the id of the user to authenticate with the SMTP server.
f7c668
+# Default None (empty value).
f7c668
+# smtp_user =
f7c668
+
f7c668
+# Specifies the password for the authorized user.
f7c668
+# Default None (empty value).
f7c668
+# smtp_password =
f7c668
+
f7c668
+# pecifies the number of seconds to wait for SMTP to respond.
f7c668
+smtp_timeout = 60
f7c668
+
f7c668
+# Specifies the type of secure connection to make. Options are: none,
f7c668
+# starttls and ssl.
f7c668
+smtp_security = none
f7c668
+
f7c668
+# Specifies the From e-mail address value in the e-mails sent. Bounces will
f7c668
+# be sent here.
f7c668
+smtp_admin = root@localhost
f7c668
+
f7c668
+# Time to wait, in milliseconds, between each e-mail sent to try to avoid
f7c668
+# overloading the mail queue.
f7c668
+smtp_delay = 0
f7c668
+
f7c668
+# Specifies the From: e-mail address value in the e-mails sent.
f7c668
+# The default when unset is noreply@ipadefaultemaildomain.
f7c668
+# This value can be found by running ipa config-show.
f7c668
+# mail_from =
f7c668
+
f7c668
+# The list of days before a password expiration when ipa-epn should notify
f7c668
+# a user that their password will soon require a reset.
f7c668
+notify_ttls = 28, 14, 7, 3, 1
f7c668
+
f7c668
+# Set the character set of the message.
f7c668
+msg_charset = utf8
f7c668
+
f7c668
+# Set the message's MIME sub-content type.
f7c668
+msg_subtype = plain
f7c668
diff --git a/freeipa.spec.in b/freeipa.spec.in
f7c668
index 5bce6f118..8cca99697 100755
f7c668
--- a/freeipa.spec.in
f7c668
+++ b/freeipa.spec.in
f7c668
@@ -1387,13 +1387,15 @@ fi
f7c668
 
f7c668
 %files client-epn
f7c668
 %doc README.md Contributors.txt
f7c668
+%dir %{_sysconfdir}/ipa/epn
f7c668
 %license COPYING
f7c668
 %{_sbindir}/ipa-epn
f7c668
 %{_mandir}/man1/ipa-epn.1*
f7c668
 %{_mandir}/man5/epn.conf.5*
f7c668
 %attr(644,root,root) %{_unitdir}/ipa-epn.service
f7c668
 %attr(644,root,root) %{_unitdir}/ipa-epn.timer
f7c668
-%attr(644,root,root) %{_sysconfdir}/ipa/epn/expire_msg.template
f7c668
+%attr(600,root,root) %config(noreplace) %{_sysconfdir}/ipa/epn.conf
f7c668
+%attr(644,root,root) %config(noreplace) %{_sysconfdir}/ipa/epn/expire_msg.template
f7c668
 
f7c668
 %files -n python3-ipaclient
f7c668
 %doc README.md Contributors.txt
f7c668
-- 
f7c668
2.26.2
f7c668
f7c668
From 3b43950d35f78b28d4edde4fda475b5aa84f4587 Mon Sep 17 00:00:00 2001
f7c668
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
f7c668
Date: Tue, 23 Jun 2020 09:39:02 +0200
f7c668
Subject: [PATCH] man pages: fix epn.conf.5 and ipa-epn.1 formatting
f7c668
MIME-Version: 1.0
f7c668
Content-Type: text/plain; charset=UTF-8
f7c668
Content-Transfer-Encoding: 8bit
f7c668
f7c668
Fix formatting issues found with mandoc.
f7c668
f7c668
Signed-off-by: François Cami <fcami@redhat.com>
f7c668
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
---
f7c668
 client/man/epn.conf.5 | 2 +-
f7c668
 client/man/ipa-epn.1  | 8 ++++----
f7c668
 2 files changed, 5 insertions(+), 5 deletions(-)
f7c668
f7c668
diff --git a/client/man/epn.conf.5 b/client/man/epn.conf.5
f7c668
index 14f5dbb75..df1f0156c 100644
f7c668
--- a/client/man/epn.conf.5
f7c668
+++ b/client/man/epn.conf.5
f7c668
@@ -16,7 +16,7 @@
f7c668
 .\"
f7c668
 .\" Author: Rob Crittenden <rcritten@@redhat.com>
f7c668
 .\"
f7c668
-.TH "epn.conf" "5" "Apr 28 2020" "FreeIPA" "FreeIPA Manual Pages"
f7c668
+.TH "EPN.CONF" "5" "April 28, 2020" "FreeIPA" "FreeIPA Manual Pages"
f7c668
 .SH "NAME"
f7c668
 epn.conf \- Expiring Password Notification configuration file
f7c668
 .SH "SYNOPSIS"
f7c668
diff --git a/client/man/ipa-epn.1 b/client/man/ipa-epn.1
f7c668
index 9999ea8ca..124fd4536 100644
f7c668
--- a/client/man/ipa-epn.1
f7c668
+++ b/client/man/ipa-epn.1
f7c668
@@ -15,14 +15,14 @@
f7c668
 .\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
f7c668
 .\"
f7c668
 .\"
f7c668
-.TH "ipa-epn" "1" "Apr 24 2020" "FreeIPA" "FreeIPA Manual Pages"
f7c668
+.TH "IPA-EPN" "1" "April 24, 2020" "FreeIPA" "FreeIPA Manual Pages"
f7c668
 .SH "NAME"
f7c668
 ipa\-epn \- Send expiring password nofications
f7c668
 .SH "SYNOPSIS"
f7c668
-ipa\-epn \[options\]
f7c668
+ipa\-epn \fR[options\fR]
f7c668
 
f7c668
 .SH "DESCRIPTION"
f7c668
-ipa\-epn provides a method to warn users via email that their IPA account password is about to expire. 
f7c668
+ipa\-epn provides a method to warn users via email that their IPA account password is about to expire.
f7c668
 
f7c668
 It can be used in dry\-run mode which is recommmended during setup. The output is always JSON in this case.
f7c668
 
f7c668
@@ -38,7 +38,7 @@ The \-\-to\-nbdays CLI option can be used to determine the number of notificatio
f7c668
 
f7c668
 If \fB\-\-from\-nbdays\fR is not specified, ipa\-epn will look within a 24\-hour long time range in <number of days> days.
f7c668
 
f7c668
-if \fB\-\-from\-nbdays\fR is specified, the date range starts at \fB\-\-from\-nbdays\fR days in the future and ends at \fB\-\-to\-nbdays\fR in the future. 
f7c668
+if \fB\-\-from\-nbdays\fR is specified, the date range starts at \fB\-\-from\-nbdays\fR days in the future and ends at \fB\-\-to\-nbdays\fR in the future.
f7c668
 
f7c668
 Together, these two CLI options can be used to determine how many emails would be sent in a specific time in the future.
f7c668
 
f7c668
-- 
f7c668
2.26.2
f7c668
f7c668
From 2648c218467792e907435eaa5267a0f3457f634f Mon Sep 17 00:00:00 2001
f7c668
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
f7c668
Date: Tue, 23 Jun 2020 13:50:02 +0200
f7c668
Subject: [PATCH] ipatests: check that EPN's configuration file is installed.
f7c668
MIME-Version: 1.0
f7c668
Content-Type: text/plain; charset=UTF-8
f7c668
Content-Transfer-Encoding: 8bit
f7c668
f7c668
Fixes: https://pagure.io/freeipa/issue/8374
f7c668
Signed-off-by: François Cami <fcami@redhat.com>
f7c668
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
---
f7c668
 ipatests/test_integration/test_epn.py | 14 ++++++++++++++
f7c668
 1 file changed, 14 insertions(+)
f7c668
f7c668
diff --git a/ipatests/test_integration/test_epn.py b/ipatests/test_integration/test_epn.py
f7c668
index 7f56d4bc0..409d588d5 100644
f7c668
--- a/ipatests/test_integration/test_epn.py
f7c668
+++ b/ipatests/test_integration/test_epn.py
f7c668
@@ -209,6 +209,20 @@ class TestEPN(IntegrationTest):
f7c668
         cls.master.run_command(r'rm -f /etc/pki/tls/private/postfix.key')
f7c668
         cls.master.run_command(r'rm -f /etc/pki/tls/certs/postfix.pem')
f7c668
 
f7c668
+    @pytest.mark.xfail(reason='pr-ci issue 378', strict=True)
f7c668
+    def test_EPN_config_file(self):
f7c668
+        """Check that the EPN configuration file is installed.
f7c668
+           https://pagure.io/freeipa/issue/8374
f7c668
+        """
f7c668
+        epn_conf = "/etc/ipa/epn.conf"
f7c668
+        epn_template = "/etc/ipa/epn/expire_msg.template"
f7c668
+        cmd1 = self.master.run_command(["rpm", "-qc", "freeipa-client-epn"])
f7c668
+        assert epn_conf in cmd1.stdout_text
f7c668
+        assert epn_template in cmd1.stdout_text
f7c668
+        cmd2 = self.master.run_command(["sha256sum", epn_conf])
f7c668
+        ck = "4c207b5c9c760c36db0d3b2b93da50ea49edcc4002d6d1e7383601f0ec30b957"
f7c668
+        assert cmd2.stdout_text.find(ck) == 0
f7c668
+
f7c668
     def test_EPN_smoketest_1(self):
f7c668
         """No users except admin. Check --dry-run output.
f7c668
            With the default configuration, the result should be an empty list.
f7c668
-- 
f7c668
2.26.2
f7c668
f7c668
From 06accac8906f66ebbb31849d6528b39ae006b124 Mon Sep 17 00:00:00 2001
f7c668
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
f7c668
Date: Wed, 24 Jun 2020 23:24:36 +0200
f7c668
Subject: [PATCH] ipatests: ipa_epn: uninstall/reinstall ipa-client-epn
f7c668
MIME-Version: 1.0
f7c668
Content-Type: text/plain; charset=UTF-8
f7c668
Content-Transfer-Encoding: 8bit
f7c668
f7c668
Due to https://github.com/freeipa/freeipa-pr-ci/issues/378
f7c668
the installed version of freeipa-client-epn is not the built
f7c668
one. Temporarily force uninstall/reinstall of this package
f7c668
before running the test.
f7c668
f7c668
Fixes: https://pagure.io/freeipa/issue/8374
f7c668
Signed-off-by: François Cami <fcami@redhat.com>
f7c668
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
f7c668
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
f7c668
---
f7c668
 ipatests/test_integration/test_epn.py | 20 +++++++++++++++++++-
f7c668
 1 file changed, 19 insertions(+), 1 deletion(-)
f7c668
f7c668
diff --git a/ipatests/test_integration/test_epn.py b/ipatests/test_integration/test_epn.py
f7c668
index 409d588d5..9a9fb17b9 100644
f7c668
--- a/ipatests/test_integration/test_epn.py
f7c668
+++ b/ipatests/test_integration/test_epn.py
f7c668
@@ -209,11 +209,29 @@ class TestEPN(IntegrationTest):
f7c668
         cls.master.run_command(r'rm -f /etc/pki/tls/private/postfix.key')
f7c668
         cls.master.run_command(r'rm -f /etc/pki/tls/certs/postfix.pem')
f7c668
 
f7c668
-    @pytest.mark.xfail(reason='pr-ci issue 378', strict=True)
f7c668
+    @pytest.mark.skip_if_platform(
f7c668
+        "debian", reason="Cannot check installed packages using RPM"
f7c668
+    )
f7c668
     def test_EPN_config_file(self):
f7c668
         """Check that the EPN configuration file is installed.
f7c668
            https://pagure.io/freeipa/issue/8374
f7c668
         """
f7c668
+        # workaround for https://github.com/freeipa/freeipa-pr-ci/issues/378
f7c668
+        rpm_q_cmds = [
f7c668
+            ["rpm", "-qi", "freeipa-client"],
f7c668
+            ["rpm", "-qi", "freeipa-client-epn"],
f7c668
+            ["rpm", "-qc", "freeipa-client-epn"],
f7c668
+            ["rpm", "-V", "freeipa-client-epn"],
f7c668
+            ["rpm", "-qvc", "freeipa-client-epn"],
f7c668
+            ["ls", "-l", "/etc/ipa", "/etc/ipa/epn"],
f7c668
+        ]
f7c668
+        for cmd in rpm_q_cmds:
f7c668
+            self.master.run_command(cmd, raiseonerr=False)
f7c668
+        tasks.uninstall_packages(self.master, ["*ipa-client-epn"])
f7c668
+        tasks.install_packages(self.master, ["*ipa-client-epn"])
f7c668
+        for cmd in rpm_q_cmds:
f7c668
+            self.master.run_command(cmd, raiseonerr=False)
f7c668
+        # end workaround
f7c668
         epn_conf = "/etc/ipa/epn.conf"
f7c668
         epn_template = "/etc/ipa/epn/expire_msg.template"
f7c668
         cmd1 = self.master.run_command(["rpm", "-qc", "freeipa-client-epn"])
f7c668
-- 
f7c668
2.26.2
f7c668