]> git.pld-linux.org Git - packages/dehydrated.git/commitdiff
add nginx config and webapp config
authorElan Ruusamäe <glen@delfi.ee>
Tue, 22 Nov 2016 18:13:33 +0000 (20:13 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 22 Nov 2016 18:13:33 +0000 (20:13 +0200)
dehydrated.spec
hook.sh

index 56089e5a3dbf0f7048f9cce52272c7ee6e20d338..8402a1962149be477c157497a958b8ef03906a36 100644 (file)
@@ -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 7440c121a532b1d26cdff89343eb3c4e0fd603fb..cc44c4e93c02f60575ebb5ff5b6c190d55e20c45 100755 (executable)
--- 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
This page took 1.172789 seconds and 4 git commands to generate.