infra/codestorage/hg-ssh
2015-10-15
Parent:bf7b66df555f
infra/codestorage/hg-ssh/run.sh
Pull hostkeys when pulling SSH keys. Rather than relying on Kubernetes secrets and baking public keys right in, which was bound to get fraught, we now have some graceful degradation. It defaults to automatically-generated random keys, but will try to download some keys from Google Cloud Storage for the host. If it can find some, it'll try to use those, instead.
1.1 --- a/run.sh Thu Oct 15 00:14:32 2015 -0700 1.2 +++ b/run.sh Thu Oct 15 01:32:28 2015 -0700 1.3 @@ -11,19 +11,7 @@ 1.4 chgrp -R committers /mounted 1.5 chmod -R 0770 /mounted 1.6 1.7 -RUN mkdir -p /data/ssh 1.8 - 1.9 /bin/bash /usr/local/bin/helpers/pull.sh 1.10 /bin/bash /usr/local/bin/helpers/pullkeys.sh 1.11 1.12 -KEYS=/data/ssh/* 1.13 -for k in "${KEYS[@]}" 1.14 -do 1.15 - base=${k##*/} 1.16 - echo "Linking ${k} to /etc/ssh/${base}" 1.17 - ln -s $k /etc/ssh/$base 1.18 -done 1.19 - 1.20 -cp /tmp/sshpubkeys/* /etc/ssh/ 1.21 - 1.22 /usr/sbin/sshd -D