cleanup cli, configs, systemd and readme

This commit is contained in:
2026-04-02 01:18:15 +03:00
parent 7a86519314
commit 50961eb3fc
17 changed files with 741 additions and 294 deletions

19
start.sh Normal file → Executable file
View File

@@ -4,24 +4,25 @@ BASE_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$BASE_DIR"
if [[ ! -d .venv ]]; then
python3 -m venv .venv
python3 -m venv .venv
fi
# shellcheck disable=SC1091
source .venv/bin/activate
python3 -c "import aiohttp, zeroconf" >/dev/null 2>&1 || {
echo "Missing deps in .venv. Run install.sh"
exit 3
echo "Missing deps in .venv. Run install.sh"
exit 3
}
TOKEN="${YANDEX_TOKEN:-}"
if [[ -z "$TOKEN" && -f "$BASE_DIR/token.txt" ]]; then
TOKEN="$(tr -d '\r' < "$BASE_DIR/token.txt")"
TOKEN="$(tr -d '
' < "$BASE_DIR/token.txt")"
fi
if [[ -z "$TOKEN" ]]; then
echo "YANDEX_TOKEN is empty and token.txt not found"
exit 2
echo "YANDEX_TOKEN is empty and token.txt not found"
exit 2
fi
BIND_HOST="${YASTATION_BIND_HOST:-127.0.0.1}"
@@ -29,8 +30,4 @@ BIND_PORT="${YASTATION_BIND_PORT:-9123}"
HTTP_HOST="${YASTATION_HTTP_HOST:-0.0.0.0}"
HTTP_PORT="${YASTATION_HTTP_PORT:-9124}"
exec "$BASE_DIR/.venv/bin/python3" "$BASE_DIR/yastation.py" --token "$TOKEN" serve \
--host "$BIND_HOST" \
--port "$BIND_PORT" \
--http-host "$HTTP_HOST" \
--http-port "$HTTP_PORT"
exec "$BASE_DIR/.venv/bin/python3" "$BASE_DIR/yastation.py" --token "$TOKEN" serve --host "$BIND_HOST" --port "$BIND_PORT" --http-host "$HTTP_HOST" --http-port "$HTTP_PORT"