First, thanks for building the application. I found it very useful to catalog and document my small farm.
I installed FarmOS I used MariusHosting.com as a guide. I set everything up successfully and logged all of my farm’s equipment and details. I haven’t been back to the app in a couple of months, but today when I tried to log in the password is incorrect. I use a password manager, so I know the password is the same. The reset password link never delivers so I’m guessing SMTP setup wasn’t part of the package. I have enabled it on the NAS so other containers are using it, but I’m sure there is a requirement I missed.
Where can I go from here? Is there a way I can reset the password from within Portainer, or otherwise recover the installation so I don’t have to re-enter the data on a new install?
Yea you can definitely get back in. There are a few ways to do it, depending on what you have available.
First, I should say: the MariusHosting.com guide is NOT an official guide, and there are some issues with it that you need to be aware of. It does not provide any guidance on how to update farmOS, which could lead to a broken instance/database if not done correctly. We do NOT recommend running the farmos/farmos:latest version of the farmOS docker image for this reason. It is better to use a specific version (eg: farmos/farmos:3.2.1) and ensure that your update process is manual and intentional. You MUST run database updates after every version update and rebuild the cache. Failure to do so could lead to unexpected/broken installations. Also, be sure to have a backup strategy and backup both your database and your files before every update!
We should reach out to the author of that guide and tell them to make some of these changes.
Back to your original question…
If you have command line access, then the drush command line tool provides a simple way of generate a one-time login link: drush uli
By default, it will generate a link for user 1 (the “root” / admin user). But it has options for other users as well.
If you don’t have the ability to use drush (I would highly recommend figuring out how to, because it can also be used to run database updates and rebuild cache after version updates), then your other option is to edit the farmOS database manually to reset your password.
Drupal (which farmOS is built on) stores hashed passwords in the user database table. So you will need to generate a hash of the password you want to use, and replace the existing one. This page points to a tool you can use to generate a hash (I would recommend using a dummy password initially, and then change it again through the UI once you are logged in): How to reset admin password without email and without drush | DrupalDope
Awesome! That worked perfectly. I ran the command, copied the return data, replaced ‘default’ with my URL and it went right to the reset page.
Thanks for following up with Marius. He has some great walkthroughs and he’s active and always improving the installs. He’ll be pleased to know there is a better way.
I’ll perform backups and make sure it gets installed the proper way before going too much further forward.