Skip to content

Commit 75d4414

Browse files
christhomastechknowlogick
authored andcommitted
Implement the ability to change the ssh port to match what is in the gitea config (#7286)
* - rearrange the templates to make it more logical because now ssh_config is a template - implemented the updating of the port to the same as the port sent to the gitea config * change the filename back
1 parent b282d4e commit 75d4414

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docker/root/etc/s6/openssh/setup

+7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ if [ ! -f /data/ssh/ssh_host_ecdsa_key ]; then
2424
ssh-keygen -t ecdsa -b 256 -f /data/ssh/ssh_host_ecdsa_key -N "" > /dev/null
2525
fi
2626

27+
if [ -d /etc/ssh ]; then
28+
SSH_PORT=${SSH_PORT:-"22"} \
29+
envsubst < /etc/templates/sshd_config > /etc/ssh/sshd_config
30+
31+
chmod 0644 /etc/ssh/sshd_config
32+
fi
33+
2734
chown root:root /data/ssh/*
2835
chmod 0700 /data/ssh
2936
chmod 0600 /data/ssh/*

docker/root/etc/ssh/sshd_config renamed to docker/root/etc/templates/sshd_config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Port 22
1+
Port ${SSH_PORT}
22
Protocol 2
33

44
AddressFamily any

0 commit comments

Comments
 (0)