--- misc/xoa-installer/xoa-installer.sh 2016/12/20 14:28:51 3176 +++ misc/xoa-installer/xoa-installer.sh 2017/01/03 15:01:59 3184 @@ -5,7 +5,8 @@ # # If running on a raspberry 1(A/B) raspian/wheezy - downgrade node.js to 5.4.0 # Please note that raspian/wheezy for arm defaults to gcc 4.6 -# gcc 4.7 is needed for compiling node-js modules +# gcc 4.7 is needed for compiling node-js modules +# 2017-01-03 gcc 4.8 is required BRANCH=stable @@ -18,7 +19,6 @@ - function restartxo { killall -9 node rm -f /root/forever.log @@ -30,6 +30,15 @@ exit fi + +phymem=$(free -m|awk '/^Mem:/{print $2}') +swapmem=$(free -m|awk '/^Swap:/{print $2}') +total=$(expr $phymem + $swapmem) +if [ $total -le 1536 ] ; then + echo not enough memory: $total + exit +fi + if [ "$1" == "clean" ] ; then echo cleaning xo-web rm -rf xo-web @@ -93,7 +102,7 @@ if [ ! -x "/usr/local/bin/node" ] ; then echo "installing node.js" - n stable || exit + n lts || exit fi if [ ! -x "/usr/local/bin/gulp" ] ; then @@ -113,7 +122,7 @@ if [ ! -d "/usr/local/lib/node_modules/bcrypt" ] ; then echo "installing bcrypt" - npm install -g bcrypt || exit + npm install -g --unsafe-perm bcrypt || exit fi if [ ! -d "xo-web" ] ; then @@ -143,7 +152,7 @@ # xo-server echo "building xo-server" cd xo-server - npm install || exit + npm install --unsafe-perm || exit npm run build || exit #for some reasone leveldown fails occasionally on arm/raspberry pi @@ -160,8 +169,7 @@ #xo-web echo "building xo-web" cd xo-web - #npm install --unsafe-perm || exit - npm install || exit + npm install --unsafe-perm || exit npm run build || exit cd .. @@ -195,6 +203,8 @@ echo Installing plugins npm install --global xo-server-transport-email npm install --global xo-server-transport-xmpp +npm install --global xo-server-backup-reports + #npm install --save xo-server-usage-report