diff --git a/Berksfile b/Berksfile index d5228b4..20a6856 100644 --- a/Berksfile +++ b/Berksfile @@ -52,3 +52,6 @@ cookbook 'mariadb', '= 0.3.1' cookbook 'ipfs', git: 'https://github.com/67P/ipfs-cookbook.git', ref: 'v0.4.1' +cookbook 'tor-full', + git: 'https://github.com/sliim-cookbooks/tor-full.git', + ref: 'custom' diff --git a/Berksfile.lock b/Berksfile.lock index 78ada7a..06b9aea 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -51,6 +51,10 @@ DEPENDENCIES revision: 7476279fc9c8727f082b8d77b5e1922dc2ef437b ref: v0.5.6 timezone_iii (= 1.0.4) + tor-full + git: https://github.com/sliim-cookbooks/tor-full.git + revision: a3e965b460745a6bd66dcf9a853d4b3d8845ac8a + ref: custom users (~> 5.3.1) GRAPH @@ -159,6 +163,9 @@ GRAPH seven_zip (3.1.1) windows (>= 0.0.0) timezone_iii (1.0.4) + tor-full (0.2.0) + apt (>= 0.0.0) + yum (>= 0.0.0) users (5.3.1) windows (6.0.0) yum (5.1.0) diff --git a/site-cookbooks/kosmos-mastodon/attributes/default.rb b/site-cookbooks/kosmos-mastodon/attributes/default.rb index e2580ed..74d6c7c 100644 --- a/site-cookbooks/kosmos-mastodon/attributes/default.rb +++ b/site-cookbooks/kosmos-mastodon/attributes/default.rb @@ -4,3 +4,6 @@ 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.default["tor"]["HiddenServices"]["mastodon"] = { + "HiddenServicePorts" => ["80 127.0.0.1:80"] +} diff --git a/site-cookbooks/kosmos-mastodon/metadata.rb b/site-cookbooks/kosmos-mastodon/metadata.rb index a718790..57d24ac 100644 --- a/site-cookbooks/kosmos-mastodon/metadata.rb +++ b/site-cookbooks/kosmos-mastodon/metadata.rb @@ -15,3 +15,4 @@ depends "application_javascript" depends "postgresql" depends "kosmos-postgresql" depends "backup" +depends "tor-full" diff --git a/site-cookbooks/kosmos-mastodon/recipes/nginx.rb b/site-cookbooks/kosmos-mastodon/recipes/nginx.rb index e2df98d..e05e261 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/nginx.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/nginx.rb @@ -28,6 +28,7 @@ mastodon_path = node["kosmos-mastodon"]["directory"] server_name = node["kosmos-mastodon"]["server_name"] include_recipe "kosmos-nginx" +include_recipe "tor-full" template "#{node['nginx']['dir']}/sites-available/#{server_name}" do source 'nginx_conf_mastodon.erb'