From 8034ea8a06d29cf148c3170b044385e874e5b7e1 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Tue, 21 Aug 2018 13:29:27 -0700 Subject: lavalab-gen: fiz zmq key filename assumptions The ZMQ key file names are expected to have specific names in the containers (e.g. $LAVA_MASTER.key). However, when using existing key files, they are simply copied into the containers, and if they don't match the exact requirements, encryption will silently fail. Fix this by allowing arbitrary filenames for existing keys, but ensure they are copied into the container with the expected filenames. Related, when using auto-generated keys, the generated master key is simply "master.key" in the slave. Fix this by ensuring that "master.key" is copied to $LAVA_MASTER.key when the slave container starts. Signed-off-by: Kevin Hilman --- lava-slave/scripts/setup.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'lava-slave/scripts/setup.sh') diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh index e688c9e..7cff479 100755 --- a/lava-slave/scripts/setup.sh +++ b/lava-slave/scripts/setup.sh @@ -120,6 +120,7 @@ if [ -e /etc/lava-dispatcher/certificates.d/$(hostname).key ];then echo "INFO: Enabling encryption" sed -i 's,.*ENCRYPT=.*,ENCRYPT="--encrypt",' /etc/lava-dispatcher/lava-slave sed -i "s,.*SLAVE_CERT=.*,SLAVE_CERT=\"--slave-cert /etc/lava-dispatcher/certificates.d/$(hostname).key_secret\"," /etc/lava-dispatcher/lava-slave + (cd /etc/lava-dispatcher/certificates.d; if [ -e master.key ]; then cp master.key $LAVA_MASTER.key; fi) sed -i "s,.*MASTER_CERT=.*,MASTER_CERT=\"--master-cert /etc/lava-dispatcher/certificates.d/$LAVA_MASTER.key\"," /etc/lava-dispatcher/lava-slave fi exit 0 -- cgit 1.2.3-korg