aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-03-31 05:15:36 +0200
committerGitHub <noreply@github.com>2022-03-31 11:15:36 +0800
commitba5f2acb9ccb40281ca8ab7eaf9dea6a77eb220d (patch)
tree42343d31c735a2a396ccca3872e3908d2e0df1a7
parentc83168104b8bcb09e3e6e1490bd586a9e1a55bc3 (diff)
downloadgitea-ba5f2acb9ccb40281ca8ab7eaf9dea6a77eb220d.tar.gz
gitea-ba5f2acb9ccb40281ca8ab7eaf9dea6a77eb220d.zip
Configure OpenSSH log level via Environment in Docker (#19274)
Introduce a new environment variable: SSH_LOG_LEVEL
-rwxr-xr-xdocker/root/etc/s6/openssh/setup1
-rw-r--r--docker/root/etc/templates/sshd_config2
2 files changed, 2 insertions, 1 deletions
diff --git a/docker/root/etc/s6/openssh/setup b/docker/root/etc/s6/openssh/setup
index 89c03092be..f7843050c1 100755
--- a/docker/root/etc/s6/openssh/setup
+++ b/docker/root/etc/s6/openssh/setup
@@ -49,6 +49,7 @@ if [ -d /etc/ssh ]; then
SSH_DSA_CERT="${SSH_DSA_CERT:+"HostCertificate "}${SSH_DSA_CERT}" \
SSH_MAX_STARTUPS="${SSH_MAX_STARTUPS:+"MaxStartups "}${SSH_MAX_STARTUPS}" \
SSH_MAX_SESSIONS="${SSH_MAX_SESSIONS:+"MaxSessions "}${SSH_MAX_SESSIONS}" \
+ SSH_LOG_LEVEL=${SSH_LOG_LEVEL:-"INFO"} \
envsubst < /etc/templates/sshd_config > /etc/ssh/sshd_config
chmod 0644 /etc/ssh/sshd_config
diff --git a/docker/root/etc/templates/sshd_config b/docker/root/etc/templates/sshd_config
index 8d336f3a8e..6f1a363045 100644
--- a/docker/root/etc/templates/sshd_config
+++ b/docker/root/etc/templates/sshd_config
@@ -8,7 +8,7 @@ ListenAddress ::
${SSH_MAX_STARTUPS}
${SSH_MAX_SESSIONS}
-LogLevel INFO
+LogLevel ${SSH_LOG_LEVEL}
HostKey /data/ssh/ssh_host_ed25519_key
${SSH_ED25519_CERT}