Changing Ghost Admin Panel Address

There are 2 issue entries in the repository.

They are both rejected, and the answer is "rewrite via proxy".

Unfortunately, that is not possible. Server side generated Javascripts include hardcoded links such as window.location = "/ghost/..."; and that makes a simple rewrite proxy impossible.

Maybe the product owners are right for their own, they don't want to complicate things. They also like simplicity; because advanced users will tinker with it and they'll eventually find a way. Maybe they don't want to make things complicated for standart users. I don't know.

But what if standart users want to use "Security Through Obscurity"?

I couldn't find a gentle way to do this (yet) but a hacky way without changing server codes is available via duplication of Ghost servers.

  1. Create a second blog.
    mkdir /var/www/ghost2/ && unzip -uo ghost.zip -d /var/www/ghost2
  2. Copy config.js from your first blog.
    cp /var/www/ghost1/config.js /var/www/ghost2/config.js
  3. Change production url and server port in your second blog.
    rvim /var/www/ghost2/config.js
  4. symlink old ghost.db to it.
    ln -s /var/www/ghost1/content/data/ghost.db /var/www/ghost2/content/data/ghost.db
  5. Install your second blog & start.
    cd /var/www/ghost2/ && npm install --production && npm start --production
  6. Make your main blog's ~ /ghost/ address return 404; then define new Ghost server to another endpoint (i.e. /somewhereelse/).
    rvim /etc/nginx/sites-available/...conf && service nginx reload
  7. Login via new endpoint.
    https://example.com/somewhereelse/ghost/
  8. Your blog will still be accessible via old urls, but this another addition justfor you to access your administration panel.

As far as I know, database files do not contain blog endpoint, and navigation links are stored relatively. So, for Ghost version 0.9.0, you are safe to symlink database file and update it via another endpoint.

Until I find a better solution, this will do the trick.

Hope this helps someone.

Comments

comments powered by Disqus