From 5c4a2cb7c5612dac711d98e48fef5f2a0538418d Mon Sep 17 00:00:00 2001 From: dmotte <37443982+dmotte@users.noreply.github.com> Date: Sun, 25 Aug 2024 16:33:44 +0200 Subject: [PATCH] Added KEEPALIVE_INTERVAL env var --- README.md | 8 ++++++++ build/startup.sh | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 08a3a00..8cdc211 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,14 @@ curl http://localhost/ For a more complex example, refer to the [`docker-compose.yml`](docker-compose.yml) file. +### Environment variables + +List of supported **environment variables**: + +| Variable | Required | Description | +| -------------------- | ---------------- | ---------------------------------------------------------------- | +| `KEEPALIVE_INTERVAL` | No (default: 30) | Value for the `ClientAliveInterval` option of the OpenSSH server | + ## Development If you want to contribute to this project, you can use the following one-liner to **rebuild the image** and bring up the **Docker-Compose stack** every time you make a change to the code: diff --git a/build/startup.sh b/build/startup.sh index 57631eb..14a4249 100644 --- a/build/startup.sh +++ b/build/startup.sh @@ -2,6 +2,8 @@ set -ex +keepalive_interval=${KEEPALIVE_INTERVAL:-30} + ################################################################################ # Get host keys from the volume @@ -66,4 +68,4 @@ done # Start the OpenSSH Server with "exec" to ensure it receives all the stop # signals correctly -exec /usr/sbin/sshd -De +exec /usr/sbin/sshd -De -oClientAliveInterval="$keepalive_interval"