From: Elan Ruusamäe Date: Tue, 22 Nov 2016 18:13:33 +0000 (+0200) Subject: add nginx config and webapp config X-Git-Tag: auto/th/dehydrated-0.3.1-1~3 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=aebe760fc1feb670b4bf2dd1584bdcfac238fe00;hp=e354c9b638fd6760cf4e57f61b0396888522a057;p=packages%2Fdehydrated.git add nginx config and webapp config --- 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