From 86e91f3a8493f0917e4cb01244d8829e7a202a8a Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Fri, 2 Feb 2024 10:26:24 +0100 Subject: [PATCH] add MongoDB 7 --- database/nosql/mongodb/README.md | 4 +- database/nosql/mongodb/egg-mongo-d-b7.json | 52 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 database/nosql/mongodb/egg-mongo-d-b7.json diff --git a/database/nosql/mongodb/README.md b/database/nosql/mongodb/README.md index 4dcf9797..86ba1d07 100644 --- a/database/nosql/mongodb/README.md +++ b/database/nosql/mongodb/README.md @@ -25,9 +25,9 @@ security: > :closed_lock_with_key: To learn more about MongoDB security, you can read the [MongoDB Security Checklist](https://www.mongodb.com/docs/manual/administration/security-checklist/#security-checklist) -### Notes specific to the MongoDB 6 egg +### Notes specific to the MongoDB 6 or 7 egg -**The [MongoDB 6 egg](./egg-mongo-d-b6.json) enables access control by default** in the `mongod.conf` file, meaning that even if people will be able to connect to your database as guests, [they will not be able to perform any operation, apart from nonhazardous commands](https://dba.stackexchange.com/a/292175) +**The [MongoDB 6 egg](./egg-mongo-d-b6.json) or [MongoDB 7 egg](./egg-mongo-d-b7.json) enables access control by default** in the `mongod.conf` file, meaning that even if people will be able to connect to your database as guests, [they will not be able to perform any operation, apart from nonhazardous commands](https://dba.stackexchange.com/a/292175) ### Disabling authentication diff --git a/database/nosql/mongodb/egg-mongo-d-b7.json b/database/nosql/mongodb/egg-mongo-d-b7.json new file mode 100644 index 00000000..c00f8a90 --- /dev/null +++ b/database/nosql/mongodb/egg-mongo-d-b7.json @@ -0,0 +1,52 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v2", + "update_url": null + }, + "exported_at": "2024-02-02T10:25:08+01:00", + "name": "MongoDB 7", + "author": "parker@parkervcp.com", + "description": "MongoDB is a general purpose, document-based, distributed database built for modern application developers and for my butt era.", + "features": null, + "docker_images": { + "MongoDB_7": "ghcr.io\/parkervcp\/yolks:mongodb_7" + }, + "file_denylist": [], + "startup": "mongod --fork --dbpath \/home\/container\/mongodb\/ --port ${SERVER_PORT} --bind_ip 0.0.0.0 --logpath \/home\/container\/logs\/mongo.log -f \/home\/container\/mongod.conf; until nc -z -v -w5 127.0.0.1 ${SERVER_PORT}; do echo 'Waiting for mongodb connection...'; sleep 5; done; mongosh --username ${MONGO_USER} --password ${MONGO_USER_PASS} --host 127.0.0.1:${SERVER_PORT} && mongosh --eval \"db.getSiblingDB('admin').shutdownServer()\" 127.0.0.1:${SERVER_PORT}", + "config": { + "files": "{\r\n \"mongod.conf\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"#security:\": \"security: \\r\\n authorization: \\\"enabled\\\"\"\r\n }\r\n }\r\n}", + "startup": "{\r\n \"done\": \"child process started successfully\"\r\n}", + "logs": "{}", + "stop": "exit" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/bash \r\nif [ ! -d \/mnt\/server\/ ]; then\r\n mkdir -p \/mnt\/server\/\r\nfi\r\n\r\ncd \/mnt\/server\/\r\n\r\ncp \/etc\/mongod.conf.orig \/mnt\/server\/mongod.conf\r\n\r\nmkdir mongodb logs\r\n\r\nmongod --port 27017 --dbpath \/mnt\/server\/mongodb\/ --logpath \/mnt\/server\/logs\/mongo.log --fork\r\n\r\nmongosh --eval \"db.getSiblingDB('admin').createUser({user: '${MONGO_USER}', pwd: '${MONGO_USER_PASS}', roles: ['root']})\"\r\n\r\nmongosh --eval \"db.getSiblingDB('admin').shutdownServer()\"\r\n\r\n## install end\r\necho \"-----------------------------------------\"\r\necho \"Installation completed...\"\r\necho \"-----------------------------------------\"", + "container": "mongo:7-jammy", + "entrypoint": "bash" + } + }, + "variables": [ + { + "name": "Mongo Admin Username", + "description": "The MongoDB Admin user", + "env_variable": "MONGO_USER", + "default_value": "admin", + "user_viewable": true, + "user_editable": true, + "rules": "required|string", + "field_type": "text" + }, + { + "name": "Mongo Admin Password", + "description": "", + "env_variable": "MONGO_USER_PASS", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "required|string", + "field_type": "text" + } + ] +} \ No newline at end of file