Skip to content

Commit 9bad6f7

Browse files
committed
add doc
1 parent 886494b commit 9bad6f7

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ Containers are configured using parameters passed at runtime (such as those abov
171171
| `-e PASSWORD_ACCESS=false` | Set to `true` to allow user/password ssh access. You will want to set `USER_PASSWORD` or `USER_PASSWORD_FILE` as well. |
172172
| `-e USER_PASSWORD=password` | Optionally set a sudo password for `linuxserver.io`, the ssh user. If this or `USER_PASSWORD_FILE` are not set but `SUDO_ACCESS` is set to true, the user will have passwordless sudo access. |
173173
| `-e USER_PASSWORD_FILE=/path/to/file` | Optionally specify a file that contains the password. This setting supersedes the `USER_PASSWORD` option (works with docker secrets). |
174+
| `-e TRUSTED_USER_CA_KEYS=yourtrustedcakeys` | Optionally trusted user CA keys, which will automatically be added to trusted user CA keys. |
175+
| `-e TRUSTED_USER_CA_KEYS_FILE=/path/to/file` | Optionally specify a file containing the trusted user CA keys (works with docker secrets). |
176+
| `-e AUTHORIZED_PRINCIPALS=` | Optionally specify a list of authorized principals. Space-separated list. |
177+
| `-e AUTHORIZED_PRINCIPALS_FILE=/path/to/file` | Optionally specify a file containing a list of authorized principals. |
178+
| `-e ADD_DEFAULT_USER_TO_AUTHORIZED_PRINCIPALS=false` | Set to `true` to add the default user to the list of authorized principals. |
174179
| `-e USER_NAME=linuxserver.io` | Optionally specify a user name (Default:`linuxserver.io`) |
175180
| `-e LOG_STDOUT=` | Set to `true` to log to stdout instead of file. |
176181
| `-v /config` | Contains all relevant configuration files. |

readme-vars.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ opt_param_env_vars:
3636
- {env_var: "USER_PASSWORD_FILE", env_value: "/path/to/file", desc: "Optionally specify a file that contains the password. This setting supersedes the `USER_PASSWORD` option (works with docker secrets)."}
3737
- {env_var: "USER_NAME", env_value: "linuxserver.io", desc: "Optionally specify a user name (Default:`linuxserver.io`)"}
3838
- {env_var: "LOG_STDOUT", env_value: "", desc: "Set to `true` to log to stdout instead of file."}
39+
- {env_var: "TRUSTED_USER_CA_KEYS", env_value: "", desc: "Optionally trusted user CA keys, which will automatically be added to trusted user CA keys."}
40+
- {env_var: "TRUSTED_USER_CA_KEYS_FILE", env_value: "/path/to/file", desc: "Optionally specify a file containing the trusted user CA keys (works with docker secrets)."}
41+
- {env_var: "AUTHORIZED_PRINCIPALS", env_value: "", desc: "Optionally specify a list of authorized principals. space separated list."}
42+
- {env_var: "AUTHORIZED_PRINCIPALS_FILE", env_value: "/path/to/file", desc: "Optionally specify a file containing a list of authorized principals."}
43+
- {env_var: "ADD_DEFAULT_USER_TO_AUTHORIZED_PRINCIPALS", env_value: "false", desc: "Set to `true` to add the default user to the list of authorized principals."}
3944
# application setup block
4045
app_setup_block_enabled: true
4146
app_setup_block: |

root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,17 @@ fi
142142
# set authorized principals
143143
if [[ -n "$AUTHORIZED_PRINCIPALS" ]]; then
144144
touch /config/.ssh/authorized_principals
145-
if ! grep -q "${AUTHORIZED_PRINCIPALS}" /config/.ssh/authorized_principals; then
146-
echo "$AUTHORIZED_PRINCIPALS" >> /config/.ssh/authorized_principals
147-
echo "Authorized principals added"
148-
fi
145+
146+
for principal in $AUTHORIZED_PRINCIPALS; do
147+
echo "$principal" >> /config/.ssh/authorized_principals
148+
echo "add $principal Authorized principals added"
149+
done
149150
fi
150151

151152
if [[ -n "$AUTHORIZED_PRINCIPALS_FILE" ]] && [[ -f "$AUTHORIZED_PRINCIPALS_FILE" ]]; then
152153
touch /config/.ssh/authorized_principals
153-
AUTHORIZED_PRINCIPALS2=$(cat "$AUTHORIZED_PRINCIPALS_FILE")
154-
if ! grep -q "$AUTHORIZED_PRINCIPALS2" /config/.ssh/authorized_principals; then
155-
echo "$AUTHORIZED_PRINCIPALS2" >> /config/.ssh/authorized_principals
156-
echo "Authorized principals from file added"
157-
fi
154+
cat $AUTHORIZED_PRINCIPALS_FILE >> /config/.ssh/authorized_principals
155+
echo "Authorized principals from file added"
158156
fi
159157

160158
if [[ "$ADD_DEFAULT_USER_TO_AUTHORIZED_PRINCIPALS" == "true" ]]; then

0 commit comments

Comments
 (0)