iFargle / headscale-webui

A simple Headscale web UI for small-scale deployments.
Other
635 stars 60 forks source link

Failure to redirect properly when key.txt is empty or missing #30

Closed FredericIV closed 1 year ago

FredericIV commented 1 year ago

Observation

When key.txt is empty: headscale-webui serves a redirect loop on whichever page. When key.txt is missing: the console reports the lack of key; the browser is continuously redirected to /prefix/settings, even when on /prefix/settings.

Replication

Tested conditions

User mitigation

Use the python console to manually encode the api key.

from cryptography.fernet import Fernet
fernet = Fernet("SECRET")
encrypted_key = fernet.encrypt("KEY".encode())

Insert result without the begining b' and end '.

iFargle commented 1 year ago

Sounds like I need to do more checking in load_checks() - https://github.com/iFargle/headscale-webui/blob/0818d70543d89c62766fa786b3860bf5e2fe4f2f/helper.py#L269

I'll see if I can get this fixed up later today.