From ccf7043cbb1850d0efb5a155c1db551a2904db46 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 4 Dec 2018 11:28:16 -0500 Subject: [PATCH] Build Web Staff Client and Websocketd Modify the SSL README file to show how to combine the server certificate and chain files into 1 file for websocketd and apache. Add steps to script/postbuild.sh to write steps for web staff client and websocketd to the buildeg.sh script: 1. Add ubuntu-$EGVMSUITE-developer target to Evergreen prerequisite installation. 2. Add web client JS installation steps. 3. Add eg2 Angular installation steps if the directory is present. 4. Download, install, and start websocketd. Signed-off-by: Jason Stephenson --- files/ssl/README | 19 ++++++++++++++++++- scripts/postbuild.sh | 25 ++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/files/ssl/README b/files/ssl/README index 586a736..fd82253 100644 --- a/files/ssl/README +++ b/files/ssl/README @@ -2,4 +2,21 @@ SSL Certificate files should be placed in here server.crt - The main certificate file server.key - The private key for the certificate file -chain.crt - The certificate chain, if needed (config will be updated to include it if necessary) +chain.crt - The certificate chain, if needed + +For websocketd to function, you must combine the server.crt and +chain.crt files in the following manner: + +[source, bash] +-------------- +cat server.crt chain.crt > combined.crt +mv combined.crt server.crt +rm chain.crt +-------------- + +Be sure to backup your files beforehand as the above steps are +destructive. You also need to make sure that there is a newline at +the end of the server.crt file before doing the concatenation. + +NOTE: The combined certificate and chain files also work with Apache +since at least version 2.2. diff --git a/scripts/postbuild.sh b/scripts/postbuild.sh index 79cdba7..3b3c4e0 100755 --- a/scripts/postbuild.sh +++ b/scripts/postbuild.sh @@ -86,7 +86,10 @@ exit 0; CPANCONFIG sudo make -f OpenSRF/src/extras/Makefile.install ubuntu-$EGVMSUITE -sudo make -f Evergreen/Open-ILS/src/extras/Makefile.install ubuntu-$EGVMSUITE postgres-server-ubuntu-$EGVMSUITE +sudo make -f Evergreen/Open-ILS/src/extras/Makefile.install ubuntu-$EGVMSUITE ubuntu-$EGVMSUITE-developer postgres-server-ubuntu-$EGVMSUITE + +# Clean up from Node.js installation +sudo chown -R opensrf:opensrf /home/opensrf/.configure cd /home/opensrf/OpenSRF autoreconf -i @@ -96,6 +99,17 @@ sudo make install export PATH=\$PATH:/openils/bin +# Build the web staff client: +cd /home/opensrf/Evergreen/Open-ILS/web/js/ui/default/staff/ +npm install +npm run build +# Build new, Angular eg2, if present +if [ -d "/home/opensrf/Evergreen/Open-ILS/src/eg2" ]; then + cd /home/opensrf/Evergreen/Open-ILS/src/eg2 + npm install + ng build +fi + cd /home/opensrf/Evergreen autoreconf -i ./configure --prefix=/openils --sysconfdir=/openils/conf $EGVMCONFIGHOST @@ -157,6 +171,15 @@ perl Open-ILS/src/support-scripts/eg_db_config --update-config \\ --user evergreen --password $EGVMPGPASS --hostname localhost --port 5432 \\ --database evergreen --admin-user $EGVMEGUSER --admin-pass $EGVMEGPASS --load-all-sample +# Install and start websocketd +cd /home/opensrf +wget https://github.com/joewalnes/websocketd/releases/download/v0.3.0/websocketd-0.3.0-linux_amd64.zip +sudo unzip websocketd-0.3.0-linux_amd64.zip websocketd -d /usr/local/bin/ +sudo -b /usr/local/bin/websocketd --port 7682 --ssl \ + --sslcert=/etc/apache2/ssl/server.crt \ + --sslkey=/etc/apache2/ssl/server.key \ + --loglevel=error /openils/bin/osrf-websocket-stdio + # Start Evergreen up! osrf_control --localhost --start-all /openils/bin/autogen.sh -- 2.11.0