summaryrefslogtreecommitdiffstats
path: root/auth/sample
diff options
context:
space:
mode:
authorInstrumental <jgonap@stl.gathman.org>2020-03-24 17:07:27 -0500
committerInstrumental <jgonap@stl.gathman.org>2020-03-26 01:28:32 -0500
commit96bf6a2771dfe992fb27bd6361d191d83b6ff605 (patch)
treeb26581f65d15574fe81f5dfa3e061b93744ef7fd /auth/sample
parent48bcfb9d4b03ac3e2e6915f7bdf72599c8794d43 (diff)
AAF Services non root, all platforms2.1.20
adjust Agent for JDK 11 Included redoing Config and Agent Init Containers refit for "hello" (sample) Issue-ID: AAF-1102 Signed-off-by: Instrumental <jgonap@stl.gathman.org> Change-Id: Ia957b1ccce34d164580ccb0a6d02d7b800e4887e
Diffstat (limited to 'auth/sample')
-rwxr-xr-xauth/sample/bin/client.sh26
-rw-r--r--auth/sample/bin/service.sh4
2 files changed, 22 insertions, 8 deletions
diff --git a/auth/sample/bin/client.sh b/auth/sample/bin/client.sh
index 4132e6ca..97a1262f 100755
--- a/auth/sample/bin/client.sh
+++ b/auth/sample/bin/client.sh
@@ -55,12 +55,13 @@ function sso_encrypt() {
$JAVA_AGENT cadi digest ${1} $DOT_AAF/keyfile
}
-# Setup Bash, first time only
-if [ ! -e "$HOME/.bashrc" ] || [ -z "$(grep agent $HOME/.bashrc)" ]; then
- echo "alias agent='$CONFIG_BIN/agent.sh agent \$*'" >>$HOME/.bashrc
+# Setup Bash, first time only, Agent only
+if [ -n "$HOME/.bashrc" ] || [ -z "$(grep agent $HOME/.bashrc)" ]; then
+ echo "alias agent='$CONFIG_BIN/agent.sh agent \$*'" > $HOME/.bashrc
chmod a+x $CONFIG_BIN/agent.sh
. $HOME/.bashrc
fi
+
if [ ! -e "$DOT_AAF/truststoreONAPall.jks" ]; then
mkdir -p $DOT_AAF
base64 -d $CONFIG/cert/truststoreONAPall.jks.b64 > $DOT_AAF/truststoreONAPall.jks
@@ -133,13 +134,22 @@ if [ "${VERSION}" != "$(cat ${LOCAL}/VERSION 2> /dev/null)" ]; then
echo "Clean up directory ${LOCAL}"
rm -Rf ${LOCAL}/*
fi
+
+# update client info
echo "${VERSION}" > $LOCAL/VERSION
+cp $AGENT_JAR $LOCAL
+echo "#!/bin/bash" > $LOCAL/agent
+ echo 'java -jar aaf-cadi-aaf-*-full.jar $*' >> $LOCAL/agent
+echo "#!/bin/bash" > $LOCAL/cadi
+ echo 'java -jar aaf-cadi-aaf-*-full.jar cadi $*' >> $LOCAL/cadi
+chmod 755 $LOCAL/agent $LOCAL/cadi
echo "Namespace is ${NS}"
# Only initialize once, automatically...
-if [ ! -e $LOCAL/${NS}.props ]; then
+if [ -n $LOCAL/${NS}.props ]; then
echo "#### Create Configuration files "
- $JAVA_AGENT config $APP_FQI $APP_FQDN
+ > $LOCAL/$NS
+ $JAVA_AGENT config $APP_FQI $APP_FQDN --nopasswd
cat $LOCAL/$NS.props
echo
@@ -153,7 +163,7 @@ if [ ! -e $LOCAL/${NS}.props ]; then
$JAVA_AGENT place $APP_FQI $APP_FQDN
if [ -z "$(grep cadi_alias $NS.cred.props)" ]; then
- echo "FAILED to get Certificate"
+ echo "FAILED to get Certificate"
INITIALIZED="false"
else
echo "Obtained Certificates"
@@ -284,7 +294,7 @@ else
;;
testConnectivity|testconnectivity)
echo "--- Test Connectivity ---"
- $JAVA -cp $CONFIG_BIN/aaf-auth-cmd-*-full.jar org.onap.aaf.cadi.aaf.TestConnectivity $LOCAL/org.osaaf.aaf.props
+ $JAVA -cp $AGENT_JAR org.onap.aaf.cadi.aaf.TestConnectivity $LOCAL/org.osaaf.aaf.props
;;
--help | -?)
case "$1" in
@@ -320,7 +330,7 @@ else
### Possible Dublin
# sample)
# echo "--- run Sample Servlet App ---"
- # $JAVA -Dcadi_prop_files=$LOCAL/${NS}.props -cp $CONFIG_BIN/aaf-auth-cmd-*-full.jar:$CONFIG_BIN/aaf-cadi-servlet-sample-*-sample.jar org.onap.aaf.sample.cadi.jetty.JettyStandalone ${NS}.props
+ # $JAVA -Dcadi_prop_files=$LOCAL/${NS}.props -cp $AGENT_JAR:$CONFIG_BIN/aaf-cadi-servlet-sample-*-sample.jar org.onap.aaf.sample.cadi.jetty.JettyStandalone ${NS}.props
# ;;
*)
$JAVA_AGENT "$CMD" "$@"
diff --git a/auth/sample/bin/service.sh b/auth/sample/bin/service.sh
index 10a3e15e..2fd49cac 100644
--- a/auth/sample/bin/service.sh
+++ b/auth/sample/bin/service.sh
@@ -193,6 +193,10 @@ if [ ! -e $LOCAL/org.osaaf.aaf.props ]; then
fi
echo "Created AAF Initial Configurations"
INITIALIZED="true"
+ if [ -n ${DUSER} ]; then
+ mkdir -p /opt/app/osaaf/logs
+ chown -R 1000:1000 /opt/app/aaf /opt/app/osaaf
+ fi
fi