sshpiper/entrypoint.sh
Vlastimil Holer 2256c137c8
allow override sshpiperd container arguments (#216)
To be able to still execute the entrypoint (and any logic which is/will be
there), but completely override the sshpiperd arguments only. So,
customizing the plugins usage should be easy.

Example:

```
$ docker run --rm -it localhost/sshpiperd:test
INFO[0000] starting sshpiperd version: devel, fc6c3e1e9, 2023-08-30T14:31:06Z, go1.21.0
INFO[0000] generating host key /etc/ssh/ssh_host_ed25519_key
INFO[0000] found host keys [/etc/ssh/ssh_host_ed25519_key]
INFO[0000] loading host key /etc/ssh/ssh_host_ed25519_key
INFO[0000] starting child process plugin: [/sshpiperd/plugins/workingdir]
INFO[0000] sshpiperd is listening on: [::]:2222
^C
```

```
$ docker run --rm -it localhost/sshpiperd:test /sshpiperd/plugins/workingdir -- /sshpiperd/plugins/failtoban
INFO[0000] starting sshpiperd version: devel, fc6c3e1e9, 2023-08-30T14:31:06Z, go1.21.0
INFO[0000] generating host key /etc/ssh/ssh_host_ed25519_key
INFO[0000] found host keys [/etc/ssh/ssh_host_ed25519_key]
INFO[0000] loading host key /etc/ssh/ssh_host_ed25519_key
INFO[0000] starting child process plugin: [/sshpiperd/plugins/workingdir]
INFO[0000] starting child process plugin: [/sshpiperd/plugins/failtoban]
INFO[0000] sshpiperd is listening on: [::]:2222
^C
```
2023-08-30 10:44:37 -07:00

7 lines
No EOL
203 B
Bash
Executable file

#!/bin/sh
set -eo pipefail
PLUGIN=${PLUGIN:-workingdir}
export SSHPIPERD_SERVER_KEY_GENERATE_MODE=${SSHPIPERD_SERVER_KEY_GENERATE_MODE:-notexist}
/sshpiperd/sshpiperd "${@:-/sshpiperd/plugins/$PLUGIN}"