I’ve came across this.
welp…
I lost my password on my localhost installation of ghost2.
and I can’t remember it.
surely, I wanna reset it somehow.
when I click to retrieve it via email I get this warning:
Failed to send email. Reason: connect ETIMEDOUT 108.177.126.27:25.
require('/path/to/ghost/core/server/lib/security/password')
.hash(process.argv[2])
.then(console.log);
I’m trying to replace core/server/lib/security/password
I’m not seeing core/server/lib/security/password
?
Where is this file?
I have DB Browser for SQLite running locally.
I’ve bcrypted a new password and I’ve updated it. But it does not work.
There is an unknown error.
Is there a local log?
The unknown error
is not very helpful.
For example in frameworks like Rails, you get a print out of log data that you can use to debug locally.
Is there any similar available in ghost cli
?
Is there ANY tooling available locally to help? A ghost console
to add new Users, Posts etc… Or some kind of log tailing ability?
1 Like
Hey @stoplion !
That file was extracted to the @tryghost/security
package, as you can see here: Utils/password.js at main · TryGhost/Utils · GitHub
1 Like
egg
October 8, 2020, 9:29am
3
We also have logging built into Ghost, and the Ghost-CLI docs for it are here: https://ghost.org/docs/api/v3/ghost-cli/log/
Mostly posting for myself to remember Thanks a lot for all the help here and in the previous topic.
Copy this to a local file e.g. password.js
Utils/password.js at main · TryGhost/Utils · GitHub
Install npm requirements
npm install bluebird
npm install bcrypt
Make make-password.js
in the same directory as password.js
require('password')
.hash(process.argv[2])
.then(console.log);
Generate password hash
node make-password.js "<your-new-password>"
On ghost:
From command line:
Log into mysql
mysql -u root -p
To see password hash:
SELECT * FROM users;
Update password hash
UPDATE users
SET
password = 'NEW_PASSWORD_HASH'
WHERE id = 1;