To use when the websocket isn't on the same host. This is needed for docker-compose settings where the ssh server and the websocket are on two separate services. Mutualy exclusive with `HAS_WEBSOCKET=1` which is the same as `WEBSOCKET_HOSTNAME=localhost`.
25 lines
576 B
Bash
Executable File
25 lines
576 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
if [ "${USE_PROXY_PROTOCOL}" -eq "1" ]; then
|
|
set -- -x "$@"
|
|
fi
|
|
|
|
if [ "${HAS_WEBSOCKET}" -eq "1" ]; then
|
|
set -- -w localhost "$@"
|
|
fi
|
|
|
|
if [ -n "${WEBSOCKET_HOSTNAME}" ]; then
|
|
set -- -w "${WEBSOCKET_HOSTNAME}" "$@"
|
|
fi
|
|
|
|
if [ ! -z "${SSH_HOSTNAME}" ]; then
|
|
set -- -h "${SSH_HOSTNAME}" "$@"
|
|
fi
|
|
|
|
SSH_PORT_LISTEN=${SSH_PORT_LISTEN:-2200}
|
|
SSH_PORT_ADVERTIZE=${SSH_PORT_ADVERTIZE:-${SSH_PORT_LISTEN}}
|
|
SSH_PORT_ADVERTISE=${SSH_PORT_ADVERTISE:-${SSH_PORT_ADVERTIZE}}
|
|
|
|
exec tmate-ssh-server -p ${SSH_PORT_LISTEN} -q ${SSH_PORT_ADVERTISE} -k ${SSH_KEYS_PATH} "$@"
|