当前位置: 动力学知识库 > 问答 > 编程问答 >

Locked out of Ghost Blog on OpenShift

问题描述:

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?

网友答案:

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 = '[email protected]';
网友答案:

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/
分享给朋友:
您可能感兴趣的文章:
随机阅读: