From 587344739b3b7b013f4cbc5227bed49cd13dd05e Mon Sep 17 00:00:00 2001 From: huangyingting Date: Thu, 28 Sep 2023 08:15:09 +0000 Subject: [PATCH 1/5] Disable websocket --- src/store-admin/vue.config.js | 2 ++ src/store-front/vue.config.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/store-admin/vue.config.js b/src/store-admin/vue.config.js index 8f65590e..0fe86299 100644 --- a/src/store-admin/vue.config.js +++ b/src/store-admin/vue.config.js @@ -12,6 +12,8 @@ module.exports = defineConfig({ port: 8081, host: '0.0.0.0', allowedHosts: 'all', + client: false, + webSocketServer: false, setupMiddlewares: (middlewares, devServer) => { if (!devServer) { diff --git a/src/store-front/vue.config.js b/src/store-front/vue.config.js index ea48fdad..5a52d0ab 100644 --- a/src/store-front/vue.config.js +++ b/src/store-front/vue.config.js @@ -11,7 +11,8 @@ module.exports = defineConfig({ port: 8080, host: '0.0.0.0', allowedHosts: 'all', - + client: false, + webSocketServer: false, setupMiddlewares: (middlewares, devServer) => { if (!devServer) { From ad240252be1817b5a41797f508d5e0e3bbfba5ca Mon Sep 17 00:00:00 2001 From: huangyingting Date: Thu, 28 Sep 2023 08:57:39 +0000 Subject: [PATCH 2/5] Update mongodb --- src/makeline-service/mongodb.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/makeline-service/mongodb.go b/src/makeline-service/mongodb.go index 656c78bc..c90ba3b6 100644 --- a/src/makeline-service/mongodb.go +++ b/src/makeline-service/mongodb.go @@ -51,8 +51,7 @@ func connectToMongoDB() (*mongo.Collection, error) { SetAuth(options.Credential{ Username: mongoUser, Password: mongoPassword, - }). - SetTLSConfig(&tls.Config{InsecureSkipVerify: true}) + }) } mongoClient, err := mongo.Connect(ctx, clientOptions) From 316d13317ed65aef20f14fed50c6cd84b812b405 Mon Sep 17 00:00:00 2001 From: huangyingting Date: Thu, 28 Sep 2023 08:59:33 +0000 Subject: [PATCH 3/5] Update makeline-service --- src/makeline-service/mongodb.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/makeline-service/mongodb.go b/src/makeline-service/mongodb.go index c90ba3b6..a0bb7966 100644 --- a/src/makeline-service/mongodb.go +++ b/src/makeline-service/mongodb.go @@ -2,7 +2,6 @@ package main import ( "context" - "crypto/tls" "log" "net/http" "os" From ae4f76ddc68dff0c2a0f564f5aea67cdf6ebab90 Mon Sep 17 00:00:00 2001 From: huangyingting Date: Thu, 28 Sep 2023 09:16:31 +0000 Subject: [PATCH 4/5] Update store app --- src/makeline-service/mongodb.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/makeline-service/mongodb.go b/src/makeline-service/mongodb.go index a0bb7966..6f5b81de 100644 --- a/src/makeline-service/mongodb.go +++ b/src/makeline-service/mongodb.go @@ -48,6 +48,7 @@ func connectToMongoDB() (*mongo.Collection, error) { } else { clientOptions = options.Client().ApplyURI(mongoUri). SetAuth(options.Credential{ + AuthSource: mongoDb, Username: mongoUser, Password: mongoPassword, }) From cbe906c653617d6bb2fc69d473464ac30694a7aa Mon Sep 17 00:00:00 2001 From: Paul Yu Date: Tue, 5 Dec 2023 14:51:53 -0800 Subject: [PATCH 5/5] adding suggested changes --- src/makeline-service/mongodb.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/makeline-service/mongodb.go b/src/makeline-service/mongodb.go index 6f5b81de..843d1689 100644 --- a/src/makeline-service/mongodb.go +++ b/src/makeline-service/mongodb.go @@ -2,6 +2,7 @@ package main import ( "context" + "crypto/tls" "log" "net/http" "os" @@ -49,9 +50,10 @@ func connectToMongoDB() (*mongo.Collection, error) { clientOptions = options.Client().ApplyURI(mongoUri). SetAuth(options.Credential{ AuthSource: mongoDb, - Username: mongoUser, - Password: mongoPassword, - }) + Username: mongoUser, + Password: mongoPassword, + }). + SetTLSConfig(&tls.Config{InsecureSkipVerify: false}) } mongoClient, err := mongo.Connect(ctx, clientOptions)