解析服务器S3文件适配器无法正常工作

时间:2016-08-16 17:31:28

标签: parse-platform amazon-s3 parse-server

我一直试图设置S3 File Adapter而没有运气。我正在使用PM2启动Parse Server,这是我的ecosystem.json文件:

 "apps" : [{
    "name"        : "parse-wrapper",
    "script"      : "/usr/bin/parse-server",
    "watch"       : true,
    "merge_logs"  : true,
    "cwd"         : "/home/parse",
    "env": {
      "PARSE_SERVER_CLOUD_CODE_MAIN": "/home/parse/cloud/main.js",
      "PARSE_SERVER_DATABASE_URI": "myuri",
      "PARSE_SERVER_APPLICATION_ID": "myappid",
      "PARSE_SERVER_MASTER_KEY": "my master key",
      "PARSE_SERVER_JAVASCRIPT_KEY": "myjskey",
      "PARSE_SERVER_FILES_ADAPTER": "parse-server-s3-adapter",
      "S3_ACCESS_KEY": "MYS3ACCESSKEY",
      "S3_SECRET_KEY": "MYS3SECRETKEY",
      "S3_BUCKET": "thenameofmybucket"
    }
  }]
}

任何帮助将不胜感激:)

1 个答案:

答案 0 :(得分:0)

虽然这个问题是一年前的,但我希望解决方案可以帮助其他人,因为我也花了很多时间研究pm2设置。

"env": {
    "PARSE_SERVER_FILES_ADAPTER": {
      "module": "parse-server-s3-adapter",
      "options": {
        "accessKey": "MYS3ACCESSKEY",
        "secretKey": "MYS3SECRETKEY",
        "bucket": "thenameofmybucket",
        "region": "ap-southeast-1",
        "bucketPrefix": "",
        "directAccess": true,
        "baseUrl": null,
        "baseUrlDirect": false,
        "signatureVersion": "v4",
        "globalCacheControl": null,
        "ServerSideEncryption": "AES256|aws:kms"
      }
}

您可以修改accessKeysecretKeybucketregion

的值