/ 宝塔面板

Ghost1.18 图片上传至又拍云

测试环境:

  • CentOS 7.4
  • 宝塔面板
  • Ghost1.18
  • 又拍云-云存储

通过Git安装

  1. 进入网站根目录下的 content 文件夹
  2. 创建文件夹 adapters
  3. 进入文件夹 adapters ,创建文件夹 storage
# cd /www/wwwroot/test.com/content/adapters/storage
# git clone https://github.com/pupboss/ghost-upyun-store.git

安装依赖关系

# cd ghost-upyun-store
# npm i

添加配置

打开并编辑根目录下的 config.production.json ,添加 storage,如下:

{
  // ...
   "storage": {
    "active": "ghost-upyun-store",
    "ghost-upyun-store": {
      "bucket": "服务名称",
      "operator": "操作员",
      "password": "密码",
      "domain": "加速域名",
      "prefix": "upload/img/",
      "folder": "YYYY/MM/"
    }
  // ...
}

重启服务

# cd /www/wwwroot/test.com
# ghost restart

参考:
https://github.com/doocii/ghost-upyun-store