diff --git a/.DS_Store b/.DS_Store index a36c337..cbfb2bc 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/StiggerDLBot/.claude/settings.local.json b/StiggerDLBot/.claude/settings.local.json index 84b82dd..d440fd5 100644 --- a/StiggerDLBot/.claude/settings.local.json +++ b/StiggerDLBot/.claude/settings.local.json @@ -4,7 +4,12 @@ "Bash(/Users/felixfoertsch/Developer/TelegramStickersDownloaderHTTP/.venv/bin/pip list:*)", "Bash(.venv/bin/pip install:*)", "Bash(python3:*)", - "Bash(.venv/bin/python:*)" + "Bash(.venv/bin/python:*)", + "WebFetch(domain:manual.uberspace.de)", + "Bash(chmod +x:*)", + "WebFetch(domain:lab.uberspace.de)", + "WebSearch", + "WebFetch(domain:u8manual.uberspace.de)" ] } } diff --git a/StiggerDLBot/app/main.py b/StiggerDLBot/app/main.py index cd3ce9a..4745ef7 100644 --- a/StiggerDLBot/app/main.py +++ b/StiggerDLBot/app/main.py @@ -3,7 +3,7 @@ from fastapi.middleware.cors import CORSMiddleware from app.routers import stickersets -app = FastAPI(title="Telegram Stickers API", root_path="/StiggerDLBot") +app = FastAPI(title="Telegram Stickers API") app.add_middleware( CORSMiddleware, diff --git a/StiggerDLBot/deploy.sh b/StiggerDLBot/deploy.sh new file mode 100755 index 0000000..cdbf08a --- /dev/null +++ b/StiggerDLBot/deploy.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +# deploy.sh — deploy sticker-cloner backend to Uberspace 8 +# Usage: ./deploy.sh +set -euo pipefail + +# ── Configuration — edit before first deploy ────────────────────────────────── +UBERSPACE_USER="serve" +UBERSPACE_NODE="prospero.uberspace.de" # SSH node (uberspace dashboard → hostname) +PORT=8080 +URL_PATH="/sticker-cloner" +SERVICE_NAME="sticker-cloner" + +# ── Derived ─────────────────────────────────────────────────────────────────── +REMOTE="${UBERSPACE_USER}@${UBERSPACE_NODE}" +WEB_HOST="${UBERSPACE_USER}.uber.space" +REMOTE_APP_DIR="/home/${UBERSPACE_USER}/services/${SERVICE_NAME}" + +# ── 1. Sync source files ────────────────────────────────────────────────────── +echo "→ syncing app files..." +rsync -az --delete \ + --exclude '.env' \ + --exclude '.venv/' \ + --exclude 'downloads/' \ + --exclude '.cache/' \ + --exclude '__pycache__/' \ + --exclude '*.pyc' \ + --exclude '.DS_Store' \ + --exclude '.git/' \ + --exclude '.idea/' \ + --exclude '.vscode/' \ + --exclude 'deploy.sh' \ + . "${REMOTE}:${REMOTE_APP_DIR}/" + +# ── 2. Upload .env ──────────────────────────────────────────────────────────── +echo "→ uploading .env..." +scp .env "${REMOTE}:${REMOTE_APP_DIR}/.env" + +# ── 3. Push systemd service unit ────────────────────────────────────────────── +echo "→ writing service unit..." +ssh "${REMOTE}" "mkdir -p ~/.config/systemd/user" +cat < ~/.config/systemd/user/${SERVICE_NAME}.service" +[Unit] +Description=sticker-cloner backend + +[Service] +WorkingDirectory=${REMOTE_APP_DIR} +ExecStart=${REMOTE_APP_DIR}/.venv/bin/uvicorn app.main:app --host 0.0.0.0 --port ${PORT} --root-path ${URL_PATH} +Restart=always + +[Install] +WantedBy=default.target +EOF + +# ── 4. Remote provisioning ──────────────────────────────────────────────────── +echo "→ provisioning..." +# XDG_RUNTIME_DIR is required for systemctl --user in non-interactive SSH sessions +ssh "${REMOTE}" bash -l <