diff --git a/scripts/config.sh b/scripts/config.sh index 29ee41a..5f75849 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -2,8 +2,10 @@ # It isn't enough to modify this yet. # You also need to manually update the toes.service file. -HOST="${HOST:-toes@toes.local}" -URL="${URL:-http://toes.local}" +TOES_USER="${TOES_USER:-toes}" +HOST="${HOST:-toes.local}" +SSH_HOST="$TOES_USER@$HOST" +URL="${URL:-http://$HOST}" DEST="${DEST:-~/toes}" DATA_DIR="${DATA_DIR:-~/data}" APPS_DIR="${APPS_DIR:-~/apps}" diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 2521d71..f349f87 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -11,7 +11,7 @@ source "$ROOT_DIR/scripts/config.sh" git push origin main # SSH to target: pull, build, sync apps, restart -ssh "$HOST" DEST="$DEST" APPS_DIR="$APPS_DIR" bash <<'SCRIPT' +ssh "$SSH_HOST" DEST="$DEST" APPS_DIR="$APPS_DIR" bash <<'SCRIPT' set -e cd "$DEST" && git checkout -- bun.lock && git pull origin main && bun install && rm -rf dist && bun run build @@ -35,5 +35,5 @@ done sudo systemctl restart toes.service SCRIPT -echo "=> Deployed to $HOST" +echo "=> Deployed to $SSH_HOST" echo "=> Visit $URL" diff --git a/scripts/remote-install.sh b/scripts/remote-install.sh index 6813a8b..33e36a7 100755 --- a/scripts/remote-install.sh +++ b/scripts/remote-install.sh @@ -9,4 +9,4 @@ ROOT_DIR="$SCRIPT_DIR/.." source "$ROOT_DIR/scripts/config.sh" # Run remote install on the target -ssh "$HOST" "git clone https://git.nose.space/defunkt/toes $DEST && cd $DEST && ./scripts/install.sh" +ssh "$SSH_HOST" "git clone https://git.nose.space/defunkt/toes $DEST && cd $DEST && ./scripts/install.sh" diff --git a/scripts/remote-logs.sh b/scripts/remote-logs.sh index 8bd421d..9863c60 100755 --- a/scripts/remote-logs.sh +++ b/scripts/remote-logs.sh @@ -6,4 +6,4 @@ ROOT_DIR="$SCRIPT_DIR/.." source "$ROOT_DIR/scripts/config.sh" -ssh "$HOST" "journalctl -u toes -n 100" +ssh "$SSH_HOST" "journalctl -u toes -n 100" diff --git a/scripts/remote-restart.sh b/scripts/remote-restart.sh index 5421cf9..d513352 100755 --- a/scripts/remote-restart.sh +++ b/scripts/remote-restart.sh @@ -6,4 +6,4 @@ ROOT_DIR="$SCRIPT_DIR/.." source "$ROOT_DIR/scripts/config.sh" -ssh "$HOST" "sudo systemctl restart toes.service" +ssh "$SSH_HOST" "sudo systemctl restart toes.service" diff --git a/scripts/remote-start.sh b/scripts/remote-start.sh index 2375626..6e6c6e4 100755 --- a/scripts/remote-start.sh +++ b/scripts/remote-start.sh @@ -6,4 +6,4 @@ ROOT_DIR="$SCRIPT_DIR/.." source "$ROOT_DIR/scripts/config.sh" -ssh "$HOST" "sudo systemctl start toes.service" +ssh "$SSH_HOST" "sudo systemctl start toes.service" diff --git a/scripts/remote-stop.sh b/scripts/remote-stop.sh index fb0e5a2..882ae42 100755 --- a/scripts/remote-stop.sh +++ b/scripts/remote-stop.sh @@ -6,4 +6,4 @@ ROOT_DIR="$SCRIPT_DIR/.." source "$ROOT_DIR/scripts/config.sh" -ssh "$HOST" "sudo systemctl stop toes.service" +ssh "$SSH_HOST" "sudo systemctl stop toes.service"