Skip to content

Commit

Permalink
update actions and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ddgth committed Oct 25, 2022
1 parent 71699b3 commit 30f51c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### 新增支持华为云DNS ——update 2022.10.25
> 使用方法
1. 安装依赖 **`pip install -r requirements.txt`**

2. 修改配置文件 **`DNS_SERVER`** **`SECRETID`** **`SECRETKEY`**

### 新增优选IPv6功能 ——update 2022.07.06
> 使用方法
Expand Down
10 changes: 4 additions & 6 deletions cf2dns_actions.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Mail: [email protected]
import base64
import hashlib
import hmac
import random
import time
import operator
import json
import urllib.parse
import urllib3
import os
import traceback
from dns.qCloud import QcloudApi
from dns.aliyun import AliApi
from dns.huawei import HuaWeiApi

#可以从https://shop.hostmonit.com获取
KEY = os.environ["KEY"] #"o1zrmHAF"
Expand All @@ -25,7 +21,7 @@
SECRETKEY = os.environ["SECRETKEY"] #'ZrVs*************gqjOp1zVl'
#默认为普通版本 不用修改
AFFECT_NUM = 2
#DNS服务商 如果使用DNSPod改为1 如果使用阿里云解析改成2
#DNS服务商 如果使用DNSPod改为1 如果使用阿里云解析改成2 如果使用华为云解析改成3
DNS_SERVER = 1
#解析生效时间,默认为600秒 如果不是DNS付费版用户 不要修改!!!
TTL = 600
Expand Down Expand Up @@ -195,4 +191,6 @@ def main(cloud):
cloud = QcloudApi(SECRETID, SECRETKEY)
elif DNS_SERVER == 2:
cloud = AliApi(SECRETID, SECRETKEY)
elif DNS_SERVER == 3:
cloud = HuaWeiApi(SECRETID, SECRETKEY)
main(cloud)

0 comments on commit 30f51c3

Please sign in to comment.