From 73e46186c2c5f6352f8481e0788f67ee13b69cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20F=C3=B6rtsch?= Date: Sun, 1 Mar 2026 11:44:26 +0100 Subject: [PATCH] sync current state --- .DS_Store | Bin 6148 -> 6148 bytes StiggerDLBot/.claude/settings.local.json | 7 +- StiggerDLBot/app/main.py | 2 +- StiggerDLBot/deploy.sh | 84 +++++++++++++++++++++++ 4 files changed, 91 insertions(+), 2 deletions(-) create mode 100755 StiggerDLBot/deploy.sh diff --git a/.DS_Store b/.DS_Store index a36c337ed384d614f8a661c4666535e32267d45c..cbfb2bc660784c1ae799f67c3d6fda7f95f94324 100644 GIT binary patch delta 192 zcmZoMXffEJ#uPihoq>UYg+Y%YogtHpF$=H$9#)A!=ZE16_Okd4>9v@>QC(0Hf>!dzqteq;k#tRHMn NWM0OynT_KgKLF9!IuHN= delta 192 zcmZoMXffEJ#uPiNl!1YPg+Y%YogtH!$rp(QRP$c$`@o9 z1}Ep|76A1yFfe_Xyn;z~@&YDfrk7TeS2D?nARF)dyHQee!Er~Z1j1Zo34UY)S*$N? OPGnxjvYCzJA3p&2@i}h* 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 <