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

Add simple way to update Drupal's admin password #193

Merged
merged 6 commits into from
Dec 1, 2021

Conversation

DonRichards
Copy link
Member

@DonRichards DonRichards commented Nov 2, 2021

To make it easier to reset admin password this make command keeps it simple.

To test use the readme instructions at the bottom of the "Secrets" section.

I tested this on mac and linux so it should work for either.

@DonRichards
Copy link
Member Author

Will be adding another step. During the Tech call it was requested to pipe the password into the secrets file. I'll add this to this Pull request.

@DonRichards
Copy link
Member Author

OK, ready for testing. Super simple low hanging fruit

@noahwsmith
Copy link
Contributor

Running this off a make clean and make local gives

noah@bds76spare:~/Code/isle-dc$ make set_admin_password 
Password: 

Setting admin password now
 [success] Changed password for admin.
/bin/sh: 1: cannot create secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD: Permission denied
make: *** [Makefile:365: set_admin_password] Error 2

I dealt with this in the install-profile branch to set ownership of /secrets/live when they are created. I'll add a new commit to bring that into this MR.

@noahwsmith
Copy link
Contributor

Ok, this tests out fully for me. PWD is set in Drupal, I can log in, and the contents of that secret file is correct after the command runs. I'm happy to merge this unless someone else wants to test it first...

@DonRichards
Copy link
Member Author

Thanks for reviewing

@DonRichards
Copy link
Member Author

@Islandora-Devops/committers are we good with merging this?

@seth-shaw-unlv
Copy link
Member

@DonRichards, please resolve conflicts.

@DonRichards
Copy link
Member Author

@seth-shaw-unlv Not sure why it thought there was a conflict but either way it's resolved now.

@seth-shaw-unlv
Copy link
Member

It worked to change the Drupal password but failed to update the live secrets file:

~/isle-dc$ make set_admin_password
Password:

Setting admin password now
 [success] Changed password for admin.
/bin/sh: 1: cannot create secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD: Permission denied
make: *** [Makefile:394: set_admin_password] Error 2

Are we expected to run the make command as root?

@DonRichards
Copy link
Member Author

OH!!! That's what you meant. No that isn't expected.

Copy link
Member

@seth-shaw-unlv seth-shaw-unlv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@seth-shaw-unlv seth-shaw-unlv merged commit 3c60c9d into development Dec 1, 2021
@DonRichards
Copy link
Member Author

@seth-shaw-unlv Got it!! Man that took too long. I added a check that basically looks to see if the Makefile/USER can write to the password file. If not it tries running the echo $password with sudo, otherwise it just echos the password to the file. This seems like the most reasonable approach.

@DonRichards DonRichards deleted the set_admin_pswd branch December 2, 2021 13:16
@DonRichards
Copy link
Member Author

Oh, great! Thanks

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

Successfully merging this pull request may close these issues.

3 participants