From e066f3cac956e20636c8c396a0f907863b138536 Mon Sep 17 00:00:00 2001 From: zabio3 Date: Tue, 2 Apr 2019 20:19:37 +0900 Subject: [PATCH] Add $NGROK_LOOK_DOMAIN --- README.md | 1 + entrypoint.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f1c1da6..6c17469 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Additionally, you can specify one of several environment variable (via `-e`) to * `NGROK_PROTOCOL` - Can either be `HTTP` or `TCP`, and it defaults to `HTTP` if not specified. If set to `TCP`, Ngrok will allocate a port instead of a subdomain and proxy TCP requests directly to your application. * `NGROK_PORT` - Port to expose (defaults to `80` for `HTTP` protocol). If the server is non-local, the hostname can also be specified, e.g. `192.168.0.102:80`. * `NGROK_REGION` - Location of the ngrok tunnel server; can be `us` (United States, default), `eu` (Europe), `ap` (Asia/Pacific) or `au` (Australia) + * `NGROK_LOOK_DOMAIN` - This is the domain name referred to by ngrok. (default: localhost). * `NGROK_BINDTLS` - Toggle tunneling only HTTP or HTTPS traffic. When `true`, Ngrok only opens the HTTPS endpoint. When `false`, Ngrok only opens the HTTP endpoint #### Full example diff --git a/entrypoint.sh b/entrypoint.sh index 98a8a71..ac473de 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -85,7 +85,12 @@ if [ -z "$NGROK_PORT" ]; then echo "You must specify a NGROK_PORT to expose." exit 1 fi -ARGS="$ARGS `echo $NGROK_PORT | sed 's|^tcp://||'`" + +if [ -n "$NGROK_LOOK_DOMAIN" ]; then + ARGS="$ARGS `echo $NGROK_LOOK_DOMAIN:$NGROK_PORT | sed 's|^tcp://||'`" +else + ARGS="$ARGS `echo $NGROK_PORT | sed 's|^tcp://||'`" +fi set -x exec $ARGS