mirror of
https://github.com/openziti/zrok.git
synced 2025-02-07 13:59:47 +01:00
1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3423],{8347:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>d,default:()=>p,frontMatter:()=>a,metadata:()=>o,toc:()=>h});const o=JSON.parse('{"id":"guides/self-hosting/docker","title":"Self-hosting guide for Docker","description":"","source":"@site/../docs/guides/self-hosting/docker.mdx","sourceDirName":"guides/self-hosting","slug":"/guides/self-hosting/docker","permalink":"/docs/guides/self-hosting/docker","draft":false,"unlisted":false,"editUrl":"https://github.com/openziti/zrok/blob/main/docs/../docs/guides/self-hosting/docker.mdx","tags":[],"version":"current","sidebarPosition":45,"frontMatter":{"title":"Self-hosting guide for Docker","sidebar_label":"Docker","sidebar_position":45},"sidebar":"tutorialSidebar","previous":{"title":"Personalized Frontend","permalink":"/docs/guides/self-hosting/personalized-frontend"},"next":{"title":"Kubernetes","permalink":"/docs/guides/self-hosting/kubernetes"}}');var i=r(4848),t=r(8453);function s(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"docker-instance",children:"Docker Instance"}),"\n",(0,i.jsx)("iframe",{width:"100%",height:"315",src:"https://www.youtube.com/embed/70zJ_h4uiD8",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:!0}),"\n",(0,i.jsx)(n.p,{children:"This Docker Compose project creates a zrok instance and includes a ziti controller and router. An optional Caddy container is included to provide HTTPS and reverse proxy services for the zrok API and public shares."}),"\n",(0,i.jsx)(n.h3,{id:"dns-configuration",children:"DNS Configuration"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["A wildcard record exists for the IP address where the zrok instance will run, e.g. if your DNS zone is ",(0,i.jsx)(n.code,{children:"share.example.com"}),", then your wildcard record is ",(0,i.jsx)(n.code,{children:"*.share.example.com"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"additional-dns-configuration-for-caddy-tls",children:"Additional DNS Configuration for Caddy TLS"}),"\n",(0,i.jsxs)(n.p,{children:["The included Caddy container can automatically manage a wildcard certificate for your zrok instance. You can enable Caddy in this compose project by renaming ",(0,i.jsx)(n.code,{children:"compose.caddy.yml"})," as ",(0,i.jsx)(n.code,{children:"compose.override.yml"}),"."]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Ensure A Caddy DNS plugin is available for your DNS provider (see ",(0,i.jsx)(n.a,{href:"https://github.com/orgs/caddy-dns/repositories?type=all&q=sort%3Aname-asc",children:"github.com/caddy-dns"}),")."]}),"\n",(0,i.jsxs)(n.li,{children:["Designate A DNS zone for zrok, e.g. ",(0,i.jsx)(n.code,{children:"example.com"})," or ",(0,i.jsx)(n.code,{children:"share.example.com"})," and create the zone on your DNS provider's platform."]}),"\n",(0,i.jsx)(n.li,{children:"Created an API token in your DNS provider that has permission to manage zrok's DNS zone."}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"create-the-docker-compose-project",children:"Create the Docker Compose Project"}),"\n",(0,i.jsx)(n.p,{children:"Create a working directory on your Docker host and save these Docker Compose project files."}),"\n",(0,i.jsx)(n.h4,{id:"shortcut-option",children:"Shortcut Option"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Run this script to download the files in the current directory."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"curl https://get.openziti.io/zrok-instance/fetch.bash | bash\n"})}),"\n",(0,i.jsx)(n.p,{children:"Or, specify the Compose project directory."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"curl https://get.openziti.io/zrok-instance/fetch.bash | bash -s /path/to/compose/project/dir\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"manual-option",children:"Manual Option"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Get the zrok repo ZIP file."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"wget https://github.com/openziti/zrok/archive/refs/heads/main.zip\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Unzip the zrok-instance files into the project directory."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"unzip -j -d . main.zip '*/docker/compose/zrok-instance/*'\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"configure-the-docker-compose-project-environment",children:"Configure the Docker Compose Project Environment"}),"\n",(0,i.jsxs)(n.p,{children:["Create an ",(0,i.jsx)(n.code,{children:".env"})," file in the working directory."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title=".env required"',children:"ZROK_DNS_ZONE=share.example.com\n\nZROK_USER_EMAIL=me@example.com\nZROK_USER_PWD=zrokuserpw\n\nZITI_PWD=zitiadminpw\nZROK_ADMIN_TOKEN=zroktoken\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title=".env options"',children:"# Caddy TLS option: rename compose.caddy.yml to compose.override.yml and set these vars; allow 80,443 in firewall\n\n#\n## set these in .env for providers other than Route53\n#\n# plugin name for your DNS provider\nCADDY_DNS_PLUGIN=cloudflare\n# API token from your DNS provider\nCADDY_DNS_PLUGIN_TOKEN=abcd1234\n# use the staging API until you're sure everything is working to avoid hitting the rate limit\nCADDY_ACME_API=https://acme-staging-v02.api.letsencrypt.org/directory\n\n#\n## set these in .env for Route53\n#\n# AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}\n# AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}\n# AWS_REGION: ${AWS_REGION}\n# AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN} # if temporary credential, e.g., from STS\n\n#\n## if not using Caddy for TLS, uncomment to publish the insecure ports to the internet\n#\n#ZROK_INSECURE_INTERFACE=0.0.0.0\n\n# these insecure ports must be proxied with TLS for security\nZROK_CTRL_PORT=18080\nZROK_FRONTEND_PORT=8080\nZROK_OAUTH_PORT=8081\n\n# these secure ziti ports must be published to the internet\nZITI_CTRL_ADVERTISED_PORT=80\nZITI_ROUTER_PORT=3022\n\n# optionally configure oauth for public shares\n#ZROK_OAUTH_HASH_KEY=oauthhashkeysecret\n#ZROK_OAUTH_GITHUB_CLIENT_ID=abcd1234\n#ZROK_OAUTH_GITHUB_CLIENT_SECRET=abcd1234\n#ZROK_OAUTH_GOOGLE_CLIENT_ID=abcd1234\n#ZROK_OAUTH_GOOGLE_CLIENT_SECRET=abcd1234\n\n# zrok version, e.g., 1.0.0\nZROK_CLI_TAG=latest\n# ziti version, e.g., 1.0.0\nZITI_CLI_TAG=latest\n"})}),"\n",(0,i.jsx)(n.h3,{id:"start-the-docker-compose-project",children:"Start the Docker Compose Project"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Start the zrok instance."}),"\n",(0,i.jsxs)(n.p,{children:["The container images for zrok (including caddy) are built in this step. This provides a simple configuration to get started. You can modify the templates named like ",(0,i.jsx)(n.code,{children:"*.envsubst"})," or mount a customized configuration file to mask the one that was built in."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker compose up --build --detach\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"set-up-a-user-account",children:"Set up a User Account"}),"\n",(0,i.jsxs)(n.p,{children:["This step creates a user account. You will log in to the zrok web console with the account password created in this step. The ZROK_USER_EMAIL and ZROK_USER_PWD variables are set in the ",(0,i.jsx)(n.code,{children:".env"})," file. You can create more user accounts the same way by substituting a different email and password."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Create the first user account"',children:"docker compose exec zrok-controller bash -xc 'zrok admin create account ${ZROK_USER_EMAIL} ${ZROK_USER_PWD}'\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-buttonless",metastring:'title="Example output"',children:"+ zrok admin create account me@example.com zrokuserpw\n[ 0.000] INFO zrok/controller/store.Open: database connected\n[ 0.002] INFO zrok/controller/store.(*Store).migrate: applied 0 migrations\nheMqncCyxZcx\n"})}),"\n",(0,i.jsx)(n.p,{children:"Create additional users by running the command again with a different email and password."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title="Create another user"',children:"docker compose exec zrok-controller zrok admin create account <email> <password>\n"})}),"\n",(0,i.jsx)(n.h3,{id:"enable-the-user-environment",children:"Enable the User Environment"}),"\n",(0,i.jsx)(n.p,{children:"You must enable each device environment with the account token obtained when the account was created. This is separate from the account password that's used to log in to the web console."}),"\n",(0,i.jsxs)(n.p,{children:["Follow ",(0,i.jsx)(n.a,{href:"/docs/getting-started#installing-the-zrok-command",children:"the getting started guide"})," to install the zrok CLI on some device and enable a zrok environment."]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Configure the environment with the zrok API. Substitute the API endpoint with the one you're using, e.g. ",(0,i.jsx)(n.code,{children:"https://zrok.${ZROK_DNS_ZONE}"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"zrok config set apiEndpoint https://zrok.share.example.com\n"})}),"\n",(0,i.jsx)(n.p,{children:"or, if not using Caddy for TLS:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"zrok config set apiEndpoint http://zrok.share.example.com:18080\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Enable an environment on this device with the account token from the previous step."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"zrok enable heMqncCyxZcx\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"firewall-configuration",children:"Firewall Configuration"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"ziti-quickstart"})," and ",(0,i.jsx)(n.code,{children:"caddy"})," containers publish ports to all devices that use zrok shares. The ",(0,i.jsx)(n.code,{children:"zrok-controller"})," and ",(0,i.jsx)(n.code,{children:"zrok-frontend"})," containers expose ports only to the ",(0,i.jsx)(n.code,{children:"caddy"})," container and the Docker host's loopback interface."]}),"\n",(0,i.jsx)(n.h4,{id:"required",children:"Required"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"443/tcp"})," - reverse proxy handles HTTPS requests for zrok API, OAuth, and public shares (published by container ",(0,i.jsx)(n.code,{children:"caddy"}),")"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"80/tcp"})," - ziti ctrl plane (published by container ",(0,i.jsx)(n.code,{children:"ziti-quickstart"}),")"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"3022/tcp"})," - ziti data plane (published by container ",(0,i.jsx)(n.code,{children:"ziti-quickstart"}),")"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:'See "My internet connection can only send traffic to common ports" below about changing the required ports.'}),"\n",(0,i.jsx)(n.h3,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Check the ziti and zrok logs."}),"\n",(0,i.jsxs)(n.p,{children:["You can substitute the service container name of each to check their logs individually: ",(0,i.jsx)(n.code,{children:"ziti-quickstart"}),", ",(0,i.jsx)(n.code,{children:"zrok-controller"}),", ",(0,i.jsx)(n.code,{children:"zrok-frontend"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker compose logs zrok-controller\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Check the Caddy logs."}),"\n",(0,i.jsxs)(n.p,{children:["It can take a few minutes for Caddy to obtain the wildcard certificate. You can check the logs to see if there were any errors completing the DNS challenge which involves using the Caddy DNS plugin to create a TXT record in your DNS zone. This leverages the API token you provided in the ",(0,i.jsx)(n.code,{children:".env"})," file, which must have permission to create DNS records in the zrok DNS zone."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker compose logs caddy\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Caddy keeps failing to obtain a wildcard certificate because it timed out waiting for DNS."}),"\n",(0,i.jsx)(n.p,{children:"Symptom: the Caddy log contains \"timed out waiting for record to fully propagate.\" This means that Caddy added a DNS record with your DNS provider's API to prove to the CA it controls the zrok DNS zone, but it wasn't able to verify the record was created successfully with a DNS query."}),"\n",(0,i.jsx)(n.p,{children:"Solutions:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Add ",(0,i.jsx)(n.code,{children:"propagation_delay"})," in your ",(0,i.jsx)(n.code,{children:"Caddyfile"})," to delay the first DNS verification query. This avoids caching a verification query failure by waiting a few minutes for the record to become available so the verification query will succeed on the first attempt. Caddy will be unable to verify the DNS record if the failure remains in the cache too long."]}),"\n",(0,i.jsxs)(n.li,{children:["If the prior solution fails, you can override the default resolves/nameservers with ",(0,i.jsx)(n.code,{children:"resolvers"}),", a space-separated list of DNS servers. This gives you more control over if and where the verification query result is cached."]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"tls {\n dns {CADDY_DNS_PLUGIN} {CADDY_DNS_PLUGIN_TOKEN}\n\tpropagation_timeout 60m # default 2m\n propagation_delay 5m # default 0m\n}\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"zrok enable"})," fails certificate verification: ensure you are not using the staging API for Let's Encrypt."]}),"\n",(0,i.jsxs)(n.p,{children:["If you are using the staging API, you will see an error about the API certificate when you use the zrok CLI. You can switch to the production API by removing the overriding assignment of the ",(0,i.jsx)(n.code,{children:"CADDY_ACME_API"})," variable."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-buttonless",metastring:'title="Example output"',children:'there was a problem enabling your environment!\nyou are trying to use the zrok service at: https://zrok.share.example.com\nyou can change your zrok service endpoint using this command:\n\n$ zrok config set apiEndpoint <newEndpoint>\n\n(where newEndpoint is something like: https://some.zrok.io)\n[ERROR]: error creating service client (error getting version from api endpoint \'https://zrok.share.example.com\': Get "https://zrok.share.example.com/api/v1/version": tls: failed to verify certificate: x509: certificate signed by unknown authority: Get "https://zrok.share.example.com/api/v1/version": tls: failed to verify certificate: x509: certificate signed by unknown authority)\n'})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Validate the Caddyfile."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker compose exec caddy caddy validate --config /etc/caddy/Caddyfile\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Verify the correct DNS provider module was built-in to Caddy."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker compose exec caddy caddy list-modules | grep dns.providers\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-buttonless",metastring:'title="Example output"',children:"dns.providers.cloudflare\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use the Caddy admin API."}),"\n",(0,i.jsxs)(n.p,{children:["You can use the Caddy admin API to check the status of the Caddy instance. The admin API is available on port ",(0,i.jsx)(n.code,{children:"2019/tcp"})," inside the Docker Compose project. You can modify ",(0,i.jsx)(n.code,{children:"compose.override.yml"})," to publish the port if you want to access the admin API from the Docker host or elsewhere."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker compose exec caddy curl http://localhost:2019/config/ | jq\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"My DNS provider credential is composed of several values, not a single API token."}),"\n",(0,i.jsxs)(n.p,{children:["As long as your DNS provider is supported by Caddy then it will work. Here's a checklist for DNS providers like Route53 with credentials expressed as multiple values, e.g., ",(0,i.jsx)(n.code,{children:"AWS_ACCESS_KEY_ID"}),", ",(0,i.jsx)(n.code,{children:"AWS_SECRET_ACCESS_KEY"}),"."]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Define env vars in ",(0,i.jsx)(n.code,{children:".env"})," file."]}),"\n",(0,i.jsxs)(n.li,{children:["Declare env vars in ",(0,i.jsx)(n.code,{children:"compose.override.yml"})," file on ",(0,i.jsx)(n.code,{children:"caddy"}),"'s ",(0,i.jsx)(n.code,{children:"environment"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Modify ",(0,i.jsx)(n.code,{children:"Caddyfile"})," according to the DNS plugin author's instructions (",(0,i.jsx)(n.a,{href:"https://github.com/caddy-dns/route53",children:"link to Route53 README"}),"). This means modifying the ",(0,i.jsx)(n.code,{children:"Caddyfile"})," to reference the env vars. The provided file ",(0,i.jsx)(n.code,{children:"route53.Caddyfile"})," serves as an example."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"My internet connection can only send traffic to common ports like 80, 443, and 3389."}),"\n",(0,i.jsxs)(n.p,{children:["You can change the required ports in the ",(0,i.jsx)(n.code,{children:".env"})," file. Caddy will still use port 443 for zrok shares and API if you renamed ",(0,i.jsx)(n.code,{children:"compose.caddy.yml"})," as ",(0,i.jsx)(n.code,{children:"compose.override.yml"})," to enable Caddy."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title=".env"',children:"ZITI_CTRL_ADVERTISED_PORT=80\nZITI_ROUTER_PORT=3389\n"})}),"\n"]}),"\n"]})]})}function c(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(s,{...e})}):s(e)}const a={title:"Self-hosting guide for Docker",sidebar_label:"Docker",sidebar_position:45},d=void 0,l={},h=[{value:"Docker Instance",id:"docker-instance",level:2},{value:"DNS Configuration",id:"dns-configuration",level:3},{value:"Additional DNS Configuration for Caddy TLS",id:"additional-dns-configuration-for-caddy-tls",level:4},{value:"Create the Docker Compose Project",id:"create-the-docker-compose-project",level:3},{value:"Shortcut Option",id:"shortcut-option",level:4},{value:"Manual Option",id:"manual-option",level:4},{value:"Configure the Docker Compose Project Environment",id:"configure-the-docker-compose-project-environment",level:3},{value:"Start the Docker Compose Project",id:"start-the-docker-compose-project",level:3},{value:"Set up a User Account",id:"set-up-a-user-account",level:3},{value:"Enable the User Environment",id:"enable-the-user-environment",level:3},{value:"Firewall Configuration",id:"firewall-configuration",level:3},{value:"Required",id:"required",level:4},{value:"Troubleshooting",id:"troubleshooting",level:3}];function u(e){return(0,i.jsx)(c,{})}function p(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u()}},8453:(e,n,r)=>{r.d(n,{R:()=>s,x:()=>c});var o=r(6540);const i={},t=o.createContext(i);function s(e){const n=o.useContext(t);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(t.Provider,{value:n},e.children)}}}]); |