EG install: use websocketd, per LP#1777180
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Mon, 18 Jun 2018 17:03:59 +0000 (10:03 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Mon, 18 Jun 2018 17:32:41 +0000 (10:32 -0700)
deployment/install-eg.sh
deployment/install-osrf.sh

index dc0937d..30ea5bb 100755 (executable)
@@ -11,7 +11,7 @@ STAMP_ID="rel_3_1_0"
 ALT_STAMP_IDS="3_1_0"
 VERSION="3.1.0.sitka.1"
 SITKACONF="/home/${DEFAULT_USER}/sysadmin"
-SITKACONF_BRANCH="master"
+SITKACONF_BRANCH="websocketd"
 SITKATOOLS="/root/sitka-tools"
 
 THISHOST=`hostname -s`
index a34830e..a1c217c 100755 (executable)
@@ -3,10 +3,14 @@ DEFAULT_USER="opensrf"
 HOMEDIR="/home/${DEFAULT_USER}"
 BUILDDIR="${HOMEDIR}/opensrf"
 INSTALLDIR="/srv/openils"
-BRANCH="rel_3_0"
+BRANCH="user/berick/websocketd-backend"
 HOSTNAME="nonprod"
 SITKACONF="${HOMEDIR}/sysadmin"
-SITKACONF_BRANCH="master"
+SITKACONF_BRANCH="websocketd"
+
+WEBSOCKETD_VERSION="0.3.0"
+WEBSOCKETD_ZIP="websocketd-${WEBSOCKETD_VERSION}-linux_amd64.zip"
+WEBSOCKETD_URL="https://github.com/joewalnes/websocketd/releases/download/v${WEBSOCKETD_VERSION}/${WEBSOCKETD_ZIP}"
 
 THISHOST=`hostname -s`
 
@@ -55,7 +59,7 @@ then
 fi
 su -c "cd ${HOMEDIR}/sysadmin && git fetch origin && git checkout ${SITKACONF_BRANCH} && git pull" ${DEFAULT_USER}
 if [ ! -d "${BUILDDIR}/.git" ] ; then
-  su -c "cd ${HOMEDIR} && git clone git://git.evergreen-ils.org/OpenSRF.git opensrf" ${DEFAULT_USER}
+  su -c "cd ${HOMEDIR} && git clone git://git.evergreen-ils.org/working/OpenSRF.git opensrf" ${DEFAULT_USER}
 fi
 su -c "cd ${BUILDDIR} && git fetch origin && git checkout ${BRANCH} && git pull" ${DEFAULT_USER}
  
@@ -131,17 +135,14 @@ echo "OpenSRF is installed!"
 # websockets install (REQUIRED for web client)
 # XXX a valid SSL cert is required!
 if [[ ! -n "$SKIP_WEBSOCKETS" ]] ; then
+  # remove apache-websocket stuff
   rm -r /tmp/apache-websocket
   rm -r /etc/apache2-websockets /etc/init.d/apache2-websockets /usr/local/sbin/*-websockets /var/log/apache2-websockets/ /etc/logrotate.d/apache2-websockets
-  cd /tmp && git clone https://github.com/disconnect/apache-websocket
-  cd apache-websocket && apxs2 -i -a -c mod_websocket.c
-  sh /usr/share/doc/apache2/examples/setup-instance websockets
-  a2dismod websocket
-  cp ${SITKACONF}/files/etc/apache2-websockets/apache2.conf/${HOSTNAME} /etc/apache2-websockets/apache2.conf
-  sed -i "s|__THISHOST__|${THISHOST}|g" /etc/apache2-websockets/apache2.conf
-  cp ${SITKACONF}/files/etc/apache2-websockets/envvars/${HOSTNAME} /etc/apache2-websockets/envvars
 
-  #/etc/init.d/apache2-websockets start
+  # install websocketd
+  [[ -e "/tmp/websocketd" ]] && rm /tmp/websocketd
+  su -c "cd /tmp && wget '${WEBSOCKETD_URL}' && unzip ${WEBSOCKETD_ZIP}" ${DEFAULT_USER}
+  cp /tmp/websocketd /usr/local/bin/
 
   #echo "websockets is installed!"
 fi