Commit Graph

98 Commits

Author SHA1 Message Date
PCoder 6ba71545a1 Fix psycopg2 bug
Internal Server Error: /admin/login/
Traceback (most recent call last):
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/contrib/admin/sites.py", line 399, in login
    return LoginView.as_view(**defaults)(request)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/utils/decorators.py", line 45, in _wrapper
    return bound_method(*args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/utils/decorators.py", line 45, in _wrapper
    return bound_method(*args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/utils/decorators.py", line 142, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/utils/decorators.py", line 45, in _wrapper
    return bound_method(*args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/contrib/auth/views.py", line 61, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/views/generic/edit.py", line 141, in post
    if form.is_valid():
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/forms/forms.py", line 185, in is_valid
    return self.is_bound and not self.errors
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/forms/forms.py", line 180, in errors
    self.full_clean()
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/forms/forms.py", line 382, in full_clean
    self._clean_form()
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/forms/forms.py", line 409, in _clean_form
    cleaned_data = self.clean()
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/contrib/auth/forms.py", line 205, in clean
    self.user_cache = authenticate(self.request, username=username, password=password)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/contrib/auth/__init__.py", line 73, in authenticate
    user = backend.authenticate(request, **credentials)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/contrib/auth/backends.py", line 20, in authenticate
    user = UserModel._default_manager.get_by_natural_key(username)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/contrib/auth/base_user.py", line 44, in get_by_natural_key
    return self.get(**{self.model.USERNAME_FIELD: username})
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/models/query.py", line 402, in get
    num = len(clone)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/models/query.py", line 256, in __len__
    self._fetch_all()
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/models/query.py", line 1242, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/models/query.py", line 55, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
    return list(result)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1554, in cursor_iter
    for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel):
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1554, in <lambda>
    for rows in iter((lambda: cursor.fetchmany(itersize)), sentinel):
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/utils.py", line 96, in inner
    return func(*args, **kwargs)
  File "/home/app/pyvenv/lib/python3.9/site-packages/django/db/backends/postgresql/utils.py", line 6, in utc_tzinfo_factory
    raise AssertionError("database connection isn't set to UTC")

See: https://stackoverflow.com/a/68025007
2021-11-03 19:48:37 +05:30
PCoder ae3c156df7 Update Django from 2.1.4 to 2.2.16 2020-09-02 20:48:34 +05:30
PCoder 1efe6ee078 Add missing parenthesis 2019-09-26 15:45:54 +05:30
PCoder 9703eb6538 Set name, realm and seed for superusers also 2019-09-26 15:26:10 +05:30
PCoder 273a1acf01 Set ALLOWED_HOSTS from .env 2019-09-26 15:16:07 +05:30
PCoder 3f37fe4826 Set username for non-superusers only 2019-09-26 15:10:16 +05:30
nico14571 79458d54cb Merge branch 'patch-1' into 'master'
Update README.md (Verify using http POST Section)

See merge request ungleich-public/ungleich-otp!3
2019-06-08 12:52:27 +02:00
Ahmed Bilal 0301e1a7e8 Update README.md 2019-06-08 09:36:55 +02:00
Ahmed Bilal 2f2d0c592e Update README.md 2019-06-07 20:06:17 +02:00
wcolmenares 9e3aad1316 updated readme 2019-03-13 19:56:49 -04:00
wcolmenares 7a581e8357 fix verify someone else token 2019-03-11 23:05:13 -04:00
nico14571 84afaaa56d Merge branch 'master' into 'master'
Decouple config and add logging

See merge request ungleich-public/ungleich-otp!1
2019-02-11 11:12:53 +01:00
PCoder d38b5378b0 More logging 2019-02-11 01:06:21 +01:00
PCoder 1b4107306b Add logging 2019-02-10 23:52:52 +01:00
PCoder d598b9584e Add logs directory 2019-02-10 23:37:15 +01:00
PCoder 636b3d3052 Log errors/debug messages 2019-02-10 23:33:28 +01:00
PCoder fd0f0b56bd Load configs from .env and add basic logging config 2019-02-10 23:32:59 +01:00
PCoder e45e5989db Add python-decouple requirement 2019-02-10 23:31:48 +01:00
PCoder 5890d95c59 Update .gitignore 2019-02-10 23:31:26 +01:00
PCoder 27b880ef77 Add values to .env.sample 2019-02-10 23:30:17 +01:00
PCoder 27ba06ce26 Add .env.sample 2019-02-10 23:29:53 +01:00
Nico Schottelius 1a54de525b Cleanup docs, remove debug print 2019-02-08 20:00:28 +01:00
Nico Schottelius 97b612e626 Update doc, run actual authentication on verify 2019-02-08 19:25:07 +01:00
Nico Schottelius 8bd256a1d7 Fix auth!
ungleich-admin can do anything, but verify
ungleich-auth can only verify
rest cannot login
2018-12-31 00:46:29 +01:00
Nico Schottelius 0eb09c31d8 Remove custom list code 2018-12-30 22:52:27 +01:00
Nico Schottelius 1e2d834c59 Adding otpseed as user works 2018-12-30 22:51:34 +01:00
Nico Schottelius 7ab29862f6 Post works, w/o creating an object 2018-12-30 22:41:17 +01:00
Nico Schottelius 1b85b28935 In between hacking commit
Trying to rip out the auth part
2018-12-30 22:30:11 +01:00
Nico Schottelius 2de270859a Fix wrong else 2018-12-30 19:42:55 +01:00
Nico Schottelius 952ff50cbb -- syntax error 2018-12-30 19:42:26 +01:00
Nico Schottelius 11f3c5bcd9 Begin to add static files support 2018-12-30 19:41:13 +01:00
Nico Schottelius 6012eab88d Simplify settings.py 2018-12-30 19:07:41 +01:00
Nico Schottelius d9ee4ffc80 Move tokenserializer import after otpseed definition 2018-12-30 19:02:34 +01:00
Nico Schottelius dabe6a08ac reorder 2018-12-30 18:20:24 +01:00
Nico Schottelius d969399423 Remove self import 2018-12-30 18:16:00 +01:00
Nico Schottelius fc9e14dd5d Restructure -> easier checkout on app server 2018-12-30 18:10:45 +01:00
Nico Schottelius 6544fccb9a Cleanup and split local/prod 2018-12-30 17:57:02 +01:00
Nico Schottelius f157cf2539 Move requirements into django folder 2018-12-26 11:29:02 +01:00
Nico Schottelius 6377187004 add hint why stuff works 2018-12-24 20:58:08 +01:00
Nico Schottelius 8636d3f81a Cleanup 2018-12-24 20:46:54 +01:00
Nico Schottelius 45394fa59c Cleanup client 2018-12-24 20:30:12 +01:00
Nico Schottelius 11ab190ebc Update 2018-12-24 20:28:21 +01:00
Nico Schottelius 78de133e16 Remove testfile 2018-12-24 19:22:15 +01:00
Nico Schottelius 2e228f3a0d Phase in ungleichotp 2018-11-18 15:41:47 +01:00
Nico Schottelius 963585806a Update script to use urrlib for server testing 2018-11-18 15:37:28 +01:00
Nico Schottelius 3ada914040 Be python friendly, don't use dashes 2018-11-18 14:33:30 +01:00
Nico Schottelius d53b980ebf add restapp to client
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2018-11-18 13:59:15 +01:00
Nico Schottelius f5f5024981 add client base
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2018-11-18 13:58:38 +01:00
Nico Schottelius f59fbf1180 Cleanup dev code 2018-11-18 13:42:16 +01:00
Nico Schottelius f55498f314 Finish the verifyserializer 2018-11-18 13:35:06 +01:00