ctxis / SnitchDNS

Database Driven DNS Server with a Web UI

Home Page:https://www.contextis.com/en/resources/tools/snitchdns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functional enhancement request: RADIUS authentication

frankenstein91 opened this issue · comments

I find the multi-user support a great feature. I would like to use this function with a Radius server. My LAN and WLAN runs with Unifi hardware and IEEE 802.1x. So I already use a Radius Server in my network. I would like to give my family members the possibility for *.firstname.surname.local.

Thanks a lot

RADIUS support has now been implemented in v1.1.0 - give it a go and let me know if there are any issues.

did you update the documentation for setup or can you give me tips?

Hi,

Login as an administrator, go to Settings > RADIUS, enter the server's IP, the port, and the secret.

I've only tested this with FreeRADIUS so hopefully it will work with your setup as well.

image

Let me know how it goes and I can tweak if it needed.

Thanks

somehow i get this
grafik

Apologies about that, I've now fixed the issue.

Pull the latest and greatest code, rebuild the Docker container, and it should work just fine.

i think we have more problems in the docker...

  Building wheel for Flask-Bcrypt (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /opt/snitchdns/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3cs1cg0/Flask-Bcrypt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3cs1cg0/Flask-Bcrypt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-n1bo3oqc
       cwd: /tmp/pip-install-v3cs1cg0/Flask-Bcrypt/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for Flask-Bcrypt
  Running setup.py clean for Flask-Bcrypt
  Building wheel for Flask-Mail (setup.py): started
  Building wheel for Flask-Mail (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /opt/snitchdns/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3cs1cg0/Flask-Mail/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3cs1cg0/Flask-Mail/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-3wxgtwnp
       cwd: /tmp/pip-install-v3cs1cg0/Flask-Mail/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for Flask-Mail
  Running setup.py clean for Flask-Mail
  Building wheel for gunicorn (setup.py): started
  Building wheel for gunicorn (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /opt/snitchdns/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3cs1cg0/gunicorn/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3cs1cg0/gunicorn/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-jc7nc7es
       cwd: /tmp/pip-install-v3cs1cg0/gunicorn/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for gunicorn
  Running setup.py clean for gunicorn
  Building wheel for pywebpush (setup.py): started
  Building wheel for pywebpush (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /opt/snitchdns/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3cs1cg0/pywebpush/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3cs1cg0/pywebpush/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-q2jke50k
       cwd: /tmp/pip-install-v3cs1cg0/pywebpush/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for pywebpush
  Running setup.py clean for pywebpush
  Building wheel for psycopg2 (setup.py): started
  Building wheel for psycopg2 (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /opt/snitchdns/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3cs1cg0/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3cs1cg0/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-kcyhw2xt
       cwd: /tmp/pip-install-v3cs1cg0/psycopg2/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
  Building wheel for blinker (setup.py): started
  Building wheel for blinker (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /opt/snitchdns/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3cs1cg0/blinker/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3cs1cg0/blinker/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-buw_m2w5
       cwd: /tmp/pip-install-v3cs1cg0/blinker/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for blinker
  Running setup.py clean for blinker
  Building wheel for http-ece (setup.py): started
  Building wheel for http-ece (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /opt/snitchdns/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3cs1cg0/http-ece/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3cs1cg0/http-ece/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-sh_67l13
       cwd: /tmp/pip-install-v3cs1cg0/http-ece/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for http-ece
  Running setup.py clean for http-ece
  Building wheel for py-vapid (setup.py): started
  Building wheel for py-vapid (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /opt/snitchdns/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v3cs1cg0/py-vapid/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v3cs1cg0/py-vapid/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vktaosjb
       cwd: /tmp/pip-install-v3cs1cg0/py-vapid/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for py-vapid
  Running setup.py clean for py-vapid
Failed to build Flask-Bcrypt Flask-Mail gunicorn pywebpush psycopg2 blinker http-ece py-vapid
ERROR: requests 2.25.1 has requirement idna<3,>=2.5, but you'll have idna 3.1 which is incompatible.

Unfortunately the radius connection does not work

'ascii' codec can't encode character '\xa7' in position 3: ordinal not in range(128)
Traceback (most recent call last):
File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask_login/utils.py", line 272, in decorated_view
return func(*args, **kwargs)
File "/opt/snitchdns/app/lib/base/decorators.py", line 14, in wrapped_view
return f(**kwargs)
File "/opt/snitchdns/app/controllers/config/system/radius.py", line 54, in radius_test
if not radius.test_connection():
File "/opt/snitchdns/app/lib/users/auth/radius.py", line 83, in test_connection
client = self.__get_client()
File "/opt/snitchdns/app/lib/users/auth/radius.py", line 99, in __get_client
return Client(server=self.host, authport=self.port, secret=self.secret.encode('ascii'), dict=Dictionary(self.dictionary), retries=1)
UnicodeEncodeError: 'ascii' codec can't encode character '\xa7' in position 3: ordinal not in range(128)

Hello (again!)

Previously I had only tested passwords with 7-bit ascii, but have now pushed a fix to treat everything as utf-8. I've done an end-to-end test and it now seems to be working fine (hopefully we're getting there!).

Please delete any existing images/containers/volumes of SnitchDNS, and give it another go.

Thanks

The function works as I imagined it would. I will soon transfer it from my test network to my productive network.

Thank you

Glad we got that sorted!