Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin's creds not working with backend on Postgresql #202

Closed
Sarevok933219 opened this issue Dec 12, 2023 · 9 comments
Closed

Admin's creds not working with backend on Postgresql #202

Sarevok933219 opened this issue Dec 12, 2023 · 9 comments
Labels
bug Something isn't working v2 wg-portal version 2

Comments

@Sarevok933219
Copy link

Sarevok933219 commented Dec 12, 2023

Hello. I'm using and testing V2 version. Trying to config with Postgres DB as backend. My config.yaml:

advanced:
  log_level: trace
  log_pretty: true
  use_ip_v6: false
core:
  listeningAddress: :8123
  externalUrl: http://localhost:8123
  admin_user: [email protected]
  admin_password: <supersecretkey>
  config_storage_path: /etc/wireguard
  import_existing: true

database:
  type: postgres
  dsn: host=postgres user=<admin> password=<superkey>a dbname=wireguard port=5432 sslmode=disable TimeZone=<localZone>
  debug: true
web:
  site_company_name: WIREGUARD VPN
  external_url: http://localhost:8123
  listening_address: :8123
  request_logging: true

auth:
  callback_url_prefix: http://localhost:8123/api/v0

Container is running up. Connection with PSQL is ok. I see tables and some information in them. My supers user is also present in dp. But then I try to start UI I get an errors:
WG_ERR
...and can't login with my creds.
WG_ERR2

Where may be mistake? Please help.

@Sarevok93219
Copy link

The Errors Backend Connection Failure are gone (change config file: external_url: http://my_ext_ip:8123), but still can't be authorized by my admin's creds.

@Sarevok933219 Sarevok933219 changed the title Backend Connection Failure Admin's creds not working Dec 14, 2023
@viktor-zharikov
Copy link

i have that problem, and found some solve, if you use
externalUrl: http://localhost:8123 in config, you must use http://localhost:8123 in browser, NOT 127.0.0.1:8123

@Sarevok93219
Copy link

Sarevok93219 commented Jan 4, 2024

i have that problem, and found some solve, if you use externalUrl: http://localhost:8123 in config, you must use http://localhost:8123 in browser, NOT 127.0.0.1:8123

Thx. I use http://127.0.0.1:8123 in my yml file. I tried to use http://localhost:8123 instead, but it didn't help. I still can't log in. Please if You can, give me config file and what is under key auth. I don't quite understand what should be here.

auth:
  callback_url_prefix: http://127.0.0.1:8123/api/v0

my config file looks like:

advanced:
  log_level: trace
  log_pretty: true
  log_json: true
  use_ip_v6: false
  config_storage_path: /etc/wireguard

core:
  admin_user: [email protected]
  admin_password: <supersecretkey>
  import_existing: true
  self_provisioning_allowed: true

database:
  #type: sqlite
  #dsn: /app/data/keys.db
  # debug: true
  type: postgres
  dsn: host=postgres user=admin password=<admin's pass> dbname=wireguard port=5432 sslmode=disable TimeZone=Europe/Moscow
  debug: true

web:
  site_company_name: WIREGUARD VPN MYCOMPANYNAME
  external_url: http://localhost:8123
  #external_url: http://127.0.0.1:8123
  listening_address: :8123
  request_logging: true

auth:
  callback_url_prefix: http://localhost:8123/api/v0
  #callback_url_prefix: http://127.0.0.1:8123/api/v0
  #callback_url_prefix: /api/v0

@viktor-zharikov
Copy link

i have that problem, and found some solve, if you use externalUrl: http://localhost:8123 in config, you must use http://localhost:8123 in browser, NOT 127.0.0.1:8123

Thx. I use http://127.0.0.1:8123 in my yml file. I tried to use http://localhost:8123 instead, but it didn't help. I still can't log in. Please if You can, give me config file and what is under key auth. I don't quite understand what should be here.

auth:
  callback_url_prefix: http://127.0.0.1:8123/api/v0

my config file looks like:

advanced:
  log_level: trace
  log_pretty: true
  log_json: true
  use_ip_v6: false
  config_storage_path: /etc/wireguard

core:
  admin_user: [email protected]
  admin_password: <supersecretkey>
  import_existing: true
  self_provisioning_allowed: true

database:
  #type: sqlite
  #dsn: /app/data/keys.db
  # debug: true
  type: postgres
  dsn: host=postgres user=admin password=<admin's pass> dbname=wireguard port=5432 sslmode=disable TimeZone=Europe/Moscow
  debug: true

web:
  site_company_name: WIREGUARD VPN MYCOMPANYNAME
  external_url: http://localhost:8123
  #external_url: http://127.0.0.1:8123
  listening_address: :8123
  request_logging: true

auth:
  callback_url_prefix: http://localhost:8123/api/v0
  #callback_url_prefix: http://127.0.0.1:8123/api/v0
  #callback_url_prefix: /api/v0

In you example config 'external_url: http://localhost:8123' and 'callback_url_prefix: http://127.0.0.1:8123/api/v0' is different, make all url in one style, at first try to localhost, and use "Ctrl + Shift + I opens the developer tools for the browser" network tab

@Sarevok93219
Copy link

i have that problem, and found some solve, if you use externalUrl: http://localhost:8123 in config, you must use http://localhost:8123 in browser, NOT 127.0.0.1:8123

Thx. I use http://127.0.0.1:8123 in my yml file. I tried to use http://localhost:8123 instead, but it didn't help. I still can't log in. Please if You can, give me config file and what is under key auth. I don't quite understand what should be here.

auth:
  callback_url_prefix: http://127.0.0.1:8123/api/v0

my config file looks like:

advanced:
  log_level: trace
  log_pretty: true
  log_json: true
  use_ip_v6: false
  config_storage_path: /etc/wireguard

core:
  admin_user: [email protected]
  admin_password: <supersecretkey>
  import_existing: true
  self_provisioning_allowed: true

database:
  #type: sqlite
  #dsn: /app/data/keys.db
  # debug: true
  type: postgres
  dsn: host=postgres user=admin password=<admin's pass> dbname=wireguard port=5432 sslmode=disable TimeZone=Europe/Moscow
  debug: true

web:
  site_company_name: WIREGUARD VPN MYCOMPANYNAME
  external_url: http://localhost:8123
  #external_url: http://127.0.0.1:8123
  listening_address: :8123
  request_logging: true

auth:
  callback_url_prefix: http://localhost:8123/api/v0
  #callback_url_prefix: http://127.0.0.1:8123/api/v0
  #callback_url_prefix: /api/v0

In you example config 'external_url: http://localhost:8123' and 'callback_url_prefix: http://127.0.0.1:8123/api/v0' is different, make all url in one style, at first try to localhost, and use "Ctrl + Shift + I opens the developer tools for the browser" network tab

I'm not sure, but may be something wrong when interacting with backend (postgres DB)
image

@viktor-zharikov
Copy link

i have that problem, and found some solve, if you use externalUrl: http://localhost:8123 in config, you must use http://localhost:8123 in browser, NOT 127.0.0.1:8123

Thx. I use http://127.0.0.1:8123 in my yml file. I tried to use http://localhost:8123 instead, but it didn't help. I still can't log in. Please if You can, give me config file and what is under key auth. I don't quite understand what should be here.

auth:
  callback_url_prefix: http://127.0.0.1:8123/api/v0

my config file looks like:

advanced:
  log_level: trace
  log_pretty: true
  log_json: true
  use_ip_v6: false
  config_storage_path: /etc/wireguard

core:
  admin_user: [email protected]
  admin_password: <supersecretkey>
  import_existing: true
  self_provisioning_allowed: true

database:
  #type: sqlite
  #dsn: /app/data/keys.db
  # debug: true
  type: postgres
  dsn: host=postgres user=admin password=<admin's pass> dbname=wireguard port=5432 sslmode=disable TimeZone=Europe/Moscow
  debug: true

web:
  site_company_name: WIREGUARD VPN MYCOMPANYNAME
  external_url: http://localhost:8123
  #external_url: http://127.0.0.1:8123
  listening_address: :8123
  request_logging: true

auth:
  callback_url_prefix: http://localhost:8123/api/v0
  #callback_url_prefix: http://127.0.0.1:8123/api/v0
  #callback_url_prefix: /api/v0

In you example config 'external_url: http://localhost:8123' and 'callback_url_prefix: http://127.0.0.1:8123/api/v0' is different, make all url in one style, at first try to localhost, and use "Ctrl + Shift + I opens the developer tools for the browser" network tab

I'm not sure, but may be something wrong when interacting with backend (postgres DB) image

Try to up wg with default config file, db, credentials, i am sure it's work

@Sarevok93219
Copy link

Sarevok93219 commented Jan 5, 2024

i have that problem, and found some solve, if you use externalUrl: http://localhost:8123 in config, you must use http://localhost:8123 in browser, NOT 127.0.0.1:8123

Thx. I use http://127.0.0.1:8123 in my yml file. I tried to use http://localhost:8123 instead, but it didn't help. I still can't log in. Please if You can, give me config file and what is under key auth. I don't quite understand what should be here.

auth:
  callback_url_prefix: http://127.0.0.1:8123/api/v0

my config file looks like:

advanced:
  log_level: trace
  log_pretty: true
  log_json: true
  use_ip_v6: false
  config_storage_path: /etc/wireguard

core:
  admin_user: [email protected]
  admin_password: <supersecretkey>
  import_existing: true
  self_provisioning_allowed: true

database:
  #type: sqlite
  #dsn: /app/data/keys.db
  # debug: true
  type: postgres
  dsn: host=postgres user=admin password=<admin's pass> dbname=wireguard port=5432 sslmode=disable TimeZone=Europe/Moscow
  debug: true

web:
  site_company_name: WIREGUARD VPN MYCOMPANYNAME
  external_url: http://localhost:8123
  #external_url: http://127.0.0.1:8123
  listening_address: :8123
  request_logging: true

auth:
  callback_url_prefix: http://localhost:8123/api/v0
  #callback_url_prefix: http://127.0.0.1:8123/api/v0
  #callback_url_prefix: /api/v0

In you example config 'external_url: http://localhost:8123' and 'callback_url_prefix: http://127.0.0.1:8123/api/v0' is different, make all url in one style, at first try to localhost, and use "Ctrl + Shift + I opens the developer tools for the browser" network tab

I'm not sure, but may be something wrong when interacting with backend (postgres DB) image

Try to up wg with default config file, db, credentials, i am sure it's work

The task is using this product with ability to work with postgres. I have already tested V1. It works fine with MySQL backend. I don't know why v2 has such problem. I saw here another issue with similar case (may be testing version contains bugs). #198 and it is still has status "opened".

@Sarevok93219
Copy link

i have that problem, and found some solve, if you use externalUrl: http://localhost:8123 in config, you must use http://localhost:8123 in browser, NOT 127.0.0.1:8123

Thx. I use http://127.0.0.1:8123 in my yml file. I tried to use http://localhost:8123 instead, but it didn't help. I still can't log in. Please if You can, give me config file and what is under key auth. I don't quite understand what should be here.

auth:
  callback_url_prefix: http://127.0.0.1:8123/api/v0

my config file looks like:

advanced:
  log_level: trace
  log_pretty: true
  log_json: true
  use_ip_v6: false
  config_storage_path: /etc/wireguard

core:
  admin_user: [email protected]
  admin_password: <supersecretkey>
  import_existing: true
  self_provisioning_allowed: true

database:
  #type: sqlite
  #dsn: /app/data/keys.db
  # debug: true
  type: postgres
  dsn: host=postgres user=admin password=<admin's pass> dbname=wireguard port=5432 sslmode=disable TimeZone=Europe/Moscow
  debug: true

web:
  site_company_name: WIREGUARD VPN MYCOMPANYNAME
  external_url: http://localhost:8123
  #external_url: http://127.0.0.1:8123
  listening_address: :8123
  request_logging: true

auth:
  callback_url_prefix: http://localhost:8123/api/v0
  #callback_url_prefix: http://127.0.0.1:8123/api/v0
  #callback_url_prefix: /api/v0

In you example config 'external_url: http://localhost:8123' and 'callback_url_prefix: http://127.0.0.1:8123/api/v0' is different, make all url in one style, at first try to localhost, and use "Ctrl + Shift + I opens the developer tools for the browser" network tab

I'm not sure, but may be something wrong when interacting with backend (postgres DB) image

Try to up wg with default config file, db, credentials, i am sure it's work

The task is using this product with ability to work with postgres. I have already tested V1. It works fine with MySQL backend. I don't know why v2 has such problem. I saw here another issue with similar case (may be testing version contains bugs). #198 and it is still has status "opened".

And You are right, if changing to default db everything is ok!!!

@Sarevok933219 Sarevok933219 changed the title Admin's creds not working Admin's creds not working with backend on Postgres Jan 9, 2024
@Sarevok933219 Sarevok933219 changed the title Admin's creds not working with backend on Postgres Admin's creds not working with backend on Postgresql Jan 9, 2024
@h44z
Copy link
Owner

h44z commented Apr 2, 2024

should be fixed by #231

@h44z h44z closed this as completed Apr 2, 2024
@h44z h44z added bug Something isn't working v2 wg-portal version 2 labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2 wg-portal version 2
Projects
None yet
Development

No branches or pull requests

4 participants