From 7031c96a00532ff4524873e3f04c4102d2314de4 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Fri, 29 Jul 2016 13:14:53 -0400
Subject: [PATCH 001/105] first commit

---
 README.md | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 README.md

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..07289f2
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# COManage

From 287b43c6126dc007f2c5ef0da085a70e086adbfc Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Fri, 29 Jul 2016 13:17:55 -0400
Subject: [PATCH 002/105] Getting started with COmanage repo

---
 .gitignore    |  7 +++++++
 BINSCRIPTS.md | 41 ++++++++++++++++++++++++++++++++++++++
 Jenkinsfile   | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
 common.bash   |  2 ++
 4 files changed, 104 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 BINSCRIPTS.md
 create mode 100644 Jenkinsfile
 create mode 100644 common.bash

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7323a01
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+bin/build.sh
+bin/destroy.sh
+bin/install.sh
+bin/rebuild.sh
+bin/rerun.sh
+bin/run.sh
+bin/test.sh
diff --git a/BINSCRIPTS.md b/BINSCRIPTS.md
new file mode 100644
index 0000000..8569b7d
--- /dev/null
+++ b/BINSCRIPTS.md
@@ -0,0 +1,41 @@
+# util
+
+This repository is intended to be downloaded into a container repository during development for convenience purposes.  Since the major mechanisms of developing to the Docker container construction lifecycle are identical across container images, this repository allows for consistency and additional ease of use across all container images.
+
+## Install
+
+If you are reading this file in BINSCRIPTS.md, your container project is likely to be util-enabled.
+
+To use these scripts yourself, issue this command:
+
+```
+curl "https://github.internet2.edu/raw/docker/util/master/bin/install.sh?token=AAAAEddkrL9MeeA6VWcNn_PgV30r4lD1ks5XogeiwA%3D%3D" | bash
+```
+
+### common.bash
+
+The installation process will create a common.bash file.  This file should be the central, canonical authority for management of environment variables.  While a subprocess may override them, the files in common.bash should be treated as authoritative defaults.  Processes (e.g. `docker build`, `bats`, inside `Jenkinsfile`) can read this file and process the results therein.
+
+You should edit this file to change the image name, and add any other helpful environment variables.
+
+### Jenkinsfile
+
+This will also install a Jenkinsfile to your repository, if it doesn't have one.  This will ensure that your Jenkins pipeline can leverage these scripts in the way intended.  Ensuring the commands that you issue on your laptop match the commands issued by the build pipeline is critical to ensure predictable, reliable results.
+
+## Use
+
+
+### Building
+
+#### build.sh
+`bin/build.sh `
+#### destroy.sh
+#### rebuild.sh
+
+### Running
+### rerun.sh
+### run.sh
+
+
+### Testing
+#### test.sh
\ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..fbb9f16
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,54 @@
+node {
+
+  stage 'Checkout'
+
+    checkout scm
+    
+  stage 'Acquire util'
+    
+    sh 'mkdir -p bin'
+    dir('bin'){
+      git([ url: "https://github.internet2.edu/docker/util.git",
+          credentialsId: "jenkins-github-access-token" ])
+      sh 'ls'
+      sh 'mv bin/* .'
+    }
+    
+  stage 'Build'
+    
+    def maintainer = maintainer()
+    def imagename = imagename()
+    def tag = env.BRANCH_NAME
+    if(!imagename){
+      echo "You must define an imagename in common.bash"
+      currentBuild.result = 'FAILURE'
+    }
+    if(maintainer){
+      echo "Building ${maintainer}:${tag} for ${maintainer}"
+    }
+    
+    sh 'bin/build.sh'
+    
+  stage 'Tests'
+  
+    sh 'bin/test.sh'
+    
+  stage 'Push'
+  
+    docker.withRegistry('https://registry.hub.docker.com/',   "dockerhub-$maintainer") {
+          def baseImg = docker.build("$maintainer/$imagename")
+          baseImg.push("$tag")
+    }
+    
+
+}
+
+def maintainer() {
+  def matcher = readFile('common.bash') =~ 'maintainer="(.+)"'
+  matcher ? matcher[0][1] : 'tier'
+}
+
+def imagename() {
+  def matcher = readFile('common.bash') =~ 'imagename="(.+)"'
+  matcher ? matcher[0][1] : null
+}
\ No newline at end of file
diff --git a/common.bash b/common.bash
new file mode 100644
index 0000000..55b3596
--- /dev/null
+++ b/common.bash
@@ -0,0 +1,2 @@
+maintainer="bigfleet"
+imagename="comanage"
\ No newline at end of file

From 1bc8be0abe2221aaa8ee67dfce23b6796ae663de Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Fri, 9 Sep 2016 11:26:22 -0400
Subject: [PATCH 003/105] Initial port of many resources

---
 Dockerfile                                    | 100 +++++++++++
 Jenkinsfile                                   |  66 +++++--
 common.bash                                   |   3 +-
 container_files/bin/cleanup.sh                |   1 +
 container_files/bin/configure.sh              |   9 +
 container_files/bin/configure_http.sh         |   5 +
 container_files/bin/configure_php.sh          |   7 +
 container_files/bin/configure_shibd.sh        |   7 +
 container_files/bin/main.sh                   |  20 +++
 container_files/bin/start.sh                  |  33 ++++
 .../etc/httpd/conf.d/comanage.conf            | 107 ++++++++++++
 container_files/etc/php/EmailShell.php        |  41 +++++
 container_files/etc/php/database.php          |  83 +++++++++
 container_files/etc/php/email.php             | 101 +++++++++++
 .../etc/shibboleth/attribute-map.xml          |  32 ++++
 .../etc/shibboleth/inc-md-cert.pem            |  21 +++
 .../etc/shibboleth/shibboleth2.xml            |  56 ++++++
 .../etc/shibboleth/shibboleth_keygen.sh       |  75 ++++++++
 container_files/wait-for-it/LICENSE           |  20 +++
 container_files/wait-for-it/README.md         |  59 +++++++
 container_files/wait-for-it/wait-for-it.sh    | 161 ++++++++++++++++++
 21 files changed, 990 insertions(+), 17 deletions(-)
 create mode 100644 Dockerfile
 create mode 100755 container_files/bin/cleanup.sh
 create mode 100755 container_files/bin/configure.sh
 create mode 100755 container_files/bin/configure_http.sh
 create mode 100755 container_files/bin/configure_php.sh
 create mode 100755 container_files/bin/configure_shibd.sh
 create mode 100755 container_files/bin/main.sh
 create mode 100755 container_files/bin/start.sh
 create mode 100644 container_files/etc/httpd/conf.d/comanage.conf
 create mode 100644 container_files/etc/php/EmailShell.php
 create mode 100644 container_files/etc/php/database.php
 create mode 100644 container_files/etc/php/email.php
 create mode 100644 container_files/etc/shibboleth/attribute-map.xml
 create mode 100644 container_files/etc/shibboleth/inc-md-cert.pem
 create mode 100644 container_files/etc/shibboleth/shibboleth2.xml
 create mode 100755 container_files/etc/shibboleth/shibboleth_keygen.sh
 create mode 100644 container_files/wait-for-it/LICENSE
 create mode 100644 container_files/wait-for-it/README.md
 create mode 100755 container_files/wait-for-it/wait-for-it.sh

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..1741ef3
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,100 @@
+FROM bigfleet/shibboleth_sp
+
+# Define args and set a default value
+ARG registry=docker.io
+ARG maintainer=tier
+ARG imagename=comanage
+ARG version=1.0.5
+
+MAINTAINER $maintainer
+LABEL Vendor="Internet2"
+LABEL ImageType="COmanage"
+LABEL ImageName=$imagename
+LABEL ImageOS=centos7
+LABEL Version=$version
+
+LABEL Build docker build --rm --tag $registry/$maintainer/$imagename .
+
+# Install deps
+RUN yum -y install --setopt=tsflags=nodocs \
+    httpd \
+    mariadb \
+    mysql-devel \
+    mysql-libs \
+    mod_ssl \
+    php \
+    php-openssl \
+    php-cli \
+    php-ldap \
+    php-mbstring \
+    php-mcrypt \
+    php-mysql \
+    php-pear-MDB2-Driver-mysqli \
+    php-pecl-memcached \
+    php-xml \
+    vim && yum -y clean all
+
+#
+# Global PHP configuration changes
+#
+RUN sed -i \
+    -e 's~^;date.timezone =$~date.timezone = Europe/Rome~g' \
+    -e 's~^;user_ini.filename =$~user_ini.filename =~g' \
+    /etc/php.ini
+
+RUN echo '<?php phpinfo(); ?>' > /var/www/html/index.php
+
+ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$version.tar.gz
+
+RUN mkdir -p /tmp/comanage && cd /tmp/comanage && \
+      wget -q $COMANAGE_URL \
+# Perform verifications [TODO]
+# Prepare filesystem
+           tar xf $version.tar.gz && \
+           mkdir -p /opt/comanage && \
+           mv $version /opt/comanage/. && \
+           ln -s /opt/comanage/$version /opt/comanage/current && \
+# Cleanup
+           rm -rf /tmp/comanage
+
+ENV COMANAGE_HOME /opt/comanage/current
+
+WORKDIR $COMANAGE_HOME
+
+# Add starters and installers
+ADD ./container_files /opt
+
+# Add Volumes and Set permissions
+RUN mkdir /opt/shared \
+    && chmod 777 /opt/shared \
+    && chmod 777 /root/*.sh \
+    && chmod 777 /root/shibboleth/*.sh
+
+# Environment variables
+ENV ADMIN_NAME "Scott"
+ENV ADMIN_FAMILY "Koranda"
+ENV ADMIN_USERNAME "scott.koranda@sphericalcowgroup.com"
+ENV COMANAGE_SERVER_FQDN "comanage.testbed.tier.internet2.edu"
+ENV COMANAGE_MAIL_FROM "comanage_registry@picard.cgac.uwm.edu"
+ENV COMANAGE_MAIL_HOST "localhost"
+ENV COMANAGE_MAIL_PORT "25"
+ENV COMANAGE_MAIL_USER "user"
+ENV COMANAGE_MAIL_PASS "secret"
+ENV MYSQL_HOST "i2mariadb"
+ENV MYSQL_DATABASE "registry"
+ENV MYSQL_USER "registry_user"
+ENV MYSQL_PASSWORD "WJzesbe3poNZ91qIbmR7"
+ENV TERM "testterm"
+# How long will we wait for MariaDB to start up?
+ENV WAIT_TIME 60
+
+# Required volumes for mounting Shibboleth SSL files into container
+VOLUME /opt/shibboleth/ssl/
+
+# Required volumes for mounting Apache SSL files into container
+VOLUME /opt/httpd/ssl/
+
+# Port
+EXPOSE 80 443
+
+CMD ["/opt/bin/start.sh"]
\ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
index fbb9f16..c4b3931 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -3,43 +3,69 @@ node {
   stage 'Checkout'
 
     checkout scm
-    
+
   stage 'Acquire util'
     
-    sh 'mkdir -p bin'
-    dir('bin'){
+    sh 'mkdir -p tmp && mkdir -p bin'
+    dir('tmp'){
       git([ url: "https://github.internet2.edu/docker/util.git",
           credentialsId: "jenkins-github-access-token" ])
-      sh 'ls'
-      sh 'mv bin/* .'
+      sh 'mv ./bin/* ../bin/.'
     }
-    
-  stage 'Build'
-    
+    sh 'rm -rf tmp'
+
+  stage 'Setting build context'
+  
     def maintainer = maintainer()
     def imagename = imagename()
-    def tag = env.BRANCH_NAME
+    def tag
+    
+    // Tag images created on master branch with 'latest'
+    if(env.BRANCH_NAME == "master"){
+      tag = "latest"
+    }else{
+      tag = env.BRANCH_NAME
+    }
+        
     if(!imagename){
       echo "You must define an imagename in common.bash"
       currentBuild.result = 'FAILURE'
+     }
+     if(maintainer){
+      echo "Building ${imagename}:${tag} for ${maintainer}"
+     }
+     
+  stage 'Build'
+    try{
+      sh 'bin/build.sh &> debug'
+    } catch(error) {
+      def error_details = readFile('./debug');
+      def message = "BUILD ERROR: There was a problem building ${imagename}:${tag}. \n\n ${error_details}"
+      sh "rm -f ./debug"
+      handleError(message)
     }
-    if(maintainer){
-      echo "Building ${maintainer}:${tag} for ${maintainer}"
-    }
-    
-    sh 'bin/build.sh'
     
   stage 'Tests'
   
-    sh 'bin/test.sh'
+    try{
+      sh 'bin/test.sh &> debug'
+    } catch(error) {
+      def error_details = readFile('./debug');
+      def message = "BUILD ERROR: There was a problem building ${imagename}:${tag}. \n\n ${error_details}"
+      sh "rm -f ./debug"
+      handleError(message)
+    }
     
   stage 'Push'
-  
+
     docker.withRegistry('https://registry.hub.docker.com/',   "dockerhub-$maintainer") {
           def baseImg = docker.build("$maintainer/$imagename")
           baseImg.push("$tag")
     }
     
+  stage 'Notify'
+  
+    slackSend color: 'good', message: "$maintainer/$imagename:$tag pushed to DockerHub"
 
 }
 
@@ -51,4 +77,12 @@ def maintainer() {
 def imagename() {
   def matcher = readFile('common.bash') =~ 'imagename="(.+)"'
   matcher ? matcher[0][1] : null
+}
+
+def handleError(String message){
+  echo "${message}"
+  currentBuild.setResult("FAILED")
+  slackSend color: 'danger', message: "${message}"
+  //step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'chris.bynum@levvel.io', sendToIndividuals: true])
+  sh 'exit 1'
 }
\ No newline at end of file
diff --git a/common.bash b/common.bash
index 55b3596..79fd23f 100644
--- a/common.bash
+++ b/common.bash
@@ -1,2 +1,3 @@
 maintainer="bigfleet"
-imagename="comanage"
\ No newline at end of file
+imagename="comanage"
+version="1.0.5"
\ No newline at end of file
diff --git a/container_files/bin/cleanup.sh b/container_files/bin/cleanup.sh
new file mode 100755
index 0000000..a9bf588
--- /dev/null
+++ b/container_files/bin/cleanup.sh
@@ -0,0 +1 @@
+#!/bin/bash
diff --git a/container_files/bin/configure.sh b/container_files/bin/configure.sh
new file mode 100755
index 0000000..afc0de0
--- /dev/null
+++ b/container_files/bin/configure.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+/opt/bin/configure_httpd.sh
+
+/opt/bin/configure_php.sh
+
+/opt/bin/configure_shibd.sh
+
+
diff --git a/container_files/bin/configure_http.sh b/container_files/bin/configure_http.sh
new file mode 100755
index 0000000..d94aafe
--- /dev/null
+++ b/container_files/bin/configure_http.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+log="/tmp/httpd.log"
+
+echo "Configuring httpd: " > $log
\ No newline at end of file
diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
new file mode 100755
index 0000000..0a8ecd1
--- /dev/null
+++ b/container_files/bin/configure_php.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+log="/tmp/php.log"
+
+echo "Configuring php: " > $log
+
+
diff --git a/container_files/bin/configure_shibd.sh b/container_files/bin/configure_shibd.sh
new file mode 100755
index 0000000..fa698f4
--- /dev/null
+++ b/container_files/bin/configure_shibd.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+log="/tmp/shibd.log"
+
+echo "Configuring shibd: " > $log
+
+
diff --git a/container_files/bin/main.sh b/container_files/bin/main.sh
new file mode 100755
index 0000000..1f49896
--- /dev/null
+++ b/container_files/bin/main.sh
@@ -0,0 +1,20 @@
+#!/bin/bash -x
+
+log="/tmp/start-main.log"
+
+echo "Starting Container: " > $log
+date >> $log
+echo "" >> $log
+
+if [ -e "/tmp/firsttimerunning" ]; then
+
+    set -e
+    
+    /opt/bin/configure.sh >> $log
+
+    /opt/bin/cleanup.sh >> $log
+ 
+else
+    echo "COmanage container has run." >> $log
+    echo "If there are problems, docker rm this container and try again." >> $log
+fi
\ No newline at end of file
diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh
new file mode 100755
index 0000000..be61c62
--- /dev/null
+++ b/container_files/bin/start.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+log="/tmp/start-starting.log"
+date >> $log
+if [ -z ${COMPOSE+x} ]
+then
+  echo "Not composed so not waiting for MariaDB: " > $log
+  /opt/bin/main.sh
+  laststatus="$?"
+  echo "Not composed status: $laststatus"
+  if [ "$laststatus" != "0" ]; then
+      echo "Not composed non-zero exit status: $laststatus" >> $log
+      echo "Not composed non-zero exit status: $laststatus"
+      exit 1
+  else
+      echo "COmanage was configured" >>$log
+      echo "COmanage was configured"
+      echo "Starting apache" >>$log
+      echo "Starting apache"
+      /usr/local/bin/httpd-shib-foreground &
+  fi
+else
+  echo "Composed so waiting for MariaDB: " > $log
+  date >> $log
+  echo "Testing connectivity to database before continue with install" >> $log
+  echo "Testing connectivity to database before continue with install"
+  /opt/wait-for-it/wait-for-it.sh $MYSQL_HOST:3306 -t $WAIT_TIME --strict -- /opt/bin/main.sh
+  
+  date >> $log
+  echo "Starting apache" >>$log
+  echo "Starting apache"  
+  /usr/local/bin/httpd-shib-foreground &
+fi
\ No newline at end of file
diff --git a/container_files/etc/httpd/conf.d/comanage.conf b/container_files/etc/httpd/conf.d/comanage.conf
new file mode 100644
index 0000000..0b8e83a
--- /dev/null
+++ b/container_files/etc/httpd/conf.d/comanage.conf
@@ -0,0 +1,107 @@
+Listen 80 http
+Listen 443 https
+
+AddType text/html .php
+php_value session.save_handler "files"
+php_value session.save_path    "/var/lib/php/session"
+
+LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_24.so
+
+<VirtualHost _default_:80>
+ServerName http://COMANAGE_SERVER_FQDN:80
+UseCanonicalName On
+RedirectMatch (.*) https://COMANAGE_SERVER_FQDN$1
+</VirtualHost>
+
+SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
+SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
+SSLSessionCacheTimeout  300
+SSLRandomSeed startup file:/dev/urandom  256
+SSLRandomSeed connect builtin
+SSLCryptoDevice builtin
+
+<VirtualHost _default_:443>
+ServerName https://COMANAGE_SERVER_FQDN:443
+UseCanonicalName On
+Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
+
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+CustomLog logs/ssl_request_log  "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
+
+ErrorLog logs/ssl_error_log
+TransferLog logs/ssl_access_log
+LogLevel warn
+
+SSLEngine on
+SSLProtocol all -SSLv2 -SSLv3
+SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
+SSLHonorCipherOrder on 
+SSLCompression off
+SSLCertificateFile /opt/httpd/ssl/CHANGE_TO_SSL_HTTPD_CERT
+SSLCertificateKeyFile /opt/httpd/ssl/CHANGE_TO_SSL_HTTPD_KEY
+
+# Optional parameter that will only be uncommented on initialization
+# if the file exists:
+#SSLCertificateChainFile CHANGE_TO_SSL_HTTPD_CHAIN
+
+BrowserMatch "MSIE [2-5]" \
+         nokeepalive ssl-unclean-shutdown \
+         downgrade-1.0 force-response-1.0
+
+
+<Directory />
+    AllowOverride none
+    Require all denied
+</Directory>
+
+DocumentRoot "/var/www/html"
+
+<Directory "/var/www">
+    AllowOverride None
+    Require all granted
+</Directory>
+
+<Directory "/var/www/html">
+    Options Indexes FollowSymLinks
+    AllowOverride None
+    Require all granted
+</Directory>
+
+<Directory "/var/www/html/registry">
+    Options Indexes FollowSymLinks MultiViews
+    DirectoryIndex index.php
+    AllowOverride All
+    Require all granted
+</Directory>
+
+ShibCompatValidUser Off
+<Location "/Shibboleth.sso">
+  AuthType None
+  Require all granted
+</Location>
+
+<Location "/shibboleth-sp">
+  AuthType None
+  Require all granted
+</Location>
+Alias /shibboleth-sp/main.css /usr/share/shibboleth/main.css
+
+<Directory "/var/www/html/registry/auth/login">
+  AuthType shibboleth
+  ShibRequestSetting requireSession 1
+  Require shib-session
+</Directory>
+
+Redirect "/registry/users/logout" "https://COMANAGE_SERVER_FQDN/Shibboleth.sso/Logout?return=https%3A//COMANAGE_SERVER_FQDN/registry/"
+
+<FilesMatch \.php$>
+    SetHandler application/x-httpd-php
+</FilesMatch>
+
+<Files ".ht*">
+    Require all denied
+</Files>
+
+</VirtualHost>                                  
+
diff --git a/container_files/etc/php/EmailShell.php b/container_files/etc/php/EmailShell.php
new file mode 100644
index 0000000..0bb978d
--- /dev/null
+++ b/container_files/etc/php/EmailShell.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * COmanage SMTP email test shell
+ *
+ * Copyright (C) 2012 University Corporation for Advanced Internet Development, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * @copyright     Copyright (C) 2012 University Corporation for Advanced Internet Development, Inc.
+ * @link          http://www.internet2.edu/comanage COmanage Project
+ * @package       registry
+ * @since         COmanage Registry v0.7
+ * @license       Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+ * @version       $Id$
+ */
+
+App::uses('CakeEmail', 'Network/Email');
+
+class EmailShell extends AppShell {
+  function main()
+  {
+
+    $email = new CakeEmail('default');
+
+    $email->emailFormat('text')
+            ->to('skoranda@uwm.edu')
+            ->subject('test')
+            ->send('Hello');
+
+    $email->send();
+
+  }
+}
diff --git a/container_files/etc/php/database.php b/container_files/etc/php/database.php
new file mode 100644
index 0000000..114d41e
--- /dev/null
+++ b/container_files/etc/php/database.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * This is core configuration file.
+ *
+ * Use it to configure core behaviour of Cake.
+ *
+ * PHP 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link          http://cakephp.org CakePHP(tm) Project
+ * @package       app.Config
+ * @since         CakePHP(tm) v 0.2.9
+ * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+/**
+ * In this file you set up your database connection details.
+ *
+ * @package       cake.config
+ */
+/**
+ * Database configuration class.
+ * You can specify multiple configurations for production, development and testing.
+ *
+ * datasource => The name of a supported datasource; valid options are as follows:
+ *      Database/Mysql      - MySQL 4 & 5,
+ *      Database/Sqlite     - SQLite (PHP5 only),
+ *      Database/Postgres   - PostgreSQL 7 and higher,
+ *      Database/Sqlserver  - Microsoft SQL Server 2005 and higher
+ *
+ * You can add custom database datasources (or override existing datasources) by adding the
+ * appropriate file to app/Model/Datasource/Database.  Datasources should be named 'MyDatasource.php',
+ *
+ *
+ * persistent => true / false
+ * Determines whether or not the database should use a persistent connection
+ *
+ * host =>
+ * the host you connect to the database. To add a socket or port number, use 'port' => #
+ *
+ * prefix =>
+ * Uses the given prefix for all the tables in this database.  This setting can be overridden
+ * on a per-table basis with the Model::$tablePrefix property.
+ *
+ * schema =>
+ * For Postgres specifies which schema you would like to use the tables in. Postgres defaults to 'public'.
+ *
+ * encoding =>
+ * For MySQL, Postgres specifies the character encoding to use when connecting to the
+ * database. Uses database default not specified.
+ *
+ * unix_socket =>
+ * For MySQL to connect via socket specify the `unix_socket` parameter instead of `host` and `port`
+ */
+class DATABASE_CONFIG {
+
+    public $default = array(
+        'datasource' => 'Database/Mysql',
+        'persistent' => false,
+        'host' => 'CHANGE_TO_ENV_MYSQL_HOST',
+        'login' => 'CHANGE_TO_ENV_MYSQL_USERNAME',
+        'password' => 'CHANGE_TO_ENV_MYSQL_PASSWORD',
+        'database' => 'CHANGE_TO_ENV_MYSQL_TABLE',
+        'prefix' => 'cm_',
+        //'encoding' => 'utf8',
+    );
+
+    public $test = array(
+        'datasource' => 'Database/Mysql',
+        'persistent' => false,
+        'host' => 'CHANGE_TO_ENV_MYSQL_HOST',
+        'login' => 'CHANGE_TO_ENV_MYSQL_USERNAME',
+        'password' => 'CHANGE_TO_ENV_MYSQL_PASSWORD',
+        'database' => 'CHANGE_TO_ENV_MYSQL_TABLE',
+        'prefix' => 'cm_',
+        //'encoding' => 'utf8',
+    );
+}
diff --git a/container_files/etc/php/email.php b/container_files/etc/php/email.php
new file mode 100644
index 0000000..9260909
--- /dev/null
+++ b/container_files/etc/php/email.php
@@ -0,0 +1,101 @@
+<?php
+/**
+ * This is email configuration file.
+ *
+ * Use it to configure email transports of Cake.
+ *
+ * PHP 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link          http://cakephp.org CakePHP(tm) Project
+ * @package       app.Config
+ * @since         CakePHP(tm) v 2.0.0
+ * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+/**
+ * In this file you set up your send email details.
+ *
+ * @package       cake.config
+ */
+/**
+ * Email configuration class.
+ * You can specify multiple configurations for production, development and testing.
+ *
+ * transport => The name of a supported transport; valid options are as follows:
+ *      Mail        - Send using PHP mail function
+ *      Smtp        - Send using SMTP
+ *      Debug       - Do not send the email, just return the result
+ *
+ * You can add custom transports (or override existing transports) by adding the
+ * appropriate file to app/Network/Email.  Transports should be named 'YourTransport.php',
+ * where 'Your' is the name of the transport.
+ *
+ * from =>
+ * The origin email. See CakeEmail::from() about the valid values
+ *
+ */
+class EmailConfig {
+
+    public $default = array(
+        'transport' => 'Smtp',
+        'from' => 'CHANGE_TO_COMANAGE_MAIL_FROM',
+        'host' => 'CHANGE_TO_COMANAGE_MAIL_HOST',
+        'port' => CHANGE_TO_COMANAGE_MAIL_PORT,
+        'username' => 'CHANGE_TO_COMANAGE_MAIL_USER',
+        'password' => 'CHANGE_TO_COMANAGE_MAIL_PASS'
+        //'charset' => 'utf-8',
+        //'headerCharset' => 'utf-8',
+    );
+
+    public $smtp = array(
+      'transport' => 'Smtp',
+      'from' => array('site@localhost' => 'My Site'),
+      'host' => 'localhost',
+      'port' => 25,
+      'timeout' => 30,
+      'username' => 'user',
+      'password' => 'secret',
+      'client' => null,
+      'log' => false
+      //'charset' => 'utf-8',
+      //'headerCharset' => 'utf-8',
+    );
+
+    public $fast = array(
+        'from' => 'you@localhost',
+        'sender' => null,
+        'to' => null,
+        'cc' => null,
+        'bcc' => null,
+        'replyTo' => null,
+        'readReceipt' => null,
+        'returnPath' => null,
+        'messageId' => true,
+        'subject' => null,
+        'message' => null,
+        'headers' => null,
+        'viewRender' => null,
+        'template' => false,
+        'layout' => false,
+        'viewVars' => null,
+        'attachments' => null,
+        'emailFormat' => null,
+        'transport' => 'Smtp',
+        'host' => 'localhost',
+        'port' => 25,
+        'timeout' => 30,
+        'username' => 'user',
+        'password' => 'secret',
+        'client' => null,
+        'log' => true,
+        //'charset' => 'utf-8',
+        //'headerCharset' => 'utf-8',
+    );
+
+}
diff --git a/container_files/etc/shibboleth/attribute-map.xml b/container_files/etc/shibboleth/attribute-map.xml
new file mode 100644
index 0000000..12c4019
--- /dev/null
+++ b/container_files/etc/shibboleth/attribute-map.xml
@@ -0,0 +1,32 @@
+<Attributes xmlns="urn:mace:shibboleth:2.0:attribute-map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.6" id="eppn">
+        <AttributeDecoder xsi:type="ScopedAttributeDecoder"/>
+    </Attribute>
+    
+    <Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.9" id="affiliation">
+        <AttributeDecoder xsi:type="ScopedAttributeDecoder" caseSensitive="false"/>
+    </Attribute>
+    
+    <Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1" id="unscoped-affiliation">
+        <AttributeDecoder xsi:type="StringAttributeDecoder" caseSensitive="false"/>
+    </Attribute>
+    
+    <Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.7" id="entitlement"/>
+
+    <Attribute name="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" id="persistent-id">
+        <AttributeDecoder xsi:type="NameIDAttributeDecoder" formatter="$NameQualifier!$SPNameQualifier!$Name" defaultQualifiers="true"/>
+    </Attribute>
+    
+    <Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.5" id="primary-affiliation">
+        <AttributeDecoder xsi:type="StringAttributeDecoder" caseSensitive="false"/>
+    </Attribute>
+    
+    <Attribute name="urn:oid:2.5.4.4" id="sn"/>
+    <Attribute name="urn:oid:2.5.4.42" id="givenName"/>
+    <Attribute name="urn:oid:2.16.840.1.113730.3.1.241" id="displayName"/>
+    <Attribute name="urn:oid:0.9.2342.19200300.100.1.1" id="uid"/>
+    <Attribute name="urn:oid:0.9.2342.19200300.100.1.3" id="mail"/>
+    <Attribute name="urn:oid:2.16.840.1.113730.3.1.3" id="employeeNumber"/>
+
+</Attributes>
diff --git a/container_files/etc/shibboleth/inc-md-cert.pem b/container_files/etc/shibboleth/inc-md-cert.pem
new file mode 100644
index 0000000..5ec4ec6
--- /dev/null
+++ b/container_files/etc/shibboleth/inc-md-cert.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDgTCCAmmgAwIBAgIJAJRJzvdpkmNaMA0GCSqGSIb3DQEBCwUAMFcxCzAJBgNV
+BAYTAlVTMRUwEwYDVQQKDAxJbkNvbW1vbiBMTEMxMTAvBgNVBAMMKEluQ29tbW9u
+IEZlZGVyYXRpb24gTWV0YWRhdGEgU2lnbmluZyBLZXkwHhcNMTMxMjE2MTkzNDU1
+WhcNMzcxMjE4MTkzNDU1WjBXMQswCQYDVQQGEwJVUzEVMBMGA1UECgwMSW5Db21t
+b24gTExDMTEwLwYDVQQDDChJbkNvbW1vbiBGZWRlcmF0aW9uIE1ldGFkYXRhIFNp
+Z25pbmcgS2V5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Chdkrn+
+dG5Zj5L3UIw+xeWgNzm8ajw7/FyqRQ1SjD4Lfg2WCdlfjOrYGNnVZMCTfItoXTSp
+g4rXxHQsykeNiYRu2+02uMS+1pnBqWjzdPJE0od+q8EbdvE6ShimjyNn0yQfGyQK
+CNdYuc+75MIHsaIOAEtDZUST9Sd4oeU1zRjV2sGvUd+JFHveUAhRc0b+JEZfIEuq
+/LIU9qxm/+gFaawlmojZPyOWZ1JlswbrrJYYyn10qgnJvjh9gZWXKjmPxqvHKJcA
+TPhAh2gWGabWTXBJCckMe1hrHCl/vbDLCmz0/oYuoaSDzP6zE9YSA/xCplaHA0mo
+C1Vs2H5MOQGlewIDAQABo1AwTjAdBgNVHQ4EFgQU5ij9YLU5zQ6K75kPgVpyQ2N/
+lPswHwYDVR0jBBgwFoAU5ij9YLU5zQ6K75kPgVpyQ2N/lPswDAYDVR0TBAUwAwEB
+/zANBgkqhkiG9w0BAQsFAAOCAQEAaQkEx9xvaLUt0PNLvHMtxXQPedCPw5xQBd2V
+WOsWPYspRAOSNbU1VloY+xUkUKorYTogKUY1q+uh2gDIEazW0uZZaQvWPp8xdxWq
+Dh96n5US06lszEc+Lj3dqdxWkXRRqEbjhBFh/utXaeyeSOtaX65GwD5svDHnJBcl
+AGkzeRIXqxmYG+I2zMm/JYGzEnbwToyC7yF6Q8cQxOr37hEpqz+WN/x3qM2qyBLE
+CQFjmlJrvRLkSL15PCZiu+xFNFd/zx6btDun5DBlfDS9DG+SHCNH6Nq+NfP+ZQ8C
+GzP/3TaZPzMlKPDCjp0XOQfyQqFIXdwjPFTWjEusDBlm4qJAlQ==
+-----END CERTIFICATE-----
diff --git a/container_files/etc/shibboleth/shibboleth2.xml b/container_files/etc/shibboleth/shibboleth2.xml
new file mode 100644
index 0000000..ab4445c
--- /dev/null
+++ b/container_files/etc/shibboleth/shibboleth2.xml
@@ -0,0 +1,56 @@
+<SPConfig xmlns="urn:mace:shibboleth:2.0:native:sp:config"
+    xmlns:conf="urn:mace:shibboleth:2.0:native:sp:config"
+    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
+    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"    
+    xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
+    clockSkew="180">
+
+    <ApplicationDefaults entityID="https://CHANGE_TO_COMANAGE_SERVER_FQDN/shibboleth"
+                         REMOTE_USER="eppn persistent-id targeted-id">
+
+        <Sessions lifetime="28800" timeout="3600" relayState="ss:mem"
+                  checkAddress="false" handlerSSL="true" cookieProps="https">
+
+            <SSO discoveryProtocol="SAMLDS" discoveryURL="https://CHANGE_TO_COMANAGE_SERVER_FQDN/registry/pages/eds/index">
+              SAML2
+            </SSO>
+
+            <Logout>SAML2 Local</Logout>
+            
+            <Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
+            <Handler type="Status" Location="/Status" acl="127.0.0.1 ::1"/>
+
+            <Handler type="Session" Location="/Session" showAttributeValues="false"/>
+
+            <Handler type="DiscoveryFeed" Location="/DiscoFeed"/>
+        </Sessions>
+
+        <Errors supportContact="root@localhost"
+            helpLocation="/about.html"
+            styleSheet="/shibboleth-sp/main.css"/>
+
+        <MetadataProvider type="XML" url="http://md.incommon.org/InCommon/InCommon-metadata.xml" backingFilePath="InCommon-metadata.xml" maxRefreshDelay="28800" legacyOrgNames="true">
+          <MetadataFilter type="Signature" certificate="/etc/shibboleth/inc-md-cert.pem"/>
+          <MetadataFilter type="RequireValidUntil" maxValidityInterval="2419200" />
+          <MetadataFilter type="Blacklist" matcher="EntityAttributes">
+            <saml:Attribute Name="http://macedir.org/entity-category" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
+              <saml:AttributeValue>http://refeds.org/category/hide-from-discovery</saml:AttributeValue>
+            </saml:Attribute>
+          </MetadataFilter>
+        </MetadataProvider>
+
+        <AttributeExtractor type="XML" validate="true" reloadChanges="false" path="attribute-map.xml"/>
+        
+        <AttributeResolver type="Query" subjectMatch="true"/>
+
+        <AttributeFilter type="XML" validate="true" path="attribute-policy.xml"/>
+
+        <CredentialResolver type="File" key="/opt/shibboleth/ssl/sp-key.pem" certificate="/opt/shibboleth/ssl/sp-cert.pem"/>
+
+    </ApplicationDefaults>
+    
+    <SecurityPolicyProvider type="XML" validate="true" path="security-policy.xml"/>
+
+    <ProtocolProvider type="XML" validate="true" reloadChanges="false" path="protocols.xml"/>
+
+</SPConfig>
diff --git a/container_files/etc/shibboleth/shibboleth_keygen.sh b/container_files/etc/shibboleth/shibboleth_keygen.sh
new file mode 100755
index 0000000..205792e
--- /dev/null
+++ b/container_files/etc/shibboleth/shibboleth_keygen.sh
@@ -0,0 +1,75 @@
+#! /bin/sh
+
+while getopts h:u:g:o:e:y:bf c
+     do
+         case $c in
+           o)         OUT=$OPTARG;;
+           b)         BATCH=1;;
+           f)         FORCE=1;;
+           h)         FQDN=$OPTARG;;
+           e)         ENTITYID=$OPTARG;;
+           y)         YEARS=$OPTARG;;
+           \?)        echo "shibboleth_keygen [-o output directory (default .)] [-h hostname for cert] [-y years to issue cert] [-e entityID to embed in cert]"
+                      exit 1;;
+         esac
+     done
+if [ -z "$OUT" ] ; then
+    OUT=.
+fi
+
+if [ -n "$FORCE" ] ; then
+    rm $OUT/sp-key.pem $OUT/sp-cert.pem
+fi
+
+if  [ -s $OUT/sp-key.pem -o -s $OUT/sp-cert.pem ] ; then
+    if [ -z "$BATCH" ] ; then  
+        echo The files $OUT/sp-key.pem and/or $OUT/sp-cert.pem already exist!
+        echo Use -f option to force recreation of keypair.
+        exit 2
+    fi
+    exit 0
+fi
+
+if [ -z "$FQDN" ] ; then
+    FQDN=`hostname --fqdn`
+fi
+
+if [ -z "$YEARS" ] ; then
+    YEARS=10
+fi
+
+DAYS=`expr $YEARS \* 365`
+
+if [ -z "$ENTITYID" ] ; then
+    ALTNAME=DNS:$FQDN
+else
+    ALTNAME=DNS:$FQDN,URI:$ENTITYID
+fi
+
+SSLCNF=$OUT/sp-cert.cnf
+cat >$SSLCNF <<EOF
+# OpenSSL configuration file for creating sp-cert.pem
+[req]
+prompt=no
+default_bits=2048
+encrypt_key=no
+default_md=sha1
+distinguished_name=dn
+# PrintableStrings only
+string_mask=MASK:0002
+x509_extensions=ext
+[dn]
+CN=$FQDN
+[ext]
+subjectAltName=$ALTNAME
+subjectKeyIdentifier=hash
+EOF
+
+touch $OUT/sp-key.pem
+chmod 600 $OUT/sp-key.pem
+if [ -z "$BATCH" ] ; then
+    openssl req -config $SSLCNF -new -x509 -days $DAYS -keyout $OUT/sp-key.pem -out $OUT/sp-cert.pem
+else
+    openssl req -config $SSLCNF -new -x509 -days $DAYS -keyout $OUT/sp-key.pem -out $OUT/sp-cert.pem 2> /dev/null
+fi
+rm $SSLCNF
\ No newline at end of file
diff --git a/container_files/wait-for-it/LICENSE b/container_files/wait-for-it/LICENSE
new file mode 100644
index 0000000..bd18d0c
--- /dev/null
+++ b/container_files/wait-for-it/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+Copyright (c) 2016 Giles Hall
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/container_files/wait-for-it/README.md b/container_files/wait-for-it/README.md
new file mode 100644
index 0000000..3a65c3d
--- /dev/null
+++ b/container_files/wait-for-it/README.md
@@ -0,0 +1,59 @@
+`wait-for-it.sh` is a pure bash script that will wait on the availability of a host and TCP port.  It is useful for synchronizing the spin-up of interdependent services, such as linked docker containers.  Since it is a pure bash script, it does not have any external dependencies.
+
+## Usage
+
+```
+wait-for-it.sh host:port [-s] [-t timeout] [-- command args]
+-h HOST | --host=HOST       Host or IP under test
+-p PORT | --port=PORT       TCP port under test
+                            Alternatively, you specify the host and port as host:port
+-s | --strict               Only execute subcommand if the test succeeds
+-q | --quiet                Don't output any status messages
+-t TIMEOUT | --timeout=TIMEOUT
+                            Timeout in seconds, zero for no timeout
+-- COMMAND ARGS             Execute command with args after the test finishes
+```
+
+## Examples
+
+For example, let's test to see if we can access port 80 on www.google.com, and if it is available, echo the message `google is up`.
+
+```
+$ ./wait-for-it.sh www.google.com:80 -- echo "google is up"
+wait-for-it.sh: waiting 15 seconds for www.google.com:80
+wait-for-it.sh: www.google.com:80 is available after 0 seconds
+google is up
+```
+
+You can set your own timeout with the `-t` or `--timeout=` option.  Setting the timeout value to 0 will disable the timeout:
+
+```
+$ ./wait-for-it.sh -t 0 www.google.com:80 -- echo "google is up"
+wait-for-it.sh: waiting for www.google.com:80 without a timeout
+wait-for-it.sh: www.google.com:80 is available after 0 seconds
+google is up
+```
+
+The subcommand will be executed regardless if the service is up or not.  If you wish to execute the subcommand only if the service is up, add the `--strict` argument. In this example, we will test port 81 on www.google.com which will fail:
+
+```
+$ ./wait-for-it.sh www.google.com:81 --timeout=1 --strict -- echo "google is up"
+wait-for-it.sh: waiting 1 seconds for www.google.com:81
+wait-for-it.sh: timeout occurred after waiting 1 seconds for www.google.com:81
+wait-for-it.sh: strict mode, refusing to execute subprocess
+```
+
+If you don't want to execute a subcommand, leave off the `--` argument.  This way, you can test the exit condition of `wait-for-it.sh` in your own scripts, and determine how to proceed:
+
+```
+$ ./wait-for-it.sh www.google.com:80
+wait-for-it.sh: waiting 15 seconds for www.google.com:80
+wait-for-it.sh: www.google.com:80 is available after 0 seconds
+$ echo $?
+0
+$ ./wait-for-it.sh www.google.com:81
+wait-for-it.sh: waiting 15 seconds for www.google.com:81
+wait-for-it.sh: timeout occurred after waiting 15 seconds for www.google.com:81
+$ echo $?
+124
+```
diff --git a/container_files/wait-for-it/wait-for-it.sh b/container_files/wait-for-it/wait-for-it.sh
new file mode 100755
index 0000000..eca6c3b
--- /dev/null
+++ b/container_files/wait-for-it/wait-for-it.sh
@@ -0,0 +1,161 @@
+#!/usr/bin/env bash
+#   Use this script to test if a given TCP host/port are available
+
+cmdname=$(basename $0)
+
+echoerr() { if [[ $QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
+
+usage()
+{
+    cat << USAGE >&2
+Usage:
+    $cmdname host:port [-s] [-t timeout] [-- command args]
+    -h HOST | --host=HOST       Host or IP under test
+    -p PORT | --port=PORT       TCP port under test
+                                Alternatively, you specify the host and port as host:port
+    -s | --strict               Only execute subcommand if the test succeeds
+    -q | --quiet                Don't output any status messages
+    -t TIMEOUT | --timeout=TIMEOUT
+                                Timeout in seconds, zero for no timeout
+    -- COMMAND ARGS             Execute command with args after the test finishes
+USAGE
+    exit 1
+}
+
+wait_for()
+{
+    if [[ $TIMEOUT -gt 0 ]]; then
+        echoerr "$cmdname: waiting $TIMEOUT seconds for $HOST:$PORT"
+    else
+        echoerr "$cmdname: waiting for $HOST:$PORT without a timeout"
+    fi
+    start_ts=$(date +%s)
+    while :
+    do
+        (echo > /dev/tcp/$HOST/$PORT) >/dev/null 2>&1
+        result=$?
+        if [[ $result -eq 0 ]]; then
+            end_ts=$(date +%s)
+            echoerr "$cmdname: $HOST:$PORT is available after $((end_ts - start_ts)) seconds"
+            break
+        fi
+        sleep 1
+    done
+    return $result
+}
+
+wait_for_wrapper()
+{
+    # In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
+    if [[ $QUIET -eq 1 ]]; then
+        timeout $TIMEOUT $0 --quiet --child --host=$HOST --port=$PORT --timeout=$TIMEOUT &
+    else
+        timeout $TIMEOUT $0 --child --host=$HOST --port=$PORT --timeout=$TIMEOUT &
+    fi
+    PID=$!
+    trap "kill -INT -$PID" INT
+    wait $PID
+    RESULT=$?
+    if [[ $RESULT -ne 0 ]]; then
+        echoerr "$cmdname: timeout occurred after waiting $TIMEOUT seconds for $HOST:$PORT"
+    fi
+    return $RESULT
+}
+
+# process arguments
+while [[ $# -gt 0 ]]
+do
+    case "$1" in
+        *:* )
+        hostport=(${1//:/ })
+        HOST=${hostport[0]}
+        PORT=${hostport[1]}
+        shift 1
+        ;;
+        --child)
+        CHILD=1
+        shift 1
+        ;;
+        -q | --quiet)
+        QUIET=1
+        shift 1
+        ;;
+        -s | --strict)
+        STRICT=1
+        shift 1
+        ;;
+        -h)
+        HOST="$2"
+        if [[ $HOST == "" ]]; then break; fi
+        shift 2
+        ;;
+        --host=*)
+        HOST="${1#*=}"
+        shift 1
+        ;;
+        -p)
+        PORT="$2"
+        if [[ $PORT == "" ]]; then break; fi
+        shift 2
+        ;;
+        --port=*)
+        PORT="${1#*=}"
+        shift 1
+        ;;
+        -t)
+        TIMEOUT="$2"
+        if [[ $TIMEOUT == "" ]]; then break; fi
+        shift 2
+        ;;
+        --timeout=*)
+        TIMEOUT="${1#*=}"
+        shift 1
+        ;;
+        --)
+        shift
+        CLI="$@"
+        break
+        ;;
+        --help)
+        usage
+        ;;
+        *)
+        echoerr "Unknown argument: $1"
+        usage
+        ;;
+    esac
+done
+
+if [[ "$HOST" == "" || "$PORT" == "" ]]; then
+    echoerr "Error: you need to provide a host and port to test."
+    usage
+fi
+
+TIMEOUT=${TIMEOUT:-15}
+STRICT=${STRICT:-0}
+CHILD=${CHILD:-0}
+QUIET=${QUIET:-0}
+
+if [[ $CHILD -gt 0 ]]; then
+    wait_for
+    RESULT=$?
+    exit $RESULT
+else
+    if [[ $TIMEOUT -gt 0 ]]; then
+        wait_for_wrapper
+        RESULT=$?
+    else
+        wait_for
+        RESULT=$?
+    fi
+fi
+
+if [[ $CLI != "" ]]; then
+    if [[ $RESULT -ne 0 && $STRICT -eq 1 ]]; then
+        echoerr "$cmdname: strict mode, refusing to execute subprocess"
+        exit $RESULT
+    fi
+    exec $CLI
+else
+    exit $RESULT
+fi

From 991cc4167587991aa87c0bdd10fe8d58487369d3 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Fri, 9 Sep 2016 11:59:28 -0400
Subject: [PATCH 004/105] Container builds

---
 Dockerfile  | 21 +++++++++++----------
 Jenkinsfile |  2 +-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 1741ef3..41681b7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -44,18 +44,20 @@ RUN sed -i \
 
 RUN echo '<?php phpinfo(); ?>' > /var/www/html/index.php
 
-ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$version.tar.gz
+ENV VERSION=$version
+ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$VERSION.tar.gz
+ENV COMANAGE_PREFIX=comanage-registry
 
 RUN mkdir -p /tmp/comanage && cd /tmp/comanage && \
-      wget -q $COMANAGE_URL \
+      wget -q $COMANAGE_URL && \
 # Perform verifications [TODO]
 # Prepare filesystem
-           tar xf $version.tar.gz && \
-           mkdir -p /opt/comanage && \
-           mv $version /opt/comanage/. && \
-           ln -s /opt/comanage/$version /opt/comanage/current && \
-# Cleanup
-           rm -rf /tmp/comanage
+      mkdir -p /opt/comanage && \
+      tar xf $VERSION.tar.gz && \
+      mv $COMANAGE_PREFIX-$VERSION /opt/comanage/. && \
+      ln -s /opt/comanage/$VERSION /opt/comanage/current && \
+# # Cleanup
+            rm -rf /tmp/comanage
 
 ENV COMANAGE_HOME /opt/comanage/current
 
@@ -67,8 +69,7 @@ ADD ./container_files /opt
 # Add Volumes and Set permissions
 RUN mkdir /opt/shared \
     && chmod 777 /opt/shared \
-    && chmod 777 /root/*.sh \
-    && chmod 777 /root/shibboleth/*.sh
+    && chmod 777 /opt/bin/*.sh
 
 # Environment variables
 ENV ADMIN_NAME "Scott"
diff --git a/Jenkinsfile b/Jenkinsfile
index c4b3931..c4145f6 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -37,7 +37,7 @@ node {
      
   stage 'Build'
     try{
-      sh 'bin/build.sh &> debug'
+      sh 'bin/rebuild.sh &> debug'
     } catch(error) {
       def error_details = readFile('./debug');
       def message = "BUILD ERROR: There was a problem building ${imagename}:${tag}. \n\n ${error_details}"

From 68ceb5d032c46e4542abd89bad8e5dcce82648f8 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Fri, 9 Sep 2016 12:04:43 -0400
Subject: [PATCH 005/105] Test passing

---
 tests/image.bats | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 tests/image.bats

diff --git a/tests/image.bats b/tests/image.bats
new file mode 100644
index 0000000..e14978f
--- /dev/null
+++ b/tests/image.bats
@@ -0,0 +1,7 @@
+#!/usr/bin/env bats
+
+load ../common
+
+@test "COmanage directory created" {
+  docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-$version
+}
\ No newline at end of file

From 47126b7085e3270345aac996c8ab86b1a675aa78 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Fri, 9 Sep 2016 13:29:38 -0400
Subject: [PATCH 006/105] Better node selection

---
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index c4145f6..9f6a1c0 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,4 +1,4 @@
-node {
+node('docker') {
 
   stage 'Checkout'
 

From 8bdd645cb58c93171076780daac46986b23f4d0a Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Fri, 9 Sep 2016 18:27:18 -0300
Subject: [PATCH 007/105] Added some fix to resolv starting issues in docker
 comanage

---
 .../bin/{configure_http.sh => configure_httpd.sh}           | 0
 container_files/bin/start.sh                                | 6 +++---
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename container_files/bin/{configure_http.sh => configure_httpd.sh} (100%)

diff --git a/container_files/bin/configure_http.sh b/container_files/bin/configure_httpd.sh
similarity index 100%
rename from container_files/bin/configure_http.sh
rename to container_files/bin/configure_httpd.sh
diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh
index be61c62..29c15e6 100755
--- a/container_files/bin/start.sh
+++ b/container_files/bin/start.sh
@@ -17,7 +17,7 @@ then
       echo "COmanage was configured"
       echo "Starting apache" >>$log
       echo "Starting apache"
-      /usr/local/bin/httpd-shib-foreground &
+      /usr/local/bin/httpd-shib-foreground 
   fi
 else
   echo "Composed so waiting for MariaDB: " > $log
@@ -29,5 +29,5 @@ else
   date >> $log
   echo "Starting apache" >>$log
   echo "Starting apache"  
-  /usr/local/bin/httpd-shib-foreground &
-fi
\ No newline at end of file
+  /usr/local/bin/httpd-shib-foreground 
+fi

From 69bad1ddb913e6c05a76f17caf799f8b47a85b4a Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Mon, 12 Sep 2016 14:41:54 -0300
Subject: [PATCH 008/105] Added test to database before start http

---
 BINSCRIPTS.md                |  4 ++--
 bin/build.sh                 |  6 ++++++
 bin/destroy.sh               | 10 ++++++++++
 bin/install.sh               | 13 +++++++++++++
 bin/rebuild.sh               |  3 +++
 bin/rerun.sh                 |  3 +++
 bin/run.sh                   |  5 +++++
 bin/start.sh                 |  8 ++++++++
 bin/stop.sh                  |  7 +++++++
 bin/test.sh                  |  3 +++
 container_files/bin/start.sh | 28 ++++++++++++++++++++++------
 11 files changed, 82 insertions(+), 8 deletions(-)
 create mode 100755 bin/build.sh
 create mode 100755 bin/destroy.sh
 create mode 100755 bin/install.sh
 create mode 100755 bin/rebuild.sh
 create mode 100755 bin/rerun.sh
 create mode 100755 bin/run.sh
 create mode 100755 bin/start.sh
 create mode 100755 bin/stop.sh
 create mode 100755 bin/test.sh

diff --git a/BINSCRIPTS.md b/BINSCRIPTS.md
index 8569b7d..7818108 100644
--- a/BINSCRIPTS.md
+++ b/BINSCRIPTS.md
@@ -9,7 +9,7 @@ If you are reading this file in BINSCRIPTS.md, your container project is likely
 To use these scripts yourself, issue this command:
 
 ```
-curl "https://github.internet2.edu/raw/docker/util/master/bin/install.sh?token=AAAAEddkrL9MeeA6VWcNn_PgV30r4lD1ks5XogeiwA%3D%3D" | bash
+curl "https://github.internet2.edu/raw/docker/util/master/bin/install.sh?token=AAAAE4VRBLPB8VExPHSR5nCe791IAYqaks5Xzug5wA%3D%3D" | bash
 ```
 
 ### common.bash
@@ -38,4 +38,4 @@ This will also install a Jenkinsfile to your repository, if it doesn't have one.
 
 
 ### Testing
-#### test.sh
\ No newline at end of file
+#### test.sh
diff --git a/bin/build.sh b/bin/build.sh
new file mode 100755
index 0000000..190c975
--- /dev/null
+++ b/bin/build.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+source common.bash .
+
+echo "Building new Docker image($maintainer/$imagename)"
+docker build --rm -t $maintainer/$imagename --build-arg maintainer=$maintainer --build-arg imagename=$imagename --build-arg version=$version .
\ No newline at end of file
diff --git a/bin/destroy.sh b/bin/destroy.sh
new file mode 100755
index 0000000..929c13e
--- /dev/null
+++ b/bin/destroy.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+source common.bash .
+
+result=$(docker ps -a | grep $maintainer/$imagename)
+
+if [ ! -z "$result" ]; then
+  docker rm -f $(docker ps -a | grep $maintainer/$imagename | awk '{print $1}')
+  docker rmi -f $maintainer/$imagename
+fi
diff --git a/bin/install.sh b/bin/install.sh
new file mode 100755
index 0000000..2db62de
--- /dev/null
+++ b/bin/install.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+git clone git@github.internet2.edu:docker/util.git
+find util/bin -name "*.sh" -exec sh -c 'echo "$1" | sed "s/util\///" >> .gitignore' -- {} \;
+mkdir -p bin
+mv util/bin/* bin/.
+mv util/README.md BINSCRIPTS.md
+if [ ! -f common.bash ]; then
+  mv util/common.bash.sample common.bash
+fi
+if [ ! -f Jenkinsfile ]; then
+  mv util/Jenkinsfile.sample Jenkinsfile
+fi
+rm -rf util
\ No newline at end of file
diff --git a/bin/rebuild.sh b/bin/rebuild.sh
new file mode 100755
index 0000000..3904e58
--- /dev/null
+++ b/bin/rebuild.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+source bin/destroy.sh && source bin/build.sh
\ No newline at end of file
diff --git a/bin/rerun.sh b/bin/rerun.sh
new file mode 100755
index 0000000..e279386
--- /dev/null
+++ b/bin/rerun.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+source bin/rebuild.sh && source bin/run.sh $1
\ No newline at end of file
diff --git a/bin/run.sh b/bin/run.sh
new file mode 100755
index 0000000..8af1b06
--- /dev/null
+++ b/bin/run.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source common.bash .
+
+docker run -it $maintainer/$imagename $1
\ No newline at end of file
diff --git a/bin/start.sh b/bin/start.sh
new file mode 100755
index 0000000..9b74d72
--- /dev/null
+++ b/bin/start.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+source common.bash .
+
+echo "Building new Docker image($registry/$maintainer/$imagename)"
+docker run --name=$imagename -d $maintainer/$imagename
+
+exit 0
\ No newline at end of file
diff --git a/bin/stop.sh b/bin/stop.sh
new file mode 100755
index 0000000..01a2252
--- /dev/null
+++ b/bin/stop.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+source common.bash .
+
+echo "Cleaning up Docker image($maintainer/$imagename)"
+docker stop $imagename >> /dev/null
+exit 0
diff --git a/bin/test.sh b/bin/test.sh
new file mode 100755
index 0000000..6d4b8be
--- /dev/null
+++ b/bin/test.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+bats tests
\ No newline at end of file
diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh
index 29c15e6..c778966 100755
--- a/container_files/bin/start.sh
+++ b/container_files/bin/start.sh
@@ -15,8 +15,8 @@ then
   else
       echo "COmanage was configured" >>$log
       echo "COmanage was configured"
-      echo "Starting apache" >>$log
-      echo "Starting apache"
+      echo "Starting apache and shibd" >>$log
+      echo "Starting apache shibd"
       /usr/local/bin/httpd-shib-foreground 
   fi
 else
@@ -24,10 +24,26 @@ else
   date >> $log
   echo "Testing connectivity to database before continue with install" >> $log
   echo "Testing connectivity to database before continue with install"
-  /opt/wait-for-it/wait-for-it.sh $MYSQL_HOST:3306 -t $WAIT_TIME --strict -- /opt/bin/main.sh
-  
+  /opt/wait-for-it/wait-for-it.sh $MYSQL_HOST:3306 -t $WAIT_TIME --strict -- /opt/bin/main.sh >> $log
+  echo "Mariadb default port is open and test connection ok"
+  echo "Mariadb default port is open and test connection ok" >> $log
+  echo "Testing connectivy to database before continue with install" >> $log
+  echo "Testing connectivy to database before continue with install"
+  mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" -e "use $MYSQL_DATABASE; show tables;"
+  laststatus="$?"
+  echo "checking connectivity" >> $log
+    while [ "$laststatus" != "0" ]; do
+      mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" -e "use $MYSQL_DATABASE; show tables;"
+      laststatus="$?"
+      sleep 5
+      date >> $log
+      echo "Trying to connect to mariadb container with $MYSQL_USER to database $MYSQL_DATABASE"
+      echo "Trying to connect to mariadb container with $MYSQL_USER to database $MYSQL_DATABASE" >> $log
+    done
+  echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" >> $log
+  echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" 
   date >> $log
-  echo "Starting apache" >>$log
-  echo "Starting apache"  
+  echo "Starting apache and shibd" >>$log
+  echo "Starting apache shibd"  
   /usr/local/bin/httpd-shib-foreground 
 fi

From 14bd1b0a1d4d050b73ba7141d4f5b3792015ec80 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Mon, 12 Sep 2016 14:43:04 -0300
Subject: [PATCH 009/105] removed util

---
 bin/build.sh   |  6 ------
 bin/destroy.sh | 10 ----------
 bin/install.sh | 13 -------------
 bin/rebuild.sh |  3 ---
 bin/rerun.sh   |  3 ---
 bin/run.sh     |  5 -----
 bin/start.sh   |  8 --------
 bin/stop.sh    |  7 -------
 bin/test.sh    |  3 ---
 9 files changed, 58 deletions(-)
 delete mode 100755 bin/build.sh
 delete mode 100755 bin/destroy.sh
 delete mode 100755 bin/install.sh
 delete mode 100755 bin/rebuild.sh
 delete mode 100755 bin/rerun.sh
 delete mode 100755 bin/run.sh
 delete mode 100755 bin/start.sh
 delete mode 100755 bin/stop.sh
 delete mode 100755 bin/test.sh

diff --git a/bin/build.sh b/bin/build.sh
deleted file mode 100755
index 190c975..0000000
--- a/bin/build.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-source common.bash .
-
-echo "Building new Docker image($maintainer/$imagename)"
-docker build --rm -t $maintainer/$imagename --build-arg maintainer=$maintainer --build-arg imagename=$imagename --build-arg version=$version .
\ No newline at end of file
diff --git a/bin/destroy.sh b/bin/destroy.sh
deleted file mode 100755
index 929c13e..0000000
--- a/bin/destroy.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-source common.bash .
-
-result=$(docker ps -a | grep $maintainer/$imagename)
-
-if [ ! -z "$result" ]; then
-  docker rm -f $(docker ps -a | grep $maintainer/$imagename | awk '{print $1}')
-  docker rmi -f $maintainer/$imagename
-fi
diff --git a/bin/install.sh b/bin/install.sh
deleted file mode 100755
index 2db62de..0000000
--- a/bin/install.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-git clone git@github.internet2.edu:docker/util.git
-find util/bin -name "*.sh" -exec sh -c 'echo "$1" | sed "s/util\///" >> .gitignore' -- {} \;
-mkdir -p bin
-mv util/bin/* bin/.
-mv util/README.md BINSCRIPTS.md
-if [ ! -f common.bash ]; then
-  mv util/common.bash.sample common.bash
-fi
-if [ ! -f Jenkinsfile ]; then
-  mv util/Jenkinsfile.sample Jenkinsfile
-fi
-rm -rf util
\ No newline at end of file
diff --git a/bin/rebuild.sh b/bin/rebuild.sh
deleted file mode 100755
index 3904e58..0000000
--- a/bin/rebuild.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source bin/destroy.sh && source bin/build.sh
\ No newline at end of file
diff --git a/bin/rerun.sh b/bin/rerun.sh
deleted file mode 100755
index e279386..0000000
--- a/bin/rerun.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source bin/rebuild.sh && source bin/run.sh $1
\ No newline at end of file
diff --git a/bin/run.sh b/bin/run.sh
deleted file mode 100755
index 8af1b06..0000000
--- a/bin/run.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-source common.bash .
-
-docker run -it $maintainer/$imagename $1
\ No newline at end of file
diff --git a/bin/start.sh b/bin/start.sh
deleted file mode 100755
index 9b74d72..0000000
--- a/bin/start.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-source common.bash .
-
-echo "Building new Docker image($registry/$maintainer/$imagename)"
-docker run --name=$imagename -d $maintainer/$imagename
-
-exit 0
\ No newline at end of file
diff --git a/bin/stop.sh b/bin/stop.sh
deleted file mode 100755
index 01a2252..0000000
--- a/bin/stop.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-source common.bash .
-
-echo "Cleaning up Docker image($maintainer/$imagename)"
-docker stop $imagename >> /dev/null
-exit 0
diff --git a/bin/test.sh b/bin/test.sh
deleted file mode 100755
index 6d4b8be..0000000
--- a/bin/test.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-bats tests
\ No newline at end of file

From efaa5361e9003e859ac5e74a745d04ae9192764c Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Mon, 12 Sep 2016 16:02:12 -0300
Subject: [PATCH 010/105] Added httpd structure

---
 Dockerfile                                    | 14 ++++++++++-
 container_files/bin/configure_httpd.sh        | 15 ++++++++++-
 .../etc/httpd/conf.d/handlers.conf            |  3 +++
 container_files/etc/httpd/conf.d/ports.conf   |  2 ++
 container_files/etc/httpd/conf.d/ssl.conf     |  6 +++++
 .../{comanage.conf => virtual_host_443.conf}  | 25 +------------------
 .../etc/httpd/conf.d/virtual_host_80.conf     |  5 ++++
 .../etc/httpd/conf.modules.d/00-shib.conf     |  1 +
 8 files changed, 45 insertions(+), 26 deletions(-)
 create mode 100644 container_files/etc/httpd/conf.d/handlers.conf
 create mode 100644 container_files/etc/httpd/conf.d/ports.conf
 create mode 100644 container_files/etc/httpd/conf.d/ssl.conf
 rename container_files/etc/httpd/conf.d/{comanage.conf => virtual_host_443.conf} (76%)
 create mode 100644 container_files/etc/httpd/conf.d/virtual_host_80.conf
 create mode 100644 container_files/etc/httpd/conf.modules.d/00-shib.conf

diff --git a/Dockerfile b/Dockerfile
index 41681b7..99d3044 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -94,8 +94,20 @@ VOLUME /opt/shibboleth/ssl/
 
 # Required volumes for mounting Apache SSL files into container
 VOLUME /opt/httpd/ssl/
+#Added ssl default conf
+RUN ln -s /opt/etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf
+
+#Added shib module apache
+RUN ln -s /opt/etc/httpd/conf.modules.d/00-shib.conf /etc/httpd/conf.modules.d/00-shib.conf
+RUN ln -s /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so
+
+#Add httpd configuration
+RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf
+RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf
+RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf
+RUN ln -s /opt/etc/httpd/conf.d/virtual_host_443.conf /etc/httpd/conf.d/00-comanage-443.conf
 
 # Port
 EXPOSE 80 443
 
-CMD ["/opt/bin/start.sh"]
\ No newline at end of file
+CMD ["/opt/bin/start.sh"]
diff --git a/container_files/bin/configure_httpd.sh b/container_files/bin/configure_httpd.sh
index d94aafe..4dd980f 100755
--- a/container_files/bin/configure_httpd.sh
+++ b/container_files/bin/configure_httpd.sh
@@ -1,5 +1,18 @@
 #!/bin/bash
 
 log="/tmp/httpd.log"
+date >> $log
+echo "Configuring httpd: " > $log
 
-echo "Configuring httpd: " > $log
\ No newline at end of file
+echo "Removing Listen 80 in httpd.conf" > $log
+sed -i 's/^Listen 80$//' /etc/httpd/conf/httpd.conf
+
+for i in /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/ports.conf /etc/httpd/conf.modules.d/00-shib.conf /etc/httpd/conf.d/00-comanage_80.conf /etc/httpd/conf.d/00-comanage_443.conf 
+  do
+    if [ -f $i ]; then
+       echo " $i is  configured" >> $log
+    else
+       echo "$i is not configured >> $log
+    fi
+date >> $log
+echo "Configuration of httpd completed " >> $log
diff --git a/container_files/etc/httpd/conf.d/handlers.conf b/container_files/etc/httpd/conf.d/handlers.conf
new file mode 100644
index 0000000..e094143
--- /dev/null
+++ b/container_files/etc/httpd/conf.d/handlers.conf
@@ -0,0 +1,3 @@
+AddType text/html .php
+php_value session.save_handler "files"
+php_value session.save_path    "/var/lib/php/session"
diff --git a/container_files/etc/httpd/conf.d/ports.conf b/container_files/etc/httpd/conf.d/ports.conf
new file mode 100644
index 0000000..cf2b7d0
--- /dev/null
+++ b/container_files/etc/httpd/conf.d/ports.conf
@@ -0,0 +1,2 @@
+Listen 80 http
+Listen 443 https
diff --git a/container_files/etc/httpd/conf.d/ssl.conf b/container_files/etc/httpd/conf.d/ssl.conf
new file mode 100644
index 0000000..ccc067c
--- /dev/null
+++ b/container_files/etc/httpd/conf.d/ssl.conf
@@ -0,0 +1,6 @@
+SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
+SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
+SSLSessionCacheTimeout  300
+SSLRandomSeed startup file:/dev/urandom  256
+SSLRandomSeed connect builtin
+SSLCryptoDevice builtin
diff --git a/container_files/etc/httpd/conf.d/comanage.conf b/container_files/etc/httpd/conf.d/virtual_host_443.conf
similarity index 76%
rename from container_files/etc/httpd/conf.d/comanage.conf
rename to container_files/etc/httpd/conf.d/virtual_host_443.conf
index 0b8e83a..28d17ea 100644
--- a/container_files/etc/httpd/conf.d/comanage.conf
+++ b/container_files/etc/httpd/conf.d/virtual_host_443.conf
@@ -1,25 +1,3 @@
-Listen 80 http
-Listen 443 https
-
-AddType text/html .php
-php_value session.save_handler "files"
-php_value session.save_path    "/var/lib/php/session"
-
-LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_24.so
-
-<VirtualHost _default_:80>
-ServerName http://COMANAGE_SERVER_FQDN:80
-UseCanonicalName On
-RedirectMatch (.*) https://COMANAGE_SERVER_FQDN$1
-</VirtualHost>
-
-SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
-SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
-SSLSessionCacheTimeout  300
-SSLRandomSeed startup file:/dev/urandom  256
-SSLRandomSeed connect builtin
-SSLCryptoDevice builtin
-
 <VirtualHost _default_:443>
 ServerName https://COMANAGE_SERVER_FQDN:443
 UseCanonicalName On
@@ -103,5 +81,4 @@ Redirect "/registry/users/logout" "https://COMANAGE_SERVER_FQDN/Shibboleth.sso/L
     Require all denied
 </Files>
 
-</VirtualHost>                                  
-
+</VirtualHost>   
diff --git a/container_files/etc/httpd/conf.d/virtual_host_80.conf b/container_files/etc/httpd/conf.d/virtual_host_80.conf
new file mode 100644
index 0000000..ffe62ec
--- /dev/null
+++ b/container_files/etc/httpd/conf.d/virtual_host_80.conf
@@ -0,0 +1,5 @@
+<VirtualHost _default_:80>
+ServerName http://COMANAGE_SERVER_FQDN:80
+UseCanonicalName On
+RedirectMatch (.*) https://COMANAGE_SERVER_FQDN$1
+</VirtualHost>
diff --git a/container_files/etc/httpd/conf.modules.d/00-shib.conf b/container_files/etc/httpd/conf.modules.d/00-shib.conf
new file mode 100644
index 0000000..0e5c7b2
--- /dev/null
+++ b/container_files/etc/httpd/conf.modules.d/00-shib.conf
@@ -0,0 +1 @@
+LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_24.so

From de4cc3039f64c186c1bfb9e973033c4205aa9faf Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Mon, 12 Sep 2016 16:48:27 -0300
Subject: [PATCH 011/105] Added support to httpd

---
 Dockerfile                             |  2 +-
 container_files/bin/configure_httpd.sh | 25 +++++++++++++++----------
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 99d3044..daf6cfa 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -105,7 +105,7 @@ RUN ln -s /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so
 RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf
 RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf
 RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf
-RUN ln -s /opt/etc/httpd/conf.d/virtual_host_443.conf /etc/httpd/conf.d/00-comanage-443.conf
+RUN [[ $CHANGE_TO_SSL_HTTPD_KEY && ${CHANGE_TO_SSL_HTTPD_KEY-x} ]] && [[ $CHANGE_TO_SSL_HTTPD_CERT && ${CHANGE_TO_SSL_HTTPD_CERT-x} ]] &&  ln -s /opt/etc/httpd/conf.d/virtual_host_443.conf /etc/httpd/conf.d/00-comanage-443.conf
 
 # Port
 EXPOSE 80 443
diff --git a/container_files/bin/configure_httpd.sh b/container_files/bin/configure_httpd.sh
index 4dd980f..c864f20 100755
--- a/container_files/bin/configure_httpd.sh
+++ b/container_files/bin/configure_httpd.sh
@@ -2,17 +2,22 @@
 
 log="/tmp/httpd.log"
 date >> $log
-echo "Configuring httpd: " > $log
+echo "Configuring httpd: " >> $log
 
-echo "Removing Listen 80 in httpd.conf" > $log
-sed -i 's/^Listen 80$//' /etc/httpd/conf/httpd.conf
+sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_80.conf >> $log
+sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
+if [[ $CHANGE_TO_SSL_HTTPD_KEY &&  ${CHANGE_TO_SSL_HTTPD_KEY-x} ]]; then
+  sed -i "s|CHANGE_TO_SSL_HTTPD_KEY|$CHANGE_TO_SSL_HTTPD_KEY|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
+else
+  echo "CHANGE_TO_SSL_HTTPD_KEY variable is not used" >> $log
+fi
+if [[ $CHANGE_TO_SSL_HTTPD_CERT && ${CHANGE_TO_SSL_HTTPD_CERT-x} ]]; then
+  sed -i "s|CHANGE_TO_SSL_HTTPD_CERT|$CHANGE_TO_SSL_HTTPD_CERT|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
+else
+  echo "CHANGE_TO_SSL_HTTPD_CERT variable is not used" >> $log
+fi
 
-for i in /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/ports.conf /etc/httpd/conf.modules.d/00-shib.conf /etc/httpd/conf.d/00-comanage_80.conf /etc/httpd/conf.d/00-comanage_443.conf 
-  do
-    if [ -f $i ]; then
-       echo " $i is  configured" >> $log
-    else
-       echo "$i is not configured >> $log
-    fi
+echo "Removing Listen 80 in httpd.conf" >> $log
+sed -i 's/^Listen 80$//' /etc/httpd/conf/httpd.conf
 date >> $log
 echo "Configuration of httpd completed " >> $log

From 3af95c823862e6ec041e5d6eda15b05f20013db6 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Mon, 12 Sep 2016 17:19:08 -0300
Subject: [PATCH 012/105] Removed 443 confiRemoved 443 config

---
 Dockerfile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index daf6cfa..cd55b79 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -105,7 +105,6 @@ RUN ln -s /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so
 RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf
 RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf
 RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf
-RUN [[ $CHANGE_TO_SSL_HTTPD_KEY && ${CHANGE_TO_SSL_HTTPD_KEY-x} ]] && [[ $CHANGE_TO_SSL_HTTPD_CERT && ${CHANGE_TO_SSL_HTTPD_CERT-x} ]] &&  ln -s /opt/etc/httpd/conf.d/virtual_host_443.conf /etc/httpd/conf.d/00-comanage-443.conf
 
 # Port
 EXPOSE 80 443

From d4707f8c3328273e4dc14c76d08f8d862514c2b2 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Tue, 13 Sep 2016 18:37:34 -0300
Subject: [PATCH 013/105] Deleted ssl.conf and 00-shib.conf because those file
 are in shib-sp Removed ssl.conf default file in dockerfile

---
 Dockerfile                                            | 6 ------
 container_files/etc/httpd/conf.d/ssl.conf             | 6 ------
 container_files/etc/httpd/conf.modules.d/00-shib.conf | 1 -
 3 files changed, 13 deletions(-)
 delete mode 100644 container_files/etc/httpd/conf.d/ssl.conf
 delete mode 100644 container_files/etc/httpd/conf.modules.d/00-shib.conf

diff --git a/Dockerfile b/Dockerfile
index cd55b79..abdae5e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -94,12 +94,6 @@ VOLUME /opt/shibboleth/ssl/
 
 # Required volumes for mounting Apache SSL files into container
 VOLUME /opt/httpd/ssl/
-#Added ssl default conf
-RUN ln -s /opt/etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf
-
-#Added shib module apache
-RUN ln -s /opt/etc/httpd/conf.modules.d/00-shib.conf /etc/httpd/conf.modules.d/00-shib.conf
-RUN ln -s /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so
 
 #Add httpd configuration
 RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf
diff --git a/container_files/etc/httpd/conf.d/ssl.conf b/container_files/etc/httpd/conf.d/ssl.conf
deleted file mode 100644
index ccc067c..0000000
--- a/container_files/etc/httpd/conf.d/ssl.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
-SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
-SSLSessionCacheTimeout  300
-SSLRandomSeed startup file:/dev/urandom  256
-SSLRandomSeed connect builtin
-SSLCryptoDevice builtin
diff --git a/container_files/etc/httpd/conf.modules.d/00-shib.conf b/container_files/etc/httpd/conf.modules.d/00-shib.conf
deleted file mode 100644
index 0e5c7b2..0000000
--- a/container_files/etc/httpd/conf.modules.d/00-shib.conf
+++ /dev/null
@@ -1 +0,0 @@
-LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_24.so

From b5dd760aa4ba361edbcf3e641a2f64dfda27b19e Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Tue, 13 Sep 2016 20:16:58 -0300
Subject: [PATCH 014/105] Added more control for configure shib and httpd.
 Changed the variable for fqdn comanage in shibboleth2.xml

---
 container_files/bin/configure_httpd.sh         |  7 ++++++-
 container_files/bin/configure_shibd.sh         | 13 ++++++++++---
 container_files/etc/shibboleth/shibboleth2.xml |  4 ++--
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/container_files/bin/configure_httpd.sh b/container_files/bin/configure_httpd.sh
index c864f20..3f025b7 100755
--- a/container_files/bin/configure_httpd.sh
+++ b/container_files/bin/configure_httpd.sh
@@ -3,16 +3,21 @@
 log="/tmp/httpd.log"
 date >> $log
 echo "Configuring httpd: " >> $log
-
+echo "Parsing COMANAGE_SERVER_FQDN to $COMANAGE_SERVER_FQDN in virtualhost 80 and 443" >> $log
 sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_80.conf >> $log
 sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
+echo "virtualhost parsed" >> $log
 if [[ $CHANGE_TO_SSL_HTTPD_KEY &&  ${CHANGE_TO_SSL_HTTPD_KEY-x} ]]; then
+  echo "Parsing CHANGE_TO_SSL_HTTPD_KEY to $CHANGE_TO_SSL_HTTPD_KEY in virtual host 443" >> $log
   sed -i "s|CHANGE_TO_SSL_HTTPD_KEY|$CHANGE_TO_SSL_HTTPD_KEY|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
+  echo "key parsed in virtualhost 443" >> $log
 else
   echo "CHANGE_TO_SSL_HTTPD_KEY variable is not used" >> $log
 fi
 if [[ $CHANGE_TO_SSL_HTTPD_CERT && ${CHANGE_TO_SSL_HTTPD_CERT-x} ]]; then
+  echo "Parsing CHANGE_TO_SSL_HTTPD_CERT to $CHANGE_TO_SSL_HTTPD_CERT in virtualhost 443" >> $log
   sed -i "s|CHANGE_TO_SSL_HTTPD_CERT|$CHANGE_TO_SSL_HTTPD_CERT|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
+  echo "httpd cert parsed in virtualhost 443" >> $log
 else
   echo "CHANGE_TO_SSL_HTTPD_CERT variable is not used" >> $log
 fi
diff --git a/container_files/bin/configure_shibd.sh b/container_files/bin/configure_shibd.sh
index fa698f4..b886c25 100755
--- a/container_files/bin/configure_shibd.sh
+++ b/container_files/bin/configure_shibd.sh
@@ -1,7 +1,14 @@
 #!/bin/bash
 
 log="/tmp/shibd.log"
-
+date >> $log
 echo "Configuring shibd: " > $log
-
-
+if [[ $COMANAGE_SERVER_FQDN &&  ${COMANAGE_SERVER_FQDN-x} ]]; then
+  echo "Parsing COMANAGE_SERVER_FQDN to  $COMANAGE_SERVER_FQDN in /etc/opt/shibboleth/shibboleth2.xml" >> $log
+  sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/shibboleth/shibboleth2.xml
+  echo "shibboleth2.xml parsed" >> $log
+else
+  echo "Variable COMANAGE_SERVER_FQDN not found"
+fi
+echo "Shibboleth xml parsing finish"
+date >> $log
diff --git a/container_files/etc/shibboleth/shibboleth2.xml b/container_files/etc/shibboleth/shibboleth2.xml
index ab4445c..3dd9a9b 100644
--- a/container_files/etc/shibboleth/shibboleth2.xml
+++ b/container_files/etc/shibboleth/shibboleth2.xml
@@ -5,13 +5,13 @@
     xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
     clockSkew="180">
 
-    <ApplicationDefaults entityID="https://CHANGE_TO_COMANAGE_SERVER_FQDN/shibboleth"
+    <ApplicationDefaults entityID="https://COMANAGE_SERVER_FQDN/shibboleth"
                          REMOTE_USER="eppn persistent-id targeted-id">
 
         <Sessions lifetime="28800" timeout="3600" relayState="ss:mem"
                   checkAddress="false" handlerSSL="true" cookieProps="https">
 
-            <SSO discoveryProtocol="SAMLDS" discoveryURL="https://CHANGE_TO_COMANAGE_SERVER_FQDN/registry/pages/eds/index">
+            <SSO discoveryProtocol="SAMLDS" discoveryURL="https://COMANAGE_SERVER_FQDN/registry/pages/eds/index">
               SAML2
             </SSO>
 

From 8bb5c9553f96a3a2e9fc80b27b96cb94c58a6890 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Tue, 13 Sep 2016 20:32:37 -0300
Subject: [PATCH 015/105] Added main.sh if comanage were composed

---
 container_files/bin/start.sh | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh
index c778966..174489a 100755
--- a/container_files/bin/start.sh
+++ b/container_files/bin/start.sh
@@ -43,7 +43,19 @@ else
   echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" >> $log
   echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" 
   date >> $log
-  echo "Starting apache and shibd" >>$log
-  echo "Starting apache shibd"  
-  /usr/local/bin/httpd-shib-foreground 
+  /opt/bin/main.sh
+  laststatus="$?"
+  echo "main.sh last  status: $laststatus"
+  if [ "$laststatus" != "0" ]; then
+      echo "composed non-zero exit status: $laststatus" >> $log
+      echo "composed non-zero exit status: $laststatus"
+      exit 1
+  else
+      date >> $log
+      echo "COmanage was configured" >>$log
+      echo "COmanage was configured"
+      echo "Starting apache and shibd" >>$log
+      echo "Starting apache shibd"
+      /usr/local/bin/httpd-shib-foreground
+  fi
 fi

From 1be79b79ae13de250c6621933b8d1e06e1cb3f42 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Tue, 13 Sep 2016 20:34:37 -0300
Subject: [PATCH 016/105] Added log to correct place

---
 container_files/bin/configure_shibd.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/container_files/bin/configure_shibd.sh b/container_files/bin/configure_shibd.sh
index b886c25..a76961f 100755
--- a/container_files/bin/configure_shibd.sh
+++ b/container_files/bin/configure_shibd.sh
@@ -8,7 +8,7 @@ if [[ $COMANAGE_SERVER_FQDN &&  ${COMANAGE_SERVER_FQDN-x} ]]; then
   sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/shibboleth/shibboleth2.xml
   echo "shibboleth2.xml parsed" >> $log
 else
-  echo "Variable COMANAGE_SERVER_FQDN not found"
+  echo "Variable COMANAGE_SERVER_FQDN not found" >> $log
 fi
-echo "Shibboleth xml parsing finish"
+echo "Shibboleth xml parsing finish" >> $log
 date >> $log

From ba60abe3b256d08878ba1d311a91ca6991da1ad3 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 08:37:15 -0300
Subject: [PATCH 017/105] Added test commit

---
 Dockerfile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Dockerfile b/Dockerfile
index abdae5e..ce71a31 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -100,6 +100,7 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf
 RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf
 RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf
 
+
 # Port
 EXPOSE 80 443
 

From 56a1cfa33bf4996f149a55852c4585a30a54ea50 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 08:55:11 -0300
Subject: [PATCH 018/105] Added cleanup.sh remove firsttimerunning

---
 container_files/bin/cleanup.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/container_files/bin/cleanup.sh b/container_files/bin/cleanup.sh
index a9bf588..183ddb4 100755
--- a/container_files/bin/cleanup.sh
+++ b/container_files/bin/cleanup.sh
@@ -1 +1,11 @@
 #!/bin/bash
+
+log=/tmp/cleanup.log
+
+date >> $log
+
+echo "Cleaning firsttimerunning" >> $log
+
+rm /tmp/firsttimerunning
+
+

From ade81b5bfb5187eb7e7a96cd6d7d30fe3ebe54c9 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 09:33:25 -0300
Subject: [PATCH 019/105] Added files in Dockerfile in order to add php config
 files

---
 Dockerfile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index ce71a31..af7747f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -100,6 +100,12 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf
 RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf
 RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf
 
+#Add php Configuration
+RUN ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php
+RUN ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php
+RUN rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php
+RUN ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php
+RUN rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php
 
 # Port
 EXPOSE 80 443

From c91f3f74518f5ee98eb0cca312f927b73b7120e1 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 09:45:14 -0300
Subject: [PATCH 020/105] Change order of configure.sh

---
 container_files/bin/configure.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/container_files/bin/configure.sh b/container_files/bin/configure.sh
index afc0de0..1192411 100755
--- a/container_files/bin/configure.sh
+++ b/container_files/bin/configure.sh
@@ -2,8 +2,9 @@
 
 /opt/bin/configure_httpd.sh
 
+/opt/bin/configure_shibd.sh
+
 /opt/bin/configure_php.sh
 
-/opt/bin/configure_shibd.sh
 
 

From 35e2d7b002b4d720dba4ad7ec1551d4dca69a44d Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 16:02:15 -0300
Subject: [PATCH 021/105] Added first variables values

---
 container_files/bin/configure_php.sh | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 0a8ecd1..3bfa32f 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -1,7 +1,23 @@
 #!/bin/bash
 
 log="/tmp/php.log"
+date >> $log
+echo "Configuring php: " >> $log
 
-echo "Configuring php: " > $log
+echo " " >> $log
+echo "Checking variables before configuring config files " >> $log
 
+if [[ $MYSQL_HOST &&  ${MYSQL_HOST-x} ]] && [[ $MYSQL_USER &&  ${MYSQL_USER-x} ]] && [[ $MYSQL_PASSWORD &&  ${MYSQL_PASSWORD-x} ]] && [[ $MYSQL_DATABASE &&  ${MYSQL_DATABASE-x} ]]  && [[ $COMANAGE_MAIL_FROM &&  ${COMANAGE_MAIL_FROM-x} ]] && [[ $COMANAGE_MAIL_HOST &&  ${COMANAGE_MAIL_HOST-x} ]] && [[ $COMANAGE_MAIL_PORT &&  ${COMANAGE_MAIL_PORT-x} ]] && [[ $COMANAGE_MAIL_USER &&  ${COMANAGE_MAIL_USER-x} ]] && [[ $COMANAGE_MAIL_PASS &&  ${COMANAGE_MAIL_PASS-x} ]]; then
+  sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_HOST|g" /opt/etc/php/database.php
+  sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_USER|g" /opt/etc/php/database.php
+  sed -i "s|CHANGE_TO_ENV_MYSQL_PASSWORD|$MYSQL_PASSWORD/g" /opt/etc/php/database.php
+  sed -i "s|CHANGE_TO_ENV_MYSQL_TABLE|$MYSQL_DATABASE/g" /opt/etc/php/database.php
+  sed -i "s|CHANGE_TO_COMANAGE_MAIL_FROM|$COMANAGE_MAIL_FROM|g" /opt/etc/php/email.php
+  sed -i "s|CHANGE_TO_COMANAGE_MAIL_HOST|$COMANAGE_MAIL_HOST|g" /opt/etc/php/email.php
+  sed -i "s|CHANGE_TO_COMANAGE_MAIL_PORT|$COMANAGE_MAIL_PORT|g" /opt/etc/php/email.php
+  sed -i "s|CHANGE_TO_COMANAGE_MAIL_USER|$COMANAGE_MAIL_USER|g" /opt/etc/php/email.php
+  sed -i "s|CHANGE_TO_COMANAGE_MAIL_PASS|$COMANAGE_MAIL_PASS|g" /opt/etc/php/email.php
+else
+  echo "Variables are not totally filled so no configuration was performed" >> $log
 
+fi

From 96401057bf8ea48f17736f44f3e97d05dec396fa Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 16:10:17 -0300
Subject: [PATCH 022/105] Added more log

---
 container_files/bin/configure_php.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 3bfa32f..6540767 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -17,7 +17,9 @@ if [[ $MYSQL_HOST &&  ${MYSQL_HOST-x} ]] && [[ $MYSQL_USER &&  ${MYSQL_USER-x} ]
   sed -i "s|CHANGE_TO_COMANAGE_MAIL_PORT|$COMANAGE_MAIL_PORT|g" /opt/etc/php/email.php
   sed -i "s|CHANGE_TO_COMANAGE_MAIL_USER|$COMANAGE_MAIL_USER|g" /opt/etc/php/email.php
   sed -i "s|CHANGE_TO_COMANAGE_MAIL_PASS|$COMANAGE_MAIL_PASS|g" /opt/etc/php/email.php
+  echo "Variables process was completed without any error" >> $log
 else
   echo "Variables are not totally filled so no configuration was performed" >> $log
 
 fi
+date >> $log

From dd1dc62eb4ee12c71d9802b146d34a758110fc0c Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 16:27:10 -0300
Subject: [PATCH 023/105] typo in sed

---
 container_files/bin/configure_php.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 6540767..b0ed008 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -10,8 +10,8 @@ echo "Checking variables before configuring config files " >> $log
 if [[ $MYSQL_HOST &&  ${MYSQL_HOST-x} ]] && [[ $MYSQL_USER &&  ${MYSQL_USER-x} ]] && [[ $MYSQL_PASSWORD &&  ${MYSQL_PASSWORD-x} ]] && [[ $MYSQL_DATABASE &&  ${MYSQL_DATABASE-x} ]]  && [[ $COMANAGE_MAIL_FROM &&  ${COMANAGE_MAIL_FROM-x} ]] && [[ $COMANAGE_MAIL_HOST &&  ${COMANAGE_MAIL_HOST-x} ]] && [[ $COMANAGE_MAIL_PORT &&  ${COMANAGE_MAIL_PORT-x} ]] && [[ $COMANAGE_MAIL_USER &&  ${COMANAGE_MAIL_USER-x} ]] && [[ $COMANAGE_MAIL_PASS &&  ${COMANAGE_MAIL_PASS-x} ]]; then
   sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_HOST|g" /opt/etc/php/database.php
   sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_USER|g" /opt/etc/php/database.php
-  sed -i "s|CHANGE_TO_ENV_MYSQL_PASSWORD|$MYSQL_PASSWORD/g" /opt/etc/php/database.php
-  sed -i "s|CHANGE_TO_ENV_MYSQL_TABLE|$MYSQL_DATABASE/g" /opt/etc/php/database.php
+  sed -i "s|CHANGE_TO_ENV_MYSQL_PASSWORD|$MYSQL_PASSWORD|g" /opt/etc/php/database.php
+  sed -i "s|CHANGE_TO_ENV_MYSQL_TABLE|$MYSQL_DATABASE|g" /opt/etc/php/database.php
   sed -i "s|CHANGE_TO_COMANAGE_MAIL_FROM|$COMANAGE_MAIL_FROM|g" /opt/etc/php/email.php
   sed -i "s|CHANGE_TO_COMANAGE_MAIL_HOST|$COMANAGE_MAIL_HOST|g" /opt/etc/php/email.php
   sed -i "s|CHANGE_TO_COMANAGE_MAIL_PORT|$COMANAGE_MAIL_PORT|g" /opt/etc/php/email.php

From 3c3569385b606f3b80c1f0c9c0aa37d76897fbb7 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 16:29:07 -0300
Subject: [PATCH 024/105] Changed variable

---
 container_files/bin/configure_php.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index b0ed008..6a5ab89 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -9,7 +9,7 @@ echo "Checking variables before configuring config files " >> $log
 
 if [[ $MYSQL_HOST &&  ${MYSQL_HOST-x} ]] && [[ $MYSQL_USER &&  ${MYSQL_USER-x} ]] && [[ $MYSQL_PASSWORD &&  ${MYSQL_PASSWORD-x} ]] && [[ $MYSQL_DATABASE &&  ${MYSQL_DATABASE-x} ]]  && [[ $COMANAGE_MAIL_FROM &&  ${COMANAGE_MAIL_FROM-x} ]] && [[ $COMANAGE_MAIL_HOST &&  ${COMANAGE_MAIL_HOST-x} ]] && [[ $COMANAGE_MAIL_PORT &&  ${COMANAGE_MAIL_PORT-x} ]] && [[ $COMANAGE_MAIL_USER &&  ${COMANAGE_MAIL_USER-x} ]] && [[ $COMANAGE_MAIL_PASS &&  ${COMANAGE_MAIL_PASS-x} ]]; then
   sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_HOST|g" /opt/etc/php/database.php
-  sed -i "s|CHANGE_TO_ENV_MYSQL_HOST|$MYSQL_USER|g" /opt/etc/php/database.php
+  sed -i "s|CHANGE_TO_ENV_MYSQL_USERNAME|$MYSQL_USER|g" /opt/etc/php/database.php
   sed -i "s|CHANGE_TO_ENV_MYSQL_PASSWORD|$MYSQL_PASSWORD|g" /opt/etc/php/database.php
   sed -i "s|CHANGE_TO_ENV_MYSQL_TABLE|$MYSQL_DATABASE|g" /opt/etc/php/database.php
   sed -i "s|CHANGE_TO_COMANAGE_MAIL_FROM|$COMANAGE_MAIL_FROM|g" /opt/etc/php/email.php

From 30e1a89d9342f6207c7504b1f52e3f66850736bb Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 17:36:04 -0300
Subject: [PATCH 025/105] ADded other script to use variables

---
 Dockerfile                                |  3 ++
 container_files/bin/configure_php.sh      | 37 +++++++++++++++++++++++
 container_files/bin/configure_php_user.sh |  7 +++++
 3 files changed, 47 insertions(+)
 create mode 100755 container_files/bin/configure_php_user.sh

diff --git a/Dockerfile b/Dockerfile
index af7747f..b1527f8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -85,6 +85,9 @@ ENV MYSQL_HOST "i2mariadb"
 ENV MYSQL_DATABASE "registry"
 ENV MYSQL_USER "registry_user"
 ENV MYSQL_PASSWORD "WJzesbe3poNZ91qIbmR7"
+ENV ADMIN_FAMILY "admin"
+ENV ADMIN_USERNAME "admin"
+ENV ADMIN_NAME "admin"
 ENV TERM "testterm"
 # How long will we wait for MariaDB to start up?
 ENV WAIT_TIME 60
diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 6a5ab89..6a88987 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -23,3 +23,40 @@ else
 
 fi
 date >> $log
+if [ -z ${COMPOSE+x} ];then
+  echo "Comanage is not composed no database configuration will be perform" >> $log
+else
+  echo "Comanage is composed. Checking variables to Configure first database data" >> $log
+  if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] & [[ $version && ${version-x} ]]; then
+    echo "Variables are ok" >> $log
+    echo "Doing first configuration in database data" >> $log
+    cd /opt/comanage/comanage-registry-$version/app
+    ./Console/cake database >> $log
+    laststatus=$?
+    echo "Composed status: $laststatus" >> $log
+    if [ "$laststatus" != "0" ]; then
+       echo "Not composed non-zero exit status: $laststatus" >> $log
+       echo "Console cake database script failed" >> $log
+       exit 1
+    fi
+    date >> $log
+    echo "First database input was completed whithout any error" >> $log
+    echo "Doing variable parsing" >> $log
+    sed -i "s|ADMIN_NAME|$ADMIN_NAME|g" /opt/bin/configure_php_user.sh
+    sed -i "s|ADMIN_FAMILY|$ADMIN_FAMILY|g" /opt/bin/configure_php_user.sh
+    sed -i "s|ADMIN_USERNAME|$ADMIN_USERNAME|g" /opt/bin/configure_php_user.sh
+    /opt/bin/configure_php_user.sh
+    laststatus=$?
+    if [ "$laststatus" != "0" ]; then
+       echo "Not composed non-zero exit status: $laststatus" >> $log
+       echo "Console cake database setup script failed" >> $log
+       exit 1
+    fi
+    date >> $log
+    echo "Configuration of database was completed" >> $log
+  else
+    echo "Variables were not provided . Configuration of database is not possible" >> $log
+    date >> $log
+  fi
+  
+fi
diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh
new file mode 100755
index 0000000..2fb0f75
--- /dev/null
+++ b/container_files/bin/configure_php_user.sh
@@ -0,0 +1,7 @@
+log=/tmp/php-user.sh
+
+date >> $log
+cd /opt/comanage/comanage-registry-$version/app
+echo "Performing database user setup" >> $log
+./Console/cake setup --admin-given-name ADMIN_NAME --admin-family-name ADMIN_FAMILY --admin-username ADMIN_USERNAME --enable-pooling=No --force >> $log
+

From 7dd2a3da8e6a202291b4dfcdc930ccc27be8f7bc Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 17:45:36 -0300
Subject: [PATCH 026/105] Fixed typo

---
 container_files/bin/configure_php.sh | 2 +-
 container_files/bin/start.sh         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 6a88987..b3118f8 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -27,7 +27,7 @@ if [ -z ${COMPOSE+x} ];then
   echo "Comanage is not composed no database configuration will be perform" >> $log
 else
   echo "Comanage is composed. Checking variables to Configure first database data" >> $log
-  if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] & [[ $version && ${version-x} ]]; then
+  if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $version && ${version-x} ]]; then
     echo "Variables are ok" >> $log
     echo "Doing first configuration in database data" >> $log
     cd /opt/comanage/comanage-registry-$version/app
diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh
index 174489a..e505c85 100755
--- a/container_files/bin/start.sh
+++ b/container_files/bin/start.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
-
 log="/tmp/start-starting.log"
 date >> $log
+
 if [ -z ${COMPOSE+x} ]
 then
   echo "Not composed so not waiting for MariaDB: " > $log

From 1d4a801ac87ea0a7e5732e4265d4fb07703a746a Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 17:51:24 -0300
Subject: [PATCH 027/105] Added version in uppercase

---
 container_files/bin/configure_php.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index b3118f8..5d01d81 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -27,7 +27,7 @@ if [ -z ${COMPOSE+x} ];then
   echo "Comanage is not composed no database configuration will be perform" >> $log
 else
   echo "Comanage is composed. Checking variables to Configure first database data" >> $log
-  if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $version && ${version-x} ]]; then
+  if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $VERSION && ${VERSION-x} ]]; then
     echo "Variables are ok" >> $log
     echo "Doing first configuration in database data" >> $log
     cd /opt/comanage/comanage-registry-$version/app

From dfa7ff42b030057dd5fa49d3b8cebb1c64ff9575 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 17:52:59 -0300
Subject: [PATCH 028/105] Changed version to VERSION

---
 container_files/bin/configure_php_user.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh
index 2fb0f75..b92f170 100755
--- a/container_files/bin/configure_php_user.sh
+++ b/container_files/bin/configure_php_user.sh
@@ -1,7 +1,7 @@
 log=/tmp/php-user.sh
 
 date >> $log
-cd /opt/comanage/comanage-registry-$version/app
+cd /opt/comanage/comanage-registry-$VERSION/app
 echo "Performing database user setup" >> $log
 ./Console/cake setup --admin-given-name ADMIN_NAME --admin-family-name ADMIN_FAMILY --admin-username ADMIN_USERNAME --enable-pooling=No --force >> $log
 

From 0cd065225c08fb98cd971efeed1a176cd34cd4b4 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 14 Sep 2016 17:58:05 -0300
Subject: [PATCH 029/105] Changed version to Version

---
 container_files/bin/configure_php.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 5d01d81..874a785 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -30,7 +30,7 @@ else
   if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $VERSION && ${VERSION-x} ]]; then
     echo "Variables are ok" >> $log
     echo "Doing first configuration in database data" >> $log
-    cd /opt/comanage/comanage-registry-$version/app
+    cd /opt/comanage/comanage-registry-$VERSION/app
     ./Console/cake database >> $log
     laststatus=$?
     echo "Composed status: $laststatus" >> $log

From 2ee9956f4c5fa763ef6c05cc650a5f793800f562 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Thu, 15 Sep 2016 11:56:52 -0300
Subject: [PATCH 030/105] Removed run

---
 Dockerfile | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index b1527f8..1b81d59 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -98,17 +98,8 @@ VOLUME /opt/shibboleth/ssl/
 # Required volumes for mounting Apache SSL files into container
 VOLUME /opt/httpd/ssl/
 
-#Add httpd configuration
-RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf
-RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf
-RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf
-
-#Add php Configuration
-RUN ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php
-RUN ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php
-RUN rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php
-RUN ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php
-RUN rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php
+#Add httpd and php configuration
+RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf &&  ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf && ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php && rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php &&  rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php
 
 # Port
 EXPOSE 80 443

From 5696f29918a6125c0ed5b05b0e924a7633099566 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Thu, 15 Sep 2016 15:22:00 -0300
Subject: [PATCH 031/105] Added autoexec binary

---
 container_files/bin/start.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh
index e505c85..a64e520 100755
--- a/container_files/bin/start.sh
+++ b/container_files/bin/start.sh
@@ -11,12 +11,14 @@ then
   if [ "$laststatus" != "0" ]; then
       echo "Not composed non-zero exit status: $laststatus" >> $log
       echo "Not composed non-zero exit status: $laststatus"
+      /opt/autoexec/bin/firstrun.sh
       exit 1
   else
       echo "COmanage was configured" >>$log
       echo "COmanage was configured"
       echo "Starting apache and shibd" >>$log
       echo "Starting apache shibd"
+      /opt/autoexec/bin/firstrun.sh
       /usr/local/bin/httpd-shib-foreground 
   fi
 else
@@ -49,6 +51,7 @@ else
   if [ "$laststatus" != "0" ]; then
       echo "composed non-zero exit status: $laststatus" >> $log
       echo "composed non-zero exit status: $laststatus"
+      /opt/autoexec/bin/firstrun.sh
       exit 1
   else
       date >> $log
@@ -56,6 +59,7 @@ else
       echo "COmanage was configured"
       echo "Starting apache and shibd" >>$log
       echo "Starting apache shibd"
+      /opt/autoexec/bin/firstrun.sh
       /usr/local/bin/httpd-shib-foreground
   fi
 fi

From af840708bd3a757d5fb66d76a227e337d7a6bc9b Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Thu, 15 Sep 2016 16:15:38 -0300
Subject: [PATCH 032/105] Added notice and license

---
 LICENSE | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 NOTICE  |   5 ++
 2 files changed, 207 insertions(+)
 create mode 100644 LICENSE
 create mode 100644 NOTICE

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..240853c
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache [PRODUCT_NAME]
+Copyright [XXXX-XXXX] The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

From b4a9896f3dbaf48feffc83cc5d817bbaebdc1946 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:15:16 -0300
Subject: [PATCH 033/105] Update common.bash

---
 common.bash | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/common.bash b/common.bash
index 79fd23f..83278ce 100644
--- a/common.bash
+++ b/common.bash
@@ -1,3 +1,18 @@
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 maintainer="bigfleet"
 imagename="comanage"
-version="1.0.5"
\ No newline at end of file
+version="1.0.5"

From 60538a66ec3e508837df53acf0fd8717d972657e Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:16:06 -0300
Subject: [PATCH 034/105] Update Dockerfile

---
 Dockerfile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 1b81d59..b264e4c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,18 @@
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 FROM bigfleet/shibboleth_sp
 
 # Define args and set a default value

From 5a131b361d47b07f55004992e6b12054bfbb88ca Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:16:49 -0300
Subject: [PATCH 035/105] Update README.md

---
 README.md | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/README.md b/README.md
index 07289f2..bb883d1 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,16 @@
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 # COManage

From f463fa993853e31441f268cc3db08f9721b07718 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:17:43 -0300
Subject: [PATCH 036/105] Update Jenkinsfile

---
 Jenkinsfile | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 9f6a1c0..80b51fd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,3 +1,18 @@
+// Licensed to the University Corporation for Advanced Internet Development,
+// Inc. (UCAID) under one or more contributor license agreements.  See the
+// NOTICE file distributed with this work for additional information regarding
+// copyright ownership. The UCAID licenses this file to You under the Apache
+// License, Version 2.0 (the "License"); you may not use this file except in
+// compliance with the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
 node('docker') {
 
   stage 'Checkout'
@@ -85,4 +100,4 @@ def handleError(String message){
   slackSend color: 'danger', message: "${message}"
   //step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'chris.bynum@levvel.io', sendToIndividuals: true])
   sh 'exit 1'
-}
\ No newline at end of file
+}

From fc08c95b25a7e7fa600e05799f29d2fc9a0b4a6c Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:19:50 -0300
Subject: [PATCH 037/105] Update Jenkinsfile

---
 Jenkinsfile | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 9f6a1c0..80b51fd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,3 +1,18 @@
+// Licensed to the University Corporation for Advanced Internet Development,
+// Inc. (UCAID) under one or more contributor license agreements.  See the
+// NOTICE file distributed with this work for additional information regarding
+// copyright ownership. The UCAID licenses this file to You under the Apache
+// License, Version 2.0 (the "License"); you may not use this file except in
+// compliance with the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
 node('docker') {
 
   stage 'Checkout'
@@ -85,4 +100,4 @@ def handleError(String message){
   slackSend color: 'danger', message: "${message}"
   //step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'chris.bynum@levvel.io', sendToIndividuals: true])
   sh 'exit 1'
-}
\ No newline at end of file
+}

From a9b2c48b635753d7bf2ccef5434f066c6f7d2fc1 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:20:37 -0300
Subject: [PATCH 038/105] Update image.bats

---
 tests/image.bats | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/tests/image.bats b/tests/image.bats
index e14978f..c422091 100644
--- a/tests/image.bats
+++ b/tests/image.bats
@@ -1,7 +1,21 @@
 #!/usr/bin/env bats
-
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 load ../common
 
 @test "COmanage directory created" {
   docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-$version
-}
\ No newline at end of file
+}

From 2de4293494095ae9115d73f2e1bc2a33f5a9b53f Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:21:10 -0300
Subject: [PATCH 039/105] Update cleanup.sh

---
 container_files/bin/cleanup.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/container_files/bin/cleanup.sh b/container_files/bin/cleanup.sh
index 183ddb4..7fd2a8a 100755
--- a/container_files/bin/cleanup.sh
+++ b/container_files/bin/cleanup.sh
@@ -1,5 +1,19 @@
 #!/bin/bash
-
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 log=/tmp/cleanup.log
 
 date >> $log

From 799d0fede165e66c75cd7f710d9e3c870b44f87a Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:22:03 -0300
Subject: [PATCH 040/105] Update configure.sh

---
 container_files/bin/configure.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/container_files/bin/configure.sh b/container_files/bin/configure.sh
index 1192411..964ac15 100755
--- a/container_files/bin/configure.sh
+++ b/container_files/bin/configure.sh
@@ -1,5 +1,19 @@
 #!/bin/bash
-
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 /opt/bin/configure_httpd.sh
 
 /opt/bin/configure_shibd.sh

From bf2fc6c1bea650f1fadf5ba43121e4c23c2550b0 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:22:14 -0300
Subject: [PATCH 041/105] Update configure_httpd.sh

---
 container_files/bin/configure_httpd.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/container_files/bin/configure_httpd.sh b/container_files/bin/configure_httpd.sh
index 3f025b7..b3d5850 100755
--- a/container_files/bin/configure_httpd.sh
+++ b/container_files/bin/configure_httpd.sh
@@ -1,5 +1,19 @@
 #!/bin/bash
-
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 log="/tmp/httpd.log"
 date >> $log
 echo "Configuring httpd: " >> $log

From 538f9c82ec4f1958e9da801bb82021741900ea55 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:22:26 -0300
Subject: [PATCH 042/105] Update configure_php.sh

---
 container_files/bin/configure_php.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 874a785..982e96b 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -1,5 +1,19 @@
 #!/bin/bash
-
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 log="/tmp/php.log"
 date >> $log
 echo "Configuring php: " >> $log

From 98f8a82d66f59226c23133c52f2562e8389e6659 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:22:59 -0300
Subject: [PATCH 043/105] Update configure_php_user.sh

---
 container_files/bin/configure_php_user.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh
index b92f170..9ee7730 100755
--- a/container_files/bin/configure_php_user.sh
+++ b/container_files/bin/configure_php_user.sh
@@ -1,3 +1,19 @@
+#!/bin/bash
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 log=/tmp/php-user.sh
 
 date >> $log

From a2fcc01e365fd74e84f3b0a12c2a5c2d56b2e4e6 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:23:13 -0300
Subject: [PATCH 044/105] Update configure_shibd.sh

---
 container_files/bin/configure_shibd.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/container_files/bin/configure_shibd.sh b/container_files/bin/configure_shibd.sh
index a76961f..eaed84f 100755
--- a/container_files/bin/configure_shibd.sh
+++ b/container_files/bin/configure_shibd.sh
@@ -1,5 +1,19 @@
 #!/bin/bash
-
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 log="/tmp/shibd.log"
 date >> $log
 echo "Configuring shibd: " > $log

From 4a751869810f392ec261ca14a0214338d4e064f1 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:23:25 -0300
Subject: [PATCH 045/105] Update main.sh

---
 container_files/bin/main.sh | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/container_files/bin/main.sh b/container_files/bin/main.sh
index 1f49896..80a811d 100755
--- a/container_files/bin/main.sh
+++ b/container_files/bin/main.sh
@@ -1,5 +1,19 @@
 #!/bin/bash -x
-
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 log="/tmp/start-main.log"
 
 echo "Starting Container: " > $log
@@ -17,4 +31,4 @@ if [ -e "/tmp/firsttimerunning" ]; then
 else
     echo "COmanage container has run." >> $log
     echo "If there are problems, docker rm this container and try again." >> $log
-fi
\ No newline at end of file
+fi

From 2a87c0a753940845d6f153b1759792982ed89ccc Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:23:38 -0300
Subject: [PATCH 046/105] Update start.sh

---
 container_files/bin/start.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh
index e505c85..d18a07c 100755
--- a/container_files/bin/start.sh
+++ b/container_files/bin/start.sh
@@ -1,4 +1,19 @@
 #!/bin/bash
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 log="/tmp/start-starting.log"
 date >> $log
 

From 836ec2b0e04b26b80888d3ccfe9431f3b95e97ca Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:23:55 -0300
Subject: [PATCH 047/105] Update handlers.conf

---
 container_files/etc/httpd/conf.d/handlers.conf | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/container_files/etc/httpd/conf.d/handlers.conf b/container_files/etc/httpd/conf.d/handlers.conf
index e094143..05d54f4 100644
--- a/container_files/etc/httpd/conf.d/handlers.conf
+++ b/container_files/etc/httpd/conf.d/handlers.conf
@@ -1,3 +1,18 @@
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 AddType text/html .php
 php_value session.save_handler "files"
 php_value session.save_path    "/var/lib/php/session"

From 82eaf6ce00db1ec7de717cc45226c8456da5b2f2 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:24:08 -0300
Subject: [PATCH 048/105] Update ports.conf

---
 container_files/etc/httpd/conf.d/ports.conf | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/container_files/etc/httpd/conf.d/ports.conf b/container_files/etc/httpd/conf.d/ports.conf
index cf2b7d0..c7e9070 100644
--- a/container_files/etc/httpd/conf.d/ports.conf
+++ b/container_files/etc/httpd/conf.d/ports.conf
@@ -1,2 +1,17 @@
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 Listen 80 http
 Listen 443 https

From 641ba2fcef405df1bbbe30f990ca425a9a84b4f2 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:24:20 -0300
Subject: [PATCH 049/105] Update virtual_host_443.conf

---
 .../etc/httpd/conf.d/virtual_host_443.conf        | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/container_files/etc/httpd/conf.d/virtual_host_443.conf b/container_files/etc/httpd/conf.d/virtual_host_443.conf
index 28d17ea..528739c 100644
--- a/container_files/etc/httpd/conf.d/virtual_host_443.conf
+++ b/container_files/etc/httpd/conf.d/virtual_host_443.conf
@@ -1,3 +1,18 @@
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 <VirtualHost _default_:443>
 ServerName https://COMANAGE_SERVER_FQDN:443
 UseCanonicalName On

From a999ecc4f588ea743d87f491154dc695bd6b546a Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:24:30 -0300
Subject: [PATCH 050/105] Update virtual_host_80.conf

---
 .../etc/httpd/conf.d/virtual_host_80.conf         | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/container_files/etc/httpd/conf.d/virtual_host_80.conf b/container_files/etc/httpd/conf.d/virtual_host_80.conf
index ffe62ec..4e29838 100644
--- a/container_files/etc/httpd/conf.d/virtual_host_80.conf
+++ b/container_files/etc/httpd/conf.d/virtual_host_80.conf
@@ -1,3 +1,18 @@
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 <VirtualHost _default_:80>
 ServerName http://COMANAGE_SERVER_FQDN:80
 UseCanonicalName On

From c0b5269f746b0f26df457f031f09f37a2aac6916 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:28:02 -0300
Subject: [PATCH 051/105] Update attribute-map.xml

---
 .../etc/shibboleth/attribute-map.xml            | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/container_files/etc/shibboleth/attribute-map.xml b/container_files/etc/shibboleth/attribute-map.xml
index 12c4019..ea6fb45 100644
--- a/container_files/etc/shibboleth/attribute-map.xml
+++ b/container_files/etc/shibboleth/attribute-map.xml
@@ -1,3 +1,20 @@
+<!-- 
+* Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+* copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
 <Attributes xmlns="urn:mace:shibboleth:2.0:attribute-map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
     <Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.6" id="eppn">

From f96744b45a6c74cce89e1d552712fb471b003d9d Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:28:26 -0300
Subject: [PATCH 052/105] Update shibboleth2.xml

---
 container_files/etc/shibboleth/shibboleth2.xml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/container_files/etc/shibboleth/shibboleth2.xml b/container_files/etc/shibboleth/shibboleth2.xml
index 3dd9a9b..7508e90 100644
--- a/container_files/etc/shibboleth/shibboleth2.xml
+++ b/container_files/etc/shibboleth/shibboleth2.xml
@@ -1,3 +1,19 @@
+<!-- 
+* Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+* copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
 <SPConfig xmlns="urn:mace:shibboleth:2.0:native:sp:config"
     xmlns:conf="urn:mace:shibboleth:2.0:native:sp:config"
     xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"

From 8d6a82d8af222fc521c877fb0d5b6ebcd19073f5 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Fri, 16 Sep 2016 12:28:55 -0300
Subject: [PATCH 053/105] Update shibboleth_keygen.sh

---
 .../etc/shibboleth/shibboleth_keygen.sh        | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/container_files/etc/shibboleth/shibboleth_keygen.sh b/container_files/etc/shibboleth/shibboleth_keygen.sh
index 205792e..bccf866 100755
--- a/container_files/etc/shibboleth/shibboleth_keygen.sh
+++ b/container_files/etc/shibboleth/shibboleth_keygen.sh
@@ -1,5 +1,19 @@
 #! /bin/sh
-
+# Licensed to the University Corporation for Advanced Internet Development,
+# Inc. (UCAID) under one or more contributor license agreements.  See the
+# NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The UCAID licenses this file to You under the Apache
+# License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 while getopts h:u:g:o:e:y:bf c
      do
          case $c in
@@ -72,4 +86,4 @@ if [ -z "$BATCH" ] ; then
 else
     openssl req -config $SSLCNF -new -x509 -days $DAYS -keyout $OUT/sp-key.pem -out $OUT/sp-cert.pem 2> /dev/null
 fi
-rm $SSLCNF
\ No newline at end of file
+rm $SSLCNF

From a61effdf2fb1b1950cd7468623e7328e9974a51c Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Fri, 16 Sep 2016 16:03:34 -0300
Subject: [PATCH 054/105] added link to registry

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 1b81d59..97a1b90 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -99,7 +99,7 @@ VOLUME /opt/shibboleth/ssl/
 VOLUME /opt/httpd/ssl/
 
 #Add httpd and php configuration
-RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf &&  ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf && ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php && rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php &&  rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php
+RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf &&  ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf && ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php && rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php &&  rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry
 
 # Port
 EXPOSE 80 443

From e04bdbda3228e772408f77bd6d8af73eb739321d Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Fri, 16 Sep 2016 16:18:14 -0300
Subject: [PATCH 055/105] Added simple httpd.conf and link to registry

---
 Dockerfile                                |  2 +-
 container_files/etc/httpd/conf/httpd.conf | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 container_files/etc/httpd/conf/httpd.conf

diff --git a/Dockerfile b/Dockerfile
index 97a1b90..db35b60 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -99,7 +99,7 @@ VOLUME /opt/shibboleth/ssl/
 VOLUME /opt/httpd/ssl/
 
 #Add httpd and php configuration
-RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf &&  ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf && ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php && rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php &&  rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry
+RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf &&  ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf && ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php && rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php &&  rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && rm /etc/httpd/conf/httpd.conf && ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf
 
 # Port
 EXPOSE 80 443
diff --git a/container_files/etc/httpd/conf/httpd.conf b/container_files/etc/httpd/conf/httpd.conf
new file mode 100644
index 0000000..f6d8cf1
--- /dev/null
+++ b/container_files/etc/httpd/conf/httpd.conf
@@ -0,0 +1,12 @@
+ServerRoot "/etc/httpd"
+Include conf.modules.d/*.conf
+User apache
+Group apache
+ServerAdmin root@localhost
+AddDefaultCharset UTF-8
+TypesConfig /etc/mime.types
+AddType application/x-compress .Z
+AddType application/x-gzip .gz .tgz
+AddType text/html .shtml
+AddOutputFilter INCLUDES .shtml
+IncludeOptional conf.d/*.conf

From bd783376c58cae435e267548b8668b4e11f1d7b1 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Fri, 16 Sep 2016 16:20:03 -0300
Subject: [PATCH 056/105] Added httpd.conf

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index db35b60..9d7e281 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -100,7 +100,7 @@ VOLUME /opt/httpd/ssl/
 
 #Add httpd and php configuration
 RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf &&  ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf && ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php && rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php &&  rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && rm /etc/httpd/conf/httpd.conf && ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf
-
+  
 # Port
 EXPOSE 80 443
 

From 336f5815134f97f94aef40ae8ea659d3a28e5928 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Mon, 19 Sep 2016 15:42:54 -0400
Subject: [PATCH 057/105] Updating lineage, expanding tests

---
 Dockerfile       | 2 +-
 tests/image.bats | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 9e23514..3b3f1a0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-FROM bigfleet/shibboleth_sp
+FROM tier/shibboleth_sp
 
 # Define args and set a default value
 ARG registry=docker.io
diff --git a/tests/image.bats b/tests/image.bats
index c422091..616708f 100644
--- a/tests/image.bats
+++ b/tests/image.bats
@@ -19,3 +19,11 @@ load ../common
 @test "COmanage directory created" {
   docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-$version
 }
+
+@test "Autoexec firstrun capability detected" {
+  docker run -i $maintainer/$imagename find /opt/autoexec/bin/firstrun.sh
+}
+
+@test "Autoexec onbuild capability detected" {
+  docker run -i $maintainer/$imagename find /opt/autoexec/bin/onbuild.sh
+}

From 3027784da92cfeab9380f2d6c48ecb5e41fb8926 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Mon, 19 Sep 2016 17:14:45 -0400
Subject: [PATCH 058/105] ADD container_files/ /opt may interfere with chmod
 settings, surprise

---
 Dockerfile       | 17 +++++++++++++++--
 tests/image.bats |  5 +++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 3b3f1a0..ef0821d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -84,7 +84,8 @@ ADD ./container_files /opt
 # Add Volumes and Set permissions
 RUN mkdir /opt/shared \
     && chmod 777 /opt/shared \
-    && chmod 777 /opt/bin/*.sh
+    && chmod +x /opt/bin/*.sh \
+    && chmod +x /opt/autoexec/bin/*.sh
 
 # Environment variables
 ENV ADMIN_NAME "Scott"
@@ -114,7 +115,19 @@ VOLUME /opt/shibboleth/ssl/
 VOLUME /opt/httpd/ssl/
 
 #Add httpd and php configuration
-RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf &&  ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf && ln -s /opt/etc/php/EmailSheel.php  /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php && rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php && ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php &&  rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php &&  ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && rm /etc/httpd/conf/httpd.conf && ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf
+RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  \
+    ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf && \
+    ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf && \
+    ln -s /opt/etc/php/EmailSheel.php /opt/comanage/comanage-registry-$version/app/Console/Command/EmailSheel.php && \
+    ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/local/Config/database.php && \
+    rm -f /opt/comanage/comanage-registry-$version/app/Config/database.php && \
+    ln -s /opt/etc/php/database.php  /opt/comanage/comanage-registry-$version/app/Config/database.php && \
+    ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php && \
+    rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php && \
+    ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && \
+    ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && \
+    rm /etc/httpd/conf/httpd.conf && \
+    ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf
   
 # Port
 EXPOSE 80 443
diff --git a/tests/image.bats b/tests/image.bats
index 616708f..ba27768 100644
--- a/tests/image.bats
+++ b/tests/image.bats
@@ -27,3 +27,8 @@ load ../common
 @test "Autoexec onbuild capability detected" {
   docker run -i $maintainer/$imagename find /opt/autoexec/bin/onbuild.sh
 }
+
+@test "Autoexec firstrun retains executability" {
+  skip
+  docker run -i $maintainer/$imagename ls -la /opt/autoexec/bin/firstrun.sh
+}

From 40233f846c0ae72216ff43a08c91a34914f8ee1e Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Mon, 19 Sep 2016 17:41:00 -0400
Subject: [PATCH 059/105] Expanding which executables are effected

---
 Dockerfile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index ef0821d..d90ae45 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -85,7 +85,9 @@ ADD ./container_files /opt
 RUN mkdir /opt/shared \
     && chmod 777 /opt/shared \
     && chmod +x /opt/bin/*.sh \
-    && chmod +x /opt/autoexec/bin/*.sh
+    && chmod +x /opt/autoexec/bin/*.sh \
+    && chmod +x /opt/autoexec/firstrun/*.sh \
+    && chmod +x /opt/autoexec/onbuild/*.sh
 
 # Environment variables
 ENV ADMIN_NAME "Scott"

From 650e808526fe9fbb618b22912b13faea6c686512 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Tue, 20 Sep 2016 14:29:45 -0400
Subject: [PATCH 060/105] Added capability to detect schema needs, closes #16

---
 container_files/bin/cleanup.sh            |  2 +-
 container_files/bin/configure_httpd.sh    |  2 +-
 container_files/bin/configure_php.sh      |  4 ++--
 container_files/bin/configure_php_user.sh | 18 ++++++++++++++----
 container_files/bin/configure_shibd.sh    |  2 +-
 container_files/bin/main.sh               |  2 +-
 container_files/bin/start.sh              | 19 -------------------
 7 files changed, 20 insertions(+), 29 deletions(-)

diff --git a/container_files/bin/cleanup.sh b/container_files/bin/cleanup.sh
index 7fd2a8a..5500b98 100755
--- a/container_files/bin/cleanup.sh
+++ b/container_files/bin/cleanup.sh
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-log=/tmp/cleanup.log
+log=/opt/log/cleanup.log
 
 date >> $log
 
diff --git a/container_files/bin/configure_httpd.sh b/container_files/bin/configure_httpd.sh
index b3d5850..b02ac3d 100755
--- a/container_files/bin/configure_httpd.sh
+++ b/container_files/bin/configure_httpd.sh
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-log="/tmp/httpd.log"
+log="/opt/log/httpd.log"
 date >> $log
 echo "Configuring httpd: " >> $log
 echo "Parsing COMANAGE_SERVER_FQDN to $COMANAGE_SERVER_FQDN in virtualhost 80 and 443" >> $log
diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 982e96b..6d3b034 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-log="/tmp/php.log"
+log="/opt/log/php.log"
 date >> $log
 echo "Configuring php: " >> $log
 
@@ -54,7 +54,7 @@ else
        exit 1
     fi
     date >> $log
-    echo "First database input was completed whithout any error" >> $log
+    echo "First database input was completed without any error" >> $log
     echo "Doing variable parsing" >> $log
     sed -i "s|ADMIN_NAME|$ADMIN_NAME|g" /opt/bin/configure_php_user.sh
     sed -i "s|ADMIN_FAMILY|$ADMIN_FAMILY|g" /opt/bin/configure_php_user.sh
diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh
index 9ee7730..4903097 100755
--- a/container_files/bin/configure_php_user.sh
+++ b/container_files/bin/configure_php_user.sh
@@ -14,10 +14,20 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-log=/tmp/php-user.sh
+log=/opt/log/php-user.sh
 
 date >> $log
-cd /opt/comanage/comanage-registry-$VERSION/app
-echo "Performing database user setup" >> $log
-./Console/cake setup --admin-given-name ADMIN_NAME --admin-family-name ADMIN_FAMILY --admin-username ADMIN_USERNAME --enable-pooling=No --force >> $log
+
+schema=$( mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" $MYSQL_DATABASE -e 'desc cm_users' )
+laststatus=$?
+    
+if [ ! $laststatus -eq 0 ]; then
+    cd /opt/comanage/comanage-registry-$VERSION/app
+    echo "Performing database user setup" >> $log
+    ./Console/cake setup --admin-given-name ADMIN_NAME --admin-family-name ADMIN_FAMILY --admin-username ADMIN_USERNAME --enable-pooling=No --force >> $log
+else
+    echo "table cm_users exists, skipping provisioning" >> $log
+fi
+
+
 
diff --git a/container_files/bin/configure_shibd.sh b/container_files/bin/configure_shibd.sh
index eaed84f..392c8e0 100755
--- a/container_files/bin/configure_shibd.sh
+++ b/container_files/bin/configure_shibd.sh
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-log="/tmp/shibd.log"
+log="/opt/log/shibd.log"
 date >> $log
 echo "Configuring shibd: " > $log
 if [[ $COMANAGE_SERVER_FQDN &&  ${COMANAGE_SERVER_FQDN-x} ]]; then
diff --git a/container_files/bin/main.sh b/container_files/bin/main.sh
index 80a811d..845b2e0 100755
--- a/container_files/bin/main.sh
+++ b/container_files/bin/main.sh
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-log="/tmp/start-main.log"
+log="/opt/log/start-main.log"
 
 echo "Starting Container: " > $log
 date >> $log
diff --git a/container_files/bin/start.sh b/container_files/bin/start.sh
index 6d843b9..5dab793 100755
--- a/container_files/bin/start.sh
+++ b/container_files/bin/start.sh
@@ -42,25 +42,6 @@ else
   echo "Testing connectivity to database before continue with install" >> $log
   echo "Testing connectivity to database before continue with install"
   /opt/wait-for-it/wait-for-it.sh $MYSQL_HOST:3306 -t $WAIT_TIME --strict -- /opt/bin/main.sh >> $log
-  echo "Mariadb default port is open and test connection ok"
-  echo "Mariadb default port is open and test connection ok" >> $log
-  echo "Testing connectivy to database before continue with install" >> $log
-  echo "Testing connectivy to database before continue with install"
-  mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" -e "use $MYSQL_DATABASE; show tables;"
-  laststatus="$?"
-  echo "checking connectivity" >> $log
-    while [ "$laststatus" != "0" ]; do
-      mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h "$MYSQL_HOST" -e "use $MYSQL_DATABASE; show tables;"
-      laststatus="$?"
-      sleep 5
-      date >> $log
-      echo "Trying to connect to mariadb container with $MYSQL_USER to database $MYSQL_DATABASE"
-      echo "Trying to connect to mariadb container with $MYSQL_USER to database $MYSQL_DATABASE" >> $log
-    done
-  echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" >> $log
-  echo "Database Connection with $MYSQL_USER to database $MYSQL_DATABASE was completed without any error" 
-  date >> $log
-  /opt/bin/main.sh
   laststatus="$?"
   echo "main.sh last  status: $laststatus"
   if [ "$laststatus" != "0" ]; then

From 06a38376ebd6f87c18c6c4878c365328df263d36 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Tue, 20 Sep 2016 15:03:53 -0400
Subject: [PATCH 061/105] Invoking ONBUILD script

---
 Dockerfile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index d90ae45..103cd66 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -129,7 +129,9 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  \
     ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && \
     ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && \
     rm /etc/httpd/conf/httpd.conf && \
-    ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf
+    ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf && \
+    /opt/autoexec/bin/onbuild.sh
+    
   
 # Port
 EXPOSE 80 443

From 241e2b125bd41d5586faba4b65ee5275c5cbce32 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Thu, 22 Sep 2016 11:31:28 -0400
Subject: [PATCH 062/105] Adding cache directory and perms setting (generates
 500's in sample appliance)

---
 Dockerfile       | 2 ++
 tests/image.bats | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 103cd66..5da82f0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -130,6 +130,8 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  \
     ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && \
     rm /etc/httpd/conf/httpd.conf && \
     ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf && \
+    mkdir -p /opt/comanage/comanage-registry-$version/local/tmp/cache/persistent && \
+    chmod 777 /opt/comanage/comanage-registry-$version/local/tmp/cache/persistent && \
     /opt/autoexec/bin/onbuild.sh
     
   
diff --git a/tests/image.bats b/tests/image.bats
index ba27768..a40d90c 100644
--- a/tests/image.bats
+++ b/tests/image.bats
@@ -32,3 +32,9 @@ load ../common
   skip
   docker run -i $maintainer/$imagename ls -la /opt/autoexec/bin/firstrun.sh
 }
+
+@test "Cache directory created" {
+  docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-1.0.5/app/tmp/cache/persistent/
+}
+
+

From 7ffa3bc4238569c79a90603eda0e720740cbcf08 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Thu, 22 Sep 2016 16:03:31 -0400
Subject: [PATCH 063/105] Adjusting the location of cache permissions

---
 Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 5da82f0..279ba20 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -130,8 +130,8 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  \
     ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && \
     rm /etc/httpd/conf/httpd.conf && \
     ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf && \
-    mkdir -p /opt/comanage/comanage-registry-$version/local/tmp/cache/persistent && \
-    chmod 777 /opt/comanage/comanage-registry-$version/local/tmp/cache/persistent && \
+    mkdir -p /opt/comanage/comanage-registry-$version/local/tmp/cache && \
+    chmod 777 /opt/comanage/comanage-registry-$version/local/tmp/cache && \
     /opt/autoexec/bin/onbuild.sh
     
   

From 9f67ad7a29a0b7e3d969b7e2e513635dbc25a54f Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Thu, 22 Sep 2016 16:05:15 -0400
Subject: [PATCH 064/105] Correcting test too

---
 tests/image.bats | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/image.bats b/tests/image.bats
index a40d90c..0293299 100644
--- a/tests/image.bats
+++ b/tests/image.bats
@@ -34,7 +34,7 @@ load ../common
 }
 
 @test "Cache directory created" {
-  docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-1.0.5/app/tmp/cache/persistent/
+  docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-1.0.5/app/tmp/cache
 }
 
 

From 81bff4213f864d9de31ebcdaf85da3a6f0fe1ab1 Mon Sep 17 00:00:00 2001
From: Jim Van Fleet <jim.van.fleet@levvel.io>
Date: Fri, 23 Sep 2016 10:29:59 -0400
Subject: [PATCH 065/105] Local tests show https request possible

---
 Dockerfile                           |  4 +---
 container_files/bin/configure.sh     | 10 ++++++----
 container_files/bin/configure_php.sh |  9 +++++++++
 tests/image.bats                     |  4 ----
 4 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 279ba20..dadee78 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -106,7 +106,7 @@ ENV MYSQL_PASSWORD "WJzesbe3poNZ91qIbmR7"
 ENV ADMIN_FAMILY "admin"
 ENV ADMIN_USERNAME "admin"
 ENV ADMIN_NAME "admin"
-ENV TERM "testterm"
+
 # How long will we wait for MariaDB to start up?
 ENV WAIT_TIME 60
 
@@ -130,8 +130,6 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  \
     ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && \
     rm /etc/httpd/conf/httpd.conf && \
     ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf && \
-    mkdir -p /opt/comanage/comanage-registry-$version/local/tmp/cache && \
-    chmod 777 /opt/comanage/comanage-registry-$version/local/tmp/cache && \
     /opt/autoexec/bin/onbuild.sh
     
   
diff --git a/container_files/bin/configure.sh b/container_files/bin/configure.sh
index 964ac15..715fa42 100755
--- a/container_files/bin/configure.sh
+++ b/container_files/bin/configure.sh
@@ -14,11 +14,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-/opt/bin/configure_httpd.sh
 
-/opt/bin/configure_shibd.sh
-
-/opt/bin/configure_php.sh
+log="/opt/log/start-configure.log"
+set -e
+echo "Configuring" > $log
+/opt/bin/configure_httpd.sh >> $log
+/opt/bin/configure_shibd.sh >> $log
+/opt/bin/configure_php.sh >> $log
 
 
 
diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index 6d3b034..c6f7c22 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -36,6 +36,15 @@ else
   echo "Variables are not totally filled so no configuration was performed" >> $log
 
 fi
+date >> $log
+echo "Preparing for cache" >> $log
+mkdir -p /opt/comanage/comanage-registry-$VERSION/local/tmp/cache/persistent && \
+mkdir -p /opt/comanage/comanage-registry-$VERSION/local/tmp/cache/models && \  
+chmod -R 777 /opt/comanage/comanage-registry-$VERSION/local/tmp/cache && \
+chown -R apache:apache /opt/comanage/comanage-registry-$VERSION/local/tmp/cache && \
+echo "Cache status: " >> $log
+ls -la /opt/comanage/comanage-registry-$VERSION/local/tmp/cache >> $log
+
 date >> $log
 if [ -z ${COMPOSE+x} ];then
   echo "Comanage is not composed no database configuration will be perform" >> $log
diff --git a/tests/image.bats b/tests/image.bats
index 0293299..71ff5be 100644
--- a/tests/image.bats
+++ b/tests/image.bats
@@ -33,8 +33,4 @@ load ../common
   docker run -i $maintainer/$imagename ls -la /opt/autoexec/bin/firstrun.sh
 }
 
-@test "Cache directory created" {
-  docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-1.0.5/app/tmp/cache
-}
-
 

From 65673fbc87ba78d3536897e5777948eb8cf17344 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Tue, 15 Nov 2016 21:20:14 +0100
Subject: [PATCH 066/105] changed variables in dockerfile

---
 Dockerfile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index dadee78..ee2c5d8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -90,9 +90,9 @@ RUN mkdir /opt/shared \
     && chmod +x /opt/autoexec/onbuild/*.sh
 
 # Environment variables
-ENV ADMIN_NAME "Scott"
-ENV ADMIN_FAMILY "Koranda"
-ENV ADMIN_USERNAME "scott.koranda@sphericalcowgroup.com"
+ENV ADMIN_GIVEN_NAME "Scott"
+ENV ADMIN_FAMILY_NAME "Koranda"
+ENV ADMIN_EPPN "scott.koranda@sphericalcowgroup.com"
 ENV COMANAGE_SERVER_FQDN "comanage.testbed.tier.internet2.edu"
 ENV COMANAGE_MAIL_FROM "comanage_registry@picard.cgac.uwm.edu"
 ENV COMANAGE_MAIL_HOST "localhost"

From 3117c7cf99751105af151c329ebd5d9a84f65c8b Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Tue, 15 Nov 2016 21:42:06 +0100
Subject: [PATCH 067/105] Changed variables

---
 Dockerfile                                | 6 +++---
 container_files/bin/configure_php.sh      | 8 ++++----
 container_files/bin/configure_php_user.sh | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index ee2c5d8..475262f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -103,9 +103,9 @@ ENV MYSQL_HOST "i2mariadb"
 ENV MYSQL_DATABASE "registry"
 ENV MYSQL_USER "registry_user"
 ENV MYSQL_PASSWORD "WJzesbe3poNZ91qIbmR7"
-ENV ADMIN_FAMILY "admin"
-ENV ADMIN_USERNAME "admin"
-ENV ADMIN_NAME "admin"
+ENV ADMIN_FAMILY_NAME "admin"
+ENV ADMIN_EPPN "admin"
+ENV ADMIN_GIVEN_NAME "admin"
 
 # How long will we wait for MariaDB to start up?
 ENV WAIT_TIME 60
diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index c6f7c22..320ac38 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -50,7 +50,7 @@ if [ -z ${COMPOSE+x} ];then
   echo "Comanage is not composed no database configuration will be perform" >> $log
 else
   echo "Comanage is composed. Checking variables to Configure first database data" >> $log
-  if [[ $ADMIN_NAME && ${ADMIN_NAME-x} ]] && [[ $ADMIN_FAMILY && ${ADMIN_FAMILY-x} ]] && [[ $ADMIN_USERNAME && ${ADMIN_USERNAME-x} ]] && [[ $VERSION && ${VERSION-x} ]]; then
+  if [[ $ADMIN_GIVEN_NAME && ${ADMIN_GIVEN_NAME-x} ]] && [[ $ADMIN_FAMILY_NAME && ${ADMIN_FAMILY_NAME-x} ]] && [[ $ADMIN_EPPN && ${ADMIN_EPPN-x} ]] && [[ $VERSION && ${VERSION-x} ]]; then
     echo "Variables are ok" >> $log
     echo "Doing first configuration in database data" >> $log
     cd /opt/comanage/comanage-registry-$VERSION/app
@@ -65,9 +65,9 @@ else
     date >> $log
     echo "First database input was completed without any error" >> $log
     echo "Doing variable parsing" >> $log
-    sed -i "s|ADMIN_NAME|$ADMIN_NAME|g" /opt/bin/configure_php_user.sh
-    sed -i "s|ADMIN_FAMILY|$ADMIN_FAMILY|g" /opt/bin/configure_php_user.sh
-    sed -i "s|ADMIN_USERNAME|$ADMIN_USERNAME|g" /opt/bin/configure_php_user.sh
+    sed -i "s|ADMIN_GIVEN_NAME|$ADMIN_GIVEN_NAME|g" /opt/bin/configure_php_user.sh
+    sed -i "s|ADMIN_FAMILY_NAME|$ADMIN_FAMILY_NAME|g" /opt/bin/configure_php_user.sh
+    sed -i "s|ADMIN_EPPN|$ADMIN_EPPN|g" /opt/bin/configure_php_user.sh
     /opt/bin/configure_php_user.sh
     laststatus=$?
     if [ "$laststatus" != "0" ]; then
diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh
index 4903097..b3dae79 100755
--- a/container_files/bin/configure_php_user.sh
+++ b/container_files/bin/configure_php_user.sh
@@ -24,7 +24,7 @@ laststatus=$?
 if [ ! $laststatus -eq 0 ]; then
     cd /opt/comanage/comanage-registry-$VERSION/app
     echo "Performing database user setup" >> $log
-    ./Console/cake setup --admin-given-name ADMIN_NAME --admin-family-name ADMIN_FAMILY --admin-username ADMIN_USERNAME --enable-pooling=No --force >> $log
+    ./Console/cake setup --admin-given-name ADMIN_GIVEN_NAME --admin-family-name ADMIN_FAMILY_NAME --admin-username ADMIN_EPPN --enable-pooling=No --force >> $log
 else
     echo "table cm_users exists, skipping provisioning" >> $log
 fi

From 892b9ae7da5916cb6997e7bcbd5cc1572693db46 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 16 Nov 2016 22:10:09 +0100
Subject: [PATCH 068/105] added the link to the directory

---
 Dockerfile                           |  2 ++
 container_files/bin/configure_php.sh | 12 ++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index dadee78..e89982a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -71,6 +71,8 @@ RUN mkdir -p /tmp/comanage && cd /tmp/comanage && \
       tar xf $VERSION.tar.gz && \
       mv $COMANAGE_PREFIX-$VERSION /opt/comanage/. && \
       ln -s /opt/comanage/$VERSION /opt/comanage/current && \
+      mkdir /var/cache/registry && \
+      ln -s /var/cache/registry /opt/comanage/$COMANAGE_PREFIX-$VERSION/local/tmp &&  \
 # # Cleanup
             rm -rf /tmp/comanage
 
diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh
index c6f7c22..acd039c 100755
--- a/container_files/bin/configure_php.sh
+++ b/container_files/bin/configure_php.sh
@@ -38,10 +38,14 @@ else
 fi
 date >> $log
 echo "Preparing for cache" >> $log
-mkdir -p /opt/comanage/comanage-registry-$VERSION/local/tmp/cache/persistent && \
-mkdir -p /opt/comanage/comanage-registry-$VERSION/local/tmp/cache/models && \  
-chmod -R 777 /opt/comanage/comanage-registry-$VERSION/local/tmp/cache && \
-chown -R apache:apache /opt/comanage/comanage-registry-$VERSION/local/tmp/cache && \
+mkdir -p /var/cache/registry/cache/persistent && \
+mkdir -p /var/cache/registry/cache/models && \  
+mkdir -p /var/cache/registry/logs && \  
+mkdir -p /var/cache/registry/sessions && \  
+mkdir -p /var/cache/registry/tests && \  
+chmod -R 700 /var/cache/registry && \
+chown -R apache:apache /var/cache/registry && \
+chown -R apache:apache /opt/comanage/comanage-registry-$VERSION/local 
 echo "Cache status: " >> $log
 ls -la /opt/comanage/comanage-registry-$VERSION/local/tmp/cache >> $log
 

From 0f55a9adf354175fb87d9e2fab6ef8e8504c5c73 Mon Sep 17 00:00:00 2001
From: villadalmine <rino@atadata.com>
Date: Wed, 16 Nov 2016 22:18:06 +0100
Subject: [PATCH 069/105] added test to check link of cache directory

---
 tests/image.bats | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/image.bats b/tests/image.bats
index 71ff5be..de810a1 100644
--- a/tests/image.bats
+++ b/tests/image.bats
@@ -20,6 +20,10 @@ load ../common
   docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-$version
 }
 
+@test "COmanage cache link directory created" {
+  docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-$version/local/tmp -links 1
+
+}
 @test "Autoexec firstrun capability detected" {
   docker run -i $maintainer/$imagename find /opt/autoexec/bin/firstrun.sh
 }

From 60bd172bd015b7d6804a1663d5224008d246b552 Mon Sep 17 00:00:00 2001
From: villadalmine <rino.rondan@levvel.io>
Date: Thu, 17 Nov 2016 20:18:21 +0100
Subject: [PATCH 070/105] Update README.md

---
 README.md | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/README.md b/README.md
index bb883d1..8b13789 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1 @@
-# Licensed to the University Corporation for Advanced Internet Development,
-# Inc. (UCAID) under one or more contributor license agreements.  See the
-# NOTICE file distributed with this work for additional information regarding
-# copyright ownership. The UCAID licenses this file to You under the Apache
-# License, Version 2.0 (the "License"); you may not use this file except in
-# compliance with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# COManage
+

From 43eae38c078e4aa34cbaf634f86b1598290960be Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 20 Jan 2017 10:04:35 -0500
Subject: [PATCH 071/105] updating for security fix to 1.0.6

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index ce9d07b..39d5d95 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,7 +19,7 @@ FROM tier/shibboleth_sp
 ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
-ARG version=1.0.5
+ARG version=1.0.6
 
 MAINTAINER $maintainer
 LABEL Vendor="Internet2"

From 359b4aed53cd01a630ab4affeda6ca024469b996 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 20 Jan 2017 10:30:13 -0500
Subject: [PATCH 072/105] updating for security fix to 1.0.6

---
 common.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common.bash b/common.bash
index 83278ce..29d2ecb 100644
--- a/common.bash
+++ b/common.bash
@@ -15,4 +15,4 @@
 #
 maintainer="bigfleet"
 imagename="comanage"
-version="1.0.5"
+version="1.0.6"

From 60fcf866ca5bd560e4606012763e94e1e36a0acd Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 20 Jan 2017 16:25:08 -0500
Subject: [PATCH 073/105] updating for security fix to 1.0.6

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index ce9d07b..39d5d95 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,7 +19,7 @@ FROM tier/shibboleth_sp
 ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
-ARG version=1.0.5
+ARG version=1.0.6
 
 MAINTAINER $maintainer
 LABEL Vendor="Internet2"

From b6db09856b8c4a5667d8cbfd9dfbf305c31df446 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 3 Feb 2017 19:55:54 -0500
Subject: [PATCH 074/105] bumped to 1.0.6

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 39d5d95..fada16b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -129,7 +129,7 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  \
     ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php && \
     rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php && \
     ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && \
-    ln -s /opt/comanage/comanage-registry-1.0.5/app/webroot /var/www/html/registry && \
+    ln -s /opt/comanage/comanage-registry-1.0.6/app/webroot /var/www/html/registry && \
     rm /etc/httpd/conf/httpd.conf && \
     ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf && \
     /opt/autoexec/bin/onbuild.sh

From 7c4611919af2ce635ca08f72c12df684d01fa912 Mon Sep 17 00:00:00 2001
From: Paul Caskey <pcaskey@internet2.edu>
Date: Fri, 3 Mar 2017 14:23:04 -0600
Subject: [PATCH 075/105] initial add for instrumentation phase 1

---
 Dockerfile                  | 10 +++++++++-
 files/bin/sendtierbeacon.sh | 25 +++++++++++++++++++++++++
 files/bin/setenv.sh         |  5 +++++
 files/bin/startup.sh        | 22 ++++++++++++++++++++++
 4 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 files/bin/sendtierbeacon.sh
 create mode 100644 files/bin/setenv.sh
 create mode 100644 files/bin/startup.sh

diff --git a/Dockerfile b/Dockerfile
index fada16b..f785421 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -138,4 +138,12 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  \
 # Port
 EXPOSE 80 443
 
-CMD ["/opt/bin/start.sh"]
+ADD files/bin/setenv.sh /opt/tier/setenv.sh
+RUN chmod +x /opt/tier/setenv.sh
+ADD files/bin/startup.sh /usr/bin/startup.sh
+RUN chmod +x /usr/bin/startup.sh
+ADD files/bin/sendtierbeacon.sh /usr/bin/sendtierbeacon.sh
+RUN chmod +x /usr/bin/sendtierbeacon.sh
+
+
+CMD ["/usr/bin/startup.sh"]
diff --git a/files/bin/sendtierbeacon.sh b/files/bin/sendtierbeacon.sh
new file mode 100644
index 0000000..f9ba5c4
--- /dev/null
+++ b/files/bin/sendtierbeacon.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+LOGHOST="collector.testbed.tier.internet2.edu"
+LOGPORT="5001"
+if [ -s /opt/tier/env.bash ]; then
+  . /opt/tier/env.bash
+fi
+
+#below for syslog, F-TICKS style
+#LOGTEXT="TIERBEACON/TIER/1.0#IM=$IMAGENAME#PV=$VERSION#TR=$TIERVERSION#MT=$MAINTAINER#"
+
+#below for JSON/REST style
+LOGTEXT="{ \"msgType\" : \"TIERBEACON\", \"msgName\" : \"TIER\", \"msgVersion\" : \"1.0\", \"tbProduct\" : \"$IMAGENAME\", \"tbProductVersion\" : \"$VERSION\", \"tbTIERRelease\" : \"$TIERVERSION\", \"tbMaintainer\" : \"$MAINTAINER\" }"
+
+
+if [ -z "$TIER_BEACON_OPT_OUT" ]; then
+  #send JSON
+  echo $LOGTEXT > msgjson.txt
+  curl -s -XPOST "${LOGHOST}:${LOGPORT}/" -H 'Content-Type: application/json' -T msgjson.txt 1>/dev/null
+  rm -f msgjson.txt
+  
+  #below is for syslog, F-TICKS style
+  #`logger -n $LOGHOST -P $LOGPORT -t TIERBEACON $LOGTEXT`
+
+  echo `date`"; TIER beacon sent."
+fi
diff --git a/files/bin/setenv.sh b/files/bin/setenv.sh
new file mode 100644
index 0000000..a43bc0b
--- /dev/null
+++ b/files/bin/setenv.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^VERSION" > /opt/tier/env.bash
+printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^TIERVERSION" >> /opt/tier/env.bash
+printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^IMAGE" >> /opt/tier/env.bash
+printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^MAINTAINER" >> /opt/tier/env.bash
diff --git a/files/bin/startup.sh b/files/bin/startup.sh
new file mode 100644
index 0000000..c3bb95d
--- /dev/null
+++ b/files/bin/startup.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+CRONFILE=/opt/tier/tier-cron
+
+#set env vars for cron job
+/opt/tier/setenv.sh
+
+#build crontab file with random start time between midnight and 3:59am
+echo "#send daily beacon to TIER Central" > ${CRONFILE}
+echo $(expr $RANDOM % 59) $(expr $RANDOM % 3) "* * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1" >> ${CRONFILE}
+chmod 644 ${CRONFILE}
+
+#install crontab
+crontab ${CRONFILE}
+
+#create cron logfile
+touch /var/log/cron.log
+
+#start crond
+/usr/sbin/crond
+
+#from intermediate container's CMD directive
+/opt/bin/start.sh

From 5fe0185d772e41f3a72e5e47b00908ec74d0dac6 Mon Sep 17 00:00:00 2001
From: Paul Caskey <pcaskey@internet2.edu>
Date: Fri, 3 Mar 2017 14:29:15 -0600
Subject: [PATCH 076/105] add a few missing lines to Dockerfile

---
 Dockerfile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index f785421..3e2e8f3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,6 +20,7 @@ ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
 ARG version=1.0.6
+ARG tierversion=17020
 
 MAINTAINER $maintainer
 LABEL Vendor="Internet2"
@@ -60,6 +61,10 @@ RUN sed -i \
 RUN echo '<?php phpinfo(); ?>' > /var/www/html/index.php
 
 ENV VERSION=$version
+ENV TIERVERSION=$tierversion
+ENV IMAGENAME=$imagename
+ENV MAINTAINER=$maintainer
+
 ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$VERSION.tar.gz
 ENV COMANAGE_PREFIX=comanage-registry
 

From 80dd9363e29cb3924cd056bf18494e2bb4ac0a50 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Wed, 22 Mar 2017 16:10:56 -0600
Subject: [PATCH 077/105] Update configure_php_user.sh

---
 container_files/bin/configure_php_user.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh
index b3dae79..4903097 100755
--- a/container_files/bin/configure_php_user.sh
+++ b/container_files/bin/configure_php_user.sh
@@ -24,7 +24,7 @@ laststatus=$?
 if [ ! $laststatus -eq 0 ]; then
     cd /opt/comanage/comanage-registry-$VERSION/app
     echo "Performing database user setup" >> $log
-    ./Console/cake setup --admin-given-name ADMIN_GIVEN_NAME --admin-family-name ADMIN_FAMILY_NAME --admin-username ADMIN_EPPN --enable-pooling=No --force >> $log
+    ./Console/cake setup --admin-given-name ADMIN_NAME --admin-family-name ADMIN_FAMILY --admin-username ADMIN_USERNAME --enable-pooling=No --force >> $log
 else
     echo "table cm_users exists, skipping provisioning" >> $log
 fi

From cbe5ec484041e66bc94852715c8dce777f70865f Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Tue, 28 Mar 2017 09:47:29 -0400
Subject: [PATCH 078/105] Starting modifications for COmanage 2.0

---
 Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 3e2e8f3..be46c01 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,8 +19,8 @@ FROM tier/shibboleth_sp
 ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
-ARG version=1.0.6
-ARG tierversion=17020
+ARG version=2.0.0-rc2
+ARG tierversion=17030
 
 MAINTAINER $maintainer
 LABEL Vendor="Internet2"

From 387bbf1bedf9e29bf69df6020ed97581ffa3c031 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Tue, 28 Mar 2017 09:51:51 -0400
Subject: [PATCH 079/105] bumping version to 2.0.0-rc2

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index be46c01..6219764 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -134,7 +134,7 @@ RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf &&  \
     ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/local/Config/email.php && \
     rm -f /opt/comanage/comanage-registry-$version/app/Config/email.php && \
     ln -s /opt/etc/php/email.php  /opt/comanage/comanage-registry-$version/app/Config/email.php && \
-    ln -s /opt/comanage/comanage-registry-1.0.6/app/webroot /var/www/html/registry && \
+    ln -s /opt/comanage/comanage-registry-$VERSION/app/webroot /var/www/html/registry && \
     rm /etc/httpd/conf/httpd.conf && \
     ln -s /opt/etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf && \
     /opt/autoexec/bin/onbuild.sh

From f4cb4193aa94f88d837b6213292773a2dc1df1c1 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Tue, 28 Mar 2017 10:02:58 -0400
Subject: [PATCH 080/105] bumping version to 2.0.0-rc2

---
 common.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common.bash b/common.bash
index 29d2ecb..f499026 100644
--- a/common.bash
+++ b/common.bash
@@ -15,4 +15,4 @@
 #
 maintainer="bigfleet"
 imagename="comanage"
-version="1.0.6"
+version="2.0.0-rc2"

From 4669791651e3e1dc8d47d18138f237c70028334f Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Tue, 28 Mar 2017 10:18:58 -0400
Subject: [PATCH 081/105] updating default config values

---
 Dockerfile | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 6219764..ffd5989 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -96,12 +96,14 @@ RUN mkdir /opt/shared \
     && chmod +x /opt/autoexec/firstrun/*.sh \
     && chmod +x /opt/autoexec/onbuild/*.sh
 
-# Environment variables
-ENV ADMIN_GIVEN_NAME "Scott"
-ENV ADMIN_FAMILY_NAME "Koranda"
-ENV ADMIN_EPPN "scott.koranda@sphericalcowgroup.com"
-ENV COMANAGE_SERVER_FQDN "comanage.testbed.tier.internet2.edu"
-ENV COMANAGE_MAIL_FROM "comanage_registry@picard.cgac.uwm.edu"
+# Change the following values to match that of your deployment when doing a native COmanage Docker deployment.
+# If using the TIER COmanage Virtual Machine (https://testbed.tier.internet2.edu/), these values will be configured
+# with the setup script
+ENV ADMIN_GIVEN_NAME "Admin"
+ENV ADMIN_FAMILY_NAME "Adming"
+ENV ADMIN_EPPN "admin@example.edu"
+ENV COMANAGE_SERVER_FQDN "comanage.example.edu"
+ENV COMANAGE_MAIL_FROM "comanage_registry@comanage.example.edu"
 ENV COMANAGE_MAIL_HOST "localhost"
 ENV COMANAGE_MAIL_PORT "25"
 ENV COMANAGE_MAIL_USER "user"
@@ -109,9 +111,8 @@ ENV COMANAGE_MAIL_PASS "secret"
 ENV MYSQL_HOST "i2mariadb"
 ENV MYSQL_DATABASE "registry"
 ENV MYSQL_USER "registry_user"
-ENV MYSQL_PASSWORD "WJzesbe3poNZ91qIbmR7"
+ENV MYSQL_PASSWORD "mysql_password"
 ENV ADMIN_FAMILY_NAME "admin"
-ENV ADMIN_EPPN "admin"
 ENV ADMIN_GIVEN_NAME "admin"
 
 # How long will we wait for MariaDB to start up?

From abecd1d986be8bf6e5ac44a6b2f5624cca1bc21c Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Tue, 28 Mar 2017 21:37:34 -0400
Subject: [PATCH 082/105] Update configure_php_user.sh

---
 container_files/bin/configure_php_user.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/container_files/bin/configure_php_user.sh b/container_files/bin/configure_php_user.sh
index 4903097..4c1bb29 100755
--- a/container_files/bin/configure_php_user.sh
+++ b/container_files/bin/configure_php_user.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
 # Licensed to the University Corporation for Advanced Internet Development,
 # Inc. (UCAID) under one or more contributor license agreements.  See the
 # NOTICE file distributed with this work for additional information regarding

From bb366bc28776be5a4e56d50b9365579ebb3f851a Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Mon, 10 Apr 2017 16:39:50 -0400
Subject: [PATCH 083/105] export LD_LIBRARY_PATH do shibd can find libcurl

---
 Dockerfile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index ffd5989..a903013 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -60,6 +60,10 @@ RUN sed -i \
 
 RUN echo '<?php phpinfo(); ?>' > /var/www/html/index.php
 
+# Export this variable so that shibd can find it's CURL library
+RUN LD_LIBRARY_PATH="/opt/shibboleth/lib64"
+RUN export LD_LIBRARY_PATH
+
 ENV VERSION=$version
 ENV TIERVERSION=$tierversion
 ENV IMAGENAME=$imagename

From 140be7aa78f72d3406bbf1094712c2112384e6cc Mon Sep 17 00:00:00 2001
From: Paul Caskey <pcaskey@internet2.edu>
Date: Tue, 11 Apr 2017 15:13:59 -0500
Subject: [PATCH 084/105] Update Dockerfile

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index a903013..35da1cc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,7 +20,7 @@ ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
 ARG version=2.0.0-rc2
-ARG tierversion=17030
+ARG tierversion=17040
 
 MAINTAINER $maintainer
 LABEL Vendor="Internet2"

From 933f899b901db0374f4af4919014d3ea73c2f28f Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Thu, 13 Apr 2017 15:48:29 -0400
Subject: [PATCH 085/105] bumping version to 2.0.0

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 35da1cc..9f5375d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,7 +19,7 @@ FROM tier/shibboleth_sp
 ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
-ARG version=2.0.0-rc2
+ARG version=2.0.0
 ARG tierversion=17040
 
 MAINTAINER $maintainer

From e4f289c710d9bcf9099d9b9ad7e588d5a7db7cc2 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Mon, 24 Apr 2017 13:54:48 -0400
Subject: [PATCH 086/105] Point to tier Dockerhub REPO

---
 common.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common.bash b/common.bash
index f499026..3fd04ea 100644
--- a/common.bash
+++ b/common.bash
@@ -13,6 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-maintainer="bigfleet"
+maintainer="tier"
 imagename="comanage"
-version="2.0.0-rc2"
+version="2.0.0"

From 940bcdb64102b3ec5c4f7a722b0530dd177f43e2 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 16 Jun 2017 14:47:43 -0400
Subject: [PATCH 087/105] Version bump to 3.1.0 and changed to git

---
 Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 9f5375d..346a965 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,7 +19,7 @@ FROM tier/shibboleth_sp
 ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
-ARG version=2.0.0
+ARG version=3.1.0
 ARG tierversion=17040
 
 MAINTAINER $maintainer
@@ -73,7 +73,7 @@ ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$VERSION
 ENV COMANAGE_PREFIX=comanage-registry
 
 RUN mkdir -p /tmp/comanage && cd /tmp/comanage && \
-      wget -q $COMANAGE_URL && \
+      git clone -b feature-3.1 https://github.com/Internet2/comanage-registry.git && \
 # Perform verifications [TODO]
 # Prepare filesystem
       mkdir -p /opt/comanage && \

From 18fbd44a0594d552c62b69bb5f1029d91704b27a Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 16 Jun 2017 14:52:42 -0400
Subject: [PATCH 088/105] Install git

---
 Dockerfile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Dockerfile b/Dockerfile
index 346a965..86868c6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -48,6 +48,7 @@ RUN yum -y install --setopt=tsflags=nodocs \
     php-pear-MDB2-Driver-mysqli \
     php-pecl-memcached \
     php-xml \
+    git \
     vim && yum -y clean all
 
 #

From 1088b4abe0e5489d157652aa9c88df6098054e83 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 16 Jun 2017 16:27:20 -0400
Subject: [PATCH 089/105] Update Dockerfile

---
 Dockerfile | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 86868c6..abc0188 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -73,18 +73,13 @@ ENV MAINTAINER=$maintainer
 ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$VERSION.tar.gz
 ENV COMANAGE_PREFIX=comanage-registry
 
-RUN mkdir -p /tmp/comanage && cd /tmp/comanage && \
+RUN mkdir -p /opt/comanage && cd /opt/comanage && \
       git clone -b feature-3.1 https://github.com/Internet2/comanage-registry.git && \
-# Perform verifications [TODO]
-# Prepare filesystem
-      mkdir -p /opt/comanage && \
-      tar xf $VERSION.tar.gz && \
-      mv $COMANAGE_PREFIX-$VERSION /opt/comanage/. && \
-      ln -s /opt/comanage/$VERSION /opt/comanage/current && \
-      mkdir /var/cache/registry && \
+      mv comanage-registry $COMANAGE_PREFIX-$VERSION && \
+      ln -s /opt/comanage/$COMANAGE_PREFIX-$VERSION  /opt/comanage/current && \
       ln -s /var/cache/registry /opt/comanage/$COMANAGE_PREFIX-$VERSION/local/tmp &&  \
-# # Cleanup
-            rm -rf /tmp/comanage
+      chown -R apache /var/cache/registry && \
+      chmod -R 700 /var/cache/registry
 
 ENV COMANAGE_HOME /opt/comanage/current
 

From 8f7bfe86b500a8d974a268a3e32cf3bc30ddda7f Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 16 Jun 2017 16:38:21 -0400
Subject: [PATCH 090/105] Update Dockerfile

---
 Dockerfile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index abc0188..4f588e1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -77,9 +77,11 @@ RUN mkdir -p /opt/comanage && cd /opt/comanage && \
       git clone -b feature-3.1 https://github.com/Internet2/comanage-registry.git && \
       mv comanage-registry $COMANAGE_PREFIX-$VERSION && \
       ln -s /opt/comanage/$COMANAGE_PREFIX-$VERSION  /opt/comanage/current && \
-      ln -s /var/cache/registry /opt/comanage/$COMANAGE_PREFIX-$VERSION/local/tmp &&  \
+      mkdir /var/cache/registry && \
+      cp -r /opt/comanage/current/app/tmp.dist /var/cache/registry && \
       chown -R apache /var/cache/registry && \
-      chmod -R 700 /var/cache/registry
+      chmod -R 700 /var/cache/registry && \
+      ln -s /var/cache/registry /opt/comanage/current/local tmp
 
 ENV COMANAGE_HOME /opt/comanage/current
 

From 120787447c47e26319cc7c630009ff2815bfa290 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 16 Jun 2017 16:39:33 -0400
Subject: [PATCH 091/105] Update Dockerfile

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 4f588e1..9490f77 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -81,7 +81,7 @@ RUN mkdir -p /opt/comanage && cd /opt/comanage && \
       cp -r /opt/comanage/current/app/tmp.dist /var/cache/registry && \
       chown -R apache /var/cache/registry && \
       chmod -R 700 /var/cache/registry && \
-      ln -s /var/cache/registry /opt/comanage/current/local tmp
+      ln -s /var/cache/registry /opt/comanage/current/local/tmp
 
 ENV COMANAGE_HOME /opt/comanage/current
 

From c24bf7c71086041aecef3213aeb8ecfd2202079e Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Wed, 12 Jul 2017 15:27:03 -0400
Subject: [PATCH 092/105] bumping release number to 17070

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 9f5375d..3850182 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,7 +20,7 @@ ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
 ARG version=2.0.0
-ARG tierversion=17040
+ARG tierversion=17070
 
 MAINTAINER $maintainer
 LABEL Vendor="Internet2"

From e6eb248c62b23e0b797aaf31dcb83e6a17d4ae25 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 4 Aug 2017 13:16:06 -0400
Subject: [PATCH 093/105] updating to feature-3.1 branch for sf patch test

---
 Dockerfile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Dockerfile b/Dockerfile
index 9490f77..f7f1c73 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -73,6 +73,7 @@ ENV MAINTAINER=$maintainer
 ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$VERSION.tar.gz
 ENV COMANAGE_PREFIX=comanage-registry
 
+# Note using git to grab this alternate feature branch
 RUN mkdir -p /opt/comanage && cd /opt/comanage && \
       git clone -b feature-3.1 https://github.com/Internet2/comanage-registry.git && \
       mv comanage-registry $COMANAGE_PREFIX-$VERSION && \

From e3362a18b1dacd4dc53ed4ee237decd0300855ea Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Mon, 25 Sep 2017 08:08:16 -0400
Subject: [PATCH 094/105] changing branch from 3.1-feature to develop

As per BennO post on comanage list.
---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index f7f1c73..6b442d8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -75,7 +75,7 @@ ENV COMANAGE_PREFIX=comanage-registry
 
 # Note using git to grab this alternate feature branch
 RUN mkdir -p /opt/comanage && cd /opt/comanage && \
-      git clone -b feature-3.1 https://github.com/Internet2/comanage-registry.git && \
+      git clone -b develop https://github.com/Internet2/comanage-registry.git && \
       mv comanage-registry $COMANAGE_PREFIX-$VERSION && \
       ln -s /opt/comanage/$COMANAGE_PREFIX-$VERSION  /opt/comanage/current && \
       mkdir /var/cache/registry && \

From f6407820d5e26ebb51f2f19cfbab48b584719240 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 13 Oct 2017 10:34:11 -0400
Subject: [PATCH 095/105] Update Dockerfile

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 6b442d8..4dc8462 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -73,7 +73,7 @@ ENV MAINTAINER=$maintainer
 ENV COMANAGE_URL=https://github.com/Internet2/comanage-registry/archive/$VERSION.tar.gz
 ENV COMANAGE_PREFIX=comanage-registry
 
-# Note using git to grab this alternate feature branch
+# Note using git to grab this alternate develop branch
 RUN mkdir -p /opt/comanage && cd /opt/comanage && \
       git clone -b develop https://github.com/Internet2/comanage-registry.git && \
       mv comanage-registry $COMANAGE_PREFIX-$VERSION && \

From 08ad5c44852e7eb0ca48dd263296f0364d9efcb4 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Thu, 15 Feb 2018 14:59:18 -0500
Subject: [PATCH 096/105] Updating to official COmanage 3.1.0 release

---
 Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 4dc8462..6072803 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,7 +20,7 @@ ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
 ARG version=3.1.0
-ARG tierversion=17040
+ARG tierversion=18020
 
 MAINTAINER $maintainer
 LABEL Vendor="Internet2"
@@ -75,7 +75,7 @@ ENV COMANAGE_PREFIX=comanage-registry
 
 # Note using git to grab this alternate develop branch
 RUN mkdir -p /opt/comanage && cd /opt/comanage && \
-      git clone -b develop https://github.com/Internet2/comanage-registry.git && \
+      wget -q $COMANAGE_URL && \ && \
       mv comanage-registry $COMANAGE_PREFIX-$VERSION && \
       ln -s /opt/comanage/$COMANAGE_PREFIX-$VERSION  /opt/comanage/current && \
       mkdir /var/cache/registry && \

From dea4e3cf3104fc6fca56c4e66651630f4d20d4f5 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Thu, 15 Feb 2018 15:02:23 -0500
Subject: [PATCH 097/105] Update Dockerfile

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 6072803..3b7dbfd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -75,7 +75,7 @@ ENV COMANAGE_PREFIX=comanage-registry
 
 # Note using git to grab this alternate develop branch
 RUN mkdir -p /opt/comanage && cd /opt/comanage && \
-      wget -q $COMANAGE_URL && \ && \
+      wget -q $COMANAGE_URL && \
       mv comanage-registry $COMANAGE_PREFIX-$VERSION && \
       ln -s /opt/comanage/$COMANAGE_PREFIX-$VERSION  /opt/comanage/current && \
       mkdir /var/cache/registry && \

From 7acb6fbc661c397ad9aa774d8882db64bc57571b Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Thu, 15 Feb 2018 15:13:15 -0500
Subject: [PATCH 098/105] Update Dockerfile

---
 Dockerfile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 3b7dbfd..787e3d1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -76,7 +76,6 @@ ENV COMANAGE_PREFIX=comanage-registry
 # Note using git to grab this alternate develop branch
 RUN mkdir -p /opt/comanage && cd /opt/comanage && \
       wget -q $COMANAGE_URL && \
-      mv comanage-registry $COMANAGE_PREFIX-$VERSION && \
       ln -s /opt/comanage/$COMANAGE_PREFIX-$VERSION  /opt/comanage/current && \
       mkdir /var/cache/registry && \
       cp -r /opt/comanage/current/app/tmp.dist /var/cache/registry && \

From 7ff9979265433ad12d260f366b3ceacac5f15801 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Thu, 15 Feb 2018 15:15:12 -0500
Subject: [PATCH 099/105] Update Dockerfile

---
 Dockerfile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Dockerfile b/Dockerfile
index 787e3d1..aa00036 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -76,6 +76,7 @@ ENV COMANAGE_PREFIX=comanage-registry
 # Note using git to grab this alternate develop branch
 RUN mkdir -p /opt/comanage && cd /opt/comanage && \
       wget -q $COMANAGE_URL && \
+      tar xf $VERSION.tar.gz && \
       ln -s /opt/comanage/$COMANAGE_PREFIX-$VERSION  /opt/comanage/current && \
       mkdir /var/cache/registry && \
       cp -r /opt/comanage/current/app/tmp.dist /var/cache/registry && \

From 3d071abafe3bf698f3a30742930c79bcb469f40b Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Wed, 4 Apr 2018 11:36:54 -0400
Subject: [PATCH 100/105] Update Dockerfile

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index aa00036..03915c3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,7 +20,7 @@ ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
 ARG version=3.1.0
-ARG tierversion=18020
+ARG tierversion=180401
 
 MAINTAINER $maintainer
 LABEL Vendor="Internet2"

From 678419be988c5453e79ab64d900013a303856e2e Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Wed, 30 May 2018 16:09:15 -0400
Subject: [PATCH 101/105] update to comanage 3.1.1

---
 Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index b7b4a7d..29ede49 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,8 +19,8 @@ FROM tier/shibboleth_sp
 ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
-ARG version=3.1.0
-ARG tierversion=180401
+ARG version=3.1.1
+ARG tierversion=180500
 
 
 MAINTAINER $maintainer

From 63aa8779ee80fae610c6e358d35aff63e7cf5f9c Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Wed, 20 Jun 2018 14:06:32 -0400
Subject: [PATCH 102/105] Update common.bash

---
 common.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common.bash b/common.bash
index 3fd04ea..857092c 100644
--- a/common.bash
+++ b/common.bash
@@ -15,4 +15,4 @@
 #
 maintainer="tier"
 imagename="comanage"
-version="2.0.0"
+version="3.1.0"

From 8b99c4676447501aff693ac22149ae7dbc7b7799 Mon Sep 17 00:00:00 2001
From: Paul Caskey <pcaskey@internet2.edu>
Date: Tue, 3 Jul 2018 15:33:59 -0500
Subject: [PATCH 103/105] update version

---
 common.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common.bash b/common.bash
index 857092c..788cb62 100644
--- a/common.bash
+++ b/common.bash
@@ -15,4 +15,4 @@
 #
 maintainer="tier"
 imagename="comanage"
-version="3.1.0"
+version="3.1.1"

From 7651562e6f9a7a5fb77d9d92e7b236558044c9c4 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 3 Aug 2018 11:38:51 -0400
Subject: [PATCH 104/105] 3.1.1

---
 Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index b7b4a7d..4f5bae3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,8 +19,8 @@ FROM tier/shibboleth_sp
 ARG registry=docker.io
 ARG maintainer=tier
 ARG imagename=comanage
-ARG version=3.1.0
-ARG tierversion=180401
+ARG version=3.1.1
+ARG tierversion=180801
 
 
 MAINTAINER $maintainer

From a02571be98c26a8cd1e9bcb236affdaf184cf1b0 Mon Sep 17 00:00:00 2001
From: Christopher Hubing <chubing@internet2.edu>
Date: Fri, 3 Aug 2018 11:39:05 -0400
Subject: [PATCH 105/105] Update common.bash

---
 common.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common.bash b/common.bash
index 3fd04ea..788cb62 100644
--- a/common.bash
+++ b/common.bash
@@ -15,4 +15,4 @@
 #
 maintainer="tier"
 imagename="comanage"
-version="2.0.0"
+version="3.1.1"