mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-31 00:15:57 -05:00
startup and install apps as non-root user
This commit is contained in:
parent
099d1a1239
commit
ebd7a7bced
@ -11,12 +11,10 @@ RUN apt-get update \
|
|||||||
&& rm -rf lzma1604 \
|
&& rm -rf lzma1604 \
|
||||||
&& npm install -g forever
|
&& npm install -g forever
|
||||||
|
|
||||||
RUN npm install greenlock-cli \
|
RUN adduser --quiet meshcentral \
|
||||||
&& chmod +x /startmeshcentral.sh \
|
&& chmod +x /startmeshcentral.sh \
|
||||||
&& adduser --quiet meshcentral
|
&& su - meshcentral \
|
||||||
|
&& npm install meshcentral node-7z greenlock-cli
|
||||||
RUN su - meshcentral \
|
|
||||||
&& npm install meshcentral node-7z
|
|
||||||
|
|
||||||
ENV PORT 443
|
ENV PORT 443
|
||||||
ENV REDIRPORT 80
|
ENV REDIRPORT 80
|
||||||
|
@ -12,11 +12,15 @@ fi
|
|||||||
|
|
||||||
cd /home/meshcentral
|
cd /home/meshcentral
|
||||||
npmbin=$(which node)
|
npmbin=$(which node)
|
||||||
$npmbin install meshcentral
|
|
||||||
foreverbin=$(which forever)
|
foreverbin=$(which forever)
|
||||||
$foreverbin start node_modules/meshcentral/meshcentral.js --cert $HOSTNAME
|
$npmbin install meshcentral
|
||||||
sleep 10
|
|
||||||
$foreverbin stop node_modules/meshcentral/meshcentral.js
|
if ! [ -f node_modules/.meshcentral-data/agentserver-cert-private.key ] ;then
|
||||||
|
$foreverbin start node_modules/meshcentral/meshcentral.js --cert $HOSTNAME
|
||||||
|
sleep 10
|
||||||
|
$foreverbin stop node_modules/meshcentral/meshcentral.js
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f ssl.key ]; then
|
if [ -f ssl.key ]; then
|
||||||
ln -sf ssl.key node_modules/.meshcentral-data/agentserver-cert-private.key
|
ln -sf ssl.key node_modules/.meshcentral-data/agentserver-cert-private.key
|
||||||
ln -sf ssl.cert node_modules/.meshcentral-data/agentserver-cert-public.crt
|
ln -sf ssl.cert node_modules/.meshcentral-data/agentserver-cert-public.crt
|
||||||
@ -27,5 +31,6 @@ if [ -f ssl.key ]; then
|
|||||||
ln -sf ssl.key node_modules/.meshcentral-data/mpsserver-cert-private.key
|
ln -sf ssl.key node_modules/.meshcentral-data/mpsserver-cert-private.key
|
||||||
ln -sf ssl.cert node_modules/.meshcentral-data/mpsserver-cert-public.crt
|
ln -sf ssl.cert node_modules/.meshcentral-data/mpsserver-cert-public.crt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$foreverbin start node_modules/meshcentral/meshcentral.js --port $PORT --redirport $REDIRPORT
|
$foreverbin start node_modules/meshcentral/meshcentral.js --port $PORT --redirport $REDIRPORT
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user