File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 schedule :
55 - cron : " 0 0 1 * *" # every month
66 push :
7+ branches :
8+ - master
9+ - feature/persistent-host-key-support
710 paths-ignore :
811 - " *.md"
912 - " *.txt"
1013 - " *.png"
11- pull_request :
1214
1315env :
1416 IMAGE_NAME : ghcr.io/techonomydev/atmoz-sftp
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ RUN apt-get update && \
1313COPY files/sshd_config /etc/ssh/sshd_config
1414COPY files/create-sftp-user /usr/local/bin/
1515COPY files/entrypoint /
16+ COPY files/startup_scripts/load_env_host_key.bash /etc/sftp.d/load_env_host_key.bash
17+
18+ RUN chmod +x /etc/sftp.d/*
1619
1720EXPOSE 22
1821
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ RUN apt-get update && \
1313COPY files/sshd_config_2222 /etc/ssh/sshd_config
1414COPY files/create-sftp-user /usr/local/bin/
1515COPY files/entrypoint /
16+ COPY files/startup_scripts/load_env_host_key.bash /etc/sftp.d/load_env_host_key.bash
17+
18+ RUN chmod +x /etc/sftp.d/*
1619
1720EXPOSE 2222
1821
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [[ -n " $SSH_HOST_ED25519_KEY_B64 " ]]; then
4+ echo " Decoding and setting up ED25519 host key..."
5+ echo " $SSH_HOST_ED25519_KEY_B64 " | base64 -d > /etc/ssh/ssh_host_ed25519_key
6+ ssh-keygen -y -f /etc/ssh/ssh_host_ed25519_key > /etc/ssh/ssh_host_ed25519_key.pub
7+ chmod 600 /etc/ssh/ssh_host_ed25519_key
8+ echo " ED25519 host key setup complete."
9+ else
10+ echo " No ED25519 host key provided."
11+ fi
12+
13+ if [[ -n " $SSH_HOST_RSA_KEY_B64 " ]]; then
14+ echo " Decoding and setting up RSA host key..."
15+ echo " $SSH_HOST_RSA_KEY_B64 " | base64 -d > /etc/ssh/ssh_host_rsa_key
16+ ssh-keygen -y -f /etc/ssh/ssh_host_rsa_key > /etc/ssh/ssh_host_rsa_key.pub
17+ chmod 600 /etc/ssh/ssh_host_rsa_key
18+ echo " RSA host key setup complete."
19+ else
20+ echo " No RSA host key provided."
21+ fi
You can’t perform that action at this time.
0 commit comments