diff --git a/ddnspod/Changelog.txt b/ddnspod/Changelog.txt new file mode 100644 index 0000000..fedcd3e --- /dev/null +++ b/ddnspod/Changelog.txt @@ -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 diff --git a/ddnspod/backup.sh b/ddnspod/backup.sh new file mode 100644 index 0000000..e71b0fc --- /dev/null +++ b/ddnspod/backup.sh @@ -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 diff --git a/ddnspod/build.sh b/ddnspod/build.sh new file mode 100755 index 0000000..a7cdbed --- /dev/null +++ b/ddnspod/build.sh @@ -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 diff --git a/ddnspod/config.json.js b/ddnspod/config.json.js new file mode 100644 index 0000000..f4688f5 --- /dev/null +++ b/ddnspod/config.json.js @@ -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" +} diff --git a/ddnspod/ddnspod.tar.gz b/ddnspod/ddnspod.tar.gz new file mode 100644 index 0000000..6cc2cdd Binary files /dev/null and b/ddnspod/ddnspod.tar.gz differ diff --git a/ddnspod/ddnspod/install.sh b/ddnspod/ddnspod/install.sh new file mode 100755 index 0000000..888fb3a --- /dev/null +++ b/ddnspod/ddnspod/install.sh @@ -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 diff --git a/ddnspod/ddnspod/res/icon-ddnspod.png b/ddnspod/ddnspod/res/icon-ddnspod.png new file mode 100644 index 0000000..9757623 Binary files /dev/null and b/ddnspod/ddnspod/res/icon-ddnspod.png differ diff --git a/ddnspod/ddnspod/res/md5.js b/ddnspod/ddnspod/res/md5.js new file mode 100644 index 0000000..c1d09a9 --- /dev/null +++ b/ddnspod/ddnspod/res/md5.js @@ -0,0 +1 @@ +var md5; md5 || (md5 = function(){function i(a,b){a[b>>5]|=128<>>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<>>32-b}function r(a){for(var b=[],d=(1<e;e+=c)b[e>>5]|=(a.charCodeAt(e/c)&d)<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))}}()); \ No newline at end of file diff --git a/ddnspod/ddnspod/res/rsa.js b/ddnspod/ddnspod/res/rsa.js new file mode 100644 index 0000000..0e012c3 --- /dev/null +++ b/ddnspod/ddnspod/res/rsa.js @@ -0,0 +1 @@ +var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64padchar="=";function hex2b64(h){var i;var c;var ret="";for(i=0;i+3<=h.length;i+=3){c=parseInt(h.substring(i,i+3),16);ret+=b64map.charAt(c>>6)+b64map.charAt(c&63)}if(i+1==h.length){c=parseInt(h.substring(i,i+1),16);ret+=b64map.charAt(c<<2)}else{if(i+2==h.length){c=parseInt(h.substring(i,i+2),16);ret+=b64map.charAt(c>>2)+b64map.charAt((c&3)<<4)}}while((ret.length&3)>0){ret+=b64padchar}return ret}function b64tohex(s){var ret="";var i;var k=0;var slop;for(i=0;i>2);slop=v&3;k=1}else{if(k==1){ret+=int2char((slop<<2)|(v>>4));slop=v&15;k=2}else{if(k==2){ret+=int2char(slop);ret+=int2char(v>>2);slop=v&3;k=3}else{ret+=int2char((slop<<2)|(v>>4));ret+=int2char(v&15);k=0}}}}if(k==1){ret+=int2char(slop<<2)}return ret}function b64toBA(s){var h=b64tohex(s);var i;var a=new Array();for(i=0;2*i=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/67108864);w[j++]=v&67108863}return c}function am2(i,x,w,j,c,n){var xl=x&32767,xh=x>>15;while(--n>=0){var l=this[i]&32767;var h=this[i++]>>15;var m=xh*l+h*xl;l=xl*l+((m&32767)<<15)+w[j]+(c&1073741823);c=(l>>>30)+(m>>>15)+xh*h+(c>>>30);w[j++]=l&1073741823}return c}function am3(i,x,w,j,c,n){var xl=x&16383,xh=x>>14;while(--n>=0){var l=this[i]&16383;var h=this[i++]>>14;var m=xh*l+h*xl;l=xl*l+((m&16383)<<14)+w[j]+c;c=(l>>28)+(m>>14)+xh*h;w[j++]=l&268435455}return c}if(j_lm&&(navigator.appName=="Microsoft Internet Explorer")){BigInteger.prototype.am=am2;dbits=30}else{if(j_lm&&(navigator.appName!="Netscape")){BigInteger.prototype.am=am1;dbits=26}else{BigInteger.prototype.am=am3;dbits=28}}BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=((1<=0;--i){r[i]=this[i]}r.t=this.t;r.s=this.s}function bnpFromInt(x){this.t=1;this.s=(x<0)?-1:0;if(x>0){this[0]=x}else{if(x<-1){this[0]=x+this.DV}else{this.t=0}}}function nbv(i){var r=nbi();r.fromInt(i);return r}function bnpFromString(s,b){var k;if(b==16){k=4}else{if(b==8){k=3}else{if(b==256){k=8}else{if(b==2){k=1}else{if(b==32){k=5}else{if(b==4){k=2}else{this.fromRadix(s,b);return}}}}}}this.t=0;this.s=0;var i=s.length,mi=false,sh=0;while(--i>=0){var x=(k==8)?s[i]&255:intAt(s,i);if(x<0){if(s.charAt(i)=="-"){mi=true}continue}mi=false;if(sh==0){this[this.t++]=x}else{if(sh+k>this.DB){this[this.t-1]|=(x&((1<<(this.DB-sh))-1))<>(this.DB-sh))}else{this[this.t-1]|=x<=this.DB){sh-=this.DB}}if(k==8&&(s[0]&128)!=0){this.s=-1;if(sh>0){this[this.t-1]|=((1<<(this.DB-sh))-1)<0&&this[this.t-1]==c){--this.t}}function bnToString(b){if(this.s<0){return"-"+this.negate().toString(b)}var k;if(b==16){k=4}else{if(b==8){k=3}else{if(b==2){k=1}else{if(b==32){k=5}else{if(b==4){k=2}else{return this.toRadix(b)}}}}}var km=(1<0){if(p>p)>0){m=true;r=int2char(d)}while(i>=0){if(p>(p+=this.DB-k)}else{d=(this[i]>>(p-=k))&km;if(p<=0){p+=this.DB;--i}}if(d>0){m=true}if(m){r+=int2char(d)}}}return m?r:"0"}function bnNegate(){var r=nbi();BigInteger.ZERO.subTo(this,r);return r}function bnAbs(){return(this.s<0)?this.negate():this}function bnCompareTo(a){var r=this.s-a.s;if(r!=0){return r}var i=this.t;r=i-a.t;if(r!=0){return(this.s<0)?-r:r}while(--i>=0){if((r=this[i]-a[i])!=0){return r}}return 0}function nbits(x){var r=1,t;if((t=x>>>16)!=0){x=t;r+=16}if((t=x>>8)!=0){x=t;r+=8}if((t=x>>4)!=0){x=t;r+=4}if((t=x>>2)!=0){x=t;r+=2}if((t=x>>1)!=0){x=t;r+=1}return r}function bnBitLength(){if(this.t<=0){return 0}return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM))}function bnpDLShiftTo(n,r){var i;for(i=this.t-1;i>=0;--i){r[i+n]=this[i]}for(i=n-1;i>=0;--i){r[i]=0}r.t=this.t+n;r.s=this.s}function bnpDRShiftTo(n,r){for(var i=n;i=0;--i){r[i+ds+1]=(this[i]>>cbs)|c;c=(this[i]&bm)<=0;--i){r[i]=0}r[ds]=c;r.t=this.t+ds+1;r.s=this.s;r.clamp()}function bnpRShiftTo(n,r){r.s=this.s;var ds=Math.floor(n/this.DB);if(ds>=this.t){r.t=0;return}var bs=n%this.DB;var cbs=this.DB-bs;var bm=(1<>bs;for(var i=ds+1;i>bs}if(bs>0){r[this.t-ds-1]|=(this.s&bm)<>=this.DB}if(a.t>=this.DB}c+=this.s}else{c+=this.s;while(i>=this.DB}c-=a.s}r.s=(c<0)?-1:0;if(c<-1){r[i++]=this.DV+c}else{if(c>0){r[i++]=c}}r.t=i;r.clamp()}function bnpMultiplyTo(a,r){var x=this.abs(),y=a.abs();var i=x.t;r.t=i+y.t;while(--i>=0){r[i]=0}for(i=0;i=0){r[i]=0}for(i=0;i=x.DV){r[i+x.t]-=x.DV;r[i+x.t+1]=1}}if(r.t>0){r[r.t-1]+=x.am(i,x[i],r,2*i,0,1)}r.s=0;r.clamp()}function bnpDivRemTo(m,q,r){var pm=m.abs();if(pm.t<=0){return}var pt=this.abs();if(pt.t0){pm.lShiftTo(nsh,y);pt.lShiftTo(nsh,r)}else{pm.copyTo(y);pt.copyTo(r)}var ys=y.t;var y0=y[ys-1];if(y0==0){return}var yt=y0*(1<1)?y[ys-2]>>this.F2:0);var d1=this.FV/yt,d2=(1<=0){r[r.t++]=1;r.subTo(t,r)}BigInteger.ONE.dlShiftTo(ys,t);t.subTo(y,y);while(y.t=0){var qd=(r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);if((r[i]+=y.am(0,qd,r,j,0,ys))0){r.rShiftTo(nsh,r)}if(ts<0){BigInteger.ZERO.subTo(r,r)}}function bnMod(a){var r=nbi();this.abs().divRemTo(a,null,r);if(this.s<0&&r.compareTo(BigInteger.ZERO)>0){a.subTo(r,r)}return r}function Classic(m){this.m=m}function cConvert(x){if(x.s<0||x.compareTo(this.m)>=0){return x.mod(this.m)}else{return x}}function cRevert(x){return x}function cReduce(x){x.divRemTo(this.m,null,x)}function cMulTo(x,y,r){x.multiplyTo(y,r);this.reduce(r)}function cSqrTo(x,r){x.squareTo(r);this.reduce(r)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo;function bnpInvDigit(){if(this.t<1){return 0}var x=this[0];if((x&1)==0){return 0}var y=x&3;y=(y*(2-(x&15)*y))&15;y=(y*(2-(x&255)*y))&255;y=(y*(2-(((x&65535)*y)&65535)))&65535;y=(y*(2-x*y%this.DV))%this.DV;return(y>0)?this.DV-y:-y}function Montgomery(m){this.m=m;this.mp=m.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<(m.DB-15))-1;this.mt2=2*m.t}function montConvert(x){var r=nbi();x.abs().dlShiftTo(this.m.t,r);r.divRemTo(this.m,null,r);if(x.s<0&&r.compareTo(BigInteger.ZERO)>0){this.m.subTo(r,r)}return r}function montRevert(x){var r=nbi();x.copyTo(r);this.reduce(r);return r}function montReduce(x){while(x.t<=this.mt2){x[x.t++]=0}for(var i=0;i>15)*this.mpl)&this.um)<<15))&x.DM;j=i+this.m.t;x[j]+=this.m.am(0,u0,x,i,0,this.m.t);while(x[j]>=x.DV){x[j]-=x.DV;x[++j]++}}x.clamp();x.drShiftTo(this.m.t,x);if(x.compareTo(this.m)>=0){x.subTo(this.m,x)}}function montSqrTo(x,r){x.squareTo(r);this.reduce(r)}function montMulTo(x,y,r){x.multiplyTo(y,r);this.reduce(r)}Montgomery.prototype.convert=montConvert;Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return((this.t>0)?(this[0]&1):this.s)==0}function bnpExp(e,z){if(e>4294967295||e<1){return BigInteger.ONE}var r=nbi(),r2=nbi(),g=z.convert(this),i=nbits(e)-1;g.copyTo(r);while(--i>=0){z.sqrTo(r,r2);if((e&(1<0){z.mulTo(r2,g,r)}else{var t=r;r=r2;r2=t}}return z.revert(r)}function bnModPowInt(e,m){var z;if(e<256||m.isEven()){z=new Classic(m)}else{z=new Montgomery(m)}return this.exp(e,z)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo;BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt;BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1);function Arcfour(){this.i=0;this.j=0;this.S=new Array()}function ARC4init(key){var i,j,t;for(i=0;i<256;++i){this.S[i]=i}j=0;for(i=0;i<256;++i){j=(j+this.S[i]+key[i%key.length])&255;t=this.S[i];this.S[i]=this.S[j];this.S[j]=t}this.i=0;this.j=0}function ARC4next(){var t;this.i=(this.i+1)&255;this.j=(this.j+this.S[this.i])&255;t=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=t;return this.S[(t+this.S[this.i])&255]}Arcfour.prototype.init=ARC4init;Arcfour.prototype.next=ARC4next;function prng_newstate(){return new Arcfour()}var rng_psize=256;var rng_state;var rng_pool;var rng_pptr;function rng_seed_int(x){rng_pool[rng_pptr++]^=x&255;rng_pool[rng_pptr++]^=(x>>8)&255;rng_pool[rng_pptr++]^=(x>>16)&255;rng_pool[rng_pptr++]^=(x>>24)&255;if(rng_pptr>=rng_psize){rng_pptr-=rng_psize}}function rng_seed_time(){rng_seed_int(new Date().getTime())}if(rng_pool==null){rng_pool=new Array();rng_pptr=0;var t;if(window.crypto&&window.crypto.getRandomValues){var ua=new Uint8Array(32);window.crypto.getRandomValues(ua);for(t=0;t<32;++t){rng_pool[rng_pptr++]=ua[t]}}if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t>>8;rng_pool[rng_pptr++]=t&255}rng_pptr=0;rng_seed_time()}function rng_get_byte(){if(rng_state==null){rng_seed_time();rng_state=prng_newstate();rng_state.init(rng_pool);for(rng_pptr=0;rng_pptr=0&&n>0){var c=s.charCodeAt(i--);if(c<128){ba[--n]=c}else{if((c>127)&&(c<2048)){ba[--n]=(c&63)|128;ba[--n]=(c>>6)|192}else{ba[--n]=(c&63)|128;ba[--n]=((c>>6)&63)|128;ba[--n]=(c>>12)|224}}}ba[--n]=0;var rng=new SecureRandom();var x=new Array();while(n>2){x[0]=0;while(x[0]==0){rng.nextBytes(x)}ba[--n]=x[0]}ba[--n]=0;ba[--n]=0;return new BigInteger(ba)}function pkcs1pad3(s,n){if(n127)&&(c<2048)){ba[j++]=(c>>6)|192;ba[j++]=(c&63)|128}else{ba[j++]=(c>>12)|224;ba[j++]=((c>>6)&63)|128;ba[j++]=(c&63)|128}}}ba[j++]=0;var rng=new SecureRandom();var x=new Array();while(j0&&E.length>0){this.n=parseBigInt(N,16);this.e=parseInt(E,16)}else{alert("Invalid RSA public key")}}function RSADoPublic(x){return x.modPowInt(this.e,this.n)}function RSAEncrypt(text){var m=pkcs1pad3(text,(this.n.bitLength()+7)>>3);if(m==null){return null}var c=this.doPublic(m);if(c==null){return null}var h=c.toString(16);if((h.length&1)==0){return h}else{return"0"+h}}RSAKey.prototype.doPublic=RSADoPublic;RSAKey.prototype.setPublic=RSASetPublic;RSAKey.prototype.encrypt=RSAEncrypt; \ No newline at end of file diff --git a/ddnspod/ddnspod/res/sha1.js b/ddnspod/ddnspod/res/sha1.js new file mode 100644 index 0000000..1b55982 --- /dev/null +++ b/ddnspod/ddnspod/res/sha1.js @@ -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; +} diff --git a/ddnspod/ddnspod/scripts/ddnspod.sh b/ddnspod/ddnspod/scripts/ddnspod.sh new file mode 100755 index 0000000..7e2c5e6 --- /dev/null +++ b/ddnspod/ddnspod/scripts/ddnspod.sh @@ -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 diff --git a/ddnspod/ddnspod/scripts/ddnspod_config.sh b/ddnspod/ddnspod/scripts/ddnspod_config.sh new file mode 100644 index 0000000..96e9e56 --- /dev/null +++ b/ddnspod/ddnspod/scripts/ddnspod_config.sh @@ -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 diff --git a/ddnspod/ddnspod/uninstall.sh b/ddnspod/ddnspod/uninstall.sh new file mode 100755 index 0000000..7b5b226 --- /dev/null +++ b/ddnspod/ddnspod/uninstall.sh @@ -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 diff --git a/ddnspod/ddnspod/webs/Module_ddnspod.asp b/ddnspod/ddnspod/webs/Module_ddnspod.asp new file mode 100644 index 0000000..27fa9c4 --- /dev/null +++ b/ddnspod/ddnspod/webs/Module_ddnspod.asp @@ -0,0 +1,358 @@ + + + + + + + + + + 软件中心 - DDnspod设置 + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + "/> + "/> + + + + + + + + + + +
  + + + + + + + + + +
+ + + + +
+
 
+
DDnspod
+
+
+
+
使用dnspod实现的ddns服务
+
    +
  • 使用前需要将域名添加到dnspod中,并添加一条A记录,使用之后将自动更新ip
  • +
  • dnspod账户·密码 和 dnspod Token 选填一组,推荐使用dnspod Token,可以保护账户安全
  • +
  • 这里 查看官方说明以及如何获取dnspod Token
  • +
+
+ + + + + + + + + + + +
开关设置
开启DDnspod +
+ +
+
+ 当前版本:<% dbus_get_def("ddnspod_version", "未知"); %> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
基本设置
dnspod账户 + +
dnspod密码 + +
显示密码
+
dnspod Token + +
推荐使用
+
域名 + +
运行状态
状态 + + + +
启动设置
开机自启 + +
启动延时 + +
刷新设置
刷新时间 + +
双WAN设置
加速WAN口 + +
+ +
+ +
+
+
+
论坛技术支持: www.koolshare.cn
+ 后台技术支持: Xiaobao
+ Shell, Web by: freexiaoyao
+
+
+
+
+
+ + + diff --git a/ddnspod/history/0.1.6/ddnspod.tar.gz b/ddnspod/history/0.1.6/ddnspod.tar.gz new file mode 100644 index 0000000..8d85070 Binary files /dev/null and b/ddnspod/history/0.1.6/ddnspod.tar.gz differ diff --git a/ddnspod/history/version b/ddnspod/history/version new file mode 100644 index 0000000..4de17df --- /dev/null +++ b/ddnspod/history/version @@ -0,0 +1 @@ +0.1.6 51d5ad8b70e973228803b9529a86e61d diff --git a/ddnspod/version b/ddnspod/version new file mode 100644 index 0000000..9c3c7f3 --- /dev/null +++ b/ddnspod/version @@ -0,0 +1,2 @@ +0.1.6 +c738df170ed0071439f017fc701be137 diff --git a/softcenter/app.json.js b/softcenter/app.json.js index 6ea7132..913f3ff 100644 --- a/softcenter/app.json.js +++ b/softcenter/app.json.js @@ -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", diff --git a/softcenter/gen_install.py b/softcenter/gen_install.py index 9ec89dc..3d40e9b 100755 --- a/softcenter/gen_install.py +++ b/softcenter/gen_install.py @@ -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: