feat: add TLSOffload variable to docker (#7738)

* feat: add TLSOffload variable to docker * chore: add readme values * chore: also edit the rest * chore: remove parameters readme paragraph * chore: set reasonable defaults --------- Co-authored-by: DaanSelen <dselen@systemec.nl>

DaanSelen committed Apr 20, 2026 at 04:36 UTC f7dd2ec086846c532a80e7d006d617b62b522460
4 files changed +96 -79
docker/README.md
+2
@@ -61,6 +61,8 @@ Below is a breakdown of environment variables used in this setup.
61 | REVERSE_PROXY | "" | Configures reverse proxy support through `certUrl`. |
62 | REVERSE_PROXY_TLS_PORT | "443" | Configures reverse proxy TLS port, will be combined with: `REVERSE_PROXY`. |
63 | WEBRTC | false | Enables/disables WebRTC support. |
64 +| TRUSTED_PROXY | "" | Trust forwarded headers from these IPs or domains. |
65 +| TLS_OFFLOAD | false | When set to true, indicate that TLS is being performed by a device in front of MeshCentral. |
66
67 ### Database Configuration
68
docker/compose.yaml
+2 -2
@@ -15,8 +15,8 @@ services:
15 - meshcentral-web:/opt/meshcentral/meshcentral-web
16 - meshcentral-backups:/opt/meshcentral/meshcentral-backups
17 ports:
18 - - ${PORT}:${PORT}
19 - - ${REDIR_PORT}:${REDIR_PORT}
18 + - 443:443
19 + - 80:80
20 volumes:
21 meshcentral-data:
22 meshcentral-files:
docker/config.json.template
+3 -2
@@ -13,7 +13,8 @@
13 "redirPort": 80,
14 "_redirAliasPort": 80,
15 "AgentPong": 300,
16 - "TLSOffload": false,
16 + "tlsOffload": false,
17 + "_trustedProxy": "",
18 "SelfUpdate": false,
19 "AllowFraming": false,
20 "WebRTC": false,
@@ -51,4 +52,4 @@
52 "_names": "myserver.mydomain.com",
53 "production": false
54 }
54 -}
\ No newline at end of file
55 +}
docker/entrypoint.sh
+89 -75
@@ -6,7 +6,7 @@ stylishui_compat="https://raw.githubusercontent.com/Melo-Professional/MeshCentra
6
7 function graceful_shutdown() {
8 echo "Received SIGTERM from the container host. Cleaning up..."
9 - kill -SIGINT $meshcentral_pid
9 + kill -SIGINT "$meshcentral_pid"
10
11 echo "MeshCentral process stopped. Exiting..."
12 exit 0
@@ -14,8 +14,8 @@ function graceful_shutdown() {
14 trap graceful_shutdown SIGTERM
15
16 function test_url() {
17 - wget --spider $1 &> /dev/null
18 - if [[ $? -eq 0 ]]; then
17 + wget --spider "$1" &> /dev/null
18 + if "$?"; then
19 echo "is ok."
20 return 0
21 else
@@ -24,10 +24,11 @@ function test_url() {
24 fi
25 }
26
27 +
28 function dynamic_config() {
29 # BEGIN DATABASE CONFIGURATION FIELDS
30 USE_MONGODB=${USE_MONGODB,,}
30 - if [[ $USE_MONGODB =~ ^(true|yes)$ ]]; then
31 + if [[ "$USE_MONGODB" =~ ^(true|yes)$ ]]; then
32 echo "Enabling MongoDB-connector..."
33
34 if [[ -n "$MONGO_URL" ]]; then
@@ -47,7 +48,7 @@ function dynamic_config() {
48 fi
49
50 USE_POSTGRESQL=${USE_POSTGRESQL,,}
50 - if [[ $USE_POSTGRESQL =~ ^(true|yes)$ ]]; then
51 + if [[ "$USE_POSTGRESQL" =~ ^(true|yes)$ ]]; then
52 echo "Enabling PostgreSQL-connector..."
53
54 sed -i 's/"_postgres"/"postgres"/' "$CONFIG_FILE"
@@ -56,11 +57,11 @@ function dynamic_config() {
57 --arg psql_user "$PSQL_USER" \
58 --arg psql_pass "$PSQL_PASS" \
59 --arg psql_db "$PSQL_DATABASE" \
59 - '.settings.postgres.host = $psql_host |
60 - .settings.postgres.port = $psql_port |
61 - .settings.postgres.user = $psql_user |
62 - .settings.postgres.password = $psql_pass |
63 - .settings.postgres.database = $psql_db' \
60 + '.settings.postgres.host = "$psql_host" |
61 + .settings.postgres.port = "$psql_port" |
62 + .settings.postgres.user = "$psql_user" |
63 + .settings.postgres.password = "$psql_pass" |
64 + .settings.postgres.database = "$psql_db"' \
65 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
66 else
67 echo "Disabling PostgreSQL-connector..."
@@ -68,7 +69,7 @@ function dynamic_config() {
69 fi
70
71 USE_MARIADB=${USE_MARIADB,,}
71 - if [[ $USE_MARIADB =~ ^(true|yes)$ ]]; then
72 + if [[ "$USE_MARIADB" =~ ^(true|yes)$ ]]; then
73 echo "Enabling MariaDB-connector..."
74 sed -i 's/"_mariaDB"/"mariaDB"/' "$CONFIG_FILE"
75 jq --arg mariadb_host "$MARIADB_HOST" \
@@ -76,11 +77,11 @@ function dynamic_config() {
77 --arg mariadb_user "$MARIADB_USER" \
78 --arg mariadb_pass "$MARIADB_PASS" \
79 --arg mariadb_db "$MARIADB_DATABASE" \
79 - '.settings.mariaDB.host = $mariadb_host |
80 - .settings.mariaDB.port = $mariadb_port |
81 - .settings.mariaDB.user = $mariadb_user |
82 - .settings.mariaDB.password = $mariadb_pass |
83 - .settings.mariaDB.database = $mariadb_db' \
80 + '.settings.mariaDB.host = "$mariadb_host" |
81 + .settings.mariaDB.port = "$mariadb_port" |
82 + .settings.mariaDB.user = "$mariadb_user" |
83 + .settings.mariaDB.password = "$mariadb_pass" |
84 + .settings.mariaDB.database = "$mariadb_db"' \
85 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
86 else
87 echo "Disabling MariaDB-connector..."
@@ -96,7 +97,7 @@ function dynamic_config() {
97 echo "If defaults are going to get applied, refer to: https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json"
98
99 # SESSIONKEY
99 - if [[ ${REGEN_SESSIONKEY,,} =~ ^(true|yes)$ ]]; then
100 + if [[ "${REGEN_SESSIONKEY,,}" =~ ^(true|yes)$ ]]; then
101 echo "Regenerating Session-Key because REGENSESSIONKEY is 'true' or 'yes'"
102 SESSION_KEY=$(tr -dc 'A-Z0-9' < /dev/urandom | fold -w 96 | head -n 1)
103
@@ -109,42 +110,42 @@ function dynamic_config() {
110 fi
111
112 # HOSTNAME
112 - if [[ -n $HOSTNAME ]]; then
113 + if [[ -n "$HOSTNAME" ]]; then
114 echo "Setting hostname (cert)... $HOSTNAME"
115
116 jq --arg hostname "$HOSTNAME" \
117 '.settings.cert = $hostname' \
118 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
119 else
119 - echo "Invalid or no hostname, defaulting to 'localhost', value given: $HOSTNAME"
120 + echo "Invalid or no hostname, defaulting to 'localhost', value(s) given: ${HOSTNAME:-empty}"
121 jq --arg hostname "localhost" \
122 '.settings.cert = $hostname' \
123 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
124 fi
125
126 # PORT
126 - if [[ -n $PORT ]]; then
127 + if [[ -n "$PORT" ]]; then
128 echo "Setting port... $PORT"
129
130 jq --arg port "$PORT" \
131 '.settings.port = $port' \
132 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
133 else
133 - echo "Invalid or no port, defaulting to '443', value given: $PORT"
134 + echo "Invalid or no port, defaulting to '443', Value(s) given: ${PORT:-empty}"
135 jq --arg port "443" \
136 '.settings.port = $port' \
137 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
138 fi
139
140 # REDIR_PORT
140 - if [[ -n $REDIR_PORT ]]; then
141 + if [[ -n "$REDIR_PORT" ]]; then
142 echo "Setting redirport... $REDIR_PORT"
143
144 jq --arg redirport "$REDIR_PORT" \
145 '.settings.redirPort = $redirport' \
146 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
147 else
147 - echo "Invalid or no redirport, defaulting to '80', value given: $REDIR_PORT"
148 + echo "Invalid or no redirport, defaulting to '80', Value(s) given: ${REDIR_PORT:-empty}"
149 jq --arg redirport "80" \
150 '.settings.redirPort = $redirport' \
151 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
@@ -152,7 +153,7 @@ function dynamic_config() {
153
154 # ALLOWPLUGINS
155 ALLOW_PLUGINS=${ALLOW_PLUGINS,,}
155 - if [[ $ALLOW_PLUGINS =~ ^(true|false)$ ]]; then
156 + if [[ "$ALLOW_PLUGINS" =~ ^(true|false)$ ]]; then
157 echo "Setting plugins... $ALLOW_PLUGINS"
158
159 sed -i 's/"_plugins"/"plugins"/' "$CONFIG_FILE"
@@ -160,13 +161,13 @@ function dynamic_config() {
161 '.settings.plugins.enabled = $allow_plugins' \
162 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
163 else
163 - echo "Invalid or no ALLOWPLUGINS value given, commenting out so default applies... Value given: $ALLOW_PLUGINS"
164 + echo "Invalid or no ALLOWPLUGINS value given, commenting out so default applies... Value(s) given: ${ALLOW_PLUGINS:-empty}"
165 sed -i 's/"plugins":/"_plugins":/g' "$CONFIG_FILE"
166 fi
167
168 # WEBRTC
169 WEBRTC=${WEBRTC,,}
169 - if [[ $WEBRTC =~ ^(true|false)$ ]]; then
170 + if [[ "$WEBRTC" =~ ^(true|false)$ ]]; then
171 echo "Setting WebRTC... $WEBRTC"
172
173 sed -i 's/"_WebRTC"/"WebRTC"/' "$CONFIG_FILE"
@@ -175,13 +176,13 @@ function dynamic_config() {
176 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
177 #sed -i "s/\"WebRTC\": *[a-z]*/\"WebRTC\": $WEBRTC/" "$CONFIG_FILE"
178 else
178 - echo "Invalid or no WEBRTC value given, commenting out so default applies... Value given: $WEBRTC"
179 + echo "Invalid or no WEBRTC value given, commenting out so default applies... Value(s) given: ${WEBRTC:-empty}"
180 sed -i 's/"WebRTC":/"_WebRTC":/g' "$CONFIG_FILE"
181 fi
182
183 # IFRAME
184 IFRAME=${IFRAME,,}
184 - if [[ $IFRAME =~ ^(true|false)$ ]]; then
185 + if [[ "$IFRAME" =~ ^(true|false)$ ]]; then
186 echo "Setting AllowFraming... $IFRAME"
187
188 sed -i 's/"_AllowFraming"/"AllowFraming"/' "$CONFIG_FILE"
@@ -189,15 +190,44 @@ function dynamic_config() {
190 '.settings.AllowFraming = $allow_framing' \
191 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
192 else
192 - echo "Invalid or no IFRAME value given, commenting out so default applies... Value given: $IFRAME"
193 + echo "Invalid or no IFRAME value given, commenting out so default applies... Value(s) given: ${IFRAME:-empty}"
194 sed -i 's/"AllowFraming":/"_AllowFraming":/g' "$CONFIG_FILE"
195 fi
196
197 + # ALLOWED_ORIGIN
198 + ALLOWED_ORIGIN=${ALLOWED_ORIGIN,,}
199 + if [[ "$ALLOWED_ORIGIN" =~ ^(true|false)$ ]]; then
200 + echo "Setting allowedOrigin... $ALLOWED_ORIGIN"
201 +
202 + sed -i 's/"_allowedOrigin"/"allowedOrigin"/' "$CONFIG_FILE"
203 + jq --argjson allowed_origin "$ALLOWED_ORIGIN" \
204 + '.domains[""].allowedOrigin = $allowed_origin' \
205 + "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
206 + else
207 + echo "Invalid or no ALLOWED_ORIGIN value given, commenting out so default applies... Value(s) given: ${ALLOWED_ORIGIN:-empty}"
208 + sed -i 's/"allowedOrigin":/"_allowedOrigin":/g' "$CONFIG_FILE"
209 + fi
210 +
211 + # certUrl || reverseProxy
212 + if [[ -n "$REVERSE_PROXY" ]] && [[ -n "$REVERSE_PROXY_TLS_PORT" ]]; then
213 + REVERSE_PROXY_STRING="${REVERSE_PROXY}:${REVERSE_PROXY_TLS_PORT}"
214 +
215 + echo "Setting certUrl... - $REVERSE_PROXY_STRING"
216 + sed -i 's/"_certUrl"/"certUrl"/' "$CONFIG_FILE"
217 + jq --arg cert_url "$REVERSE_PROXY_STRING" \
218 + '.domains[""].certUrl = $cert_url' \
219 + "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
220 + #sed -i "s/\"certUrl\": *[a-z]*/\"certUrl\": $REVERSE_PROXY_STRING/" "$CONFIG_FILE"
221 + else
222 + echo "Invalid or no REVERSE_PROXY and/or REVERSE_PROXY_TLS_PORT value given, commenting out so default applies... Value(s) given: ${REVERSE_PROXY_STRING:-empty}"
223 + sed -i 's/"certUrl":/"_certUrl":/g' "$CONFIG_FILE"
224 + fi
225 +
226 # trustedProxy
197 - if [[ -n $TRUSTED_PROXY ]]; then
227 + if [[ -n "$TRUSTED_PROXY" ]]; then
228 echo "Setting trustedProxy... - $TRUSTED_PROXY"
229
200 - if [[ $TRUSTED_PROXY == "all" ]] || [[ $TRUSTED_PROXY == "true" ]]; then
230 + if [[ "$TRUSTED_PROXY" == "all" ]] || [[ "$TRUSTED_PROXY" == "true" ]]; then
231 sed -i 's/"_trustedProxy"/"trustedProxy"/' "$CONFIG_FILE"
232 jq --argjson trusted_proxy "true" \
233 '.settings.trustedProxy = $trusted_proxy' \
@@ -209,13 +239,26 @@ function dynamic_config() {
239 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
240 fi
241 else
212 - echo "Invalid or no REVERSE_PROXY and/or REVERSE_PROXY_TLS_PORT value given, commenting out so default applies... Value(s) given: $REVERSE_PROXY_STRING"
213 - sed -i 's/"certUrl":/"_certUrl":/g' "$CONFIG_FILE"
242 + echo "Invalid or no TRUSTED_PROXY value given, commenting out so default applies... Value(s) given: ${TRUSTED_PROXY:-empty}"
243 + sed -i 's/"trustedProxy":/"_trustedProxy":/g' "$CONFIG_FILE"
244 + fi
245 +
246 + # tlsOffload
247 + if [[ -n "$TLS_OFFLOAD" ]]; then
248 + echo "Setting tlsOffload... - $TLS_OFFLOAD"
249 +
250 + sed -i 's/"_tlsOffload"/"tlsOffload"/' "$CONFIG_FILE"
251 + jq --arg tls_offload "$TLS_OFFLOAD" \
252 + '.settings.tlsOffload = $tls_offload' \
253 + "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
254 + else
255 + echo "Invalid or no TLS_OFFLOAD value given, commenting out so default applies... Value(s) given: ${TLS_OFFLOAD:-empty}"
256 + sed -i 's/"tlsOffload":/"_tlsOffload":/g' "$CONFIG_FILE"
257 fi
258
259 # ALLOW_NEW_ACCOUNTS
260 ALLOW_NEW_ACCOUNTS=${ALLOW_NEW_ACCOUNTS,,}
218 - if [[ $ALLOW_NEW_ACCOUNTS =~ ^(true|false)$ ]]; then
261 + if [[ "$ALLOW_NEW_ACCOUNTS" =~ ^(true|false)$ ]]; then
262 echo "Setting NewAccounts... $ALLOW_NEW_ACCOUNTS"
263
264 sed -i 's/"_NewAccounts"/"NewAccounts"/' "$CONFIG_FILE"
@@ -223,13 +266,13 @@ function dynamic_config() {
266 '.domains[""].NewAccounts = $new_accounts' \
267 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
268 else
226 - echo "Invalid or no ALLOW_NEW_ACCOUNTS value given, commenting out so default applies... Value given: $ALLOW_NEW_ACCOUNTS"
269 + echo "Invalid or no ALLOW_NEW_ACCOUNTS value given, commenting out so default applies... Value(s) given: ${ALLOW_NEW_ACCOUNTS:-empty}"
270 sed -i 's/"NewAccounts":/"_NewAccounts":/g' "$CONFIG_FILE"
271 fi
272
273 # LOCALSESSIONRECORDING
274 LOCAL_SESSION_RECORDING=${LOCAL_SESSION_RECORDING,,}
232 - if [[ $LOCAL_SESSION_RECORDING =~ ^(true|false)$ ]]; then
275 + if [[ "$LOCAL_SESSION_RECORDING" =~ ^(true|false)$ ]]; then
276 echo "Setting localSessionRecording... $LOCAL_SESSION_RECORDING"
277
278 sed -i 's/"_localSessionRecording"/"localSessionRecording"/' "$CONFIG_FILE"
@@ -237,13 +280,13 @@ function dynamic_config() {
280 '.domains[""].localSessionRecording = $session_recording' \
281 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
282 else
240 - echo "Invalid or no LOCALSESSIONRECORDING value given, commenting out so default applies... Value given: $LOCAL_SESSION_RECORDING"
283 + echo "Invalid or no LOCALSESSIONRECORDING value given, commenting out so default applies... Value(s) given: ${LOCAL_SESSION_RECORDING:-empty}"
284 sed -i 's/"localSessionRecording":/"_localSessionRecording":/g' "$CONFIG_FILE"
285 fi
286
287 # MINIFY
288 MINIFY=${MINIFY,,}
246 - if [[ $MINIFY =~ ^(true|false)$ ]]; then
289 + if [[ "$MINIFY" =~ ^(true|false)$ ]]; then
290 echo "Setting minify... $MINIFY"
291
292 sed -i 's/"_minify"/"minify"/' "$CONFIG_FILE"
@@ -252,46 +295,17 @@ function dynamic_config() {
295 "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
296 #sed -i "s/\"minify\": *[a-z]*/\"minify\": $MINIFY/" "$CONFIG_FILE"
297 else
255 - echo "Invalid or no MINIFY value given, commenting out so default applies... Value given: $MINIFY"
298 + echo "Invalid or no MINIFY value given, commenting out so default applies... Value(s) given: ${MINIFY:-empty}"
299 sed -i 's/"minify":/"_minify":/g' "$CONFIG_FILE"
300 fi
301
259 - # ALLOWED_ORIGIN
260 - ALLOWED_ORIGIN=${ALLOWED_ORIGIN,,}
261 - if [[ $ALLOWED_ORIGIN =~ ^(true|false)$ ]]; then
262 - echo "Setting allowedOrigin... $ALLOWED_ORIGIN"
263 -
264 - sed -i 's/"_allowedOrigin"/"allowedOrigin"/' "$CONFIG_FILE"
265 - jq --argjson allowed_origin "$ALLOWED_ORIGIN" \
266 - '.domains[""].allowedOrigin = $allowed_origin' \
267 - "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
268 - else
269 - echo "Invalid or no ALLOWED_ORIGIN value given, commenting out so default applies... Value given: $ALLOWED_ORIGIN"
270 - sed -i 's/"allowedOrigin":/"_allowedOrigin":/g' "$CONFIG_FILE"
271 - fi
272 -
273 - # certUrl
274 - if [[ -n $REVERSE_PROXY ]] && [[ -n $REVERSE_PROXY_TLS_PORT ]]; then
275 - REVERSE_PROXY_STRING="${REVERSE_PROXY}:${REVERSE_PROXY_TLS_PORT}"
276 -
277 - echo "Setting certUrl... - $REVERSE_PROXY_STRING"
278 - sed -i 's/"_certUrl"/"certUrl"/' "$CONFIG_FILE"
279 - jq --arg cert_url "$REVERSE_PROXY_STRING" \
280 - '.domains[""].certUrl = $cert_url' \
281 - "$CONFIG_FILE" > temp_config.json && mv temp_config.json "$CONFIG_FILE"
282 - #sed -i "s/\"certUrl\": *[a-z]*/\"certUrl\": $REVERSE_PROXY_STRING/" "$CONFIG_FILE"
283 - else
284 - echo "Invalid or no REVERSE_PROXY and/or REVERSE_PROXY_TLS_PORT value given, commenting out so default applies... Value(s) given: $REVERSE_PROXY_STRING"
285 - sed -i 's/"certUrl":/"_certUrl":/g' "$CONFIG_FILE"
286 - fi
287 -
302 cat "$CONFIG_FILE"
303 }
304
305 function install_stylishui() {
306 # Start by testing if we can determine compatibility
307 printf "Testing compatibility schema URL..."
294 - if ! test_url $stylishui_compat; then
308 + if ! test_url "$stylishui_compat"; then
309 echo "Compat URL failed."
310 return 1
311 fi
@@ -301,7 +315,7 @@ function install_stylishui() {
315 full_url="${stylishui_base_url}/heads/main.tar.gz"
316 else
317 # Retrieve the values we need to determine compatibility
304 - compat_data=$(curl -fsSL $stylishui_compat)
318 + compat_data=$(curl -fsSL "$stylishui_compat")
319 meshcentral_version=$(jq -r '.version' /opt/meshcentral/meshcentral/package.json)
320 # Target the StylishUI version we need for our present Meshcentral version
321 compat_version=$(echo "$compat_data" | jq -r --arg mcv "$meshcentral_version" \
@@ -314,18 +328,18 @@ function install_stylishui() {
328
329 # Test if we can reach the data/content URL on github
330 printf "Testing content URL..."
317 - if ! test_url $full_url; then
331 + if ! test_url "$full_url"; then
332 echo "StylishUI URL failed."
333 return 1
334 fi
335
336 # Lets download and install the UI
323 - wget -O /tmp/stylishui.tar.gz $full_url > /dev/null
337 + wget -O /tmp/stylishui.tar.gz "$full_url" > /dev/null
338 tar -xzf /tmp/stylishui.tar.gz -C /tmp
339 web_folder=$(find /tmp -name meshcentral-web)
340
341 # Check if we have some integrity
328 - if [[ -z $web_folder ]]; then
342 + if [[ -z "$web_folder" ]]; then
343 echo "Installation failed, cleaning..."
344 rm /tmp/stylishui*
345 return 1
@@ -365,12 +379,12 @@ fi
379 if [ -f "${CONFIG_FILE}" ]; then
380 echo "Pre-existing config found, not recreating..."
381 else
368 - if [ ! -d $(dirname "$CONFIG_FILE") ]; then
382 + if [ ! -d "$(dirname "$CONFIG_FILE")" ]; then
383 echo "Creating meshcentral-data directory..."
384 mkdir -p /opt/meshcentral/meshcentral-data
385 fi
386
373 - echo "Placing template into the relevant directory: $(dirname $CONFIG_FILE)"
387 + echo "Placing template into the relevant directory: $(dirname "$CONFIG_FILE")"
388 cp /opt/meshcentral/config.json.template "${CONFIG_FILE}"
389 fi
390