From 7482a610b63eda8c5f0d8b045bd3ae368b266b52 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Fri, 31 Jan 2025 19:22:44 -0800 Subject: [PATCH] chore(test): add support for passing custom domain and port to test script --- test/test-local.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/test-local.sh b/test/test-local.sh index 61fd12634..f554fd3bc 100755 --- a/test/test-local.sh +++ b/test/test-local.sh @@ -3,8 +3,14 @@ # This script will make your local Owncast server available at a public URL. # It's particularly useful for testing on mobile devices or want to test # activitypub integration. +# Pass a custom domain as an argument if you have previously set it up at +# localhost.run. Otherwise, a random hostname will be generated. +# DOMAIN=me.example.com ./test/test-local.sh +# Pass a port number as an argument if you are running Owncast on a different port. +# By default, it will use port 8080. +# PORT=8080 ./test/test-local.sh -PORT=8080 +PORT="${PORT:=8080}" HOST="localhost" # Using nc (netcat) to check if the port is open @@ -15,4 +21,11 @@ else exit 1 fi -ssh -R 80:localhost:$PORT localhost.run +if [ -n "$DOMAIN" ]; then + echo "Attempting to use custom domain: $DOMAIN" + ssh -R $DOMAIN:80:localhost:$PORT localhost.run + +else + echo "Using auto-generated hostname for tunnel." + ssh -R 80:localhost:$PORT localhost.run +fi