From 475da40b0d58acdf4dd1a3590c490ce7b95a1af8 Mon Sep 17 00:00:00 2001 From: Jonathan Gathman Date: Sat, 25 Apr 2020 14:28:13 -0500 Subject: Add StandAlone Unix Configurations Include scripts, podman starts, minor code changes. Issue-ID: AAF-1137 Signed-off-by: Jonathan Gathman Change-Id: Ief72d93e607dbe62875f592978ee15084c8310d2 --- conf/CA/deploy.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 conf/CA/deploy.sh (limited to 'conf/CA') 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 -- cgit 1.2.3-korg