diff --git a/workspace/Dockerfile b/workspace/Dockerfile index af7ad26898..d556b4b315 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -436,8 +436,9 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ ARG INSTALL_WORKSPACE_SSH=false -COPY insecure_id_rsa /tmp/id_rsa -COPY insecure_id_rsa.pub /tmp/id_rsa.pub +COPY install_ssh_keys.sh /usr/local/bin/install_ssh_keys.sh +RUN chmod +x /usr/local/bin/install_ssh_keys.sh +RUN /usr/local/bin/install_ssh_keys.sh RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \ rm -f /etc/service/sshd/down && \ diff --git a/workspace/install_ssh_keys.sh b/workspace/install_ssh_keys.sh new file mode 100644 index 0000000000..0c779a9020 --- /dev/null +++ b/workspace/install_ssh_keys.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Define the directory to check +directory="ssh_keys" + +# Define the files to check for +files=("id_rsa" "id_rsa.pub") + +# Loop through each file and check if it exists +for file in "${files[@]}"; do + if [ -f "$directory/$file" ]; then + cp $directory/"$file" /tmp/$directory/"$file" + else + cp insecure_"$file" /tmp/"$file" + fi +done