2016-01-13 19:23:15 +00:00
|
|
|
#!/bin/bash
|
2016-01-26 20:35:27 +00:00
|
|
|
sudo apt-get install --yes nfs-common
|
2016-01-13 19:23:15 +00:00
|
|
|
cd /opt
|
|
|
|
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
|
2017-03-06 15:56:44 +00:00
|
|
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
|
|
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
2016-01-13 19:23:15 +00:00
|
|
|
sudo apt-get install --yes nodejs
|
|
|
|
curl -o /usr/local/bin/n https://raw.githubusercontent.com/visionmedia/n/master/bin/n
|
2016-01-14 02:28:04 +00:00
|
|
|
sudo chmod +x /usr/local/bin/n
|
|
|
|
sudo n stable
|
2017-01-03 15:23:30 +00:00
|
|
|
sudo apt-get install --yes build-essential redis-server libpng-dev git python-minimal libvhdi-utils
|
2016-01-13 19:23:15 +00:00
|
|
|
git clone -b stable https://github.com/vatesfr/xo-server
|
|
|
|
git clone -b stable https://github.com/vatesfr/xo-web
|
|
|
|
cd xo-server
|
|
|
|
sudo npm install && npm run build
|
2016-01-14 02:28:04 +00:00
|
|
|
sudo cp sample.config.yaml .xo-server.yaml
|
|
|
|
sudo sed -i /mounts/a\\" '/': '/opt/xo-web/dist'" .xo-server.yaml
|
2016-01-13 19:23:15 +00:00
|
|
|
cd /opt/xo-web
|
|
|
|
sudo npm i lodash.trim@3.0.1
|
2017-03-06 15:56:44 +00:00
|
|
|
yarn install --force
|
2016-03-08 20:38:21 +00:00
|
|
|
cat > /etc/systemd/system/xo-server.service <<EOF
|
|
|
|
# systemd service for XO-Server.
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description= XO Server
|
|
|
|
After=network-online.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
WorkingDirectory=/opt/xo-server/
|
|
|
|
ExecStart=/usr/local/bin/node ./bin/xo-server
|
|
|
|
Restart=always
|
|
|
|
SyslogIdentifier=xo-server
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
EOF
|
|
|
|
|
|
|
|
sudo chmod +x /etc/systemd/system/xo-server.service
|
|
|
|
sudo systemctl enable xo-server.service
|
|
|
|
sudo systemctl start xo-server.service
|