From 2ecc128abda9f1865099aa5c4ae11583bfb9b875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Wed, 11 Sep 2019 13:47:42 +0200 Subject: [PATCH] Move the hidden service attributes to the attributes file When it is set in the recipe the hidden service dir doesn't get set correctly (nil), resulting in a broken torrc file --- site-cookbooks/kosmos-ejabberd/attributes/default.rb | 8 ++++++++ site-cookbooks/kosmos-ejabberd/recipes/default.rb | 9 ++------- site-cookbooks/kosmos-mastodon/attributes/default.rb | 4 ++++ site-cookbooks/kosmos-mastodon/recipes/nginx.rb | 5 ++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/site-cookbooks/kosmos-ejabberd/attributes/default.rb b/site-cookbooks/kosmos-ejabberd/attributes/default.rb index 3f7d227..03e6dd4 100644 --- a/site-cookbooks/kosmos-ejabberd/attributes/default.rb +++ b/site-cookbooks/kosmos-ejabberd/attributes/default.rb @@ -1,2 +1,10 @@ node.default["kosmos-ejabberd"]["version"] = "19.02" node.default["kosmos-ejabberd"]["checksum"] = "aea550c58e61eab04ca9beb8896d8b04f4a79321c21dee160a67ad6787236f51" + +node.override["tor"]["HiddenServices"]["ejabberd"] = { + "HiddenServicePorts" => [ + "5222 127.0.0.1:5222", + "5223 127.0.0.1:5223", + "5269 127.0.0.1:5269" + ] +} diff --git a/site-cookbooks/kosmos-ejabberd/recipes/default.rb b/site-cookbooks/kosmos-ejabberd/recipes/default.rb index 0870638..5d4e282 100644 --- a/site-cookbooks/kosmos-ejabberd/recipes/default.rb +++ b/site-cookbooks/kosmos-ejabberd/recipes/default.rb @@ -134,11 +134,6 @@ end # # Tor hidden service # -node.override["tor"]["HiddenServices"]["ejabberd"] = { - "HiddenServicePorts" => [ - "5222 127.0.0.1:5222", - "5223 127.0.0.1:5223", - "5269 127.0.0.1:5269" - ] -} +# The attributes for the hidden service are set in attributes/default.rb, due +# to the way the tor-full cookbook builds the path to the hidden service dir include_recipe "tor-full" diff --git a/site-cookbooks/kosmos-mastodon/attributes/default.rb b/site-cookbooks/kosmos-mastodon/attributes/default.rb index e2580ed..9d99cea 100644 --- a/site-cookbooks/kosmos-mastodon/attributes/default.rb +++ b/site-cookbooks/kosmos-mastodon/attributes/default.rb @@ -4,3 +4,7 @@ node.default["kosmos-mastodon"]["streaming_port"] = 4000 node.default["kosmos-mastodon"]["server_name"] = "kosmos.social" node.default["kosmos-mastodon"]["redis_url"] = "redis://localhost:6379/1" node.default["kosmos-mastodon"]["sidekiq_threads"] = 25 + +node.override["tor"]["HiddenServices"]["mastodon"] = { + "HiddenServicePorts" => ["80 127.0.0.1:80"] +} diff --git a/site-cookbooks/kosmos-mastodon/recipes/nginx.rb b/site-cookbooks/kosmos-mastodon/recipes/nginx.rb index 765eb66..268e973 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/nginx.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/nginx.rb @@ -71,7 +71,6 @@ nginx_certbot_site server_name # # Tor hidden service # -node.override["tor"]["HiddenServices"]["mastodon"] = { - "HiddenServicePorts" => ["80 127.0.0.1:80"] -} +# The attributes for the hidden service are set in attributes/default.rb, due +# to the way the tor-full cookbook builds the path to the hidden service dir include_recipe "tor-full"