File tree Expand file tree Collapse file tree 3 files changed +30
-19
lines changed Expand file tree Collapse file tree 3 files changed +30
-19
lines changed Original file line number Diff line number Diff line change 44from mongodb_settings import * # noqa: F403
55from pymongo.encryption import AutoEncryptionOpts
66
7+ os.environ["LD_LIBRARY_PATH"] = os.environ["GITHUB_WORKSPACE"] + "/lib/"
8+
79DATABASES["encrypted"] = { # noqa: F405
810 "ENGINE": "django_mongodb_backend",
911 "NAME": "djangotests_encrypted",
1012 "OPTIONS": {
1113 "auto_encryption_opts": AutoEncryptionOpts(
1214 key_vault_namespace="djangotests_encrypted.__keyVault",
1315 kms_providers={"local": {"key": os.urandom(96)}},
16+ crypt_shared_lib_path=os.environ["GITHUB_WORKSPACE"] + "/lib/mongo_crypt_v1.so",
1417 ),
1518 "directConnection": True,
1619 },
Original file line number Diff line number Diff line change @@ -52,26 +52,10 @@ jobs:
5252 - name: Start local Atlas
5353 working-directory: .
5454 run: bash .github/workflows/start_local_atlas.sh mongodb/mongodb-atlas-local:8.0.15
55- - name: Install mongosh
55+ - name: Download crypt shared
5656 run: |
57- wget -q https://downloads.mongodb.com/compass/mongosh-2.2.10-linux-x64.tgz
58- tar -xzf mongosh-*-linux-x64.tgz
59- sudo cp mongosh-*-linux-x64/bin/mongosh /usr/local/bin/
60- mongosh --version
61- - name: Install mongocryptd from Enterprise tarball
62- run: |
63- curl -sSL -o mongodb-enterprise.tgz "https://downloads.mongodb.com/linux/mongodb-linux-x86_64-enterprise-ubuntu2204-8.0.15.tgz"
64- tar -xzf mongodb-enterprise.tgz
65- sudo cp mongodb-linux-x86_64-enterprise-ubuntu2204-8.0.15/bin/mongocryptd /usr/local/bin/
66- - name: Start mongocryptd
67- run: |
68- nohup mongocryptd --logpath=/tmp/mongocryptd.log &
69- - name: Verify MongoDB installation
70- run: |
71- mongosh --eval 'db.runCommand({ connectionStatus: 1 })'
72- - name: Verify mongocryptd is running
73- run: |
74- pgrep mongocryptd
57+ wget https://downloads.mongodb.com/linux/mongo_crypt_shared_v1-linux-x86_64-enterprise-ubuntu2404-8.2.1.tgz
58+ tar -xvzf mongo_crypt_shared_v1-linux-x86_64-enterprise-ubuntu2404-8.2.1.tgz lib/mongo_crypt_v1.so
7559 - name: Run tests
7660 run: python3 django_repo/tests/runtests_.py
7761 permissions:
Original file line number Diff line number Diff line change @@ -285,5 +285,29 @@ settings::
285285 },
286286 }
287287
288+
289+ .. admonition:: Dynamic library path configuration
290+
291+ The Automatic Encryption Shared Library is platform‑specific. Make sure to
292+ download the correct version for your operating system and architecture,
293+ and configure your environment so the system can locate it.
294+
295+ Use the following variables depending on your platform:
296+
297+ +---------------+---------------------------------+
298+ | **Platform** | **Environment Variable** |
299+ +---------------+---------------------------------+
300+ | Windows | ``PATH`` |
301+ +---------------+---------------------------------+
302+ | macOS | ``DYLD_FALLBACK_LIBRARY_PATH`` |
303+ +---------------+---------------------------------+
304+ | Linux | ``LD_LIBRARY_PATH`` |
305+ +---------------+---------------------------------+
306+
307+ For example on macOS, you can set the ``DYLD_FALLBACK_LIBRARY_PATH``
308+ environment variable in your shell before starting your Django application::
309+
310+ $ export DYLD_FALLBACK_LIBRARY_PATH="/path/to/mongo_crypt_shared_v1.dylib:$DYLD_FALLBACK_LIBRARY_PATH"
311+
288312You are now ready to :doc:`start developing applications
289313</topics/queryable-encryption>` with Queryable Encryption!
You can’t perform that action at this time.
0 commit comments