Skip to content

Commit

Permalink
1.) added: custom ssh certificate instllation for easier maintenance
Browse files Browse the repository at this point in the history
@wip

Signed-off-by: Oskars Germovs <[email protected]>
  • Loading branch information
Faks committed Mar 22, 2024
1 parent 3c2b81b commit 9e4b34b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
16 changes: 16 additions & 0 deletions workspace/install_ssh_keys.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9e4b34b

Please sign in to comment.