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 1010 "auto_encryption_opts" : AutoEncryptionOpts (
1111 key_vault_namespace = "my_encrypted_database.keyvault" ,
1212 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",
1414 ),
1515 "directConnection" : True ,
1616 },
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -eu
33
4- echo " Starting the container"
4+ echo " Starting MongoDB Atlas Local container... "
55
66IMAGE=${1:- mongodb/ mongodb-atlas-local: latest}
77DOCKER=$( which docker || which podman)
88
9+ # Pull the latest Atlas Local image
910$DOCKER pull $IMAGE
1011
12+ # Stop any existing Atlas Local container
1113$DOCKER kill mongodb_atlas_local || true
1214
15+ # Run Atlas Local
1316CONTAINER_ID=$( $DOCKER run --rm -d --name mongodb_atlas_local -p 27017:27017 $IMAGE )
1417
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
1822 $DOCKER logs mongodb_atlas_local
1923}
2024
21- wait " $CONTAINER_ID "
25+ wait_for_container " $CONTAINER_ID "
2226
23- # Sleep for a bit to let all services start.
27+ # Give services time to start
2428sleep 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