Skip to content

Commit

Permalink
Merge branch 'ronivay:master' into add_patches
Browse files Browse the repository at this point in the history
  • Loading branch information
ixs authored Apr 1, 2023
2 parents 78b7a4c + 9222f17 commit aff8362
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ rpm:
- cifs-utils
- lvm2
- ntfs-3g
- dmidecode
- sudo (if set in xo-install.cfg)
deb:
Expand All @@ -142,6 +143,7 @@ deb:
- gnupg (debian 10/11)
- software-properties-common (ubuntu)
- ntfs-3g
- dmidecode
- sudo (if set in xo-install.cfg)
```

Expand Down
6 changes: 6 additions & 0 deletions sample.xo-install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,9 @@ PRESERVE="3"
# options: true/false
# default: true
#INSTALL_REPOS="true"

# Send xo-server logs to remote syslog
# syntax is: <protocol>://<target-address>:<port>
# supported protocols are udp and tcp
# example: tcp://syslog.company.lan:514
#SYSLOG_TARGET=""
31 changes: 14 additions & 17 deletions xo-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ACME_CA="${ACME_CA:-"letsencrypt/production"}"
USESUDO="${USESUDO:-"false"}"
GENSUDO="${GENSUDO:-"false"}"
INSTALL_REPOS="${INSTALL_REPOS:-"true"}"
SYSLOG_TARGET="${SYSLOG_TARGET:-""}"

# set variables not changeable in configfile
TIME=$(date +%Y%m%d%H%M)
Expand Down Expand Up @@ -204,9 +205,9 @@ function InstallDependenciesRPM {

# install packages
echo
printprog "Installing build dependencies, redis server, python3, git, nfs-utils, cifs-utils, lvm2, ntfs-3g"
runcmd "yum -y install gcc gcc-c++ make openssl-devel redis libpng-devel python3 git nfs-utils cifs-utils lvm2 ntfs-3g"
printok "Installing build dependencies, redis server, python3, git, nfs-utils, cifs-utils, lvm2, ntfs-3g"
printprog "Installing build dependencies, redis server, python3, git, nfs-utils, cifs-utils, lvm2, ntfs-3g, dmidecode"
runcmd "yum -y install gcc gcc-c++ make openssl-devel redis libpng-devel python3 git nfs-utils cifs-utils lvm2 ntfs-3g dmidecode"
printok "Installing build dependencies, redis server, python3, git, nfs-utils, cifs-utils, lvm2, ntfs-3g, dmidecode"

# only run automated node install if executable not found
if [[ -z $(runcmd_stdout "command -v node") ]]; then
Expand Down Expand Up @@ -288,9 +289,9 @@ function InstallDependenciesDeb {

# install packages
echo
printprog "Installing build dependencies, redis server, python3-minimal, git, libvhdi-utils, lvm2, nfs-common, cifs-utils, curl, ntfs-3g"
runcmd "apt-get install -y build-essential redis-server libpng-dev git libvhdi-utils python3-minimal lvm2 nfs-common cifs-utils curl ntfs-3g"
printok "Installing build dependencies, redis server, python3-minimal, git, libvhdi-utils, lvm2, nfs-common, cifs-utils, curl, ntfs-3g"
printprog "Installing build dependencies, redis server, python3-minimal, git, libvhdi-utils, lvm2, nfs-common, cifs-utils, curl, ntfs-3g, dmidecode"
runcmd "apt-get install -y build-essential redis-server libpng-dev git libvhdi-utils python3-minimal lvm2 nfs-common cifs-utils curl ntfs-3g dmidecode"
printok "Installing build dependencies, redis server, python3-minimal, git, libvhdi-utils, lvm2, nfs-common, cifs-utils, curl, ntfs-3g, dmidecode"

# Install apt-transport-https and ca-certificates because of yarn https repo url
echo
Expand Down Expand Up @@ -617,12 +618,11 @@ function PrepInstall {
if [[ "$INTERACTIVE" == "true" ]]; then
printinfo "No changes to $XO_SVC_DESC since previous install. Run update anyway?"
read -r -p "[y/N]: " answer
answer="${answer:-n}"
case "$answer" in
y)
:
;;
n)
*)
printinfo "Cleaning up install directory: $INSTALLDIR/xo-builds/xen-orchestra-$TIME"
runcmd "rm -rf $INSTALLDIR/xo-builds/xen-orchestra-$TIME"
exit 0
Expand Down Expand Up @@ -826,6 +826,12 @@ function InstallXO {
runcmd "chown -R $XOUSER:$XOUSER $INSTALLDIR/mounts"
fi

if [[ -n "$SYSLOG_TARGET" ]]; then
printinfo "Enabling remote syslog in xo-server configuration file"
runcmd "sed -i \"s%#\[logs.transport.syslog\]%\[logs.transport.syslog\]%\" $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml"
runcmd "sed -i \"/^\[logs.transport.syslog.*/a target = '$SYSLOG_TARGET'\" $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml"
fi

printinfo "Activating modified configuration file"
runcmd "mkdir -p $CONFIGPATH/.config/xo-server"
runcmd "mv -f $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml $CONFIGPATH/.config/xo-server/config.toml"
Expand Down Expand Up @@ -1390,9 +1396,6 @@ function CheckMemory {
y)
:
;;
n)
exit 0
;;
*)
exit 0
;;
Expand All @@ -1416,9 +1419,6 @@ function CheckDiskFree {
y)
:
;;
n)
exit 0
;;
*)
exit 0
;;
Expand Down Expand Up @@ -1524,9 +1524,6 @@ function StartUpScreen {
exit 1
}
;;
n)
exit 0
;;
*)
exit 0
;;
Expand Down

0 comments on commit aff8362

Please sign in to comment.