Erfan commited on
Commit
263e530
·
1 Parent(s): 91f7053

feat: add HestiaCP deployment config, remove Render files

Browse files
Files changed (9) hide show
  1. .env.example +2 -2
  2. .gitignore +1 -0
  3. Aptfile +0 -1
  4. deploy/nginx.conf +24 -0
  5. deploy/setup.sh +23 -0
  6. deploy/start.sh +5 -0
  7. deploy/stop.sh +3 -0
  8. render.yaml +0 -17
  9. runtime.txt +0 -1
.env.example CHANGED
@@ -1,5 +1,5 @@
1
  BALE_TOKEN=123456789:abcdIuZmK5qNEm2A1BhUaAg7MPJv1O9KCcBQB2ro
2
  OPENAI_API_KEY=sk-your-openai-api-key
3
- WEBHOOK_URL=https://your-app.onrender.com
4
- APP_URL=https://your-app.onrender.com
5
  ADMIN_IDS=123456789,987654321
 
1
  BALE_TOKEN=123456789:abcdIuZmK5qNEm2A1BhUaAg7MPJv1O9KCcBQB2ro
2
  OPENAI_API_KEY=sk-your-openai-api-key
3
+ WEBHOOK_URL=https://your-domain.com
4
+ APP_URL=https://your-domain.com
5
  ADMIN_IDS=123456789,987654321
.gitignore CHANGED
@@ -5,3 +5,4 @@ __pycache__/
5
  data/
6
  /tmp/
7
  *.db
 
 
5
  data/
6
  /tmp/
7
  *.db
8
+ bot.log
Aptfile DELETED
@@ -1 +0,0 @@
1
- ffmpeg
 
 
deploy/nginx.conf ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 80;
3
+ listen [::]:80;
4
+ server_name your-domain.com;
5
+
6
+ client_max_body_size 0;
7
+
8
+ location / {
9
+ proxy_pass http://127.0.0.1:8001;
10
+ proxy_http_version 1.1;
11
+ proxy_set_header Upgrade $http_upgrade;
12
+ proxy_set_header Connection "upgrade";
13
+ proxy_set_header Host $host;
14
+ proxy_set_header X-Real-IP $remote_addr;
15
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
16
+ proxy_set_header X-Forwarded-Proto $scheme;
17
+ proxy_read_timeout 300s;
18
+ proxy_send_timeout 300s;
19
+ }
20
+
21
+ location /static/ {
22
+ alias /home/h000773/web/your-domain.com/public_html/static/;
23
+ }
24
+ }
deploy/setup.sh ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "=== YouTubeBot Setup for HestiaCP ==="
5
+
6
+ cd "$(dirname "$0")/.."
7
+
8
+ python3 -m venv venv
9
+ source venv/bin/activate
10
+
11
+ pip install --upgrade pip
12
+ pip install -r requirements.txt
13
+
14
+ cp .env.example .env
15
+ echo ""
16
+ echo "=== IMPORTANT ==="
17
+ echo "Edit the .env file with your actual credentials:"
18
+ echo " nano .env"
19
+ echo ""
20
+ echo "Then run: bash deploy/start.sh"
21
+ echo ""
22
+ echo "To set the webhook, visit:"
23
+ echo " https://your-domain.com/set-webhook"
deploy/start.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ cd "$(dirname "$0")/.."
3
+ source venv/bin/activate
4
+ nohup uvicorn main:app --host 127.0.0.1 --port 8001 --workers 1 > bot.log 2>&1 &
5
+ echo "Bot started on port 8001, PID: $!"
deploy/stop.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #!/bin/bash
2
+ pkill -f "uvicorn main:app"
3
+ echo "Bot stopped"
render.yaml DELETED
@@ -1,17 +0,0 @@
1
- services:
2
- - type: web
3
- name: youtube-bot
4
- env: python
5
- buildCommand: pip install -r requirements.txt
6
- startCommand: uvicorn main:app --host 0.0.0.0 --port $PORT
7
- envVars:
8
- - key: BALE_TOKEN
9
- sync: false
10
- - key: OPENAI_API_KEY
11
- sync: false
12
- - key: WEBHOOK_URL
13
- sync: false
14
- - key: APP_URL
15
- sync: false
16
- - key: ADMIN_IDS
17
- sync: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
runtime.txt DELETED
@@ -1 +0,0 @@
1
- 3.11.0