简体   繁体   English

Google App Engine + MongoDB(带有SSL证书)

[英]Google App Engine + MongoDB (w/ SSL Certificate)

I'm in the final stages of launching a website complete w/ a few data visualization apps and user authentication capabilities. 我正处于启动完整的网站(带有一些数据可视化应用程序和用户身份验证功能)的最后阶段。 User data is stored in MongoDB on an external server (GCP instance that we manage), and SSL authentication is required. 用户数据存储在外部服务器(我们管理的GCP实例)上的MongoDB中,并且需要SSL身份验证。 The problem I'm running into is the following: 我遇到的问题如下:

In order to connect to MongoDB (create/authenticate/update user information) the path to the ssl certificate is required ("ssl_ca_certs" argument w/in the MongoDB URI). 为了连接到MongoDB(创建/认证/更新用户信息),需要ssl证书的路径(在MongoDB URI中带有“ ssl_ca_certs”参数)。 On a GCP instance (or locally) this is no big deal... just type in the absolute path of the SSL certificate and we're connected, however Google App Engine doesn't appear to have any readable/writable local filesystem, which makes me wonder if using the ssl_ca_certs argument is even possible. 在GCP实例(或本地)上,这没什么大不了的……只需输入SSL证书的绝对路径即可连接到我们,但是Google App Engine似乎没有任何可读/可写的本地文件系统,让我想知道是否甚至可以使用ssl_ca_certs参数。

Has anyone had any experience connecting to MongoDB from GAE using an SSL certificate? 有没有人有使用SSL证书从GAE连接到MongoDB的经验? If so, what was the solution? 如果是这样,解决方案是什么?

Thanks! 谢谢!

If I understood correctly, you need a readable/writable file system to work with GAE. 如果我理解正确,那么您需要一个可读/可写的文件系统来使用GAE。

You can use GCS (Google Cloud Storage) to write and read your files from GAE (Standard {1} and Flexible {2}). 您可以使用GCS(Google云存储)从GAE(标准{1}和灵活{2})写入和读取文件。

Maybe another good solution is using environment variables inside your app.yaml {3},{4}. 也许另一个好的解决方案是在app.yaml {3},{4}中使用环境变量。

{1}: https://cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/read-write-to-cloud-storage {1}: https//cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/read-write-to-cloud-storage

{2}: https://cloud.google.com/appengine/docs/flexible/python/using-cloud-storage {2}: https//cloud.google.com/appengine/docs/flexible/python/using-cloud-storage

{3}: https://cloud.google.com/appengine/docs/standard/python/config/appref {3}: https//cloud.google.com/appengine/docs/standard/python/config/appref

{4}: https://cloud.google.com/appengine/docs/flexible/nodejs/runtime#environment_variables {4}: https//cloud.google.com/appengine/docs/flexible/nodejs/runtime#environment_variables

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM