-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·76 lines (67 loc) · 1.88 KB
/
setup.sh
File metadata and controls
executable file
·76 lines (67 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# Setup script for Telegram Service
echo "🚀 Telegram Service Setup Script"
echo "================================="
echo ""
# Check Python version
echo "✓ Checking Python version..."
python_version=$(python3 --version 2>&1 | awk '{print $2}')
echo " Python version: $python_version"
echo ""
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
echo " ✓ Virtual environment created"
else
echo "✓ Virtual environment already exists"
fi
echo ""
# Activate virtual environment
echo "🔌 Activating virtual environment..."
source venv/bin/activate
echo " ✓ Activated"
echo ""
# Install dependencies
echo "📥 Installing dependencies..."
pip install -r requirements.txt
echo " ✓ Dependencies installed"
echo ""
# Check if .env exists
if [ ! -f ".env" ]; then
echo "⚙️ Creating .env file from .env.example..."
cp .env.example .env
echo " ✓ .env file created"
echo ""
echo "⚠️ IMPORTANT: Please edit .env file and set your configuration:"
echo " - TELEGRAM_API_ID"
echo " - TELEGRAM_API_HASH"
echo " - LARAVEL_BASE_URL"
echo " - WEBHOOK_SECRET_TOKEN"
echo " - API_SECRET_KEY"
echo ""
else
echo "✓ .env file already exists"
echo ""
fi
# Create sessions directory
if [ ! -d "sessions" ]; then
echo "📁 Creating sessions directory..."
mkdir -p sessions
echo " ✓ Sessions directory created"
else
echo "✓ Sessions directory already exists"
fi
echo ""
echo "✅ Setup completed successfully!"
echo ""
echo "Next steps:"
echo "1. Edit .env file with your credentials"
echo "2. Get Telegram API credentials from https://my.telegram.org"
echo "3. Run the service:"
echo " python -m app.main"
echo " or"
echo " uvicorn app.main:app --reload"
echo ""
echo "📖 For more information, read README.md"
echo ""