add ddnspod

This commit is contained in:
paldier 2019-01-17 00:08:03 +08:00
parent 8d2bebb205
commit 374a641d28
19 changed files with 841 additions and 1 deletions

6
ddnspod/Changelog.txt Normal file
View File

@ -0,0 +1,6 @@
Koolshare Asuswrt-Merlin DDnspod Changelog
===========================================
0.1.1 ( 01/06/2016 14:49:28 )
- init 初始版本
0.1.2 ( 13/06/2016 14:49:28 )
- Change icon

24
ddnspod/backup.sh Normal file
View File

@ -0,0 +1,24 @@
#! /bin/sh
# you can do something here
# this shell scripts will run at the end of build.py scripts
tar_name="$1.tar.gz"
mkdir -p history
if [ ! -f ./history/version ];then
touch ./history/version
fi
version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
md5_new=` md5sum $tar_name | awk '{print $1}'`
if [ -f ./$tar_name ];then
if [ "$version_old" != "$version_new" ];then
mkdir ./history/$version_new/
cp ./$tar_name ./history/$version_new/
echo $version_new $md5_new >> ./history/version
fi
fi

22
ddnspod/build.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
MODULE=ddnspod
VERSION=0.1.6
TITLE=DDnspod
DESCRIPTION=使用Dnspod的ddns服务
HOME_URL=Module_ddnspod.asp
# Check and include base
DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
# now include build_base.sh
. $DIR/../softcenter/build_base.sh
# change to module directory
cd $DIR
# do something here
do_build_result
# now backup
sh backup.sh $MODULE

8
ddnspod/config.json.js Normal file
View File

@ -0,0 +1,8 @@
{
"version":"0.1.6",
"md5":"c738df170ed0071439f017fc701be137",
"home_url":"Module_ddnspod.asp",
"title":"DDnspod",
"description":"使用Dnspod的ddns服务",
"build_date":"2019-01-17_00:07:34"
}

BIN
ddnspod/ddnspod.tar.gz Normal file

Binary file not shown.

10
ddnspod/ddnspod/install.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
cp -rf /tmp/ddnspod/scripts/* /jffs/softcenter/scripts/
cp -rf /tmp/ddnspod/webs/* /jffs/softcenter/webs/
cp -rf /tmp/ddnspod/res/* /jffs/softcenter/res/
rm -rf /tmp/ddnspod* >/dev/null 2>&1
cp -rf /tmp/ddnspod/scripts/ddnspod.sh /jffs/softcenter/init.d/S99ddnspod.sh
chmod a+x /jffs/softcenter/scripts/ddnspod_config.sh
chmod a+x /jffs/softcenter/scripts/ddnspod.sh
chmod a+x /jffs/softcenter/init.d/S99ddnspod.sh

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1 @@
var md5; md5 || (md5 = function(){function i(a,b){a[b>>5]|=128<<b%32,a[(b+64>>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,f=271733878,g=0;a.length>g;g+=16){var h=c,i=d,j=e,o=f;c=k(c,d,e,f,a[g+0],7,-680876936),f=k(f,c,d,e,a[g+1],12,-389564586),e=k(e,f,c,d,a[g+2],17,606105819),d=k(d,e,f,c,a[g+3],22,-1044525330),c=k(c,d,e,f,a[g+4],7,-176418897),f=k(f,c,d,e,a[g+5],12,1200080426),e=k(e,f,c,d,a[g+6],17,-1473231341),d=k(d,e,f,c,a[g+7],22,-45705983),c=k(c,d,e,f,a[g+8],7,1770035416),f=k(f,c,d,e,a[g+9],12,-1958414417),e=k(e,f,c,d,a[g+10],17,-42063),d=k(d,e,f,c,a[g+11],22,-1990404162),c=k(c,d,e,f,a[g+12],7,1804603682),f=k(f,c,d,e,a[g+13],12,-40341101),e=k(e,f,c,d,a[g+14],17,-1502002290),d=k(d,e,f,c,a[g+15],22,1236535329),c=l(c,d,e,f,a[g+1],5,-165796510),f=l(f,c,d,e,a[g+6],9,-1069501632),e=l(e,f,c,d,a[g+11],14,643717713),d=l(d,e,f,c,a[g+0],20,-373897302),c=l(c,d,e,f,a[g+5],5,-701558691),f=l(f,c,d,e,a[g+10],9,38016083),e=l(e,f,c,d,a[g+15],14,-660478335),d=l(d,e,f,c,a[g+4],20,-405537848),c=l(c,d,e,f,a[g+9],5,568446438),f=l(f,c,d,e,a[g+14],9,-1019803690),e=l(e,f,c,d,a[g+3],14,-187363961),d=l(d,e,f,c,a[g+8],20,1163531501),c=l(c,d,e,f,a[g+13],5,-1444681467),f=l(f,c,d,e,a[g+2],9,-51403784),e=l(e,f,c,d,a[g+7],14,1735328473),d=l(d,e,f,c,a[g+12],20,-1926607734),c=m(c,d,e,f,a[g+5],4,-378558),f=m(f,c,d,e,a[g+8],11,-2022574463),e=m(e,f,c,d,a[g+11],16,1839030562),d=m(d,e,f,c,a[g+14],23,-35309556),c=m(c,d,e,f,a[g+1],4,-1530992060),f=m(f,c,d,e,a[g+4],11,1272893353),e=m(e,f,c,d,a[g+7],16,-155497632),d=m(d,e,f,c,a[g+10],23,-1094730640),c=m(c,d,e,f,a[g+13],4,681279174),f=m(f,c,d,e,a[g+0],11,-358537222),e=m(e,f,c,d,a[g+3],16,-722521979),d=m(d,e,f,c,a[g+6],23,76029189),c=m(c,d,e,f,a[g+9],4,-640364487),f=m(f,c,d,e,a[g+12],11,-421815835),e=m(e,f,c,d,a[g+15],16,530742520),d=m(d,e,f,c,a[g+2],23,-995338651),c=n(c,d,e,f,a[g+0],6,-198630844),f=n(f,c,d,e,a[g+7],10,1126891415),e=n(e,f,c,d,a[g+14],15,-1416354905),d=n(d,e,f,c,a[g+5],21,-57434055),c=n(c,d,e,f,a[g+12],6,1700485571),f=n(f,c,d,e,a[g+3],10,-1894986606),e=n(e,f,c,d,a[g+10],15,-1051523),d=n(d,e,f,c,a[g+1],21,-2054922799),c=n(c,d,e,f,a[g+8],6,1873313359),f=n(f,c,d,e,a[g+15],10,-30611744),e=n(e,f,c,d,a[g+6],15,-1560198380),d=n(d,e,f,c,a[g+13],21,1309151649),c=n(c,d,e,f,a[g+4],6,-145523070),f=n(f,c,d,e,a[g+11],10,-1120210379),e=n(e,f,c,d,a[g+2],15,718787259),d=n(d,e,f,c,a[g+9],21,-343485551),c=p(c,h),d=p(d,i),e=p(e,j),f=p(f,o)}return[c,d,e,f]}function j(a,b,c,d,e,f){return p(q(p(p(b,a),p(d,f)),e),c)}function k(a,b,c,d,e,f,g){return j(b&c|~b&d,a,b,e,f,g)}function l(a,b,c,d,e,f,g){return j(b&d|c&~d,a,b,e,f,g)}function m(a,b,c,d,e,f,g){return j(b^c^d,a,b,e,f,g)}function n(a,b,c,d,e,f,g){return j(c^(b|~d),a,b,e,f,g)}function p(a,b){var c=(a&65535)+(b&65535),d=(a>>16)+(b>>16)+(c>>16);return d<<16|c&65535}function q(a,b){return a<<b|a>>>32-b}function r(a){for(var b=[],d=(1<<c)-1,e=0;a.length*c>e;e+=c)b[e>>5]|=(a.charCodeAt(e/c)&d)<<e%32;return b}function t(b){for(var c=a?"0123456789ABCDEF":"0123456789abcdef",d="",e=0;b.length*4>e;e++)d+=c.charAt(b[e>>2]>>e%4*8+4&15)+c.charAt(b[e>>2]>>e%4*8&15);return d}var a=0,c=8;return function(a){return t(i(r(a),a.length*c))}}());

File diff suppressed because one or more lines are too long

202
ddnspod/ddnspod/res/sha1.js Normal file
View File

@ -0,0 +1,202 @@
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS PUB 180-1
* Version 2.1a Copyright Paul Johnston 2000 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
/*
* Perform a simple self-test to see if the VM is working
*/
function sha1_vm_test()
{
return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
}
/*
* Calculate the SHA-1 of an array of big-endian words, and a bit length
*/
function core_sha1(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << (24 - len % 32);
x[((len + 64 >> 9) << 4) + 15] = len;
var w = Array(80);
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
var e = -1009589776;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
var olde = e;
for(var j = 0; j < 80; j++)
{
if(j < 16) w[j] = x[i + j];
else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
safe_add(safe_add(e, w[j]), sha1_kt(j)));
e = d;
d = c;
c = rol(b, 30);
b = a;
a = t;
}
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
e = safe_add(e, olde);
}
return Array(a, b, c, d, e);
}
/*
* Perform the appropriate triplet combination function for the current
* iteration
*/
function sha1_ft(t, b, c, d)
{
if(t < 20) return (b & c) | ((~b) & d);
if(t < 40) return b ^ c ^ d;
if(t < 60) return (b & c) | (b & d) | (c & d);
return b ^ c ^ d;
}
/*
* Determine the appropriate additive constant for the current iteration
*/
function sha1_kt(t)
{
return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
(t < 60) ? -1894007588 : -899497514;
}
/*
* Calculate the HMAC-SHA1 of a key and some data
*/
function core_hmac_sha1(key, data)
{
var bkey = str2binb(key);
if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
return core_sha1(opad.concat(hash), 512 + 160);
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* Convert an 8-bit or 16-bit string to an array of big-endian words
* In 8-bit function, characters >255 have their hi-byte silently ignored.
*/
function str2binb(str)
{
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz)
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
return bin;
}
/*
* Convert an array of big-endian words to a string
*/
function binb2str(bin)
{
var str = "";
var mask = (1 << chrsz) - 1;
for(var i = 0; i < bin.length * 32; i += chrsz)
str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
return str;
}
/*
* Convert an array of big-endian words to a hex string.
*/
function binb2hex(binarray)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++)
{
str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
}
return str;
}
/*
* Convert an array of big-endian words to a base-64 string
*/
function binb2b64(binarray)
{
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
for(var i = 0; i < binarray.length * 4; i += 3)
{
var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
| (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
| ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
}
}
return str;
}

View File

@ -0,0 +1,174 @@
#!/bin/sh
#################################################
# 由AnripDdns修改而来原版信息如下
#################################################
# AnripDdns v5.08
# 基于DNSPod用户API实现的动态域名客户端
# 作者: 若海[mail@anrip.com]
# 介绍: http://www.anrip.com/ddnspod
# 时间: 2016-02-24 16:25:00
# Mod: 荒野无灯 http://ihacklog.com 2016-03-16
#################################################
# ====================================变量定义====================================
# 版本号定义
version="0.1.6"
# 导入skipd数据
eval `dbus export ddnspod`
# 引用环境变量等
source /jffs/softcenter/scripts/base.sh
export PERP_BASE=/jffs/softcenter/perp
# 使用Token认证(推荐) 请去 https://www.dnspod.cn/console/user/security 获取
arToken=$ddnspod_config_token
# 使用邮箱和密码认证
arMail=$ddnspod_config_uname
arPass=$ddnspod_config_pwd
# 域名
mainDomain=""
subDomain=""
# ====================================函数定义====================================
# 获得外网地址
arIpAdress() {
#双WAN判断
local wans_mode=$(nvram get wans_mode)
local inter
if [ "$ddnspod_config_wan" == "1" ] && [ "$wans_mode" == "lb" ]; then
inter=$(nvram get wan0_ipaddr)
elif [ "$ddnspod_config_wan" == "2" ] && [ "$wans_mode" == "lb" ]; then
inter=$(nvram get wan1_ipaddr)
else
inter=$(nvram get wan0_ipaddr)
fi
echo $inter
}
# 查询域名地址
# 参数: 待查询域名
arNslookup() {
local inter="http://119.29.29.29/d?dn="
wget --quiet --output-document=- $inter$1
}
# 读取接口数据
# 参数: 接口类型 待提交数据
arApiPost() {
local agent="AnripDdns/5.07(mail@anrip.com)"
local inter="https://dnsapi.cn/${1:?'Info.Version'}"
if [ "x${arToken}" = "x" ]; then # undefine token
local param="login_email=${arMail}&login_password=${arPass}&format=json&${2}"
else
local param="login_token=${arToken}&format=json&${2}"
fi
wget --quiet --no-check-certificate --output-document=- --user-agent=$agent --post-data $param $inter
}
# 更新记录信息
# 参数: 主域名 子域名
arDdnsUpdate() {
local domainID recordID recordRS recordCD myIP errMsg
# 获得域名ID
domainID=$(arApiPost "Domain.Info" "domain=${1}")
domainID=$(echo $domainID | sed 's/.*{"id":"\([0-9]*\)".*/\1/')
# 获得记录ID
recordID=$(arApiPost "Record.List" "domain_id=${domainID}&sub_domain=${2}")
recordID=$(echo $recordID | sed 's/.*\[{"id":"\([0-9]*\)".*/\1/')
# 更新记录IP
myIP=$($inter)
recordRS=$(arApiPost "Record.Ddns" "domain_id=${domainID}&record_id=${recordID}&sub_domain=${2}&value=${myIP}&record_line=默认")
recordCD=$(echo $recordRS | sed 's/.*{"code":"\([0-9]*\)".*/\1/')
# 输出记录IP
if [ "$recordCD" == "1" ]; then
echo $recordRS | sed 's/.*,"value":"\([0-9\.]*\)".*/\1/'
dbus set ddnspod_run_status="更新成功"
return 1
fi
# 输出错误信息
errMsg=$(echo $recordRS | sed 's/.*,"message":"\([^"]*\)".*/\1/')
dbus set ddnspod_run_status="$errMsg"
echo $errMsg
}
# 动态检查更新
# 参数: 主域名 子域名
arDdnsCheck() {
local postRS
local hostIP=$(arIpAdress)
local lastIP=$(arNslookup "${2}.${1}")
echo "hostIP: ${hostIP}"
echo "lastIP: ${lastIP}"
if [ "$lastIP" != "$hostIP" ]; then
dbus set ddnspod_run_status="更新中。。。"
postRS=$(arDdnsUpdate $1 $2)
echo "postRS: ${postRS}"
if [ $? -ne 1 ]; then
return 1
fi
else
dbus set ddnspod_run_status="wan ip未改变无需更新"
fi
return 0
}
parseDomain() {
mainDomain=${ddnspod_config_domain#*.}
local tmp=${ddnspod_config_domain%$mainDomain}
subDomain=${tmp%.}
}
#将执行脚本写入crontab定时运行
add_ddnspod_cru(){
if [ -f /jffs/softcenter/scripts/ddnspod.sh ]; then
#确保有执行权限
chmod +x /jffs/softcenter/scripts/ddnspod.sh
cru a ddnspod "0 */$ddnspod_refresh_time * * * /jffs/softcenter/scripts/ddnspod.sh restart"
fi
}
#停止服务
stop_ddnspod(){
#停掉cru里的任务
local ddnspodcru=$(cru l | grep "ddnspod")
if [ ! -z "$ddnspodcru" ]; then
cru d ddnspod
fi
}
# 写入版本号
write_ddnspod_version(){
dbus set ddnspod_version="$version"
}
# ====================================主逻辑====================================
case $ACTION in
start)
#此处为开机自启动设计
if [ "$ddnspod_enable" == "1" ] && [ "$ddnspod_auto_start" == "1" ];then
parseDomain
add_ddnspod_cru
sleep $ddnspod_delay_time
arDdnsCheck $mainDomain $subDomain
fi
;;
stop | kill )
stop_ddnspod
;;
restart)
stop_ddnspod
parseDomain
add_ddnspod_cru
sleep $ddnspod_delay_time
arDdnsCheck $mainDomain $subDomain
write_ddnspod_version
;;
*)
echo "Usage: $0 (start|stop|restart|kill)"
exit 1
;;
esac

View File

@ -0,0 +1,10 @@
#!/bin/sh
eval `dbus export ddnspod`
if [ "$ddnspod_enable" == "1" ];then
/jffs/softcenter/scripts/ddnspod.sh restart
else
/jffs/softcenter/scripts/ddnspod.sh stop
fi

11
ddnspod/ddnspod/uninstall.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
rm -rf /jffs/softcenter/scripts/ddnspod_config.sh
rm -rf /jffs/softcenter/scripts/ddnspod.sh
rm -rf /jffs/softcenter/webs/Module_ddnspod.asp
rm -rf /jffs/softcenter/res/icon-ddnspod.png
rm -rf /jffs/softcenter/res/md5.js
rm -rf /jffs/softcenter/res/rsa.js
rm -rf /jffs/softcenter/res/sha1.js
rm -rf /jffs/softcenter/scripts/ddnspod_config.sh
rm -rf /jffs/softcenter/init.d/S99ddnspod.sh

View File

@ -0,0 +1,358 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache"/>
<meta HTTP-EQUIV="Expires" CONTENT="-1"/>
<link rel="shortcut icon" href="images/favicon.png"/>
<link rel="icon" href="images/favicon.png"/>
<title>软件中心 - DDnspod设置</title>
<link rel="stylesheet" type="text/css" href="index_style.css"/>
<link rel="stylesheet" type="text/css" href="form_style.css"/>
<link rel="stylesheet" type="text/css" href="usp_style.css"/>
<link rel="stylesheet" type="text/css" href="ParentalControl.css">
<link rel="stylesheet" type="text/css" href="css/icon.css">
<link rel="stylesheet" type="text/css" href="css/element.css">
<script type="text/javascript" src="/state.js"></script>
<script type="text/javascript" src="/popup.js"></script>
<script type="text/javascript" src="/help.js"></script>
<script type="text/javascript" src="/validator.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/general.js"></script>
<script type="text/javascript" src="/switcherplugin/jquery.iphone-switch.js"></script>
<script type="text/javascript" src="/dbconf?p=ddnspod_&v=<% uptime(); %>"></script>
<script type="text/javascript" src="/res/rsa.js"></script>
<script type="text/javascript" src="/res/md5.js"></script>
<script type="text/javascript" src="/res/sha1.js"></script>
<script type="text/javascript">
function init() {
show_menu();
buildswitch();
var rrt = document.getElementById("switch");
if (document.form.ddnspod_enable.value != "1") {
rrt.checked = false;
document.getElementById('ddnspod_detail_table').style.display = "none";
} else {
rrt.checked = true;
document.getElementById('ddnspod_detail_table').style.display = "";
}
//双wan开始判断
var lb_mode = '<% nvram_get("wans_mode"); %>';
if(lb_mode !== "lb"){
document.getElementById('double_wan_set').style.display = "none";
document.getElementById('select_wan').style.display = "none";
document.form.ddnspod_config_wan.value = 0;
} else {
check_selected("ddnspod_config_wan", db_ddnspod_.ddnspod_config_wan);
}
version_show();
write_ddnspod_run_status();
check_selected("ddnspod_auto_start", db_ddnspod_.ddnspod_auto_start);
check_selected("ddnspod_delay_time", db_ddnspod_.ddnspod_delay_time);
check_selected("ddnspod_refresh_time", db_ddnspod_.ddnspod_refresh_time);
}
var kn = '00AC69F5CCC8BDE47CD3D371603748378C9CFAD2938A6B021E0E191013975AD683F5CBF9ADE8BD7D46B4D2EC2D78AF146F1DD2D50DC51446BB8880B8CE88D476694DFC60594393BEEFAA16F5DBCEBE22F89D640F5336E42F587DC4AFEDEFEAC36CF007009CCCE5C1ACB4FF06FBA69802A8085C2C54BADD0597FC83E6870F1E36FD';
var ke = '010001';
var rsa = new RSAKey();
rsa.setPublic(kn, ke);
function onSubmitCtrl(o, s) {
document.form.action_mode.value = s;
//开始赋值
var pwd = $("#ddnspod_config_old_pwd").val();
var encrypted_pwd = rsa.encrypt(md5(pwd));
$("#ddnspod_config_pwd").val(encrypted_pwd.toUpperCase());
showLoading(9);
document.form.submit();
setTimeout("conf2obj()", 8000);
}
function pass_checked(obj){
switchType(obj, document.form.show_pass.checked, true);
}
function conf2obj() {
$.ajax({
type: "get",
url: "dbconf?p=ddnspod_",
dataType: "script",
success: function(xhr) {
var p = "ddnspod_";
var params = ["run_status"];
for (var i = 0; i < params.length; i++) {
if (typeof db_ddnspod_[p + params[i]] !== "undefined") {
$("#ddnspod_"+params[i]).val(db_ddnspod_[p + params[i]]);
}
}
$("#ddnspod_run_state").html(db_ddnspod_['ddnspod_run_status']);
check_selected("ddnspod_auto_start", db_ddnspod_.ddnspod_auto_start);
check_selected("ddnspod_delay_time", db_ddnspod_.ddnspod_delay_time);
check_selected("ddnspod_refresh_time", db_ddnspod_.ddnspod_refresh_time);
}
});
}
function buildswitch(){
$("#switch").click(
function(){
if(document.getElementById('switch').checked){
document.form.ddnspod_enable.value = 1;
document.getElementById('ddnspod_detail_table').style.display = "";
}else{
document.form.ddnspod_enable.value = 0;
document.getElementById('ddnspod_detail_table').style.display = "none";
}
});
}
function check_selected(obj, m) {
var o = document.getElementById(obj);
for (var c = 0; c < o.length; c++) {
if (o.options[c].value == m) {
o.options[c].selected = true;
break;
}
}
}
function write_ddnspod_run_status(){
$.ajax({
type: "get",
url: "dbconf?p=ddnspod_",
dataType: "script",
success: function() {
var p = "ddnspod_";
var params = ["run_status"];
for (var i = 0; i < params.length; i++) {
if (typeof db_ddnspod_[p + params[i]] !== "undefined") {
$("#ddnspod_"+params[i]).val(db_ddnspod_[p + params[i]]);
}
}
$("#ddnspod_run_state").html(db_ddnspod_['ddnspod_run_status']);
setTimeout("write_ddnspod_run_status()", 10000);
}
});
}
function version_show(){
$("#ddnspod_version_status").html("<i>当前版本:" + db_ddnspod_['ddnspod_version']);
$.ajax({
url: 'https://raw.githubusercontent.com/paldier/softcenter/master/ddnspod/config.json.js',
type: 'GET',
success: function(res) {
var txt = $(res.responseText).text();
if(typeof(txt) != "undefined" && txt.length > 0) {
//console.log(txt);
var obj = $.parseJSON(txt.replace("'", "\""));
$("#ddnspod_version_status").html("<i>当前版本:" + obj.version);
if(obj.version != db_ddnspod_["ddnspod_version"]) {
$("#ddnspod_version_status").html("<i>有新版本:" + obj.version);
}
}
}
});
}
function done_validating(action) {
return true;
}
function reload_Soft_Center() {
location.href = "/Main_Soft_center.asp";
}
</script>
</head>
<body onload="init();">
<div id="TopBanner"></div>
<div id="Loading" class="popup_bg"></div>
<iframe name="hidden_frame" id="hidden_frame" src="" width="0" height="0" frameborder="0"></iframe>
<form method="post" name="form" action="/applydb.cgi?p=ddnspod_" target="hidden_frame">
<input type="hidden" name="current_page" value="Module_ddnspod.asp"/>
<input type="hidden" name="next_page" value="Module_ddnspod.asp"/>
<input type="hidden" name="group_id" value=""/>
<input type="hidden" name="modified" value="0"/>
<input type="hidden" name="action_mode" value=""/>
<input type="hidden" name="action_script" value="ddnspod_config.sh"/>
<input type="hidden" name="action_wait" value="5"/>
<input type="hidden" name="first_time" value=""/>
<input type="hidden" name="preferred_lang" id="preferred_lang" value="<% nvram_get("preferred_lang"); %>"/>
<input type="hidden" name="firmver" value="<% nvram_get("firmver"); %>"/>
<input type="hidden" id="ddnspod_config_pwd" name="ddnspod_config_pwd" value='<% dbus_get_def("ddnspod_config_pwd", ""); %>'/>
<input type="hidden" id="ddnspod_enable" name="ddnspod_enable" value='<% dbus_get_def("ddnspod_enable", "0"); %>'/>
<input type="hidden" id="ddnspod_run_status" name="ddnspod_run_status" value='<% dbus_get_def("ddnspod_run_status", "0"); %>'/>
<table class="content" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="17">&nbsp;</td>
<td valign="top" width="202">
<div id="mainMenu"></div>
<div id="subMenu"></div>
</td>
<td valign="top">
<div id="tabMenu" class="submenuBlock"></div>
<table width="98%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<table width="760px" border="0" cellpadding="5" cellspacing="0" bordercolor="#6b8fa3" class="FormTitle" id="FormTitle">
<tr>
<td bgcolor="#4D595D" colspan="3" valign="top">
<div>&nbsp;</div>
<div style="float:left;" class="formfonttitle">DDnspod</div>
<div style="float:right; width:15px; height:25px;margin-top:10px"><img id="return_btn" onclick="reload_Soft_Center();" align="right" style="cursor:pointer;position:absolute;margin-left:-30px;margin-top:-25px;" title="返回软件中心" src="/images/backprev.png" onMouseOver="this.src='/images/backprevclick.png'" onMouseOut="this.src='/images/backprev.png'"></img></div>
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px"><img src="/images/New_ui/export/line_export.png"></div>
<div class="formfontdesc" style="padding-top:5px;margin-top:0px;float: left;" id="cmdDesc">
<div>使用dnspod实现的ddns服务</div>
<ul style="padding-top:5px;margin-top:10px;float: left;">
<li>使用前需要将域名添加到dnspod中并添加一条A记录使用之后将自动更新ip</li>
<li>dnspod账户·密码 和 dnspod Token 选填一组推荐使用dnspod Token可以保护账户安全</li>
<li>点 <a href="https://support.dnspod.cn/Kb/showarticle/tsid/227"><i><u>这里</u></i></a> 查看官方说明以及如何获取dnspod Token</li>
</ul>
</div>
<!--<div class="formfontdesc" id="cmdDesc"></div>-->
<table style="margin:10px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable" id="routing_table">
<thead>
<tr>
<td colspan="2">开关设置</td>
</tr>
</thead>
<tr>
<th>开启DDnspod</th>
<td colspan="2">
<div class="switch_field" style="display:table-cell;float: left;">
<label for="switch">
<input id="switch" class="switch" type="checkbox" style="display: none;">
<div class="switch_container" >
<div class="switch_bar"></div>
<div class="switch_circle transition_style">
<div></div>
</div>
</div>
</label>
</div>
<div id="ddnspod_version_status" style="padding-top:5px;margin-left:230px;margin-top:0px;float:left;">
<i>当前版本:<% dbus_get_def("ddnspod_version", "未知"); %></i>
</div>
</td>
</tr>
</table>
<table style="margin:10px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable" id="ddnspod_detail_table">
<thead>
<tr>
<td colspan="2">基本设置</td>
</tr>
</thead>
<tr>
<th width="35%">dnspod账户</th>
<td>
<input type="text" class="input_ss_table" style="width:auto;" size="30" id="ddnspod_config_uname" name="ddnspod_config_uname" maxlength="20" placeholder="dnspod账户" value='<% dbus_get_def("ddnspod_config_uname", ""); %>' >
</td>
</tr>
<tr>
<th width="35%">dnspod密码</th>
<td>
<input type="password" class="input_ss_table" style="width:auto;" size="20" id="ddnspod_config_old_pwd" name="ddnspod_config_old_pwd" maxlength="30" placeholder="dnspod密码" value='<% dbus_get_def("ddnspod_config_old_pwd", ""); %>' />
<div style="margin-left:170px;margin-top:-20px;margin-bottom:0px"><input type="checkbox" name="show_pass" onclick="pass_checked(document.form.ddnspod_config_old_pwd);">显示密码</div>
</td>
</tr>
<tr>
<th width="35%">dnspod Token</th>
<td>
<input type="text" class="input_ss_table" style="width:auto;" size="30" id="ddnspod_config_token" name="ddnspod_config_token" maxlength="50" placeholder="ID,Token" value='<% dbus_get_def("ddnspod_config_token", ""); %>' >
<div class="formfontdesc" style="margin-left:270px;margin-top:-20px;margin-bottom:0px;color:rgb(255,204,0);">推荐使用</div>
</td>
</tr>
<tr>
<th width="35%">域名</th>
<td>
<input type="text" class="input_ss_table" style="width:auto;" size="30" id="ddnspod_config_domain" name="ddnspod_config_domain" maxlength="40" placeholder="填写完整域名" value='<% dbus_get_def("ddnspod_config_domain", ""); %>' >
</td>
</tr>
<thead>
<tr>
<td colspan="3">运行状态</td>
</tr>
</thead>
<tr>
<th width="35%">状态</th>
<td>
<a>
<span id="ddnspod_run_state"></span>
</a>
</td>
</tr>
<thead>
<tr>
<td colspan="4">启动设置</td>
</tr>
</thead>
<tr>
<th width="35%">开机自启</th>
<td>
<select id="ddnspod_auto_start" name="ddnspod_auto_start" class="input_option" >
<option value="1">是</option>
<option value="0">否</option>
</select>
</td>
</tr>
<tr>
<th width="35%">启动延时</th>
<td>
<select id="ddnspod_delay_time" name="ddnspod_delay_time" class="input_option" >
<option value="1">1S</option>
<option value="5">5S</option>
<option value="10">10S</option>
</select>
</td>
</tr>
<thead>
<tr>
<td colspan="4">刷新设置</td>
</tr>
</thead>
<tr>
<th width="35%">刷新时间</th>
<td>
<select id="ddnspod_refresh_time" name="ddnspod_refresh_time" class="input_option" >
<option value="1">1H</option>
<option value="5">5H</option>
<option value="10">10H</option>
</select>
</td>
</tr>
<thead id="double_wan_set">
<tr>
<td colspan="4">双WAN设置</td>
</tr>
</thead>
<tr id="select_wan">
<th width="35%">加速WAN口</th>
<td>
<select id="ddnspod_config_wan" name="ddnspod_config_wan" class="input_option" >
<option value="1">WAN1</option>
<option value="2">WAN2</option>
</select>
</td>
</tr>
</table>
<div id="warn" style="display: none;margin-top: 20px;text-align: center;font-size: 20px;margin-bottom: 20px;"class="formfontdesc" ></div>
<div class="apply_gen">
<button id="cmdBtn" class="button_gen" onclick="onSubmitCtrl(this, ' Refresh ')">提交</button>
</div>
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px"><img src="/images/New_ui/export/line_export.png"></div>
<div class="KoolshareBottom">
<br/>论坛技术支持: <a href="http://www.koolshare.cn" target="_blank"> <i><u>www.koolshare.cn</u></i> </a> <br/>
后台技术支持: <i>Xiaobao</i> <br/>
Shell, Web by <i>freexiaoyao</i><br/>
</div>
</td>
</tr>
</table>
</td>
<td width="10" align="center" valign="top"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<div id="footer"></div>
</body>
</html>

Binary file not shown.

1
ddnspod/history/version Normal file
View File

@ -0,0 +1 @@
0.1.6 51d5ad8b70e973228803b9529a86e61d

2
ddnspod/version Normal file
View File

@ -0,0 +1,2 @@
0.1.6
c738df170ed0071439f017fc701be137

View File

@ -119,6 +119,16 @@
"tar_url": "aliddns/aliddns.tar.gz",
"title": "aliddns",
"version": "1.2"
},
{
"build_date": "2019-01-17_00:07:34",
"description": "使用Dnspod的ddns服务",
"home_url": "Module_ddnspod.asp",
"md5": "c738df170ed0071439f017fc701be137",
"name": "ddnspod",
"tar_url": "ddnspod/ddnspod.tar.gz",
"title": "DDnspod",
"version": "0.1.6"
}
],
"home_url": "https://raw.githubusercontent.com/paldier/softcenter/master",

View File

@ -31,7 +31,7 @@ def work_paths_by_walk():
print os.path.join(root,sub)
def work_parent():
ignore_paths = frozenset(["maintain_files", "softcenter", "v2ray", "adbyby", "ddnspod", "gdddns"])
ignore_paths = frozenset(["maintain_files", "softcenter", "v2ray", "adbyby", "gdddns"])
for fname in os.listdir(parent_path):
if fname[0] == "." or fname in ignore_paths: