cf-speed-dns Documentation

CF优选IP工具。动态获取Cloudflare优选IP,CloudflareSpeedTest测速。

1,583 stars Python Python 1 file · ~980 tokens
RAW Doc

File: README.md

cf-speed-dns是什么?

CloudflareSpeedTest 推送「每5分钟自选优选 IP」获取Cloudflare CDN 延迟和速度最快 IP !

cf-speed-dns有哪些功能?

  • CloudflareSpeedTest优选IP,实时更新列表页面。https://ip.164746.xyz
  • CloudflareSpeedTest优选IP,Top接口(默认)https://ip.164746.xyz/ipTop.html;Top10接口https://ip.164746.xyz/ipTop10.html。
  • DNSPOD实时域名解析推送,fork 本项目。
    • Action配置,Actions secrets and variables 添加 DOMAIN(例如:164746.xyz),SUB_DOMAIN(例如:dns),SECRETID(xxxxx),SECRETKEY(xxxxx),PUSHPLUS_TOKEN(xxxxx)。
  • DNSCF实时域名解析推送,fork 本项目。
    • Action配置,Actions secrets and variables 添加 CF_API_TOKEN(例如:xxxxx),CF_ZONE_ID(例如:xxxxx),CF_DNS_NAME(dns.164746.xyz),PUSHPLUS_TOKEN(xxxxx)。
  • 接入PUSHPLUS消息通知。https://www.pushplus.plus/push1.html

接口请求

javascript
curl 'https://ip.164746.xyz/ipTop.html'

接口返回

javascript
104.16.204.6,104.18.103.125

感谢

XIU2

广告


File: requirements.txt

requests==2.28.1


File: .github/workflows/dns_cf.yml

name: 'dns_cf_push'

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: 'Install dependencies'
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: 'run dnscf'
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
CF_DNS_NAME: ${{ secrets.CF_DNS_NAME }}
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }}
run: python dnscf.py


File: .github/workflows/dns_pod.yml

name: 'dns_pod_push'

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: 'Install dependencies'
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: 'run dnspod'
env:
DOMAIN: ${{ secrets.DOMAIN }}
SUB_DOMAIN: ${{ secrets.SUB_DOMAIN }}
SECRETID: ${{ secrets.SECRETID }}
SECRETKEY: ${{ secrets.SECRETKEY }}
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }}
run: python dnspod.py


File: .github/workflows/sync.yml

name: Upstream Sync

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

permissions:
contents: write

on:
schedule:
- cron: "0 0 * * *" # every day
workflow_dispatch:

jobs:
sync_latest_from_upstream:
name: Sync latest commits from upstream repo
runs-on: ubuntu-latest
if: ${{ github.event.repository.fork }}

text
steps:
  # Step 1: run a standard checkout action
  - name: Checkout target repo
    uses: actions/checkout@v4

  # Step 2: run the sync action
  - name: Sync upstream changes
    id: sync
    uses: aormsby/[email protected]
    with:
      upstream_sync_repo: ZhiXuanWang/cf-speed-dns
      upstream_sync_branch: main
      target_sync_branch: main
      target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set

      # Set test_mode true to run tests instead of the true action!!
      test_mode: false

  - name: Sync check
    if: failure()
    run: |
      echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次。"
      exit 1