Add setup documentation
Browse files
SETUP.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OpenCode Space - 24/7 Keep-Alive Setup
|
| 2 |
+
|
| 3 |
+
## Your Space URLs
|
| 4 |
+
- **Web UI**: https://abbasyk60-opencode.static.hf.space
|
| 5 |
+
- **Space Settings**: https://huggingface.co/spaces/abbasyk60/opencode
|
| 6 |
+
|
| 7 |
+
## Static Spaces Don't Sleep!
|
| 8 |
+
|
| 9 |
+
Good news: Your Space is a **Static Space**, which means:
|
| 10 |
+
- It's served directly by HuggingFace's CDN
|
| 11 |
+
- It does NOT have a runtime that can sleep
|
| 12 |
+
- It's always available at the URL above
|
| 13 |
+
|
| 14 |
+
The only way it would go down is if you delete it.
|
| 15 |
+
|
| 16 |
+
## For Extra Safety: Set Up Free Monitoring
|
| 17 |
+
|
| 18 |
+
### Option 1: UptimeRobot (Easiest - 2 minutes setup)
|
| 19 |
+
|
| 20 |
+
1. Go to **https://uptimerobot.com**
|
| 21 |
+
2. Sign up for free
|
| 22 |
+
3. Click **"+ Add New Monitor"**
|
| 23 |
+
4. Fill in:
|
| 24 |
+
- **Monitor Type**: HTTP(s)
|
| 25 |
+
- **Friendly Name**: OpenCode AI Agent
|
| 26 |
+
- **URL**: `https://abbasyk60-opencode.static.hf.space`
|
| 27 |
+
- **Monitoring Interval**: 5 minutes
|
| 28 |
+
5. Click **Create Monitor**
|
| 29 |
+
|
| 30 |
+
This will ping your Space every 5 minutes and email you if it's ever down.
|
| 31 |
+
|
| 32 |
+
### Option 2: cron-job.org
|
| 33 |
+
|
| 34 |
+
1. Go to **https://cron-job.org**
|
| 35 |
+
2. Sign up for free
|
| 36 |
+
3. Click **"Create Job"**
|
| 37 |
+
4. Fill in:
|
| 38 |
+
- **URL**: `https://abbasyk60-opencode.static.hf.space`
|
| 39 |
+
- **Request Method**: GET
|
| 40 |
+
- **Schedule**: Every 5 minutes
|
| 41 |
+
5. Save
|
| 42 |
+
|
| 43 |
+
## Telegram Bot - Keep Running Locally
|
| 44 |
+
|
| 45 |
+
The Telegram bot must run on your PC. To keep it running:
|
| 46 |
+
|
| 47 |
+
### Option A: Run the batch file
|
| 48 |
+
Double-click `start-bot.bat` in the project folder.
|
| 49 |
+
|
| 50 |
+
### Option B: Run the PowerShell script
|
| 51 |
+
```powershell
|
| 52 |
+
.\keep-alive.ps1
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
### Option C: Windows Task Scheduler
|
| 56 |
+
1. Open Task Scheduler
|
| 57 |
+
2. Create Basic Task
|
| 58 |
+
3. Trigger: Daily, repeat every 5 minutes
|
| 59 |
+
4. Action: Start a program
|
| 60 |
+
5. Program: `node`
|
| 61 |
+
6. Arguments: `bot.js`
|
| 62 |
+
7. Start in: `C:\Users\abbasyk\Documents\opencode-hf-space`
|