diff options
author | 2020-04-25 21:29:29 +0000 | |
---|---|---|
committer | 2020-04-25 21:29:29 +0000 | |
commit | d7c1a1b6c4218e3f470f86e4ff67fdcdc86f0ea5 (patch) | |
tree | deb33803d25e4a5d11aa7e42131d3490b08dc6ba /conf/CA | |
parent | e4220946ef3feb864ed45e4fc14682be2016dc1b (diff) | |
parent | 475da40b0d58acdf4dd1a3590c490ce7b95a1af8 (diff) |
Merge "Add StandAlone Unix Configurations Include scripts, podman starts, minor code changes."
Diffstat (limited to 'conf/CA')
-rw-r--r-- | conf/CA/deploy.sh | 38 |
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 |