-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make most code async * Make all db communication async * Optimize db queries * Parallelize db queries * Change MongoDB integration to use a single-node replica set * Integrate MongoDB transactions * Refactor persistence code * Add new tests and improve some existing ones * Refactor and improve various parts of the code * Update dependency versions
- Loading branch information
1 parent
4d6890f
commit 28c032b
Showing
80 changed files
with
2,879 additions
and
1,992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM mongo:noble | ||
|
||
COPY mongodb/generate_keyfile.sh /root/generate_keyfile.sh | ||
RUN /bin/bash /root/generate_keyfile.sh | ||
|
||
COPY mongodb/mongod.conf /etc/mongod.conf | ||
COPY mongodb/init_mongodb.js /docker-entrypoint-initdb.d/init_mongodb.js | ||
|
||
CMD ["mongod", "-f", "/etc/mongod.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
MONGO_KEYFILE="/data/mongo-keyfile" | ||
|
||
if [ ! -f "$MONGO_KEYFILE" ]; then | ||
echo "Generating keyfile..." | ||
openssl rand -base64 756 > "$MONGO_KEYFILE" | ||
chmod 400 "$MONGO_KEYFILE" | ||
chown mongodb:mongodb "$MONGO_KEYFILE" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Replica set configuration | ||
var config = { | ||
"_id": "rs0", | ||
"members": [ | ||
{ "_id": 0, "host": "localhost:27017" } | ||
] | ||
} | ||
|
||
rs.initiate(config) | ||
|
||
while (!rs.isMaster().ismaster) { | ||
sleep(1000) | ||
} | ||
|
||
// Create the admin user | ||
var adminDb = db.getSiblingDB('admin'); | ||
adminDb.createUser({ | ||
user: process.env["MONGO_INITDB_ROOT_USERNAME"], | ||
pwd: process.env["MONGO_INITDB_ROOT_PASSWORD"], | ||
roles: [{ role: 'root', db: 'admin' }] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
storage: | ||
dbPath: /data/db | ||
|
||
net: | ||
port: 27017 | ||
bindIp: localhost,eos-mongodb | ||
|
||
security: | ||
authorization: enabled | ||
keyFile: /data/mongo-keyfile | ||
|
||
replication: | ||
replSetName: rs0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.