From d935b99d7d55fb74a262b681a28fc231b020e1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Thu, 22 Aug 2024 21:51:49 +0200 Subject: [PATCH] Fix Mastodon signup/password/confirmation links Adds ENV vars for our custom fix in https://gitea.kosmos.org/kosmos/mastodon/commit/b916182bc10aae14b13a772d57586036015f341a fixes #562 --- site-cookbooks/kosmos-mastodon/attributes/default.rb | 6 +++++- site-cookbooks/kosmos-mastodon/recipes/default.rb | 4 ++++ site-cookbooks/kosmos-mastodon/templates/default/env.erb | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/site-cookbooks/kosmos-mastodon/attributes/default.rb b/site-cookbooks/kosmos-mastodon/attributes/default.rb index bd6028b..a7c17ba 100644 --- a/site-cookbooks/kosmos-mastodon/attributes/default.rb +++ b/site-cookbooks/kosmos-mastodon/attributes/default.rb @@ -10,7 +10,7 @@ node.default["kosmos-mastodon"]["redis_url"] = "redis://localhost:6379/0 node.default["kosmos-mastodon"]["sidekiq_threads"] = 25 node.default["kosmos-mastodon"]["allowed_private_addresses"] = "127.0.0.1" -node.default["kosmos-mastodon"]["onion_address"] = nil +node.default["kosmos-mastodon"]["onion_address"] = nil # Allocate this amount of RAM to the Java heap for Elasticsearch node.default["kosmos-mastodon"]["elasticsearch"]["allocated_memory"] = "1536m" @@ -20,6 +20,10 @@ node.default["kosmos-mastodon"]["s3_region"] = nil node.default["kosmos-mastodon"]["s3_bucket"] = nil node.default["kosmos-mastodon"]["s3_alias_host"] = nil +node.default["kosmos-mastodon"]["sso_account_sign_up_url"] = "https://kosmos.org" +node.default["kosmos-mastodon"]["sso_account_reset_password_url"] = "https://accounts.kosmos.org/users/password/new" +node.default["kosmos-mastodon"]["sso_account_resend_confirmation_url"] = "https://accounts.kosmos.org/users/confirmation/new" + node.default["kosmos-mastodon"]["default_locale"] = "en" node.default["kosmos-mastodon"]["libre_translate_endpoint"] = nil diff --git a/site-cookbooks/kosmos-mastodon/recipes/default.rb b/site-cookbooks/kosmos-mastodon/recipes/default.rb index 5c2d3cb..2f57789 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/default.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/default.rb @@ -190,6 +190,7 @@ template "#{mastodon_path}/.env.#{rails_env}" do mode "0640" owner mastodon_user group mastodon_user + sensitive true variables redis_url: node["kosmos-mastodon"]["redis_url"], domain: node["kosmos-mastodon"]["domain"], alternate_domains: node["kosmos-mastodon"]["alternate_domains"], @@ -210,6 +211,9 @@ template "#{mastodon_path}/.env.#{rails_env}" do vapid_public_key: credentials['vapid_public_key'], db_pass: postgresql_credentials['mastodon_user_password'], db_host: "pg.kosmos.local", + sso_account_sign_up_url: node["kosmos-mastodon"]["sso_account_sign_up_url"], + sso_account_reset_password_url: node["kosmos-mastodon"]["sso_account_reset_password_url"], + sso_account_resend_confirmation_url: node["kosmos-mastodon"]["sso_account_resend_confirmation_url"], default_locale: node["kosmos-mastodon"]["default_locale"], allowed_private_addresses: node["kosmos-mastodon"]["allowed_private_addresses"], libre_translate_endpoint: node["kosmos-mastodon"]["libre_translate_endpoint"] diff --git a/site-cookbooks/kosmos-mastodon/templates/default/env.erb b/site-cookbooks/kosmos-mastodon/templates/default/env.erb index 4e1fae1..2178b2b 100644 --- a/site-cookbooks/kosmos-mastodon/templates/default/env.erb +++ b/site-cookbooks/kosmos-mastodon/templates/default/env.erb @@ -44,6 +44,9 @@ LDAP_SEARCH_FILTER='<%= @ldap[:search_filter] %>' LDAP_UID_CONVERSION_ENABLED=<%= @ldap[:uid_conversion_enabled] %> LDAP_UID_CONVERSION_SEARCH=<%= @ldap[:uid_conversion_search] %> LDAP_UID_CONVERSION_REPLACE=<%= @ldap[:uid_conversion_replace] %> +SSO_ACCOUNT_SIGN_UP=<%= @sso_account_sign_up_url %> +SSO_ACCOUNT_RESET_PASSWORD=<%= @sso_account_reset_password_url %> +SSO_ACCOUNT_RESEND_CONFIRMATION=<%= @sso_account_resend_confirmation_url %> <% end %> # Optional asset host for multi-server setups