diff --git a/README.md b/README.md index 5076674..0d25f5d 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,12 @@ This repo consist of script to install and update [Xen Orchestra](https://xen-or Installation is done using latest xo-server and xo-web sources. With this method Xen-Orchestra has all features unlocked which are normally available only with monthly fee. +Optional plugins can be installed. They are included in XO repository, but not installed by default. Check list from [Xen Orchestra plugins](https://github.com/vatesfr/xen-orchestra/tree/master/packages) and edit xo-install.sh accordingly. + # Instructions ### script -Clone this repository and run xo-install.sh script as root +Clone this repository, edit variables to suit your preferences from the xo-install.sh script and run it as root ``` ./xo-install.sh diff --git a/xo-install.sh b/xo-install.sh index 4cae230..919b92a 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -1,14 +1,33 @@ #!/bin/bash -## Modify to your need ## +######################################################################### +# Title: XenOrchestraInstallerUpdater # +# Author: Roni Väyrynen # +# Repository: https://github.com/ronivay/XenOrchestraInstallerUpdater # +######################################################################### +### Start of editable variables ### + +# Optional user that runs the service. root by default #XOUSER="node" + +# Port number where xen-orchestra service is bound PORT="80" + +# Base dir for installation and future updates INSTALLDIR="/etc/xo" + +# Git branch where xen-orchestra sources are fetched BRANCH="master" + +# Log path for possible errors LOGFILE="$(dirname $0)/xo-install.log" -## Modify to your need ## +# comma separated list of plugins to be installed, check README for more information +#PLUGINS="xo-server-transport-email,xo-server-usage-report,xo-server-perf-alert" + + +### End of editable variables ### function CheckUser { @@ -122,6 +141,28 @@ function InstallDependenciesDebian { } 2>$LOGFILE +function InstallXOPlugins { + if [[ "$PLUGINS" ]] || [[ -z "$PLUGINS" ]]; then + + echo "Installing plugins defined in PLUGINS variable" + echo + local PLUGINSARRAY=($(echo "$PLUGINS" | tr ',' ' ')) + for x in "${PLUGINSARRAY[@]}"; do + if [[ $(find $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages -type d -name "$x") ]]; then + ln -sn $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/$x $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/node_modules/ + else + echo "No $x plugin found from xen-orchestra packages, skipping" + continue + fi + done + + cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn >/dev/null && yarn build >/dev/null + else + echo + echo "No plugins to install" + fi + +} function InstallXO { @@ -348,6 +389,7 @@ fi echo "Port: $PORT" echo "Git Branch for source: $BRANCH" +echo "Following plugins will be installed: "$PLUGINS"" echo echo "Errorlog is stored to $LOGFILE for debug purposes" echo "-----------------------------------------"