diff --git a/redeploy.sh b/redeploy.sh index c477fc3..3774471 100755 --- a/redeploy.sh +++ b/redeploy.sh @@ -18,6 +18,10 @@ HOST=118.95.33.89 PORT=61 USER=root APPDIR=/opt/bizgaze-support +# Pinned server host key (SHA256). plink -batch won't prompt to cache an +# unknown key, so we pin it here. Verify against the fingerprint plink shows +# on first connect. Override with $DEPLOY_HOSTKEY if the server is rebuilt. +HOSTKEY="${DEPLOY_HOSTKEY:-SHA256:hxfv/hH5aplnM4wOsl+jLjWaXwEeceZ4Uz932/5IoCE}" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -36,4 +40,4 @@ if [ -z "$PW" ]; then fi echo "==> Triggering deploy on $USER@$HOST ($APPDIR) …" -exec "$PLINK" -ssh -batch -P "$PORT" -pw "$PW" "$USER@$HOST" "cd $APPDIR && bash deploy.sh $*" +exec "$PLINK" -ssh -batch -hostkey "$HOSTKEY" -P "$PORT" -pw "$PW" "$USER@$HOST" "cd $APPDIR && bash deploy.sh $*"