Merge branch 'master' into feature/16-ipfs
This commit is contained in:
commit
a7433a42cd
@ -7,16 +7,43 @@
|
|||||||
# All rights reserved - Do Not Redistribute
|
# All rights reserved - Do Not Redistribute
|
||||||
#
|
#
|
||||||
|
|
||||||
git "/usr/local/letsencrypt" do
|
git "/usr/local/certbot" do
|
||||||
repository "https://github.com/letsencrypt/letsencrypt"
|
repository "https://github.com/certbot/certbot"
|
||||||
action :sync
|
action :sync
|
||||||
revision "v0.5.0"
|
revision "v0.12.0"
|
||||||
user "root"
|
user "root"
|
||||||
group "root"
|
group "root"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
letsencrypt_renew_hook = <<-EOF
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Reloading nginx is enough to read the new certificates
|
||||||
|
systemctl reload nginx
|
||||||
|
|
||||||
|
# Copy the prosody certificate and restart the server if it has been renewed
|
||||||
|
# This is necessary because the prosody user doesn't have access to the
|
||||||
|
# letsencrypt live folder
|
||||||
|
echo "${RENEWED_DOMAINS}" | grep xmpp.5apps.com
|
||||||
|
if [ $? -ne 1 ]; then
|
||||||
|
cp /etc/letsencrypt/live/xmpp.5apps.com/fullchain.pem /var/lib/prosody/xmpp.5apps.com.crt
|
||||||
|
cp /etc/letsencrypt/live/xmpp.5apps.com/privkey.pem /var/lib/prosody/xmpp.5apps.com.key
|
||||||
|
systemctl restart prosody
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
file "/usr/local/bin/letsencrypt_renew_hook" do
|
||||||
|
content letsencrypt_renew_hook
|
||||||
|
mode 0700
|
||||||
|
owner "root"
|
||||||
|
group "root"
|
||||||
|
end
|
||||||
|
|
||||||
cron "renew Let's Encrypt certificates" do
|
cron "renew Let's Encrypt certificates" do
|
||||||
minute "0"
|
minute "0"
|
||||||
hour "4"
|
hour "4"
|
||||||
command "/usr/local/letsencrypt/letsencrypt-auto renew && service nginx restart"
|
# The post hook is only executed if a cert has been renewed
|
||||||
|
command "/usr/local/certbot/certbot-auto renew --renew-hook \"/usr/local/bin/letsencrypt_renew_hook\" -n"
|
||||||
end
|
end
|
||||||
|
@ -50,8 +50,8 @@ include_recipe "mediawiki::nginx"
|
|||||||
include_recipe "kosmos-base::letsencrypt"
|
include_recipe "kosmos-base::letsencrypt"
|
||||||
|
|
||||||
execute "letsencrypt cert for wiki.kosmos.org" do
|
execute "letsencrypt cert for wiki.kosmos.org" do
|
||||||
command "./letsencrypt-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path #{node["mediawiki"]["docroot_dir"]} -d wiki.kosmos.org"
|
command "./certbot-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path #{node["mediawiki"]["docroot_dir"]} -d wiki.kosmos.org -n"
|
||||||
cwd "/usr/local/letsencrypt"
|
cwd "/usr/local/certbot"
|
||||||
not_if { File.exist? "/etc/letsencrypt/live/wiki.kosmos.org/fullchain.pem" }
|
not_if { File.exist? "/etc/letsencrypt/live/wiki.kosmos.org/fullchain.pem" }
|
||||||
notifies :reload, "service[nginx]", :delayed
|
notifies :reload, "service[nginx]", :delayed
|
||||||
end
|
end
|
||||||
|
@ -64,8 +64,8 @@ include_recipe "kosmos-nginx"
|
|||||||
include_recipe "wordpress::app"
|
include_recipe "wordpress::app"
|
||||||
|
|
||||||
execute "letsencrypt cert for blog.kosmos.org" do
|
execute "letsencrypt cert for blog.kosmos.org" do
|
||||||
command "./letsencrypt-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path #{node['wordpress']['dir']} -d blog.kosmos.org"
|
command "./certbot-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path #{node['wordpress']['dir']} -d blog.kosmos.org -n"
|
||||||
cwd "/usr/local/letsencrypt"
|
cwd "/usr/local/certbot"
|
||||||
not_if { File.exist? "/etc/letsencrypt/live/blog.kosmos.org/fullchain.pem" }
|
not_if { File.exist? "/etc/letsencrypt/live/blog.kosmos.org/fullchain.pem" }
|
||||||
notifies :reload, "service[nginx]", :delayed
|
notifies :reload, "service[nginx]", :delayed
|
||||||
end
|
end
|
||||||
|
@ -19,7 +19,7 @@ application "sockethub" do
|
|||||||
action :deploy
|
action :deploy
|
||||||
|
|
||||||
repository 'https://github.com/sockethub/sockethub.git'
|
repository 'https://github.com/sockethub/sockethub.git'
|
||||||
revision 'master'
|
revision 'v1.0.5'
|
||||||
|
|
||||||
nodejs do
|
nodejs do
|
||||||
entry_point '/srv/sockethub/current/bin/sockethub'
|
entry_point '/srv/sockethub/current/bin/sockethub'
|
||||||
|
@ -38,8 +38,8 @@ template "#{node['nginx']['dir']}/sites-available/sockethub" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
execute "letsencrypt cert for sockethub.kosmos.org" do
|
execute "letsencrypt cert for sockethub.kosmos.org" do
|
||||||
command "./letsencrypt-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path /var/www/sockethub -d sockethub.kosmos.org"
|
command "./certbot-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path /var/www/sockethub -d sockethub.kosmos.org -n"
|
||||||
cwd "/usr/local/letsencrypt"
|
cwd "/usr/local/certbot"
|
||||||
not_if { File.exist? "/etc/letsencrypt/live/sockethub.kosmos.org/fullchain.pem" }
|
not_if { File.exist? "/etc/letsencrypt/live/sockethub.kosmos.org/fullchain.pem" }
|
||||||
notifies :reload, "service[nginx]", :delayed
|
notifies :reload, "service[nginx]", :delayed
|
||||||
end
|
end
|
||||||
|
@ -28,22 +28,6 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# an HTTP header important enough to have its own Wikipedia entry:
|
|
||||||
# http://en.wikipedia.org/wiki/X-Forwarded-For
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
|
|
||||||
# enable this if and only if you use HTTPS, this helps Rack
|
|
||||||
# set the proper protocol for doing redirects:
|
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
|
||||||
|
|
||||||
# pass the Host: header from the client right along so redirects
|
|
||||||
# can be set properly within the Rack application
|
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
|
|
||||||
# we don't want nginx trying to do something clever with
|
|
||||||
# redirects, we set the Host: header above already.
|
|
||||||
proxy_redirect off;
|
|
||||||
|
|
||||||
# Increase number of buffers. Default is 8
|
# Increase number of buffers. Default is 8
|
||||||
proxy_buffers 1024 8k;
|
proxy_buffers 1024 8k;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user