From 6fc0cdc9ae6fe1530572e688ecbf9697f68ef4b7 Mon Sep 17 00:00:00 2001 From: Andrew DeVries Date: Mon, 12 Feb 2024 12:51:36 -0500 Subject: [PATCH] Fix Mongo Env Pass Through --- .devcontainer/docker-compose.yml | 4 +--- dockerCompose/docker-compose.yml | 14 +++++++++----- dockerCompose/installUispToolsStandAlone.sh | 2 +- package.json | 2 +- server.js | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index c9cf640..f8ab297 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -16,9 +16,7 @@ services: - ..:/workspace:cached container_name: uisptools_dev environment: - ME_CONFIG_MONGODB_ADMINUSERNAME: "uisptools" - ME_CONFIG_MONGODB_ADMINPASSWORD: "U!spT00ls!" - ME_CONFIG_MONGODB_URL: "mongodb://uisptools:U!spT00ls!@uisptools_mongodb_dev:27017/" + MONGODBSERVERURL: "mongodb://uisptools:U!spT00ls!@uisptools_mongodb_dev:27017/" # Overrides default command so things don't shut down after the process ends. command: sleep infinity diff --git a/dockerCompose/docker-compose.yml b/dockerCompose/docker-compose.yml index fb4aa6f..35f85de 100644 --- a/dockerCompose/docker-compose.yml +++ b/dockerCompose/docker-compose.yml @@ -15,11 +15,12 @@ services: - "49443:49443" - "49080:49080" volumes: - - /usr/src/uisptools/config:/usr/src/uisptools/config - - /var/log:/usr/src/uisptools/logs + - ../data/config:/usr/src/uisptools/config + - ../data/log:/usr/src/uisptools/logs container_name: uisptools${UISPTOOLS_ALIAS} environment: - MONGODB_URL: "mongodb://uisptools:U!spT00ls!@mongo_mongodb${UISPTOOLS_ALIAS}:27017/" + MONGODBSERVERURL: "${MONGODBSERVERURL:-mongodb://uisptools:U!spT00ls!@mongo_mongodb${UISPTOOLS_ALIAS}:27017/}" + GOOGLEAPIKEY: "${GOOGLEAPIKEY:-}" depends_on: - uisptools_mongodb networks: @@ -33,8 +34,11 @@ services: MONGO_INITDB_ROOT_PASSWORD: "U!spT00ls!" MONGO_INITDB_DATABASE: "uisptools" volumes: - - /usr/src/uisptools/data/mongodb:/data/db - - ../mongodb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro + - ../data/mongodb/data/db:/data/db + - ../data/mongodb/data/configdb:/data/configdb + #- ../data/mongodb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro + - ../data/mongodb/docker-entrypoint-initdb.d/01_createDatabase.js:/docker-entrypoint-initdb.d/01_createDatabase.js:ro + - ../data/mongodb/docker-entrypoint-initdb.d/02_initWebServerPages.js:/docker-entrypoint-initdb.d/02_initWebServerPages.js:ro # this for Production as only need to Expose to internal services inside of Docker expose: - "27017" diff --git a/dockerCompose/installUispToolsStandAlone.sh b/dockerCompose/installUispToolsStandAlone.sh index e42b479..f061d3e 100644 --- a/dockerCompose/installUispToolsStandAlone.sh +++ b/dockerCompose/installUispToolsStandAlone.sh @@ -1,7 +1,7 @@ #!/bin/bash # installUispToolsStandAlone.sh -VERSION=0.0.2.2024-02-12:0004 +VERSION=0.0.2.2024-02-12:0005 echo installUispToolsStandAlone version $VERSION UISPTOOLS_USER="" diff --git a/package.json b/package.json index 3559206..8ea3900 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uisp-tools", - "version": "0.0.20", + "version": "0.0.21", "description": "Tools for UISP", "main": "server.js", "license": "GPL-3.0-or-later", diff --git a/server.js b/server.js index e7064b6..6d81b98 100644 --- a/server.js +++ b/server.js @@ -45,7 +45,7 @@ if (process.env.localDebug === 'true') { var defaultConfig = { "configDirectory": configFileOptions.configDirectory, "urlPrefix": "uisptools/", - "mongoDbServerUrl": process.env.MONGODB_URL || "mongodb://uisptools:U!spT00ls!@uisptools_mongodb:27017/?connectTimeoutMS=300000&authSource=admin", + "mongoDbServerUrl": process.env.MONGODBSERVERURL || "mongodb://uisptools:U!spT00ls!@uisptools_mongodb:27017/?connectTimeoutMS=300000&authSource=admin", "mongoDbDatabaseName": "uisptools", "logDirectory": "logs", "adminRoute": "/admin",