Skip to content

Commit

Permalink
Adding publicUrl Option for XO Lite Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
bnerickson committed Oct 21, 2024
1 parent f2a3edc commit 137a592
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sample.xo-install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ PRESERVE="3"
# Configurable network-timeout setting for yarn, in ms.
# default: 300000 = 300sec
#YARN_NETWORK_TIMEOUT="300000"

# Change the URL communicated to XO Lite to be used to
# access Xen Orchestra. By default, this is set to the
# IPv4 address of the Xen Orchestra server.
#PUBLIC_URL="https://xoa.company.lan"
6 changes: 6 additions & 0 deletions xo-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ INSTALL_REPOS="${INSTALL_REPOS:-"true"}"
SYSLOG_TARGET="${SYSLOG_TARGET:-""}"
YARN_CACHE_CLEANUP="${YARN_CACHE_CLEANUP:-"false"}"
YARN_NETWORK_TIMEOUT="${YARN_NETWORK_TIMEOUT:-"300000"}"
PUBLIC_URL="${PUBLIC_URL:-""}"

# set variables not changeable in configfile
TIME=$(date +%Y%m%d%H%M)
Expand Down Expand Up @@ -825,6 +826,11 @@ function InstallXO {
runcmd "sed -i \"/^\[logs.transport.syslog.*/a target = '$SYSLOG_TARGET'\" $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml"
fi

if [[ -n "$PUBLIC_URL" ]]; then
printinfo "Setting publicUrl in xo-server configuration file"
runcmd "sed -i \"/^#publicUrl =.*/a publicUrl= '$PUBLIC_URL'\" $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml"
fi

printinfo "Activating modified configuration file"
if ! [[ -d $CONFIGPATH/.config ]]; then
# create generic .config directory only if it doesn't exist as we set permissions to it
Expand Down

0 comments on commit 137a592

Please sign in to comment.