Comment 1 for bug 1360458

Revision history for this message
Martijn Evers (mevers) wrote :

For people like me. Who deployed the charm, made the relation and later realised they didn't known the password to login. I have a solution. Taken from the charm's 'db-relation-changed' hook, in the 'set_admin_password' function I extracted the follwing instruction:

1. login with 'juju ssh' on the unit.
2. execute the following code:
> admin_password=mypassword # change your password here
> echo `ruby -e 'require "bcrypt"; puts BCrypt::Password.create(ARGV[0], :cost => 10)' $admin_password`
3. copy the encrypted password returned by echo.
4. login on the mysql database find the correct schema/database (usually named: gitlab) and set the 'encrypted_password' field of a record in the 'users' table to the copied password from step 3.