Skip to content

Commit

Permalink
Hack up something to manage certificates for birthday20
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Aug 1, 2024
1 parent d0f4924 commit 3729e7a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
1 change: 1 addition & 0 deletions cookbooks/blog/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

version "1.0.0"
supports "ubuntu"
depends "ssl"
depends "wordpress"
45 changes: 25 additions & 20 deletions cookbooks/blog/recipes/birthday.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,35 @@
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"
group "wordpress"
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"
Expand All @@ -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
7 changes: 3 additions & 4 deletions roles/birthday20.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
}
)

# FIXME: Disable while site under development
# run_list(
# "recipe[blog::birthday]"
# )
run_list(
"recipe[blog::birthday]"
)

0 comments on commit 3729e7a

Please sign in to comment.