From 0b6d4b28bee97d08a38145bed2e20c58f1a31beb Mon Sep 17 00:00:00 2001 From: DaanSelen <80752476+DaanSelen@users.noreply.github.com> Date: Wed, 25 Jun 2025 01:13:04 +0200 Subject: [PATCH] Minor Docker fixes and nice things (#7120) --- docker/compose.yaml | 9 +++++---- docker/entrypoint.sh | 7 +++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/compose.yaml b/docker/compose.yaml index 1ff2bc10..fd24e0c9 100644 --- a/docker/compose.yaml +++ b/docker/compose.yaml @@ -2,10 +2,11 @@ services: meshcentral: image: ghcr.io/ylianst/meshcentral:latest environment: - - HOSTNAME=myserver.domain.com - - ALLOW_NEW_ACCOUNTS=false - - USE_MONGODB=true - - MONGO_URL=mongodb://username:password@mongodb:27017/meshcentral + - DYNAMIC_CONFIG=false # Show the option but disable it by default, for safety. + - HOSTNAME=myserver.domain.com # Set the hostname in the config.json + - ALLOW_NEW_ACCOUNTS=false # Disable creation of new accounts (except for the first user) in the config.json + - USE_MONGODB=true # Enable the Mongo connector in the config.json + - MONGO_URL=mongodb://username:password@mongodb:27017/meshcentral # Example MONGO_URL volumes: - meshcentral-data:/opt/meshcentral/meshcentral-data - meshcentral-files:/opt/meshcentral/meshcentral-files diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index a9c4b4f2..ca758ac3 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -22,7 +22,6 @@ else fi if [[ ${DYNAMIC_CONFIG,,} =~ ^(true|yes)$ ]]; then - cat "$CONFIG_FILE" echo "Using Dynamic Configuration values..." # BEGIN DATABASE CONFIGURATION FIELDS @@ -245,7 +244,7 @@ if [[ ${DYNAMIC_CONFIG,,} =~ ^(true|yes)$ ]]; then # certUrl if [[ -n $REVERSE_PROXY ]] && [[ -n $REVERSE_PROXY_TLS_PORT ]]; then REVERSE_PROXY_STRING="${REVERSE_PROXY}:${REVERSE_PROXY_TLS_PORT}" - + echo "Setting certUrl... - $REVERSE_PROXY_STRING" sed -i 's/"_certUrl"/"certUrl"/' "$CONFIG_FILE" jq --arg cert_url "$REVERSE_PROXY_STRING" \ @@ -257,7 +256,7 @@ if [[ ${DYNAMIC_CONFIG,,} =~ ^(true|yes)$ ]]; then sed -i 's/"certUrl":/"_certUrl":/g' "$CONFIG_FILE" fi - echo -e "\n$(cat "$CONFIG_FILE")" + cat "$CONFIG_FILE" else echo "Leaving config as-is." fi @@ -266,4 +265,4 @@ fi node /opt/meshcentral/meshcentral/meshcentral --configfile "${CONFIG_FILE}" "${ARGS}" >> /proc/1/fd/1 & meshcentral_pid=$! -wait "$meshcentral_pid" \ No newline at end of file +wait "$meshcentral_pid"