diff --git a/clients/mastodon-2.json b/clients/mastodon-2.json new file mode 100644 index 0000000..ff3162b --- /dev/null +++ b/clients/mastodon-2.json @@ -0,0 +1,4 @@ +{ + "name": "mastodon-2", + "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA27a8h17CCQLP8JY59n+M\nURsrbeVvRi3yIUe1IklOlRSTy0L3Z37rFuSNC3dC9rKl/pHDKtorgeukxbFADXQx\nkta2LNX8gf09jCWsUdga5lWIbfOdtlCLRDG1MVEUSA0f6Sxdqr8RbjM2ch31T6Me\n5Z6DYdggwBujcPHwZC1AugI1wJ0T5XHY9f2MDs/XjNEdw3ThYbAdbl1e09ql6Gtg\nSVCa4RlLg/KICdLJtVOLkX6049/XRxi41I6xvu9tXsqgV3+bs8dYbeGLsTWmpPIv\naAUMcf/A5t4B2DVpnlXDytPqfvZQPD3aBVyfEJRGI1yD6Vi9zL3RyIhDQ/I7PMNI\naQIDAQAB\n-----END PUBLIC KEY-----\n" +} \ No newline at end of file diff --git a/nodes/mastodon-2.json b/nodes/mastodon-2.json new file mode 100644 index 0000000..8233528 --- /dev/null +++ b/nodes/mastodon-2.json @@ -0,0 +1,90 @@ +{ + "name": "mastodon-2", + "normal": { + "knife_zero": { + "host": "10.1.1.114" + } + }, + "automatic": { + "fqdn": "mastodon-2", + "os": "linux", + "os_version": "5.4.0-1049-kvm", + "hostname": "mastodon-2", + "ipaddress": "192.168.122.33", + "roles": [ + "mastodon", + "postgresql_client" + ], + "recipes": [ + "kosmos-base", + "kosmos-base::default", + "kosmos_postgresql::hostsfile", + "kosmos-mastodon", + "kosmos-mastodon::default", + "kosmos-mastodon::nginx", + "apt::default", + "timezone_iii::default", + "timezone_iii::debian", + "ntp::default", + "ntp::apparmor", + "kosmos-base::systemd_emails", + "apt::unattended-upgrades", + "kosmos-base::firewall", + "kosmos-postfix::default", + "postfix::default", + "postfix::_common", + "postfix::_attributes", + "postfix::sasl_auth", + "hostname::default", + "kosmos-nodejs::default", + "nodejs::nodejs_from_package", + "nodejs::repo", + "java::default", + "java::set_attributes_from_version", + "java::openjdk", + "java::notify", + "java::default_java_symlink", + "java::set_java_home", + "redisio::default", + "redisio::_install_prereqs", + "redisio::install", + "ulimit::default", + "redisio::disable_os_default", + "redisio::configure", + "redisio::enable", + "nodejs::npm", + "nodejs::install", + "kosmos-nginx::default", + "nginx::default", + "nginx::package", + "nginx::ohai_plugin", + "nginx::repo", + "nginx::commons", + "nginx::commons_dir", + "nginx::commons_script", + "nginx::commons_conf", + "kosmos-nginx::firewall", + "tor-full::default", + "git::default", + "git::package", + "kosmos-base::letsencrypt" + ], + "platform": "ubuntu", + "platform_version": "20.04", + "cloud": null, + "chef_packages": { + "ohai": { + "version": "15.12.0", + "ohai_root": "/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ohai-15.12.0/lib/ohai" + }, + "chef": { + "version": "15.17.4", + "chef_root": "/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.17.4/lib" + } + } + }, + "run_list": [ + "recipe[kosmos-base]", + "role[mastodon]" + ] +} \ No newline at end of file diff --git a/site-cookbooks/kosmos-mastodon/attributes/default.rb b/site-cookbooks/kosmos-mastodon/attributes/default.rb index 0110dfc..e5fb368 100644 --- a/site-cookbooks/kosmos-mastodon/attributes/default.rb +++ b/site-cookbooks/kosmos-mastodon/attributes/default.rb @@ -9,6 +9,8 @@ node.default["kosmos-mastodon"]["sidekiq_threads"] = 25 # Allocate this amount of RAM to the Java heap for Elasticsearch node.default["kosmos-mastodon"]["elasticsearch"]["allocated_memory"] = "1536m" +node.override["redisio"]["version"] = "6.2.6" + node.override["tor"]["HiddenServices"]["mastodon"] = { "HiddenServicePorts" => ["80 127.0.0.1:80", "443 127.0.0.1:443"] } diff --git a/site-cookbooks/kosmos-mastodon/metadata.rb b/site-cookbooks/kosmos-mastodon/metadata.rb index 5885e4e..dc23b66 100644 --- a/site-cookbooks/kosmos-mastodon/metadata.rb +++ b/site-cookbooks/kosmos-mastodon/metadata.rb @@ -8,7 +8,7 @@ version '0.2.1' depends "kosmos-nginx" depends "kosmos-nodejs" -depends "kosmos-redis" +depends 'redisio' depends "poise-ruby-build" depends "application" depends "application_git" diff --git a/site-cookbooks/kosmos-mastodon/recipes/default.rb b/site-cookbooks/kosmos-mastodon/recipes/default.rb index ccb999d..5dcba8b 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/default.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/default.rb @@ -4,8 +4,9 @@ # include_recipe "kosmos-nodejs" -include_recipe "kosmos-redis" include_recipe "java" +include_recipe 'redisio::default' +include_recipe 'redisio::enable' elasticsearch_user 'elasticsearch' diff --git a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq-scheduler.systemd.service.erb b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq-scheduler.systemd.service.erb index 238855d..82d36f4 100644 --- a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq-scheduler.systemd.service.erb +++ b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq-scheduler.systemd.service.erb @@ -1,14 +1,14 @@ [Unit] Description=mastodon-sidekiq-scheduler -Requires=redis-server.service -After=redis-server.service +Requires=redis@6379.service +After=redis@6379.service [Service] Type=simple User=<%= @user %> WorkingDirectory=<%= @app_dir %> Environment="RAILS_ENV=production" -Environment="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1" +Environment="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" ExecStart=<%= @bundle_path %> exec sidekiq -c <%= @sidekiq_threads %> -q scheduler TimeoutSec=15 Restart=always diff --git a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq.systemd.service.erb b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq.systemd.service.erb index e79ef2c..eea08fd 100644 --- a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq.systemd.service.erb +++ b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq.systemd.service.erb @@ -1,7 +1,7 @@ [Unit] Description=mastodon-sidekiq -Requires=redis-server.service -After=redis-server.service +Requires=redis@6379.service +After=redis@6379.service [Service] Type=simple diff --git a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-web.systemd.service.erb b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-web.systemd.service.erb index e6d3c44..59625d0 100644 --- a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-web.systemd.service.erb +++ b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-web.systemd.service.erb @@ -1,7 +1,7 @@ [Unit] Description=mastodon-web -Requires=redis-server.service -After=redis-server.service +Requires=redis@6379.service +After=redis@6379.service [Service] Type=simple