-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cookie-based authentication while still supporting basic auth headers Fix quicktunnel startup logic Replace lsof with fuser for killing processes Check network volumes for compatibility with permissions changes update docs to reflect recent changes
- Loading branch information
1 parent
99344bc
commit 9d01acc
Showing
13 changed files
with
152 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
direct-url.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
trap cleanup EXIT | ||
|
||
function cleanup() { | ||
kill $(jobs -p) >/dev/null 2>&1 | ||
} | ||
|
||
unset -v port | ||
unset -v url | ||
|
||
metrics="" | ||
while getopts l:p: flag | ||
do | ||
case "${flag}" in | ||
l) location="${OPTARG}";; | ||
p) port="${OPTARG}";; | ||
esac | ||
done | ||
|
||
if [[ -z $port ]]; then | ||
printf "port (-p) is required\n" | ||
exit 1 | ||
fi | ||
|
||
function get_url { | ||
# Vast.ai | ||
if [[ $DIRECT_ADDRESS == "auto#vast-ai" ]]; then | ||
declare -n vast_mapped_port=VAST_TCP_PORT_${port} | ||
if [[ -n $vast_mapped_port && -n $PUBLIC_IPADDR ]]; then | ||
url="http://${PUBLIC_IPADDR}:${vast_mapped_port}" | ||
fi | ||
# Runpod.io | ||
elif [[ $DIRECT_ADDRESS == "auto#runpod-io" ]]; then | ||
declare -n runpod_mapped_port=RUNPOD_TCP_PORT_${port} | ||
if [[ -n $runpod_mapped_port && -n $RUNPOD_PUBLIC_IP ]]; then | ||
url="http://${RUNPOD_PUBLIC_IP}:${runpod_mapped_port}" | ||
elif [[ -n $RUNPOD_POD_ID ]]; then | ||
url="https://${RUNPOD_POD_ID}-${port}.proxy.runpod.net" | ||
fi | ||
# Other cloud / local | ||
else | ||
url="http://${DIRECT_ADDRESS}:${port}" | ||
fi | ||
|
||
if [[ -n $url ]]; then | ||
printf "%s%s\n" "$url" "$location" | ||
exit 0 | ||
else | ||
printf "Could not create URL\n" | ||
exit 1 | ||
fi | ||
} | ||
|
||
get_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.