Minor Docker fixes and nice things (#7120)
DaanSelen committed
Jun 25, 2025 at 01:13 UTC
0b6d4b28bee97d08a38145bed2e20c58f1a31beb
2 files changed
+8
-8
docker/compose.yaml
+5
-4
@@ -2,10 +2,11 @@ services:
2
meshcentral:
3
image: ghcr.io/ylianst/meshcentral:latest
4
environment:
5
- - HOSTNAME=myserver.domain.com
6
- - ALLOW_NEW_ACCOUNTS=false
7
- - USE_MONGODB=true
8
- - MONGO_URL=mongodb://username:password@mongodb:27017/meshcentral
5
+ - DYNAMIC_CONFIG=false # Show the option but disable it by default, for safety.
6
+ - HOSTNAME=myserver.domain.com # Set the hostname in the config.json
7
+ - ALLOW_NEW_ACCOUNTS=false # Disable creation of new accounts (except for the first user) in the config.json
8
+ - USE_MONGODB=true # Enable the Mongo connector in the config.json
9
+ - MONGO_URL=mongodb://username:password@mongodb:27017/meshcentral # Example MONGO_URL
10
volumes:
11
- meshcentral-data:/opt/meshcentral/meshcentral-data
12
- meshcentral-files:/opt/meshcentral/meshcentral-files
docker/entrypoint.sh
+3
-4
@@ -22,7 +22,6 @@ else
22
fi
23
24
if [[ ${DYNAMIC_CONFIG,,} =~ ^(true|yes)$ ]]; then
25
- cat "$CONFIG_FILE"
25
echo "Using Dynamic Configuration values..."
26
27
# BEGIN DATABASE CONFIGURATION FIELDS
@@ -245,7 +244,7 @@ if [[ ${DYNAMIC_CONFIG,,} =~ ^(true|yes)$ ]]; then
244
# certUrl
245
if [[ -n $REVERSE_PROXY ]] && [[ -n $REVERSE_PROXY_TLS_PORT ]]; then
246
REVERSE_PROXY_STRING="${REVERSE_PROXY}:${REVERSE_PROXY_TLS_PORT}"
248
-
247
+
248
echo "Setting certUrl... - $REVERSE_PROXY_STRING"
249
sed -i 's/"_certUrl"/"certUrl"/' "$CONFIG_FILE"
250
jq --arg cert_url "$REVERSE_PROXY_STRING" \
@@ -257,7 +256,7 @@ if [[ ${DYNAMIC_CONFIG,,} =~ ^(true|yes)$ ]]; then
256
sed -i 's/"certUrl":/"_certUrl":/g' "$CONFIG_FILE"
257
fi
258
260
- echo -e "\n$(cat "$CONFIG_FILE")"
259
+ cat "$CONFIG_FILE"
260
else
261
echo "Leaving config as-is."
262
fi
@@ -266,4 +265,4 @@ fi
265
node /opt/meshcentral/meshcentral/meshcentral --configfile "${CONFIG_FILE}" "${ARGS}" >> /proc/1/fd/1 &
266
meshcentral_pid=$!
267
269
-wait "$meshcentral_pid"
\ No newline at end of file
268
+wait "$meshcentral_pid"