1.2.0 • Published 6 months ago

ghost-oss-store-feifei v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Ghost Aliyun OSS Storage

NPM version

This Ghost custom storage module allows you to store media file with Aliyun OSS instead of storing at local machine.

Supported

  • 1.x
  • 0.x

Installation

Via NPM

  • Install Oss storage module

    npm install ghost-oss-store
  • Make the storage folder if it doesn't exist yet

    mkdir -p content/adapters/storage
  • Create a script named "oss-store.js", content as follow:

    //  content/adapters/storage/oss-store.js

module.exports = require('ghost-oss-store');

### Via Git

In order to replace the storage module, the basic requirements are:

- Create a new folder inside `/content` called `/storage`

- Clone this repo to `/storage`

cd path/to/ghost/content/storage mkdir oss-store && cd oss-store git clone https://github.com/MT-Libraries/ghost-oss-store ./

- Install dependencies

npm install

## Configuration

In your `config.js` file, you'll need to add a new `storage` block to whichever environment you want to change:

```javascript
storage: {
active: 'oss-store',
'oss-store': {
  accessKeyId: 'accessKeyId',
  accessKeySecret: 'accessKeySecret',
  bucket: 'bucket',
  region: 'oss-cn-hangzhou',
  origin: 'https://www.thonatos.com/', // if you have bind custom domain to oss bucket. or false             
  fileKey: {
    safeString: true, // use Ghost safaString util to rename filename, e.g. Chinese to Pinyin
    prefix: 'ghost/',  // { String } will be formated by moment.js, using `[]` to escape,
    suffix: '' // { String } string added before file extname.
  }
}
}

License

Read LICENSE

1.2.0

6 months ago

1.1.7

6 months ago

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago