d3vilh / openvpn-ui

Web User Interface for OpenVPN
MIT License
169 stars 39 forks source link

Standalone Install Username/Password #52

Closed Alex-Giaquinto closed 2 months ago

Alex-Giaquinto commented 4 months ago

I just tried doing the standalone install a few times and every time after following the instructions I cannot login. I use the export commands for both username and password but cannot get in.

d3vilh commented 4 months ago

Hi @Alex-Giaquinto, Thanks for the reporting. Vars export should be done before the first start of the container (otherwise it will not create user correctly).

For you solution will be following: Stop application. Drop database file:

kalimera@kaliserver:~/openvpn-server/db $ rm data.db
rm: remove write-protected regular file 'data.db'? yes

this will clear all UI users configuration.

Then run export again:

export OPENVPN_ADMIN_USERNAME=admin
export OPENVPN_ADMIN_PASSWORD=MyPassword

Double check that environment is updated properly

echo $OPENVPN_ADMIN_USERNAME
echo $OPENVPN_ADMIN_PASSWORD

The output will be:
admin
MyPassword

Then start application again. It will create all the users and hash your password into DB. For security reasons you have to unset these vars after success login, so it will be removed from the local server environment:

unset OPENVPN_ADMIN_USERNAME
unset OPENVPN_ADMIN_PASSWORD

This username and password export needs to be done only once, on the first application run, when application creates DB and users for access.

Alex-Giaquinto commented 4 months ago

Hey! @d3vilh sorry for the late reply. Thanks for the detailed response! So I did all of this and I am still unable to get in. Anything I can show you that might help?

d3vilh commented 3 months ago

Anything I can show you that might help?

Hi @Alex-Giaquinto, sorry for the late reply! My main job has been super demanding lately 🙃

Yes, if you could share your session log, like commands you execute one by one with output it would be very nice (hide passwords) and running application log. This would help with debugging.

I also did short update for Standalone installation procedure.

d3vilh commented 2 months ago

Pin this one and closing.