LP#1790923: disable XUL staff client by default
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 5 Sep 2018 20:29:22 +0000 (16:29 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 6 Sep 2018 21:27:25 +0000 (17:27 -0400)
This patch discourages use of the legacy XUL staff client
by adjusting the installation process so that a versioned XUL
server directory is not created. Instead, by default XUL
server files (which is still needed by a few web staff client
interfaces) end up in /openils/var/web/xul/legacy. During installation
and upgrade, the /openils/var/web/xul/server symbolic link is
set to point to /openils/var/web/xul/legacy/server if possible.

If for some reason a given installation of Evergreen 3.2.x does not
wish to stop using the XUL staff client, STAFF_CLIENT_STAMP_ID
can still be provided during the 'make install' step, and the
make_release script can still create the XUL client installers
if given the -x switch.

Note, however, that use of the XUL staff client in 3.2.x is
NOT RECOMMENDED and no longer under any guarantee of community
support.

To test
-------
[1] Perform a fresh installation and verify that /openils/var/web/xul/legacy
    is created and that /openils/var/web/xul/server is a symlink
    pointing to /openils/var/web/xul/legacy/server.
[2] Verify that the web staff client works and that the
    user permissions editor in particular continues to work.
[3] Perform an upgrade; verify that /openils/var/web/xul/legacy exists
    and that if /openils/var/web/xul/server started out as a symlink,
    it has been repointed.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/xul/staff_client/Makefile.am
docs/installation/server_installation.adoc
docs/installation/server_upgrade.adoc

index 0da672f..7834a01 100644 (file)
@@ -5,7 +5,7 @@
 export WEBDIR=@localstatedir@/web
 export STAFF_CLIENT_BUILD_ID = $$(/bin/cat build/BUILD_ID)
 export STAFF_CLIENT_VERSION = $$(/bin/cat build/VERSION)
-export STAFF_CLIENT_STAMP_ID = $$(/bin/cat build/STAMP_ID)
+export STAFF_CLIENT_STAMP_ID = legacy
 
 # from http://closure-compiler.googlecode.com/files/compiler-latest.zip  FIXME: Autotools this?
 export CLOSURE_COMPILER_JAR = ~/closure-compiler/compiler.jar
@@ -201,6 +201,26 @@ server-xul: needwebdir build
        @echo "Copying xul into $(DESTDIR)$(WEBDIR)/xul/$(STAFF_CLIENT_STAMP_ID)"
        mkdir -p "$(DESTDIR)$(WEBDIR)/xul/$(STAFF_CLIENT_STAMP_ID)"
        cp -R @top_srcdir@/Open-ILS/xul/staff_client/build/server "$(DESTDIR)${WEBDIR}/xul/${STAFF_CLIENT_STAMP_ID}/"
+       @if [ "${STAFF_CLIENT_STAMP_ID}" == "legacy" ]; then \
+               echo "Installing the legacy parts of the XUL staff client"; \
+               if [ -L "$(DESTDIR)${WEBDIR}/xul/server" ]; then \
+                       echo "Updating XUL server symlink to point to legacy code"; \
+                       rm $(DESTDIR)${WEBDIR}/xul/server; \
+                       ( cd "$(DESTDIR)${WEBDIR}/xul"; ln -s legacy/server server; ); \
+               else \
+                       if [ ! -f "$(DESTDIR)${WEBDIR}/xul/server" ]; then \
+                               echo "Creating XUL server symlink to point to legacy code"; \
+                               ( cd "$(DESTDIR)${WEBDIR}/xul"; ln -s legacy/server server; ); \
+                       else \
+                               if [ -d "$(DESTDIR)${WEBDIR}/xul/server" ]; then \
+                                       echo "WARNING: $(DESTDIR)${WEBDIR}/xul/server is a directory; "; \
+                                       echo "Not overwriting it, but you should probably do the following: "; \
+                                       echo "1. Remove or move it, and "; \
+                                       echo "2. Create a symlink from $(DESTDIR)${WEBDIR}/xul/legacy/server to $(DESTDIR)${WEBDIR}/xul/server "; \
+                               fi; \
+                       fi; \
+               fi; \
+       fi; # manage the server symlink if installing the 'legacy' staff client
 
 compress-javascript: build
        @echo "Size of build/ before compression = " `du -sh build/`
index c057e59..9c7eedd 100644 (file)
@@ -248,24 +248,10 @@ Installation instructions
    command as the *root* Linux account to install Evergreen, build the server
    portion of the staff client, and copy example configuration files to
    `/openils/conf`.
-   Change the value of the `STAFF_CLIENT_STAMP_ID` variable to match the version
-   of the staff client that you will use to connect to the Evergreen server.
 +
 [source, bash]
 ------------------------------------------------------------------------------
-make STAFF_CLIENT_STAMP_ID=rel_name install
-------------------------------------------------------------------------------
-+
-2. The server portion of the staff client expects `http://hostname/xul/server`
-   to resolve. Issue the following commands as the *root* Linux account to
-   create a symbolic link pointing to the `server` subdirectory of the server
-   portion of the staff client that we just built using the staff client ID
-   'rel_name':
-+
-[source, bash]
-------------------------------------------------------------------------------
-cd /openils/var/web/xul
-ln -sf rel_name/server server
+make install
 ------------------------------------------------------------------------------
 
 Change ownership of the Evergreen files
index 3f1c7ea..c7c1bf0 100644 (file)
@@ -94,6 +94,17 @@ These instructions assume that you have also installed OpenSRF under /openils/.
 [source, bash]
 ------------------------------------------------------------
 cd /home/opensrf/Evergreen-ILS-2.12.0
+make install
+------------------------------------------------------------
++
+
+**Note** that this version of Evergreen does not use the legacy XUL staff
+client by default, but if you wish to use a versioned XUL staff client, you
+can supply `STAFF_CLIENT_STAMP` during the `make install` step like this:
++
+[source, bash]
+------------------------------------------------------------
+cd /home/opensrf/Evergreen-ILS-2.12.0
 make STAFF_CLIENT_STAMP_ID=rel_2_12_rc install
 ------------------------------------------------------------
 +
@@ -104,7 +115,8 @@ make STAFF_CLIENT_STAMP_ID=rel_2_12_rc install
 chown -R opensrf:opensrf /openils
 ------------------------------------------------------------
 +
-. As the *opensrf* user, update the server symlink in /openils/var/web/xul/:
+. (Optional, only if you are using the legacy staff client)
+  As the *opensrf* user, update the server symlink in /openils/var/web/xul/:
 +
 [source, bash]
 -----------------------------------------------------------