Remove redundant cursor styling
This commit is contained in:
parent
080b4bdaf1
commit
b24dd72ae0
93 changed files with 9058 additions and 1 deletions
74
clio-infra/scripts/deploy-api-server.sh
Executable file
74
clio-infra/scripts/deploy-api-server.sh
Executable file
|
|
@ -0,0 +1,74 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Deployment script for phone-recorder server
|
||||
# Target: thallock@10.0.0.45 (SSH port 2252)
|
||||
#
|
||||
# Paths on server:
|
||||
# Code: /work/hosting/recordings
|
||||
# Data (db): /work/hosting/recordings/data
|
||||
# Audio: /media/external/Hosting/Recordings
|
||||
|
||||
SERVER_HOST="10.0.0.45"
|
||||
SERVER_USER="thallock"
|
||||
SERVER_PORT="2252"
|
||||
CODE_DIR="/work/hosting/recordings"
|
||||
DATA_DIR="/work/hosting/recordings/data"
|
||||
AUDIO_DIR="/media/external/Hosting/Recordings"
|
||||
|
||||
SSH_OPTS="-p ${SERVER_PORT}"
|
||||
SSH_CMD="ssh ${SSH_OPTS} ${SERVER_USER}@${SERVER_HOST}"
|
||||
RSYNC_SSH="ssh -p ${SERVER_PORT}"
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
echo "=== Deploying phone-recorder server to ${SERVER_USER}@${SERVER_HOST} ==="
|
||||
|
||||
# Sync server code (excluding local data)
|
||||
echo "Syncing server code..."
|
||||
rsync -avz --delete \
|
||||
--exclude '.venv' \
|
||||
--exclude '__pycache__' \
|
||||
--exclude '*.pyc' \
|
||||
--exclude 'recordings/' \
|
||||
--exclude 'recordings.db' \
|
||||
--exclude 'keys/' \
|
||||
--exclude 'data/' \
|
||||
--exclude '.git' \
|
||||
--exclude 'nixos/' \
|
||||
-e "${RSYNC_SSH}" \
|
||||
"${SCRIPT_DIR}/" \
|
||||
"${SERVER_USER}@${SERVER_HOST}:${CODE_DIR}/"
|
||||
|
||||
echo "Setting up on remote server..."
|
||||
${SSH_CMD} bash << REMOTE_SCRIPT
|
||||
set -euo pipefail
|
||||
|
||||
# Create directories
|
||||
mkdir -p ${DATA_DIR}/keys
|
||||
mkdir -p ${AUDIO_DIR}
|
||||
|
||||
cd ${CODE_DIR}
|
||||
|
||||
# Sync dependencies
|
||||
echo "Syncing Python dependencies..."
|
||||
uv sync
|
||||
|
||||
echo ""
|
||||
echo "=== Server code deployed ==="
|
||||
echo "Code: ${CODE_DIR}"
|
||||
echo "Data: ${DATA_DIR}"
|
||||
echo "Audio: ${AUDIO_DIR}"
|
||||
echo ""
|
||||
echo "To install/update systemd service:"
|
||||
echo " sudo cp ${CODE_DIR}/nixos/phone-recorder.service /etc/systemd/system/"
|
||||
echo " sudo systemctl daemon-reload"
|
||||
echo " sudo systemctl enable --now phone-recorder"
|
||||
echo ""
|
||||
echo "To check status:"
|
||||
echo " sudo systemctl status phone-recorder"
|
||||
echo " curl http://localhost:8000/health"
|
||||
REMOTE_SCRIPT
|
||||
|
||||
echo ""
|
||||
echo "=== Deployment complete ==="
|
||||
Loading…
Add table
Add a link
Reference in a new issue