aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2018-08-15 16:41:42 -0700
committerKiran Kamineni <kiran.k.kamineni@intel.com>2018-08-15 16:41:51 -0700
commit56cf7f2d9f54bdc9c3e52bfd153073aa0da638c1 (patch)
tree1bb05e7708876c959a4852311863fc93fb9b6d91
parent9446b6c0d24e9f9af6855073eaa51b18e86c3f5f (diff)
Change to container based naming convention
Changed naming and folder structure to allow for easy integration with kubernetes. Changed createca to distcenter name, after the container name. Issue-ID: AAF-409 Change-Id: I6f9f290f7c1f02b42a11aea85c26b95b334082d1 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
-rw-r--r--bin/distcenter/Dockerfile4
-rwxr-xr-xbin/distcenter/entrypoint.sh23
2 files changed, 14 insertions, 13 deletions
diff --git a/bin/distcenter/Dockerfile b/bin/distcenter/Dockerfile
index afa5b7d..cb6f000 100644
--- a/bin/distcenter/Dockerfile
+++ b/bin/distcenter/Dockerfile
@@ -6,8 +6,8 @@ RUN cd sshsm && \
cd duplicate && \
make -f sampleMakefile
-RUN mkdir /createca
-COPY ./create_ca.sh /createca/
+RUN mkdir -p /distcenter/bin
+COPY ./create_ca.sh /distcenter/bin
RUN mkdir /dup
RUN mkdir /dup/bin
diff --git a/bin/distcenter/entrypoint.sh b/bin/distcenter/entrypoint.sh
index 641c529..25cefd6 100755
--- a/bin/distcenter/entrypoint.sh
+++ b/bin/distcenter/entrypoint.sh
@@ -1,22 +1,23 @@
#!/bin/sh
set -e
-cd /createca
-/createca/create_ca.sh
-cd /createca/ca
-cat /volume/passphrase | gpg --no-tty --symmetric -z 9 --require-secmem \
+cd /distcenter
+/distcenter/bin/create_ca.sh
+cd /distcenter/ca
+cat /distcenter/passphrase/passphrase | gpg --no-tty --symmetric -z 9 --require-secmem \
--cipher-algo AES256 --s2k-cipher-algo AES256 --s2k-digest-algo SHA512 \
--s2k-mode 3 --s2k-count 65000000 --compress-algo BZIP2 \
--passphrase-fd 0 privkey.pem
-cp /createca/ca/privkey.pem.gpg /volume
-cp /createca/ca/ca.cert /volume
+cp /distcenter/ca/privkey.pem.gpg /distcenter/data
+cp /distcenter/ca/ca.cert /distcenter/data
-cd /volume
+cd /distcenter/data
DLIST=`ls -d host_*`
+#Iterate over all hosts (host in k8s corresponds node)
for DIR in $DLIST; do
echo $DIR
- cp /createca/ca/ca.cert /volume/$DIR
- cd /volume/$DIR
- /dup/bin/ossl_tpm_duplicate -pemfile /createca/ca/privkey.pem -parentPub \
- /volume/$DIR/out_parent_public -dupPub dupPub -dupPriv dupPriv -dupSymSeed \
+ cp /distcenter/ca/ca.cert /distcenter/data/$DIR
+ cd /distcenter/data/$DIR
+ /dup/bin/ossl_tpm_duplicate -pemfile /distcenter/ca/privkey.pem -parentPub \
+ /distcenter/data/$DIR/out_parent_public -dupPub dupPub -dupPriv dupPriv -dupSymSeed \
dupSymseed -dupEncKey dupEncKey
done