Set up an instance of Mastodon for Kosmos

Refs #19

Use new application cookbook, update our cookbooks
This commit is contained in:
Greg Karékinian
2017-04-06 21:20:51 +02:00
parent a3f5c5f646
commit de11c0d691
345 changed files with 22591 additions and 3473 deletions

View File

@@ -8,7 +8,9 @@
#
# nginx config to generate a Let's Encrypt cert
include_recipe "kosmos-base::letsencrypt"
unless node.chef_environment == "development"
include_recipe "kosmos-base::letsencrypt"
end
root_directory = "/var/www/ipfs.kosmos.org"
@@ -37,20 +39,23 @@ nginx_site 'ipfs.kosmos.org' do
enable true
end
firewall_rule 'ipfs_api' do
port 5444
protocol :tcp
command :allow
end
# Generate a Let's Encrypt cert (only if the nginx vhost exists and no cert
# has been generated before. The renew cron will take care of renewing
execute "letsencrypt cert for ipfs.kosmos.org" do
command "./certbot-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path #{root_directory} -d ipfs.kosmos.org -n"
cwd "/usr/local/certbot"
only_if do
File.exist?("#{node['nginx']['dir']}/sites-enabled/ipfs.kosmos.org") &&
! File.exist?("/etc/letsencrypt/live/ipfs.kosmos.org/fullchain.pem")
unless node.chef_environment == "development"
include_recipe "firewall"
firewall_rule 'ipfs_api' do
port 5444
protocol :tcp
command :allow
end
# Generate a Let's Encrypt cert (only if the nginx vhost exists and no cert
# has been generated before. The renew cron will take care of renewing
execute "letsencrypt cert for ipfs.kosmos.org" do
command "./certbot-auto certonly --webroot --agree-tos --email ops@5apps.com --webroot-path #{root_directory} -d ipfs.kosmos.org -n"
cwd "/usr/local/certbot"
only_if do
File.exist?("#{node['nginx']['dir']}/sites-enabled/ipfs.kosmos.org") &&
! File.exist?("/etc/letsencrypt/live/ipfs.kosmos.org/fullchain.pem")
end
notifies :create, "template[#{node['nginx']['dir']}/sites-available/ipfs.kosmos.org]", :delayed
end
notifies :create, "template[#{node['nginx']['dir']}/sites-available/ipfs.kosmos.org]", :delayed
end