[packages/dehydrated] add nginx config and webapp config

glen glen at pld-linux.org
Tue Nov 22 19:25:32 CET 2016


commit aebe760fc1feb670b4bf2dd1584bdcfac238fe00
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Nov 22 20:13:33 2016 +0200

    add nginx config and webapp config

 dehydrated.spec | 11 ++++++++++-
 hook.sh         | 10 +++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/dehydrated.spec b/dehydrated.spec
index 56089e5..8402a19 100644
--- a/dehydrated.spec
+++ b/dehydrated.spec
@@ -1,13 +1,14 @@
 Summary:	letsencrypt/acme client implemented as a shell-script
 Name:		dehydrated
 Version:	0.3.1
-Release:	0.5
+Release:	0.6
 License:	MIT
 Group:		Applications/Networking
 Source0:	https://github.com/lukas2511/dehydrated/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	7a3b92b963da6469c4a53f051d6efa24
 Source1:	apache.conf
 Source2:	lighttpd.conf
+Source3:	nginx.conf
 Source4:	domains.txt
 Source5:	hook.sh
 Source6:	crontab
@@ -57,6 +58,7 @@ install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/certs,/etc/cron.d} \
 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf
 cp -p docs/examples/config $RPM_BUILD_ROOT%{_sysconfdir}
 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}
 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/cron.d/%{name}
@@ -84,6 +86,12 @@ rm -rf $RPM_BUILD_ROOT
 %triggerun -- lighttpd
 %webapp_unregister lighttpd %{_webapp}
 
+%triggerin -- nginx
+%webapp_register nginx %{_webapp}
+
+%triggerun -- nginx
+%webapp_unregister nginx %{_webapp}
+
 %files
 %defattr(644,root,root,755)
 %doc README.md CHANGELOG LICENSE
@@ -92,6 +100,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nginx.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/domains.txt
 %attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hook.sh
diff --git a/hook.sh b/hook.sh
index 7440c12..cc44c4e 100755
--- a/hook.sh
+++ b/hook.sh
@@ -14,11 +14,11 @@ deploy_cert)
 		cat "$FULLCHAINCERT" "$PRIVKEY" > /etc/lighttpd/server.pem
 		/sbin/service lighttpd reload
 	fi
-	if [ -f /etc/nginx/server.pem -a -f /etc/nginx/server.key ]; then
-		echo " + Hook: Overwritting /etc/nginx/server.{pem,key} and reloading nginx..."
-		cp -a /etc/nginx/server.pem /etc/nginx/server.pem.letsencrypt~
-		cp -a /etc/nginx/server.key /etc/nginx/server.key.letsencrypt~
-		cat "$FULLCHAINCERT" > /etc/nginx/server.pem
+	if [ -f /etc/nginx/server.crt -a -f /etc/nginx/server.key ]; then
+		echo " + Hook: Overwritting /etc/nginx/server.{crt,key} and reloading nginx..."
+		cp -a /etc/nginx/server.crt /etc/nginx/server.crt.letsencrypt~
+		cp -a /etc/nginx/server.crt /etc/nginx/server.key.letsencrypt~
+		cat "$FULLCHAINCERT" > /etc/nginx/server.crt
 		cat "$PRIVKEY" > /etc/nginx/server.key
 		/sbin/service nginx reload
 	fi
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dehydrated.git/commitdiff/657cacc73854a26bfe7eda50a917aad096393546



More information about the pld-cvs-commit mailing list