From 28767a548629cbc929414a43769f166bb55eff61 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sat, 20 Aug 2016 14:29:29 +0000 Subject: [PATCH] Switch from old recaptcha to recaptcha-nocaptcha The newer recaptcha-nocaptcha implementation is a little better at thwarting script-driven spammers and vandals, so switch to it. Leave the parameter names for the old recaptcha implementation in place until our consumer in the openstack_project::wiki class no longer attempts to set it. Change-Id: I435484cd65a028d774dfd920ca19f3077d4e03fb --- manifests/init.pp | 6 ++++-- templates/Settings.php.erb | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 4d0a11b..e253a9b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -12,8 +12,10 @@ class mediawiki( $ssl_chain_file_contents = undef, $ssl_key_file = undef, $ssl_key_file_contents = undef, - $wg_recaptchapublickey = undef, - $wg_recaptchaprivatekey = undef, + $wg_recaptchapublickey = undef, # TODO: remove (no longer used) + $wg_recaptchaprivatekey = undef, # TODO: remove (no longer used) + $wg_recaptchasitekey = undef, + $wg_recaptchasecretkey = undef, $wg_googleanalyticsaccount = undef, $wg_dbserver = 'localhost', $wg_dbname = 'openstack_wiki', diff --git a/templates/Settings.php.erb b/templates/Settings.php.erb index a1b0304..b28e304 100644 --- a/templates/Settings.php.erb +++ b/templates/Settings.php.erb @@ -189,12 +189,11 @@ $wgNamespacesWithSubpages[110] = true; # https://www.mediawiki.org/wiki/Extension:QuestyCaptcha require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" ); -#Enable ReCaptcha -require_once "$IP/extensions/ConfirmEdit/ReCaptcha.php"; - -$wgCaptchaClass = 'ReCaptcha'; -$wgReCaptchaPublicKey = "<%= @wg_recaptchapublickey %>"; -$wgReCaptchaPrivateKey = "<%= @wg_recaptchaprivatekey %>"; +#Enable ReCaptchaNoCaptcha +wfLoadExtensions( array( 'ConfirmEdit', 'ConfirmEdit/ReCaptchaNoCaptcha' ) ); +$wgCaptchaClass = 'ReCaptchaNoCaptcha'; +$wgReCaptchaSiteKey = "<%= @wg_recaptchasitekey %>"; +$wgReCaptchaSecretKey = "<%= @wg_recaptchasecretkey %>"; $wgMainCacheType = CACHE_ANYTHING; $wgCaptchaTriggers['edit'] = true;