Adapt Gitea recipes for new VM setup

This commit is contained in:
2022-03-12 14:43:44 -06:00
parent 23e49134e7
commit a1b07dfb9e
9 changed files with 75 additions and 38 deletions

View File

@@ -3,9 +3,6 @@
# Recipe:: default
#
include_recipe "kosmos-nginx"
domain = node["kosmos_gitea"]["nginx"]["domain"]
working_directory = node["kosmos_gitea"]["working_directory"]
git_home_directory = "/home/git"
repository_root_directory = "#{git_home_directory}/gitea-repositories"
@@ -63,15 +60,6 @@ directory config_directory do
mode "0750"
end
# Copy the self-signed root certificate to the system certificate store. Gitea
# will find it there automatically
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
root_cert_path = "/etc/ssl/certs/root.kosmos.org.crt"
file root_cert_path do
content postgresql_data_bag_item['ssl_root_cert']
mode "0644"
end
template "#{config_directory}/app.ini" do
source "app.ini.erb"
owner "git"
@@ -119,20 +107,9 @@ service "gitea" do
action [:enable, :start]
end
template "#{node['nginx']['dir']}/sites-available/#{domain}" do
source "nginx_conf.erb"
owner 'www-data'
mode 0640
variables server_name: domain,
ssl_cert: "/etc/letsencrypt/live/#{domain}/fullchain.pem",
ssl_key: "/etc/letsencrypt/live/#{domain}/privkey.pem",
upstream_port: 3000
notifies :reload, 'service[nginx]', :delayed
firewall_rule 'gitea' do
port [node["kosmos_gitea"]["port"]]
source "10.1.1.0/24"
protocol :tcp
command :allow
end
nginx_site domain do
action :enable
end
nginx_certbot_site domain