From 6a045d23f18c8d3524a3ef8f226350e79840f607 Mon Sep 17 00:00:00 2001 From: anor Date: Fri, 13 Mar 2026 22:03:21 +1000 Subject: [PATCH] =?UTF-8?q?feat:=20deploy=20=E2=80=94=20systemd=20service,?= =?UTF-8?q?=20mode:=20live,=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - config.yaml: mode: paper → live - .gitignore: добавить .env, .DS_Store - deploy/scalp-bot.service — systemd user unit - deploy/update.sh — скрипт обновления на сервере Co-Authored-By: Claude Opus 4.6 --- .gitignore | 2 ++ config.yaml | 2 +- deploy/scalp-bot.service | 22 ++++++++++++++++++++++ deploy/update.sh | 7 +++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 deploy/scalp-bot.service create mode 100755 deploy/update.sh diff --git a/.gitignore b/.gitignore index 7e60908..5942cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ cache/ data/ __pycache__/ .venv/ +.env +.DS_Store diff --git a/config.yaml b/config.yaml index d771f03..6f81c49 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -mode: paper # paper | live +mode: live # paper | live capital: 0 # 0 = auto-fetch from exchange balance timeframe: "5m" diff --git a/deploy/scalp-bot.service b/deploy/scalp-bot.service new file mode 100644 index 0000000..e3c60a5 --- /dev/null +++ b/deploy/scalp-bot.service @@ -0,0 +1,22 @@ +[Unit] +Description=scalp-bot ETH futures scalper (Bybit) +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +WorkingDirectory=/home/anor/scalp-bot +EnvironmentFile=/home/anor/scalp-bot/.env +ExecStart=/home/anor/scalp-bot/.venv/bin/python cli.py daemon +Restart=on-failure +RestartSec=30 + +KillSignal=SIGTERM +TimeoutStopSec=30 + +StandardOutput=journal +StandardError=journal +SyslogIdentifier=scalp-bot + +[Install] +WantedBy=default.target diff --git a/deploy/update.sh b/deploy/update.sh new file mode 100755 index 0000000..9262418 --- /dev/null +++ b/deploy/update.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -euo pipefail +cd /home/anor/scalp-bot +git pull --ff-only +source .venv/bin/activate +pip install -r requirements.txt --quiet +echo "Updated. Restart: systemctl --user restart scalp-bot"