]> git.openstreetmap.org Git - chef.git/commitdiff
wiki: Switch Captcha to Turnstile master
authorGrant Slater <github@firefishy.com>
Thu, 5 Feb 2026 21:16:36 +0000 (21:16 +0000)
committerGrant Slater <github@firefishy.com>
Thu, 5 Feb 2026 21:16:36 +0000 (21:16 +0000)
cookbooks/mediawiki/resources/site.rb
cookbooks/mediawiki/templates/default/mw-ext-ConfirmEdit.inc.php.erb
cookbooks/wiki/recipes/default.rb
test/data_bags/wiki/passwords.json

index 760e152df71a7bf744fb3713b027eeb0c7845d45..1efa54d5cd37b089a76a58ae298f4ee5e3027a20 100644 (file)
@@ -41,8 +41,8 @@ property :admin_user, :kind_of => String, :default => "Admin"
 property :admin_password, :kind_of => String, :required => [:create]
 property :private_accounts, :kind_of => [TrueClass, FalseClass], :default => false
 property :private_site, :kind_of => [TrueClass, FalseClass], :default => false
-property :hcaptcha_public_key, :kind_of => String, :default => ""
-property :hcaptcha_private_key, :kind_of => String, :default => ""
+property :turnstile_site_key, :kind_of => String, :default => ""
+property :turnstile_secret_key, :kind_of => String, :default => ""
 property :extra_file_extensions, :kind_of => [String, Array], :default => []
 property :namespaces, :kind_of => Hash, :default => {}
 property :force_ui_messages, :kind_of => Array, :default => []
@@ -243,8 +243,8 @@ action :create do
     mediawiki_extension "ConfirmEdit" do
       site new_resource.site
       template "mw-ext-ConfirmEdit.inc.php.erb"
-      variables :public_key => new_resource.hcaptcha_public_key,
-                :private_key => new_resource.hcaptcha_private_key
+      variables :turnstile_site_key => new_resource.turnstile_site_key,
+                :turnstile_secret_key => new_resource.turnstile_secret_key
       update_site false
     end
   end
index 2e0af37bab4520d2a46cd754620e7a1de43afd1b..4dd46cf4c3fcd89ff440d5a728579bc1fa41d02d 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 # DO NOT EDIT - This file is being maintained by Chef
-wfLoadExtensions( array( 'ConfirmEdit', 'ConfirmEdit/hCaptcha' ) );
-$wgHCaptchaSendRemoteIP = true;
-$wgHCaptchaSiteKey = '<%= @public_key %>';
-$wgHCaptchaSecretKey = '<%= @private_key %>';
+wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/Turnstile' ]);
+$wgCaptchaClass = MediaWiki\Extension\ConfirmEdit\Turnstile\Turnstile::class;
+
+$wgTurnstileSiteKey= '<%= @turnstile_site_key %>';
+$wgTurnstileSecretKey= '<%= @turnstile_secret_key %>';
+$wgTurnstileSendRemoteIP = true;
 
 $wgGroupPermissions['autoconfirmed']['skipcaptcha'] = true;
 $wgGroupPermissions['bot'          ]['skipcaptcha'] = true;
index c80c439b032824d115556d1771b5b3f334eede69..eb19ce6905062beffe6df5ca3c50746342947bce 100644 (file)
@@ -54,8 +54,8 @@ mediawiki_site site_name do
 
   metanamespace "Wiki"
 
-  hcaptcha_public_key "b67a410b-955e-4049-b432-f9c00e0202c0"
-  hcaptcha_private_key passwords["hcaptcha"]
+  turnstile_site_key passwords["turnstile_site_key"]
+  turnstile_secret_key passwords["turnstile_secret_key"]
 
   namespaces "DE" => { :id => 200, :talk_id => 201 },
              "FR" => { :id => 202, :talk_id => 203 },
index 961e60f96726e8f94787888bff92849791d55ecb..ff95f6c318f20b703f13ca5a8110d6ecec947d66 100644 (file)
@@ -1,6 +1,7 @@
 {
   "database": "database_password",
   "admin": "admin_password",
-  "hcaptcha": "precaptcha_token",
-  "thunderforest": "thunderforest_token"
+  "thunderforest": "thunderforest_token",
+  "turnstile_site_key": "turnstile_site_key_value",
+  "turnstile_secret_key": "turnstile_secret_key_value"
 }