screenrev / ghost-s3

S3 file module for Ghost blog
16 stars 10 forks source link

Plugin wiki needs updating #5

Open conor909 opened 8 years ago

conor909 commented 8 years ago

In the following instructions for this repo this first line of code storage = require('./' + storageChoice); doesn't exist.

Plug In

Until Ghost has a file module system, you will have to change the file storage/index storage = require('./' + storageChoice);

becomes

storage = require('ghost-s3')({
        errors: errors,
        config: require('../config')().aws
    });
hadifarnoud commented 8 years ago

I have exact issue, how did you solve it @conor909 ?

conor909 commented 8 years ago

I fixed it because in my case I was trying to install Ghost on heroku, which is why I needed ghost-s3. But instead I found this repo: https://github.com/cobyism/ghost-on-heroku, Its a 1 click button which installs ghost automatically to heroku. All I needed to do was input my s3 credentials, which is great.

If your also working on heroku you'll need to read this: I later discovered that heroku has changed something which means you cant clone the repo from heroku to your local machine (it says your repo is empty). So I got around this by directly cloning the repo from https://github.com/cobyism/ghost-on-heroku, then pushing to heroku.

If your not working with Heroku you might want to see the ghost-on-heroku repo anyway because it has a working s3 file. Check out https://github.com/cobyism/ghost-on-heroku/blob/master/content/storage/ghost-s3, it uses a different library called ghost-s3-storage

hadifarnoud commented 8 years ago

don't know what the end result would be for package.json. can you share yours?

conor909 commented 8 years ago

I actually decided not to go with ghost as a blogging platform, so I deleted that package.json. But look at the package in the repository I mentioned https://github.com/cobyism/ghost-on-heroku/blob/master/package.json

hadifarnoud commented 8 years ago

yeah, that package.json file seems incomplete comparing to Ghost's

ErisDS commented 8 years ago

It is completely unnecessary to edit core files in order to install a storage module, the README on this repo is incorrect.

Instead of editing core files, you need to move the module from the node_modules folder, to live in content/storage as explained in the guide provided by Ghost: https://github.com/TryGhost/Ghost/wiki/Using-a-custom-storage-module

The commands to do this (run after doing the npm install in the README) should be something like this:

mkdir content/storage (make the storage folder if it doesn't exist yet) cp node_modules/ghost-s3 content/storage/ghost-s3 (copy the ghost-s3 module into the right location)

And then it will work... no need for editing core files & no module loss when upgrading Ghost.