[18.0][ADD] website_altcha#1175
Conversation
71aadf4 to
842051e
Compare
842051e to
d4f3616
Compare
|
The problem is that it requires https to work. If you change to https it should work (tested in runboat). In local there is not such a limitation when using localhost (only on localhost) |
It works, thanks! |
luisDIXMIT
left a comment
There was a problem hiding this comment.
Code review and tested on runboat, LGTM!
d4f3616 to
916c261
Compare
916c261 to
41da999
Compare
|
I made a major change, allowing to configure this for each website (much simpler to handle) |
ad3850b to
7e766f4
Compare
hbrunn
left a comment
There was a problem hiding this comment.
funny, I just came here to propose this for version 16, but as yours has seniority, I'll backport this instead when done.
Do you think the module could have an init hook that enables it for all websites? Seems a bit nonsensical for users to have to do this manually, as they'll install the module because they want to have it, right?
| ("SCRYPT", "SCRYPT (memory hard)"), | ||
| ] | ||
| if argon2: | ||
| result.append(("ARGON2ID", "ARGON2ID (memory hard, recommended)")) |
There was a problem hiding this comment.
those two aren't included in the JS file, so I don't see how those choices can work (and expectedly selecting scrypt doesn't work on runbot). I think it's fine to remove them for version 1
| @@ -0,0 +1,2 @@ | |||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | |||
| access_altcha_key,access_altcha_key,website_altcha.model_altcha_key,base.group_user,1,0,0,0 | |||
There was a problem hiding this comment.
| access_altcha_key,access_altcha_key,website_altcha.model_altcha_key,base.group_user,1,0,0,0 | |
| access_altcha_key,access_altcha_key,website_altcha.model_altcha_key,base.group_system,1,0,0,0 |
as all access to this is sudo'd, no need for users to have access, right?
| @@ -0,0 +1,15 @@ | |||
| This module allows to use a Captcha System completly handled by Odoo. | |||
|
|
|||
| It relies on Altcha, an OpenSource captcha alternative. | |||
There was a problem hiding this comment.
| It relies on Altcha, an OpenSource captcha alternative. | |
| It relies on Altcha (https://altcha.org), an OpenSource captcha alternative. |
| Currently, Odoo provides 2 options: | ||
|
|
||
| - Google Recaptcha relies on tracking of the user. It implies cookies | ||
| - Cloudfare Turnstile relies on signals of the browser so it is less RGDP problematic. | ||
| However, it relies on a third party infrastructure. | ||
| The decision is made from a probabilistic perspective (likely a human) | ||
|
|
||
| With this new module, everything relies on our own system with no cookies, no tracking and no network calls. |
There was a problem hiding this comment.
this can go to CONTEXT.md I think
| - Memory Hard: `SCRYPT` | ||
| - Memory Hard (it required argon2-cffi): `ARGON2ID` |
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| { | ||
| "name": "Website Friendly Captcha", |
There was a problem hiding this comment.
| "name": "Website Friendly Captcha", | |
| "name": "Privacy Friendly Captcha", |
the point is that this is privacy friendly and self hosted, not friendly as in nice i think
|
|
||
| { | ||
| "name": "Website Friendly Captcha", | ||
| "summary": """Use Friendly Captcha for verifying users""", |
There was a problem hiding this comment.
| "summary": """Use Friendly Captcha for verifying users""", | |
| "summary": """Use self hosted privacy friendly captcha for verifying website users are not bots""", |
| @@ -0,0 +1,16 @@ | |||
| On each website, some extra parameters will appear with all the altcha information | |||
There was a problem hiding this comment.
this should start with: Go to Configuration/Website, check "Enable Altcha" under "Privacy"
There was a problem hiding this comment.
ah, and they style their name ALTCHA, so I suggest to s/Altcha/ALTCHA in all user visible texts
cc2abba to
449f19d
Compare
|
@hbrunn All comments attended. |
There was a problem hiding this comment.
thanks, what do you think about activating this on installation though?
and I just tried to test password reset and signup on runbot, here the widget shows an error even though it works fine for the contact form. any idea what's going on there?
| * @param {String} action | ||
| * @returns {Promise|Object} | ||
| */ | ||
| async getToken(action) { |
There was a problem hiding this comment.
can you point me to where this function is used?
There was a problem hiding this comment.
I think it comes from the first implementation. I will remove it.
| this.$el | ||
| .find("div.oe_login_buttons") | ||
| .prepend( | ||
| '<altcha-widget class="pb-2 o_altcha_widget" challengeurl="/altcha"></altcha-widget>' |
There was a problem hiding this comment.
@etobella this seems to be the problem, why not render here website_altcha.AltchaWidget?
There was a problem hiding this comment.
btw in my version I named the controller /website_altcha/challenge to scope stuff with the module name
| return this._super(...arguments); | ||
| }, | ||
| start: function () { | ||
| if (this._altcha._publicKey && !this.$el.find(".altcha-widget").length) { |
There was a problem hiding this comment.
| if (this._altcha._publicKey && !this.$el.find(".altcha-widget").length) { | |
| if (this._altcha._publicKey && !this.$el.find(".o_altcha-widget").length) { |
449f19d to
a10d885
Compare
|
I am not confident about the pre_init change. It might happend that your customer is already using a recaptcha system, so forcing it mitght be a problem. |
hbrunn
left a comment
There was a problem hiding this comment.
fair enough, then we leave it like that. do you need this to be three commits or can it be just one?
|
This PR has the |
a10d885 to
2118c0f
Compare
|
2 because there is 2 different authors 😉 |
|
thanks /ocabot merge nobump |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
@hbrunn The merge process could not be finalized, because command |
|
I will try tomorrow... the problem with pypi... |
tarteo
left a comment
There was a problem hiding this comment.
Great, tested it locally! Only nitpicking so code LGTM!
| publicWidget.registry.SignupAltcha = publicWidget.Widget.extend({ | ||
| ...AltchaFunctionality, | ||
| selector: ".oe_signup_form", | ||
| tokenName: "signup", |
|
|
||
| - Google Recaptcha relies on tracking of the user. It implies cookies | ||
| - Cloudfare Turnstile relies on signals of the browser so it is less | ||
| RGDP problematic. However, it relies on a third party infrastructure. |
|
|
||
| class AltchaKey(models.Model): | ||
| _name = "altcha.key" | ||
| _description = "Altcha Key" # TODO |
There was a problem hiding this comment.
What is TODO here? I think it can be removed.
hbrunn
left a comment
There was a problem hiding this comment.
as you have to touch this anyways again for the typo, I added a few UI things I came across when backporting this to v16
| <field | ||
| name="altcha_algorithm" | ||
| required="altcha_enabled" | ||
| placeholder="00000000-0000-0000-0000-000000000000" |
There was a problem hiding this comment.
| placeholder="00000000-0000-0000-0000-000000000000" |
| <div class="mt16" invisible="not altcha_enabled"> | ||
| <label | ||
| class="col-md-3 o_light_label" | ||
| string="Tracking ID" |
There was a problem hiding this comment.
| string="Tracking ID" | |
| string="HMAC secret" |
| <div class="mt16" invisible="not altcha_enabled"> | ||
| <label | ||
| class="col-md-3 o_light_label" | ||
| string="Private Key" |
There was a problem hiding this comment.
| string="Private Key" | |
| string="HMAC key secret" |

This module allows to use a Captcha System completly handled by Odoo.
It relies on Altcha, an OpenSource captcha alternative.
Currently, Odoo provides 2 options:
RGDP problematic. However, it relies on a third party infrastructure.
The decision is made from a probabilistic perspective (likely a human)
With this new module, everything relies on our own system with no
cookies, no tracking and no network calls.
The way to solve it is to add a deterministic puzzle to solve. Bots need
to spend more CPU, making it costly at scale.