···11+(self.webpackChunkmy_website=self.webpackChunkmy_website||[]).push([["631"],{2994:function(e,r,o){e.exports={src:Object.assign(Object.create({toString(){return this.src}}),{srcSet:o.p+"assets/ideal-img/sync-resource-file.d733ef4.640.png 640w,"+o.p+"assets/ideal-img/sync-resource-file.cdf1733.739.png 739w",images:[{path:o.p+"assets/ideal-img/sync-resource-file.d733ef4.640.png",width:640,height:793},{path:o.p+"assets/ideal-img/sync-resource-file.cdf1733.739.png",width:739,height:916}],src:o.p+"assets/ideal-img/sync-resource-file.d733ef4.640.png",placeholder:void 0,width:640,height:793}),preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAMCAYAAABbayygAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABDElEQVR4nG2P226DMBBEeQ7XgC9gm0swEAKFpKRpq1Zqpf7/P01lFyFF6cNod7VHs7MOlxokPSAiCjSrQbIaEZHY+QncgGxy/H1qFzErEOwzeBGHF7I7yDVgGKcILKzgBvTPySePIE0LCFXbwTMK6aadn6w9gxMlAqkyOSvELN+U8MJGChOJIM7ghImAPi4o2wU078HU0YrKDlS2to95ZUCJafnE/PKN+ukDor5A1DN43oOKBkx1K0gkuvGGdrhC6RlpOYKXA5hqV8cVNN82pyvyZgEvR1DV2aWpd6A5fb59YXn/gbanz8gOE3hxenTs5zf00yuK9oKsGm02Az2Aul+g9DN4MYAIDfIP+AtBl50yVJl/EgAAAABJRU5ErkJggg=="}},5124:function(e,r,o){"use strict";o.d(r,{ZP:()=>c,d$:()=>t});var s=o(5893),n=o(65);let t=[];function i(e){let r={a:"a",code:"code",p:"p",pre:"pre",...(0,n.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Console Output Example"}),(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-shell",children:"docker compose up --no-log-prefix\n"})}),(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{children:'INFO : [Init] Debug Mode: NO\nINFO : [App] Version: 0.1.0\nINFO : [App] Files On Server Dir ENV: /filesOnServer -> Resolved: /filesOnServer\nINFO : [App] [Files On Server] Processing Stacks for 2 folders:\n/filesOnServer/immich\n/filesOnServer/plex\n/filesOnServer/uptime-kuma\nINFO : [App] [Files On Server] Compose File Glob: **/{compose,docker-compose}*.y?(a)ml\nINFO : [App] [Files On Server] Env Glob: **/.env\nINFO : [App] [Files On Server] [compose] Found Stack \'compose\' at dir /filesOnServer/compose.yaml\nWARN : [App] [Files On Server] [compose] Did not find any files patterns matching compose glob\nINFO : [App] [Files On Server] [compose] Stack config complete\n\n...\n\nINFO : [App] [Files On Server] Built Stack configs for 3 folders\nINFO : [App] Copy the text between the scissors to use as the *Resource File* contents within your Resource Sync\n\n\u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F\n\n[[stack]]\nname = "immich"\n\n[stack.config]\nserver = "my-cool-server"\nrun_directory = "/home/myUser/homelab/immich"\nfiles_on_host = true\nauto_update = false\npoll_for_updates = false\nfile_paths = [ "docker/docker-compose.yaml" ]\n\n[[stack]]\nname = "plex"\n\n[stack.config]\nserver = "my-cool-server"\nrun_directory = "/home/myUser/homelab/plex"\nfiles_on_host = true\nauto_update = false\npoll_for_updates = false\n\n[[stack]]\nname = "uptime-kuma"\n\n[stack.config]\nserver = "my-cool-server"\nrun_directory = "/home/myUser/homelab/uptime-kuma"\nfiles_on_host = true\nauto_update = false\npoll_for_updates = false\nenv_file_path = ".komodoEnv"\nadditional_env_files = [ ".env" ]\n\u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F\nINFO : [App] Done!\n'})}),(0,s.jsxs)(r.p,{children:["Copy the text between the scissors and ",(0,s.jsx)(r.a,{href:"../usage/resourceSync/#create-sync-resource",children:"create a new Sync Resource in Komodo"})]})]})}function c(e={}){let{wrapper:r}={...(0,n.a)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},3526:function(e,r,o){"use strict";o.r(r),o.d(r,{frontMatter:()=>W,default:()=>er,toc:()=>Q,metadata:()=>s,assets:()=>J,contentTitle:()=>X});var s=JSON.parse('{"id":"quickstart","title":"Quickstart","description":"Prerequisites","source":"@site/docs/quickstart.mdx","sourceDirName":".","slug":"/quickstart","permalink":"/komodo-import/docs/quickstart","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/quickstart.mdx","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"title":"Quickstart","sidebar_position":1},"sidebar":"tutorialSidebar","next":{"title":"Installation","permalink":"/komodo-import/docs/category/installation"}}'),n=o(5893),t=o(65);o(7057),o(4250);var i=o(7294),c=o(2292),l=o.n(c),a=o(9999),d=o(2575),m=o(461),h=o(5756),p=o(7026),u=o(1183);function x({size:e=null,outline:r=!1,variant:o="primary",block:s=!1,disabled:t=!1,className:i,style:c={},link:l,label:a,onClick:d=()=>null,...m}){let h=e?({sm:"sm",small:"sm",lg:"lg",large:"lg",medium:null})[e]:"",x=h?`button--${h}`:"",f=o?`button--${o}`:"";return(0,n.jsx)(u.Z,{to:t?null:l,children:(0,n.jsx)("button",{className:(0,p.Z)("button",x,r?"button--outline":"",f,s?"button--block":"",t?"disabled":"",i),style:c,role:"button","aria-disabled":t,onClick:e=>{e.preventDefault(),d()},...m,children:a})})}let f={borderRadius:"var(--ifm-button-border-radius) 0 0 var(--ifm-button-border-radius)"},j={borderRadius:"0 var(--ifm-button-border-radius) var(--ifm-button-border-radius) 0"},g={borderRadius:"0"};function y({size:e=null,variant:r="primary",block:o=!1,disabled:s=!1,className:t,style:i,options:c,value:l,defaultValue:a,onChange:d=()=>null}){if(void 0===c||0===c.length)return null;let m=c.map((o,s)=>{let t={style:g,outline:!0,size:e,variant:r,label:o[1],link:"#",onClick:()=>d(o[0])};return 0===s?t.style=f:s===c.length-1&&(t.style=j),(l??a)===o[0]&&(t.outline=!1),(0,n.jsx)(x,{...t},s)});return(0,n.jsx)("span",{children:m})}var v=o(4697);function S(e){let r={code:"code",p:"p",pre:"pre",strong:"strong",...(0,t.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(r.p,{children:["When using ",(0,n.jsx)(r.code,{children:"STACKS_FROM=compose"})," this should be the the most top-level directory that all projects are contained within, at some level."]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Example"}),(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.code,{children:"docker compose ls"})," reveals these projects:"]}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{children:"NAME STATUS CONFIG FILES\nimmich running /home/myUser/homelab/immich/compose.yaml\nplex running /home/myUser/homelab/plex/docker-compose.yaml\nproject1 running /home/myUser/localDev/myProjects/project1/compose.yaml\n"})}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{children:".\n\u2514\u2500\u2500 /home/myUser\n \u251C\u2500\u2500 homeLab\n \u2502 \u251C\u2500\u2500 immich\n \u2502 \u2502 \u2514\u2500\u2500 compose.yaml\n \u2502 \u2514\u2500\u2500 plex\n \u2502 \u251C\u2500\u2500 docker-compose.yaml\n \u2502 \u2514\u2500\u2500 .git\n \u2514\u2500\u2500 localDev\n \u2514\u2500\u2500 myProjects\n \u2514\u2500\u2500 project1\n \u2514\u2500\u2500 compose.yaml\n"})}),(0,n.jsxs)(r.p,{children:["Then ",(0,n.jsx)(r.strong,{children:"Host Directory"})," should be ",(0,n.jsx)(r.code,{children:"/home/myUser"})]})]})]})}function k(e={}){let{wrapper:r}={...(0,t.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(S,{...e})}):S(e)}function b(e){let r={code:"code",p:"p",pre:"pre",strong:"strong",...(0,t.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(r.p,{children:["For ",(0,n.jsx)(r.code,{children:"STACKS_FROM=dir"})," this should be the immediate parent directory containing all your project folders."]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Example"}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{children:".\n\u2514\u2500\u2500 /home/myUser/homelab/\n \u251C\u2500\u2500 immich/\n \u2502 \u2514\u2500\u2500 compose.yaml\n \u251C\u2500\u2500 plex/\n \u2502 \u251C\u2500\u2500 docker-compose.yaml\n \u2502 \u2514\u2500\u2500 .git\n \u2514\u2500\u2500 uptime-kuma/\n \u2514\u2500\u2500 compose.yaml\n"})}),(0,n.jsxs)(r.p,{children:["Then ",(0,n.jsx)(r.strong,{children:"Host Directory"})," should be ",(0,n.jsx)(r.code,{children:"/home/myUser/homelab"})]})]})]})}function O(e={}){let{wrapper:r}={...(0,t.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(b,{...e})}):b(e)}var A=o(5124),w=o(8494),F=o(2994),N=o.n(F);function I(e){let r={a:"a",code:"code",p:"p",pre:"pre",...(0,t.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Komodo Example"}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-shell",children:"docker compose up --no-log-prefix\n"})}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{children:"INFO : [Init] Debug Mode: NO\nINFO : [App] Version: 0.1.0\nINFO : [App] Files On Server Dir ENV: /filesOnServer -> Resolved: /filesOnServer\nINFO : [App] [Files On Server] Processing Stacks for 2 folders:\n/filesOnServer/immich\n/filesOnServer/plex\n/filesOnServer/uptime-kuma\nINFO : [App] [Files On Server] Compose File Glob: **/{compose,docker-compose}*.y?(a)ml\nINFO : [App] [Files On Server] Env Glob: **/.env\nINFO : [App] [Files On Server] [compose] Found Stack 'compose' at dir /filesOnServer/compose.yaml\nWARN : [App] [Files On Server] [compose] Did not find any files patterns matching compose glob\nINFO : [App] [Files On Server] [compose] Stack config complete\n\n...\n\nINFO : [App] [Files On Server] Built Stack configs for 3 folders\nINFO : [App] Copy the text between the scissors to use as the *Resource File* contents within your Resource Sync\n\n...\n\nINFO : [App] [Sync API] Using 'komodo-import' as Sync Name\nVERBOSE: [App] [Sync API] KOMODO_URL: http://192.168.0.101:9120 | Normalized: http://192.168.0.101:9120/\nINFO : [App] [Sync API] Resource Sync created.\nINFO : [App] [Sync API] Resource Sync URL: http://192.168.0.101:9120/resource-syncs/689a41a04ed1b642f3053f57\n"})}),(0,n.jsxs)(r.p,{children:["The ",(0,n.jsx)(r.a,{href:"../usage/resourceSync#verify-sync-changes",children:"Sync Resource"})," is automatically created for you (but not executed!)"]}),(0,n.jsx)(w.Z,{img:N()})]})}function E(e={}){let{wrapper:r}={...(0,t.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(I,{...e})}):I(e)}var R=o(6370),K=o(5070),C=o(122);let _={},P=(e,r,o)=>e in _?_[e]():C.Z.canUseDOM?(_[e]=((e,r,o)=>{let s=[];return()=>{let[n,t]=((e,r,o=!0)=>{let[s,n]=(0,i.useState)(()=>{let s=window.localStorage.getItem(e);if(o)try{return s?JSON.parse(s):r}catch(e){return console.error(e),r}try{let e;if(null===s)return r;if("true"===s)return!0;if("false"===s)return!1;if(e=s,("number"==typeof e||"string"==typeof e&&""!==e.trim())&&!isNaN(e)){if(s.includes("."))return parseFloat(s);return parseInt(s)}return s}catch(e){return console.error(e),r}}),t=(0,i.useCallback)(r=>{n(()=>(o?localStorage.setItem(e,JSON.stringify(r)):localStorage.setItem(e,r),r))},[e]);return(0,i.useEffect)(()=>{let o=o=>{o.storageArea===localStorage&&o.key===e&&n(null===o.newValue?r:o.newValue)};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)}),[s,t]})(e,r,o),c=(0,i.useCallback)(e=>{for(let r of s)r(e)},[]);return(0,i.useEffect)(()=>(s.push(t),()=>{s.splice(s.indexOf(t),1)}),[t]),[n,c]}})(e,r,o),_[e]()):[r,()=>null],D=(0,R.wL)("services:\n komodo-import:\n image: foxxmd/komodo-import:latest\n restart: no\n volumes:\n - ./home/myUser/homelab:/filesOnServer\n environment:\n"),U=(0,R.wL)("socket-proxy:\n image: lscr.io/linuxserver/socket-proxy:latest\n environment:\n - CONTAINERS=1\n - INFO=1\n - POST=0\n - PING=1\n - VERSION=1\n volumes:\n - /var/run/docker.sock:/var/run/docker.sock:ro\n read_only: true\n tmpfs:\n - /run"),T=new RegExp(/(?:^|[\/\\])\.\S/),B=e=>{let[r,o]=P("docusaurus.tab.stacksFrom","dir",!1),[s,t]=P("syncApi",!1),[c,a]=(0,i.useState)(D),[d]=P("hostDirectory",""),[m]=P("serverName",""),[h]=P("komodoUrl",""),[p]=P("komodoApiKey",""),[u]=P("komodoApiSecret","");return(0,i.useEffect)(()=>{let e=D.clone(),o=void 0!==d&&""!==d.trim()?d:"/home/myUser/homelab",n=new R.Ru(`${o}:/filesOnServer`);n.commentBefore=`# ${"dir"===r?"Parent directory where all subfolders are compose projects":"Top-most directory that contains all folders (at any level) that compose projects are found in"}`,e.setIn(["services","komodo-import","volumes",0],n),e.setIn(["services","komodo-import","environment"],new R.wr);let t=e.getIn(["services","komodo-import","environment"]),i=new R.Ru(`HOST_PARENT_PATH=${o}`);if(i.commentBefore="# Same as mounted directory above",t.add(i),T.test(o)){let e=new R.Ru("GLOB_DOT=true");e.commentBefore="# Forces glob to not ignore dot folders",t.add(e)}let c=new R.Ru(`STACKS_FROM=${r}`);c.commentBefore="# Determines what sources to generate Stacks from",c.comment=`# ${"dir"===r?"Generate stacks from subfolders in directory":"Generate stacks from compose projects"}`,t.add(c);let l=new R.Ru(`SERVER_NAME=${void 0!==m&&""!==m.trim()?m:"my-cool-server"}`);if(l.commentBefore="# Name of Server for this machine, in Komodo\nmask",t.add(l),s){let e=new R.Ru(`KOMODO_URL=${""===h?"http://192.168.KOMOMDO.IP:8120":h}`);e.spaceBefore=!0,e.commentBefore="# Configuration for interacting with Komodo API\nmask-start",t.add(e),t.add(`API_KEY=${""===p?"K-3A6btIPZYeBu_EXAMPLE_KEY":p}`),t.add(`API_SECRET=${""===u?"S-qnaXD1frutYlfC2ZYl_EXAMPLE_SECRET":u}`);let r=new R.Ru("OUTPUT_API_SYNC=true");r.commentBefore="mask-end",r.comment="Create Sync Resource in Komodo",t.add(r)}if("compose"===r){let r=new R.Ru("DOCKER_HOST=tcp://socket-proxy:2375");r.spaceBefore=!0,r.commentBefore="Tells Komodo Import how to connect to Docker",t.add(r);let o=new R.wr;o.add("socket-proxy"),e.setIn(["services","komodo-import","depends_on"],o),e.setIn(["services","socket-proxy"],U.get("socket-proxy")),e.getIn(["services","socket-proxy"]).commentBefore="# used to communicate with docker daemon"}a(e)},[s,r,d,m,p,u,h,a]),(0,n.jsx)(l(),{title:"compose.yaml",language:"yaml",children:c.toString()})},G=e=>(0,n.jsx)(h.Z,{fallback:({error:e})=>(0,n.jsx)("div",{children:(0,n.jsxs)(d.Z,{type:"danger",children:[(0,n.jsx)("p",{children:"Interactive Quickstart compose.yaml crashed because of error! Sorry."}),(0,n.jsx)(l(),{children:e.stack})]})}),children:(0,n.jsx)(K.default,{children:()=>(0,n.jsx)(B,{...e})})}),L=e=>{let{readOnly:r=!1,stylePreset:o,placeholder:s,storageKey:t,initialValue:c="",sensitive:l=!1}=e,[d,m]=P(t,c),[h,p]=i.useState(d),[u,x]=(0,v.Nr)(h,500);(0,i.useEffect)(()=>{m(u)},[u,m]),(0,i.useEffect)(()=>{x(d),p(d)},[d,x,p]);let f=l?"rr-mask":"";if(r){let e;switch(null!=d&&""!==d.trim()?e=d:""!==c?e=c:void 0!==s&&(e=s),o){case"inline":return(0,n.jsx)(a.Z,{className:f,children:e});case"bold":return(0,n.jsx)("strong",{className:f,children:e});default:return(0,n.jsx)("span",{className:f,children:e})}}return(0,n.jsx)("input",{type:"text",className:f,placeholder:s,onChange:e=>{p(e.target.value)},value:h})},M=e=>(0,n.jsx)(K.default,{children:()=>(0,n.jsx)(L,{...e})}),Z=e=>{let{placeholder:r="my-cool-server",...o}=e;return(0,n.jsx)(M,{storageKey:"serverName",placeholder:r,sensitive:!0,...o})},Y=e=>{let{placeholder:r="/home/myUser/homelab",...o}=e;return(0,n.jsx)(M,{storageKey:"hostDirectory",placeholder:r,...o})},V=e=>{let{placeholder:r="http://192.168.0.101:8120",...o}=e;return(0,n.jsx)(M,{storageKey:"komodoUrl",sensitive:!0,placeholder:r,...o})},q=e=>{let{placeholder:r="K-3A6btIPZYeBuD5ebSa9uD5ebuD5ebHIjYxT5sc",...o}=e;return(0,n.jsx)(M,{storageKey:"komodoApiKey",sensitive:!0,placeholder:r,...o})},z=e=>{let{placeholder:r="S-qnaXD1frutYlfC2ZYlfCSzqiYlfC1WYlfCVR34Yj4",...o}=e;return(0,n.jsx)(M,{storageKey:"komodoApiSecret",sensitive:!0,placeholder:r,...o})},H=e=>{let{data:r,name:o,client:s=!1}=e,[t,c]=(0,v.Nr)("",1e3),[l,h]=P("docusaurus.tab.stacksFrom","dir",!1),[p,u]=P("syncApi",!1),f=(0,i.useCallback)(()=>{u(!p)},[p,u]),j=(0,i.useCallback)(e=>{h(e)},[h]);return(0,n.jsxs)(i.Fragment,{children:[(0,n.jsxs)("h3",{children:["1. What ",(0,n.jsx)("a",{href:"../usage/overview#stack-sources",children:"Stack Sources"})," to generate Stacks from?"]}),(0,n.jsx)("p",{children:(0,n.jsx)(y,{options:[["dir","Directory"],["compose","Compose Projects"]],defaultValue:"dir",value:l,variant:"primary",size:"lg",onChange:e=>j(e)})}),(0,n.jsx)("span",{style:{display:"dir"===l?"inherit":"none"},children:(0,n.jsxs)(d.Z,{type:"info",children:["For ",(0,n.jsx)("strong",{children:"Directory"})," (",(0,n.jsx)(a.Z,{children:"STACKS_FROM=dir"}),") Komodo Import will try to generate Stacks from each ",(0,n.jsx)("strong",{children:"subfolder"})," inside the directory mounted into the container."]})}),(0,n.jsx)("span",{style:{display:"compose"===l?"inherit":"none"},children:(0,n.jsxs)(d.Z,{type:"info",children:["For ",(0,n.jsx)("strong",{children:"Compose Projects"})," (",(0,n.jsx)(a.Z,{children:"STACKS_FROM=compose"}),") Komodo Import will try to generate Stacks from existing projects on your machine that were created with ",(0,n.jsx)(a.Z,{children:"docker compose up"})]})}),(0,n.jsx)("h3",{children:"2. Where are your existing projects located on your machine?"}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"hostDir",children:(0,n.jsx)("strong",{children:(0,n.jsx)("a",{href:"../usage/overview#host-directory",children:"Host Directory:"})})}),(0,n.jsx)(Y,{})]}),"compose"===l?(0,n.jsx)(m.Z,{children:(0,n.jsx)(k,{})}):(0,n.jsx)(m.Z,{children:(0,n.jsx)(O,{})}),(0,n.jsx)("h3",{children:"3. What is the name of this Komodo Server?"}),(0,n.jsxs)("p",{children:["Once Komodo Periphery agent was added to this machine you connected it to Komodo as a ",(0,n.jsx)("a",{href:"https://komo.do/docs/resources#server",children:(0,n.jsx)("strong",{children:"Server"})}),". Specify the name you gave it."]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"serverName",children:(0,n.jsx)("strong",{children:"Server Name:"})}),(0,n.jsx)(Z,{})]}),(0,n.jsx)("h3",{children:"4. Where should generated Stacks be created?"}),(0,n.jsxs)("p",{children:["Choose one or more ",(0,n.jsx)("a",{href:"../usage/overview#outputs-1",children:"Outputs"}),":"]}),(0,n.jsxs)("p",{children:[(0,n.jsx)(x,{className:"margin-right--md",label:"Console",link:"#",variant:"primary",disabled:!0}),(0,n.jsx)(x,{label:"Komodo",link:"#",variant:"primary",outline:!p,onClick:f})]}),(0,n.jsxs)("div",{style:{display:p?"inherit":"none"},children:[(0,n.jsxs)("p",{children:["Komodo Import can create a ",(0,n.jsx)("a",{href:"../usage/resourceSync#create-sync-resource",children:"Sync Resource"})," with the generated Stacks in Komodo for you. This method ",(0,n.jsx)("strong",{children:"only"})," creates the Resource, it does not execute or change your existing Stacks."]}),(0,n.jsxs)("p",{children:["Create an ",(0,n.jsx)("a",{href:"../usage/overview#api-sync",children:"API Key and Secret"}),", then specify them below."]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"url",children:(0,n.jsx)("strong",{children:"Komodo URL:"})}),(0,n.jsx)(V,{})]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"apiKey",children:(0,n.jsx)("strong",{children:"Komodo API Key:"})}),(0,n.jsx)(q,{})]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"apiSecret",children:(0,n.jsx)("strong",{children:"Komodo API Secret:"})}),(0,n.jsx)(z,{})]}),(0,n.jsx)(m.Z,{children:(0,n.jsx)(E,{})})]}),(0,n.jsxs)("p",{children:["Generated Stacks are ",(0,n.jsx)("strong",{children:"always"})," output to docker logs as a ",(0,n.jsx)("a",{href:"../usage/resourceSync#create-sync-resource",children:"Sync Resource"}),"."]}),(0,n.jsx)(m.Z,{children:(0,n.jsx)(A.ZP,{})}),(0,n.jsx)("h3",{children:"5. Save your customized Compose file"}),(0,n.jsx)("p",{children:"The file below has been customized for your specific machine! Save this somewhere on the machine:"}),(0,n.jsx)(G,{})]})},$=e=>(0,n.jsx)(h.Z,{fallback:({error:e})=>(0,n.jsx)("div",{children:(0,n.jsxs)(d.Z,{type:"danger",children:[(0,n.jsx)("p",{children:"Interactive Quickstart crashed because of error! Sorry."}),(0,n.jsx)(l(),{children:e.stack})]})}),children:(0,n.jsx)(H,{...e})}),W={title:"Quickstart",sidebar_position:1},X=void 0,J={},Q=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Create Your Scenario",id:"create-your-scenario",level:2},{value:"Generate Stacks",id:"generate-stacks",level:2},{value:"Next Steps",id:"next-steps",level:2}];function ee(e){let r={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"You have Komodo already setup"}),"\n",(0,n.jsxs)(r.li,{children:["You have installed ",(0,n.jsx)(r.a,{href:"https://komo.do/docs/connect-servers",children:"Periphery"})," on a machine","\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:["The Komodo ",(0,n.jsx)(r.a,{href:"https://komo.do/docs/resources#server",children:"Server"})," name is ",(0,n.jsx)(Z,{readOnly:!0,stylePreset:"inline"})]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(r.h2,{id:"create-your-scenario",children:"Create Your Scenario"}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Follow the directions below, select your options, and fill in all fields to generate a customized Docker Compose file for your specific scenario."})}),"\n",(0,n.jsx)($,{}),"\n",(0,n.jsx)(r.h2,{id:"generate-stacks",children:"Generate Stacks"}),"\n",(0,n.jsxs)(r.p,{children:["Run the customized ",(0,n.jsx)(r.code,{children:"compose.yaml"})," from above with ",(0,n.jsx)(r.code,{children:"docker compose"})," to generate Komodo Stacks from existing projects on your machine!"]}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"# in the same directory as compose.yaml...\ndocker compose up --no-log-prefix\n"})}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Show Only Sync Resource Contents"}),(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.strong,{children:"Console"})," output too long? Run Komodo Import again with this command to output only the ",(0,n.jsx)(r.a,{href:"../usage/resourceSync",children:"Sync Resource"})," content:"]}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"docker compose up --no-log-prefix | grep -Pzo '(?s)\u2702\uFE0F\\n\\K(.+)(?=\\n\u2702)' && echo\n"})})]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Copy to Clipboard"}),(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.strong,{children:"Console"})," output too long to copy? Run Komodo Import again with this command to copy the ",(0,n.jsx)(r.a,{href:"../usage/resourceSync",children:"Sync Resource"})," content directly to clipboard with ",(0,n.jsx)(r.code,{children:"xclip"}),":"]}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"docker compose up --no-log-prefix | grep -Pzo '(?s)\u2702\uFE0F\\n\\K(.+)(?=\\n\u2702)' | xclip -selection c\n"})})]}),"\n",(0,n.jsxs)(r.p,{children:["How the Stacks will be generated is determined by what you chose in ",(0,n.jsx)(r.strong,{children:"Step 4"}),". Refer to the expandable ",(0,n.jsx)(r.strong,{children:"Examples"})," in that step."]}),"\n",(0,n.jsx)(r.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,n.jsxs)(r.p,{children:["There are many more options (environmental variables) that can be used to customize how Stacks are generated, all found in ",(0,n.jsx)(r.a,{href:"../usage/overview#stacks",children:"Usage"})," docs. Some customizations that might interest you:"]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.a,{href:"../usage/overview#stack-configuration",children:"Common Stack options"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"Set image registry provider/account"}),"\n",(0,n.jsxs)(r.li,{children:["Set defaults for polling for new images (",(0,n.jsx)(r.code,{children:"POLL_FOR_UPDATE"}),") and auto updating (",(0,n.jsx)(r.code,{children:"AUTO_UPDATE"}),")"]}),"\n",(0,n.jsxs)(r.li,{children:["Set what compose files (",(0,n.jsx)(r.code,{children:"COMPOSE_FILE_GLOB"}),") and .env files (",(0,n.jsx)(r.code,{children:"ENV_FILE_GLOB"}),") to include, per Stack"]}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(r.li,{children:["For ",(0,n.jsx)(r.strong,{children:"Directory"})," generated stacks...","\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:["Include (",(0,n.jsx)(r.code,{children:"FOLDER_GLOB"}),") or exclude (",(0,n.jsx)(r.code,{children:"FOLDER_IGNORE_GLOB"}),") folders based on patterns"]}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(r.li,{children:["Configure Komodo Import to use the ",(0,n.jsx)(r.a,{href:"../usage/overview#komodo-api",children:"Komodo API"})," for better integration","\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"Uses existing Linked Repos for Git Based Stacks"}),"\n",(0,n.jsx)(r.li,{children:"Automatically configures Git Based Stacks to use existing, private Git Provider if git URL domains match"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(r.p,{children:["Additionally, review the ",(0,n.jsx)(r.a,{href:"../usage/resourceSync",children:"Sync Resource"})," guide to learn how to use them for creating Stacks in Komodo."]})]})}function er(e={}){let{wrapper:r}={...(0,t.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(ee,{...e})}):ee(e)}}}]);
-1
assets/js/74876495.9ad8aafc.js
···11-(self.webpackChunkmy_website=self.webpackChunkmy_website||[]).push([["631"],{2994:function(e,r,o){e.exports={src:Object.assign(Object.create({toString(){return this.src}}),{srcSet:o.p+"assets/ideal-img/sync-resource-file.d733ef4.640.png 640w,"+o.p+"assets/ideal-img/sync-resource-file.cdf1733.739.png 739w",images:[{path:o.p+"assets/ideal-img/sync-resource-file.d733ef4.640.png",width:640,height:793},{path:o.p+"assets/ideal-img/sync-resource-file.cdf1733.739.png",width:739,height:916}],src:o.p+"assets/ideal-img/sync-resource-file.d733ef4.640.png",placeholder:void 0,width:640,height:793}),preSrc:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAMCAYAAABbayygAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABDElEQVR4nG2P226DMBBEeQ7XgC9gm0swEAKFpKRpq1Zqpf7/P01lFyFF6cNod7VHs7MOlxokPSAiCjSrQbIaEZHY+QncgGxy/H1qFzErEOwzeBGHF7I7yDVgGKcILKzgBvTPySePIE0LCFXbwTMK6aadn6w9gxMlAqkyOSvELN+U8MJGChOJIM7ghImAPi4o2wU078HU0YrKDlS2to95ZUCJafnE/PKN+ukDor5A1DN43oOKBkx1K0gkuvGGdrhC6RlpOYKXA5hqV8cVNN82pyvyZgEvR1DV2aWpd6A5fb59YXn/gbanz8gOE3hxenTs5zf00yuK9oKsGm02Az2Aul+g9DN4MYAIDfIP+AtBl50yVJl/EgAAAABJRU5ErkJggg=="}},5124:function(e,r,o){"use strict";o.d(r,{ZP:()=>c,d$:()=>t});var s=o(5893),n=o(65);let t=[];function i(e){let r={a:"a",code:"code",p:"p",pre:"pre",...(0,n.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(o,{children:[(0,s.jsx)("summary",{children:"Console Output Example"}),(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-shell",children:"docker compose up --no-log-prefix\n"})}),(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{children:'INFO : [Init] Debug Mode: NO\nINFO : [App] Version: 0.1.0\nINFO : [App] Files On Server Dir ENV: /filesOnServer -> Resolved: /filesOnServer\nINFO : [App] [Files On Server] Processing Stacks for 2 folders:\n/filesOnServer/immich\n/filesOnServer/plex\n/filesOnServer/uptime-kuma\nINFO : [App] [Files On Server] Compose File Glob: **/{compose,docker-compose}*.y?(a)ml\nINFO : [App] [Files On Server] Env Glob: **/.env\nINFO : [App] [Files On Server] [compose] Found Stack \'compose\' at dir /filesOnServer/compose.yaml\nWARN : [App] [Files On Server] [compose] Did not find any files patterns matching compose glob\nINFO : [App] [Files On Server] [compose] Stack config complete\n\n...\n\nINFO : [App] [Files On Server] Built Stack configs for 3 folders\nINFO : [App] Copy the text between the scissors to use as the *Resource File* contents within your Resource Sync\n\n\u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F\n\n[[stack]]\nname = "immich"\n\n[stack.config]\nserver = "my-cool-server"\nrun_directory = "/home/myUser/homelab/immich"\nfiles_on_host = true\nauto_update = false\npoll_for_updates = false\nfile_paths = [ "docker/docker-compose.yaml" ]\n\n[[stack]]\nname = "plex"\n\n[stack.config]\nserver = "my-cool-server"\nrun_directory = "/home/myUser/homelab/plex"\nfiles_on_host = true\nauto_update = false\npoll_for_updates = false\n\n[[stack]]\nname = "uptime-kuma"\n\n[stack.config]\nserver = "my-cool-server"\nrun_directory = "/home/myUser/homelab/uptime-kuma"\nfiles_on_host = true\nauto_update = false\npoll_for_updates = false\nenv_file_path = ".komodoEnv"\nadditional_env_files = [ ".env" ]\n\u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F \u2702\uFE0F\nINFO : [App] Done!\n'})}),(0,s.jsxs)(r.p,{children:["Copy the text between the scissors and ",(0,s.jsx)(r.a,{href:"../usage/resourceSync/#create-sync-resource",children:"create a new Sync Resource in Komodo"})]})]})}function c(e={}){let{wrapper:r}={...(0,n.a)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},3526:function(e,r,o){"use strict";o.r(r),o.d(r,{frontMatter:()=>W,default:()=>er,toc:()=>Q,metadata:()=>s,assets:()=>J,contentTitle:()=>X});var s=JSON.parse('{"id":"quickstart","title":"Quickstart","description":"Prerequisites","source":"@site/docs/quickstart.mdx","sourceDirName":".","slug":"/quickstart","permalink":"/komodo-import/docs/quickstart","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/quickstart.mdx","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"title":"Quickstart","sidebar_position":1},"sidebar":"tutorialSidebar","next":{"title":"Installation","permalink":"/komodo-import/docs/category/installation"}}'),n=o(5893),t=o(65);o(7057),o(4250);var i=o(7294),c=o(2292),l=o.n(c),a=o(9999),d=o(2575),m=o(461),h=o(5756),p=o(7026),u=o(1183);function x({size:e=null,outline:r=!1,variant:o="primary",block:s=!1,disabled:t=!1,className:i,style:c={},link:l,label:a,onClick:d=()=>null,...m}){let h=e?({sm:"sm",small:"sm",lg:"lg",large:"lg",medium:null})[e]:"",x=h?`button--${h}`:"",j=o?`button--${o}`:"";return(0,n.jsx)(u.Z,{to:t?null:l,children:(0,n.jsx)("button",{className:(0,p.Z)("button",x,r?"button--outline":"",j,s?"button--block":"",t?"disabled":"",i),style:c,role:"button","aria-disabled":t,onClick:e=>{e.preventDefault(),d()},...m,children:a})})}let j={borderRadius:"var(--ifm-button-border-radius) 0 0 var(--ifm-button-border-radius)"},f={borderRadius:"0 var(--ifm-button-border-radius) var(--ifm-button-border-radius) 0"},g={borderRadius:"0"};function y({size:e=null,variant:r="primary",block:o=!1,disabled:s=!1,className:t,style:i,options:c,value:l,defaultValue:a,onChange:d=()=>null}){if(void 0===c||0===c.length)return null;let m=c.map((o,s)=>{let t={style:g,outline:!0,size:e,variant:r,label:o[1],link:"#",onClick:()=>d(o[0])};return 0===s?t.style=j:s===c.length-1&&(t.style=f),(l??a)===o[0]&&(t.outline=!1),(0,n.jsx)(x,{...t},s)});return(0,n.jsx)("span",{children:m})}var v=o(4697);function S(e){let r={code:"code",p:"p",pre:"pre",strong:"strong",...(0,t.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(r.p,{children:["When using ",(0,n.jsx)(r.code,{children:"STACKS_FROM=compose"})," this should be the the most top-level directory that all projects are contained within, at some level."]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Example"}),(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.code,{children:"docker compose ls"})," reveals these projects:"]}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{children:"NAME STATUS CONFIG FILES\nimmich running /home/myUser/homelab/immich/compose.yaml\nplex running /home/myUser/homelab/plex/docker-compose.yaml\nproject1 running /home/myUser/localDev/myProjects/project1/compose.yaml\n"})}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{children:".\n\u2514\u2500\u2500 /home/myUser\n \u251C\u2500\u2500 homeLab\n \u2502 \u251C\u2500\u2500 immich\n \u2502 \u2502 \u2514\u2500\u2500 compose.yaml\n \u2502 \u2514\u2500\u2500 plex\n \u2502 \u251C\u2500\u2500 docker-compose.yaml\n \u2502 \u2514\u2500\u2500 .git\n \u2514\u2500\u2500 localDev\n \u2514\u2500\u2500 myProjects\n \u2514\u2500\u2500 project1\n \u2514\u2500\u2500 compose.yaml\n"})}),(0,n.jsxs)(r.p,{children:["Then ",(0,n.jsx)(r.strong,{children:"Host Directory"})," should be ",(0,n.jsx)(r.code,{children:"/home/myUser"})]})]})]})}function k(e={}){let{wrapper:r}={...(0,t.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(S,{...e})}):S(e)}function b(e){let r={code:"code",p:"p",pre:"pre",strong:"strong",...(0,t.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(r.p,{children:["For ",(0,n.jsx)(r.code,{children:"STACKS_FROM=dir"})," this should be the immediate parent directory containing all your project folders."]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Example"}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{children:".\n\u2514\u2500\u2500 /home/myUser/homelab/\n \u251C\u2500\u2500 immich/\n \u2502 \u2514\u2500\u2500 compose.yaml\n \u251C\u2500\u2500 plex/\n \u2502 \u251C\u2500\u2500 docker-compose.yaml\n \u2502 \u2514\u2500\u2500 .git\n \u2514\u2500\u2500 uptime-kuma/\n \u2514\u2500\u2500 compose.yaml\n"})}),(0,n.jsxs)(r.p,{children:["Then ",(0,n.jsx)(r.strong,{children:"Host Directory"})," should be ",(0,n.jsx)(r.code,{children:"/home/myUser/homelab"})]})]})]})}function O(e={}){let{wrapper:r}={...(0,t.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(b,{...e})}):b(e)}var A=o(5124),w=o(8494),F=o(2994),I=o.n(F);function N(e){let r={a:"a",code:"code",p:"p",pre:"pre",...(0,t.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Komodo Example"}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-shell",children:"docker compose up --no-log-prefix\n"})}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{children:"INFO : [Init] Debug Mode: NO\nINFO : [App] Version: 0.1.0\nINFO : [App] Files On Server Dir ENV: /filesOnServer -> Resolved: /filesOnServer\nINFO : [App] [Files On Server] Processing Stacks for 2 folders:\n/filesOnServer/immich\n/filesOnServer/plex\n/filesOnServer/uptime-kuma\nINFO : [App] [Files On Server] Compose File Glob: **/{compose,docker-compose}*.y?(a)ml\nINFO : [App] [Files On Server] Env Glob: **/.env\nINFO : [App] [Files On Server] [compose] Found Stack 'compose' at dir /filesOnServer/compose.yaml\nWARN : [App] [Files On Server] [compose] Did not find any files patterns matching compose glob\nINFO : [App] [Files On Server] [compose] Stack config complete\n\n...\n\nINFO : [App] [Files On Server] Built Stack configs for 3 folders\nINFO : [App] Copy the text between the scissors to use as the *Resource File* contents within your Resource Sync\n\n...\n\nINFO : [App] [Sync API] Using 'komodo-import' as Sync Name\nVERBOSE: [App] [Sync API] KOMODO_URL: http://192.168.0.101:9120 | Normalized: http://192.168.0.101:9120/\nINFO : [App] [Sync API] Resource Sync created.\nINFO : [App] [Sync API] Resource Sync URL: http://192.168.0.101:9120/resource-syncs/689a41a04ed1b642f3053f57\n"})}),(0,n.jsxs)(r.p,{children:["The ",(0,n.jsx)(r.a,{href:"../usage/resourceSync#verify-sync-changes",children:"Sync Resource"})," is automatically created for you (but not executed!)"]}),(0,n.jsx)(w.Z,{img:I()})]})}function E(e={}){let{wrapper:r}={...(0,t.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(N,{...e})}):N(e)}var R=o(6370),K=o(5070),C=o(122);let _={},P=(e,r,o)=>e in _?_[e]():C.Z.canUseDOM?(_[e]=((e,r,o)=>{let s=[];return()=>{let[n,t]=((e,r,o=!0)=>{let[s,n]=(0,i.useState)(()=>{let s=window.localStorage.getItem(e);if(o)try{return s?JSON.parse(s):r}catch(e){return console.error(e),r}try{let e;if(null===s)return r;if("true"===s)return!0;if("false"===s)return!1;if(e=s,("number"==typeof e||"string"==typeof e&&""!==e.trim())&&!isNaN(e)){if(s.includes("."))return parseFloat(s);return parseInt(s)}return s}catch(e){return console.error(e),r}}),t=(0,i.useCallback)(r=>{n(()=>(o?localStorage.setItem(e,JSON.stringify(r)):localStorage.setItem(e,r),r))},[e]);return(0,i.useEffect)(()=>{let o=o=>{o.storageArea===localStorage&&o.key===e&&n(null===o.newValue?r:o.newValue)};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)}),[s,t]})(e,r,o),c=(0,i.useCallback)(e=>{for(let r of s)r(e)},[]);return(0,i.useEffect)(()=>(s.push(t),()=>{s.splice(s.indexOf(t),1)}),[t]),[n,c]}})(e,r,o),_[e]()):[r,()=>null],D=(0,R.wL)("services:\n komodo-import:\n image: foxxmd/komodo-import:latest\n restart: no\n volumes:\n - ./home/myUser/homelab:/filesOnServer\n environment:\n"),U=(0,R.wL)("socket-proxy:\n image: lscr.io/linuxserver/socket-proxy:latest\n environment:\n - CONTAINERS=1\n - INFO=1\n - POST=0\n - PING=1\n - VERSION=1\n volumes:\n - /var/run/docker.sock:/var/run/docker.sock:ro\n read_only: true\n tmpfs:\n - /run"),T=new RegExp(/(?:^|[\/\\])\.\S/),B=e=>{let[r,o]=P("docusaurus.tab.stacksFrom","dir",!1),[s,t]=P("syncApi",!1),[c,a]=(0,i.useState)(D),[d]=P("hostDirectory",""),[m]=P("serverName",""),[h]=P("komodoUrl",""),[p]=P("komodoApiKey",""),[u]=P("komodoApiSecret","");return(0,i.useEffect)(()=>{let e=D.clone(),o=void 0!==d&&""!==d.trim()?d:"/home/myUser/homelab",n=new R.Ru(`${o}:/filesOnServer`);n.commentBefore=`# ${"dir"===r?"Parent directory where all subfolders are compose projects":"Top-most directory that contains all folders (at any level) that compose projects are found in"}`,e.setIn(["services","komodo-import","volumes",0],n),e.setIn(["services","komodo-import","environment"],new R.wr);let t=e.getIn(["services","komodo-import","environment"]),i=new R.Ru(`HOST_PARENT_PATH=${o}`);if(i.commentBefore="# Same as mounted directory above",t.add(i),T.test(o)){let e=new R.Ru("GLOB_DOT=true");e.commentBefore="# Forces glob to not ignore dot folders",t.add(e)}let c=new R.Ru(`STACKS_FROM=${r}`);c.commentBefore="# Determines what sources to generate Stacks from",c.comment=`# ${"dir"===r?"Generate stacks from subfolders in directory":"Generate stacks from compose projects"}`,t.add(c);let l=new R.Ru(`SERVER_NAME=${void 0!==m&&""!==m.trim()?m:"my-cool-server"}`);if(l.commentBefore="# Name of Server for this machine, in Komodo",t.add(l),s){let e=new R.Ru(`KOMODO_URL=${""===h?"http://192.168.KOMOMDO.IP:8120":h}`);e.spaceBefore=!0,e.commentBefore="# Configuration for interacting with Komodo API",t.add(e),t.add(`API_KEY=${""===p?"K-3A6btIPZYeBu_EXAMPLE_KEY":p}`),t.add(`API_SECRET=${""===u?"S-qnaXD1frutYlfC2ZYl_EXAMPLE_SECRET":u}`);let r=new R.Ru("OUTPUT_API_SYNC=true");r.comment="Create Sync Resource in Komodo",t.add(r)}if("compose"===r){let r=new R.Ru("DOCKER_HOST=tcp://socket-proxy:2375");r.spaceBefore=!0,r.commentBefore="Tells Komodo Import how to connect to Docker",t.add(r);let o=new R.wr;o.add("socket-proxy"),e.setIn(["services","komodo-import","depends_on"],o),e.setIn(["services","socket-proxy"],U.get("socket-proxy")),e.getIn(["services","socket-proxy"]).commentBefore="# used to communicate with docker daemon"}a(e)},[s,r,d,m,p,u,h,a]),(0,n.jsx)(l(),{className:"rr-block .rr-block",title:"compose.yaml",language:"yaml",children:c.toString()})},G=e=>(0,n.jsx)(h.Z,{fallback:({error:e})=>(0,n.jsx)("div",{children:(0,n.jsxs)(d.Z,{type:"danger",children:[(0,n.jsx)("p",{children:"Interactive Quickstart compose.yaml crashed because of error! Sorry."}),(0,n.jsx)(l(),{children:e.stack})]})}),children:(0,n.jsx)(K.default,{children:()=>(0,n.jsx)(B,{...e})})}),L=e=>{let{readOnly:r=!1,stylePreset:o,placeholder:s,storageKey:t,initialValue:c=""}=e,[l,d]=P(t,c),[m,h]=i.useState(l),[p,u]=(0,v.Nr)(m,500);if((0,i.useEffect)(()=>{d(p)},[p,d]),(0,i.useEffect)(()=>{u(l),h(l)},[l,u,h]),r){let e;switch(null!=l&&""!==l.trim()?e=l:""!==c?e=c:void 0!==s&&(e=s),o){case"inline":return(0,n.jsx)(a.Z,{children:e});case"bold":return(0,n.jsx)("strong",{children:e});default:return(0,n.jsx)(i.Fragment,{children:e})}}return(0,n.jsx)("input",{type:"text",placeholder:s,onChange:e=>{h(e.target.value)},value:m})},M=e=>(0,n.jsx)(K.default,{children:()=>(0,n.jsx)(L,{...e})}),Z=e=>{let{placeholder:r="my-cool-server",...o}=e;return(0,n.jsx)(M,{storageKey:"serverName",placeholder:r,...o})},Y=e=>{let{placeholder:r="/home/myUser/homelab",...o}=e;return(0,n.jsx)(M,{storageKey:"hostDirectory",placeholder:r,...o})},V=e=>{let{placeholder:r="http://192.168.0.101:8120",...o}=e;return(0,n.jsx)(M,{storageKey:"komodoUrl",placeholder:r,...o})},q=e=>{let{placeholder:r="K-3A6btIPZYeBuD5ebSa9uD5ebuD5ebHIjYxT5sc",...o}=e;return(0,n.jsx)(M,{storageKey:"komodoApiKey",placeholder:r,...o})},z=e=>{let{placeholder:r="S-qnaXD1frutYlfC2ZYlfCSzqiYlfC1WYlfCVR34Yj4",...o}=e;return(0,n.jsx)(M,{storageKey:"komodoApiSecret",placeholder:r,...o})},H=e=>{let{data:r,name:o,client:s=!1}=e,[t,c]=(0,v.Nr)("",1e3),[l,h]=P("docusaurus.tab.stacksFrom","dir",!1),[p,u]=P("syncApi",!1),j=(0,i.useCallback)(()=>{u(!p)},[p,u]),f=(0,i.useCallback)(e=>{h(e)},[h]);return(0,n.jsxs)(i.Fragment,{children:[(0,n.jsxs)("h3",{children:["1. What ",(0,n.jsx)("a",{href:"../usage/overview#stack-sources",children:"Stack Sources"})," to generate Stacks from?"]}),(0,n.jsx)("p",{children:(0,n.jsx)(y,{options:[["dir","Directory"],["compose","Compose Projects"]],defaultValue:"dir",value:l,variant:"primary",size:"lg",onChange:e=>f(e)})}),(0,n.jsx)("span",{style:{display:"dir"===l?"inherit":"none"},children:(0,n.jsxs)(d.Z,{type:"info",children:["For ",(0,n.jsx)("strong",{children:"Directory"})," (",(0,n.jsx)(a.Z,{children:"STACKS_FROM=dir"}),") Komodo Import will try to generate Stacks from each ",(0,n.jsx)("strong",{children:"subfolder"})," inside the directory mounted into the container."]})}),(0,n.jsx)("span",{style:{display:"compose"===l?"inherit":"none"},children:(0,n.jsxs)(d.Z,{type:"info",children:["For ",(0,n.jsx)("strong",{children:"Compose Projects"})," (",(0,n.jsx)(a.Z,{children:"STACKS_FROM=compose"}),") Komodo Import will try to generate Stacks from existing projects on your machine that were created with ",(0,n.jsx)(a.Z,{children:"docker compose up"})]})}),(0,n.jsx)("h3",{children:"2. Where are your existing projects located on your machine?"}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"hostDir",children:(0,n.jsx)("strong",{children:(0,n.jsx)("a",{href:"../usage/overview#host-directory",children:"Host Directory:"})})}),(0,n.jsx)(Y,{})]}),"compose"===l?(0,n.jsx)(m.Z,{children:(0,n.jsx)(k,{})}):(0,n.jsx)(m.Z,{children:(0,n.jsx)(O,{})}),(0,n.jsx)("h3",{children:"3. What is the name of this Komodo Server?"}),(0,n.jsxs)("p",{children:["Once Komodo Periphery agent was added to this machine you connected it to Komodo as a ",(0,n.jsx)("a",{href:"https://komo.do/docs/resources#server",children:(0,n.jsx)("strong",{children:"Server"})}),". Specify the name you gave it."]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"serverName",children:(0,n.jsx)("strong",{children:"Server Name:"})}),(0,n.jsx)(Z,{})]}),(0,n.jsx)("h3",{children:"4. Where should generated Stacks be created?"}),(0,n.jsxs)("p",{children:["Choose one or more ",(0,n.jsx)("a",{href:"../usage/overview#outputs-1",children:"Outputs"}),":"]}),(0,n.jsxs)("p",{children:[(0,n.jsx)(x,{className:"margin-right--md",label:"Console",link:"#",variant:"primary",disabled:!0}),(0,n.jsx)(x,{label:"Komodo",link:"#",variant:"primary",outline:!p,onClick:j})]}),(0,n.jsxs)("div",{style:{display:p?"inherit":"none"},children:[(0,n.jsxs)("p",{children:["Komodo Import can create a ",(0,n.jsx)("a",{href:"../usage/resourceSync#create-sync-resource",children:"Sync Resource"})," with the generated Stacks in Komodo for you. This method ",(0,n.jsx)("strong",{children:"only"})," creates the Resource, it does not execute or change your existing Stacks."]}),(0,n.jsxs)("p",{children:["Create an ",(0,n.jsx)("a",{href:"../usage/overview#api-sync",children:"API Key and Secret"}),", then specify them below."]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"url",children:(0,n.jsx)("strong",{children:"Komodo URL:"})}),(0,n.jsx)(V,{})]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"apiKey",children:(0,n.jsx)("strong",{children:"Komodo API Key:"})}),(0,n.jsx)(q,{})]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("label",{className:"margin-right--sm",htmlFor:"apiSecret",children:(0,n.jsx)("strong",{children:"Komodo API Secret:"})}),(0,n.jsx)(z,{})]}),(0,n.jsx)(m.Z,{children:(0,n.jsx)(E,{})})]}),(0,n.jsxs)("p",{children:["Generated Stacks are ",(0,n.jsx)("strong",{children:"always"})," output to docker logs as a ",(0,n.jsx)("a",{href:"../usage/resourceSync#create-sync-resource",children:"Sync Resource"}),"."]}),(0,n.jsx)(m.Z,{children:(0,n.jsx)(A.ZP,{})}),(0,n.jsx)("h3",{children:"5. Save your customized Compose file"}),(0,n.jsx)("p",{children:"The file below has been customized for your specific machine! Save this somewhere on the machine:"}),(0,n.jsx)(G,{})]})},$=e=>(0,n.jsx)(h.Z,{fallback:({error:e})=>(0,n.jsx)("div",{children:(0,n.jsxs)(d.Z,{type:"danger",children:[(0,n.jsx)("p",{children:"Interactive Quickstart crashed because of error! Sorry."}),(0,n.jsx)(l(),{children:e.stack})]})}),children:(0,n.jsx)(H,{...e})}),W={title:"Quickstart",sidebar_position:1},X=void 0,J={},Q=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Create Your Scenario",id:"create-your-scenario",level:2},{value:"Generate Stacks",id:"generate-stacks",level:2},{value:"Next Steps",id:"next-steps",level:2}];function ee(e){let r={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.a)(),...e.components},{Details:o}=r;return o||function(e,r){throw Error("Expected "+(r?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"You have Komodo already setup"}),"\n",(0,n.jsxs)(r.li,{children:["You have installed ",(0,n.jsx)(r.a,{href:"https://komo.do/docs/connect-servers",children:"Periphery"})," on a machine","\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:["The Komodo ",(0,n.jsx)(r.a,{href:"https://komo.do/docs/resources#server",children:"Server"})," name is ",(0,n.jsx)(Z,{readOnly:!0,stylePreset:"inline"})]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(r.h2,{id:"create-your-scenario",children:"Create Your Scenario"}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Follow the directions below, select your options, and fill in all fields to generate a customized Docker Compose file for your specific scenario."})}),"\n",(0,n.jsx)($,{}),"\n",(0,n.jsx)(r.h2,{id:"generate-stacks",children:"Generate Stacks"}),"\n",(0,n.jsxs)(r.p,{children:["Run the customized ",(0,n.jsx)(r.code,{children:"compose.yaml"})," from above with ",(0,n.jsx)(r.code,{children:"docker compose"})," to generate Komodo Stacks from existing projects on your machine!"]}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"# in the same directory as compose.yaml...\ndocker compose up --no-log-prefix\n"})}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Show Only Sync Resource Contents"}),(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.strong,{children:"Console"})," output too long? Run Komodo Import again with this command to output only the ",(0,n.jsx)(r.a,{href:"../usage/resourceSync",children:"Sync Resource"})," content:"]}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"docker compose up --no-log-prefix | grep -Pzo '(?s)\u2702\uFE0F\\n\\K(.+)(?=\\n\u2702)' && echo\n"})})]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsx)("summary",{children:"Copy to Clipboard"}),(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.strong,{children:"Console"})," output too long to copy? Run Komodo Import again with this command to copy the ",(0,n.jsx)(r.a,{href:"../usage/resourceSync",children:"Sync Resource"})," content directly to clipboard with ",(0,n.jsx)(r.code,{children:"xclip"}),":"]}),(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"docker compose up --no-log-prefix | grep -Pzo '(?s)\u2702\uFE0F\\n\\K(.+)(?=\\n\u2702)' | xclip -selection c\n"})})]}),"\n",(0,n.jsxs)(r.p,{children:["How the Stacks will be generated is determined by what you chose in ",(0,n.jsx)(r.strong,{children:"Step 4"}),". Refer to the expandable ",(0,n.jsx)(r.strong,{children:"Examples"})," in that step."]}),"\n",(0,n.jsx)(r.h2,{id:"next-steps",children:"Next Steps"}),"\n",(0,n.jsxs)(r.p,{children:["There are many more options (environmental variables) that can be used to customize how Stacks are generated, all found in ",(0,n.jsx)(r.a,{href:"../usage/overview#stacks",children:"Usage"})," docs. Some customizations that might interest you:"]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.a,{href:"../usage/overview#stack-configuration",children:"Common Stack options"}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"Set image registry provider/account"}),"\n",(0,n.jsxs)(r.li,{children:["Set defaults for polling for new images (",(0,n.jsx)(r.code,{children:"POLL_FOR_UPDATE"}),") and auto updating (",(0,n.jsx)(r.code,{children:"AUTO_UPDATE"}),")"]}),"\n",(0,n.jsxs)(r.li,{children:["Set what compose files (",(0,n.jsx)(r.code,{children:"COMPOSE_FILE_GLOB"}),") and .env files (",(0,n.jsx)(r.code,{children:"ENV_FILE_GLOB"}),") to include, per Stack"]}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(r.li,{children:["For ",(0,n.jsx)(r.strong,{children:"Directory"})," generated stacks...","\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:["Include (",(0,n.jsx)(r.code,{children:"FOLDER_GLOB"}),") or exclude (",(0,n.jsx)(r.code,{children:"FOLDER_IGNORE_GLOB"}),") folders based on patterns"]}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(r.li,{children:["Configure Komodo Import to use the ",(0,n.jsx)(r.a,{href:"../usage/overview#komodo-api",children:"Komodo API"})," for better integration","\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"Uses existing Linked Repos for Git Based Stacks"}),"\n",(0,n.jsx)(r.li,{children:"Automatically configures Git Based Stacks to use existing, private Git Provider if git URL domains match"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(r.p,{children:["Additionally, review the ",(0,n.jsx)(r.a,{href:"../usage/resourceSync",children:"Sync Resource"})," guide to learn how to use them for creating Stacks in Komodo."]})]})}function er(e={}){let{wrapper:r}={...(0,t.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(ee,{...e})}):ee(e)}}}]);