Skip to content

gitlexin/ghost-oss-store

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • 4.x
  • 3.x
  • 2.x
  • 1.x
  • 0.x

Installation

Via Git

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

  • Create a new folder inside /content called /adapters/storage

  • Clone this repo to /content/adapters/storage

    cd [path/to/ghost]
    mkdir -p ./content/adapters/storage
    cd ./content/adapters/storage
    mkdir oss-store && cd oss-store
    git clone https://github.com/gitlexin/ghost-oss-store ./
    npm install
    

Configuration

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

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
      folderByDate: true, // add date folder, e.g. 201901
      filenameWithRandam: true, // add randam string after filename
      maxPixel: 2000, // max width or height to 2000px
      prefix: 'ghost/',  // { String } will be formated by moment.js, using `[]` to escape,
      suffix: '' // { String } string added before file extname.
    }
  }
}

License

Read LICENSE

About

Ghost Aliyun OSS storage module.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%