Code Monkey home page Code Monkey logo

ghost-qcloud-cos-store's Introduction

Ghost QCloud(TencentYun) COS Storage

This is an implement of Ghost custom storage module allows you to store images over QCloud instead of local disk.

Supported

This module works well with 1.x. I haven't test it on 0.x. If you have any problem, please submit an issue.

Installation

Via NPM

  • Install ghost-qcloud-cos-store

    npm install ghost-qcloud-cos-store
    
  • Go to ghost/content/adapters/storage. If content folder is empty, create the folders first.

  • Create a file named qcloud-cos-store.js with the content blow:

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

Via Git

  • Go to ghost/content/adapters/storage. If content folder is empty, create the folders first.

  • Clone this repo to storage

    cd ghost/content/adapters/storage
    git clone https://github.com/zkd8907/ghost-qcloud-cos-store.git qcloud-cos-store
    
  • Install dependencies

    cd qcloud-cos-storage
    npm install
    

Configuration

Edit ghost/config.production.json and add a new storage key to specify the custom storage.

{
  ...
  "storage": {
    "active": "qcloud-cos-store",
    "qcloud-cos-store": {
      "Bucket": "{BucketName}-{AppId}",
      "Region": "{BucketRegion}",
      "SecretId": "{SecretId}",
      "SecretKey": "{SecretKey}",
      "staticDomain": "https://static.zkd.me"
    }
  }
}

All the keys are necessary except staticDomain.

The value of active must be the same with the name of the file(Via NPM) or the folder(Via Git) in ghost/content/adapters/storage. You can find your Bucket Name, Appid, SecureId and SecureKey at your console of QCloud. The all regions are listed at https://cloud.tencent.com/document/product/436/6224.

staticDomain is optional. Normally, you need to specify a CDN domain to visit the full URL starts with http or https.

License

Read LICENSE

ghost-qcloud-cos-store's People

Contributors

zkd8907 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ghost-qcloud-cos-store's Issues

有可能添加命名支持吗?

就是类似这样的,以hash之类的重命名。和前缀支持,年月等。

  fileKey: {
       //使用Qiniu hash作为文件basename,如果设置,`safeString`将被忽略 
      hashAsBasename: false,
      safeString : true,//使用Ghost safaString util重命名文件名,例如中文到拼音 
      前缀: ' YYYY / MM / ',// {String}将由moment.js格式化,使用`[]`来转义,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.