File tree 4 files changed +12
-6
lines changed
4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
1
from pymongo .mongo_client import MongoClient
2
2
from beacon .connections .mongo import conf
3
- import os
4
3
5
4
if conf .database_cluster :
6
5
uri = "mongodb+srv://{}:{}@{}/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000" .format (
18
17
conf .database_auth_source
19
18
)
20
19
21
- if os .path .isfile (conf .database_certificate ):
22
- uri += '&tls=true&tlsCertificateKeyFile={}' .format (conf .database_certificate )
23
- if os .path .isfile (conf .database_cafile ):
24
- uri += '&tlsCAFile={}' .format (conf .database_cafile )
20
+ if conf .database_certificate != '' and conf .database_cafile != '' :
21
+ uri += '&tls=true&tlsCertificateKeyFile={}&tlsCAFile={}' .format (conf .database_certificate , conf .database_cafile )
25
22
26
23
client = MongoClient (uri )
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ services:
57
57
db :
58
58
image : mongo:5
59
59
command : --wiredTigerCacheSizeGB 4
60
+ # command: --wiredTigerCacheSizeGB 4 --sslMode requireSSL --tlsCertificateKeyFile test-server1.pem --tlsCAFile test-ca.pem
60
61
hostname : mongo
61
62
container_name : mongoprod
62
63
ports :
@@ -71,6 +72,9 @@ services:
71
72
- ./beacon/connections/mongo/data/db:/data/db
72
73
- ./beacon/connections/mongo/data/configdb:/data/configdb
73
74
- ./beacon/connections/mongo/data/caseLevelData:/data/caseLevelData
75
+ # - ./test-server1.pem:/test-server1.pem
76
+ # - ./test-ca.pem:/test-ca.pem
77
+ # - ./test-client.pem:/test-client.pem
74
78
# command: --verbose
75
79
76
80
beacon-ri-tools :
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ services:
68
68
db :
69
69
image : mongo:5
70
70
command : --wiredTigerCacheSizeGB 4
71
+ # command: --wiredTigerCacheSizeGB 4 --sslMode requireSSL --tlsCertificateKeyFile test-server1.pem --tlsCAFile test-ca.pem
71
72
hostname : mongo
72
73
container_name : mongoprod
73
74
ports :
@@ -82,6 +83,9 @@ services:
82
83
- ./beacon/connections/mongo/data/db:/data/db
83
84
- ./beacon/connections/mongo/data/configdb:/data/configdb
84
85
- ./beacon/connections/mongo/data/caseLevelData:/data/caseLevelData
86
+ # - ./test-server1.pem:/test-server1.pem
87
+ # - ./test-ca.pem:/test-ca.pem
88
+ # - ./test-client.pem:/test-client.pem
85
89
networks :
86
90
- pub
87
91
# command: --verbose
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ aiohttp-middlewares==2.4.0
8
8
aiohttp-jinja2 == 1.5
9
9
aiohttp-session == 2.9.0
10
10
asyncpg == 0.24.0
11
- cryptography == 39 .0.1
11
+ cryptography == 41 .0.5
12
12
PyJWT == 2.7.0
13
13
python-dotenv == 1.0.1
14
14
jsonschema == 4.21.1
@@ -17,6 +17,7 @@ loguru==0.7.2
17
17
pyyaml == 6.0.1
18
18
dataclasses-json == 0.5.6
19
19
pymongo [srv ]== 4.0.1
20
+ pyopenssl == 23.3.0
20
21
coverage == 7.6.0
21
22
requests == 2.25.1
22
23
pydantic == 2.6.2
You can’t perform that action at this time.
0 commit comments