-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 84917ba
Showing
45 changed files
with
5,228 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Run autoddns | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # 仅在推送到 main 分支时触发,可以修改为你想要的分支 | ||
paths: | ||
- 'cfip/ip.txt' # 只有 ipv6.txt 文件发生变化时才触发 | ||
- 'csv/result.csv' | ||
|
||
jobs: | ||
run-autoddns: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
# 设置环境变量,使用 GitHub Secrets | ||
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} | ||
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} | ||
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} | ||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run autoddns script | ||
run: | | ||
python ddns/autoddns.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Run autoddnsfd | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # 仅在推送到 main 分支时触发,可以修改为你想要的分支 | ||
paths: | ||
- 'cfip/fd.txt' # 只有 fd.txt 文件发生变化时才触发 | ||
- 'csv/resultfd.csv' | ||
|
||
jobs: | ||
run-autoddns: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
# 设置环境变量,使用 GitHub Secrets | ||
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} | ||
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} | ||
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} | ||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run autoddnsfd script | ||
run: | | ||
python ddns/autoddnsfd.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Run autoddnsv6 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # 仅在推送到 main 分支时触发,可以修改为你想要的分支 | ||
paths: | ||
- 'cfip/ipv6.txt' # 只有 ipv6.txt 文件发生变化时才触发 | ||
- 'csv/resultv6.csv' | ||
|
||
jobs: | ||
run-autoddns: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
# 设置环境变量,使用 GitHub Secrets | ||
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} | ||
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} | ||
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} | ||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run autoddnsv6 script | ||
run: | | ||
python ddns/autoddnsv6.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 忽略所有 .session 文件 | ||
*.session | ||
|
||
# 忽略特定命名的 session 文件(例如 "my_session.session") | ||
my_session.session | ||
|
||
# 忽略包含敏感信息的文件(如 API_ID 和 API_HASH) | ||
config.ini | ||
secrets.json | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# CFST - Cloudflare Speed Test and DNS Management | ||
|
||
CFST 是一个用于优选 Cloudflare IPv4 和 IPv6 地址,并将优选后的 IP 地址添加到 Cloudflare DNS 记录中的工具。此外,它还支持优选反代 IP 并检测 IP 的连通性。所有优选和检测后的结果会自动上传到 GitHub。 | ||
|
||
## 文件结构 | ||
|
||
### 主脚本文件 | ||
- `cfst.py`: 优选 IPv4 地址并更新 Cloudflare DNS 记录。 | ||
- `cfstv6.py`: 优选 IPv6 地址并更新 Cloudflare DNS 记录。 | ||
- `cfstfd.py`: 优选反代 IP 并更新 Cloudflare DNS 记录。 | ||
- `speed.py`: 检测 `speed/ip.txt` 和 `speed/ipv6.txt` 的连通性,删除不通的 IP 并提交文件到 GitHub。 | ||
- `proxy.py`: 从 `cfip/ip.txt` 中筛选出反代 IP,并输出到 `cfip/proxy.txt`。 | ||
- `sk.py`: 检测 IP 的连通性,删除不通的 IP。 | ||
- `autoddns.py`: 提取 IP 并添加 DNS 记录到 Cloudflare。 | ||
|
||
### 数据文件 | ||
- `cfip/ip.txt`: 存储不带端口的优选 IPv4 地址。 | ||
- `cfip/ipv6.txt`: 存储不带端口的优选 IPv6 地址。 | ||
- `cfip/fd.txt`: 存储不带端口的优选反代 IP。 | ||
- `cfip/proxy.txt`: 存储筛选出的反代 IP。 | ||
- `port/ip.txt`: 存储带端口的优选 IPv4 地址。 | ||
- `port/ipv6.txt`: 存储带端口的优选 IPv6 地址。 | ||
- `port/fdport.txt`: 存储带端口的优选反代 IP。 | ||
- `speed/ip.txt`: 存储下载速度大于 10 Mbps 的优选 IPv4 地址。 | ||
- `speed/ipv6.txt`: 存储下载速度大于 10 Mbps 的优选 IPv6 地址。 | ||
|
||
## GitHub Secrets 配置 | ||
|
||
在 GitHub Actions 中运行脚本时,需要配置以下 Secrets 变量: | ||
|
||
| Secret 名称 | 描述 | | ||
|--------------------------|--------------------------------------| | ||
| `CLOUDFLARE_API_KEY` | Cloudflare API 密钥。 | | ||
| `CLOUDFLARE_EMAIL` | Cloudflare 账户邮箱。 | | ||
| `CLOUDFLARE_ZONE_ID` | Cloudflare Zone ID。 | | ||
| `TELEGRAM_BOT_TOKEN` | Telegram 机器人令牌(用于通知)。 | | ||
| `TELEGRAM_CHAT_ID` | Telegram 聊天 ID(用于通知)。 | | ||
|
||
### 配置步骤 | ||
1. 进入你的 GitHub 仓库。 | ||
2. 点击 **Settings** > **Secrets and variables** > **Actions**。 | ||
3. 点击 **New repository secret**,依次添加上述 Secrets 变量。 | ||
|
||
## 使用方法 | ||
|
||
1. **克隆仓库** | ||
|
||
克隆本仓库到本地: | ||
|
||
```bash | ||
git clone https://github.com/yourusername/cfst.git | ||
cd cfst | ||
``` | ||
|
||
2. **安装依赖** | ||
|
||
确保你已经安装了 Python 3 和所需的依赖库: | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
3. **运行脚本** | ||
|
||
- **优选 IPv4 并自动更新 DNS 记录,需要配置git环境,不然DNS记录无法添加**: | ||
```bash | ||
python cfst.py | ||
``` | ||
- **优选 IPv6 并自动更新 DNS 记录,需要配置git环境,不然DNS记录无法添加**: | ||
```bash | ||
python cfstv6.py | ||
``` | ||
- **优选反代 IP 并自动更新 DNS 记录,需要配置git环境,不然DNS记录无法添加**: | ||
```bash | ||
python cfstfd.py | ||
``` | ||
|
||
## 注意事项 | ||
|
||
- 请确保你有权限使用 Cloudflare 的 API,并且已经正确配置了 API 密钥、邮箱和 Zone ID。 | ||
- 优选 IP 的过程可能需要一些时间,具体取决于 IP 的数量和网络状况。 | ||
- 如果你不想自动提交文件到 GitHub,可以注释掉脚本中相关的代码部分。 | ||
|
||
## 贡献 | ||
|
||
欢迎提交 Issue 和 Pull Request 来改进本项目。 | ||
|
||
## 许可证 | ||
|
||
本项目采用 MIT 许可证。详情请参阅 [LICENSE](LICENSE) 文件。 | ||
|
||
--- | ||
|
||
感谢使用 CFST!如果你有任何问题或建议,请随时联系我。 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
47.90.141.204:443#🇺🇸LAX┃CF优选 | ||
47.57.13.107:443#🇭🇰HKG┃CF优选 | ||
47.76.218.163:443#🇭🇰HKG┃CF优选 | ||
47.236.181.185:8443#🇸🇬SIN┃CF优选 | ||
47.57.14.118:443#🇺🇸SJC┃CF优选 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
47.251.33.121#🇺🇸SJC | ||
150.230.42.80#🇺🇸SJC | ||
152.67.251.232#🇺🇸SJC | ||
144.24.53.45#🇺🇸SJC | ||
47.254.17.234#🇺🇸SJC | ||
129.146.111.62#🇺🇸LAX | ||
129.153.116.130#🇺🇸LAX | ||
132.226.114.74#🇺🇸LAX | ||
91.149.239.122#🇺🇸LAX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
108.162.198.115#🇭🇰HKG | ||
190.93.246.114#🇭🇰HKG | ||
190.93.244.154#🇭🇰HKG | ||
190.93.247.138#🇭🇰HKG | ||
141.101.114.230#🇭🇰HKG | ||
141.101.115.18#🇭🇰HKG | ||
198.41.208.39#🇭🇰HKG | ||
104.16.245.154#🇭🇰HKG | ||
198.41.221.18#🇭🇰HKG | ||
198.41.212.216#🇭🇰HKG | ||
190.93.244.62#🇺🇸SJC | ||
188.114.97.144#🇺🇸SJC | ||
104.16.24.104#🇺🇸SJC | ||
198.41.219.210#🇺🇸SJC | ||
104.16.187.237#🇺🇸SJC | ||
104.16.188.25#🇺🇸SJC | ||
104.16.184.155#🇺🇸SJC | ||
104.16.185.227#🇺🇸SJC | ||
104.16.186.55#🇺🇸SJC | ||
104.16.179.231#🇺🇸SJC | ||
172.67.172.89#🇺🇸SEA | ||
104.20.193.152#🇺🇸LAX | ||
104.22.36.171#🇺🇸LAX | ||
162.159.26.14#🇺🇸LAX | ||
104.21.105.2#🇺🇸LAX | ||
104.25.227.31#🇺🇸LAX | ||
104.21.104.147#🇺🇸LAX | ||
141.101.122.93#🇺🇸LAX | ||
104.19.10.50#🇺🇸LAX | ||
104.25.239.235#🇺🇸LAX | ||
104.27.195.23#🇺🇸LAX |
Oops, something went wrong.