cube.js learning cube connection mongodb trial two

I have written before in my mongo cube.js connection (via mongodb bi-connector), did not consider security issues (account && ssl)
The following description is based on the account authentication and ssl problem, the following explanation is simple integration

Preparing the Environment

  • docker-compose mongo
 
version: "3"
services:
    mongo:
        image: mongo
        ports:
            - "27017:27017"

 

 

cube.js Application Integration

  • Initialize the project
cubejs create appdemos - d mongobi
  • 环境变量配置
    .env 配置
    核心是CUBEJS_DB_SSL=true 以及CUBEJS_DB_SSL_REJECT_UNAUTHORIZED=false
 
CUBEJS_DB_HOST=localhost
CUBEJS_DB_NAME=appdemos
CUBEJS_DB_USER=dalong
CUBEJS_DB_PASS=dalong
CUBEJS_WEB_SOCKETS=true
CUBEJS_DB_TYPE=mongobi
CUBEJS_API_SECRET=9c403ecad9d9b1cb62b01c22c22e8b73fc9057a0d9da7795d12c89b4d61d1b690dba2c91d4bd7d8d3d352a881fb5a6d4a5350f0f1859da8a83b87803c45510f3
CUBEJS_DB_SSL=true
CUBEJS_DB_SSL_REJECT_UNAUTHORIZED=false
#CUBEJS_DB_SSL_CA=<SSL_CA>
#CUBEJS_DB_SSL_CERT=<SSL_CERT>
#CUBEJS_DB_SSL_CIPHERS=<SSL_CIPHERS>
#CUBEJS_DB_SSL_PASSPHRASE=<SSL_PASSPHRASE>
#CUBEJS_DB_SSL_REJECT_UNAUTHORIZED=<SSL_REJECT_UNAUTHORIZED>
  • 效果

 

 


数据查询

 

 

参考资料

https://www.cnblogs.com/rongfengliang/p/12313132.html
https://docs.mongodb.com/bi-connector/master/reference/mongosqld/#bin.mongosqld
https://github.com/cube-js/cube.js
https://github.com/cube-js/cube.js/issues/222

Guess you like

Origin www.cnblogs.com/rongfengliang/p/12316369.html