iFargle / headscale-webui

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

internal server error #58

Closed changchichung closed 1 year ago

changchichung commented 1 year ago

I can not connect to headscale-webui after docker-compose up here is the docker log

2023-03-23 09:04:37 [chchang@cowbay headscale-webui  main ]$ docker logs -f headscale-webui 
[2023-03-23 09:04:36 +0800] [1] [INFO] Starting gunicorn 20.1.0
[2023-03-23 09:04:36 +0800] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
[2023-03-23 09:04:36 +0800] [1] [INFO] Using worker: sync
[2023-03-23 09:04:36 +0800] [8] [INFO] Booting worker with pid: 8
[2023-03-23 09:04:38,185] INFO in server: Headscale-WebUI Version:  v0.5.6 / main
[2023-03-23 09:04:38,185] INFO in server: LOG LEVEL SET TO INFO
[2023-03-23 09:04:38,185] INFO in server: DEBUG STATE:  False
[2023-03-23 09:04:48 +0800] [8] [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-23 09:04:49 +0800] [8] [ERROR] Error handling request /favicon.ico
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

and docker-compose.yml

version: "3"
services:
  headscale-webui:
    image: ifargle/headscale-webui:latest
    container_name: headscale-webui
    ports:
      - 127.0.0.1:8002:5000                                                                        
    environment:

any suggestions ??

iFargle commented 1 year ago

What is your 'SCRIPT_NAME' environment variable set to?

iFargle commented 1 year ago

Is that your full docker-compose.yml? What environment do you have set?

changchichung commented 1 year ago

full docker-compose.yml

version: "3"
services:
  headscale-webui:
    image: ifargle/headscale-webui:latest
    container_name: headscale-webui
    ports:
      - 127.0.0.1:8002:5000
    environment:
      - TZ=Asia/Taipei
      - COLOR=red                              # Use the base colors (ie, no darken-3, etc) - 
        #- HS_SERVER=https://headscale.$DOMAIN    # Reachable endpoint for your Headscale server
      - HS_SERVER=https://head.abc.com    # Reachable endpoint for your Headscale server
      - DOMAIN_NAME=https://hui.abc.com  # The base domain name for this container.
      - SCRIPT_NAME=/admin                     # This is your applications base path (wsgi requires the name "SCRIPT_NAME")
      - KEY="gDzxOgIWoBEsomesupersecretherej4NyXITM="             # Generate with "openssl rand -base64 32" - used to encrypt your key on disk.
        #- AUTH_TYPE=oidc                         # AUTH_TYPE is either Basic or OIDC.  Empty for no authentication
      - AUTH_TYPE=                         # AUTH_TYPE is either Basic or OIDC.  Empty for no authentication
      - LOG_LEVEL=info                         # Log level.  "DEBUG", "ERROR", "WARNING", or "INFO".  Default "INFO"
      # ENV for Basic Auth (Used only if AUTH_TYPE is "Basic").  Can be omitted if you aren't using Basic Auth
      - BASIC_AUTH_USER=user                   # Used for basic auth
      - BASIC_AUTH_PASS=pass                   # Used for basic auth
      # ENV for OIDC (Used only if AUTH_TYPE is "OIDC").  Can be omitted if you aren't using OIDC
      #- OIDC_AUTH_URL=https://auth.$DOMAIN/.well-known/openid-configuration # URL for your OIDC issuer's well-known endpoint
      #- OIDC_CLIENT_ID=headscale-webui         # Your OIDC Issuer's Client ID for Headscale-WebUI
      #- OIDC_CLIENT_SECRET=YourSecretHere      # Your OIDC Issuer's Secret Key for Headscale-WebUI
    volumes:
      - ./volume:/data                         # Headscale-WebUI's storage.  Make sure ./volume is readable by UID 1000 (chown 1000:1000 ./volume)
      - ./headscale/config/:/etc/headscale/:ro # Headscale's config storage location.  Used to read your Headscale config.
iFargle commented 1 year ago

I see: [2023-03-23 09:04:48 +0800] [8] [ERROR] Error handling request / Are you going to https://hui.abc.com/ or https://hui.abc.com/admin ?

Your SCRIPT_NAME is /admin, you might need to change it to /

changchichung commented 1 year ago

thanks , problem solved!