Initial commit: Batch Bot - Telegram Comment Bot
0.0.1 Features: - Multi-account support via session files - AI comments generation via Ollama (local LLM) - Telegram bot for moderation (approve/reject/regenerate) - Docker support (controller + worker) - Auto-join public groups - Comment regeneration on group re-add - Statistics tracking Tech stack: - Python 3.11 - Telethon 1.34 (Telegram user client) - Aiogram 3.4 (Telegram bot framework) - SQLite (Database) - Docker & Docker Compose - Ollama (Local LLM)
This commit is contained in:
167
GIT_INSTRUCTIONS.md
Normal file
167
GIT_INSTRUCTIONS.md
Normal file
@@ -0,0 +1,167 @@
|
||||
# Инструкция по отправке в Gitea
|
||||
|
||||
## 1. Инициализация Git
|
||||
|
||||
```bash
|
||||
cd /Users/bilal/Documents/code/batch-bot
|
||||
|
||||
# Инициализация репозитория
|
||||
git init
|
||||
|
||||
# Проверка статуса
|
||||
git status
|
||||
```
|
||||
|
||||
## 2. Добавление файлов
|
||||
|
||||
```bash
|
||||
# Добавить все файлы
|
||||
git add .
|
||||
|
||||
# Или выборочно:
|
||||
git add README.md
|
||||
git add bot/
|
||||
git add docker-compose.yml
|
||||
git add Dockerfile
|
||||
git add requirements.txt
|
||||
git add auth.py
|
||||
git add prompt.txt
|
||||
git add .env.example
|
||||
git add .gitignore
|
||||
git add DOCKER.md
|
||||
git add QUICKSTART.md
|
||||
|
||||
# Проверка что будет закоммичено
|
||||
git status
|
||||
```
|
||||
|
||||
## 3. Первый коммит
|
||||
|
||||
```bash
|
||||
git commit -m "Initial commit: Batch Bot - Telegram Comment Bot
|
||||
|
||||
Features:
|
||||
- Multi-account support
|
||||
- AI comments via Ollama
|
||||
- Moderation via Telegram bot
|
||||
- Docker support
|
||||
- Auto-join groups
|
||||
- Comment regeneration
|
||||
|
||||
Tech stack:
|
||||
- Python 3.11
|
||||
- Telethon (Telegram client)
|
||||
- Aiogram (Bot framework)
|
||||
- SQLite (Database)
|
||||
- Docker & Docker Compose"
|
||||
```
|
||||
|
||||
## 4. Добавление удалённого репозитория
|
||||
|
||||
```bash
|
||||
# Добавить remote
|
||||
git remote add origin https://git.core.com.ru/bilal/batch-bot.git
|
||||
|
||||
# Или по SSH:
|
||||
git remote add origin ssh://git@git.core.com.ru/bilal/batch-bot.git
|
||||
|
||||
# Проверка
|
||||
git remote -v
|
||||
```
|
||||
|
||||
## 5. Отправка в Gitea
|
||||
|
||||
```bash
|
||||
# Отправка main ветки
|
||||
git push -u origin main
|
||||
|
||||
# Если ветка называется master:
|
||||
git branch -M main
|
||||
git push -u origin main
|
||||
```
|
||||
|
||||
## 6. Последующие изменения
|
||||
|
||||
```bash
|
||||
# Внесение изменений
|
||||
# ... редактирование файлов ...
|
||||
|
||||
# Добавление изменений
|
||||
git add .
|
||||
|
||||
# Коммит
|
||||
git commit -m "Описание изменений"
|
||||
|
||||
# Отправка
|
||||
git push
|
||||
```
|
||||
|
||||
## 📋 Что НЕ попадает в репозиторий:
|
||||
|
||||
- ✅ `.env` — содержит секреты
|
||||
- ✅ `sessions/*.session` — файлы сессий
|
||||
- ✅ `data/comments.db` — база данных
|
||||
- ✅ `logs/` — логи
|
||||
- ✅ `__pycache__/` — кэш Python
|
||||
- ✅ `.DS_Store` — системные файлы
|
||||
|
||||
## 🔐 Проверка перед отправкой
|
||||
|
||||
```bash
|
||||
# Проверить что не попадает в репозиторий
|
||||
git status
|
||||
|
||||
# Проверить .gitignore
|
||||
git check-ignore -v .env
|
||||
git check-ignore -v sessions/
|
||||
git check-ignore -v data/
|
||||
```
|
||||
|
||||
## 📊 Структура в Gitea
|
||||
|
||||
После отправки в репозитории будет:
|
||||
|
||||
```
|
||||
batch-bot/
|
||||
├── README.md # Документация
|
||||
├── DOCKER.md # Docker инструкция
|
||||
├── QUICKSTART.md # Быстрый старт
|
||||
├── .env.example # Пример конфигурации
|
||||
├── .gitignore
|
||||
├── docker-compose.yml
|
||||
├── Dockerfile
|
||||
├── requirements.txt
|
||||
├── auth.py
|
||||
├── prompt.txt
|
||||
└── bot/
|
||||
├── config.py
|
||||
├── controller.py
|
||||
├── worker.py
|
||||
├── db.py
|
||||
├── keyboard.py
|
||||
├── ollama.py
|
||||
├── session_manager.py
|
||||
└── __init__.py
|
||||
```
|
||||
|
||||
## 🚀 Развёртывание из Gitea
|
||||
|
||||
На сервере:
|
||||
|
||||
```bash
|
||||
# Клонирование
|
||||
git clone https://git.core.com.ru/bilal/batch-bot.git
|
||||
cd batch-bot
|
||||
|
||||
# Настройка
|
||||
cp .env.example .env
|
||||
nano .env
|
||||
|
||||
# Создание сессий
|
||||
pip install -r requirements.txt
|
||||
python auth.py
|
||||
|
||||
# Запуск
|
||||
docker-compose build
|
||||
docker-compose up -d
|
||||
```
|
||||
Reference in New Issue
Block a user