summaryrefslogtreecommitdiffstats
path: root/conf/CA/deploy.sh
diff options
context:
space:
mode:
authorJonathan Gathman <jgonap@stl.gathman.org>2020-04-25 14:28:13 -0500
committerInstrumental <jgonap@stl.gathman.org>2020-04-25 15:40:38 -0500
commit475da40b0d58acdf4dd1a3590c490ce7b95a1af8 (patch)
tree6ada2fd4e98522c4e942121f1c20f22343e450d3 /conf/CA/deploy.sh
parent861b557b294032f9443ee1fca6b42d7252e92481 (diff)
Add StandAlone Unix Configurations
Include scripts, podman starts, minor code changes. Issue-ID: AAF-1137 Signed-off-by: Jonathan Gathman <jgonap@stl.gathman.org> Change-Id: Ief72d93e607dbe62875f592978ee15084c8310d2
Diffstat (limited to 'conf/CA/deploy.sh')
-rw-r--r--conf/CA/deploy.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/conf/CA/deploy.sh b/conf/CA/deploy.sh
new file mode 100644
index 00000000..031f9575
--- /dev/null
+++ b/conf/CA/deploy.sh
@@ -0,0 +1,38 @@
+# SED needs escaped slashes
+function escSlash {
+ echo "${1//\//\\\/}"
+}
+
+NS="$(cat ns.aaf)"
+DEPLOY_DIR=${PWD/\/CA/}
+read -p "AAF Config Directory: [$DEPLOY_DIR]: " input
+DEPLOY_DIR=${input:-$DEPLOY_DIR}
+
+echo "Deploying to $DEPLOY_DIR"
+
+APP_NAME="${DEPLOY_DIR##*/}"
+CA_CRT="CA_${APP_NAME^^}.crt"
+cp -v certs/ca.crt $DEPLOY_DIR/public/$CA_CRT
+sed -i.bak \
+ -e "/cm_public_dir=.*/s//cm_public_dir=$(escSlash $DEPLOY_DIR/public)/" \
+ -e "/cm_trust_cas=.*/s//cm_trust_cas=${CA_CRT}/" \
+ $DEPLOY_DIR/etc/org.osaaf.aaf.cm.props
+
+INT_DIR="intermediate_$(cat intermediate.serial)"
+
+cp -v $INT_DIR/certs/ca.crt $DEPLOY_DIR/public/${APP_NAME^^}_SIGNER.crt
+SIGNER=${NS}.signer.p12
+cp -v $INT_DIR/aaf_$INT_DIR.p12 $DEPLOY_DIR/local/${SIGNER}
+
+CADI="java -jar /opt/app/aaf/lib/aaf-cadi-core-*.jar"
+KEYFILE="$DEPLOY_DIR/local/org.osaaf.aaf.keyfile"
+if [ ! -f "$KEYFILE" ]; then
+ echo $CADI keygen $KEYFILE
+fi
+
+echo "Enter Issuer Key Password "
+read -s ISSUER_PASS
+ISSUER_PASS=$($CADI digest "$ISSUER_PASS" $KEYFILE)
+sed -i.bak \
+ -e "/cm_ca.local=.*/s//cm_ca.local=org.onap.aaf.auth.cm.ca.LocalCA,$(escSlash $DEPLOY_DIR/local/$SIGNER);aaf_$INT_DIR;enc:$ISSUER_PASS/" \
+ $DEPLOY_DIR/local/org.osaaf.aaf.cm.ca.props