I installed openproject in CentOS 7 using docker. I changed the admin password and then I forgot it.
How can I reset it.?
I installed openproject in CentOS 7 using docker. I changed the admin password and then I forgot it.
How can I reset it.?
For newer versions of OpenProject, Ulferts' solution seems not to work, but I was successfull using the information in this guide:
docker ps
.docker exec -u root -it <CONTAINER ID> /bin/bash
RAILS_ENV=production bundle exec rails c
u = User.find_by_login "admin"
u.password=u.password_confirmation='my new password'
u.save
If the settings permit (which is the default), the easiest solution would be to go to the login page (https://[host]/login
) of the OpenProject installation (via a browser) and use the "Forgot your password?" link to have a password reset token send to the email address configured for the admin account.
If that option does not exist, you have to connect to the docker container to get a terminal window on it, e.g. by following this how-to.
Once you have a bash open, issue:
sudo openproject run rails console
which will open a rails console for you.
Once inside, issue:
# retrieve first admin account
admin = User.where(admin: true).first
# change the password
admin.password = admin.password_confirmation = "[The password you choose]"
# Save the change disregarding any errors
admin.save(validate: false)
In case you have more than one admin account on the installation, you will have to narrow down the correct one in the first step by e.g.
# print a list of all admin accounts
pp User.where(admin: true).pluck(:id, :login, :firstname, :lastname, :mail)
# Fetch admin account by id
admin = User.where(id: "[the id]")