From a449993c2f97f5bfa7c66e8bc1e453946fe25bc7 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 12 Feb 2017 10:52:09 +0000 Subject: [PATCH] Switch OTRS to letsencrypt --- cookbooks/otrs/recipes/default.rb | 6 ++++++ cookbooks/otrs/templates/default/apache.erb | 3 +++ 2 files changed, 9 insertions(+) diff --git a/cookbooks/otrs/recipes/default.rb b/cookbooks/otrs/recipes/default.rb index c1a027e56..03eb43aa0 100644 --- a/cookbooks/otrs/recipes/default.rb +++ b/cookbooks/otrs/recipes/default.rb @@ -139,6 +139,12 @@ Dir.glob("/opt/otrs/var/cron/*.dist") do |distname| end end +ssl_certificate site do + domains site + fallback_certificate "openstreetmap" + notifies :reload, "service[apache2]" +end + apache_site site do template "apache.erb" end diff --git a/cookbooks/otrs/templates/default/apache.erb b/cookbooks/otrs/templates/default/apache.erb index 3b889ce3d..e392d8765 100644 --- a/cookbooks/otrs/templates/default/apache.erb +++ b/cookbooks/otrs/templates/default/apache.erb @@ -7,6 +7,7 @@ CustomLog /var/log/apache2/<%= @name %>-access.log combined ErrorLog /var/log/apache2/<%= @name %>-error.log + RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ RedirectPermanent / https://otrs.openstreetmap.org/ @@ -18,6 +19,8 @@ ErrorLog /var/log/apache2/<%= @name %>-error.log SSLEngine on + SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem + SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key ScriptAlias /otrs/ /opt/otrs/bin/cgi-bin/ Alias /otrs-web/ /opt/otrs/var/httpd/htdocs/ -- 2.39.5