Skip to content

Commit

Permalink
add code 20240930
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Sep 30, 2024
1 parent 0af3d5d commit 612dbcc
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 47 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
![cf2dns.jpg](https://raw.githubusercontent.com/gacjie/cf2dns/main/cf2dns.jpg)

#### 公告通知
由于原系统monitor.gacjie.cn代码性能差,以及国内服务器成本高、小水管等原因。
我重写了一套系统,并更换海外服务器,使用新域名182682.xyz继续提供服务。
原系统计划在国内服务器到期后彻底停止服务,请及时更新插件版本到最新
出于运维成本、长久稳定性等情况考虑。
目前平台域名更换为WeTest.vip。
请各位用户及时将插件更新到1.9版本以上

#### 接口支持
CloudFlare官方优选(182682.xyz)更新频率15IP/15分钟
CloudFlare官方优选(hostmonit.com)更新频率15IP/15分钟
CloudFlare官方优选(345673.xyz)更新频率15IP/15分钟
CloudFront官方优选(182682.xyz)更新频率15IP/15分钟
Gcore官方优选(182682.xyz)更新频率15IP/15分钟
CloudFlare官方优选(WeTest.vip) 更新频率15IP/15分钟
CloudFlare官方优选(HostMonit.com)更新频率15IP/15分钟
CloudFlare官方优选(345673.xyz) 更新频率15IP/15分钟
CloudFront官方优选(WeTest.vip) 更新频率15IP/15分钟
Gcore官方优选 (WeTest.vip) 更新频率15IP/15分钟

#### 解析支持
[华为云解析](https://support.huaweicloud.com/devg-apisign/api-sign-provide-aksk.html)
Expand All @@ -32,16 +32,17 @@ btpanel9.0.0-lts

#### 小广告

[【弘速云hosuyun.com】香港8H8G 50元/月](https://www.hosuyun.com/)
[【宝塔】Linux专业版1年¥699](https://www.bt.cn/p/2PcEKn)
[【腾讯云】云产品1折特惠专区](https://curl.qcloud.com/zASK1SLm)
[【阿里云】云产品爆款特惠](https://www.aliyun.com/minisite/goods?userCode=zqpad1gj)
[【弘速云hosuyun.com】香港、美国高性能优质线路服务器,新用户首购五折特惠。](https://www.hosuyun.com/)
[【宝塔】宝塔产品特惠,linux专业版1年仅需¥699](https://www.bt.cn/p/2PcEKn)
[【腾讯云】云产品1折特惠,2核2G4M仅需108元/年](https://curl.qcloud.com/zASK1SLm)
[【阿里云】云产品爆款特惠,2核2G3M仅需82元/年](https://www.aliyun.com/minisite/goods?userCode=zqpad1gj)

#### 价格计费
插件免费提供授权码o1zrmHAF,可永久免费使用。
[182682.xyz付费授权码购买](https://182682.xyz/dash/Account/login)
[hostmonit.com付费授权码购](https://shop.hostmonit.com/)
[345673.xyz付费授权码购](https://345673.xyz/)
[WeTest.vip付费服务说明](https://github.com/gacjie/cf2dns/wiki/WeTest付费服务说明)
[WeTest.vip付费授权码购买](https://www.wetest.vip/dash/Account/register)
[HostMonit.com付费授权码](https://shop.hostmonit.com/)
[345673.xyz付费授权码](https://345673.xyz/)

### 注意事项
宝塔安装时请关闭宝塔系统加固插件,会终止安装脚本的执行。
Expand All @@ -59,10 +60,9 @@ domains.json是域名数据
cf2dns插件、cf2dns_global、cf2dns_actions均支持。
配置完后可以直接备份这俩数据文件,后续需要迁移可直接上传。

#### 2024年09月08日更新记录(V1.8)
更新新系统接口
取消CloudFlare、CloudFront、Gcore选项
优化用户配置选择
#### 2024年09月30日更新记录(V1.9)
更新接口地址为WeTest.vip
插件版增加对传入的字符串过滤空格、换行符

#### 常见问题

Expand All @@ -72,12 +72,12 @@ A:建议增加缓存或有条件更换国际线路较好的源站服务器来

Q:为什么不支持反代优选?
A:本项目是为了建站而开发,反代优选IP为扫描的第三方的服务器,存在不可控的安全隐患。
A:目前已有因使用反代优选导致域名被注册机构禁用的先例。
A:因此本项目未来也不会提供反代优选,除非您自行添加相关接口。

Q:为什么不支持海外dns解析运营商?
A:目前已有因使用反代优选导致域名被注册机构禁用的先例。
A:因此本项目未来也不会提供反代优选,除非您自行添加相关接口。
Q:为什么不支持海外dns解析运营商?
A:由于cf等cdn属于泛播,移动联通电信需要单独解析,才能实现三网优选。海外dns均不支持国内三网线路解析。
A:如不方便使用国内云解析 可以访问 https://www.182682.xyz 获取公共cname地址使用。
A:如不方便使用国内云解析 可以访问 https://www.WeTest.vip 获取公共cname地址使用。

Q:该插件安全吗?
A:插件是基于cf2dns增加了宝塔可视化操作界面。并且代码全部公开在github上面,可先自行审查代码再决定是否安装。
Expand Down
9 changes: 6 additions & 3 deletions cf2dns_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def set_home_info(self, args):
data['region_hw'] = args.region_hw
data['region_ali'] = args.region_ali
data['ttl'] = int(args.ttl)
data['secretid'] = args.secretid
data['secretkey'] = args.secretkey
data['secretid'] = args.secretid.strip()
data['secretkey'] = args.secretkey.strip()
# data['key'] = args.key
# data['data_server'] = int(args.data_server)
public.writeFile(self.__config_path,json.dumps(data))
Expand All @@ -56,6 +56,8 @@ def set_domian_info(self, args):
if not args.host:
return self.__response_json('',500,'主机名不能为空,请使用@创建空主机名。')
domains = json.loads(public.readFile(self.__domians_path))
args.domain = args.domain.strip()
args.host = args.host.strip()
if args.domain not in domains:
domains[args.domain] = {}
domains[args.domain][args.host] = ["CM","CU","CT"]
Expand All @@ -80,7 +82,7 @@ def get_data_server(self, args):
#设置数据服务信息
def set_data_server(self, args):
data = json.loads(public.readFile(self.__config_path))
data['key'] = args.key
data['key'] = args.key.strip()
data['data_server'] = int(args.data_server)
public.writeFile(self.__config_path,json.dumps(data))
return self.__response_json('',200,'数据保存成功')
Expand All @@ -102,3 +104,4 @@ def update_integral(self, args):
def __response_json(self, data, code=0, msg=''):
response = {"code": code, "msg": msg, "data": data}
return response

18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
tpl += " <tbody>";
tpl += " <tr>";
tpl += " <td>插件版本:<\/td>";
tpl += " <td><i class=\"sui-icon icon-pc-loading\">Cf2dns V1.8 240908<\/i><\/td>";
tpl += " <td><i class=\"sui-icon icon-pc-loading\">Cf2dns V1.9 240930<\/i><\/td>";
tpl += " <\/tr>";
tpl += " <tr>";
tpl += " <td>作者:<\/td>";
Expand All @@ -69,19 +69,19 @@
tpl += " <td><a href=\"https://github.com/ddgth/cf2dns/\" target=\"_blank\">冬冬<\/a> & <a href=\"https://shop.huaqi.pro/\" target=\"_blank\">花旗<\/a> & <a href=\"https://www.hosuyun.com/\" target=\"_blank\">弘速云<\/a><\/td>";
tpl += " <\/tr>";
tpl += " <tr>";
tpl += " <td>【弘速云】香港8H8G 50元/月<\/td>";
tpl += " <td>【弘速云】香港、美国高性能优质线路服务器,新用户首购五折特惠。<\/td>";
tpl += " <td><a href=\"https://www.hosuyun.com\" target=\"_blank\">https://www.hosuyun.com<\/a><\/td>";
tpl += " <\/tr>";
tpl += " <tr>";
tpl += " <td>【宝塔】Linux专业版1年¥699<\/td>";
tpl += " <td>【宝塔】宝塔产品特惠,linux专业版1年仅需¥699<\/td>";
tpl += " <td><a href=\"https://www.bt.cn/p/2PcEKn\" target=\"_blank\">https://www.bt.cn/p/2PcEKn<\/a><\/td>";
tpl += " <\/tr>";
tpl += " <tr>";
tpl += " <td>【腾讯云】云产品1折特惠<\/td>";
tpl += " <td>【腾讯云】云产品1折特惠,2核2G4M仅需108元/年<\/td>";
tpl += " <td><a href=\"https://curl.qcloud.com/zASK1SLm\" target=\"_blank\">https://curl.qcloud.com/zASK1SLm<\/a><\/td>";
tpl += " <\/tr>";
tpl += " <tr>";
tpl += " <td>【阿里云】云产品爆款特惠<\/td>";
tpl += " <td>【阿里云】云产品爆款特惠,2核2G3M仅需82元/年<\/td>";
tpl += " <td><a href=\"https://www.aliyun.com/minisite/goods?userCode=zqpad1gj\" target=\"_blank\">https://www.aliyun.com/minisite/goods?userCode=zqpad1gj<\/a><\/td>";
tpl += " <\/tr>";
tpl += "<\/table>";
Expand Down Expand Up @@ -317,11 +317,11 @@
var tpl = '<div class="clearfixDns">\
<div class="SetAggregateOne">\
<p><span>数据接口</span><select class="bt-input-text" name="data_server" type="number">\
<option value="1"' + (res.data.data_server === 1 ? ' selected' : '') + '>CloudFlare官方优选(182682.xyz)</option>\
<option value="2"' + (res.data.data_server === 2 ? ' selected' : '') + '>CloudFlare官方优选(hostmonit.com)</option>\
<option value="1"' + (res.data.data_server === 1 ? ' selected' : '') + '>CloudFlare官方优选(WeTest.vip)</option>\
<option value="2"' + (res.data.data_server === 2 ? ' selected' : '') + '>CloudFlare官方优选(HostMonit.com)</option>\
<option value="3"' + (res.data.data_server === 3 ? ' selected' : '') + '>CloudFlare官方优选(345673.xyz)</option>\
<option value="5"' + (res.data.data_server === 5 ? ' selected' : '') + '>CloudFront官方优选(182682.xyz)</option>\
<option value="6"' + (res.data.data_server === 6 ? ' selected' : '') + '>Gcore官方优选(182682.xyz)</option>\
<option value="5"' + (res.data.data_server === 5 ? ' selected' : '') + '>CloudFront官方优选(WeTest.vip)</option>\
<option value="6"' + (res.data.data_server === 6 ? ' selected' : '') + '>Gcore官方优选(WeTest.vip)</option>\
</select></p>\
<p><span>KEY</span><input class="bt-input-text" name="key" type="text" value="' + res.data.key + '" /></p>\
<p><span>积分</span><input disabled="disabled" class="bt-input-text" name="integral" type="text" value="' + res.data.integral + '" /><button class="btn btn-default btn-sm btn-title" onclick="cf2dns.update_integral();">更新</button></p>\
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "cf2dns",
"name": "cf2dns",
"ps": "自动化更新CDN优选节点",
"versions": "1.8",
"versions": "1.9",
"checks": "/www/server/panel/plugin/cf2dns",
"author": "GacJie",
"home": "https://github.com/gacjie/cf2dns"
Expand Down
20 changes: 10 additions & 10 deletions provider.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[
{
"id": 1,
"name": "CloudFlare官方优选(182682.xyz)",
"get_ip_url": "https://www.182682.xyz/api/cf2dns/get_cloudflare_ip",
"get_license_url": "https://www.182682.xyz/api/cf2dns/get_license?license="
"name": "CloudFlare官方优选(WeTest.vip)",
"get_ip_url": "https://www.wetest.vip/api/cf2dns/get_cloudflare_ip",
"get_license_url": "https://www.wetest.vip/api/cf2dns/get_cloudflare_license?license="
},
{
"id": 2,
"name": "CloudFlare官方优选(hostmonit.com)",
"name": "CloudFlare官方优选(HostMonit.com)",
"get_ip_url": "https://api.hostmonit.com/get_optimization_ip",
"get_license_url": "https://api.hostmonit.com/get_license?license="
},
Expand All @@ -25,14 +25,14 @@
},
{
"id": 5,
"name": "CloudFront官方优选(182682.xyz)",
"get_ip_url": "https://www.182682.xyz/api/cf2dns/get_cloudfront_ip",
"get_license_url": "https://www.182682.xyz/api/cf2dns/get_license?license="
"name": "CloudFront官方优选(WeTest.vip)",
"get_ip_url": "https://www.wetest.vip/api/cf2dns/get_cloudfront_ip",
"get_license_url": "https://www.wetest.vip/api/cf2dns/get_cloudfront_license?license="
},
{
"id": 6,
"name": "Gcore官方优选(182682.xyz)",
"get_ip_url": "https://www.182682.xyz/api/cf2dns/get_gcore_ip",
"get_license_url": "https://www.182682.xyz/api/cf2dns/get_license?license="
"name": "Gcore官方优选(WeTest.vip)",
"get_ip_url": "https://www.wetest.vip/api/cf2dns/get_gcore_ip",
"get_license_url": "https://www.wetest.vip/api/cf2dns/get_gcore_license?license="
}
]

0 comments on commit 612dbcc

Please sign in to comment.