fix: default max body size 1Gi

This commit is contained in:
loveuer committed 2024-12-23 21:49:04 -08:00
1 parent 105d26efe4
commit aac6c67a5f
8 files changed
+148 -15

No files matched your search

+1 -3
View File
@@ -17,7 +17,6 @@ import (
"nf-repo/internal/opt"
"nf-repo/internal/util/r"
"nf-repo/internal/util/rerr"
"nf-repo/internal/util/tools"
"strings"
)
@@ -187,8 +186,7 @@ func ProxyDownloadImage(mh interfaces.ManifestHandler, bh interfaces.BlobHandler
})
_ = c.Flush()
ctx := tools.TimeoutCtx(c.Request.Context())
if des, err = puller.Get(ctx, tn); err != nil {
if des, err = puller.Get(c.Request.Context(), tn); err != nil {
return r.Resp500(c, err.Error())
}
+1 -1
View File
@@ -12,5 +12,5 @@
</style><link rel="stylesheet" href="styles-7HNLK6WW.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-7HNLK6WW.css"></noscript></head>
<body class="mat-typography">
<app-root></app-root>
<script src="polyfills-7NI4OVGA.js" type="module"></script><script src="main-V5ZNJQTZ.js" type="module"></script></body>
<script src="polyfills-7NI4OVGA.js" type="module"></script><script src="main-GOH3XQ2N.js" type="module"></script></body>
</html>
@@ -10,4 +10,4 @@ ${i.map((n,r)=>`${r+1}) ${n.toString()}`).join(`
--mat-mdc-form-field-label-transform,
${oL} translateX(${u})
)`}_isAttachedToDom(){let n=this._elementRef.nativeElement;if(n.getRootNode){let r=n.getRootNode();return r&&r!==n}return document.documentElement.contains(n)}};e.\u0275fac=function(r){return new(r||e)(f(k),f(Je),f(A),f(un),f(oe),f(iL,8),f(Ge,8),f(O))},e.\u0275cmp=W({type:e,selectors:[["mat-form-field"]],contentQueries:function(r,o,s){if(r&1&&(Oe(s,zo,5),Oe(s,zo,7),Oe(s,lg,5),Oe(s,uD,5),Oe(s,fD,5),Oe(s,JP,5),Oe(s,iD,5)),r&2){let a;U(a=$())&&(o._labelChildNonStatic=a.first),U(a=$())&&(o._labelChildStatic=a.first),U(a=$())&&(o._formFieldControl=a.first),U(a=$())&&(o._prefixChildren=a),U(a=$())&&(o._suffixChildren=a),U(a=$())&&(o._errorChildren=a),U(a=$())&&(o._hintChildren=a)}},viewQuery:function(r,o){if(r&1&&(qe(RP,5),qe(kP,5),qe(OP,5),qe(rD,5),qe(aD,5),qe(sD,5)),r&2){let s;U(s=$())&&(o._textField=s.first),U(s=$())&&(o._iconPrefixContainer=s.first),U(s=$())&&(o._textPrefixContainer=s.first),U(s=$())&&(o._floatingLabel=s.first),U(s=$())&&(o._notchedOutline=s.first),U(s=$())&&(o._lineRipple=s.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:42,hostBindings:function(r,o){r&2&&ie("mat-mdc-form-field-label-always-float",o._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",o._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",o._hasIconSuffix)("mat-form-field-invalid",o._control.errorState)("mat-form-field-disabled",o._control.disabled)("mat-form-field-autofilled",o._control.autofilled)("mat-form-field-no-animations",o._animationMode==="NoopAnimations")("mat-form-field-appearance-fill",o.appearance=="fill")("mat-form-field-appearance-outline",o.appearance=="outline")("mat-form-field-hide-placeholder",o._hasFloatingLabel()&&!o._shouldLabelFloat())("mat-focused",o._control.focused)("mat-primary",o.color!=="accent"&&o.color!=="warn")("mat-accent",o.color==="accent")("mat-warn",o.color==="warn")("ng-untouched",o._shouldForward("untouched"))("ng-touched",o._shouldForward("touched"))("ng-pristine",o._shouldForward("pristine"))("ng-dirty",o._shouldForward("dirty"))("ng-valid",o._shouldForward("valid"))("ng-invalid",o._shouldForward("invalid"))("ng-pending",o._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],standalone:!0,features:[we([{provide:dg,useExisting:e},{provide:mD,useExisting:e}]),G],ngContentSelectors:NP,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],[1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(r,o){if(r&1){let s=An();rt(FP),z(0,jP,1,1,"ng-template",null,0,rl),b(2,"div",4,1),be("click",function(c){return In(s),Sn(o._control.onContainerClick(c))}),z(4,VP,1,0,"div",5),b(5,"div",6),z(6,HP,2,2,"div",7)(7,UP,3,0,"div",8)(8,$P,3,0,"div",9),b(9,"div",10),z(10,GP,1,1,null,11),ae(11),C(),z(12,qP,2,0,"div",12)(13,YP,2,0,"div",13),C(),z(14,QP,1,0,"div",14),C(),b(15,"div",15),z(16,ZP,2,1)(17,XP,5,2),C()}if(r&2){let s;M(2),ie("mdc-text-field--filled",!o._hasOutline())("mdc-text-field--outlined",o._hasOutline())("mdc-text-field--no-label",!o._hasFloatingLabel())("mdc-text-field--disabled",o._control.disabled)("mdc-text-field--invalid",o._control.errorState),M(2),ye(4,!o._hasOutline()&&!o._control.disabled?4:-1),M(2),ye(6,o._hasOutline()?6:-1),M(),ye(7,o._hasIconPrefix?7:-1),M(),ye(8,o._hasTextPrefix?8:-1),M(2),ye(10,!o._hasOutline()||o._forceDisplayInfixLabel()?10:-1),M(2),ye(12,o._hasTextSuffix?12:-1),M(),ye(13,o._hasIconSuffix?13:-1),M(),ye(14,o._hasOutline()?-1:14),M(),ie("mat-mdc-form-field-subscript-dynamic-size",o.subscriptSizing==="dynamic"),M(),ye(16,(s=o._getDisplayedMessages())==="error"?16:s==="hint"?17:-1)}},dependencies:[rD,aD,wl,sD,iD],styles:['.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.m Line truncated
`);if(a.length>2){let c=a[0].slice(6),l=a[1].slice(5),d=JSON.parse(l);d.msg&&(this.title=d.msg),d.action&&d.action==="done"&&(this.repo_svc.GetCatalog(this.repo_svc.catalog().limit,this.repo_svc.catalog().last,this.repo_svc.catalog().keyword),this.msg_svc.success("\u83B7\u53D6\u955C\u50CF\u6210\u529F"),this.dialogRef.close())}}}this.inProgress=!1})}};e.\u0275fac=function(r){return new(r||e)(f(iu),f(kr),f(Fo))},e.\u0275cmp=W({type:e,selectors:[["app-download-image"]],standalone:!0,features:[G],decls:35,vars:9,consts:[["mat-dialog-title",""],[1,"content"],[1,"mat-typography"],["appearance","outline"],["matInput","","placeholder","golang:1.22.2-alpine3.19",3,"ngModelChange","ngModel"],["matSuffix",""],[2,"margin-left","1.5rem"],["matTextPrefix",""],["matInput","","placeholder","external/golang:latest",3,"ngModelChange","ngModel"],["matInput","","placeholder","socks5://127.0.0.1:7890",3,"ngModelChange","ngModel"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-button","","cdkFocusInitial","","color","primary",3,"click"]],template:function(r,o){r&1&&(b(0,"h2",0),L(1),C(),b(2,"div",1)(3,"div"),_e(4,"mat-spinner"),C(),b(5,"div")(6,"mat-dialog-content",2)(7,"p")(8,"mat-form-field",3)(9,"mat-label"),L(10,"\u4E91\u4E0A\u955C\u50CF\u540D\u79F0"),C(),b(11,"input",4),Cs("ngModelChange",function(a){return il(o.source,a)||(o.source=a),a}),C(),b(12,"mat-icon",5),L(13,"clear"),C()()(),b(14,"p")(15,"mat-form-field",3)(16,"mat-label",6),L(17,"\u672C\u5730\u955C\u50CF\u540D\u79F0"),C(),b(18,"span",7),L(19),C(),b(20,"input",8),Cs("ngModelChange",function(a){return il(o.target,a)||(o.target=a),a}),C(),b(21,"mat-icon",5),L(22,"clear"),C()()(),b(23,"p")(24,"mat-form-field",3)(25,"mat-label"),L(26,"\u4EE3\u7406"),C(),b(27,"input",9),Cs("ngModelChange",function(a){return il(o.proxy,a)||(o.proxy=a),a}),C(),b(28,"mat-icon",5),L(29,"clear"),C()()()(),b(30,"mat-dialog-actions",10)(31,"button",11),L(32,"\u53D6\u6D88"),C(),b(33,"button",12),be("click",function(){return o.proxyDownload()}),L(34,"\u4E0B\u8F7D"),C()()()()),r&2&&(M(),Qt(o.title),M(2),Mt(o.inProgress?"download-overlay in-progress":"download-overlay"),M(2),Mt(o.inProgress?"forms in-progress":"forms"),M(6),Ds("ngModel",o.source),M(8),Qt(o.repo_svc.settings().base_address+"/ "),M(),Ds("ngModel",o.target),M(7),Ds("ngModel",o.proxy))},dependencies:[KD,XD,JD,QD,rd,zo,Gd,$d,ai,Wd,hD,Jx,Vo,Vd,rg,iC],styles:["mat-dialog-content[_ngcontent-%COMP%]{min-width:40rem}mat-dialog-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%}mat-dialog-content[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}div.content[_ngcontent-%COMP%]{position:relative}div.content[_ngcontent-%COMP%] div.download-overlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;display:none;align-items:center;justify-content:center;margin-top:-2rem;z-index:1000}div.content[_ngcontent-%COMP%] div.download-overlay.in-progress[_ngcontent-%COMP%]{display:flex}div.content[_ngcontent-%COMP%] div.forms[_ngcontent-%COMP%]{opacity:1}div.content[_ngcontent-%COMP%] div.forms.in-progress[_ngcontent-%COMP%]{opacity:.3}"]});let t=e;return t})();var sC=(()=>{let e=class e{transform(n,...r){if(n===0)return"0 Bytes";let o=1024,s=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],a=Math.floor(Math.log(n)/Math.log(o));return parseFloat((n/Math.pow(o,a)).toFixed(2))+" "+s[a]}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=Vc({name:"capacity",type:e,pure:!0,standalone:!0});let t=e;return t})();var Sg=class{constructor(e,i){this._document=i;let n=this._textarea=this._document.createElement("textarea"),r=n.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",n.setAttribute("aria-hidden","true"),n.value=e,n.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(n)}copy(){let e=this._textarea,i=!1;try{if(e){let n=this._document.activeElement;e.select(),e.setSelectionRange(0,e.value.length),i=this._document.execCommand("copy"),n&&n.focus()}}catch{}return i}destroy(){let e=this._textarea;e&&(e.remove(),this._textarea=void 0)}},aC=(()=>{let e=class e{constructor(n){this._document=n}copy(n){let r=this.beginCopy(n),o=r.copy();return r.destroy(),o}beginCopy(n){return new Sg(n,this._document)}};e.\u0275fac=function(r){return new(r||e)(p(O))},e.\u0275prov=D({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var oj=()=>["expandedDetail"];function sj(t,e){t&1&&(b(0,"th",23),L(1,"\xA0"),C())}function aj(t,e){t&1&&(b(0,"mat-icon"),L(1,"keyboard_arrow_up"),C())}function cj(t,e){t&1&&(b(0,"mat-icon"),L(1,"keyboard_arrow_down"),C())}function lj(t,e){if(t&1){let i=An();b(0,"td",24)(1,"button",25),be("click",function(r){let o=In(i).$implicit,s=Ne();return Sn(s.showTags(r,o))}),z(2,aj,2,0,"mat-icon")(3,cj,2,0),C()()}if(t&2){let i=e.$implicit,n=Ne();M(2),ye(2,n.expandedElement===i?2:3)}}function dj(t,e){t&1&&(b(0,"th",26),L(1,"ID"),C())}function uj(t,e){if(t&1&&(b(0,"td",24),L(1),C()),t&2){let i=e.$implicit;M(),ot(" ",i.id,"")}}function hj(t,e){t&1&&( Line truncated
`);if(a.length>2){let c=a[0].slice(6),l=a[1].slice(5),d=JSON.parse(l);d.msg&&(this.title=d.msg),d.action&&d.action==="done"&&(this.repo_svc.GetCatalog(this.repo_svc.catalog().limit,this.repo_svc.catalog().last,this.repo_svc.catalog().keyword),this.msg_svc.success("\u83B7\u53D6\u955C\u50CF\u6210\u529F"),this.dialogRef.close())}}}this.inProgress=!1})}};e.\u0275fac=function(r){return new(r||e)(f(iu),f(kr),f(Fo))},e.\u0275cmp=W({type:e,selectors:[["app-download-image"]],standalone:!0,features:[G],decls:35,vars:9,consts:[["mat-dialog-title",""],[1,"content"],[1,"mat-typography"],["appearance","outline"],["matInput","","placeholder","golang:1.22.2-alpine3.19",3,"ngModelChange","ngModel"],["matSuffix",""],[2,"margin-left","1.5rem"],["matTextPrefix",""],["matInput","","placeholder","external/golang:latest",3,"ngModelChange","ngModel"],["matInput","","placeholder","socks5://127.0.0.1:7890",3,"ngModelChange","ngModel"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-button","","cdkFocusInitial","","color","primary",3,"click"]],template:function(r,o){r&1&&(b(0,"h2",0),L(1),C(),b(2,"div",1)(3,"div"),_e(4,"mat-spinner"),C(),b(5,"div")(6,"mat-dialog-content",2)(7,"p")(8,"mat-form-field",3)(9,"mat-label"),L(10,"\u4E91\u4E0A\u955C\u50CF\u540D\u79F0"),C(),b(11,"input",4),Cs("ngModelChange",function(a){return il(o.source,a)||(o.source=a),a}),C(),b(12,"mat-icon",5),L(13,"clear"),C()()(),b(14,"p")(15,"mat-form-field",3)(16,"mat-label",6),L(17,"\u672C\u5730\u955C\u50CF\u540D\u79F0"),C(),b(18,"span",7),L(19),C(),b(20,"input",8),Cs("ngModelChange",function(a){return il(o.target,a)||(o.target=a),a}),C(),b(21,"mat-icon",5),L(22,"clear"),C()()(),b(23,"p")(24,"mat-form-field",3)(25,"mat-label"),L(26,"\u4EE3\u7406"),C(),b(27,"input",9),Cs("ngModelChange",function(a){return il(o.proxy,a)||(o.proxy=a),a}),C(),b(28,"mat-icon",5),L(29,"clear"),C()()()(),b(30,"mat-dialog-actions",10)(31,"button",11),L(32,"\u53D6\u6D88"),C(),b(33,"button",12),be("click",function(){return o.proxyDownload()}),L(34,"\u4E0B\u8F7D"),C()()()()),r&2&&(M(),Qt(o.title),M(2),Mt(o.inProgress?"download-overlay in-progress":"download-overlay"),M(2),Mt(o.inProgress?"forms in-progress":"forms"),M(6),Ds("ngModel",o.source),M(8),Qt(o.repo_svc.settings().base_address+"/ "),M(),Ds("ngModel",o.target),M(7),Ds("ngModel",o.proxy))},dependencies:[KD,XD,JD,QD,rd,zo,Gd,$d,ai,Wd,hD,Jx,Vo,Vd,rg,iC],styles:["mat-dialog-content[_ngcontent-%COMP%]{min-width:40rem}mat-dialog-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%}mat-dialog-content[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}div.content[_ngcontent-%COMP%]{position:relative}div.content[_ngcontent-%COMP%] div.download-overlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;display:none;align-items:center;justify-content:center;margin-top:-2rem;z-index:1000}div.content[_ngcontent-%COMP%] div.download-overlay.in-progress[_ngcontent-%COMP%]{display:flex}div.content[_ngcontent-%COMP%] div.forms[_ngcontent-%COMP%]{opacity:1}div.content[_ngcontent-%COMP%] div.forms.in-progress[_ngcontent-%COMP%]{opacity:.3}"]});let t=e;return t})();var sC=(()=>{let e=class e{transform(n,...r){if(n===0)return"0 Bytes";let o=1024,s=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],a=Math.floor(Math.log(n)/Math.log(o));return parseFloat((n/Math.pow(o,a)).toFixed(2))+" "+s[a]}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=Vc({name:"capacity",type:e,pure:!0,standalone:!0});let t=e;return t})();var Sg=class{constructor(e,i){this._document=i;let n=this._textarea=this._document.createElement("textarea"),r=n.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",n.setAttribute("aria-hidden","true"),n.value=e,n.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(n)}copy(){let e=this._textarea,i=!1;try{if(e){let n=this._document.activeElement;e.select(),e.setSelectionRange(0,e.value.length),i=this._document.execCommand("copy"),n&&n.focus()}}catch{}return i}destroy(){let e=this._textarea;e&&(e.remove(),this._textarea=void 0)}},aC=(()=>{let e=class e{constructor(n){this._document=n}copy(n){let r=this.beginCopy(n),o=r.copy();return r.destroy(),o}beginCopy(n){return new Sg(n,this._document)}};e.\u0275fac=function(r){return new(r||e)(p(O))},e.\u0275prov=D({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var oj=()=>["expandedDetail"];function sj(t,e){t&1&&(b(0,"th",23),L(1,"\xA0"),C())}function aj(t,e){t&1&&(b(0,"mat-icon"),L(1,"keyboard_arrow_up"),C())}function cj(t,e){t&1&&(b(0,"mat-icon"),L(1,"keyboard_arrow_down"),C())}function lj(t,e){if(t&1){let i=An();b(0,"td",24)(1,"button",25),be("click",function(r){let o=In(i).$implicit,s=Ne();return Sn(s.showTags(r,o))}),z(2,aj,2,0,"mat-icon")(3,cj,2,0),C()()}if(t&2){let i=e.$implicit,n=Ne();M(2),ye(2,n.expandedElement===i?2:3)}}function dj(t,e){t&1&&(b(0,"th",26),L(1,"ID"),C())}function uj(t,e){if(t&1&&(b(0,"td",24),L(1),C()),t&2){let i=e.$implicit;M(),ot(" ",i.id,"")}}function hj(t,e){t&1&&( Line truncated
+1 -1
View File
@@ -3,7 +3,7 @@ package opt
import "errors"
const (
DefaultMaxSize = 32 * 1024 * 1024
DefaultMaxSize = 1024 * 1024 * 1024
ReferrersEnabled = true
BaseAddress = "repo.me"