Set up an instance of Mastodon for Kosmos
Refs #19 Use new application cookbook, update our cookbooks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user