2016-03-28 23:50:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-06-07 14:49:26 +00:00
|
|
|
sudo mkdir -p /srv/walnut/{certs,core,letsencrypt,lib,etc,config}
|
|
|
|
sudo mkdir -p /srv/walnut/etc/org.oauth3.consumer
|
|
|
|
sudo mkdir -p /srv/walnut/etc/org.oauth3.provider
|
2016-03-28 23:50:36 +00:00
|
|
|
sudo mkdir -p /srv/walnut/packages/{api,pages,services}
|
|
|
|
sudo chown -R $(whoami):$(whoami) /srv/walnut
|
|
|
|
|
|
|
|
#git clone git@github.com:Daplie/walnut.git
|
|
|
|
git clone https://github.com/Daplie/walnut.git /srv/walnut/core
|
|
|
|
|
|
|
|
pushd /srv/walnut/core
|
|
|
|
npm install
|
|
|
|
popd
|
2016-04-09 23:14:00 +00:00
|
|
|
|
|
|
|
sudo rsync -a /srv/walnut/core/etc/init/walnut.conf /etc/init/walnut.conf
|
|
|
|
rsync -a /srv/walnut/core/etc/letsencrypt/ /srv/walnut/certs/
|
2016-03-28 23:50:36 +00:00
|
|
|
mv /srv/walnut/core/node_modules /srv/walnut
|
|
|
|
|
2016-04-09 23:14:00 +00:00
|
|
|
echo -n "Enter an email address to use for LetsEncrypt and press [ENTER]: "
|
|
|
|
read LE_EMAIL
|
|
|
|
node -e "
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
require('fs').writeFileSync('/srv/walnut/config.letsencrypt.json', JSON.stringify({
|
|
|
|
configDir: '/srv/walnut/letsencrypt'
|
|
|
|
, email: '$LE_EMAIL'
|
|
|
|
, agreeTos: true
|
|
|
|
}, null, ' '));
|
|
|
|
"
|
|
|
|
|
2016-03-28 23:50:36 +00:00
|
|
|
sudo service walnut stop
|
|
|
|
sudo service walnut start
|