|
|
(()=>{"use strict";var t,e={85325:(t,e,a)=>{a.d(e,{A:()=>i});var n=a(71354),o=a.n(n),r=a(76314),s=a.n(r)()(o());s.push([t.id,"form{padding:calc(3*var(--default-grid-baseline));color:var(--color-main-text);border-radius:var(--border-radius-container);background-color:var(--color-main-background-blur);box-shadow:0 0 10px var(--color-box-shadow);-webkit-backdrop-filter:var(--filter-background-blur);backdrop-filter:var(--filter-background-blur);max-width:300px;margin-bottom:30px}form>fieldset:first-child,form>.notecard:first-child{margin-top:0}form>.notecard:last-child{margin-bottom:0}form fieldset,form details{margin-block:1rem}form .setup-form__button:not(.setup-form__button--loading) .material-design-icon{transition:all linear var(--animation-quick)}form .setup-form__button:not(.setup-form__button--loading):hover .material-design-icon{transform:translateX(0.2em)}form .setup-form__database-type-select{display:flex}form .setup-form__database-type-select--vertical{flex-direction:column}code{background-color:var(--color-background-dark);margin-top:1rem;padding:0 .3em;border-radius:var(--border-radius)}.input-field{margin-block-start:1rem !important}.notecard__heading{font-size:inherit !important}","",{version:3,sources:["webpack://./core/src/views/Setup.vue"],names:[],mappings:"AACA,KACC,4CAAA,CACA,4BAAA,CACA,4CAAA,CACA,kDAAA,CACA,2CAAA,CACA,qDAAA,CACA,6CAAA,CAEA,eAAA,CACA,kBAAA,CAEA,qDAEC,YAAA,CAGD,0BACC,eAAA,CAGD,2BAEC,iBAAA,CAIA,iFACC,4CAAA,CAGD,uFACC,2BAAA,CAKF,uCACC,YAAA,CACA,iDACC,qBAAA,CAMH,KACC,6CAAA,CACA,eAAA,CACA,cAAA,CACA,kCAAA,CAID,aACC,kCAAA,CAGD,mBACC,4BAAA",sourcesContent:["\nform {\n\tpadding: calc(3 * var(--default-grid-baseline));\n\tcolor: var(--color-main-text);\n\tborder-radius: var(--border-radius-container);\n\tbackground-color: var(--color-main-background-blur);\n\tbox-shadow: 0 0 10px var(--color-box-shadow);\n\t-webkit-backdrop-filter: var(--filter-background-blur);\n\tbackdrop-filter: var(--filter-background-blur);\n\n\tmax-width: 300px;\n\tmargin-bottom: 30px;\n\n\t> fieldset:first-child,\n\t> .notecard:first-child {\n\t\tmargin-top: 0;\n\t}\n\n\t> .notecard:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\tfieldset,\n\tdetails {\n\t\tmargin-block: 1rem;\n\t}\n\n\t.setup-form__button:not(.setup-form__button--loading) {\n\t\t.material-design-icon {\n\t\t\ttransition: all linear var(--animation-quick);\n\t\t}\n\n\t\t&:hover .material-design-icon {\n\t\t\ttransform: translateX(0.2em);\n\t\t}\n\t}\n\n\t// Db select required styling\n\t.setup-form__database-type-select {\n\t\tdisplay: flex;\n\t\t&--vertical {\n\t\t\tflex-direction: column;\n\t\t}\n\t}\n\n}\n\ncode {\n\tbackground-color: var(--color-background-dark);\n\tmargin-top: 1rem;\n\tpadding: 0 0.3em;\n\tborder-radius: var(--border-radius);\n}\n\n// Various overrides\n.input-field {\n\tmargin-block-start: 1rem !important;\n}\n\n.notecard__heading {\n\tfont-size: inherit !important;\n}\n"],sourceRoot:""}]);const i=s},95748:(t,e,a)=>{var n,o=a(85471),r=a(81222),s=a(53334),i=a(99418),c=a(74095),l=a(32073),d=a(88289),u=a(31133),f=a(16044),p=a(82182),m=a(33691);function g(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=new Set(t),a=parseInt(Math.log2(Math.pow(parseInt(e.size.toString()),t.length)).toFixed(2));return a<16?n.VeryWeak:a<31?n.Weak:a<46?n.Moderate:a<61?n.Strong:a<76?n.VeryStrong:n.ExtremelyStrong}!function(t){t[t.VeryWeak=0]="VeryWeak",t[t.Weak=1]="Weak",t[t.Moderate=2]="Moderate",t[t.Strong=3]="Strong",t[t.VeryStrong=4]="VeryStrong",t[t.ExtremelyStrong=5]="ExtremelyStrong"}(n||(n={}));const b=(0,o.pM)({name:"Setup",components:{IconArrowRight:m.A,NcButton:c.A,NcCheckboxRadioSwitch:l.A,NcLoadingIcon:d.A,NcNoteCard:u.A,NcPasswordField:f.A,NcTextField:p.A},setup:()=>({t:s.t}),data:()=>({config:{},links:{},isValidAutoconfig:!1,loading:!1}),computed:{passwordHelperText(){if(""===this.config?.adminpass)return"";switch(g(this.config?.adminpass)){case n.VeryWeak:return(0,s.t)("core","Password is too weak");case n.Weak:return(0,s.t)("core","Password is weak");case n.Moderate:return(0,s.t)("core","Password is average");case n.Strong:return(0,s.t)("core","Password is strong");case n.VeryStrong:return(0,s.t)("core","Password is very strong");case n.ExtremelyStrong:return(0,s.t)("core","Password is extremely strong")}return(0,s.t)("core","Unknown password strength")},passwordHelperType(){return g(this.config?.adminpass)<n.Moderate?"error":g(this.config?.adminpass)<n.Strong?"warning":"success"},firstAndOnlyDatabase(){const t=Object.values(this.config?.databases||{});return 1===t.length?t[0]:null},DBTypeGroupDirection(){return Object.keys(this.config?.databases||{}).length>3?"vertical":"horizontal"},htaccessWarning(){const t=[(0,s.t)("core","Your data directory and files are probably accessible from the internet because the <code>.htaccess</code> file does not work."),(0,s.t)("core","For information how to properly configure your server, please {linkStart}see the documentation{linkEnd}",{linkStart:'<a href="'+this.links.adminInstall+'" target="_blank" rel="noreferrer noopener">',linkEnd:"</a>"},{escape:!1})].join("<br>");return i.A.sanitize(t)},errors(){return(this.config?.errors||[]).map(t=>"string"==typeof t?{heading:"",message:t}:""===t.hint?{heading:"",message:t.error}:{heading:t.error,message:t.hint})}},beforeMount(){this.config=(0,r.C)("core","config"),this.links=(0,r.C)("core","links")},mounted(){if(""===this.config.dbtype&&(this.config.dbtype=Object.keys(this.config.databases).at(0)),this.config.hasAutoconfig){const t=this.$refs.form;t.querySelectorAll('input[name="adminlogin"], input[name="adminpass"]').forEach(t=>{t.removeAttribute("required")}),t.checkValidity()&&0===this.config.errors.length?this.isValidAutoconfig=!0:this.isValidAutoconfig=!1,t.querySelectorAll('input[name="adminlogin"], input[name="adminpass"]').forEach(t=>{t.setAttribute("required","true")})}},methods:{async onSubmit(){this.loading=!0}}});var A=a(85072),h=a.n(A),v=a(97825),y=a.n(v),_=a(77659),k=a.n(_),C=a(55056),w=a.n(C),x=a(10540),S=a.n(x),N=a(41113),D=a.n(N),O=a(85325),T={};T.styleTagTransform=D(),T.setAttributes=w(),T.insert=k().bind(null,"head"),T.domAPI=y(),T.insertStyleElement=S(),h()(O.A,T),O.A&&O.A.locals&&O.A.locals;const P=(0,a(14486).A)(b,function(){var t=this,e=t._self._c;return t._self._setupProxy,e("form",{ref:"form",staticClass:"setup-form",class:{"setup-form--loading":t.loading},attrs:{action:"","data-cy-setup-form":"",method:"POST"},on:{submit:t.onSubmit}},[t.config.hasAutoconfig?e("NcNoteCard",{attrs:{heading:t.t("core","Autoconfig file detected"),"data-cy-setup-form-note":"autoconfig",type:"success"}},[t._v("\n\t\t"+t._s(t.t("core","The setup form below is pre-filled with the values from the config file."))+"\n\t")]):t._e(),t._v(" "),!1===t.config.htaccessWorking?e("NcNoteCard",{attrs:{heading:t.t("core","Security warning"),"data-cy-setup-form-note":"htaccess",type:"warning"}},[e("p",{domProps:{innerHTML:t._s(t.htaccessWarning)}})]):t._e(),t._v(" "),t._l(t.errors,function(a,n){return e("NcNoteCard",{key:n,attrs:{heading:a.heading,"data-cy-setup-form-note":"error",type:"error"}},[t._v("\n\t\t"+t._s(a.message)+"\n\t")])}),t._v(" "),e("fieldset",{staticClass:"setup-form__administration"},[e("legend",[t._v(t._s(t.t("core","Create administration account")))]),t._v(" "),e("NcTextField",{attrs:{label:t.t("core","Administration account name"),"data-cy-setup-form-field":"adminlogin",name:"adminlogin",required:""},model:{value:t.config.adminlogin,callback:function(e){t.$set(t.config,"adminlogin",e)},expression:"config.adminlogin"}}),t._v(" "),e("NcPasswordField",{attrs:{label:t.t("core","Administration account password"),"data-cy-setup-form-field":"adminpass",name:"adminpass",required:""},model:{value:t.config.adminpass,callback:function(e){t.$set(t.config,"adminpass",e)},expression:"config.adminpass"}}),t._v(" "),e("NcNoteCard",{directives:[{name:"show",rawName:"v-show",value:""!==t.config.adminpass,expression:"config.adminpass !== ''"}],attrs:{type:t.passwordHelperType}},[t._v("\n\t\t\t"+t._s(t.passwordHelperText)+"\n\t\t")])],1),t._v(" "),e("details",{attrs:{open:!t.isValidAutoconfig,"data-cy-setup-form-advanced-config":""}},[e("summary",[t._v(t._s(t.t("core","Storage & database")))]),t._v(" "),e("fieldset",{staticClass:"setup-form__data-folder"},[e("NcTextField",{attrs:{label:t.t("core","Data folder"),placeholder:t.config.serverRoot+"/data",required:"",autocomplete:"off",autocapitalize:"none","data-cy-setup-form-field":"directory",name:"directory",spellcheck:"false"},model:{value:t.config.directory,callback:function(e){t.$set(t.config,"directory",e)},expression:"config.directory"}})],1),t._v(" "),e("fieldset",{staticClass:"setup-form__database"},[e("legend",[t._v(t._s(t.t("core","Database configuration")))]),t._v(" "),e("fieldset",{staticClass:"setup-form__database-type"},[e("legend",{staticClass:"hidden-visually"},[t._v("\n\t\t\t\t\t"+t._s(t.t("core","Database type"))+"\n\t\t\t\t")]),t._v(" "),e("p",{directives:[{name:"show",rawName:"v-show",value:!t.firstAndOnlyDatabase,expression:"!firstAndOnlyDatabase"}],staticClass:"setup-form__database-type-select",class:`setup-form__database-type-select--${t.DBTypeGroupDirection}`},t._l(t.config.databases,function(a,n){return e("NcCheckboxRadioSwitch",{key:n,attrs:{"button-variant":!0,"data-cy-setup-form-field":`dbtype-${n}`,value:n,"button-variant-grouped":t.DBTypeGroupDirection,name:"dbtype",type:"radio"},model:{value:t.config.dbtype,callback:function(e){t.$set(t.config,"dbtype",e)},expression:"config.dbtype"}},[t._v("\n\t\t\t\t\t\t"+t._s(a)+"\n\t\t\t\t\t")])}),1),t._v(" "),t.firstAndOnlyDatabase?e("NcNoteCard",{attrs:{"data-cy-setup-form-db-note":"single-db",type:"warning"}},[t._v("\n\t\t\t\t\t"+t._s(t.t("core","Only {firstAndOnlyDatabase} is available.",{firstAndOnlyDatabase:t.firstAndOnlyDatabase}))),e("br"),t._v("\n\t\t\t\t\t"+t._s(t.t("core","Install and activate additional PHP modules to choose other database types."))),e("br"),t._v(" "),e("a",{attrs:{href:t.links.adminSourceInstall,target:"_blank",rel:"noreferrer noopener"}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("core","For more details check out the documentation."))+" ↗\n\t\t\t\t\t")])]):t._e(),t._v(" "),"sqlite"===t.config.dbtype?e("NcNoteCard",{attrs:{heading:t.t("core","Performance warning"),"data-cy-setup-form-db-note":"sqlite",type:"warning"}},[t._v("\n\t\t\t\t\t"+t._s(t.t("core","You chose SQLite as database."))),e("br"),t._v("\n\t\t\t\t\t"+t._s(t.t("core","SQLite should only be used for minimal and development instances. For production we recommend a different database backend."))),e("br"),t._v("\n\t\t\t\t\t"+t._s(t.t("core","If you use clients for file syncing, the use of SQLite is highly discouraged."))+"\n\t\t\t\t")]):t._e()],1),t._v(" "),"sqlite"!==t.config.dbtype?e("fieldset",[e("legend",{staticClass:"hidden-visually"},[t._v("\n\t\t\t\t\t"+t._s(t.t("core","Database connection"))+"\n\t\t\t\t")]),t._v(" "),e("NcTextField",{attrs:{label:t.t("core","Database user"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbuser",name:"dbuser",spellcheck:"false",required:""},model:{value:t.config.dbuser,callback:function(e){t.$set(t.config,"dbuser",e)},expression:"config.dbuser"}}),t._v(" "),e("NcPasswordField",{attrs:{label:t.t("core","Database password"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbpass",name:"dbpass",spellcheck:"false",required:""},model:{value:t.config.dbpass,callback:function(e){t.$set(t.config,"dbpass",e)},expression:"config.dbpass"}}),t._v(" "),e("NcTextField",{attrs:{label:t.t("core","Database name"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbname",name:"dbname",pattern:"[0-9a-zA-Z\\$_\\-]+",spellcheck:"false",required:""},model:{value:t.config.dbname,callback:function(e){t.$set(t.config,"dbname",e)},expression:"config.dbname"}}),t._v(" "),"oci"===t.config.dbtype?e("NcTextField",{attrs:{label:t.t("core","Database tablespace"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbtablespace",name:"dbtablespace",spellcheck:"false"},model:{value:t.config.dbtablespace,callback:function(e){t.$set(t.config,"dbtablespace",e)},expression:"config.dbtablespace"}}):t._e(),t._v(" "),e("NcTextField",{attrs:{"helper-text":t.t("core","Please specify the port number along with the host name (e.g., localhost:5432)."),label:t.t("core","Database host"),placeholder:t.t("core","localhost"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbhost",name:"dbhost",spellcheck:"false"},model:{value:t.config.dbhost,callback:function(e){t.$set(t.config,"dbhost",e)},expression:"config.dbhost"}})],1):t._e()])]),t._v(" "),e("NcButton",{staticClass:"setup-form__button",class:{"setup-form__button--loading":t.loading},attrs:{disabled:t.loading,loading:t.loading,wide:!0,alignment:"center-reverse","data-cy-setup-form-submit":"",type:"submit",variant:"primary"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon"):e("IconArrowRight")]},proxy:!0}])},[t._v("\n\t\t"+t._s(t.loading?t.t("core","Installing …"):t.t("core","Install"))+"\n\t")]),t._v(" "),e("NcNoteCard",{attrs:{"data-cy-setup-form-note":"help",type:"info"}},[t._v("\n\t\t"+t._s(t.t("core","Need help?"))+"\n\t\t"),e("a",{attrs:{target:"_blank",rel:"noreferrer noopener",href:t.links.adminInstall}},[t._v(t._s(t.t("core","See the documentation"))+" ↗")])])],2)},[],!1,null,null,null).exports;(new(o.Ay.extend(P))).$mount("#content")}},a={};function n(t){var o=a[t];if(void 0!==o)return o.exports;var r=a[t]={id:t,loaded:!1,exports:{}};return e[t].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=e,t=[],n.O=(e,a,o,r)=>{if(!a){var s=1/0;for(d=0;d<t.length;d++){a=t[d][0],o=t[d][1],r=t[d][2];for(var i=!0,c=0;c<a.length;c++)(!1&r||s>=r)&&Object.keys(n.O).every(t=>n.O[t](a[c]))?a.splice(c--,1):(i=!1,r<s&&(s=r));if(i){t.splice(d--,1);var l=o();void 0!==l&&(e=l)}}return e}r=r||0;for(var d=t.length;d>0&&t[d-1][2]>r;d--)t[d]=t[d-1];t[d]=[a,o,r]},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n.j=820,(()=>{n.b=document&&document.baseURI||self.location.href;var t={820:0};n.O.j=e=>0===t[e];var e=(e,a)=>{var o,r,s=a[0],i=a[1],c=a[2],l=0;if(s.some(e=>0!==t[e])){for(o in i)n.o(i,o)&&(n.m[o]=i[o]);if(c)var d=c(n)}for(e&&e(a);l<s.length;l++)r=s[l],n.o(t,r)&&t[r]&&t[r][0](),t[r]=0;return n.O(d)},a=self.webpackChunknextcloud=self.webpackChunknextcloud||[];a.forEach(e.bind(null,0)),a.push=e.bind(null,a.push.bind(a))})(),n.nc=void 0;var o=n.O(void 0,[4208],()=>n(95748));o=n.O(o)})();
|