iFargle / headscale-webui

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

Internal Server Error #39

Closed Aurora8orealis closed 1 year ago

Aurora8orealis commented 1 year ago

After Setting up Docker Container with:

version: "3"
services:
  headscale-webui:
    image: ghcr.io/ifargle/headscale-webui:latest
    container_name: headscale-webui
    environment:
      - TZ=Europe/Berlin
      - COLOR=red                              
      - HS_SERVER=http://domain:port 
      - SCRIPT_NAME=/admin                     
      - KEY="randomkey"             
      - LOG_LEVEL=info                
    volumes:
      - ./volume:/data                         
      - ./headscale/config/:/etc/headscale/:ro 

Server Starts as expected

Trying to open the panel on http://domain:5000 gives:

Internal Server Error

In Logs Error shows:

[2023-03-09 00:07:08 +0100] [1] [INFO] Starting gunicorn 20.1.0
[2023-03-09 00:07:08 +0100] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
[2023-03-09 00:07:08 +0100] [1] [INFO] Using worker: sync
[2023-03-09 00:07:08 +0100] [7] [INFO] Booting worker with pid: 7
[2023-03-09 00:07:10 +0100] [7] [ERROR] Error handling request /
Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 136, in handle
    self.handle_request(listener, req, client, addr)
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 169, in handle_request
    resp, environ = wsgi.create(req, client, addr,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/http/wsgi.py", line 183, in create
    path_info = path_info.split(script_name, 1)[1]
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
[2023-03-09 00:07:18 +0100] [7] [ERROR] Error handling request /
Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 136, in handle
    self.handle_request(listener, req, client, addr)
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 169, in handle_request
    resp, environ = wsgi.create(req, client, addr,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/gunicorn/http/wsgi.py", line 183, in create
    path_info = path_info.split(script_name, 1)[1]
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
iFargle commented 1 year ago

Should be "domain:port/SCRIPT_NAME" -- I see you have it set to "/admin", try that. I can test on my set up in about an hour :) Give me a bit.

Aurora8orealis commented 1 year ago

Omg, okay im one step further, now im just having trouble with the config.yaml and data folder permissions

Aurora8orealis commented 1 year ago

When setting up the server 2 things were completly wrong

Port 5000 exposure was missing Volumes were set to something completly wrong

After changing both Webui works now