Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
TELEGRAM_TOKEN=
TELEGRAM_CHAT_ID=
LOG_LEVEL=INFO
MAX_WORKERS=50
FETCH_TIMEOUT=15
PING_TIMEOUT=1.5
PING_RETRIES=2
LATENCY_THRESHOLD_MS=1000
69 changes: 57 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,68 @@
name: Update V2Ray Configs

on:
schedule:
- cron: '0 */2 * * *'
workflow_dispatch:
push:
paths:
- 'src/**'
- '.github/workflows/**'
- 'requirements*.txt'

env:
PYTHON_VERSION: '3.11'

jobs:
build:
collect:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pip install requests
- name: Run Collector
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run collector
env:

run: python scripts/collector.py
- run: |

git add configs/*.txt
git commit -m "Update V2Ray configs [$(date)]" || echo "No changes"
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
PYTHONUNBUFFERED: '1'
run: python -m src.main

- name: Check for changes
id: check_changes
run: |
if [ -n "$(git status --porcelain configs/)" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi

- name: Commit and push changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add configs/
git commit -m "🚀 Update V2Ray configs [$(date '+%Y-%m-%d %H:%M')]"
git push

- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: collector-logs
path: logs/
retention-days: 7
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__pycache__/
*.pyc
.venv/
.env
.pytest_cache/
logs/
44 changes: 32 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to V2Ray Collector Pro / مشارکت در پروژه
# Contributing to Freedom-V2Ray / مشارکت در پروژه

[English](#english) | [فارسی](#فارسی)

Expand All @@ -18,12 +18,22 @@ We love your input! We want to make contributing to this project as easy and tra
### 🚀 How to Contribute

1. **Fork the Repository**: Create your own copy of the project.
2. **Clone the Fork**: `git clone https://github.com/YOUR_USERNAME/v2ray-collector-pro.git`
2. **Clone the Fork**: `git clone https://github.com/YOUR_USERNAME/Freedom-V2Ray.git`
3. **Create a Branch**: `git checkout -b feature/AmazingFeature`
4. **Make Changes**: Implement your feature or fix.
5. **Commit Changes**: `git commit -m 'Add some AmazingFeature'`
6. **Push to GitHub**: `git push origin feature/AmazingFeature`
7. **Submit a Pull Request**: Explain your changes and why they are beneficial.
4. **Install dependencies**: `pip install -r requirements.txt`
5. **Make Changes**: Implement your feature or fix.
6. **Run tests**: `pytest`
7. **Commit Changes**: `git commit -m 'Add some AmazingFeature'`
8. **Push to GitHub**: `git push origin feature/AmazingFeature`
9. **Submit a Pull Request**: Explain your changes and why they are beneficial.

### 🧰 Project Structure

- `src/`: main application code
- `scripts/`: helper wrappers
- `configs/`: generated outputs
- `tests/`: automated tests
- `logs/`: runtime logs

---

Expand All @@ -41,12 +51,22 @@ We love your input! We want to make contributing to this project as easy and tra
### 🚀 نحوه مشارکت

۱. **پروژه را Fork کنید**: یک نسخه از پروژه را در حساب خود بسازید.
۲. **پروژه را کلون کنید**: `git clone https://github.com/YOUR_USERNAME/v2ray-collector-pro.git`
۲. **پروژه را کلون کنید**: `git clone https://github.com/YOUR_USERNAME/Freedom-V2Ray.git`
۳. **یک Branch بسازید**: `git checkout -b feature/AmazingFeature`
۴. **تغییرات را اعمال کنید**: ویژگی جدید یا اصلاحات خود را پیاده‌سازی کنید.
۵. **تغییرات را Commit کنید**: `git commit -m 'Add some AmazingFeature'`
۶. **به گیت‌هاب Push کنید**: `git push origin feature/AmazingFeature`
۷. **یک Pull Request باز کنید**: تغییرات خود و دلیل مفید بودن آن‌ها را توضیح دهید.
۴. **وابستگی‌ها را نصب کنید**: `pip install -r requirements.txt`
۵. **تغییرات را اعمال کنید**: ویژگی جدید یا اصلاحات خود را پیاده‌سازی کنید.
۶. **تست‌ها را اجرا کنید**: `pytest`
۷. **تغییرات را Commit کنید**: `git commit -m 'Add some AmazingFeature'`
۸. **به گیت‌هاب Push کنید**: `git push origin feature/AmazingFeature`
۹. **یک Pull Request باز کنید**: تغییرات خود و دلیل مفید بودن آن‌ها را توضیح دهید.

### 🧰 ساختار پروژه

- `src/`: کد اصلی برنامه
- `scripts/`: اسکریپت‌های کمکی
- `configs/`: خروجی‌های تولید شده
- `tests/`: تست‌های خودکار
- `logs/`: لاگ‌های اجرا

---
*Created by Manus AI for MahanKenway*
*Created for MahanKenway*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Freedom-V2Ray

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading