Skip to content

[18.0][ADD] website_altcha - #1175

Merged
OCA-git-bot merged 2 commits into
OCA:18.0from
dixmit:18.0-add-website_altcha
May 31, 2026
Merged

OCA-git-bot merged 2 commits into
OCA:18.0from
dixmit:18.0-add-website_altcha

Conversation

@etobella

Copy link
Copy Markdown
Member

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:

  • 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.

The way to solve it is to add a deterministic puzzle to solve. Bots need
to spend more CPU, making it costly at scale.

@etobella
etobella force-pushed the 18.0-add-website_altcha branch from 71aadf4 to 842051e Compare April 15, 2026 07:28

@luisDIXMIT luisDIXMIT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am testing on runboat, system params are setted but I don't understand why it gives me "Verification failed. Try again later." error. I am doing it from "contact us" page on website.
image

@etobella
etobella force-pushed the 18.0-add-website_altcha branch from 842051e to d4f3616 Compare April 15, 2026 08:25
@etobella

Copy link
Copy Markdown
Member Author

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)

@luisDIXMIT

Copy link
Copy Markdown
Contributor

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 luisDIXMIT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review and tested on runboat, LGTM!

@etobella
etobella force-pushed the 18.0-add-website_altcha branch from d4f3616 to 916c261 Compare April 15, 2026 10:49
@etobella
etobella force-pushed the 18.0-add-website_altcha branch from 916c261 to 41da999 Compare April 24, 2026 13:55
@etobella

Copy link
Copy Markdown
Member Author

I made a major change, allowing to configure this for each website (much simpler to handle)

@etobella
etobella force-pushed the 18.0-add-website_altcha branch 3 times, most recently from ad3850b to 7e766f4 Compare April 29, 2026 15:57

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread website_altcha/models/website.py Outdated
Comment on lines +42 to +45
("SCRYPT", "SCRYPT (memory hard)"),
]
if argon2:
result.append(("ARGON2ID", "ARGON2ID (memory hard, recommended)"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

Comment thread website_altcha/readme/DESCRIPTION.md Outdated
@@ -0,0 +1,15 @@
This module allows to use a Captcha System completly handled by Odoo.

It relies on Altcha, an OpenSource captcha alternative.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It relies on Altcha, an OpenSource captcha alternative.
It relies on Altcha (https://altcha.org), an OpenSource captcha alternative.

Comment thread website_altcha/readme/DESCRIPTION.md Outdated
Comment on lines +5 to +12
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can go to CONTEXT.md I think

Comment thread website_altcha/readme/CONFIGURE.md Outdated
Comment on lines +12 to +13
- Memory Hard: `SCRYPT`
- Memory Hard (it required argon2-cffi): `ARGON2ID`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

Comment thread website_altcha/__manifest__.py Outdated
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Website Friendly Captcha",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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

Comment thread website_altcha/__manifest__.py Outdated

{
"name": "Website Friendly Captcha",
"summary": """Use Friendly Captcha for verifying users""",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"summary": """Use Friendly Captcha for verifying users""",
"summary": """Use self hosted privacy friendly captcha for verifying website users are not bots""",

Comment thread website_altcha/readme/CONFIGURE.md Outdated
@@ -0,0 +1,16 @@
On each website, some extra parameters will appear with all the altcha information

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should start with: Go to Configuration/Website, check "Enable Altcha" under "Privacy"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, and they style their name ALTCHA, so I suggest to s/Altcha/ALTCHA in all user visible texts

@etobella
etobella force-pushed the 18.0-add-website_altcha branch 2 times, most recently from cc2abba to 449f19d Compare May 29, 2026 07:36
@etobella

Copy link
Copy Markdown
Member Author

@hbrunn All comments attended.

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you point me to where this function is used?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etobella this seems to be the problem, why not render here website_altcha.AltchaWidget?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this._altcha._publicKey && !this.$el.find(".altcha-widget").length) {
if (this._altcha._publicKey && !this.$el.find(".o_altcha-widget").length) {

@etobella
etobella force-pushed the 18.0-add-website_altcha branch from 449f19d to a10d885 Compare May 29, 2026 11:49
@etobella

Copy link
Copy Markdown
Member Author

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 hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough, then we leave it like that. do you need this to be three commits or can it be just one?

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@etobella
etobella force-pushed the 18.0-add-website_altcha branch from a10d885 to 2118c0f Compare May 29, 2026 13:37
@etobella

Copy link
Copy Markdown
Member Author

2 because there is 2 different authors 😉

@hbrunn

hbrunn commented May 29, 2026

Copy link
Copy Markdown
Member

thanks

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 18.0-ocabot-merge-pr-1175-by-hbrunn-bump-nobump, awaiting test results.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@hbrunn The merge process could not be finalized, because command twine upload --disable-progress-bar --non-interactive --repository-url https://upload.pypi.org/legacy/ -u __token__ odoo_addon_website_altcha-18.0.1.0.0.3-py3-none-any.whl failed with output:

Uploading distributions to https://upload.pypi.org/legacy/
Uploading odoo_addon_website_altcha-18.0.1.0.0.3-py3-none-any.whl
�[33mWARNING �[0m Error during upload. Retry with the --verbose option for more details. 
�[31mERROR   �[0m HTTPError: 429 Too Many Requests from https://upload.pypi.org/legacy/  
         Too Many Requests                                                      

@etobella

Copy link
Copy Markdown
Member Author

I will try tomorrow... the problem with pypi...

@tarteo tarteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, tested it locally! Only nitpicking so code LGTM!

Comment thread website_altcha/static/src/signup/signup.esm.js Outdated
Comment thread website_altcha/README.rst Outdated

- 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean GDPR?

Comment thread website_altcha/models/altcha_key.py Outdated

class AltchaKey(models.Model):
_name = "altcha.key"
_description = "Altcha Key" # TODO

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is TODO here? I think it can be removed.

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
placeholder="00000000-0000-0000-0000-000000000000"

<div class="mt16" invisible="not altcha_enabled">
<label
class="col-md-3 o_light_label"
string="Tracking ID"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
string="Tracking ID"
string="HMAC secret"

<div class="mt16" invisible="not altcha_enabled">
<label
class="col-md-3 o_light_label"
string="Private Key"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
string="Private Key"
string="HMAC key secret"

@etobella
etobella force-pushed the 18.0-add-website_altcha branch from f87f0e6 to 7d8857c Compare May 30, 2026 20:27
@etobella

Copy link
Copy Markdown
Member Author

Comments attended.

@hbrunn

hbrunn commented May 31, 2026

Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-1175-by-hbrunn-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 1733315 into OCA:18.0 May 31, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 8b0c109. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants