Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e054c04
[ADD] website_altcha: Add module
luisDIXMIT Apr 8, 2026
70b2a97
[IMP] website_altcha: From v1 to v2, add tests & improve speed
etobella Apr 14, 2026
bf26ea6
[UPD] Update website_altcha.pot
May 31, 2026
015b7ab
[BOT] post-merge updates
OCA-git-bot May 31, 2026
51261a1
Added translation using Weblate (Italian)
mymage Jun 3, 2026
3a790b6
Translated using Weblate (Italian)
mymage Jun 3, 2026
542120b
[DEL] website_altcha: unnecessary modification of upstream file
hbrunn Jul 3, 2026
9f8038f
[RFR] website_altcha: base test case
hbrunn Jul 3, 2026
9345783
[RFR] website_altcha: make it easier to extend & customize
hbrunn Jul 3, 2026
8976006
[IMP] website_altcha: add hbrunn as maintainer
hbrunn Jul 3, 2026
b4d2303
[FIX] website_altcha: Add sitemap value for `/altcha` route
tarteo Jul 3, 2026
73706ea
[BOT] post-merge updates
OCA-git-bot Jul 8, 2026
96e00b2
Added translation using Weblate (French)
thibaultrey Aug 11, 2026
72d3cac
Translated using Weblate (French)
thibaultrey Aug 11, 2026
e25f467
[UPD] Update website_altcha.pot
Sep 2, 2026
8380a4d
[BOT] post-merge updates
OCA-git-bot Sep 2, 2026
e66d884
Update translation files
weblate Sep 2, 2026
b6c765e
Translated using Weblate (Italian)
mymage Sep 21, 2026
aff85f6
[FIX] website_altcha: don't show altcha payload in form submission
jans23 Sep 22, 2026
fd12ffe
[BOT] post-merge updates
OCA-git-bot Oct 5, 2026
dc8dfb1
[FIX] website_altcha: remove parent too on edition
etobella Oct 7, 2026
9eddcc8
[BOT] post-merge updates
OCA-git-bot Oct 7, 2026
bf8f2a5
[IMP] website_altcha: allow appending the widget
jans23 Sep 25, 2026
323b4f5
[BOT] post-merge updates
OCA-git-bot Oct 19, 2026
fed1195
[IMP] website_altcha: pre-commit auto fixes
luisDIXMIT Oct 22, 2026
25dff90
[MIG] website_altcha: Migration to 19.0
luisDIXMIT Oct 26, 2026
4955f9e
[IMP] website_altcha: update altcha version
luisDIXMIT Oct 28, 2026
2eb5b6f
[FIX] website_altcha: add altcha to login form
luisDIXMIT Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# generated from manifests external_dependencies
altcha
146 changes: 146 additions & 0 deletions website_altcha/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

========================
Privacy Friendly Captcha
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:cdd185c7f6efad7c31edada25c3a0b434eeeb6ac9cdec6dbbfc41f1c0d5da090
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
:target: https://github.com/OCA/website/tree/19.0/website_altcha
:alt: OCA/website
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/website-19-0/website-19-0-website_altcha
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to use a Captcha System completly handled by Odoo.

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

Third-party libraries
~~~~~~~~~~~~~~~~~~~~~

- `ALTCHA <https://github.com/altcha-org/altcha>`__ **v3.5.0** (MIT
License), updated on 2026-10-28. Vendored file:
```dist/main/altcha.i18n.js`` <https://github.com/altcha-org/altcha/blob/v3.5.0/dist/main/altcha.i18n.js>`__

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

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

Configuration
=============

Go to Configuration/Website, check "Enable Altcha" under "Privacy". Some
extra parameters will appear with all the ALTCHA information. This
parameters are website dependent.

- ``altcha_key``: This key is made to create the challenge and review it
later

Also, the system adds the option to use some extra parameters:

- ``altcha_secret_key``: Key used to use deterministic mode. Using it
will make it faster from a server perspective.
- ``altcha_algorithm``: Algorithm used, by default ``PBKDF2/SHA-512``,
however, we can use:

- Fast ones only for testing purposes: ``SHA-256``, ``SHA-384``,
``SHA-512``
- Good by default: ``PBKDF2/SHA-256``, ``PBKDF2/SHA-384``,
``PBKDF2/SHA-512``
- Memory Hard: ``SCRYPT``. To be implemented
- Memory Hard (it required argon2-cffi): ``ARGON2ID``. To be
implemented

- ``altcha_timeout``: Number of minutes that we will trust the key, by
default 5
- ``altcha_cost``: Cost of the challenge. By default, 5000

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/website/issues/new?body=module:%20website_altcha%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Dixmit

Contributors
------------

- `Dixmit <https://www.dixmit.com>`__

- Enric Tobella
- Luís David Rodríguez

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-hbrunn| image:: https://github.com/hbrunn.png?size=40px
:target: https://github.com/hbrunn
:alt: hbrunn

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-hbrunn|

This module is part of the `OCA/website <https://github.com/OCA/website/tree/19.0/website_altcha>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions website_altcha/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import models
40 changes: 40 additions & 0 deletions website_altcha/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2025 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Privacy Friendly Captcha",
"summary": """Use self hosted privacy friendly captcha for
verifying website users are not bots""",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "Dixmit,Odoo Community Association (OCA)",
"maintainers": ["hbrunn"],
"website": "https://github.com/OCA/website",
"depends": [
"website",
],
"assets": {
"web.assets_frontend": [
"website_altcha/static/src/*.esm.js",
"website_altcha/static/src/*.xml",
"website_altcha/static/src/*.scss",
],
"web.altcha_libs": [
"website_altcha/static/lib/altcha.i18n.js",
"website_altcha/static/lib/altcha.css",
],
"web.assets_tests": [
"website_altcha/static/tests/tours/*.esm.js",
],
},
"external_dependencies": {
"python": ["altcha"],
},
"data": [
"security/ir.model.access.csv",
"views/res_config_settings_views.xml",
],
"demo": [
"demo/website_page.xml",
],
}
1 change: 1 addition & 0 deletions website_altcha/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import altcha
39 changes: 39 additions & 0 deletions website_altcha/controllers/altcha.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import json
import secrets
from datetime import timedelta

import altcha.v2 as altcha

from odoo import fields, http
from odoo.http import request


class AltchaController(http.Controller):
@http.route("/altcha", type="http", auth="public", website=True, sitemap=False)
def generate_altcha_challenge(self):
timeout = int(request.website.sudo().altcha_timeout or 5)
cost = int(request.website.sudo().altcha_cost or 1_000)
algorithm = request.website.sudo().altcha_algorithm or "PBKDF2/SHA-512"
expires = fields.Datetime.now() + timedelta(minutes=timeout)
key = request.website.sudo().altcha_key
secret_key = request.website.sudo().altcha_private_key
parameters = {
"algorithm": algorithm,
"cost": cost,
"hmac_secret": key,
"expires_at": expires,
}
if secret_key:
parameters["hmac_key_secret"] = secret_key
parameters["counter"] = secrets.randbelow(cost) + cost
challenge = altcha.create_challenge(**parameters)
request.env["altcha.key"].sudo().create(
{
"key": request.env["ir.http"]._get_altcha_key(challenge.signature),
"expires_at": expires,
}
)
return request.make_response(
json.dumps(challenge.to_dict()),
headers=[("Content-Type", "application/json")],
)
36 changes: 36 additions & 0 deletions website_altcha/demo/website_page.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<odoo>
<template id="demo_page_view">
<t t-call="website.layout">
<form class="website_altcha_form">
<p>
This is a demo form for website_altcha. Note how it automatically inserts the widget in the container containing the submit button
</p>
<div>
<button type="submit">Submit</button>
</div>
</form>
<form class="website_altcha_form">
<p>
You can however also place the widget yourself and configure it according to the <a
href="https://altcha.org/docs/v2/widget-integration/#attribute-configuration"
>documentation</a>. In that case the <em
>website_altcha_form</em> class only takes care that the javascript code is loaded and activated.
</p>
<p>
Note in both cases, you'll have to verify the token you received in your custom controller.
</p>
<div>
<altcha-widget type="switch" />
</div>
<div>
<button type="submit">Submit</button>
</div>
</form>
</t>
</template>
<record id="demo_page" model="website.page">
<field name="url">/website_altcha_demo</field>
<field name="is_published" eval="True" />
<field name="view_id" ref="demo_page_view" />
</record>
</odoo>
Loading