You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
973 B
43 lines
973 B
sudo dnf -y update
|
|
sudo dnf -y in nano nodejs npm mongodb
|
|
systemctl enable --now mongodb
|
|
|
|
sudo useradd -m -r -d /home/meshcentral -s /sbin/nologin meshcentral
|
|
|
|
#
|
|
#
|
|
cat <<EOF > /etc/systemd/system/meshcentral.service
|
|
[Unit]
|
|
Description=MeshCentral Server
|
|
|
|
[Service]
|
|
Type=simple
|
|
LimitNOFILE=1000000
|
|
ExecStart=/usr/bin/node /home/meshcentral/node_modules/meshcentral
|
|
WorkingDirectory=/home/meshcentral
|
|
Environment=NODE_ENV=production
|
|
User=default
|
|
Group=default
|
|
Restart=always
|
|
# Restart service after 10 seconds if node service crashes
|
|
RestartSec=10
|
|
# Set port permissions capability
|
|
#AmbientCapabilities=cap_net_bind_service
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
#
|
|
#
|
|
|
|
|
|
cd /home/meshcentral
|
|
sudo npm install meshcentral
|
|
read -n1 -r -p "Press any key to continue..."
|
|
nano meshcentral-data/config.json
|
|
echo "ctrl+c to continue after testing..."
|
|
sudo -u meshcentral node ./node_modules/meshcentral
|
|
|
|
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now meshcentral.service |