diff --git a/404.html b/404.html index 54224059..0889beac 100644 --- a/404.html +++ b/404.html @@ -10,7 +10,7 @@ - +
diff --git a/assets/js/5396078f.c4a1e82e.js b/assets/js/5396078f.c4a1e82e.js new file mode 100644 index 00000000..b0549fd4 --- /dev/null +++ b/assets/js/5396078f.c4a1e82e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4863],{31181:(e,n,o)=>{o.d(n,{Ay:()=>c,RM:()=>t});var i=o(74848),r=o(28453);const t=[{value:"Docker Instance",id:"docker-instance",level:2},{value:"Create the Docker Compose Project",id:"create-the-docker-compose-project",level:3},{value:"YOLO",id:"yolo",level:4},{value:"I'll Do it Myself",id:"ill-do-it-myself",level:4},{value:"Basic Configuration (No TLS, Localhost Only)",id:"basic-configuration-no-tls-localhost-only",level:3},{value:"DNS Configuration (Optional for localhost-only setup)",id:"dns-configuration-optional-for-localhost-only-setup",level:4},{value:"Configure the Docker Compose Project Environment",id:"configure-the-docker-compose-project-environment",level:4},{value:"Start the Docker Compose Project",id:"start-the-docker-compose-project",level:4},{value:"Expanded Configuration with TLS (Caddy or Traefik)",id:"expanded-configuration-with-tls-caddy-or-traefik",level:3},{value:"DNS Configuration for TLS",id:"dns-configuration-for-tls",level:4},{value:"Configure the Docker Compose File",id:"configure-the-docker-compose-file",level:4},{value:"Caddy Configuration",id:"caddy-configuration",level:4},{value:"Traefik Configuration",id:"traefik-configuration",level:4},{value:"Start the Docker Compose Project",id:"start-the-docker-compose-project-1",level:4},{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:"Additional Configuration Options",id:"additional-configuration-options",level:3},{value:"\u26a0\ufe0f OAuth Configuration Note",id:"\ufe0f-oauth-configuration-note",level:4},{value:"Troubleshooting",id:"troubleshooting",level:3}];function s(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.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 supported by a OpenZiti controller and router. It supports flexible deployment configurations:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Basic Configuration"}),": Services exposed on localhost only (no TLS)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"With Caddy"}),": Services published using Caddy (TLS)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"With Traefik"}),": Services published using Traefik (TLS)"]}),"\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:"yolo",children:"YOLO"}),"\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:"ill-do-it-myself",children:"I'll Do it Myself"}),"\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:"basic-configuration-no-tls-localhost-only",children:"Basic Configuration (No TLS, Localhost Only)"}),"\n",(0,i.jsx)(n.p,{children:"This is the simplest way to get started with zrok, exposing services on localhost only, without TLS."}),"\n",(0,i.jsx)(n.h4,{id:"dns-configuration-optional-for-localhost-only-setup",children:"DNS Configuration (Optional for localhost-only setup)"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["If you plan to use this beyond localhost, set up a wildcard record for the IP address where the zrok instance will run\n(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:"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 with the minimal required configuration:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title=".env minimal configuration"',children:"# Required settings\nZROK_DNS_ZONE=share.example.com\nZROK_USER_EMAIL=me@example.com\nZROK_USER_PWD=zrokuserpw\nZITI_PWD=zitiadminpw\nZROK_ADMIN_TOKEN=zroktoken\n\n# Expose services only on localhost (default)\nZROK_INSECURE_INTERFACE=127.0.0.1\n\n# Service ports\nZROK_CTRL_PORT=18080\nZROK_FRONTEND_PORT=8080\nZROK_OAUTH_PORT=8081\nZITI_CTRL_ADVERTISED_PORT=80\nZITI_ROUTER_PORT=3022\n"})}),"\n",(0,i.jsx)(n.h4,{id:"start-the-docker-compose-project",children:"Start the Docker Compose Project"}),"\n",(0,i.jsx)(n.p,{children:"Start the zrok instance:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker compose up --build --detach\n"})}),"\n",(0,i.jsx)(n.h3,{id:"expanded-configuration-with-tls-caddy-or-traefik",children:"Expanded Configuration with TLS (Caddy or Traefik)"}),"\n",(0,i.jsx)(n.p,{children:"For production deployments, you should use TLS. You can choose between Caddy or Traefik for TLS termination and reverse proxy to the zrok services. The ziti services are always published directly, not proxied, and they bring their own TLS."}),"\n",(0,i.jsx)(n.h4,{id:"dns-configuration-for-tls",children:"DNS Configuration for TLS"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Ensure a wildcard record exists for the IP address where the zrok instance will run\n(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.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Choose a DNS provider that supports automatic DNS challenge for obtaining wildcard certificates and for which a plugin is available in Caddy or Traefik."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h4,{id:"configure-the-docker-compose-file",children:"Configure the Docker Compose File"}),"\n",(0,i.jsxs)(n.p,{children:["Add this setting to your ",(0,i.jsx)(n.code,{children:".env"})," file to select which TLS provider to use:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"# Use one of the following:\nCOMPOSE_FILE=compose.yml:compose.caddy.yml # For Caddy\n# OR\nCOMPOSE_FILE=compose.yml:compose.traefik.yml # For Traefik\n"})}),"\n",(0,i.jsx)(n.h4,{id:"caddy-configuration",children:"Caddy Configuration"}),"\n",(0,i.jsxs)(n.p,{children:["If using Caddy, add these settings to your ",(0,i.jsx)(n.code,{children:".env"})," file:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title=".env for Caddy"',children:"# Caddy TLS configuration\nCADDY_DNS_PLUGIN=cloudflare # Plugin name for your DNS provider (see github.com/caddy-dns)\nCADDY_DNS_PLUGIN_TOKEN=abcd1234 # API token from your DNS provider\nCADDY_ACME_API=https://acme-v02.api.letsencrypt.org/directory # ACME API endpoint\nCADDY_HTTPS_PORT=443 # HTTPS port (optional, defaults to 443)\nCADDY_INTERFACE=0.0.0.0 # Interface to bind to (optional, defaults to all interfaces)\n\n# For AWS Route53, uncomment and set these instead of CADDY_DNS_PLUGIN_TOKEN:\n# AWS_ACCESS_KEY_ID=your-access-key\n# AWS_SECRET_ACCESS_KEY=your-secret-key\n# AWS_REGION=your-region\n# AWS_SESSION_TOKEN=your-session-token # Only if using temporary credentials\n"})}),"\n",(0,i.jsx)(n.h4,{id:"traefik-configuration",children:"Traefik Configuration"}),"\n",(0,i.jsxs)(n.p,{children:["If using Traefik, add these settings to your ",(0,i.jsx)(n.code,{children:".env"})," file:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",metastring:'title=".env for Traefik"',children:"# Traefik TLS configuration\nTRAEFIK_DNS_PROVIDER=digitalocean # DNS provider for Traefik\nTRAEFIK_DNS_PROVIDER_TOKEN=abcd1234 # API token from your DNS provider\nTRAEFIK_ACME_API=https://acme-v02.api.letsencrypt.org/directory # ACME API endpoint\nTRAEFIK_HTTPS_PORT=443 # HTTPS port (optional, defaults to 443)\nTRAEFIK_INTERFACE=0.0.0.0 # Interface to bind to (optional, defaults to all interfaces)\n\n# For AWS Route53, uncomment and set these instead of TRAEFIK_DNS_PROVIDER_TOKEN:\n# AWS_ACCESS_KEY_ID=your-access-key\n# AWS_SECRET_ACCESS_KEY=your-secret-key\n# AWS_REGION=your-region\n# AWS_SESSION_TOKEN=your-session-token # Only if using temporary credentials\n"})}),"\n",(0,i.jsx)(n.h4,{id:"start-the-docker-compose-project-1",children:"Start the Docker Compose Project"}),"\n",(0,i.jsx)(n.p,{children:"Start the zrok instance with TLS support:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"docker compose up --build --detach\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."]}),"\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 accountYou can add these additional settings to your .env
file for more customization:
# OAuth configuration for public shares
ZROK_OAUTH_HASH_KEY=oauthhashkeysecret
ZROK_OAUTH_GITHUB_CLIENT_ID=abcd1234
ZROK_OAUTH_GITHUB_CLIENT_SECRET=abcd1234
ZROK_OAUTH_GOOGLE_CLIENT_ID=abcd1234
ZROK_OAUTH_GOOGLE_CLIENT_SECRET=abcd1234
If you are NOT using OAuth for public shares, remove the entire OAuth section from zrok-frontend-config.yml.envsubst
to avoid configuration errors:
# Remove this entire section if not using OAuth
oauth:
bind_address: 0.0.0.0:${ZROK_OAUTH_PORT}
endpoint_url: https://oauth.${ZROK_DNS_ZONE}
cookie_name: zrok-auth-session
cookie_domain: ${ZROK_DNS_ZONE}
session_lifetime: 6h
intermediate_lifetime: 5m
signing_key: ${ZROK_OAUTH_HASH_KEY}
encryption_key: ${ZROK_OAUTH_HASH_KEY}
providers:
- name: github
type: github
client_id: ${ZROK_OAUTH_GITHUB_CLIENT_ID}
client_secret: ${ZROK_OAUTH_GITHUB_CLIENT_SECRET}
- name: google
type: google
client_id: ${ZROK_OAUTH_GOOGLE_CLIENT_ID}
client_secret: ${ZROK_OAUTH_GOOGLE_CLIENT_SECRET}
Then rebuild: docker compose up -d --build zrok-frontend
You can add these additional settings to your .env
file for more customization:
# OAuth configuration for public shares
ZROK_OAUTH_HASH_KEY=oauthhashkeysecret
ZROK_OAUTH_GITHUB_CLIENT_ID=abcd1234
ZROK_OAUTH_GITHUB_CLIENT_SECRET=abcd1234
ZROK_OAUTH_GOOGLE_CLIENT_ID=abcd1234
ZROK_OAUTH_GOOGLE_CLIENT_SECRET=abcd1234
If you are NOT using OAuth for public shares, remove the entire OAuth section from zrok-frontend-config.yml.envsubst
to avoid configuration errors:
# Remove this entire section if not using OAuth
oauth:
bind_address: 0.0.0.0:${ZROK_OAUTH_PORT}
endpoint_url: https://oauth.${ZROK_DNS_ZONE}
cookie_name: zrok-auth-session
cookie_domain: ${ZROK_DNS_ZONE}
session_lifetime: 6h
intermediate_lifetime: 5m
signing_key: ${ZROK_OAUTH_HASH_KEY}
encryption_key: ${ZROK_OAUTH_HASH_KEY}
providers:
- name: github
type: github
client_id: ${ZROK_OAUTH_GITHUB_CLIENT_ID}
client_secret: ${ZROK_OAUTH_GITHUB_CLIENT_SECRET}
- name: google
type: google
client_id: ${ZROK_OAUTH_GOOGLE_CLIENT_ID}
client_secret: ${ZROK_OAUTH_GOOGLE_CLIENT_SECRET}
Then rebuild: docker compose up -d --build zrok-frontend
You can add these additional settings to your .env
file for more customization:
# OAuth configuration for public shares
ZROK_OAUTH_HASH_KEY=oauthhashkeysecret
ZROK_OAUTH_GITHUB_CLIENT_ID=abcd1234
ZROK_OAUTH_GITHUB_CLIENT_SECRET=abcd1234
ZROK_OAUTH_GOOGLE_CLIENT_ID=abcd1234
ZROK_OAUTH_GOOGLE_CLIENT_SECRET=abcd1234
If you are NOT using OAuth for public shares, remove the entire OAuth section from zrok-frontend-config.yml.envsubst
to avoid configuration errors:
# Remove this entire section if not using OAuth
oauth:
bind_address: 0.0.0.0:${ZROK_OAUTH_PORT}
endpoint_url: https://oauth.${ZROK_DNS_ZONE}
cookie_name: zrok-auth-session
cookie_domain: ${ZROK_DNS_ZONE}
session_lifetime: 6h
intermediate_lifetime: 5m
signing_key: ${ZROK_OAUTH_HASH_KEY}
encryption_key: ${ZROK_OAUTH_HASH_KEY}
providers:
- name: github
type: github
client_id: ${ZROK_OAUTH_GITHUB_CLIENT_ID}
client_secret: ${ZROK_OAUTH_GITHUB_CLIENT_SECRET}
- name: google
type: google
client_id: ${ZROK_OAUTH_GOOGLE_CLIENT_ID}
client_secret: ${ZROK_OAUTH_GOOGLE_CLIENT_SECRET}
Then rebuild: docker compose up -d --build zrok-frontend