diff --git a/test/test-local.sh b/test/test-local.sh index 95c24b8fc..61fd12634 100755 --- a/test/test-local.sh +++ b/test/test-local.sh @@ -1,12 +1,18 @@ #!/bin/bash # This script will make your local Owncast server available at a public URL. -# It's particularly useful for testing on mobile devices. +# It's particularly useful for testing on mobile devices or want to test +# activitypub integration. PORT=8080 -USERNAME=$(whoami) -BRANCH=$(git symbolic-ref --short -q HEAD | sed 's/[^a-z A-Z 0-9]//g') -HOSTNAME="oc-$USERNAME-$BRANCH" +HOST="localhost" -echo "Please wait. Making the local server port $PORT available at https://$HOSTNAME.serveo.net" -ssh -R "$HOSTNAME".serveo.net:80:localhost:$PORT serveo.net +# Using nc (netcat) to check if the port is open +if nc -zv $HOST $PORT 2>/dev/null; then + echo "Your web server is running on port $PORT. Good." +else + echo "Please make sure your Owncast server is running on port $PORT." + exit 1 +fi + +ssh -R 80:localhost:$PORT localhost.run