2

I have a Ghost app instance running on Open Shift. For some reason when I try to login into myapp.domain/ghost it is no longer able to find my email.

How do I change the admin email settings?

user247702
  • 23,641
  • 15
  • 110
  • 157
HGB
  • 2,157
  • 8
  • 43
  • 74

2 Answers2

4

I've adapted the following from the reference given by @niharvey in his step 5, which is unluckily offline. The complete procedure including the missing steps would be as follows:

What you need:

  • root (not really, just writing permissions)
  • Path to database ($OPENSHIFT_REPO_DIR/content/data)
  • Bcrypt hash of desired password (we'll call it bcrypt-hash)
  • Email address used (select statement below)

SSH to your app:

rhc ssh appname

Start sqlite with appropriate database path:

$ cd $OPENSHIFT_REPO_DIR/content/data
$ sqlite3 ghost.db

Display data, such as email address used and column names (optional):

sqlite> PRAGMA table_info(users);
sqlite> select * from users;
sqlite> select email from users;

Unlock account and reset password:

sqlite> update users set status = 'active' ;
sqlite> UPDATE users SET password = 'bcrypt-hash' WHERE email = 'youremail@gmail.com';
JorgeGT
  • 157
  • 4
  • 9
1

The process to reset the password is relatively simple.

  1. ssh into your gear
    rhc ssh <yourappname>
  2. cd into your app dir
    cd app-root/runtime/repo
    Note: This is the location of your application code and you can also cd to it by using the OPENSHIFT_REPO_DIR environment varaible
  3. cd into the sqlite database directory
    cd content/data
  4. Login to your sqlite instance
    sqlite3 ghost.db
  5. And use the directions from http://www.poisoncontrolcentre.org/changing-your-admin-password-manually/
niharvey
  • 2,807
  • 2
  • 15
  • 24
  • 2
    The site is down, that's why it's recommended to write out answers completely instead of redirecting to a external webpage. Luckily archive.org had a snapshot, so I've provided the instructions as a new answer. – JorgeGT Sep 13 '14 at 17:29