h44z / wg-portal

WireGuard Configuration Portal with LDAP connection
https://wgportal.org/
MIT License
875 stars 121 forks source link

I can't log into the portal using my account. #198

Open garunoff opened 7 months ago

garunoff commented 7 months ago

My container starts up normally, but for some unknown reason I can’t log into the portal under the user I specify in the config. When I try to login it says: "Login failed! Authentication failed!". Below I write the configs:

docker-compose.yml :

version: '3.6' services: wg-portal: image: wgportal/wg-portal:master restart: unless-stopped cap_add:

/app/wireguard-portal/config/config.yml

core: admin_user: test@wg-portal.local admin_password: secret

web: external_url: http://localhost:8888 request_logging: true

Please help me solve the problem.

BliNeR-KeY commented 7 months ago

pls check log

docker logs wg-portal

my config

web:
  external_url: http://wghome-home.ddns.net:8888
  request_logging: true

`

core:
  admin_user: MyUserName
  admin_password: MyPassword

Pls try to remove ./data/sqlite.db reboot server.

try to login again...

garunoff commented 7 months ago

In the logs there is only this:

time="2023-11-15T09:46:34Z" level=info msg="Starting WireGuard Portal V2..." time="2023-11-15T09:46:34Z" level=info msg="WireGuard Portal version: unknown (local build)"

Deleting the database and restarting also does nothing.

BliNeR-KeY commented 7 months ago

In the logs there is only this:

time="2023-11-15T09:46:34Z" level=info msg="Starting WireGuard Portal V2..." time="2023-11-15T09:46:34Z" level=info msg="WireGuard Portal version: unknown (local build)"

Deleting the database and restarting also does nothing.

on first install . you have once login details. you will get it from log.

garunoff commented 7 months ago

Sorry, but I didn't understand you. Can you explain in more detail?

BliNeR-KeY commented 7 months ago

Sorry, but I didn't understand you. Can you explain in more detail?

if have no access in login. it means

core:
  admin_user: admin
  admin_password: adminPass

or your config.yml not right place.

example...

if docker-compose.yaml are >> /home/Softwares/wg-portal/

you need to add config like this..

/home/Softwares/wg-portal/config/config.yml

i'm using V2. works everything fine only have problem dont manage iptables i hope @h44z fill fix it without extra scripts around.

my wgportal/wg-portal:latest

version: '3.6'
services:
  wg-portal:
    image: wgportal/wg-portal:latest
    container_name: wg-portal
    restart: unless-stopped
    logging:
      options:
        max-size: "10m"
        max-file: "3"
    cap_add:
      - NET_ADMIN
    network_mode: "host"
    volumes:
      - /etc/wireguard:/etc/wireguard
      - ./data:/app/data
      - ./config:/app/config
#    restart: no
#    command: ["-migrateFrom=/app/data/wg_portal.db"]
garunoff commented 7 months ago

I do everything as you wrote, but the problem remains the same. The only thing that caught my attention was that you wrote not to manage iptables - what did you mean?

BliNeR-KeY commented 7 months ago

PostUp PostDown PreUp PreDown

don't works from UI. (maybe i wrong) but for me don't manage the shell

i open issue https://github.com/h44z/wg-portal/issues/194

hope @h44z will check to fix it.

garunoff commented 7 months ago

Got you. I don't use this in the config file. How can I view authentication logs?

BliNeR-KeY commented 7 months ago

Got you. I don't use this in the config file. How can I view authentication logs?

garunoff commented 7 months ago

I read and applied the configuration you showed, but nothing helps. Please show me an example of what you are saying about a log in JSON format.

BliNeR-KeY commented 7 months ago

I read and applied the configuration you showed, but nothing helps. Please show me an example of what you are saying about a log in JSON format.

in ./config/config.ym > advanced try to put like this.

advanced:
  log_level: debug
  config_storage_path: /etc/wireguard
  start_cidr_v4: 10.11.12.0/24
  start_listen_port: 51820
  log_pretty: true
  log_json: true
BliNeR-KeY commented 7 months ago

you can check the log using

docker logs wg-portal

garunoff commented 7 months ago

{ "clientIP": "192.168.153.205", "dataLength": 644, "hostname": "ubuntu-server", "latency": 1, "level": "info", "method": "GET", "msg": "192.168.153.205 - ubuntu-server [16/Nov/2023:12:20:06 +0000] \"GET /app/assets/us-5615dee6.svg\" 200 644 \"http://192.168.153.243:8888/app/assets/index-7144f109.css\" \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\" (1ms)", "path": "/app/assets/us-5615dee6.svg", "referer": "http://192.168.153.243:8888/app/assets/index-7144f109.css", "statusCode": 200, "time": "2023-11-16T12:20:06Z", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" }

Sarevok93219 commented 6 months ago

Hello everyone. I have the same problem: can't authorize using my creds from config.yaml. I configured PSQL Backend. In logs have 401 or 400 error. { "clientIP": "ext_IP_client", "dataLength": 44, "hostname": "321b40a534cd", "latency": 1, "level": "warning", "method": "POST", "msg": "ext_IP_client - 321b40a534cd [13/Dec/2023:20:30:17 +0000] \"POST /api/v0/auth/login\" 400 44 \"http://ext_IP_wg_Portal:8888/app/\" \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.731 YaBrowser/23.11.1.731 Yowser/2.5 Safari/537.36\" (1ms)", "path": "/api/v0/auth/login", "referer": "http://ext_IP_wg_portal:8888/app/", "statusCode": 400, "time": "2023-12-13T20:30:17Z", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.731 YaBrowser/23.11.1.731 Yowser/2.5 Safari/537.36" }

SealinGp commented 2 months ago

i know how to solve this problem.
you need to ensure you access web url ip and port is the same as your web.external_url config. for example. my access web url is 'http://192.168.1.100:8800/app/#/'. i change the config web.external_url from 'http://localhost:51821' to 'http://192.168.1.100:8800'. and it will be solved

fdff87554 commented 2 months ago

i know how to solve this problem. you need to ensure you access web url ip and port is the same as your web.external_url config. for example. my access web url is 'http://192.168.1.100:8800/app/#/'. i change the config web.external_url from 'http://localhost:51821' to 'http://192.168.1.100:8800'. and it will be solved

Thank you so much for your explanation, it helps my situation!