File tree Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 10
10
"auto_encryption_opts" : AutoEncryptionOpts (
11
11
key_vault_namespace = "my_encrypted_database.keyvault" ,
12
12
kms_providers = {"local" : {"key" : os .urandom (96 )}},
13
- crypt_shared_lib_path = "lib/mongo_crypt_v1.so" ,
13
+ # crypt_shared_lib_path="lib/mongo_crypt_v1.so",
14
14
),
15
15
"directConnection" : True ,
16
16
},
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -eu
3
3
4
- echo " Starting the container"
4
+ echo " Starting MongoDB Atlas Local container... "
5
5
6
6
IMAGE=${1:- mongodb/ mongodb-atlas-local: latest}
7
7
DOCKER=$( which docker || which podman)
8
8
9
+ # Pull the latest Atlas Local image
9
10
$DOCKER pull $IMAGE
10
11
12
+ # Stop any existing Atlas Local container
11
13
$DOCKER kill mongodb_atlas_local || true
12
14
15
+ # Run Atlas Local
13
16
CONTAINER_ID=$( $DOCKER run --rm -d --name mongodb_atlas_local -p 27017:27017 $IMAGE )
14
17
15
- function wait() {
16
- CONTAINER_ID=$1
17
- echo " waiting for container to become healthy..."
18
+ function wait_for_container() {
19
+ local container_id=$1
20
+ echo " Waiting for container to become healthy..."
21
+ sleep 2
18
22
$DOCKER logs mongodb_atlas_local
19
23
}
20
24
21
- wait " $CONTAINER_ID "
25
+ wait_for_container " $CONTAINER_ID "
22
26
23
- # Sleep for a bit to let all services start.
27
+ # Give services time to start
24
28
sleep 5
29
+
30
+ echo " Starting mongocryptd for Client-Side Field Level Encryption..."
31
+
32
+ # Check if mongocryptd is already running
33
+ if pgrep -x " mongocryptd" > /dev/null; then
34
+ echo " mongocryptd is already running."
35
+ else
36
+ # Start mongocryptd locally
37
+ mongocryptd --port=27020 --bind_ip=127.0.0.1 --logpath=mongocryptd.log --fork
38
+ echo " mongocryptd started on 127.0.0.1:27020"
39
+ fi
40
+
41
+ echo " Atlas Local running on port 27017"
42
+ echo " mongocryptd running on port 27020"
You can’t perform that action at this time.
0 commit comments