mirror of
https://github.com/nextcloud/server.git
synced 2026-10-29 16:15:46 +01:00
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
3 lines
11 KiB
JavaScript
3 lines
11 KiB
JavaScript
import{e as H,V as Q,s as G,v as R,o as d,f as v,k as u,w as p,z as i,t as r,u as e,h as b,l as n,G as A,H as D,p as c,Q as S,R as q,n as z,q as x,i as f,a as W}from"./PencilOutline-C4ZkKkas.chunk.mjs";import{X as Y,N as B}from"./Link-CUdpEe-t.chunk.mjs";import{l as P,c as X}from"./star-outline-BpDZzOb8.chunk.mjs";import{t,p as Z}from"./translations-pLZlvQeM.chunk.mjs";import{N as I}from"./NcCheckboxRadioSwitch-BgZXg73g.chunk.mjs";import{N as J}from"./ArrowRight-COu6qSN5.chunk.mjs";import{N as K}from"./Check-CEU1oy_I.chunk.mjs";import{N as y}from"./cancel-DDzvQ-HX.chunk.mjs";import{N as j}from"./NcPasswordField-DgVaELPd.chunk.mjs";import{_ as m}from"./NcHighlight.vue_vue_type_script_lang-CT7Xx-zK.chunk.mjs";import{m as ee}from"./MapMarkerOutline-Ip3bQdll.chunk.mjs";import"./formatRelative-uuSCBZ1C.chunk.mjs";import"./_l10n-CK24vgHE.chunk.mjs";import"./File-xDTWu8L0.chunk.mjs";import"./Web-BMG0zIln.chunk.mjs";import"./index-DHyMMYTN.chunk.mjs";import"./livePhotoUtils-CVUhgL4S.chunk.mjs";import"./index-D6fZh9CR.chunk.mjs";import"./NcInputField-wKF2DDSn.chunk.mjs";const ae=["innerHTML"],te={open:"","data-cy-setup-form-advanced-config":""},le={class:"hidden-visually"},oe=["href"],se={key:0},re={class:"hidden-visually"},ne={key:1,"data-cy-setup-form-database-encryption":""},de={class:"hidden-visually"},ce=["href"],ue=H({__name:"WebInstaller",setup(ge){function E(s=""){const l=new Set(s),o=parseInt(Math.log2(Math.pow(l.size,s.length)).toFixed(2));return o<16?0:o<31?1:o<46?2:o<61?3:o<76?4:5}const a=Q(P("core","config")),k=P("core","links"),_=G("form"),F=x(!1),h=x(!1),V=f(()=>E(a.adminpass)),N=f(()=>{if(a.adminpass==="")return"";switch(V.value){case 0:return t("core","Password is too weak");case 1:return t("core","Password is weak");case 2:return t("core","Password is average");case 3:return t("core","Password is strong");case 4:return t("core","Password is very strong");case 5:return t("core","Password is extremely strong")}return t("core","Unknown password strength")}),O=f(()=>V.value<2?"error":V.value<3?"warning":"success"),$=f(()=>a.dbtype==="mysql"||a.dbtype==="pgsql"),T=f({get:()=>a.dbsslnoverify?["1"]:[],set:s=>{a.dbsslnoverify=s.includes("1")}}),w=f(()=>{const s=Object.values(a.databases||{});return s.length===1?s[0]:null}),U=f(()=>Object.keys(a.databases||{}).length>3?"vertical":"horizontal"),C=f(()=>{const s=[t("core","Your data directory and files are probably accessible from the internet because the <code>.htaccess</code> file does not work."),t("core","For information how to properly configure your server, please {linkStart}see the documentation{linkEnd}",{linkStart:'<a href="'+k.adminInstall+'" target="_blank" rel="noreferrer noopener">',linkEnd:"</a>"},{escape:!1})].join("<br>");return Z.sanitize(s)}),L=f(()=>(a.errors||[]).map(s=>typeof s=="string"?{heading:"",message:s}:s.hint===""?{heading:"",message:s.error}:{heading:s.error,message:s.hint}));return R(()=>{if(a.dbtype===""&&(a.dbtype=Object.keys(a.databases).at(0)),a.hasAutoconfig&&_.value){const s=_.value.querySelectorAll('input[name="adminlogin"], input[name="adminpass"]');s.forEach(l=>l.removeAttribute("required")),F.value=_.value.checkValidity()&&a.errors.length===0,s.forEach(l=>l.setAttribute("required","true"))}}),(s,l)=>(d(),v("form",{ref_key:"form",ref:_,class:z(s.$style.setupForm),action:"","data-cy-setup-form":"",method:"POST",onSubmit:l[15]||(l[15]=o=>h.value=!0)},[a.hasAutoconfig?(d(),u(e(y),{key:0,heading:e(t)("core","Autoconfig file detected"),"data-cy-setup-form-note":"autoconfig",type:"success"},{default:p(()=>[i(r(e(t)("core","The setup form below is pre-filled with the values from the config file.")),1)]),_:1},8,["heading"])):b("",!0),a.htaccessWorking===!1?(d(),u(e(y),{key:1,heading:e(t)("core","Security warning"),"data-cy-setup-form-note":"htaccess",type:"warning"},{default:p(()=>[n("p",{innerHTML:C.value},null,8,ae)]),_:1},8,["heading"])):b("",!0),(d(!0),v(A,null,D(L.value,(o,g)=>(d(),u(e(y),{key:g,heading:o.heading,"data-cy-setup-form-note":"error",type:"error"},{default:p(()=>[i(r(o.message),1)]),_:2},1032,["heading"]))),128)),n("fieldset",null,[n("legend",null,r(e(t)("core","Create administration account")),1),c(e(m),{modelValue:a.adminlogin,"onUpdate:modelValue":l[0]||(l[0]=o=>a.adminlogin=o),label:e(t)("core","Administration account name"),"data-cy-setup-form-field":"adminlogin",name:"adminlogin",required:""},null,8,["modelValue","label"]),c(e(j),{modelValue:a.adminpass,"onUpdate:modelValue":l[1]||(l[1]=o=>a.adminpass=o),label:e(t)("core","Administration account password"),"data-cy-setup-form-field":"adminpass",name:"adminpass",required:""},null,8,["modelValue","label"]),S(c(e(y),{type:O.value},{default:p(()=>[i(r(N.value),1)]),_:1},8,["type"]),[[q,a.adminpass!==""]])]),S(n("details",te,[n("summary",null,r(e(t)("core","Storage & database")),1),n("fieldset",null,[c(e(m),{modelValue:a.directory,"onUpdate:modelValue":l[2]||(l[2]=o=>a.directory=o),label:e(t)("core","Data folder"),placeholder:a.serverRoot+"/data",required:"",autocomplete:"off",autocapitalize:"none","data-cy-setup-form-field":"directory",name:"directory",spellcheck:"false"},null,8,["modelValue","label","placeholder"])]),n("fieldset",null,[n("legend",null,r(e(t)("core","Database configuration")),1),n("fieldset",null,[n("legend",le,r(e(t)("core","Database type")),1),S(n("p",{class:z([s.$style.setupForm__databaseTypeSelect,{[s.$style.setupForm__databaseTypeSelect_vertical]:U.value==="vertical"}])},[(d(!0),v(A,null,D(a.databases,(o,g)=>(d(),u(e(I),{key:g,modelValue:a.dbtype,"onUpdate:modelValue":l[3]||(l[3]=M=>a.dbtype=M),buttonVariant:"","data-cy-setup-form-field":`dbtype-${g}`,value:g,buttonVariantGrouped:U.value,name:"dbtype",type:"radio"},{default:p(()=>[i(r(o),1)]),_:2},1032,["modelValue","data-cy-setup-form-field","value","buttonVariantGrouped"]))),128))],2),[[q,!w.value]]),w.value?(d(),u(e(y),{key:0,"data-cy-setup-form-db-note":"single-db",type:"warning"},{default:p(()=>[i(r(e(t)("core","Only {firstAndOnlyDatabase} is available.",{firstAndOnlyDatabase:w.value})),1),l[16]||(l[16]=n("br",null,null,-1)),i(" "+r(e(t)("core","Install and activate additional PHP modules to choose other database types.")),1),l[17]||(l[17]=n("br",null,null,-1)),n("a",{href:e(k).adminSourceInstall,target:"_blank",rel:"noreferrer noopener"},r(e(t)("core","For more details check out the documentation."))+" ↗ ",9,oe)]),_:1})):b("",!0),a.dbtype==="sqlite"?(d(),u(e(y),{key:1,heading:e(t)("core","Performance warning"),"data-cy-setup-form-db-note":"sqlite",type:"warning"},{default:p(()=>[i(r(e(t)("core","You chose SQLite as database.")),1),l[18]||(l[18]=n("br",null,null,-1)),i(" "+r(e(t)("core","SQLite should only be used for minimal and development instances. For production we recommend a different database backend.")),1),l[19]||(l[19]=n("br",null,null,-1)),i(" "+r(e(t)("core","If you use clients for file syncing, the use of SQLite is highly discouraged.")),1)]),_:1},8,["heading"])):b("",!0)]),a.dbtype!=="sqlite"?(d(),v("fieldset",se,[n("legend",re,r(e(t)("core","Database connection")),1),c(e(m),{modelValue:a.dbuser,"onUpdate:modelValue":l[4]||(l[4]=o=>a.dbuser=o),label:e(t)("core","Database user"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbuser",name:"dbuser",spellcheck:"false",required:""},null,8,["modelValue","label"]),c(e(j),{modelValue:a.dbpass,"onUpdate:modelValue":l[5]||(l[5]=o=>a.dbpass=o),label:e(t)("core","Database password"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbpass",name:"dbpass",spellcheck:"false",required:""},null,8,["modelValue","label"]),c(e(m),{modelValue:a.dbname,"onUpdate:modelValue":l[6]||(l[6]=o=>a.dbname=o),label:e(t)("core","Database name"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbname",name:"dbname",pattern:"[0-9a-zA-Z\\$_\\-]+",spellcheck:"false",required:""},null,8,["modelValue","label"]),a.dbtype==="oci"?(d(),u(e(m),{key:0,modelValue:a.dbtablespace,"onUpdate:modelValue":l[7]||(l[7]=o=>a.dbtablespace=o),label:e(t)("core","Database tablespace"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbtablespace",name:"dbtablespace",spellcheck:"false"},null,8,["modelValue","label"])):b("",!0),c(e(m),{modelValue:a.dbhost,"onUpdate:modelValue":l[8]||(l[8]=o=>a.dbhost=o),helperText:e(t)("core","Please specify the port number along with the host name (e.g., localhost:5432)."),label:e(t)("core","Database host"),placeholder:e(t)("core","localhost"),autocapitalize:"none",autocomplete:"off","data-cy-setup-form-field":"dbhost",name:"dbhost",spellcheck:"false"},null,8,["modelValue","helperText","label","placeholder"])])):b("",!0),$.value?(d(),v("details",ne,[n("summary",null,r(e(t)("core","Encrypted database connection")),1),n("fieldset",null,[n("legend",de,r(e(t)("core","Encrypted database connection")),1),a.dbtype==="pgsql"?(d(),u(e(m),{key:0,modelValue:a.dbsslmode,"onUpdate:modelValue":l[9]||(l[9]=o=>a.dbsslmode=o),helperText:e(t)("core","Supported modes: disable, allow, prefer, require, verify-ca, verify-full."),label:e(t)("core","Encryption mode"),autocapitalize:"none",autocomplete:"off",name:"dbsslmode",spellcheck:"false"},null,8,["modelValue","helperText","label"])):b("",!0),c(e(m),{modelValue:a.dbsslca,"onUpdate:modelValue":l[10]||(l[10]=o=>a.dbsslca=o),helperText:e(t)("core","Has to be readable by the web server."),label:e(t)("core","CA certificate path"),autocapitalize:"none",autocomplete:"off",name:"dbsslca",spellcheck:"false"},null,8,["modelValue","helperText","label"]),c(e(m),{modelValue:a.dbsslcert,"onUpdate:modelValue":l[11]||(l[11]=o=>a.dbsslcert=o),label:e(t)("core","Client certificate path"),autocapitalize:"none",autocomplete:"off",name:"dbsslcert",spellcheck:"false"},null,8,["modelValue","label"]),c(e(m),{modelValue:a.dbsslkey,"onUpdate:modelValue":l[12]||(l[12]=o=>a.dbsslkey=o),label:e(t)("core","Client certificate key path"),autocapitalize:"none",autocomplete:"off",name:"dbsslkey",spellcheck:"false"},null,8,["modelValue","label"]),a.dbtype==="pgsql"?(d(),u(e(m),{key:1,modelValue:a.dbsslcrl,"onUpdate:modelValue":l[13]||(l[13]=o=>a.dbsslcrl=o),label:e(t)("core","Certificate revocation list path"),autocapitalize:"none",autocomplete:"off",name:"dbsslcrl",spellcheck:"false"},null,8,["modelValue","label"])):b("",!0),a.dbtype==="mysql"?(d(),u(e(I),{key:2,modelValue:T.value,"onUpdate:modelValue":l[14]||(l[14]=o=>T.value=o),name:"dbsslnoverify",type:"checkbox",value:"1"},{default:p(()=>[i(r(e(t)("core","Do not verify that the server certificate matches the database host")),1)]),_:1},8,["modelValue"])):b("",!0)])])):b("",!0)])],512),[[q,!F.value]]),c(e(B),{class:z({[s.$style.setupForm__button]:!h.value}),disabled:h.value,wide:"",alignment:"center-reverse","data-cy-setup-form-submit":"",type:"submit",variant:"primary"},{icon:p(()=>[h.value?(d(),u(e(K),{key:0})):(d(),u(e(J),{key:1,path:e(Y)},null,8,["path"]))]),default:p(()=>[i(" "+r(h.value?e(t)("core","Installing …"):e(t)("core","Install")),1)]),_:1},8,["class","disabled"]),c(e(y),{"data-cy-setup-form-note":"help",type:"info"},{default:p(()=>[i(r(e(t)("core","Need help?"))+" ",1),n("a",{target:"_blank",rel:"noreferrer noopener",href:e(k).adminInstall},r(e(t)("core","See the documentation"))+" ↗",9,ce)]),_:1})],34))}}),ie="_setupForm_1j0no_1",pe="_setupForm__button_1j0no_36",me="_setupForm__databaseTypeSelect_1j0no_43",be="_setupForm__databaseTypeSelect_vertical_1j0no_47",fe={setupForm:ie,setupForm__button:pe,setupForm__databaseTypeSelect:me,setupForm__databaseTypeSelect_vertical:be},ye={$style:fe},he=X(ue,[["__cssModules",ye]]);ee(W(he),document.getElementById("content"));
|
|
//# sourceMappingURL=core-install.mjs.map
|