hfs 0.57.26 → 0.57.27-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/assets/{index-CHMhmNYS.js → index-DSkhXlWX.js} +103 -103
- package/admin/assets/{sha512-Dsv49IAs.js → sha512-CoddZKeD.js} +1 -1
- package/admin/index.html +1 -1
- package/frontend/assets/{index-legacy-BI8icwFp.js → index-legacy-C4Gclsbz.js} +4 -4
- package/frontend/assets/{sha512-legacy-D82alHBq.js → sha512-legacy-C-FMk44u.js} +1 -1
- package/frontend/index.html +1 -1
- package/package.json +4 -3
- package/src/QuickZipStream.js +11 -8
- package/src/SendList.js +10 -8
- package/src/ThrottledStream.js +8 -6
- package/src/acme.js +5 -7
- package/src/adminApis.js +6 -7
- package/src/api.accounts.js +4 -6
- package/src/api.auth.js +7 -11
- package/src/api.get_file_list.js +11 -16
- package/src/api.lang.js +1 -1
- package/src/api.monitor.js +2 -3
- package/src/api.net.js +1 -2
- package/src/api.plugins.js +8 -10
- package/src/api.vfs.js +14 -19
- package/src/apiMiddleware.js +4 -4
- package/src/auth.js +6 -9
- package/src/basicWeb.js +1 -2
- package/src/block.js +1 -1
- package/src/commands.js +9 -9
- package/src/comments.js +4 -5
- package/src/config.js +8 -9
- package/src/connections.js +11 -6
- package/src/consoleLog.js +6 -6
- package/src/const.js +4 -4
- package/src/cross.js +19 -21
- package/src/customHtml.js +3 -4
- package/src/ddns.js +4 -4
- package/src/debounceAsync.js +3 -3
- package/src/errorPages.js +2 -3
- package/src/events.js +7 -10
- package/src/fileAttr.js +6 -6
- package/src/first.js +13 -8
- package/src/frontEndApis.js +5 -5
- package/src/geo.js +3 -5
- package/src/github.js +14 -17
- package/src/i18n.js +3 -4
- package/src/icons.js +1 -1
- package/src/index.js +2 -3
- package/src/lang.js +5 -6
- package/src/listen.js +25 -28
- package/src/log.js +18 -17
- package/src/middlewares.js +12 -15
- package/src/misc.js +9 -11
- package/src/nat.js +14 -16
- package/src/outboundProxy.js +7 -7
- package/src/perm.js +7 -12
- package/src/persistence.js +1 -1
- package/src/plugins.js +62 -73
- package/src/roots.js +1 -2
- package/src/selfCheck.js +5 -4
- package/src/serveFile.js +6 -7
- package/src/serveGuiAndSharedFiles.js +7 -9
- package/src/serveGuiFiles.js +11 -20
- package/src/stat.js +40 -0
- package/src/statWorker.js +11 -0
- package/src/throttler.js +5 -7
- package/src/update.js +7 -7
- package/src/upload.js +11 -13
- package/src/util-files.js +42 -32
- package/src/util-http.js +80 -29
- package/src/util-os.js +2 -4
- package/src/vfs.js +77 -68
- package/src/walkDir.js +9 -9
- package/src/watchLoad.js +4 -4
- package/src/zip.js +5 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["./index-legacy-BI8icwFp.js"],(function(h,t){"use strict";var i,s;return{setters:[function(h){i=h.c,s=h.g}],execute:function(){function t(h,t){for(var i=function(){var i=t[s];if("string"!=typeof i&&!Array.isArray(i)){var r=function(t){if("default"!==t&&!(t in h)){var s=Object.getOwnPropertyDescriptor(i,t);s&&Object.defineProperty(h,t,s.get?s:{enumerable:!0,get:function(){return i[t]}})}};for(var e in i)r(e)}},s=0;s<t.length;s++)i();return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var r,e={exports:{}},n=(r||(r=1,function(h){!function(){var t="input is invalid type",s="object"==typeof window,r=s?window:{};r.JS_SHA512_NO_WINDOW&&(s=!1);var e=!s&&"object"==typeof self;!r.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=i:e&&(r=self);var n=!r.JS_SHA512_NO_COMMON_JS&&h.exports,o=!r.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],f=[24,16,8,0],c=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=["hex","array","digest","arrayBuffer"],y=[];!r.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(h){return"[object Array]"===Object.prototype.toString.call(h)}),!o||!r.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(h){return"object"==typeof h&&h.buffer&&h.buffer.constructor===ArrayBuffer});var p=function(h,t){return function(i){return new _(t,!0).update(i)[h]()}},d=function(h){var t=p("hex",h);t.create=function(){return new _(h)},t.update=function(h){return t.create().update(h)};for(var i=0;i<u.length;++i){var s=u[i];t[s]=p(s,h)}return t},b=function(h,t){return function(i,s){return new w(i,t,!0).update(s)[h]()}},v=function(h){var t=b("hex",h);t.create=function(t){return new w(t,h)},t.update=function(h,i){return t.create(h).update(i)};for(var i=0;i<u.length;++i){var s=u[i];t[s]=b(s,h)}return t};function _(h,t){t?(y[0]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=y[16]=y[17]=y[18]=y[19]=y[20]=y[21]=y[22]=y[23]=y[24]=y[25]=y[26]=y[27]=y[28]=y[29]=y[30]=y[31]=y[32]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==h?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==h?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==h?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=h,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function w(h,i,s){var r,e=typeof h;if("string"!==e){if("object"!==e)throw new Error(t);if(null===h)throw new Error(t);if(o&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!(Array.isArray(h)||o&&ArrayBuffer.isView(h)))throw new Error(t);r=!0}var n=h.length;if(!r){for(var a,l=[],f=(n=h.length,0),c=0;c<n;++c)(a=h.charCodeAt(c))<128?l[f++]=a:a<2048?(l[f++]=192|a>>6,l[f++]=128|63&a):a<55296||a>=57344?(l[f++]=224|a>>12,l[f++]=128|a>>6&63,l[f++]=128|63&a):(a=65536+((1023&a)<<10|1023&h.charCodeAt(++c)),l[f++]=240|a>>18,l[f++]=128|a>>12&63,l[f++]=128|a>>6&63,l[f++]=128|63&a);h=l}h.length>128&&(h=new _(i,!0).update(h).array());var u=[],y=[];for(c=0;c<128;++c){var p=h[c]||0;u[c]=92^p,y[c]=54^p}_.call(this,i,s),this.update(y),this.oKeyPad=u,this.inner=!0,this.sharedMemory=s}_.prototype.update=function(h){if(this.finalized)throw new Error("finalize already called");var i,s=typeof h;if("string"!==s){if("object"!==s)throw new Error(t);if(null===h)throw new Error(t);if(o&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!(Array.isArray(h)||o&&ArrayBuffer.isView(h)))throw new Error(t);i=!0}for(var r,e,n=0,a=h.length,l=this.blocks;n<a;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=l[16]=l[17]=l[18]=l[19]=l[20]=l[21]=l[22]=l[23]=l[24]=l[25]=l[26]=l[27]=l[28]=l[29]=l[30]=l[31]=l[32]=0),i)for(e=this.start;n<a&&e<128;++n)l[e>>2]|=h[n]<<f[3&e++];else for(e=this.start;n<a&&e<128;++n)(r=h.charCodeAt(n))<128?l[e>>2]|=r<<f[3&e++]:r<2048?(l[e>>2]|=(192|r>>6)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]):r<55296||r>=57344?(l[e>>2]|=(224|r>>12)<<f[3&e++],l[e>>2]|=(128|r>>6&63)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]):(r=65536+((1023&r)<<10|1023&h.charCodeAt(++n)),l[e>>2]|=(240|r>>18)<<f[3&e++],l[e>>2]|=(128|r>>12&63)<<f[3&e++],l[e>>2]|=(128|r>>6&63)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,e>=128?(this.block=l[32],this.start=e-128,this.hash(),this.hashed=!0):this.start=e}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,t=this.lastByteIndex;h[32]=this.block,h[t>>2]|=l[3&t],this.block=h[32],t>=112&&(this.hashed||this.hash(),h[0]=this.block,h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=h[16]=h[17]=h[18]=h[19]=h[20]=h[21]=h[22]=h[23]=h[24]=h[25]=h[26]=h[27]=h[28]=h[29]=h[30]=h[31]=h[32]=0),h[30]=this.hBytes<<3|this.bytes>>>29,h[31]=this.bytes<<3,this.hash()}},_.prototype.hash=function(){var h,t,i,s,r,e,n,o,a,l,f,u,y,p,d,b,v,_,w,A,g,S,B,U,O,k=this.h0h,x=this.h0l,z=this.h1h,j=this.h1l,E=this.h2h,N=this.h2l,m=this.h3h,J=this.h3l,P=this.h4h,H=this.h4l,I=this.h5h,R=this.h5l,V=this.h6h,C=this.h6l,D=this.h7h,K=this.h7l,M=this.blocks;for(h=32;h<160;h+=2)t=((A=M[h-30])>>>1|(g=M[h-29])<<31)^(A>>>8|g<<24)^A>>>7,i=(g>>>1|A<<31)^(g>>>8|A<<24)^(g>>>7|A<<25),s=((A=M[h-4])>>>19|(g=M[h-3])<<13)^(g>>>29|A<<3)^A>>>6,r=(g>>>19|A<<13)^(A>>>29|g<<3)^(g>>>6|A<<26),A=M[h-32],g=M[h-31],a=((S=M[h-14])>>>16)+(A>>>16)+(t>>>16)+(s>>>16)+((o=(65535&S)+(65535&A)+(65535&t)+(65535&s)+((n=((B=M[h-13])>>>16)+(g>>>16)+(i>>>16)+(r>>>16)+((e=(65535&B)+(65535&g)+(65535&i)+(65535&r))>>>16))>>>16))>>>16),M[h]=a<<16|65535&o,M[h+1]=n<<16|65535&e;var F=k,T=x,W=z,Y=j,q=E,G=N,L=m,Q=J,X=P,Z=H,$=I,hh=R,th=V,ih=C,sh=D,rh=K;for(b=W&q,v=Y&G,h=0;h<160;h+=8)t=(F>>>28|T<<4)^(T>>>2|F<<30)^(T>>>7|F<<25),i=(T>>>28|F<<4)^(F>>>2|T<<30)^(F>>>7|T<<25),s=(X>>>14|Z<<18)^(X>>>18|Z<<14)^(Z>>>9|X<<23),r=(Z>>>14|X<<18)^(Z>>>18|X<<14)^(X>>>9|Z<<23),_=(l=F&W)^F&q^b,w=(f=T&Y)^T&G^v,U=X&$^~X&th,O=Z&hh^~Z&ih,A=M[h],g=M[h+1],A=(a=((S=c[h])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(sh>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&sh)+((n=((B=c[h+1])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(rh>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&rh))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,sh=(a=(L>>>16)+(A>>>16)+((o=(65535&L)+(65535&A)+((n=(Q>>>16)+(g>>>16)+((e=(65535&Q)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,rh=n<<16|65535&e,t=((L=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(Q=n<<16|65535&e)<<4)^(Q>>>2|L<<30)^(Q>>>7|L<<25),i=(Q>>>28|L<<4)^(L>>>2|Q<<30)^(L>>>7|Q<<25),s=(sh>>>14|rh<<18)^(sh>>>18|rh<<14)^(rh>>>9|sh<<23),r=(rh>>>14|sh<<18)^(rh>>>18|sh<<14)^(sh>>>9|rh<<23),_=(u=L&F)^L&W^l,w=(y=Q&T)^Q&Y^f,U=sh&X^~sh&$,O=rh&Z^~rh&hh,A=M[h+2],g=M[h+3],A=(a=((S=c[h+2])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(th>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&th)+((n=((B=c[h+3])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(ih>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&ih))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,th=(a=(q>>>16)+(A>>>16)+((o=(65535&q)+(65535&A)+((n=(G>>>16)+(g>>>16)+((e=(65535&G)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,ih=n<<16|65535&e,t=((q=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(G=n<<16|65535&e)<<4)^(G>>>2|q<<30)^(G>>>7|q<<25),i=(G>>>28|q<<4)^(q>>>2|G<<30)^(q>>>7|G<<25),s=(th>>>14|ih<<18)^(th>>>18|ih<<14)^(ih>>>9|th<<23),r=(ih>>>14|th<<18)^(ih>>>18|th<<14)^(th>>>9|ih<<23),_=(p=q&L)^q&F^u,w=(d=G&Q)^G&T^y,U=th&sh^~th&X,O=ih&rh^~ih&Z,A=M[h+4],g=M[h+5],A=(a=((S=c[h+4])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+($>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&$)+((n=((B=c[h+5])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(hh>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&hh))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,$=(a=(W>>>16)+(A>>>16)+((o=(65535&W)+(65535&A)+((n=(Y>>>16)+(g>>>16)+((e=(65535&Y)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,hh=n<<16|65535&e,t=((W=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(Y=n<<16|65535&e)<<4)^(Y>>>2|W<<30)^(Y>>>7|W<<25),i=(Y>>>28|W<<4)^(W>>>2|Y<<30)^(W>>>7|Y<<25),s=($>>>14|hh<<18)^($>>>18|hh<<14)^(hh>>>9|$<<23),r=(hh>>>14|$<<18)^(hh>>>18|$<<14)^($>>>9|hh<<23),_=(b=W&q)^W&L^p,w=(v=Y&G)^Y&Q^d,U=$&th^~$&sh,O=hh&ih^~hh&rh,A=M[h+6],g=M[h+7],A=(a=((S=c[h+6])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(X>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&X)+((n=((B=c[h+7])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(Z>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&Z))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,X=(a=(F>>>16)+(A>>>16)+((o=(65535&F)+(65535&A)+((n=(T>>>16)+(g>>>16)+((e=(65535&T)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,Z=n<<16|65535&e,F=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,T=n<<16|65535&e;a=(k>>>16)+(F>>>16)+((o=(65535&k)+(65535&F)+((n=(x>>>16)+(T>>>16)+((e=(65535&x)+(65535&T))>>>16))>>>16))>>>16),this.h0h=a<<16|65535&o,this.h0l=n<<16|65535&e,a=(z>>>16)+(W>>>16)+((o=(65535&z)+(65535&W)+((n=(j>>>16)+(Y>>>16)+((e=(65535&j)+(65535&Y))>>>16))>>>16))>>>16),this.h1h=a<<16|65535&o,this.h1l=n<<16|65535&e,a=(E>>>16)+(q>>>16)+((o=(65535&E)+(65535&q)+((n=(N>>>16)+(G>>>16)+((e=(65535&N)+(65535&G))>>>16))>>>16))>>>16),this.h2h=a<<16|65535&o,this.h2l=n<<16|65535&e,a=(m>>>16)+(L>>>16)+((o=(65535&m)+(65535&L)+((n=(J>>>16)+(Q>>>16)+((e=(65535&J)+(65535&Q))>>>16))>>>16))>>>16),this.h3h=a<<16|65535&o,this.h3l=n<<16|65535&e,a=(P>>>16)+(X>>>16)+((o=(65535&P)+(65535&X)+((n=(H>>>16)+(Z>>>16)+((e=(65535&H)+(65535&Z))>>>16))>>>16))>>>16),this.h4h=a<<16|65535&o,this.h4l=n<<16|65535&e,a=(I>>>16)+($>>>16)+((o=(65535&I)+(65535&$)+((n=(R>>>16)+(hh>>>16)+((e=(65535&R)+(65535&hh))>>>16))>>>16))>>>16),this.h5h=a<<16|65535&o,this.h5l=n<<16|65535&e,a=(V>>>16)+(th>>>16)+((o=(65535&V)+(65535&th)+((n=(C>>>16)+(ih>>>16)+((e=(65535&C)+(65535&ih))>>>16))>>>16))>>>16),this.h6h=a<<16|65535&o,this.h6l=n<<16|65535&e,a=(D>>>16)+(sh>>>16)+((o=(65535&D)+(65535&sh)+((n=(K>>>16)+(rh>>>16)+((e=(65535&K)+(65535&rh))>>>16))>>>16))>>>16),this.h7h=a<<16|65535&o,this.h7l=n<<16|65535&e},_.prototype.hex=function(){this.finalize();var h=this.h0h,t=this.h0l,i=this.h1h,s=this.h1l,r=this.h2h,e=this.h2l,n=this.h3h,o=this.h3l,l=this.h4h,f=this.h4l,c=this.h5h,u=this.h5l,y=this.h6h,p=this.h6l,d=this.h7h,b=this.h7l,v=this.bits,_=a[h>>28&15]+a[h>>24&15]+a[h>>20&15]+a[h>>16&15]+a[h>>12&15]+a[h>>8&15]+a[h>>4&15]+a[15&h]+a[t>>28&15]+a[t>>24&15]+a[t>>20&15]+a[t>>16&15]+a[t>>12&15]+a[t>>8&15]+a[t>>4&15]+a[15&t]+a[i>>28&15]+a[i>>24&15]+a[i>>20&15]+a[i>>16&15]+a[i>>12&15]+a[i>>8&15]+a[i>>4&15]+a[15&i]+a[s>>28&15]+a[s>>24&15]+a[s>>20&15]+a[s>>16&15]+a[s>>12&15]+a[s>>8&15]+a[s>>4&15]+a[15&s]+a[r>>28&15]+a[r>>24&15]+a[r>>20&15]+a[r>>16&15]+a[r>>12&15]+a[r>>8&15]+a[r>>4&15]+a[15&r]+a[e>>28&15]+a[e>>24&15]+a[e>>20&15]+a[e>>16&15]+a[e>>12&15]+a[e>>8&15]+a[e>>4&15]+a[15&e]+a[n>>28&15]+a[n>>24&15]+a[n>>20&15]+a[n>>16&15]+a[n>>12&15]+a[n>>8&15]+a[n>>4&15]+a[15&n];return v>=256&&(_+=a[o>>28&15]+a[o>>24&15]+a[o>>20&15]+a[o>>16&15]+a[o>>12&15]+a[o>>8&15]+a[o>>4&15]+a[15&o]),v>=384&&(_+=a[l>>28&15]+a[l>>24&15]+a[l>>20&15]+a[l>>16&15]+a[l>>12&15]+a[l>>8&15]+a[l>>4&15]+a[15&l]+a[f>>28&15]+a[f>>24&15]+a[f>>20&15]+a[f>>16&15]+a[f>>12&15]+a[f>>8&15]+a[f>>4&15]+a[15&f]+a[c>>28&15]+a[c>>24&15]+a[c>>20&15]+a[c>>16&15]+a[c>>12&15]+a[c>>8&15]+a[c>>4&15]+a[15&c]+a[u>>28&15]+a[u>>24&15]+a[u>>20&15]+a[u>>16&15]+a[u>>12&15]+a[u>>8&15]+a[u>>4&15]+a[15&u]),512==v&&(_+=a[y>>28&15]+a[y>>24&15]+a[y>>20&15]+a[y>>16&15]+a[y>>12&15]+a[y>>8&15]+a[y>>4&15]+a[15&y]+a[p>>28&15]+a[p>>24&15]+a[p>>20&15]+a[p>>16&15]+a[p>>12&15]+a[p>>8&15]+a[p>>4&15]+a[15&p]+a[d>>28&15]+a[d>>24&15]+a[d>>20&15]+a[d>>16&15]+a[d>>12&15]+a[d>>8&15]+a[d>>4&15]+a[15&d]+a[b>>28&15]+a[b>>24&15]+a[b>>20&15]+a[b>>16&15]+a[b>>12&15]+a[b>>8&15]+a[b>>4&15]+a[15&b]),_},_.prototype.toString=_.prototype.hex,_.prototype.digest=function(){this.finalize();var h=this.h0h,t=this.h0l,i=this.h1h,s=this.h1l,r=this.h2h,e=this.h2l,n=this.h3h,o=this.h3l,a=this.h4h,l=this.h4l,f=this.h5h,c=this.h5l,u=this.h6h,y=this.h6l,p=this.h7h,d=this.h7l,b=this.bits,v=[h>>24&255,h>>16&255,h>>8&255,255&h,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n];return b>=256&&v.push(o>>24&255,o>>16&255,o>>8&255,255&o),b>=384&&v.push(a>>24&255,a>>16&255,a>>8&255,255&a,l>>24&255,l>>16&255,l>>8&255,255&l,f>>24&255,f>>16&255,f>>8&255,255&f,c>>24&255,c>>16&255,c>>8&255,255&c),512==b&&v.push(u>>24&255,u>>16&255,u>>8&255,255&u,y>>24&255,y>>16&255,y>>8&255,255&y,p>>24&255,p>>16&255,p>>8&255,255&p,d>>24&255,d>>16&255,d>>8&255,255&d),v},_.prototype.array=_.prototype.digest,_.prototype.arrayBuffer=function(){this.finalize();var h=this.bits,t=new ArrayBuffer(h/8),i=new DataView(t);return i.setUint32(0,this.h0h),i.setUint32(4,this.h0l),i.setUint32(8,this.h1h),i.setUint32(12,this.h1l),i.setUint32(16,this.h2h),i.setUint32(20,this.h2l),i.setUint32(24,this.h3h),h>=256&&i.setUint32(28,this.h3l),h>=384&&(i.setUint32(32,this.h4h),i.setUint32(36,this.h4l),i.setUint32(40,this.h5h),i.setUint32(44,this.h5l)),512==h&&(i.setUint32(48,this.h6h),i.setUint32(52,this.h6l),i.setUint32(56,this.h7h),i.setUint32(60,this.h7l)),t},_.prototype.clone=function(){var h=new _(this.bits,!1);return this.copyTo(h),h},_.prototype.copyTo=function(h){var t=0,i=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<i.length;++t)h[i[t]]=this[i[t]];for(t=0;t<this.blocks.length;++t)h.blocks[t]=this.blocks[t]},w.prototype=new _,w.prototype.finalize=function(){if(_.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();_.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(h),_.prototype.finalize.call(this)}},w.prototype.clone=function(){var h=new w([],this.bits,!1);this.copyTo(h),h.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)h.oKeyPad[t]=this.oKeyPad[t];return h};var A=d(512);A.sha512=A,A.sha384=d(384),A.sha512_256=d(256),A.sha512_224=d(224),A.sha512.hmac=v(512),A.sha384.hmac=v(384),A.sha512_256.hmac=v(256),A.sha512_224.hmac=v(224),n?h.exports=A:(r.sha512=A.sha512,r.sha384=A.sha384,r.sha512_256=A.sha512_256,r.sha512_224=A.sha512_224)}()}(e)),e.exports);
|
|
1
|
+
System.register(["./index-legacy-C4Gclsbz.js"],(function(h,t){"use strict";var i,s;return{setters:[function(h){i=h.c,s=h.g}],execute:function(){function t(h,t){for(var i=function(){var i=t[s];if("string"!=typeof i&&!Array.isArray(i)){var r=function(t){if("default"!==t&&!(t in h)){var s=Object.getOwnPropertyDescriptor(i,t);s&&Object.defineProperty(h,t,s.get?s:{enumerable:!0,get:function(){return i[t]}})}};for(var e in i)r(e)}},s=0;s<t.length;s++)i();return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var r,e={exports:{}},n=(r||(r=1,function(h){!function(){var t="input is invalid type",s="object"==typeof window,r=s?window:{};r.JS_SHA512_NO_WINDOW&&(s=!1);var e=!s&&"object"==typeof self;!r.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=i:e&&(r=self);var n=!r.JS_SHA512_NO_COMMON_JS&&h.exports,o=!r.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],f=[24,16,8,0],c=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=["hex","array","digest","arrayBuffer"],y=[];!r.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(h){return"[object Array]"===Object.prototype.toString.call(h)}),!o||!r.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(h){return"object"==typeof h&&h.buffer&&h.buffer.constructor===ArrayBuffer});var p=function(h,t){return function(i){return new _(t,!0).update(i)[h]()}},d=function(h){var t=p("hex",h);t.create=function(){return new _(h)},t.update=function(h){return t.create().update(h)};for(var i=0;i<u.length;++i){var s=u[i];t[s]=p(s,h)}return t},b=function(h,t){return function(i,s){return new w(i,t,!0).update(s)[h]()}},v=function(h){var t=b("hex",h);t.create=function(t){return new w(t,h)},t.update=function(h,i){return t.create(h).update(i)};for(var i=0;i<u.length;++i){var s=u[i];t[s]=b(s,h)}return t};function _(h,t){t?(y[0]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=y[16]=y[17]=y[18]=y[19]=y[20]=y[21]=y[22]=y[23]=y[24]=y[25]=y[26]=y[27]=y[28]=y[29]=y[30]=y[31]=y[32]=0,this.blocks=y):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==h?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==h?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==h?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=h,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function w(h,i,s){var r,e=typeof h;if("string"!==e){if("object"!==e)throw new Error(t);if(null===h)throw new Error(t);if(o&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!(Array.isArray(h)||o&&ArrayBuffer.isView(h)))throw new Error(t);r=!0}var n=h.length;if(!r){for(var a,l=[],f=(n=h.length,0),c=0;c<n;++c)(a=h.charCodeAt(c))<128?l[f++]=a:a<2048?(l[f++]=192|a>>6,l[f++]=128|63&a):a<55296||a>=57344?(l[f++]=224|a>>12,l[f++]=128|a>>6&63,l[f++]=128|63&a):(a=65536+((1023&a)<<10|1023&h.charCodeAt(++c)),l[f++]=240|a>>18,l[f++]=128|a>>12&63,l[f++]=128|a>>6&63,l[f++]=128|63&a);h=l}h.length>128&&(h=new _(i,!0).update(h).array());var u=[],y=[];for(c=0;c<128;++c){var p=h[c]||0;u[c]=92^p,y[c]=54^p}_.call(this,i,s),this.update(y),this.oKeyPad=u,this.inner=!0,this.sharedMemory=s}_.prototype.update=function(h){if(this.finalized)throw new Error("finalize already called");var i,s=typeof h;if("string"!==s){if("object"!==s)throw new Error(t);if(null===h)throw new Error(t);if(o&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!(Array.isArray(h)||o&&ArrayBuffer.isView(h)))throw new Error(t);i=!0}for(var r,e,n=0,a=h.length,l=this.blocks;n<a;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=l[16]=l[17]=l[18]=l[19]=l[20]=l[21]=l[22]=l[23]=l[24]=l[25]=l[26]=l[27]=l[28]=l[29]=l[30]=l[31]=l[32]=0),i)for(e=this.start;n<a&&e<128;++n)l[e>>2]|=h[n]<<f[3&e++];else for(e=this.start;n<a&&e<128;++n)(r=h.charCodeAt(n))<128?l[e>>2]|=r<<f[3&e++]:r<2048?(l[e>>2]|=(192|r>>6)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]):r<55296||r>=57344?(l[e>>2]|=(224|r>>12)<<f[3&e++],l[e>>2]|=(128|r>>6&63)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]):(r=65536+((1023&r)<<10|1023&h.charCodeAt(++n)),l[e>>2]|=(240|r>>18)<<f[3&e++],l[e>>2]|=(128|r>>12&63)<<f[3&e++],l[e>>2]|=(128|r>>6&63)<<f[3&e++],l[e>>2]|=(128|63&r)<<f[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,e>=128?(this.block=l[32],this.start=e-128,this.hash(),this.hashed=!0):this.start=e}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,t=this.lastByteIndex;h[32]=this.block,h[t>>2]|=l[3&t],this.block=h[32],t>=112&&(this.hashed||this.hash(),h[0]=this.block,h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=h[16]=h[17]=h[18]=h[19]=h[20]=h[21]=h[22]=h[23]=h[24]=h[25]=h[26]=h[27]=h[28]=h[29]=h[30]=h[31]=h[32]=0),h[30]=this.hBytes<<3|this.bytes>>>29,h[31]=this.bytes<<3,this.hash()}},_.prototype.hash=function(){var h,t,i,s,r,e,n,o,a,l,f,u,y,p,d,b,v,_,w,A,g,S,B,U,O,k=this.h0h,x=this.h0l,z=this.h1h,j=this.h1l,E=this.h2h,N=this.h2l,m=this.h3h,J=this.h3l,P=this.h4h,H=this.h4l,I=this.h5h,R=this.h5l,V=this.h6h,C=this.h6l,D=this.h7h,K=this.h7l,M=this.blocks;for(h=32;h<160;h+=2)t=((A=M[h-30])>>>1|(g=M[h-29])<<31)^(A>>>8|g<<24)^A>>>7,i=(g>>>1|A<<31)^(g>>>8|A<<24)^(g>>>7|A<<25),s=((A=M[h-4])>>>19|(g=M[h-3])<<13)^(g>>>29|A<<3)^A>>>6,r=(g>>>19|A<<13)^(A>>>29|g<<3)^(g>>>6|A<<26),A=M[h-32],g=M[h-31],a=((S=M[h-14])>>>16)+(A>>>16)+(t>>>16)+(s>>>16)+((o=(65535&S)+(65535&A)+(65535&t)+(65535&s)+((n=((B=M[h-13])>>>16)+(g>>>16)+(i>>>16)+(r>>>16)+((e=(65535&B)+(65535&g)+(65535&i)+(65535&r))>>>16))>>>16))>>>16),M[h]=a<<16|65535&o,M[h+1]=n<<16|65535&e;var F=k,T=x,W=z,Y=j,q=E,G=N,L=m,Q=J,X=P,Z=H,$=I,hh=R,th=V,ih=C,sh=D,rh=K;for(b=W&q,v=Y&G,h=0;h<160;h+=8)t=(F>>>28|T<<4)^(T>>>2|F<<30)^(T>>>7|F<<25),i=(T>>>28|F<<4)^(F>>>2|T<<30)^(F>>>7|T<<25),s=(X>>>14|Z<<18)^(X>>>18|Z<<14)^(Z>>>9|X<<23),r=(Z>>>14|X<<18)^(Z>>>18|X<<14)^(X>>>9|Z<<23),_=(l=F&W)^F&q^b,w=(f=T&Y)^T&G^v,U=X&$^~X&th,O=Z&hh^~Z&ih,A=M[h],g=M[h+1],A=(a=((S=c[h])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(sh>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&sh)+((n=((B=c[h+1])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(rh>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&rh))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,sh=(a=(L>>>16)+(A>>>16)+((o=(65535&L)+(65535&A)+((n=(Q>>>16)+(g>>>16)+((e=(65535&Q)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,rh=n<<16|65535&e,t=((L=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(Q=n<<16|65535&e)<<4)^(Q>>>2|L<<30)^(Q>>>7|L<<25),i=(Q>>>28|L<<4)^(L>>>2|Q<<30)^(L>>>7|Q<<25),s=(sh>>>14|rh<<18)^(sh>>>18|rh<<14)^(rh>>>9|sh<<23),r=(rh>>>14|sh<<18)^(rh>>>18|sh<<14)^(sh>>>9|rh<<23),_=(u=L&F)^L&W^l,w=(y=Q&T)^Q&Y^f,U=sh&X^~sh&$,O=rh&Z^~rh&hh,A=M[h+2],g=M[h+3],A=(a=((S=c[h+2])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(th>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&th)+((n=((B=c[h+3])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(ih>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&ih))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,th=(a=(q>>>16)+(A>>>16)+((o=(65535&q)+(65535&A)+((n=(G>>>16)+(g>>>16)+((e=(65535&G)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,ih=n<<16|65535&e,t=((q=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(G=n<<16|65535&e)<<4)^(G>>>2|q<<30)^(G>>>7|q<<25),i=(G>>>28|q<<4)^(q>>>2|G<<30)^(q>>>7|G<<25),s=(th>>>14|ih<<18)^(th>>>18|ih<<14)^(ih>>>9|th<<23),r=(ih>>>14|th<<18)^(ih>>>18|th<<14)^(th>>>9|ih<<23),_=(p=q&L)^q&F^u,w=(d=G&Q)^G&T^y,U=th&sh^~th&X,O=ih&rh^~ih&Z,A=M[h+4],g=M[h+5],A=(a=((S=c[h+4])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+($>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&$)+((n=((B=c[h+5])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(hh>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&hh))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,$=(a=(W>>>16)+(A>>>16)+((o=(65535&W)+(65535&A)+((n=(Y>>>16)+(g>>>16)+((e=(65535&Y)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,hh=n<<16|65535&e,t=((W=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o)>>>28|(Y=n<<16|65535&e)<<4)^(Y>>>2|W<<30)^(Y>>>7|W<<25),i=(Y>>>28|W<<4)^(W>>>2|Y<<30)^(W>>>7|Y<<25),s=($>>>14|hh<<18)^($>>>18|hh<<14)^(hh>>>9|$<<23),r=(hh>>>14|$<<18)^(hh>>>18|$<<14)^($>>>9|hh<<23),_=(b=W&q)^W&L^p,w=(v=Y&G)^Y&Q^d,U=$&th^~$&sh,O=hh&ih^~hh&rh,A=M[h+6],g=M[h+7],A=(a=((S=c[h+6])>>>16)+(A>>>16)+(U>>>16)+(s>>>16)+(X>>>16)+((o=(65535&S)+(65535&A)+(65535&U)+(65535&s)+(65535&X)+((n=((B=c[h+7])>>>16)+(g>>>16)+(O>>>16)+(r>>>16)+(Z>>>16)+((e=(65535&B)+(65535&g)+(65535&O)+(65535&r)+(65535&Z))>>>16))>>>16))>>>16))<<16|65535&o,g=n<<16|65535&e,S=(a=(_>>>16)+(t>>>16)+((o=(65535&_)+(65535&t)+((n=(w>>>16)+(i>>>16)+((e=(65535&w)+(65535&i))>>>16))>>>16))>>>16))<<16|65535&o,B=n<<16|65535&e,X=(a=(F>>>16)+(A>>>16)+((o=(65535&F)+(65535&A)+((n=(T>>>16)+(g>>>16)+((e=(65535&T)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,Z=n<<16|65535&e,F=(a=(S>>>16)+(A>>>16)+((o=(65535&S)+(65535&A)+((n=(B>>>16)+(g>>>16)+((e=(65535&B)+(65535&g))>>>16))>>>16))>>>16))<<16|65535&o,T=n<<16|65535&e;a=(k>>>16)+(F>>>16)+((o=(65535&k)+(65535&F)+((n=(x>>>16)+(T>>>16)+((e=(65535&x)+(65535&T))>>>16))>>>16))>>>16),this.h0h=a<<16|65535&o,this.h0l=n<<16|65535&e,a=(z>>>16)+(W>>>16)+((o=(65535&z)+(65535&W)+((n=(j>>>16)+(Y>>>16)+((e=(65535&j)+(65535&Y))>>>16))>>>16))>>>16),this.h1h=a<<16|65535&o,this.h1l=n<<16|65535&e,a=(E>>>16)+(q>>>16)+((o=(65535&E)+(65535&q)+((n=(N>>>16)+(G>>>16)+((e=(65535&N)+(65535&G))>>>16))>>>16))>>>16),this.h2h=a<<16|65535&o,this.h2l=n<<16|65535&e,a=(m>>>16)+(L>>>16)+((o=(65535&m)+(65535&L)+((n=(J>>>16)+(Q>>>16)+((e=(65535&J)+(65535&Q))>>>16))>>>16))>>>16),this.h3h=a<<16|65535&o,this.h3l=n<<16|65535&e,a=(P>>>16)+(X>>>16)+((o=(65535&P)+(65535&X)+((n=(H>>>16)+(Z>>>16)+((e=(65535&H)+(65535&Z))>>>16))>>>16))>>>16),this.h4h=a<<16|65535&o,this.h4l=n<<16|65535&e,a=(I>>>16)+($>>>16)+((o=(65535&I)+(65535&$)+((n=(R>>>16)+(hh>>>16)+((e=(65535&R)+(65535&hh))>>>16))>>>16))>>>16),this.h5h=a<<16|65535&o,this.h5l=n<<16|65535&e,a=(V>>>16)+(th>>>16)+((o=(65535&V)+(65535&th)+((n=(C>>>16)+(ih>>>16)+((e=(65535&C)+(65535&ih))>>>16))>>>16))>>>16),this.h6h=a<<16|65535&o,this.h6l=n<<16|65535&e,a=(D>>>16)+(sh>>>16)+((o=(65535&D)+(65535&sh)+((n=(K>>>16)+(rh>>>16)+((e=(65535&K)+(65535&rh))>>>16))>>>16))>>>16),this.h7h=a<<16|65535&o,this.h7l=n<<16|65535&e},_.prototype.hex=function(){this.finalize();var h=this.h0h,t=this.h0l,i=this.h1h,s=this.h1l,r=this.h2h,e=this.h2l,n=this.h3h,o=this.h3l,l=this.h4h,f=this.h4l,c=this.h5h,u=this.h5l,y=this.h6h,p=this.h6l,d=this.h7h,b=this.h7l,v=this.bits,_=a[h>>28&15]+a[h>>24&15]+a[h>>20&15]+a[h>>16&15]+a[h>>12&15]+a[h>>8&15]+a[h>>4&15]+a[15&h]+a[t>>28&15]+a[t>>24&15]+a[t>>20&15]+a[t>>16&15]+a[t>>12&15]+a[t>>8&15]+a[t>>4&15]+a[15&t]+a[i>>28&15]+a[i>>24&15]+a[i>>20&15]+a[i>>16&15]+a[i>>12&15]+a[i>>8&15]+a[i>>4&15]+a[15&i]+a[s>>28&15]+a[s>>24&15]+a[s>>20&15]+a[s>>16&15]+a[s>>12&15]+a[s>>8&15]+a[s>>4&15]+a[15&s]+a[r>>28&15]+a[r>>24&15]+a[r>>20&15]+a[r>>16&15]+a[r>>12&15]+a[r>>8&15]+a[r>>4&15]+a[15&r]+a[e>>28&15]+a[e>>24&15]+a[e>>20&15]+a[e>>16&15]+a[e>>12&15]+a[e>>8&15]+a[e>>4&15]+a[15&e]+a[n>>28&15]+a[n>>24&15]+a[n>>20&15]+a[n>>16&15]+a[n>>12&15]+a[n>>8&15]+a[n>>4&15]+a[15&n];return v>=256&&(_+=a[o>>28&15]+a[o>>24&15]+a[o>>20&15]+a[o>>16&15]+a[o>>12&15]+a[o>>8&15]+a[o>>4&15]+a[15&o]),v>=384&&(_+=a[l>>28&15]+a[l>>24&15]+a[l>>20&15]+a[l>>16&15]+a[l>>12&15]+a[l>>8&15]+a[l>>4&15]+a[15&l]+a[f>>28&15]+a[f>>24&15]+a[f>>20&15]+a[f>>16&15]+a[f>>12&15]+a[f>>8&15]+a[f>>4&15]+a[15&f]+a[c>>28&15]+a[c>>24&15]+a[c>>20&15]+a[c>>16&15]+a[c>>12&15]+a[c>>8&15]+a[c>>4&15]+a[15&c]+a[u>>28&15]+a[u>>24&15]+a[u>>20&15]+a[u>>16&15]+a[u>>12&15]+a[u>>8&15]+a[u>>4&15]+a[15&u]),512==v&&(_+=a[y>>28&15]+a[y>>24&15]+a[y>>20&15]+a[y>>16&15]+a[y>>12&15]+a[y>>8&15]+a[y>>4&15]+a[15&y]+a[p>>28&15]+a[p>>24&15]+a[p>>20&15]+a[p>>16&15]+a[p>>12&15]+a[p>>8&15]+a[p>>4&15]+a[15&p]+a[d>>28&15]+a[d>>24&15]+a[d>>20&15]+a[d>>16&15]+a[d>>12&15]+a[d>>8&15]+a[d>>4&15]+a[15&d]+a[b>>28&15]+a[b>>24&15]+a[b>>20&15]+a[b>>16&15]+a[b>>12&15]+a[b>>8&15]+a[b>>4&15]+a[15&b]),_},_.prototype.toString=_.prototype.hex,_.prototype.digest=function(){this.finalize();var h=this.h0h,t=this.h0l,i=this.h1h,s=this.h1l,r=this.h2h,e=this.h2l,n=this.h3h,o=this.h3l,a=this.h4h,l=this.h4l,f=this.h5h,c=this.h5l,u=this.h6h,y=this.h6l,p=this.h7h,d=this.h7l,b=this.bits,v=[h>>24&255,h>>16&255,h>>8&255,255&h,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n];return b>=256&&v.push(o>>24&255,o>>16&255,o>>8&255,255&o),b>=384&&v.push(a>>24&255,a>>16&255,a>>8&255,255&a,l>>24&255,l>>16&255,l>>8&255,255&l,f>>24&255,f>>16&255,f>>8&255,255&f,c>>24&255,c>>16&255,c>>8&255,255&c),512==b&&v.push(u>>24&255,u>>16&255,u>>8&255,255&u,y>>24&255,y>>16&255,y>>8&255,255&y,p>>24&255,p>>16&255,p>>8&255,255&p,d>>24&255,d>>16&255,d>>8&255,255&d),v},_.prototype.array=_.prototype.digest,_.prototype.arrayBuffer=function(){this.finalize();var h=this.bits,t=new ArrayBuffer(h/8),i=new DataView(t);return i.setUint32(0,this.h0h),i.setUint32(4,this.h0l),i.setUint32(8,this.h1h),i.setUint32(12,this.h1l),i.setUint32(16,this.h2h),i.setUint32(20,this.h2l),i.setUint32(24,this.h3h),h>=256&&i.setUint32(28,this.h3l),h>=384&&(i.setUint32(32,this.h4h),i.setUint32(36,this.h4l),i.setUint32(40,this.h5h),i.setUint32(44,this.h5l)),512==h&&(i.setUint32(48,this.h6h),i.setUint32(52,this.h6l),i.setUint32(56,this.h7h),i.setUint32(60,this.h7l)),t},_.prototype.clone=function(){var h=new _(this.bits,!1);return this.copyTo(h),h},_.prototype.copyTo=function(h){var t=0,i=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<i.length;++t)h[i[t]]=this[i[t]];for(t=0;t<this.blocks.length;++t)h.blocks[t]=this.blocks[t]},w.prototype=new _,w.prototype.finalize=function(){if(_.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();_.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(h),_.prototype.finalize.call(this)}},w.prototype.clone=function(){var h=new w([],this.bits,!1);this.copyTo(h),h.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)h.oKeyPad[t]=this.oKeyPad[t];return h};var A=d(512);A.sha512=A,A.sha384=d(384),A.sha512_256=d(256),A.sha512_224=d(224),A.sha512.hmac=v(512),A.sha384.hmac=v(384),A.sha512_256.hmac=v(256),A.sha512_224.hmac=v(224),n?h.exports=A:(r.sha512=A.sha512,r.sha384=A.sha384,r.sha512_256=A.sha512_256,r.sha512_224=A.sha512_224)}()}(e)),e.exports);
|
|
2
2
|
/*
|
|
3
3
|
* [js-sha512]{@link https://github.com/emn178/js-sha512}
|
|
4
4
|
*
|
package/frontend/index.html
CHANGED
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
document.getElementById('root').innerHTML = 'Loading...'
|
|
26
26
|
</script>
|
|
27
27
|
<script crossorigin id="vite-legacy-polyfill" src="/assets/polyfills-legacy-Ca1TOBqp.js"></script>
|
|
28
|
-
<script crossorigin id="vite-legacy-entry" data-src="/assets/index-legacy-
|
|
28
|
+
<script crossorigin id="vite-legacy-entry" data-src="/assets/index-legacy-C4Gclsbz.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
|
|
29
29
|
</body>
|
|
30
30
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hfs",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.27-beta2",
|
|
4
4
|
"description": "HTTP File Server",
|
|
5
5
|
"keywords": ["file server", "http server"],
|
|
6
6
|
"homepage": "https://rejetto.com/hfs",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"start-frontend": "npm run start --workspace=frontend",
|
|
14
14
|
"start-admin": "npm run start --workspace=admin",
|
|
15
15
|
"build-all": "npm audit --omit=dev --audit-level=moderate && rm -rf dist && npm i && npm run build-server && npm run test-with-server && (npm run build-frontend & npm run build-admin) && echo COMPLETED",
|
|
16
|
-
"build-server": "rm -rf dist/src dist/plugins && tsc
|
|
16
|
+
"build-server": "rm -rf dist/src dist/plugins && tsc && touch package.json && cp -v -r package.json central.json README* LICENSE* hfs.ico plugins dist && find dist -name .DS_Store -o -name storage -exec rm -rf {} + && node afterbuild.js",
|
|
17
17
|
"build-frontend": "npm run build --workspace=frontend",
|
|
18
18
|
"build-admin": "npm run build --workspace=admin",
|
|
19
19
|
"server-for-test": "node dist/src --cwd tests/work --config tests --debug",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"pkg": {
|
|
58
58
|
"assets": [
|
|
59
59
|
"central.json",
|
|
60
|
+
"src/statWorker.js",
|
|
60
61
|
"admin/**/*",
|
|
61
62
|
"frontend/**/*",
|
|
62
63
|
"**/node_modules/fswin/x64/*",
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
"@types/node": "^20.17.30",
|
|
115
116
|
"@types/node-forge": "^1.3.14",
|
|
116
117
|
"@types/picomatch": "^4.0.2",
|
|
117
|
-
"@yao-pkg/pkg": "^6.
|
|
118
|
+
"@yao-pkg/pkg": "^6.10.1",
|
|
118
119
|
"cross-env": "^10.0.0",
|
|
119
120
|
"koa-better-http-proxy": "^0.2.10",
|
|
120
121
|
"nm-prune": "^5.0.0",
|
package/src/QuickZipStream.js
CHANGED
|
@@ -13,15 +13,18 @@ const ZIP64_NUMBER_LIMIT = 0xffff;
|
|
|
13
13
|
const FLAGS = 0x0808; // bit3 = no crc in local header + bit11 = utf8
|
|
14
14
|
// the point of this class is the method applyRange, which allows seeking forward in the zip file quickly (useful to resume downloads)
|
|
15
15
|
class QuickZipStream extends stream_1.Readable {
|
|
16
|
+
walker;
|
|
17
|
+
workingFile;
|
|
18
|
+
finished = false;
|
|
19
|
+
entries = [];
|
|
20
|
+
dataWritten = 0;
|
|
21
|
+
consumedCalculating = [];
|
|
22
|
+
skip = 0;
|
|
23
|
+
limit;
|
|
24
|
+
now = new Date();
|
|
16
25
|
constructor(walker) {
|
|
17
26
|
super({});
|
|
18
27
|
this.walker = walker;
|
|
19
|
-
this.finished = false;
|
|
20
|
-
this.entries = [];
|
|
21
|
-
this.dataWritten = 0;
|
|
22
|
-
this.consumedCalculating = [];
|
|
23
|
-
this.skip = 0;
|
|
24
|
-
this.now = new Date();
|
|
25
28
|
}
|
|
26
29
|
getArchiveEntries() {
|
|
27
30
|
return this.entries.map(x => String(x.pathAsBuffer));
|
|
@@ -120,7 +123,7 @@ class QuickZipStream extends stream_1.Readable {
|
|
|
120
123
|
if (this.finished)
|
|
121
124
|
return;
|
|
122
125
|
const cache = sourcePath ? crcCache[sourcePath] : undefined;
|
|
123
|
-
const cacheHit = Number(cache
|
|
126
|
+
const cacheHit = Number(cache?.ts) === Number(ts);
|
|
124
127
|
let crc = cacheHit ? cache.crc : getData ? (0, crc_32_1.buf)([]) : 0;
|
|
125
128
|
const extAttr = !mode ? 0 : (mode | 0x8000) * 0x10000; // it's like <<16 but doesn't overflow so easily
|
|
126
129
|
const entry = { size, crc, pathAsBuffer, ts, offset, version, extAttr };
|
|
@@ -137,7 +140,7 @@ class QuickZipStream extends stream_1.Readable {
|
|
|
137
140
|
await new Promise(resolve => {
|
|
138
141
|
const data = this.workingFile = getData();
|
|
139
142
|
data.on('error', (err) => {
|
|
140
|
-
if (
|
|
143
|
+
if (err?.code !== 'EACCES')
|
|
141
144
|
console.error('zipping:', String(err));
|
|
142
145
|
data.destroy(err);
|
|
143
146
|
resolve();
|
package/src/SendList.js
CHANGED
|
@@ -10,9 +10,12 @@ const cross_1 = require("./cross");
|
|
|
10
10
|
const events_1 = __importDefault(require("./events"));
|
|
11
11
|
// offer an api for a generic dynamic list. Suitable to be the result of an api.
|
|
12
12
|
class SendListReadable extends stream_1.Readable {
|
|
13
|
+
lastError;
|
|
14
|
+
buffer = [];
|
|
15
|
+
processBuffer;
|
|
16
|
+
sent;
|
|
13
17
|
constructor({ addAtStart, doAtStart, bufferTime, onEnd, diff } = {}) {
|
|
14
18
|
super({ objectMode: true, read() { } });
|
|
15
|
-
this.buffer = [];
|
|
16
19
|
if (!bufferTime)
|
|
17
20
|
bufferTime = 200;
|
|
18
21
|
if (diff)
|
|
@@ -21,7 +24,6 @@ class SendListReadable extends stream_1.Readable {
|
|
|
21
24
|
const { sent } = this;
|
|
22
25
|
if (sent)
|
|
23
26
|
this.buffer = this.buffer.filter(([cmd, a, b]) => {
|
|
24
|
-
var _a;
|
|
25
27
|
if (cmd === cross_1.LIST.add)
|
|
26
28
|
return sent.push(...(0, cross_1.wantArray)(a));
|
|
27
29
|
if (cmd === cross_1.LIST.remove)
|
|
@@ -36,7 +38,7 @@ class SendListReadable extends stream_1.Readable {
|
|
|
36
38
|
delete b[k];
|
|
37
39
|
else {
|
|
38
40
|
found[k] = b[k];
|
|
39
|
-
|
|
41
|
+
b[k] ??= null; // go and delete it, remotely
|
|
40
42
|
}
|
|
41
43
|
return !lodash_1.default.isEmpty(b);
|
|
42
44
|
});
|
|
@@ -46,10 +48,10 @@ class SendListReadable extends stream_1.Readable {
|
|
|
46
48
|
this.buffer = [];
|
|
47
49
|
}, bufferTime, { maxWait: bufferTime });
|
|
48
50
|
this.on('close', () => {
|
|
49
|
-
onEnd
|
|
51
|
+
onEnd?.(this);
|
|
50
52
|
this.destroy();
|
|
51
53
|
});
|
|
52
|
-
setTimeout(() => doAtStart
|
|
54
|
+
setTimeout(() => doAtStart?.(this)); // work later, when list object has been received by Koa
|
|
53
55
|
if (addAtStart) {
|
|
54
56
|
for (const x of addAtStart)
|
|
55
57
|
this.add(x);
|
|
@@ -58,7 +60,7 @@ class SendListReadable extends stream_1.Readable {
|
|
|
58
60
|
}
|
|
59
61
|
_push(rec) {
|
|
60
62
|
this.buffer.push(rec);
|
|
61
|
-
if (this.buffer.length >
|
|
63
|
+
if (this.buffer.length > 10_000) // hard limit
|
|
62
64
|
this.processBuffer.flush();
|
|
63
65
|
else
|
|
64
66
|
this.processBuffer();
|
|
@@ -70,7 +72,7 @@ class SendListReadable extends stream_1.Readable {
|
|
|
70
72
|
const match = lodash_1.default.matches(search);
|
|
71
73
|
const idx = lodash_1.default.findIndex(this.buffer, x => match(x[1]));
|
|
72
74
|
const found = this.buffer[idx];
|
|
73
|
-
const op = found
|
|
75
|
+
const op = found?.[0];
|
|
74
76
|
if (op === cross_1.LIST.remove)
|
|
75
77
|
return;
|
|
76
78
|
if (found) {
|
|
@@ -85,7 +87,7 @@ class SendListReadable extends stream_1.Readable {
|
|
|
85
87
|
return;
|
|
86
88
|
const match = lodash_1.default.matches(search);
|
|
87
89
|
const found = lodash_1.default.find(this.buffer, x => match(x[1]));
|
|
88
|
-
const op = found
|
|
90
|
+
const op = found?.[0];
|
|
89
91
|
if (op === cross_1.LIST.remove)
|
|
90
92
|
return;
|
|
91
93
|
if (op === cross_1.LIST.add || op === cross_1.LIST.update)
|
package/src/ThrottledStream.js
CHANGED
|
@@ -6,13 +6,14 @@ const stream_1 = require("stream");
|
|
|
6
6
|
const limiter_1 = require("limiter");
|
|
7
7
|
// throttled stream
|
|
8
8
|
class ThrottledStream extends stream_1.Transform {
|
|
9
|
+
group;
|
|
10
|
+
sent = 0;
|
|
11
|
+
lastSpeed = 0;
|
|
12
|
+
lastSpeedTime = Date.now();
|
|
13
|
+
totalSent = 0; // total sent over connection, since connection can be re-used for multiple requests
|
|
9
14
|
constructor(group, copyStats) {
|
|
10
15
|
super();
|
|
11
16
|
this.group = group;
|
|
12
|
-
this.sent = 0;
|
|
13
|
-
this.lastSpeed = 0;
|
|
14
|
-
this.lastSpeedTime = Date.now();
|
|
15
|
-
this.totalSent = 0; // total sent over connection, since connection can be re-used for multiple requests
|
|
16
17
|
if (!copyStats)
|
|
17
18
|
return;
|
|
18
19
|
this.sent = copyStats.sent;
|
|
@@ -59,6 +60,8 @@ class ThrottledStream extends stream_1.Transform {
|
|
|
59
60
|
}
|
|
60
61
|
exports.ThrottledStream = ThrottledStream;
|
|
61
62
|
class ThrottleGroup {
|
|
63
|
+
parent;
|
|
64
|
+
bucket;
|
|
62
65
|
constructor(kBs, parent) {
|
|
63
66
|
this.parent = parent;
|
|
64
67
|
this.bucket = this.updateLimit(kBs); // assignment is redundant and yet the best way I've found to shut up typescript
|
|
@@ -78,9 +81,8 @@ class ThrottleGroup {
|
|
|
78
81
|
});
|
|
79
82
|
}
|
|
80
83
|
suggestChunkSize() {
|
|
81
|
-
var _a;
|
|
82
84
|
let b = this.bucket;
|
|
83
|
-
b.parentBucket =
|
|
85
|
+
b.parentBucket = this.parent?.bucket;
|
|
84
86
|
let min = b.bucketSize;
|
|
85
87
|
while (b = b.parentBucket)
|
|
86
88
|
min = Math.min(min, b.bucketSize);
|
package/src/acme.js
CHANGED
|
@@ -18,9 +18,8 @@ const selfCheck_1 = require("./selfCheck");
|
|
|
18
18
|
let acmeOngoing = false;
|
|
19
19
|
const acmeTokens = {};
|
|
20
20
|
const acmeListener = (req, res) => {
|
|
21
|
-
var _a;
|
|
22
21
|
const BASE = '/.well-known/acme-challenge/';
|
|
23
|
-
if (!
|
|
22
|
+
if (!req.url?.startsWith(BASE))
|
|
24
23
|
return;
|
|
25
24
|
const token = req.url.slice(BASE.length);
|
|
26
25
|
console.debug("got http challenge", token);
|
|
@@ -62,13 +61,13 @@ async function generateSSLCert(domain, email, altNames) {
|
|
|
62
61
|
try {
|
|
63
62
|
const checkUrl = `http://${domain.split(',')[0]}`;
|
|
64
63
|
let check = await (0, selfCheck_1.selfCheck)(checkUrl); // some check services may not consider the domain, but we already verified that
|
|
65
|
-
if (
|
|
64
|
+
if (check?.success === false && nat.upnp && !nat.mapped80) {
|
|
66
65
|
console.debug("setting temporary port forward");
|
|
67
|
-
tempMap = await (0, misc_1.haveTimeout)(
|
|
66
|
+
tempMap = await (0, misc_1.haveTimeout)(10_000, nat_1.upnpClient.createMapping(TEMP_MAP).catch(() => { })).catch(() => { });
|
|
68
67
|
check = await (0, selfCheck_1.selfCheck)(checkUrl); // repeat test
|
|
69
68
|
}
|
|
70
69
|
//if (!check) throw new ApiError(HTTP_FAILED_DEPENDENCY, "couldn't test port 80")
|
|
71
|
-
if (
|
|
70
|
+
if (check?.success === false)
|
|
72
71
|
throw new apiMiddleware_1.ApiError(misc_1.HTTP_FAILED_DEPENDENCY, "port 80 is not working on the specified domain");
|
|
73
72
|
const acmeClient = new acme_client_1.default.Client({
|
|
74
73
|
accountKey: await acme_client_1.default.crypto.createPrivateKey(),
|
|
@@ -103,8 +102,7 @@ exports.makeCert = (0, debounceAsync_1.debounceAsync)(async (domain, email, altN
|
|
|
103
102
|
if (!domain)
|
|
104
103
|
return new apiMiddleware_1.ApiError(misc_1.HTTP_BAD_REQUEST, 'bad params');
|
|
105
104
|
const res = await generateSSLCert(domain, email, altNames).catch(e => {
|
|
106
|
-
|
|
107
|
-
throw !((_a = e.message) === null || _a === void 0 ? void 0 : _a.includes('not match this challenge')) ? e // another acme server?
|
|
105
|
+
throw !e.message?.includes('not match this challenge') ? e // another acme server?
|
|
108
106
|
: Error("a different server is responding on port 80 of your domain(s)");
|
|
109
107
|
});
|
|
110
108
|
const CERT_FILE = 'acme.cer';
|
package/src/adminApis.js
CHANGED
|
@@ -49,17 +49,17 @@ exports.adminApis = {
|
|
|
49
49
|
...api_cert_1.default,
|
|
50
50
|
get_dynamic_dns_error: ddns_1.get_dynamic_dns_error,
|
|
51
51
|
async set_config({ values }) {
|
|
52
|
-
var _a;
|
|
53
52
|
(0, misc_1.apiAssertTypes)({ object: { values } });
|
|
54
53
|
await (0, config_1.setConfig)(values);
|
|
55
54
|
if (values.port === 0 || values.https_port === 0)
|
|
56
|
-
return
|
|
55
|
+
return await (0, misc_1.waitFor)(async () => {
|
|
57
56
|
const st = await (0, listen_1.getServerStatus)();
|
|
58
57
|
// wait for all random ports to be done, so we communicate new numbers
|
|
59
58
|
if ((values.port !== 0 || st.http.listening)
|
|
60
59
|
&& (values.https_port !== 0 || st.https.listening))
|
|
61
60
|
return st;
|
|
62
|
-
}, { timeout: 1000 })
|
|
61
|
+
}, { timeout: 1000 })
|
|
62
|
+
?? new apiMiddleware_1.ApiError(const_1.HTTP_SERVER_ERROR, "something went wrong changing ports");
|
|
63
63
|
return {};
|
|
64
64
|
},
|
|
65
65
|
get_config: config_1.getWholeConfig,
|
|
@@ -73,8 +73,7 @@ exports.adminApis = {
|
|
|
73
73
|
},
|
|
74
74
|
set_config_text: ({ text }) => config_1.configFile.save(text, { reparse: true }),
|
|
75
75
|
update: ({ tag }) => (0, update_1.update)(tag).catch(e => {
|
|
76
|
-
|
|
77
|
-
throw ((_a = e.cause) === null || _a === void 0 ? void 0 : _a.statusCode) ? new apiMiddleware_1.ApiError((_b = e.cause) === null || _b === void 0 ? void 0 : _b.statusCode) : e;
|
|
76
|
+
throw e.cause?.statusCode ? new apiMiddleware_1.ApiError(e.cause?.statusCode) : e;
|
|
78
77
|
}),
|
|
79
78
|
async check_update() {
|
|
80
79
|
return { options: await (0, update_1.getUpdates)() };
|
|
@@ -191,10 +190,10 @@ const frpDebounced = (0, misc_1.debounceAsync)(async () => {
|
|
|
191
190
|
const { stdout } = await (0, util_1.promisify)(child_process_1.execFile)('tasklist', ['/fi', 'imagename eq frpc.exe', '/nh']);
|
|
192
191
|
return stdout.includes('frpc');
|
|
193
192
|
}
|
|
194
|
-
catch
|
|
193
|
+
catch {
|
|
195
194
|
return false;
|
|
196
195
|
}
|
|
197
|
-
}, { retain:
|
|
196
|
+
}, { retain: 10_000 });
|
|
198
197
|
function anyAccountCanLoginAdmin() {
|
|
199
198
|
return Boolean(lodash_1.default.find(perm_1.accounts.get(), perm_1.accountCanLoginAdmin));
|
|
200
199
|
}
|
package/src/api.accounts.js
CHANGED
|
@@ -12,22 +12,21 @@ const auth_1 = require("./auth");
|
|
|
12
12
|
const misc_1 = require("./misc");
|
|
13
13
|
const api_vfs_1 = require("./api.vfs");
|
|
14
14
|
function prepareAccount(ac) {
|
|
15
|
-
var _a;
|
|
16
15
|
return ac && {
|
|
17
16
|
...lodash_1.default.omit(ac, ['password', 'hashed_password', 'srp']),
|
|
18
17
|
username: ac.username, // omit won't copy it because it's a hidden prop
|
|
19
18
|
hasPassword: (0, perm_1.accountHasPassword)(ac),
|
|
20
|
-
isGroup: !
|
|
19
|
+
isGroup: !ac.plugin?.auth && !(0, perm_1.accountHasPassword)(ac),
|
|
21
20
|
adminActualAccess: (0, perm_1.accountCanLoginAdmin)(ac),
|
|
22
21
|
canLogin: (0, perm_1.accountHasPassword)(ac) ? (0, perm_1.accountCanLogin)(ac) : undefined,
|
|
23
22
|
canChangePassword: (0, perm_1.accountCanChangePassword)(ac),
|
|
24
23
|
invalidated: auth_1.invalidateSessionBefore.get(ac.username),
|
|
25
|
-
directMembers: Object.values(perm_1.accounts.get()).filter(a =>
|
|
24
|
+
directMembers: Object.values(perm_1.accounts.get()).filter(a => a.belongs?.includes(ac.username)).map(x => x.username),
|
|
26
25
|
members: (0, misc_1.with_)(Object.values(perm_1.accounts.get()), accounts => {
|
|
27
26
|
const ret = [];
|
|
28
27
|
let news = [ac.username];
|
|
29
28
|
while (news.length) {
|
|
30
|
-
news = accounts.filter(a =>
|
|
29
|
+
news = accounts.filter(a => !ret.includes(a.username) && a.belongs?.some(x => news.includes(x))).map(x => x.username);
|
|
31
30
|
ret.push(...news);
|
|
32
31
|
}
|
|
33
32
|
return lodash_1.default.uniq(ret).sort();
|
|
@@ -51,13 +50,12 @@ exports.default = {
|
|
|
51
50
|
return { list: lodash_1.default.filter(perm_1.accounts.get(), perm_1.accountCanLoginAdmin).map(ac => ac.username) };
|
|
52
51
|
},
|
|
53
52
|
async set_account({ username, changes }, ctx) {
|
|
54
|
-
var _a;
|
|
55
53
|
(0, misc_1.apiAssertTypes)({ string: { username } });
|
|
56
54
|
const acc = (0, perm_1.getAccount)(username);
|
|
57
55
|
if (!acc)
|
|
58
56
|
return new apiMiddleware_1.ApiError(const_1.HTTP_BAD_REQUEST);
|
|
59
57
|
await (0, perm_1.updateAccount)(acc, (0, api_vfs_1.pickProps)(changes, ALLOWED_KEYS));
|
|
60
|
-
if (changes.username &&
|
|
58
|
+
if (changes.username && ctx.session?.username === (0, perm_1.normalizeUsername)(username)) // update session if necessary
|
|
61
59
|
ctx.session.username = (0, perm_1.normalizeUsername)(changes.username);
|
|
62
60
|
return lodash_1.default.pick(acc, 'username');
|
|
63
61
|
},
|
package/src/api.auth.js
CHANGED
|
@@ -16,7 +16,6 @@ const events_1 = __importDefault(require("./events"));
|
|
|
16
16
|
const ongoingLogins = {}; // store data that doesn't fit session object
|
|
17
17
|
const keepSessionAlive = (0, config_1.defineConfig)('keep_session_alive', true);
|
|
18
18
|
const login = async ({ username, password }, ctx) => {
|
|
19
|
-
var _a;
|
|
20
19
|
if (!username)
|
|
21
20
|
return new apiMiddleware_1.ApiError(const_1.HTTP_BAD_REQUEST);
|
|
22
21
|
if (!ctx.session)
|
|
@@ -30,21 +29,20 @@ const login = async ({ username, password }, ctx) => {
|
|
|
30
29
|
return new apiMiddleware_1.ApiError(const_1.HTTP_UNAUTHORIZED, String(e));
|
|
31
30
|
}
|
|
32
31
|
return {
|
|
33
|
-
redirect:
|
|
32
|
+
redirect: ctx.state.account?.redirect,
|
|
34
33
|
...await (0, exports.refresh_session)({}, ctx)
|
|
35
34
|
};
|
|
36
35
|
};
|
|
37
36
|
exports.login = login;
|
|
38
37
|
const loginSrp1 = async ({ username }, ctx) => {
|
|
39
|
-
var _a, _b;
|
|
40
38
|
if (!username)
|
|
41
39
|
return new apiMiddleware_1.ApiError(const_1.HTTP_BAD_REQUEST);
|
|
42
40
|
const account = (0, perm_1.getAccount)(username);
|
|
43
41
|
if (!ctx.session)
|
|
44
42
|
return new apiMiddleware_1.ApiError(const_1.HTTP_SERVER_ERROR);
|
|
45
|
-
if (
|
|
43
|
+
if (account?.plugin?.auth) // tell client to do clear-text login, before firing attemptingLogin, before triggering anti-brute
|
|
46
44
|
return new apiMiddleware_1.ApiError(const_1.HTTP_METHOD_NOT_ALLOWED);
|
|
47
|
-
if ((
|
|
45
|
+
if ((await events_1.default.emitAsync('attemptingLogin', { ctx, username }))?.isDefaultPrevented())
|
|
48
46
|
return;
|
|
49
47
|
if (!account || !(0, perm_1.accountCanLogin)(account)) { // TODO simulate fake account to prevent knowing valid usernames
|
|
50
48
|
ctx.logExtra({ u: username });
|
|
@@ -57,7 +55,7 @@ const loginSrp1 = async ({ username }, ctx) => {
|
|
|
57
55
|
const { srpServer, ...rest } = await (0, auth_1.srpServerStep1)(account);
|
|
58
56
|
const sid = Math.random();
|
|
59
57
|
ongoingLogins[sid] = srpServer;
|
|
60
|
-
setTimeout(() => delete ongoingLogins[sid],
|
|
58
|
+
setTimeout(() => delete ongoingLogins[sid], 60_000);
|
|
61
59
|
ctx.session.loggingIn = { username, sid }; // temporarily store until process is complete
|
|
62
60
|
return rest;
|
|
63
61
|
}
|
|
@@ -67,7 +65,6 @@ const loginSrp1 = async ({ username }, ctx) => {
|
|
|
67
65
|
};
|
|
68
66
|
exports.loginSrp1 = loginSrp1;
|
|
69
67
|
const loginSrp2 = async ({ pubKey, proof }, ctx) => {
|
|
70
|
-
var _a;
|
|
71
68
|
if (!ctx.session)
|
|
72
69
|
return new apiMiddleware_1.ApiError(const_1.HTTP_SERVER_ERROR);
|
|
73
70
|
if (!ctx.session.loggingIn)
|
|
@@ -83,7 +80,7 @@ const loginSrp2 = async ({ pubKey, proof }, ctx) => {
|
|
|
83
80
|
await (0, auth_1.setLoggedIn)(ctx, username);
|
|
84
81
|
return {
|
|
85
82
|
proof: String(M2),
|
|
86
|
-
redirect:
|
|
83
|
+
redirect: ctx.state.account?.redirect,
|
|
87
84
|
...await (0, exports.refresh_session)({}, ctx)
|
|
88
85
|
};
|
|
89
86
|
}
|
|
@@ -108,16 +105,15 @@ const logout = async ({}, ctx) => {
|
|
|
108
105
|
};
|
|
109
106
|
exports.logout = logout;
|
|
110
107
|
const refresh_session = async ({}, ctx) => {
|
|
111
|
-
var _a, _b;
|
|
112
108
|
const username = (0, auth_1.getCurrentUsername)(ctx);
|
|
113
109
|
return !ctx.session ? new apiMiddleware_1.ApiError(const_1.HTTP_SERVER_ERROR) : {
|
|
114
110
|
username,
|
|
115
111
|
expandedUsername: (0, perm_1.expandUsername)(username),
|
|
116
112
|
adminUrl: (0, adminApis_1.ctxAdminAccess)(ctx) ? ctx.state.revProxyPath + const_1.ADMIN_URI : undefined,
|
|
117
113
|
canChangePassword: (0, perm_1.accountCanChangePassword)(ctx.state.account),
|
|
118
|
-
requireChangePassword:
|
|
114
|
+
requireChangePassword: ctx.state.account?.require_password_change,
|
|
119
115
|
exp: keepSessionAlive.get() ? new Date(Date.now() + middlewares_1.sessionDuration.compiled()) : undefined,
|
|
120
|
-
accountExp:
|
|
116
|
+
accountExp: ctx.state.account?.expire,
|
|
121
117
|
};
|
|
122
118
|
};
|
|
123
119
|
exports.refresh_session = refresh_session;
|
package/src/api.get_file_list.js
CHANGED
|
@@ -25,12 +25,11 @@ function paramsToFilter({ search, wild, searchComment, fileMask }) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
const get_file_list = async ({ uri = '/', offset, limit, c, onlyFolders, onlyFiles, admin, ...rest }, ctx) => {
|
|
28
|
-
var _a;
|
|
29
28
|
const node = await (0, vfs_1.urlToNode)(uri, ctx);
|
|
30
29
|
const list = ctx.get('accept') === 'text/event-stream' ? new SendList_1.SendListReadable() : undefined;
|
|
31
30
|
if (!node)
|
|
32
31
|
return fail(const_1.HTTP_NOT_FOUND);
|
|
33
|
-
admin
|
|
32
|
+
admin &&= (0, adminApis_1.ctxAdminAccess)(ctx); // validate 'admin' flag
|
|
34
33
|
if (await (0, vfs_1.hasDefaultFile)(node, ctx) || !(0, vfs_1.nodeIsFolder)(node)) // for files without permission, the frontend is sent, and the location is the file itself
|
|
35
34
|
// so, we first check if you have a permission problem, to tell frontend to show login, otherwise we fall back to method_not_allowed, as it's proper for files.
|
|
36
35
|
return fail(!admin && (0, vfs_1.statusCodeForMissingPerm)(node, 'can_read', ctx) ? undefined : const_1.HTTP_METHOD_NOT_ALLOWED);
|
|
@@ -48,7 +47,7 @@ const get_file_list = async ({ uri = '/', offset, limit, c, onlyFolders, onlyFil
|
|
|
48
47
|
const can_archive = admin || (0, vfs_1.hasPermission)(node, 'can_archive', ctx);
|
|
49
48
|
const can_comment = can_upload && (0, comments_1.areCommentsEnabled)();
|
|
50
49
|
const can_overwrite = can_upload && (can_delete_children || !upload_1.dontOverwriteUploading.get());
|
|
51
|
-
const comment =
|
|
50
|
+
const comment = node.comment ?? await (0, comments_1.getCommentFor)(node.source);
|
|
52
51
|
const props = { can_archive, can_upload, can_delete, can_delete_children, can_overwrite, can_comment, comment, accept: node.accept, icon: getNodeIcon(node) };
|
|
53
52
|
ctx.state.browsing = uri.replace(/\/{2,}/g, '/');
|
|
54
53
|
(0, connections_1.updateConnectionForCtx)(ctx);
|
|
@@ -98,22 +97,19 @@ const get_file_list = async ({ uri = '/', offset, limit, c, onlyFolders, onlyFil
|
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
function getNodeIcon(node) {
|
|
101
|
-
|
|
102
|
-
return ((_a = node.icon) === null || _a === void 0 ? void 0 : _a.includes('.')) || node.icon; // true = specific for this file, otherwise is a SYS_ICONS
|
|
100
|
+
return node.icon?.includes('.') || node.icon; // true = specific for this file, otherwise is a SYS_ICONS
|
|
103
101
|
}
|
|
104
102
|
async function nodeToDirEntry(ctx, node) {
|
|
105
|
-
var _a;
|
|
106
103
|
const { source, url } = node;
|
|
107
104
|
const name = (0, vfs_1.getNodeName)(node);
|
|
108
105
|
if (url)
|
|
109
106
|
return name ? { n: name, url, target: node.target } : null;
|
|
110
107
|
const isFolder = (0, vfs_1.nodeIsFolder)(node);
|
|
111
108
|
try {
|
|
112
|
-
const st = source ? node.stats ||
|
|
113
|
-
|
|
114
|
-
if (!isFolder || !((_a = node.children) === null || _a === void 0 ? void 0 : _a.length)) // folders with virtual children, keep them
|
|
109
|
+
const st = source ? await (node.stats || (0, misc_1.statWithTimeout)(source).catch(e => {
|
|
110
|
+
if (!isFolder || !node.children?.length) // folders with virtual children, keep them
|
|
115
111
|
throw e;
|
|
116
|
-
}) : undefined;
|
|
112
|
+
})) : undefined;
|
|
117
113
|
// permissions of entries are sent as a difference with permissions of parent
|
|
118
114
|
const pl = node.can_list === misc_1.WHO_NO_ONE ? 'l'
|
|
119
115
|
: !(0, vfs_1.hasPermission)(node, 'can_list', ctx) ? 'L'
|
|
@@ -128,23 +124,22 @@ const get_file_list = async ({ uri = '/', offset, limit, c, onlyFolders, onlyFil
|
|
|
128
124
|
const pu = !isFolder || Boolean(can_upload) === (0, vfs_1.hasPermission)(node, 'can_upload', ctx) ? '' : can_upload ? 'u' : 'U';
|
|
129
125
|
return {
|
|
130
126
|
n: name + (isFolder ? '/' : ''),
|
|
131
|
-
c: st
|
|
127
|
+
c: st?.birthtime,
|
|
132
128
|
m: !st || Math.abs(st.mtimeMs - st.birthtimeMs) < 1000 ? undefined : st.mtime,
|
|
133
|
-
s: isFolder ? undefined : st
|
|
129
|
+
s: isFolder ? undefined : st?.size,
|
|
134
130
|
p: (pr + pl + pd + pa + pu) || undefined,
|
|
135
131
|
order: node.order,
|
|
136
|
-
comment:
|
|
132
|
+
comment: node.comment ?? await (0, comments_1.getCommentFor)(source),
|
|
137
133
|
icon: getNodeIcon(node),
|
|
138
134
|
web: await (0, vfs_1.hasDefaultFile)(node, ctx) ? true : undefined,
|
|
139
135
|
};
|
|
140
136
|
}
|
|
141
|
-
catch
|
|
137
|
+
catch {
|
|
142
138
|
return null;
|
|
143
139
|
}
|
|
144
140
|
function filesInsideCould(n = node) {
|
|
145
|
-
var _a;
|
|
146
141
|
return (0, vfs_1.masksCouldGivePermission)(n.masks, 'can_read')
|
|
147
|
-
||
|
|
142
|
+
|| n.children?.some(c => c.can_read || filesInsideCould(c)); // we count on the boolean-compliant nature of the permission type here
|
|
148
143
|
}
|
|
149
144
|
}
|
|
150
145
|
};
|
package/src/api.lang.js
CHANGED
|
@@ -24,7 +24,7 @@ const apis = {
|
|
|
24
24
|
const data = JSON.parse(await (0, promises_1.readFile)(name, 'utf8'));
|
|
25
25
|
list.add({ code, ...lodash_1.default.omit(data, 'translate') });
|
|
26
26
|
}
|
|
27
|
-
catch
|
|
27
|
+
catch { }
|
|
28
28
|
}
|
|
29
29
|
for (const [code, data] of Object.entries(embedded_1.default))
|
|
30
30
|
list.add({ code, embedded: true, ...lodash_1.default.omit(data, 'translate') });
|
package/src/api.monitor.js
CHANGED
|
@@ -51,11 +51,10 @@ exports.default = {
|
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
53
|
function serializeConnection(conn) {
|
|
54
|
-
var _a;
|
|
55
54
|
const { socket, started, secure } = conn;
|
|
56
55
|
return {
|
|
57
56
|
...getConnAddress(conn),
|
|
58
|
-
v: (
|
|
57
|
+
v: (socket.remoteFamily?.endsWith('6') ? 6 : 4),
|
|
59
58
|
got: socket.bytesRead,
|
|
60
59
|
sent: socket.bytesWritten,
|
|
61
60
|
country: conn.country,
|
|
@@ -109,7 +108,7 @@ function ignore(conn) {
|
|
|
109
108
|
}
|
|
110
109
|
function getConnAddress(conn, overrideIp) {
|
|
111
110
|
return {
|
|
112
|
-
ip: overrideIp
|
|
111
|
+
ip: overrideIp ?? conn.ip,
|
|
113
112
|
port: conn.socket.remotePort,
|
|
114
113
|
};
|
|
115
114
|
}
|