From 1297de4eac0f30da215b909e653515be4e02b14b Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Fri, 2 Dec 2022 17:58:44 +0000 Subject: [PATCH] community: Fix tests and workaround ohai issue on ARM Mac --- cookbooks/community/metadata.rb | 1 + cookbooks/community/recipes/default.rb | 6 +++++- cookbooks/community/templates/default/web_only.yml.erb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cookbooks/community/metadata.rb b/cookbooks/community/metadata.rb index 4d159c4ad..f2eaaaa03 100644 --- a/cookbooks/community/metadata.rb +++ b/cookbooks/community/metadata.rb @@ -8,6 +8,7 @@ version "1.0.0" supports "ubuntu" depends "accounts" depends "docker" +depends "exim" depends "geoipupdate" depends "git" depends "ssl" diff --git a/cookbooks/community/recipes/default.rb b/cookbooks/community/recipes/default.rb index 89743de31..f3888c61a 100644 --- a/cookbooks/community/recipes/default.rb +++ b/cookbooks/community/recipes/default.rb @@ -19,13 +19,17 @@ include_recipe "accounts" include_recipe "docker" -include_recipe "geoipupdate" include_recipe "git" include_recipe "ssl" passwords = data_bag_item("community", "passwords") license_keys = data_bag_item("geoipupdate", "license-keys") unless kitchen? +# Disable any default installed apache2 service. Web server is embedded within the discourse docker container +service "apache2" do + action [:disable, :stop] +end + directory "/srv/community.openstreetmap.org" do owner "root" group "root" diff --git a/cookbooks/community/templates/default/web_only.yml.erb b/cookbooks/community/templates/default/web_only.yml.erb index fbf8604d1..f3f58bb6e 100644 --- a/cookbooks/community/templates/default/web_only.yml.erb +++ b/cookbooks/community/templates/default/web_only.yml.erb @@ -32,7 +32,7 @@ env: ## How many concurrent web requests are supported? Depends on memory and CPU cores. ## will be set automatically by bootstrap based on detected CPUs, or you can override - UNICORN_WORKERS: <%= node[:cpu][:total] %> + UNICORN_WORKERS: <%= [2, node.dig('cpu', 'total').to_i, node.dig('cpu', 'cores').to_i].max %> ## TODO: The domain name this Discourse instance will respond to DISCOURSE_HOSTNAME: community.openstreetmap.org -- 2.39.5