Skip to content

Commit

Permalink
Rename SSH-related variables and scripts for consistency
Browse files Browse the repository at this point in the history
Renamed environment variables and script files to use 'SSHD' instead of 'SSH' for improved clarity and consistency. Updated documentation and templates to reflect these changes.
  • Loading branch information
nbejansen committed Sep 17, 2024
1 parent d05a134 commit 67dda39
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ services:
- "2222:2222"
environment:
RUNTIME_VERBOSITY: 2
RUNTIME_SSH_ENABLED: true
RUNTIME_SSHD_ENABLED: true
RUNTIME_CRON_ENABLED: true
RUNTIME_USER: captain
# Generate with: openssl passwd -1
RUNTIME_PASSWORD_FILE: /files/password # secret
RUNTIME_SSH_AUTH_KEYS_FILE: /files/authorized_keys
RUNTIME_SSHD_AUTH_KEYS_FILE: /files/authorized_keys
volumes:
- ./files:/files
build:
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ persist application data.
| `/runtime/bin/rchown` | Recursively change the owner and group of a folder (this allows services and scripts to access this folder while running the container with a non-root user) |
| `/runtime/entrypoint.d` | Each file in this folder is executed before the container command is executed |
| `/runtime/entrypoint.d/10-logo.sh` | Displays the brand logo |
| `/runtime/entrypoint.d/20-info.sh` | Modifies the user name and password |
| `/runtime/entrypoint.d/40-cron.sh` | Enable and configure cron service |
| `/runtime/entrypoint.d/40-ssh.sh` | Enable and configure sshd service |
| `/runtime/entrypoint.d/20-user.sh` | Configures the user name and password |
| `/runtime/entrypoint.d/40-cron.sh` | Configures the cron service |
| `/runtime/entrypoint.d/40-sshd.sh` | Configures the sshd service |
| `/runtime/templates` | Contains configuration templates |

## Environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
set -e
set -u

file_env "RUNTIME_SSH_AUTH_KEYS"
file_env "RUNTIME_SSHD_AUTH_KEYS"

if ${RUNTIME_SSH_ENABLED:-false} to_bool; then
info "SSH Server: Enabled"
if ${RUNTIME_SSHD_ENABLED:-false} to_bool; then
info "SSHD: Enabled"

touch /etc/s6-overlay/s6-rc.d/user/contents.d/sshd

Expand All @@ -18,5 +18,5 @@ if ${RUNTIME_SSH_ENABLED:-false} to_bool; then

template authorized_keys.tmpl ~/.ssh/authorized_keys
else
info "SSH Server: Disabled"
info "SSHD: Disabled"
fi
2 changes: 1 addition & 1 deletion src/runtime/runtime/templates/authorized_keys.tmpl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is managed by the container; any changes will be lost.
{{ default .Env.RUNTIME_SSH_AUTH_KEYS "" }}
{{ default .Env.RUNTIME_SSHD_AUTH_KEYS "" }}
2 changes: 1 addition & 1 deletion src/runtime/runtime/templates/sshd_config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

Include /etc/ssh/sshd_config.d/*.conf

Port {{ default .Env.RUNTIME_SSH_PORT "2222" }}
Port {{ default .Env.RUNTIME_SSHD_PORT "2222" }}
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
Expand Down

0 comments on commit 67dda39

Please sign in to comment.