-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor and combine client and server.sh
- Loading branch information
1 parent
bffeefa
commit c3c043e
Showing
4 changed files
with
21 additions
and
28 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
APP_MODULE=server.main:app | ||
LOG_LEVEL=${LOG_LEVEL:-info} | ||
HOST=${HOST:-0.0.0.0} | ||
PORT=${APP_PORT:-5555} | ||
RELOAD="--reload" | ||
DEBUG_CMD="" | ||
RATHOLE_MODE=${RATHOLE_MODE:-server} | ||
|
||
apt update && apt install -y nginx | ||
nginx & exec python -m $DEBUG_CMD uvicorn $RELOAD --host $HOST --port $APP_PORT --log-level $LOG_LEVEL "$APP_MODULE" & | ||
|
||
if [[ $RATHOLE_MODE == "server" ]]; then | ||
/app/rathole server.toml | ||
elif [[ $RATHOLE_MODE = "client" ]]; then | ||
/app/rathole client.toml | ||
else | ||
echo "RATHOLE_MODE is set to an invalid value. Exiting." | ||
fi |