Merge remote branch 'origin/master' into wosch
authorWolfram Schneider <wosch@indexdata.dk>
Fri, 8 Aug 2014 14:43:25 +0000 (14:43 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Fri, 8 Aug 2014 14:43:25 +0000 (14:43 +0000)
doc/mkws-manual.markdown
examples/htdocs/mike.html
test/bin/apache-template-update
test/spec/mkws-config.js
tools/apache2/jasmine-dev.apache-modules-2.4.debian.conf [new file with mode: 0644]
tools/apache2/jasmine-dev.apache-modules.ubuntu.conf [deleted file]
tools/apache2/jasmine-dev.template
tools/apache2/jasmine-dev.template-2.4

index 8750d91..2247868 100644 (file)
@@ -431,7 +431,7 @@ this is very simple:
          "//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig" };
        </script>
 
-> TODO This should be the default setting
+> TODO This should be the default setting: see **MKWS-251**.
 
 And ensure that access to the MWKS application is from the correct
 Referrer URL or IP-range.
@@ -445,10 +445,11 @@ URL containing that hostname, such as
 `//yourname.sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig`
 
 > TODO It should be possible to change just the hostname without
-> needing to repeat the rest of the URL (protocol, path, query)
+> needing to repeat the rest of the URL (protocol, path, query): see
+> **MKWS-252**.
 
 > TODO When changing the SP authentication URL, the Pazpar2 URL should
-> in general change along with it.
+> in general change along with it: see **MKWS-253**.
 
 ### (Optional): embed credentials for access to the library
 
@@ -459,7 +460,8 @@ by setting the `service_proxy_auth` configuration item to a URL such as
 `//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig&username=mike&password=swordfish`
 
 > TODO It should be possible to add the username and password to the
-> configuration without needing to repeat the rest of the URL.
+> configuration without needing to repeat the rest of the URL: see
+> **MKWS-254**.
 
 ### (Optional): conceal credentials from HTML source
 
index cfc4f89..90caf92 100644 (file)
@@ -6,7 +6,8 @@
     <script type="text/javascript">
       var mkws_config = {
        pazpar2_url:        "//sp-mkws.indexdata.com/service-proxy/",
-       service_proxy_auth: "//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig"
+        // For now, we have to provide known-bad credentials to skip user/pw login: see bug MKSP-125
+       service_proxy_auth: "//sp-mkws.indexdata.com/service-proxy/?command=auth&action=perconfig&username=XXX&password=XXX"
         // For explicit credential-based authentication, add: &username=orex&password=orexmkc
       };
     </script>
index 54d2f8c..25cfdaf 100755 (executable)
@@ -16,37 +16,39 @@ export APACHE_LOCK_FILE=$APACHE_LOG_DIR/accept.lock
 
 export MKWS_ROOT=$(pwd)/..
 
-MKWS_OS=debian 
+MKWS_OS=debian
 APACHE_VERSION=2.2
+apache2=$(env PATH=/usr/bin:/usr/sbin which apache2 httpd false 2>/dev/null | head -1)
+
 case $(uname) in
-  Darwin ) MKWS_OS=macos 
+  Darwin ) MKWS_OS=macos
           test -e libexec || ln -fs /usr/libexec .
           ;;
-  Linux )  MKWS_OS=debian 
+  Linux )  MKWS_OS=debian
           if [ -e /etc/debian_version ]; then
                MKWS_OS=debian
-               # Ubuntu with Apache 2.2 can continue using debian
-               if /usr/bin/dpkg -s apache2 | grep -q "Version: 2\.4\..*ubuntu"; then
-                       MKWS_OS=ubuntu
-                        APACHE_VERSION=2.4
+                if $apache2 -v | egrep -q 'Server version: Apache/2\.4\.'; then
+                    APACHE_VERSION=2.4
                fi
           fi
           if [ -e /etc/redhat-release ]; then
-               MKWS_OS=centos  
+               MKWS_OS=centos
           fi
           ;;
   * ) MKWS_OS=debian ;;
 esac
 
-export APACHE_MODULES="$MKWS_ROOT/tools/apache2/jasmine-dev.apache-modules.$MKWS_OS.conf"
 
 if [ "$APACHE_VERSION" = "2.4" ]; then
-       : ${MKWS_APACHE_TEMPLATE="$MKWS_ROOT/tools/apache2/jasmine-dev.template-2.4"}
+    : ${MKWS_APACHE_TEMPLATE="$MKWS_ROOT/tools/apache2/jasmine-dev.template-$APACHE_VERSION"}
+    APACHE_MODULES="$MKWS_ROOT/tools/apache2/jasmine-dev.apache-modules-$APACHE_VERSION.$MKWS_OS.conf"
 else
-       : ${MKWS_APACHE_TEMPLATE="$MKWS_ROOT/tools/apache2/jasmine-dev.template"}
+    : ${MKWS_APACHE_TEMPLATE="$MKWS_ROOT/tools/apache2/jasmine-dev.template"}
+    APACHE_MODULES="$MKWS_ROOT/tools/apache2/jasmine-dev.apache-modules.$MKWS_OS.conf"
 fi
-: ${MKWS_APACHE_FILE="$APACHE_LOG_DIR/jasmine-dev"}
 
+: ${MKWS_APACHE_FILE="$APACHE_LOG_DIR/jasmine-dev"}
+export APACHE_MODULES
 
 perl -npe 's,\${(.*?)},$ENV{$1},g; ' $MKWS_APACHE_TEMPLATE > $MKWS_APACHE_FILE.tmp
 mv -f $MKWS_APACHE_FILE.tmp $MKWS_APACHE_FILE
index d168fb2..59a0132 100644 (file)
@@ -18,6 +18,10 @@ describe("Check mkws.config object", function () {
         expect(mkws.locale_lang.da.Location).toMatch(/^Lokation$/);
     });
 
+    /*
+     * this is a test if the config value is a boolean JavaScript object: true or false
+     * and nothing else (0, '0', undefined, "false" etc.)
+     */
     it("mkws.config service proxy enabled/disabled", function () {
         if (mkws.config.use_service_proxy) {
             expect(mkws.config.use_service_proxy).toBe(true);
diff --git a/tools/apache2/jasmine-dev.apache-modules-2.4.debian.conf b/tools/apache2/jasmine-dev.apache-modules-2.4.debian.conf
new file mode 100644 (file)
index 0000000..ca48beb
--- /dev/null
@@ -0,0 +1,21 @@
+# apache 2.4
+
+Include /etc/apache2/mods-available/alias.load
+Include /etc/apache2/mods-available/authz*.load
+Include /etc/apache2/mods-available/proxy*.load
+Include /etc/apache2/mods-available/rewrite.load
+Include /etc/apache2/mods-available/headers.load
+Include /etc/apache2/mods-available/mime.load
+Include /etc/apache2/mods-available/deflate.load
+
+Include /etc/apache2/mods-available/alias*.conf
+Include /etc/apache2/mods-available/proxy*.conf
+Include /etc/apache2/mods-available/mime.conf
+Include /etc/apache2/mods-available/deflate.conf
+
+Include /etc/apache2/mods-enabled/mpm*conf
+Include /etc/apache2/mods-enabled/mpm*load
+Include /etc/apache2/mods-available/xml2enc.load
+Include /etc/apache2/mods-available/filter.load
+Include /etc/apache2/mods-available/slotmem_shm.load
+
diff --git a/tools/apache2/jasmine-dev.apache-modules.ubuntu.conf b/tools/apache2/jasmine-dev.apache-modules.ubuntu.conf
deleted file mode 100644 (file)
index 612d1c1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Include /etc/apache2/mods-available/alias.load
-Include /etc/apache2/mods-available/authz*.load
-Include /etc/apache2/mods-available/proxy*.load
-Include /etc/apache2/mods-available/rewrite.load
-Include /etc/apache2/mods-available/headers.load
-Include /etc/apache2/mods-available/mime.load
-Include /etc/apache2/mods-available/deflate.load
-
-Include /etc/apache2/mods-available/alias*.conf
-Include /etc/apache2/mods-available/proxy*.conf
-Include /etc/apache2/mods-available/mime.conf
-Include /etc/apache2/mods-available/deflate.conf
-
-Include /etc/apache2/mods-enabled/mpm*conf
-Include /etc/apache2/mods-enabled/mpm*load
-Include /etc/apache2/mods-available/xml2enc.load
-Include /etc/apache2/mods-available/filter.load
-Include /etc/apache2/mods-available/slotmem_shm.load
-
index 088b741..acf7cf4 100644 (file)
@@ -1,7 +1,7 @@
 # Configuration for the apache web server                 -*- apache -*-
 
 #####################################################################
-# global apache2 config
+# global apache 2.2 config
 #
 User ${APACHE_RUN_USER}
 Group ${APACHE_RUN_GROUP}
index 6d91adf..3c0f626 100644 (file)
@@ -1,7 +1,7 @@
 # Configuration for the apache web server                 -*- apache -*-
 
 #####################################################################
-# global apache2 config
+# global apache 2.4 config
 #
 User ${APACHE_RUN_USER}
 Group ${APACHE_RUN_GROUP}