mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-29 09:43:56 +03:00
Create startup.sh
This commit is contained in:
parent
9d32a03c82
commit
a11631502d
28
docker/startup.sh
Normal file
28
docker/startup.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export NODE_ENV=production
|
||||||
|
|
||||||
|
export HOSTNAME
|
||||||
|
export REVERSE_PROXY
|
||||||
|
export REVERSE_PROXY_TLS_PORT
|
||||||
|
export IFRAME
|
||||||
|
export ALLOW_NEW_ACCOUNTS
|
||||||
|
export WEBRTC
|
||||||
|
|
||||||
|
if [ -f "meshcentral-data/config.json" ]
|
||||||
|
then
|
||||||
|
node node_modules/meshcentral
|
||||||
|
else
|
||||||
|
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/\"WebRTC\": false/\"WebRTC\": \"$WEBRTC\"/" meshcentral-data/config.json
|
||||||
|
sed -i "s/\"AllowFraming\": false/\"AllowFraming\": \"$IFRAME\"/" meshcentral-data/config.json
|
||||||
|
if [ "$REVERSE_PROXY" != "false" ]
|
||||||
|
then
|
||||||
|
sed -i "s/\"_certUrl\": \"my\.reverse\.proxy\"/\"certUrl\": \"https:\/\/$REVERSE_PROXY:$REVERSE_PROXY_TLS_PORT\"/" meshcentral-data/config.json
|
||||||
|
node node_modules/meshcentral
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
node node_modules/meshcentral --cert "$HOSTNAME"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user