Make Container Config Strategy 17/56417/1
authorInstrumental <jonathan.gathman@att.com>
Fri, 13 Jul 2018 20:49:26 +0000 (15:49 -0500)
committerInstrumental <jonathan.gathman@att.com>
Fri, 13 Jul 2018 20:59:11 +0000 (15:59 -0500)
Issue-ID: AAF-378
Change-Id: I57186f66b9713262643e0f440f5b9eb78154c155
Signed-off-by: Instrumental <jonathan.gathman@att.com>
33 files changed:
auth/auth-cass/docker/dinstall.sh
auth/auth-cass/src/main/cql/init.cql
auth/auth-certman/pom.xml
auth/auth-fs/pom.xml
auth/auth-gui/pom.xml
auth/auth-hello/pom.xml
auth/auth-locate/pom.xml
auth/auth-oauth/pom.xml
auth/auth-service/pom.xml
auth/docker/.gitignore
auth/docker/Dockerfile [deleted file]
auth/docker/Dockerfile.config
auth/docker/Dockerfile.ms
auth/docker/README.txt [new file with mode: 0644]
auth/docker/agent.sh
auth/docker/dbounce.sh [new file with mode: 0644]
auth/docker/dbuild.sh
auth/docker/dclean.sh
auth/docker/dpush.sh
auth/docker/drun.sh
auth/docker/dstart.sh
auth/docker/dstop.sh
auth/pom.xml
auth/sample/.gitignore [new file with mode: 0644]
auth/sample/bin/agent.sh
auth/sample/etc/org.osaaf.aaf.cm.props
auth/sample/local/.dockerignore [new file with mode: 0644]
auth/sample/local/.gitignore
auth/sample/local/aaf.props
auth/sample/local/org.osaaf.aaf.cassandra.props
auth/sample/local/org.osaaf.aaf.cm.ca.props
conf/CA/newCA.sh [moved from conf/CA/newca.sh with 96% similarity]
conf/CA/newIntermediate.sh

index 44ee713..bdbadf6 100644 (file)
@@ -7,11 +7,24 @@ else
   echo Docker not available in /usr/bin or /usr/local/bin
   exit
 fi
+
+if [ "$($DOCKER volume ls | grep aaf_cass_data)" = "" ]; then
+  $DOCKER volume create aaf_cass_data
+  echo "Created Cassandra Volume aaf_cass_data"
+fi
+
 echo "Running DInstall"
 if [ "`$DOCKER ps -a | grep aaf_cass`" == "" ]; then
   echo "starting Cass from 'run'"
   # NOTE: These HEAP Sizes are minimal. Not set for full organizations.
-  $DOCKER run --name aaf_cass -e HEAP_NEWSIZE=512M -e MAX_HEAP_SIZE=1024M -e CASSANDRA_DC=dc1 -e CASSANDRA_CLUSTER_NAME=osaaf -d cassandra:3.11 
+  $DOCKER run \
+    --name aaf_cass \
+    -e HEAP_NEWSIZE=512M \
+    -e MAX_HEAP_SIZE=1024M \
+    -e CASSANDRA_DC=dc1 \
+    -e CASSANDRA_CLUSTER_NAME=osaaf \
+    --mount 'type=volume,src=aaf_cass_data,dst=/var/lib/cassandra,volume-driver=local' \
+    -d cassandra:3.11 
   # Set on local Disk
   # -v /opt/app/cass:/var/lib/cassandra 
   echo "aaf_cass Starting"
index c06e5ee..bf75998 100644 (file)
@@ -264,3 +264,10 @@ CREATE TABLE run_lock (
   start timestamp,
   PRIMARY KEY ((class))
 );
+
+CREATE TABLE config (
+  name          varchar,
+  tag           varchar,
+  value         varchar,
+  PRIMARY KEY (name,tag)
+);
index f0dc08f..26c3c67 100644 (file)
                                                        <mainClass>org.onap.aaf.auth.cm.AAF_CM</mainClass>
                                                        <name>cm</name>
                                                        <commandLineArguments>
-                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.cm.props</commandLineArgument>
+                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.aaf.cm.props</commandLineArgument>
                                                                <commandLineArgument>cadi_log_dir=${project.ext_root_dir}/logs/cm</commandLineArgument>
                                                        </commandLineArguments>
                                                </program>
index 0559bed..93b55e9 100644 (file)
                                                        <mainClass>org.onap.aaf.auth.fs.AAF_FS</mainClass>
                                                        <name>fs</name>
                                                        <commandLineArguments>
-                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.fs.props</commandLineArgument>
+                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.aaf.fs.props</commandLineArgument>
                                                                <commandLineArgument>cadi_log_dir=${project.ext_root_dir}/logs/fs</commandLineArgument>
+                                                               <commandLineArgument>cadi_etc_dir=${project.ext_root_dir}/etc</commandLineArgument>
                                                        </commandLineArguments>
                                                </program>
                                        </programs>
index 6b02437..dde1a5d 100644 (file)
                                                        <mainClass>org.onap.aaf.auth.gui.AAF_GUI</mainClass>
                                                        <name>gui</name>
                                                        <commandLineArguments>
-                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.gui.props</commandLineArgument>
+                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.aaf.gui.props</commandLineArgument>
                                                                <commandLineArgument>cadi_log_dir=${project.ext_root_dir}/logs/gui</commandLineArgument>
+                                                               <commandLineArgument>cadi_etc_dir=${project.ext_root_dir}/etc</commandLineArgument>
                                                        </commandLineArguments>
                                                        <jvmSettings>
                                                                <extraArguments>
index b913b6c..db732a6 100644 (file)
@@ -89,8 +89,9 @@
                                                        <mainClass>org.onap.aaf.auth.hello.AAF_Hello</mainClass>
                                                        <name>hello</name>
                                                        <commandLineArguments>
-                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.hello.props</commandLineArgument>
+                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.aaf.hello.props</commandLineArgument>
                                                                <commandLineArgument>cadi_log_dir=${project.ext_root_dir}/logs/hello</commandLineArgument>
+                                                               <commandLineArgument>cadi_etc_dir=${project.ext_root_dir}/etc</commandLineArgument>
                                                        </commandLineArguments>
                                                </program>
                                        </programs>
index 13640b5..76fe2a1 100644 (file)
                                                        <mainClass>org.onap.aaf.auth.locate.AAF_Locate</mainClass>
                                                        <id>locate</id>
                                                        <commandLineArguments>
-                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.locate.props</commandLineArgument>
+                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.aaf.locate.props</commandLineArgument>
                                                                <commandLineArgument>cadi_log_dir=${project.ext_root_dir}/logs/locate</commandLineArgument>
+                                                               <commandLineArgument>cadi_etc_dir=${project.ext_root_dir}/etc</commandLineArgument>
                                                        </commandLineArguments>
                                                </program>
                                        </programs>
index 6510070..fdd236a 100644 (file)
@@ -92,8 +92,9 @@
                                                        <mainClass>org.onap.aaf.auth.oauth.AAF_OAuth</mainClass>
                                                        <name>oauth</name>
                                                        <commandLineArguments>
-                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.oauth.props</commandLineArgument>
+                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.aaf.oauth.props</commandLineArgument>
                                                                <commandLineArgument>cadi_log_dir=${project.ext_root_dir}/logs/oauth</commandLineArgument>
+                                                               <commandLineArgument>cadi_etc_dir=${project.ext_root_dir}/etc</commandLineArgument>
                                                        </commandLineArguments>
                                                </program>
                                        </programs>
index 244e1e8..6ad719b 100644 (file)
                                                        <mainClass>org.onap.aaf.auth.service.AAF_Service</mainClass>
                                                        <name>service</name>
                                                        <commandLineArguments>
-                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.service.props</commandLineArgument>
+                                                               <commandLineArgument>cadi_prop_files=${project.ext_root_dir}/etc/org.osaaf.aaf.service.props</commandLineArgument>
                                                                <commandLineArgument>cadi_log_dir=${project.ext_root_dir}/logs/service</commandLineArgument>
+                                                               <commandLineArgument>cadi_etc_dir=${project.ext_root_dir}/etc</commandLineArgument>
                                                        </commandLineArguments>
                                                </program>
                                        </programs>
index f08acc7..a03737d 100644 (file)
@@ -1 +1,2 @@
+local
 d.props
diff --git a/auth/docker/Dockerfile b/auth/docker/Dockerfile
deleted file mode 100644 (file)
index d744d69..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-FROM rmannfv/aaf-base:xenial
-MAINTAINER AAF Team, AT&T 2018
-ENV VERSION=${AAF_VERSION}
-
-LABEL description="aaf ${AAF_COMPONENT}"
-LABEL version=${AAF_VERSION}
-
-
-COPY lib /opt/app/aaf/${AAF_COMPONENT}/lib
-COPY theme /opt/app/aaf/${AAF_COMPONENT}/theme
-COPY bin /opt/app/aaf/${AAF_COMPONENT}/bin
-
-CMD ["/bin/bash","-c","/opt/app/aaf/${AAF_COMPONENT}/bin/${AAF_COMPONENT}"]
-
-# For Debugging installation
-# CMD ["/bin/bash","-c","pwd;cd /opt/app/osaaf;find /opt/app/osaaf -depth;df -k; cat /opt/app/aaf/${AAF_COMPONENT}/bin/${AAF_COMPONENT};cat /etc/hosts;/opt/app/aaf/${AAF_COMPONENT}/bin/${AAF_COMPONENT}"]
-# Java Debugging VM Args
-#     "-Xdebug",\
-#     "-Xnoagent",\
-#     "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000",\
-
-# TLS Debugging VM Args
-#     "-Djavax.net.debug","ssl", \
-     
index a5811e0..1855fae 100644 (file)
@@ -7,7 +7,7 @@ LABEL version=${AAF_VERSION}
 
 COPY data/sample.identities.dat /opt/app/aaf_config/data/
 COPY etc /opt/app/aaf_config/etc
-COPY local/*.props /opt/app/aaf_config/local/
+COPY local /opt/app/aaf_config/local
 COPY public /opt/app/aaf_config/public
 COPY logs /opt/app/aaf_config/logs
 COPY bin /opt/app/aaf_config/bin
index 121bd06..b8ef6d9 100644 (file)
@@ -5,6 +5,8 @@ ENV VERSION=${AAF_VERSION}
 LABEL description="aaf_${AAF_COMPONENT}"
 LABEL version=${AAF_VERSION}
 
+COPY theme /opt/app/aaf/theme
+
 CMD ["/bin/bash","-c","/opt/app/aaf/bin/${AAF_COMPONENT}"]
 
 # For Debugging installation
diff --git a/auth/docker/README.txt b/auth/docker/README.txt
new file mode 100644 (file)
index 0000000..32ed348
--- /dev/null
@@ -0,0 +1,31 @@
+# Start the container in bash mode, so it stays up
+sh agent.sh bash
+
+
+# in another shell, find out your Container name
+docker container ls | grep aaf_agent
+
+# copy keystore for this AAF Env 
+docker container cp -L org.osaaf.aaf.p12 <Your Container>:/opt/app/osaaf/local
+# (in Agent Window)
+agent encrypt cadi_keystore_password
+
+# If you intend to use Certman to sign certs, it is a "local" CA
+# copy Signing Keystore into container
+docker container cp -L org.osaaf.aaf.signer.p12 <Your Container>:/opt/app/osaaf/local
+# (in Agent Window)
+agent encrypt cm_ca.local 
+
+# Add in Cassandra Password 
+agent encrypt cassandra.clusters.password
+
+# Check to make sure all passwords are set
+grep "enc:" *.props
+
+
+# When good, run AAF
+bash drun.sh
+
+# watch logs in Agent Window
+cd ../logs
+sh taillog
index 6802794..f734c62 100644 (file)
@@ -1,9 +1,12 @@
 #!/bin/bash
 . ./d.props
+
 docker run \
-  -it \
-  --mount 'type=volume,src=aaf_config,dst=/opt/app/osaaf,volume-driver=local' \
-  --name aaf_agent_$USER \
-  ${ORG}/${PROJECT}/aaf_config:${VERSION} \
-  /bin/bash $*
-docker container rm aaf_agent_$USER > /dev/null
+    -it \
+    --rm \
+    --mount 'type=volume,src=aaf_config,dst='$CONF_ROOT_DIR',volume-driver=local' \
+    --add-host="$HOSTNAME:$HOST_IP" \
+    --add-host="aaf.osaaf.org:$HOST_IP" \
+    --name aaf_agent_$USER \
+    ${ORG}/${PROJECT}/aaf_config:${VERSION} \
+    /bin/bash "$@"
diff --git a/auth/docker/dbounce.sh b/auth/docker/dbounce.sh
new file mode 100644 (file)
index 0000000..e636795
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+sh ./dstop.sh "$@"
+sh ./dstart.sh "$@"
index ec5cd5c..ba7a809 100755 (executable)
@@ -1,46 +1,42 @@
-#!/bin/bash 
+#!/bin/bash
 #
 # Docker Building Script.  Reads all the components generated by install, on per-version basis
 #
 # Pull in Variables from d.props
 if [ ! -e ./d.props ]; then
-  cp d.props.init d.props
+    cp d.props.init d.props
 fi
 
 . ./d.props
 
 # Create the Config (Security) Image
-sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.config  > ../sample/Dockerfile
+sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.config >../sample/Dockerfile
 cd ..
 cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin
 docker build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
 rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
 cd -
 
-exit
-
 # Second, build a core Docker Image
 echo Building aaf_$AAF_COMPONENT...
 # Apply currrent Properties to Docker file, and put in place.
-sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core > ../aaf_${VERSION}/Dockerfile
+sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile
 cd ..
 docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
 rm aaf_${VERSION}/Dockerfile
 cd -
 
 if ["$1" == ""]; then
-  AAF_COMPONENTS=`ls ../aaf_*HOT/bin | grep -v '\.'`
+    AAF_COMPONENTS=$(ls ../aaf_*HOT/bin | grep -v '\.')
 else
-  AAF_COMPONENTS=$1
+    AAF_COMPONENTS=$1
 fi
 
 for AAF_COMPONENT in ${AAF_COMPONENTS}; do
-        echo Building aaf_$AAF_COMPONENT...
-        sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms > ../aaf_${VERSION}/Dockerfile
-        cd ..
-        docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}  aaf_${VERSION}
-        rm aaf_${VERSION}/Dockerfile
-        cd -
+    echo Building aaf_$AAF_COMPONENT...
+    sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile
+    cd ..
+    docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
+    rm aaf_${VERSION}/Dockerfile
+    cd -
 done
-
-
index 163272d..0bca9ef 100644 (file)
@@ -1,17 +1,18 @@
-#!/bin/bash 
+#!/bin/bash
 # Pull in Variables from d.props
 . ./d.props
 
 if [ "$1" == "" ]; then
-  AAF_COMPONENTS=`ls ../aaf_${VERSION}/bin | grep -v '\.'`
+    AAF_COMPONENTS=$(ls ../aaf_${VERSION}/bin | grep -v '\.')
 else
-  AAF_COMPONENTS=$1
+    AAF_COMPONENTS=$1
 fi
 
+docker image rm $ORG/$PROJECT/aaf_config:${VERSION}
 docker image rm $ORG/$PROJECT/aaf_core:${VERSION}
 
 echo "Y" | docker container prune
 for AAF_COMPONENT in ${AAF_COMPONENTS}; do
-  docker image rm $ORG/$PROJECT/aaf_$AAF_COMPONENT:${VERSION}
+    docker image rm $ORG/$PROJECT/aaf_$AAF_COMPONENT:${VERSION}
 done
 echo "Y" | docker image prune
index 7812979..761ae2a 100644 (file)
@@ -12,7 +12,7 @@ fi
 
 for AAF_COMPONENT in ${AAF_COMPONENTS}; do
         docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${OLD_VERSION}
-               docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
-               docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${NEW_VERSION}
+        docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
+        docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${NEW_VERSION}
 
 done
index a7378b7..c62adfc 100644 (file)
@@ -1,65 +1,52 @@
-#!/bin/bash 
+#!/bin/bash
 # Pull in Variables from d.props
 . ./d.props
 
-# Create Volumes, if not exist already
-for VOL in aaf_config aaf_cass_data; do
-  HAS_VOLUME=`docker volume ls | grep $VOL`
-  if [ "$HAS_VOLUME" = "" ]; then
-    docker volume create --name $VOL
-  fi
-done
-       docker run  \
-          -d \
-          --name aaf_config \
-          --mount 'type=volume,src=aaf_config,dst=/opt/app/osaaf,volume-driver=local' \
-          ${ORG}/${PROJECT}/aaf_agent:${VERSION}
-
 if [ "$1" == "" ]; then
-  AAF_COMPONENTS=`ls -r ../aaf_${VERSION}/bin | grep -v '\.'`
+    AAF_COMPONENTS=$(ls -r ../aaf_${VERSION}/bin | grep -v '\.')
 else
-  AAF_COMPONENTS=$1
+    AAF_COMPONENTS="$@"
 fi
-  
-for AAF_COMPONENT in ${AAF_COMPONENTS}; do 
-       case "$AAF_COMPONENT" in
-               "service") 
-                       PORTMAP="8100:8100"
-                       LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
-                       ;;
-               "locate") 
-                       PORTMAP="8095:8095"
-                       LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
-                       ;;
-               "oauth") 
-                       PORTMAP="8140:8140"
-                       LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
-                       ;;
-               "gui") 
-                       PORTMAP="8200:8200"
-                       ;;
-               "cm") 
-                       PORTMAP="8150:8150"
-                       LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
-                       ;;
-               "hello") 
-                       PORTMAP="8130:8130"
-                       ;;
-               "fs") 
-                       PORTMAP="80:8096"
-                       ;;
-       esac
-       
-       echo Starting aaf_$AAF_COMPONENT...
 
-       docker run  \
-         -d \
-         --name aaf_$AAF_COMPONENT \
-         --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
-         --add-host="$HOSTNAME:$HOST_IP" \
-         --add-host="aaf.osaaf.org:$HOST_IP" \
-         ${LINKS} \
-         --publish $PORTMAP \
-         --mount type=bind,source=$CONF_ROOT_DIR,target=/opt/app/osaaf \
-         ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} 
+for AAF_COMPONENT in ${AAF_COMPONENTS}; do
+    case "$AAF_COMPONENT" in
+    "service")
+        PORTMAP="8100:8100"
+        LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
+        ;;
+    "locate")
+        PORTMAP="8095:8095"
+        LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
+        ;;
+    "oauth")
+        PORTMAP="8140:8140"
+        LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
+        ;;
+    "gui")
+        PORTMAP="8200:8200"
+        ;;
+    "cm")
+        PORTMAP="8150:8150"
+        LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
+        ;;
+    "hello")
+        PORTMAP="8130:8130"
+        ;;
+    "fs")
+        PORTMAP="80:8096"
+        ;;
+    esac
+
+    echo Starting aaf_$AAF_COMPONENT...
+
+    docker run \
+        -d \
+        --name aaf_$AAF_COMPONENT \
+        --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
+        --add-host="$HOSTNAME:$HOST_IP" \
+        --add-host="aaf.osaaf.org:$HOST_IP" \
+        ${LINKS} \
+        --publish $PORTMAP \
+        --mount 'type=volume,src=aaf_config,dst='$CONF_ROOT_DIR',volume-driver=local' \
+        ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
 done
index ae6ed02..4c0a46f 100644 (file)
@@ -1,14 +1,13 @@
-#!/bin/bash 
+#!/bin/bash
 # Pull in Props
 . ./d.props
 
-
 if [ "$1" == "" ]; then
-  AAF_COMPONENTS=`ls -r ../aaf_${VERSION}/bin | grep -v '\.'`
+    AAF_COMPONENTS=$(ls -r ../aaf_${VERSION}/bin | grep -v '\.')
 else
-  AAF_COMPONENTS=$1
+    AAF_COMPONENTS="$@"
 fi
 
 for AAF_COMPONENT in ${AAF_COMPONENTS}; do
-  docker start aaf_$AAF_COMPONENT
+    docker start aaf_$AAF_COMPONENT
 done
index 4c8d442..c6e1cfe 100644 (file)
@@ -1,13 +1,13 @@
-#!/bin/bash 
+#!/bin/bash
 # Pull in Properties
 . ./d.props
 
 if [ "$1" == "" ]; then
-  AAF_COMPONENTS=`ls ../aaf_${VERSION}/bin | grep -v '\.'`
+    AAF_COMPONENTS=$(ls ../aaf_${VERSION}/bin | grep -v '\.')
 else
-  AAF_COMPONENTS=$1
+    AAF_COMPONENTS="$@"
 fi
 
 for AAF_COMPONENT in ${AAF_COMPONENTS}; do
-  docker stop aaf_$AAF_COMPONENT
+    docker stop aaf_$AAF_COMPONENT
 done
index 193565d..8e6045c 100644 (file)
@@ -57,9 +57,7 @@
                <!-- We have to up these versions from the original to avoid Security Errors -->
                <project.cassVersion>3.4.0</project.cassVersion>
                <project.nettyVersion>4.1.22.Final</project.nettyVersion>
-               <!--
-               <project.cassVersion>3.3.0</project.cassVersion>
-               <project.nettyVersion>4.0.47.Final</project.nettyVersion> -->
+               <project.project.ext_root_dir>/opt/app/osaaf</project.project.ext_root_dir>
        </properties>
 
        <developers>
diff --git a/auth/sample/.gitignore b/auth/sample/.gitignore
new file mode 100644 (file)
index 0000000..62fd177
--- /dev/null
@@ -0,0 +1 @@
+theme
index b4ea272..5d34a8a 100644 (file)
@@ -1,3 +1,4 @@
+#!/bin/bash
 # This script is run when starting aaf_config Container.
 #  It needs to cover the cases where the initial data doesn't exist, and when it has already been configured (don't overwrite)
 #
@@ -5,81 +6,121 @@ JAVA=/usr/bin/java
 
 # Only load Identities once
 if [ ! -e /opt/app/osaaf/data/identities.dat ]; then
-  mkdir -p /opt/app/osaaf/data
-  cp /opt/app/aaf_config/data/sample.identities.dat /opt/app/osaaf/data/identities.dat
+    mkdir -p /opt/app/osaaf/data
+    cp /opt/app/aaf_config/data/sample.identities.dat /opt/app/osaaf/data/identities.dat
 fi
 
 # Only initialize once, automatically...
 if [ ! -e /opt/app/osaaf/local/org.osaaf.aaf.props ]; then
-  for D in local; do
-    rsync -avzh /opt/app/aaf_config/$D/org.osaaf.aaf* /opt/app/osaaf/$D
-  done
-  for D in public etc logs; do 
-     rsync -avzh --exclude=.gitignore /opt/app/aaf_config/$D/* /opt/app/osaaf/$D
-  done
-  $JAVA -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar config osaaf@aaf.osaaf.org \
-    cadi_etc_dir=/opt/app/osaaf/local \
-    cadi_prop_files=/opt/app/aaf_config/local/initialConfig.props:/opt/app/aaf_config/local/aaf.props \
-    cadi_latitude=38.4329 \
-    cadi_longitude=-90.43248
-  #cp /opt/app/aaf_config/
-else
-  CMD=$2
-  shift
-  if [ "$CMD" = "" ]; then
-    echo "AAF already configured for this Volume"
-  else
+    rsync -avzh --exclude=.gitignore /opt/app/aaf_config/local/org.osaaf.aaf* /opt/app/osaaf/local
+    for D in public etc logs; do
+        rsync -avzh --exclude=.gitignore /opt/app/aaf_config/$D/* /opt/app/osaaf/$D
+    done
+    $JAVA -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar config osaaf@aaf.osaaf.org \
+        cadi_etc_dir=/opt/app/osaaf/local \
+        cadi_prop_files=/opt/app/aaf_config/local/initialConfig.props:/opt/app/aaf_config/local/aaf.props \
+        cadi_latitude=38.4329 \
+        cadi_longitude=-90.43248
+fi
+
+# Now run a command
+CMD=$2
+if [ ! "$CMD" = "" ]; then
+    shift
+    shift
     case "$CMD" in
-      ls)
-       echo ls requested
-       find /opt/app/osaaf -depth
-       ;;
-      cat) 
-       if [ "$1" = "" ]; then
-         echo "usage: cat <file... ONLY files ending in .props>"
-        else 
-         if [[ $1 == *.props ]]; then
-           echo 
-            echo "## CONTENTS OF $3"
-            echo
-            cat $1
-         else
-           echo "### ERROR ####"
-           echo "   \"cat\" may only be used with files ending with \".props\""
-         fi
+    ls)
+        echo ls requested
+        find /opt/app/osaaf -depth
+        ;;
+    cat)
+        if [ "$1" = "" ]; then
+            echo "usage: cat <file... ONLY files ending in .props>"
+        else
+            if [[ $1 == *.props ]]; then
+                echo
+                echo "## CONTENTS OF $3"
+                echo
+                cat "$1"
+            else
+                echo "### ERROR ####"
+                echo "   \"cat\" may only be used with files ending with \".props\""
+            fi
         fi
-       ;;      
-      update)
-        for D in public data etc local logs; do 
-          rsync -uh --exclude=.gitignore /opt/app/aaf_config/$D /opt/app/osaaf
+        ;;
+    update)
+        rsync -uh --exclude=.gitignore /opt/app/aaf_config/local/org.osaaf.aaf* /opt/app/osaaf/local
+        for D in public data etc logs; do
+            rsync -uh --exclude=.gitignore /opt/app/aaf_config/$D/* /opt/app/osaaf/$D
         done
-       ;;
-      validate)
-       echo "## validate requested"
-       $JAVA -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar validate cadi_prop_files=/opt/app/osaaf/local/org.osaaf.aaf.props
-       ;;
-      bash)
-       if [ ! "grep aaf_config ~/.bashrc" == "" ]; then 
-               echo "alias cadi='/bin/bash /opt/app/aaf_config/bin/agent.sh $*'" >> ~/.bashrc
-               . ~/.bashrc
-       fi
-       shift
-       /bin/bash $*
-       ;;
-       encrypt)
-       echo $1 $2 $3
-       cd /opt/app/osaaf/local
-       
-       for F in `grep -l $2 *.props`; do 
-         echo "Changing $F"
-         PWD=`$JAVA -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar cadi digest $3 /opt/app/osaaf/local/org.osaaf.aaf.keyfile`
-         sed -i.old -e "s/\($2=\).*/\1enc=$PWD/" /opt/app/osaaf/local/org.osaaf.aaf.cred.props
-         cat $F
-       done  
-       ;;
-       *)
-       $JAVA -Dcadi_prop_files=/opt/app/osaaf/local/org.osaaf.aaf.props -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar $*
+        ;;
+    validate)
+        echo "## validate requested"
+        $JAVA -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar validate cadi_prop_files=/opt/app/osaaf/local/org.osaaf.aaf.props
+        ;;
+    bash)
+        echo "alias agent='/bin/bash /opt/app/aaf_config/bin/agent.sh EMPTY \$*'" >>~/.bashrc
+        if [ ! "$(grep aaf_config ~/.bashrc)" = "" ]; then
+            echo "alias cadi='/bin/bash /opt/app/aaf_config/bin/agent.sh EMPTY cadi \$*'" >>~/.bashrc
+            echo "alias agent='/bin/bash /opt/app/aaf_config/bin/agent.sh EMPTY \$*'" >>~/.bashrc
+            #. ~/.bashrc
+        fi
+        shift
+        cd /opt/app/osaaf/local || exit
+        /bin/bash "$@"
+        ;;
+    encrypt)
+        cd /opt/app/osaaf/local || exit
+        FILES=$(grep -l "$1" ./*.props)
+        if [ "$FILES" = "" ]; then
+            FILES=/opt/app/osaaf/local/org.osaaf.aaf.cred.props
+            echo "$1=enc:" >>FILES
+        fi
+        for F in $FILES; do
+            echo "Changing $1 in $F"
+            if [ "$2" = "" ]; then
+                read -r -p "Password (leave blank to cancel): " -s ORIG_PW
+                echo " "
+                if [ "$ORIG_PW" = "" ]; then
+                    echo canceling...
+                    break
+                fi
+            else
+                ORIG_PW="$2"
+            fi
+            PWD=$("$JAVA" -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar cadi digest "$ORIG_PW" /opt/app/osaaf/local/org.osaaf.aaf.keyfile)
+            sed -i.backup -e "s/\\($1.*enc:\\).*/\\1$PWD/" $F
+            cat $F
+        done
+        ;;
+    --help | -?)
+        case "$1" in
+        "")
+            echo "--- Agent Container Comands ---"
+            echo "  ls                      - Lists all files in Configuration"
+            echo "  cat <file.props>>       - Shows the contents (Prop files only)"
+            echo "  validate                - Runs a test using Configuration"
+            echo "  encrypt <tag> [<pass>]  - set passwords on Configuration (if no pass, it will be queried)"
+            echo "  bash                    - run bash in Container"
+            echo "     Note: the following aliases are preset"
+            echo "       cadi               - CADI CmdLine tool"
+            echo "       agent              - Agent Java tool (see above help)"
+            echo ""
+            echo " --help|-? [cadi|agent]   - This help, cadi help or agent help"
+            ;;
+        cadi)
+            echo "--- cadi Tool Comands ---"
+            $JAVA -Dcadi_prop_files=/opt/app/osaaf/local/org.osaaf.aaf.props -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar cadi | tail -n +6
+            ;;
+        agent)
+            echo "--- agent Tool Comands ---"
+            $JAVA -Dcadi_prop_files=/opt/app/osaaf/local/org.osaaf.aaf.props -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar
+            ;;
+        esac
+        echo ""
+        ;;
+    *)
+        $JAVA -Dcadi_prop_files=/opt/app/osaaf/local/org.osaaf.aaf.props -jar /opt/app/aaf_config/bin/aaf-cadi-aaf-*-full.jar "$CMD" "$@"
+        ;;
     esac
-  fi
-fi  
-
+fi
index 1fa13fe..628b5fd 100644 (file)
@@ -3,7 +3,7 @@
 ## AAF Certificate Manager properties
 ## Note: Link to CA Properties in "local" dir
 ##
-cadi_prop_files=/opt/app/osaaf/local/org.osaaf.aaf.props:/opt/app/osaaf/etc/org.osaaf.aaf.log4j.props:/opt/app/osaaf/local/org.osaaf.cassandra.props:/opt/app/osaaf/local/org.osaaf.cm.ca.props
+cadi_prop_files=/opt/app/osaaf/local/org.osaaf.aaf.props:/opt/app/osaaf/etc/org.osaaf.aaf.log4j.props:/opt/app/osaaf/local/org.osaaf.aaf.cassandra.props:/opt/app/osaaf/local/org.osaaf.aaf.cm.ca.props
 aaf_component=AAF_NS.cm:2.1.0.0
 port=8150
 
diff --git a/auth/sample/local/.dockerignore b/auth/sample/local/.dockerignore
new file mode 100644 (file)
index 0000000..6c7b69a
--- /dev/null
@@ -0,0 +1 @@
+.gitignore
index 362863a..e69de29 100644 (file)
@@ -1,2 +0,0 @@
-truststoreONAPall.jks
-org.osaaf.aaf.signer.p12
index 6b08d9a..8237c4e 100644 (file)
@@ -10,9 +10,13 @@ aaf_domain_support=.com:.org
 aaf_default_realm=people.osaaf.org
 
 # Initial Passwords and such
-aaf_password=osaaf_admin
+aaf_password=startup
+cadi_alias=osaaf@aaf.osaaf.org
+cadi_keystore=/opt/app/osaaf/local/org.osaaf.aaf.p12
+cadi_keystore_password=kumquat
 cadi_truststore=/opt/app/osaaf/public/truststoreONAPall.jks
 cadi_truststore_password=changeit
 
 # Other
 aaf_data_dir=/opt/app/osaaf/data
+cadi_registration_hostname=meriadoc.mithril.sbc.com
index 692e57f..9e29d83 100644 (file)
@@ -7,7 +7,7 @@ cassandra.clusters=cass.aaf.osaaf.org
 cassandra.clusters.port=9042
 #need this to be fully qualified name when REAL AAF integration
 cassandra.clusters.user=cassandra
-cassandra.clusters.password=enc:<Encrypted Password>
+cassandra.clusters.password=enc:
 
 # Name for exception that has happened in the past
 cassandra.reset.exceptions=com.datastax.driver.core.exceptions.NoHostAvailableException:"no host was tried":"Connection has been closed"
index 5924299..92d55f9 100644 (file)
@@ -1,10 +1,10 @@
 ##
-## org.osaaf.aaf.cm.ca.props
-## Properties to access Certificate Authority
+## org.osaaf.cm.ca.props
+## Properties to access Certifiate Authority
 ##
 
 #Certman
-cm_ca.local=org.onap.aaf.auth.cm.ca.LocalCA,/opt/app/osaaf/local/org.osaaf.aaf.cm.p12;aaf_cm_ca;enc:<Encrypted Password>
+cm_ca.local=org.onap.aaf.auth.cm.ca.LocalCA,/opt/app/osaaf/local/aaf_intermediate_1.p12;aaf_intermediate_1;enc:
 cm_ca.local.idDomains=org.osaaf
 cm_ca.local.baseSubject=/OU=OSAAF/O=ONAP/C=US
 cm_ca.local.perm_type=org.osaaf.aaf.ca
similarity index 96%
rename from conf/CA/newca.sh
rename to conf/CA/newCA.sh
index 5f49f38..49b12c3 100644 (file)
@@ -6,6 +6,8 @@ mkdir -p private certs newcerts
 chmod 700 private
 chmod 755 certs newcerts
 touch index.txt
+echo "unique_subject = no" > index.txt.attr
+
 if [ ! -e serial ]; then
   echo '01' > serial
 fi
index 9410305..303c22e 100644 (file)
@@ -13,6 +13,8 @@ mkdir -p $DIR/private $DIR/certs $DIR/newcerts
 chmod 700 $DIR/private
 chmod 755 $DIR/certs $DIR/newcerts
 touch $DIR/index.txt
+echo "unique_subject = no" > $DIR/index.txt.attr
+
 if [ ! -e $DIR/serial ]; then
   echo '01' > $DIR/serial
 fi