From c81be50a6fd6b990b1622dcaa912b10bd10156f1 Mon Sep 17 00:00:00 2001 From: Einar Stenberg Date: Sun, 12 Dec 2021 22:04:21 +0100 Subject: [PATCH 1/2] add nedb dependency to docker image fixes problems with plugins as referenced here https://github.com/ryanblenis/MeshCentral-ScriptTask/issues/23 --- docker/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index cdd0403b..54af827a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,7 +16,9 @@ WORKDIR /opt/meshcentral RUN npm install meshcentral -#Copy config template and startup script +#Install dependencies for plugins +RUN npm install nedb + COPY config.json.template /opt/meshcentral/config.json.template COPY startup.sh startup.sh #environment variables From 259c3ef66ce1cd77079488ce0c842bcdab817c49 Mon Sep 17 00:00:00 2001 From: Einar Stenberg Date: Sun, 12 Dec 2021 22:06:56 +0100 Subject: [PATCH 2/2] add more options to as ENV settings --- docker/config.json.template | 6 ++++-- docker/readme.md | 9 ++++++--- docker/startup.sh | 5 ++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docker/config.json.template b/docker/config.json.template index 4df6a6d7..16c03fa7 100644 --- a/docker/config.json.template +++ b/docker/config.json.template @@ -1,6 +1,7 @@ { "$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json", "settings": { + "plugins":{"enabled": false}, "cert": "myserver.mydomain.com", "_WANonly": true, "_LANonly": true, @@ -19,8 +20,9 @@ "": { "_title": "MyServer", "_title2": "Servername", - "_minify": true, + "minify": true, "NewAccounts": true, + "localSessionRecording": false, "_userNameIsEmail": true, "_certUrl": "my.reverse.proxy" } @@ -31,4 +33,4 @@ "_names": "myserver.mydomain.com", "production": false } -} +} \ No newline at end of file diff --git a/docker/readme.md b/docker/readme.md index 76480c33..d3802299 100644 --- a/docker/readme.md +++ b/docker/readme.md @@ -9,14 +9,14 @@ docker build -t meshcentral . docker-compose.yml example: ```yaml -version: '2' +version: '3' services: meshcentral: restart: always container_name: meshcentral - image: meshcentral + image: einar/meshcentral ports: - - 443:443 #MeshCentral will moan and try everything not to use port 80, but you can also use it if you so desire, just change the config.json according to your needs + - 8086:443 #MeshCentral will moan and try everything not to use port 80, but you can also use it if you so desire, just change the config.json according to your needs environment: - HOSTNAME=my.domain.com #your hostname - REVERSE_PROXY=false #set to your reverse proxy IP if you want to put meshcentral behind a reverse proxy @@ -24,6 +24,9 @@ services: - IFRAME=false #set to true if you wish to enable iframe support - ALLOW_NEW_ACCOUNTS=true #set to false if you want disable self-service creation of new accounts besides the first (admin) - WEBRTC=false #set to true to enable WebRTC - per documentation it is not officially released with meshcentral, but is solid enough to work with. Use with caution + - ALLOWPLUGINS=false #set to true to allow plugins + - LOCALSESSIONRECORDING=false # set to true to allow session recording + - MINIFY=true #set to enable or disable minification of json, reduces traffic volumes: - ./meshcentral/data:/opt/meshcentral/meshcentral-data #config.json and other important files live here. A must for data persistence - ./meshcentral/user_files:/opt/meshcentral/meshcentral-files #where file uploads for users live diff --git a/docker/startup.sh b/docker/startup.sh index 39a852d1..b0b3e555 100644 --- a/docker/startup.sh +++ b/docker/startup.sh @@ -16,6 +16,9 @@ if [ -f "meshcentral-data/config.json" ] cp config.json.template meshcentral-data/config.json sed -i "s/\"cert\": \"myserver.mydomain.com\"/\"cert\": \"$HOSTNAME\"/" meshcentral-data/config.json sed -i "s/\"NewAccounts\": true/\"NewAccounts\": \"$ALLOW_NEW_ACCOUNTS\"/" meshcentral-data/config.json + sed -i "s/\"enabled\": false/\"enabled\": \"$ALLOWPLUGINS\"/" meshcentral-data/config.json + sed -i "s/\"localSessionRecording\": false/\"localSessionRecording\": \"$LOCALSESSIONRECORDING\"/" meshcentral-data/config.json + sed -i "s/\"minify\": true/\"minify\": \"$MINIFY\"/" meshcentral-data/config.json sed -i "s/\"WebRTC\": false/\"WebRTC\": \"$WEBRTC\"/" meshcentral-data/config.json sed -i "s/\"AllowFraming\": false/\"AllowFraming\": \"$IFRAME\"/" meshcentral-data/config.json if [ "$REVERSE_PROXY" != "false" ] @@ -25,4 +28,4 @@ if [ -f "meshcentral-data/config.json" ] exit fi node node_modules/meshcentral --cert "$HOSTNAME" -fi +fi \ No newline at end of file