From 5b8901701bc886cb65ccbf342edd3039300d54de Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Sun, 18 Dec 2022 10:20:51 +0100 Subject: [PATCH] #160 fix 500 TERM error (#175) * #160 fix 500 TERM error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- README.md | 2 +- app/system/impl/raspiblitz.py | 2 ++ scripts/sync_to_blitz.sh | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29d726b..5cbe910 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ localIP="192.168.178.61" sshPort="22" passwordA="" -Then you can run always `make sync_to_blitz` to copy your latest code over to your RaspiBlitz. The script automatically restarts the backend API with the new code on your RaspiBlitz and shows you the logs. +Then you can run always `make sync-to-blitz` to copy your latest code over to your RaspiBlitz. The script automatically restarts the backend API with the new code on your RaspiBlitz and shows you the logs. To test the backend API then call the SwaggerUI: `http://[LOCALIP]/api/v1/docs` - to call protected endpoints run the `/system/login` endpoint first with HTTP POST body: ``` diff --git a/app/system/impl/raspiblitz.py b/app/system/impl/raspiblitz.py index 7ced4b3..3fea0ec 100644 --- a/app/system/impl/raspiblitz.py +++ b/app/system/impl/raspiblitz.py @@ -35,6 +35,8 @@ GET_DEBUG_LOG_SCRIPT = os.path.join( SHELL_SCRIPT_PATH, "config.scripts", "blitz.debug.sh" ) +os.environ["TERM"] = "xterm" + class RaspiBlitzSystem(SystemBase): def __init__(self) -> None: diff --git a/scripts/sync_to_blitz.sh b/scripts/sync_to_blitz.sh index a3a2f1d..9ea22c7 100644 --- a/scripts/sync_to_blitz.sh +++ b/scripts/sync_to_blitz.sh @@ -57,12 +57,15 @@ rm -r ./app/routers/__pycache__ 2>/dev/null rm -r ./app/auth/__pycache__ 2>/dev/null # make sure remote repo files can be overwritten bei user admin +echo "# sshpass Test" sshpass -p "$passwordA" ssh -p $sshPort admin@$localIP "sudo chown -R admin:admin ${remoteRepoPath}" result=$? echo "result(${result})" if [ "$result" != "0" ]; then echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "FAIL: was not able to ssh in: ssh -p ${sshPort} admin@$localIP" + echo "Is password correct? --> ${passwordA}" + echo "Too often wrong password? Wait a bit." echo "SSH in once manually. Then try again." exit 1 fi