Files
tmate-ssh-server/docker-entrypoint.sh
Gilles Filippini 511fd2bd85 Docker: add variable WEBSOCKET_HOSTNAME
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`.
2021-03-21 13:57:32 -04:00

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} "$@"