From 196ab2787e204a49f5604b6aa76d00c3a674574e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 5 Dec 2021 20:53:41 +0100 Subject: [PATCH] ++notes --- README.md | 18 ++++++++++++++++++ ungleichuser/templates/registration/login.html | 4 ++++ ungleichuser/ungleichuser/forms.py | 4 ++++ ungleichuser/ungleichuser/v6v4.py | 6 +++++- 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 ungleichuser/ungleichuser/forms.py diff --git a/README.md b/README.md index ef38cf7..c87b24e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,24 @@ This service runs on [account.ungleich.ch](https://account.ungleich.ch/) and allows customers manage their ungleich account (register, edit mail & password, ...). +## Todos for v2: + +* Rewrite/create new app Django 4.0 based (ungleichuser) +* Do not use django-auth-ldap, because it uses python-ldap +* Update the template HTML to bootstrap5 +* Use ldap3 +* Check/verify the ldap registration +* Ensure multiple ldap servers are supported +* Cleanup this readme +* Use the following "captcha" for all forms: + * Extra form field named "random" + * Present the user the following text: +* Create Dockerfile / ensure it works in kubernetes + +## Next steps + +* Override/use custom form to allow captcha + ## Development Setup ``` diff --git a/ungleichuser/templates/registration/login.html b/ungleichuser/templates/registration/login.html index dce5873..25aec63 100644 --- a/ungleichuser/templates/registration/login.html +++ b/ungleichuser/templates/registration/login.html @@ -26,6 +26,10 @@ {{ form.password.label_tag }} {{ form.password }} + + {{ form.random.label_tag }} + {{ form.random }} + diff --git a/ungleichuser/ungleichuser/forms.py b/ungleichuser/ungleichuser/forms.py new file mode 100644 index 0000000..24b092a --- /dev/null +++ b/ungleichuser/ungleichuser/forms.py @@ -0,0 +1,4 @@ +import django.contrib.auth.forms as forms + +class UngleichAuthenticationForm(forms.AuthenticationForm): + address = forms.CharField(max_length=45) diff --git a/ungleichuser/ungleichuser/v6v4.py b/ungleichuser/ungleichuser/v6v4.py index 75fb54a..a0a6f65 100644 --- a/ungleichuser/ungleichuser/v6v4.py +++ b/ungleichuser/ungleichuser/v6v4.py @@ -2,4 +2,8 @@ import ipaddress import random v4_addr = ipaddress.IPv4Address(random.randint(0, 2**32)) -v6_addr = ipaddress.IPv6Address(random.randint(0, 2**128) +v6_addr = ipaddress.IPv6Address(random.randint(0, 2**128)) + +if __name__ == '__main__': + addr_type = random.choice(["ipv6", "ipv4"]) + if addr_type == "ipv6":