Skip to content

Commit e54040a

Browse files
committed
Added debug mode
1 parent 793562c commit e54040a

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ All variables are documented here:
5858
:-----:|:-----:|:-----:
5959
PUID|User ID the SSH user should run as.|9999
6060
PGID|Group ID the SSH user should run as.|9999
61+
DEBUG\_MODE|Display a bunch of helpful content for debugging.|false
6162
SSH\_USER|Username for the SSH user that other users will connect into as.|tunnel
6263
SSH\_GROUP|Group name used for our SSH user.|tunnelgroup
63-
SSH\_USER\_HOME|Home location of the SSH user.|/home/`$SSH_USER`
64+
SSH\_USER\_HOME|Home location of the SSH user.|/home/$SSH\_USER
6465
SSH\_PORT|Listening port for SSH server (on container only. You'll still need to publish this port).|2222
6566
SSH\_HOST\_KEY\_DIR|Location of where the SSH host keys should be stored.|/etc/ssh/ssh\_host\_keys/
66-
AUTHORIZED\_KEYS|🚨 <b>Required to be set</b> (if there isn't a `$SSH_USER_HOME/.ssh/authorized_keys` file provided). [See below]|
67+
AUTHORIZED\_KEYS|🚨 <b>Required to be set by you.</b> Content of your authorized keys file (see below)|
6768
ALLOWED\_IPS|🚨 <b>Required to be set by you.</b> Content of allowed IP addresses (see below)|
6869

6970

src/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
1919
SSH_GROUP="tunnelgroup" \
2020
SSH_PORT="2222" \
2121
SSH_HOST_KEY_DIR="/etc/ssh/ssh_host_keys" \
22+
DEBUG_MODE="false" \
2223
LC_ALL="en_US.UTF-8" \
2324
LANG="en_US.UTF-8" \
2425
LANGUAGE="en_US.UTF-8"

src/etc/s6-overlay/scripts/generate-ssh-keys

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/command/with-contenv bash
22

3+
if [ $DEBUG_MODE == true ]; then
4+
set -x
5+
fi
6+
37
# Check if SSH host keys are missing
48
if [ ! -f $SSH_HOST_KEY_DIR/ssh_host_* ]; then
59
echo "🏃‍♂️ Generating SSH keys for you..."

src/etc/s6-overlay/scripts/prep-ssh-server

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/command/with-contenv bash
2+
if [ $DEBUG_MODE == true ]; then
3+
set -x
4+
fi
25

36
SSH_USER_HOME="${SSH_USER_HOME:-"/home/$SSH_USER"}"
47

@@ -25,6 +28,14 @@ echo "🤖 Setting SSHD configuration..."
2528
echo "HostKey ${SSH_HOST_KEY_DIR}/ssh_host_ed25519_key"
2629
} > /etc/ssh/sshd_config.d/custom.conf
2730

31+
if [ $DEBUG_MODE == true ]; then
32+
echo "🔥🔥🔥 Putting SSH server into Debug Mode..."
33+
{
34+
echo "SyslogFacility AUTHPRIV"
35+
echo "LogLevel DEBUG"
36+
} >> /etc/ssh/sshd_config.d/custom.conf
37+
fi
38+
2839
# Make the SSH directory
2940
mkdir -p $SSH_USER_HOME/.ssh/
3041

src/etc/s6-overlay/scripts/runas-user

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/command/with-contenv bash
22

3+
if [ $DEBUG_MODE == true ]; then
4+
set -x
5+
fi
6+
37
SSH_USER_HOME="${SSH_USER_HOME:-"/home/$SSH_USER"}"
48

59
# Create our SSH user

0 commit comments

Comments
 (0)