Awjrichards has submitted this change and it was merged.
Change subject: Use FancyCaptcha in ConfirmEdit
......................................................................
Use FancyCaptcha in ConfirmEdit
That's what we currently use in production.
Change-Id: I8544c32871da73d6199a75a0ba70a0e3a6543ebe
---
M puppet/manifests/roles/confirmedit.pp
M puppet/modules/python/manifests/pil.pp
2 files changed, 29 insertions(+), 3 deletions(-)
Approvals:
Awjrichards: Verified; Looks good to me, approved
diff --git a/puppet/manifests/roles/confirmedit.pp
b/puppet/manifests/roles/confirmedit.pp
index 0ac7128..8a2604d 100644
--- a/puppet/manifests/roles/confirmedit.pp
+++ b/puppet/manifests/roles/confirmedit.pp
@@ -5,8 +5,24 @@
# to guess passwords.
class role::confirmedit {
include role::mediawiki
+ include python::pil
mediawiki::extension { 'ConfirmEdit':
- settings => { wgCaptchaClass => 'SimpleCaptcha' },
+ before => Exec['generate FancyCaptcha images']
+ }
+
+ mediawiki::settings { 'ConfirmEdit FancyCaptcha':
+ values => {
+ wgCaptchaClass => 'FancyCaptcha',
+ wgCaptchaDirectory => '$IP/images/temp/captcha',
+ wgCaptchaDirectoryLevels => 0,
+ wgCaptchaSecret => 'FOO',
+ },
+ header => 'require_once
"$IP/extensions/ConfirmEdit/FancyCaptcha.php";',
+ }
+
+ exec { 'generate FancyCaptcha images':
+ command => 'echo "hello\nworld\n" > /tmp/words; mkdir -p
../../images/temp/captcha; python captcha.py
--font=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
--wordlist=/tmp/words --key=FOO --output=../../images/temp/captcha --count=2',
+ cwd => '/vagrant/mediawiki/extensions/ConfirmEdit',
}
}
diff --git a/puppet/modules/python/manifests/pil.pp
b/puppet/modules/python/manifests/pil.pp
index 3c787eb..04aa2da 100644
--- a/puppet/modules/python/manifests/pil.pp
+++ b/puppet/modules/python/manifests/pil.pp
@@ -8,6 +8,8 @@
include ::python::dev
package { 'zlib1g-dev': }
+ # needed for ConfirmEdit's FancyCaptcha
+ package { 'libfreetype6-dev': }
# Workaround for 'pip install pil' failing to find libz.so and thus
# installing without zlib support. See <http://goo.gl/eWJc24>.
@@ -17,12 +19,20 @@
require => Package['zlib1g-dev'],
}
+ # Workaround for 'pip install pil' failing to find libfreetype.so and
+ # thus installing without freetype support. See <http://goo.gl/eWJc24>.
+ file { '/usr/lib/libfreetype.so':
+ ensure => link,
+ target => "/usr/lib/${::hardwaremodel}-linux-gnu/libfreetype.so",
+ require => Package['libfreetype6-dev'],
+ }
+
package { 'PIL':
ensure => '1.1.7',
provider => 'pip',
require => [
- Package['python-dev', 'zlib1g-dev'],
- File['/usr/lib/libz.so'],
+ Package['python-dev', 'zlib1g-dev', 'libfreetype6-dev'],
+ File['/usr/lib/libz.so', '/usr/lib/libfreetype.so'],
],
}
}
--
To view, visit https://gerrit.wikimedia.org/r/132749
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8544c32871da73d6199a75a0ba70a0e3a6543ebe
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: JGonera <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits