Bug 227394 - www/moinmoin: Add reCAPTCHA v2 support (Cannot create wiki account: reCAPTCHA v1 no longer supported)
Summary: www/moinmoin: Add reCAPTCHA v2 support (Cannot create wiki account: reCAPTCHA...
Status: Closed FIXED
Alias: None
Product: Services
Classification: Unclassified
Component: Wiki (show other bugs)
Version: unspecified
Hardware: Any Any
: --- Affects Many People
Assignee: Kubilay Kocak
URL: https://wiki.freebsd.org/WikiFixitGro...
Keywords: dogfood, patch, regression
: 228453 229823 (view as bug list)
Depends on:
Blocks: 230173
  Show dependency treegraph
 
Reported: 2018-04-09 18:47 UTC by Ali Mashtizadeh
Modified: 2019-02-02 23:12 UTC (History)
12 users (show)

See Also:


Attachments
reCAPTCHA v2 patch (15.15 KB, patch)
2018-05-02 03:50 UTC, daz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Mashtizadeh 2018-04-09 18:47:59 UTC
reCAPTCHA v1 was retired and the wiki needs to upgrade to v2 so folks can register accounts.

https://developers.google.com/recaptcha/docs/faq#what-happens-to-recaptcha-v1
Comment 1 daz 2018-05-02 03:50:28 UTC
Created attachment 192986 [details]
reCAPTCHA v2 patch

This is an update for the www/moinmoin port bringing support for reCAPTCHA v2.

After 0mp@ provided me with some basic information about the issue and related
patches[1] I was able to build on those patches and integrate reCAPTCHA v2
support into MoinMoin.

We've tested it on a demo system running Nginx and uWSGI. Everything seems to
work fine after getting a reCAPTCHA key pair from Google and putting them into
/usr/local/www/wiki/wikiconfig.py as "recaptcha_site_key" and
"recaptcha_secret_key".


QA: 
 - poudriere testport 11.1 amd64
 - manual testing on 12.0-current r333017

[1]:  https://gist.github.com/tfoote/675b98df53369e199dea
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-05-02 03:51:44 UTC
(In reply to daz from comment #1)

I confirm.
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-02 04:25:31 UTC
Investigation today revealed the production wiki installation is:

- based on a customised moinmoin package
- created by/sourced [1] from cluster admin (ports/pkg repository), that 
- adds (patches in) recaptcha support which leverages python-recaptcha [1],
- very likely (based on code inspection/file headers) sourced from the same place mentioned in comment 1

[1] See Also: Bug 204245 Comment 2
[2] probably via RUN_DEPENDS on https://www.freshports.org/www/py-recaptcha/

As a python (moinnmoin port maintainer) and wiki-admin team member (deployment), I'll take this issue to resolution

@Daz Now that we know the origin of the original function, the next step was to look for options to fix or replace it, so this is a very timely patch. Thank you for contributing the fix, and Mateusz for pushing it forward
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-02 04:36:49 UTC
Need to confirm that the existing API keys used in the current configuration will work with the v2 API, and if not, arrange for a new set of API keys to be created, potentially requiring handover of existing recaptcha account credentials from clusteradm, or failing that, creation of a new/separate account (if for instance the same keys are used for other FreeBSD services)
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2018-05-31 15:17:48 UTC
*** Bug 228453 has been marked as a duplicate of this bug. ***
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2018-07-17 14:56:43 UTC
*** Bug 229823 has been marked as a duplicate of this bug. ***
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2018-07-18 04:01:11 UTC
Update to www/moinmoin integrating attachment 192986 [details], combined into a single patch, and a patch adding email verification (provided by clusteradm, currently a custom port patch) is available https://reviews.freebsd.org/D16315

Progress pending:

- Testing specifically of upgrade process from existing port revision for regression.

- Response from clusteradm (gavin, via IRC) on how to proceed (method, timing) with the upgrade (creation) of v2 API keys, which will be tracked as a subtask of, and dependent on resolution (commit) of this issue, once clarified.
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2018-07-18 04:05:55 UTC
Comment on attachment 192986 [details]
reCAPTCHA v2 patch

Integrated into review with other additions/changes
Comment 9 Samy Mahmoudi 2018-07-18 07:12:46 UTC
(In reply to Kubilay Kocak from comment #7)
Thank you for that information.
Comment 10 commit-hook freebsd_committer freebsd_triage 2018-07-30 00:06:22 UTC
A commit references this bug:

Author: koobs
Date: Mon Jul 30 00:05:21 UTC 2018
New revision: 475859
URL: https://svnweb.freebsd.org/changeset/ports/475859

Log:
  www/moinmoin: Add recaptcha v2 and email verification support

  Add patches to include:

     - reCAPTCHA v2 support [1]
     - Email verification for new account creation [2]

  Both patches are OPTION'al, both OPTIONS are enabled by default. Both features
  require additional configuration (within moinmoin) to enable them within wiki
  instances.

  While I'm here:

    - Use TLS for MASTER_SITES and pkg-descr WWW: URLs
    - Update COMMENT to match setup.py description
    - Enable NO_ARCH
    - Sort sections

  PR:			227394 [1]
  Submitted by:		<daz hackerspace pl> [1]
  Reviewed by:		0mp
  Tested by:		0mp (upgrade process)
  Approved by:		koobs (python, maintainer)
  Obtained from:		clusteradm (sbruno, custom patch to port) [2]
  Differential Revision:	D16315

Changes:
  head/www/moinmoin/Makefile
  head/www/moinmoin/files/extra-patch-recaptchav2
  head/www/moinmoin/files/extra-patch-verifyemail
  head/www/moinmoin/files/patch-setup.py
  head/www/moinmoin/pkg-descr
  head/www/moinmoin/pkg-plist
Comment 11 Samy Mahmoudi 2019-02-02 23:12:27 UTC
Hi all,

Despite the work accomplished on www/moinmoin, it seems account creation is still not possible on the FreeBSD wiki.