Skip to content

Commit

Permalink
Override the default ssh askpass flow on project clone step
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Jul 30, 2024
1 parent 68bae56 commit 0604f83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion project-clone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ COPY --from=builder /project-clone/_output/bin/project-clone /usr/local/bin/proj

ENV USER_UID=1001 \
USER_NAME=project-clone \
HOME=/home/user
HOME=/home/user \
DISPLAY=":0" \
SSH_ASKPASS=/usr/local/bin/ssh-askpass.sh

COPY build/bin /usr/local/bin
COPY project-clone/ssh-askpass.sh /usr/local/bin
RUN /usr/local/bin/user_setup
RUN chmod +x /usr/local/bin/ssh-askpass.sh

USER ${USER_UID}

Expand Down
7 changes: 7 additions & 0 deletions project-clone/ssh-askpass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
PASSPHRASE_FILE_PATH="/etc/ssh/passphrase"
if [ ! -f $PASSPHRASE_FILE_PATH ]; then
echo "Error: passphrase file is missing in the '/etc/ssh/' directory" 1>&2
exit 1
fi
cat $PASSPHRASE_FILE_PATH

0 comments on commit 0604f83

Please sign in to comment.