Parse Dashboard 只能通过 HTTPS 远程访问

Parse Dashboard can only be remotely accessed via HTTPS

我正在尝试在我的 DigitalOcean 的服务器上部署解析服务器和解析仪表板。我通过 docker-compose 安装在这个 git 上: https://github.com/yongjhih/docker-parse-server

当我访问它时,http://rafael-ruiz.es:4040 它说:

Parse Dashboard can only be remotely accessed via HTTPS

所以这些是我的解决方案:

1.- 根据解析 (https://github.com/ParsePlatform/parse-dashboard)

Deploying in production

If you're deploying to a provider like Heroku, or Google App Engine, the SSL endpoint is terminated early and handled by the provider and you may encounter this error: Parse Dashboard can only be remotely accessed via HTTPS.

Before going further, make sure your server cannot be reachable via HTTP. See the provider documentation for force HTTPS connections to your deployment.

Set the environment variable PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 to tell parse server to skip the secure tests.

所以我将我的环境变量设置为 1。但是没有任何反应。

2.- 我已经启用了 https(尝试 https://rafael-ruiz.es). But when I try: https://rafael-ruiz.es:4040 它不起作用。

这有什么问题吗?

谢谢。


问题:

会不会是因为我必须使用我的 SSL 证书配置一些端口?

第一种方式: 您可以在命令行上使用“--allowInsecureHTTP true”参数,并使用配置文件的用户部分进行身份验证:

   {
      "apps": [...],
      "users": [
      {
           "user":"user1",
           "pass":"pass"
      },
      {
           "user":"user2",
           "pass":"pass"
      }
   ]
 }

按照以下步骤获取解析仪表板 运行ning 并可通过 public ip 访问:

  1. 创建配置文件 your-config-filename.json
  2. 向其中添加以下 json 结构,并且不要忘记替换为您的应用值:

{
  "apps": [
    {
      "serverURL": "https://api.parse.com/1",
      "appId": "myAppId",
      "masterKey": "myMasterKey",
      "javascriptKey": "myJavascriptKey",
      "restKey": "myRestKey",
      "appName": "My Parse.Com App"
    },
    {
      "serverURL": "http://localhost:1337/parse",
      "appId": "myAppId",
      "masterKey": "myMasterKey",
      "appName": "My Parse Server App"
    }
  ],
"users": [
    {
      "user":"user1",
      "pass":"pass"
    },
    {
      "user":"user2",
      "pass":"pass"
    }
  ]
}

  1. 保存配置文件并运行以下命令:

parse-dashboard --config <your-config-filename>.json --allowInsecureHTTP true

尽情享受吧!

变化是

app.use('/parse-dashboard', new ParseDashboard(config.dashboard, { allowInsecureHTTP: true }));

而不是

app.use('/parse-dashboard', ParseDashboard(config.dashboard, true));

您将在 index.js

中找到此代码