Refactor MongoDB data and log paths in run.sh

- Updated MONGO_DBPATH to use a new directory (.mongo-data) for database storage.
- Removed MONGO_LOGPATH variable and its usage in the MongoDB startup command.
This commit is contained in:
Maximilian G.
2026-03-24 07:20:17 +00:00
committed by GitHub
parent f4357273b9
commit 5d144e9214
34 changed files with 4 additions and 811 deletions
+2 -3
View File
@@ -2,8 +2,7 @@
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MONGO_DBPATH="${MONGO_DBPATH:-$SCRIPT_DIR/data/db}"
MONGO_LOGPATH="${MONGO_LOGPATH:-$SCRIPT_DIR/data/mongod.log}"
MONGO_DBPATH="${MONGO_DBPATH:-$SCRIPT_DIR/.mongo-data}"
start_mongodb_if_needed() {
if ! command -v mongod >/dev/null 2>&1; then
@@ -18,7 +17,7 @@ start_mongodb_if_needed() {
mkdir -p "$MONGO_DBPATH"
echo "Starting MongoDB with dbPath: $MONGO_DBPATH"
mongod --dbpath "$MONGO_DBPATH" --bind_ip 127.0.0.1 --port 27017 --fork --logpath "$MONGO_LOGPATH"
mongod --dbpath "$MONGO_DBPATH" --bind_ip 127.0.0.1 --port 27017
}
start_mongodb_if_needed