Skip to content

Commit

Permalink
remove mtcaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienReuiller committed Apr 24, 2023
1 parent 1b9e227 commit 9c4364e
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 108 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
SECRET_KEY=
SEND_IN_BLUE_API_KEY=
IS_DEBUG_ENABLED=True
MTCAPTCHA_PRIVATE_KEY=
MTCAPTCHA_PUBLIC_KEY=
MOCK_EXTERNAL_API=False
SENTRY_URL=
SENTRY_SAMPLE_RATE=
Expand Down
2 changes: 0 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ DATABASE_HOST=127.0.0.1
DATABASE_PORT=5432
SEND_IN_BLUE_API_KEY=YOUR_ACTUAL_KEY
IS_DEBUG_ENABLED=True
MTCAPTCHA_PRIVATE_KEY=YOUR_ACTUAL_KEY
MTCAPTCHA_PUBLIC_KEY=YOUR_ACTUAL_KEY
MOCK_EXTERNAL_API=True
SENTRY_URL=
14 changes: 0 additions & 14 deletions cnr/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
CSP_DEFAULT_SRC = ["'self'", "data:", "localhost:" + runserver.default_port]
CSP_FRAME_SRC = [
"*.youtube.com",
"*.mtcaptcha.com",
"*.facebook.com",
"*.vimeo.com",
"datawrapper.dwcdn.net",
Expand All @@ -131,7 +130,6 @@
"'self'",
"data:",
"localhost:" + runserver.default_port,
"axeptio.imgix.net",
"*.google.com",
"*.gstatic.com",
"*.facebook.com",
Expand All @@ -145,12 +143,6 @@
"'sha256-Eyt3MCqJJqqqUJzUlVq9BLYX+kVGQZVLpJ4toZz4mb8='", # inject-svg.js de django-dsfr
"'sha256-Xhd5+zYamb/dMdyIkYwXmzaXokrsMrINTdCsO/s+Hcc='", # inject style inline for homepage cover (old)
"'sha256-dDZkVrIJy1Xyahb04E1npPS7ONJw3g8949x7gAc/kEY='", # inject style inline for homepage cover
"'sha256-R2Vkrx5FLpmMY0750ljuQem15/f/bIrrGl+TXyzeETo='", # mtcaptcha
"'sha256-8kPOCl/iIr6YgWLvLnIRMrYnCJHOzs6WNYAedT41SM8='", # mtcaptcha
"'sha256-2Go/yMtz4sEcAbw1TnjkjLz983Zxq7frCShdJs2OobM='", # mtcaptcha
"'sha256-g6zf946PtVM63bZ+fe9QUc3hDXp5BMl6OBmAlKhKV60='", # mtcaptcha
"'sha256-zqo/Gf4mmbgvoqPGTNSkHYfibgllewm/seDhWyooOOk='", # mtcaptcha
"'sha256-FVE4UqDzJ5GzKFQlZqU4Zq3EAxxb/T0hpPQU9k6uwkA='", # mtcaptcha
"'sha256-/68szNaQXdlDug09n2c6rD/J5VWzEfkXCRsVxk+Bc7s='", # datawrapper
"'sha256-AthIs6YNuVjwfheHgESE8WAfJ61fXMZXX7s/UwRV5Dg='", # typeform nps
"embed.typeform.com", # typeform nps
Expand All @@ -159,10 +151,6 @@
"'self'",
"'sha256-bniFC3kd4JwCYRuTuxW9AjUYecKEuyTLJ+5NH6TJBWE='", # matomo
"stats.conseil-refondation.fr", # matomo
"service.mtcaptcha.com",
"service2.mtcaptcha.com",
"'sha256-7I5+oMehC+KBd+/dcrEMSPXSBUa0CSjemqYTkGftfeo='", # MTCaptcha staging public key
"'sha256-GWPBP28u9s4u/wssaakyNjieplIhhXg1ExHLViqsF6s='", # MTCaptcha production public key
"'sha256-1neh+DsrMKevQd7CmK4xkhFjYHtrpaiR8ncbjLw/w5E='", # cookies handler
"connect.facebook.net",
"static.axept.io",
Expand Down Expand Up @@ -312,8 +300,6 @@
SEND_IN_BLUE_LIST = int(os.getenv("SEND_IN_BLUE_LIST", 1))

MOCK_EXTERNAL_API = os.getenv("MOCK_EXTERNAL_API", "False")
MTCAPTCHA_PRIVATE_KEY = os.getenv("MTCAPTCHA_PRIVATE_KEY", "")
MTCAPTCHA_PUBLIC_KEY = os.getenv("MTCAPTCHA_PUBLIC_KEY", "")

SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_COOKIE_AGE = 60 * 60
Expand Down
45 changes: 0 additions & 45 deletions public_website/captcha.py

This file was deleted.

6 changes: 0 additions & 6 deletions public_website/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
from django.core.exceptions import ValidationError
from django.forms import ModelForm

from public_website.captcha import check_captcha_token

from . import models


class ProfileForm(ModelForm):

email = forms.EmailField(
label="Adresse électronique",
)
Expand Down Expand Up @@ -55,9 +52,6 @@ class ProfileForm(ModelForm):
label="Pour améliorer notre école", required=False
)

def is_captcha_valid(self):
return check_captcha_token(self.data)

def clean_postal_code(self):
postal_code = self.cleaned_data["postal_code"]
for character in postal_code:
Expand Down
1 change: 0 additions & 1 deletion public_website/templates/public_website/accessibilite.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ <h3>Résultats des tests</h3>
<h2>Contenus non accessibles</h2>
<h3>Non-conformités</h3>
<ul>
<li>Le captcha n'est pas conforme</li>
<li>Le module d’acceptation de cookie n’est pas conforme</li>
</ul>
<hr/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ <h1>Démarche d’accessibilité</h1>

</p>
<p>
Nous travaillons actuellement sur les problèmes suivants :
Nous travaillons actuellement sur le problème suivant :
<ul>
<li>Le module d’acceptation de cookie</li>
<li>Le captcha</li>
</ul>
</p>
</div>
Expand Down
9 changes: 0 additions & 9 deletions public_website/templates/public_website/confidentialite.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ <h2>Qui nous aide à traiter les données ?</h2>
<td>Envoi de mail</td>
<td><a title="RGPD de Sendinblue- ouvre une nouvelle fenêtre" href="https://fr.sendinblue.com/rgpd/" target="_blank" rel="noopener">https://fr.sendinblue.com/rgpd/</a></td>
</tr>
<tr>
<td>MTCaptcha</td>
<td>USA</td>
<td>Captcha</td>
<td>Solution de sécurisation ne manipulant pas de données à caractère personnel directement identifiante <a title="RGPD et Captcha - ouvre une nouvelle fenêtre" href="https://www.mtcaptcha.com/gdpr-captcha" target="_blank" rel="noopener">https://www.mtcaptcha.com/gdpr-captcha</a>
<a title="MTCaptcha - Data Processing Agreement - ouvre une nouvelle fenêtre" href="https://www.mtcaptcha.com/legal-dpa" target="_blank" rel="noopener">https://www.mtcaptcha.com/legal-dpa</a>
</td>
</tr>
</tbody>
</table>
</div>
Expand All @@ -152,7 +144,6 @@ <h2>Cookies et autres trackers</h2>
<p>À tout moment, vous pouvez refuser l'utilisation des cookies et désactiver le dépôt sur votre ordinateur en utilisant [l'outil de gestion des cookies] que nous mettons à votre disposition ou depuis la fonction dédiée de votre navigateur (fonction disponible notamment sur Microsoft Internet Explorer 11, Google Chrome, Mozilla Firefox, Apple Safari et Opera).</p>
<p>La plateforme du Conseil National de la Refondation (CNR) utilise des cookies exemptés de consentement, strictement nécessaires au bon fonctionnement du site.</p>
<p>La plateforme a recours à des cookies de statistiques anonymes qui ne nécessitent pas de bandeau cookies, toujours au sens des dernières recommandations de la CNIL à ce sujet. L'outil utilisé est Matomo opéré par la Direction interministérielle du numérique. Vous pouvez vous opposer à la réalisation de statistiques anonymes en cliquant ci-après : <a title="Statistiques du Conseil National de la Refondation - ouvre une nouvelle fenêtre" href="https://stats.conseil-refondation.fr//index.php?module=CoreAdminHome&action=optOut&language=fr." target="_blank" rel="noopener">s'opposer aux statistiques anonymes</a>.</p>
<p>La plateforme a également recours à une solution de Captcha qui peut nécessiter le dépôt d'un cookie en vue de réaliser un test d'identification pour s'assurer que le visiteur est bien d'un humain et non un automate informatique. <a title="MTCaptcha - ouvre une nouvelle fenêtre" href="https://www.mtcaptcha.com/" target="_blank" rel="noopener">MTCaptcha</a></p>
<p>Certains cookies sont déposés pour vous adresser une communication personnalisée, y compris sur d'autres sites internet et applications. Vous avez la possibilité de les désactiver ou de les activer à tout moment. [PIXEL TRACKING]</p>
<p>Enfin, d'autres cookies sont déposés pour mesurer et améliorer la promotion du CNR auprès du public et sur différents canaux [GOOGLE ADS]</p>
<p>Pour aller plus loin, vous pouvez consulter les fiches proposées par la Commission Nationale de l'Informatique et des Libertés (CNIL) :</p>
Expand Down
1 change: 0 additions & 1 deletion public_website/templates/public_website/inscription.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ <h2 class="fr-h2 fr-mb-0">2. Je veux m'investir localement</h2>
{{ form.errors.gives_gdpr_consent }}
</div>
</div>
<div class="mtcaptcha"></div>
<div class="fr-input-group fr-my-4w">
<button type="submit" class="fr-btn" title="Valider ce formulaire">Je valide mon inscription</button>
</div>
Expand Down
9 changes: 0 additions & 9 deletions public_website/templatetags/mtcaptcha_key.py

This file was deleted.

2 changes: 1 addition & 1 deletion public_website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def inscription_view(request):

if request.method == "POST":
form = ProfileForm(request.POST)
if form.is_captcha_valid() and form.is_valid():
if form.is_valid():
try:
participant = Participant.objects.get(email=form.cleaned_data["email"])
if participant.has_profile:
Expand Down
18 changes: 2 additions & 16 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,6 @@
})();
</script>
<!-- End Matomo Code -->

<!-- MTCaptcha javascript configuration and import -->
{% load mtcaptcha_key %}
<script>
var mtcaptchaConfig = {
"sitekey": "{% get_mtcaptcha_public_key %}",
"lang": "fr"
};
(function(){var mt_service = document.createElement('script');mt_service.async = true;mt_service.src = 'https://service.mtcaptcha.com/mtcv1/client/mtcaptcha.min.js';(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(mt_service);
var mt_service2 = document.createElement('script');mt_service2.async = true;mt_service2.src = 'https://service2.mtcaptcha.com/mtcv1/client/mtcaptcha2.min.js';(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(mt_service2);}) ();
</script>
<!-- MTCaptcha javascript configuration and import -->

</head>

<body>
Expand Down Expand Up @@ -120,8 +107,7 @@ <h2 class="fr-h6">À propos des cookies sur conseil-refondation.fr</h2>
{% dsfr_js %}
{% block extra_js %}{% endblock extra_js %}

<!-- Axeptio javascript configuration and import -->

<!-- Coockies consent javascript configuration and import -->
<script>
document.addEventListener("DOMContentLoaded", function() {
CookiesHandler('cnrCookiesStore', dsfr).init({
Expand Down Expand Up @@ -158,7 +144,7 @@ <h2 class="fr-h6">À propos des cookies sur conseil-refondation.fr</h2>
})
});
</script>
<!-- Axeptio javascript configuration and import -->
<!-- Coockies consent javascript configuration and import -->

<dialog id="fr-consent-modal" class="fr-modal" role="dialog" aria-labelledby="fr-consent-modal-title">
<div class="fr-container fr-container--fluid fr-container-md">
Expand Down

0 comments on commit 9c4364e

Please sign in to comment.