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

Login after deployment #109

Open
Neodyn opened this issue Nov 10, 2022 · 6 comments
Open

Login after deployment #109

Neodyn opened this issue Nov 10, 2022 · 6 comments

Comments

@Neodyn
Copy link

Neodyn commented Nov 10, 2022

Login is not possible with the provided default credentials:
The default credentials are user / user and admin / admin

Also edit of the existing account "admin" with sudo docker exec -it taranis-ng-core-1 python manage.py account -e --username admin --password admin does not work.

@dodancs
Copy link
Collaborator

dodancs commented Nov 10, 2022

Hi @Neodyn,

This is a duplicate of #92 . Nevertheless, the default user accounts are supposed to be added by the following migration ac311a84207a_added_default_user_accounts.py.

Can you please provide a dump of your database for us to verify that all migrations have been run? To do this, simply run the following command and attach the resulting export.sql file to a comment under this Issue:

docker exec taranis-ng-database-1 pg_dump --data-only -U taranis-ng -d taranis-ng > export.sql

If you are unable to run this command, it probably means the name of the container is different, so you can find the name by doing docker ps -a | grep taranis and find a container name that has the word database in it: taranis-ng_database_1. Then replace the original name in the previous command with it like so:

docker exec <CONTAINER_NAME> pg_dump --data-only -U taranis-ng -d taranis-ng > export.sql

====

docker exec taranis-ng_database_1 pg_dump --data-only -U taranis-ng -d taranis-ng > export.sql

Thank you.

@Neodyn
Copy link
Author

Neodyn commented Nov 10, 2022

export.txt

@dodancs
Copy link
Collaborator

dodancs commented Nov 10, 2022

export.txt

I can see that the user accounts are present in your database (both the admin and user usernames). All of the migrations have also been run.

Can you please provide us with the logs from all of the containers while you attempt to log in? You can achieve this with the following commands:

docker-compose -f docker/docker-compose.yml down --remove # this should remove all containers, also clear logs
docker-compose -f docker/docker-compose.yml down # if the above command does not work, try without --remove
docker-compose -f docker/docker-compose.yml up -d # bring the container back up
# wait for TNG to boot up
# try to log in with default credentials, eg. admin/admin or user/user
docker-compose -f docker/docker-compose.yml logs > logs.txt # export the logs for all containers

@Neodyn
Copy link
Author

Neodyn commented Nov 10, 2022

Thank you for your support.
logs.txt

@milankowww
Copy link
Collaborator

This issue went quitet for some time. Let me pick it up:

  • your "core" container is not getting the login requests from the GUI.
  • I can see you are not accessing it via "localhost" but through an IP address and port.
  • Most likely, the GUI is still configured to access localhost and not the remote IP so when you log in, your login requests are shooting nowhere.

when you do docker inspect taranis-ng-gui-1 focus on these env variables:
"Env": [
"VUE_APP_TARANIS_NG_CORE_API=https://localhost:4443/api/v1",
"VUE_APP_TARANIS_NG_CORE_SSE=https://localhost:4443/sse",
"VUE_APP_TARANIS_NG_URL=https://localhost:4443",

you can change their values by editing docker/.env and recreating the containers.

This is how it looks like on my side, for instance. You need to change localhost to your intended hostname.

# Web host and ports
TARANIS_NG_HOSTNAME=localhost
TARANIS_NG_HTTPS_PORT=4443
TARANIS_NG_HTTP_PORT=8080
TARANIS_NG_HTTPS_URI=https://localhost:4443

@StefC93
Copy link

StefC93 commented Feb 22, 2023

(i know it's an old issue but it's still open so it might still be helpful, if not for others)

@Neodyn. I had this same issue and fixed it with the following steps:

  • In the docker .env file, change values of "TARANIS_NG_HOSTNAME" & "TARANIS_NG_HTTPS_URI" from localhost to the IP you want to reach it on
  • Restart containers
  • Refresh browser cache (Ctrl+F5) <--- browser cache was the issue
  • Issue fixed and you can log in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants