From 3729e7a7995f29e474890068fa2524270950d11e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 1 Aug 2024 08:08:44 +0100 Subject: [PATCH] Hack up something to manage certificates for birthday20 --- cookbooks/blog/metadata.rb | 1 + cookbooks/blog/recipes/birthday.rb | 45 +++++++++++++++++------------- roles/birthday20.rb | 7 ++--- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/cookbooks/blog/metadata.rb b/cookbooks/blog/metadata.rb index 7000d76db..943dce067 100644 --- a/cookbooks/blog/metadata.rb +++ b/cookbooks/blog/metadata.rb @@ -6,4 +6,5 @@ version "1.0.0" supports "ubuntu" +depends "ssl" depends "wordpress" diff --git a/cookbooks/blog/recipes/birthday.rb b/cookbooks/blog/recipes/birthday.rb index eac984ae0..f4749f33b 100644 --- a/cookbooks/blog/recipes/birthday.rb +++ b/cookbooks/blog/recipes/birthday.rb @@ -20,7 +20,7 @@ include_recipe "wordpress" passwords = data_bag_item("birthday20", "passwords") -wp2fa_encrypt_keys = data_bag_item("birthday20", "wp2fa_encrypt_keys") +# wp2fa_encrypt_keys = data_bag_item("birthday20", "wp2fa_encrypt_keys") directory "/srv/birthday20.openstreetmap.org" do owner "wordpress" @@ -28,27 +28,27 @@ mode "755" end -wordpress_site "birthday20.openstreetmap.org" do - aliases ["birthday20.osm.org", "birthday20.openstreetmap.com", - "birthday20.openstreetmap.net", "birthday20.openstreetmaps.org"] - directory "/srv/birthday20.openstreetmap.org/wp" - database_name "osm-birthday20" - database_user "osm-birthday20-user" - database_password passwords["osm-birthday20-user"] - wp2fa_encrypt_key wp2fa_encrypt_keys["key"] - fpm_prometheus_port 11403 -end +# wordpress_site "birthday20.openstreetmap.org" do +# aliases ["birthday20.osm.org", "birthday20.openstreetmap.com", +# "birthday20.openstreetmap.net", "birthday20.openstreetmaps.org"] +# directory "/srv/birthday20.openstreetmap.org/wp" +# database_name "osm-birthday20" +# database_user "osm-birthday20-user" +# database_password passwords["osm-birthday20-user"] +# wp2fa_encrypt_key wp2fa_encrypt_keys["key"] +# fpm_prometheus_port 11403 +# end -wordpress_plugin "birthday20.openstreetmap.org-shareadraft" do - action :delete - plugin "shareadraft" - site "birthday20.openstreetmap.org" -end +# wordpress_plugin "birthday20.openstreetmap.org-shareadraft" do +# action :delete +# plugin "shareadraft" +# site "birthday20.openstreetmap.org" +# end -wordpress_plugin "birthday20.openstreetmap.org-public-post-preview" do - plugin "public-post-preview" - site "birthday20.openstreetmap.org" -end +# wordpress_plugin "birthday20.openstreetmap.org-public-post-preview" do +# plugin "public-post-preview" +# site "birthday20.openstreetmap.org" +# end template "/etc/cron.daily/birthday20-backup" do source "backup-birthday20.cron.erb" @@ -57,3 +57,8 @@ mode "750" variables :passwords => passwords end + +ssl_certificate new_resource.site do + domains ["birthday20.openstreetmap.org", "birthday20.osm.org", "birthday20.openstreetmap.com", + "birthday20.openstreetmap.net", "birthday20.openstreetmaps.org"] +end diff --git a/roles/birthday20.rb b/roles/birthday20.rb index 55132429e..a1b9191c2 100644 --- a/roles/birthday20.rb +++ b/roles/birthday20.rb @@ -13,7 +13,6 @@ } ) -# FIXME: Disable while site under development -# run_list( -# "recipe[blog::birthday]" -# ) +run_list( + "recipe[blog::birthday]" +)