File tree Expand file tree Collapse file tree 4 files changed +7
-17
lines changed
Expand file tree Collapse file tree 4 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ def backup(req: HttpRequest) -> HttpResponse:
308308def mongo_health (req : HttpRequest ) -> HttpResponse :
309309 if req .method == "GET" :
310310 if not engine .is_mongodb_running ():
311- return HttpResponseBadRequest (f"MongoDB is downnn at: mongodb:// { engine .mongo_user } : { engine . mongo_password } @ { engine . mongo_host } : { engine . mongo_port } / { engine . mongo_db } ? { engine . mongo_params } " )
311+ return HttpResponseBadRequest (f"MongoDB is downnn at: { engine .mongo_uri } " )
312312 else :
313313 return HttpResponse ("MongoDB is up" )
314314 else :
Original file line number Diff line number Diff line change @@ -10,11 +10,6 @@ POSTGRES_PORT = 5432
1010POSTGRES_USERNAME = postgres
1111POSTGRES_PASSWORD = postgres
1212POSTGRES_DATABASE = bwwc
13- MONGO_HOST = mongo
14- MONGO_PORT = 27017
15- MONGO_USER = bwwc
16- MONGO_PASSWORD = mongo
17- MONGO_DB = bwwc
18- MONGO_PARAMS = " "
13+ MONGO_URI = mongodb://mongo:27017
1914DJANGO_ALLOWED_HOSTS = " "
2015ALLOW_ALL_HOSTS = false
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ SECRET_KEY = mysecret
22PRIME = 2
33BASE_URL = http://localhost:8000
44THRESHOLD = 3
5- MONGO_HOST = mongodb://localhost:27017/
65REDIS_HOST = localhost
76REDIS_PW = secure_password
87AUTH_PK_API = https:/auth-service.sail.codes/public-key
@@ -11,11 +10,6 @@ POSTGRES_PORT = 5432
1110POSTGRES_USERNAME = postgres
1211POSTGRES_PASSWORD = postgres
1312POSTGRES_DATABASE = bwwc
14- MONGO_HOST = localhost
15- MONGO_PORT = 27017
16- MONGO_USER = bwwc
17- MONGO_PASSWORD = mongo
18- MONGO_DB = bwwc
19- MONGO_PARAMS = " "
13+ MONGO_URI = mongodb://localhost:27017/
2014DJANGO_ALLOWED_HOSTS = " "
2115ALLOW_ALL_HOSTS = false
Original file line number Diff line number Diff line change @@ -34,14 +34,15 @@ class MPCEngine(object):
3434 def __init__ (self , protocol : str = "shamirs" , prime : int = 180252380737439 ):
3535 self .logger = logging .getLogger ("django" )
3636
37- self .mongo_host = os .environ .get ("MONGO_HOST" )
37+ ''' self.mongo_host = os.environ.get("MONGO_HOST")
3838 self.mongo_port = os.environ.get("MONGO_PORT")
3939 self.mongo_user = urllib.parse.quote_plus(os.environ.get("MONGO_USER", "bwwc"))
4040 self.mongo_password = urllib.parse.quote_plus(os.environ.get("MONGO_PASSWORD"))
4141 self.mongo_db = os.environ.get("MONGO_DB", "bwwc")
4242 self.mongo_params = os.environ.get("MONGO_PARAMS", "")
43- mongo_uri = f"mongodb://{ self .mongo_user } :{ self .mongo_password } @{ self .mongo_host } :{ self .mongo_port } /{ self .mongo_db } ?{ self .mongo_params } "
44- self .logger .info (f"Connection URI is: { mongo_uri } " )
43+ mongo_uri = f"mongodb://{self.mongo_user}:{self.mongo_password}@{self.mongo_host}:{self.mongo_port}/{self.mongo_db}?{self.mongo_params}"'''
44+ self .mongo_uri = os .environ .get ("MONGO_URI" , "mongodb://localhost:27017/" )
45+ self .logger .info (f"Connection URI is: { self .mongo_uri } " )
4546
4647 self .mongo_client = MongoClient (mongo_uri )
4748
You can’t perform that action at this time.
0 commit comments