diff --git a/docker/compose/zrok-public-reserved/compose.yml b/docker/compose/zrok-public-reserved/compose.yml index 85c50a65..0af7a051 100644 --- a/docker/compose/zrok-public-reserved/compose.yml +++ b/docker/compose/zrok-public-reserved/compose.yml @@ -126,6 +126,7 @@ services: # start share on reserved public frontend url zrok-share: image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok} + restart: unless-stopped entrypoint: - bash - -euc diff --git a/docs/guides/docker-share/_reserved_public_share.mdx b/docs/guides/docker-share/_reserved_public_share.mdx index 726941ba..34905f8f 100644 --- a/docs/guides/docker-share/_reserved_public_share.mdx +++ b/docs/guides/docker-share/_reserved_public_share.mdx @@ -1,7 +1,22 @@ +## Goal -1. Make a folder on your computer to use as a Docker Compose project for your zrok public share with a reserved subdomain. -1. In your terminal, go to the newly-created project folder. -1. Download [the reserved public share project file](pathname:///zrok-public-reserved/compose.yml) into the project folder. +Proxy a reserved public subdomain to a backend target with Docker. + +## How it Works + +The Docker Compose project uses your zrok account token to reserve a public subdomain and keep sharing the backend +target. + +When the project runs it will: + +1. enable a zrok environment unless `/mnt/.zrok/environment.json` exists in the `zrok_env` volume +1. reserve a public subdomain for the service unless `/mnt/.zrok/reserved.json` exists +1. start sharing the target specified in the `.env` configuration file + +## Create the Docker Project + +1. Make a folder on your computer to use as a Docker Compose project for your zrok public share with a reserved subdomain and switch to the new directory in your terminal. +1. Download [the reserved public share `compose.yml` project file](pathname:///zrok-public-reserved/compose.yml) into the same directory. 1. Copy your zrok account's enable token from the zrok web console to your clipboard and paste it in a file named `.env` in the same folder like this: ```bash title=".env" @@ -14,7 +29,7 @@ docker compose up --detach ``` -1. Get the public share URL from the output of the `zrok-share` service or by peeking in the zrok console where the share will be graphed. +1. Get the public share URL from the output of the `zrok-share` service or by peeking in the zrok console where the share will appear in the graph. ```bash docker compose logs zrok-share @@ -28,7 +43,7 @@ This concludes the minimum steps to begin sharing the demo web server. Read on t ## Proxy Any Web Server -The simplest way to share your web server is to set `ZROK_TARGET` (e.g. `https://example.com`) in the environment of the `docker compose up` command. When you restart the share will auto-configure for that upstream server URL. This applies to both temporary and reserved public shares. +The simplest way to share your existing HTTP server is to set `ZROK_TARGET` (e.g. `https://example.com`) in the environment of the `docker compose up` command. When you restart the share will auto-configure for that URL. ```bash title=".env" ZROK_TARGET="http://example.com:8080" @@ -40,10 +55,15 @@ docker compose down && docker compose up ## Require Authentication -You can require authentication for your public share by setting `ZROK_OAUTH_PROVIDER` to `github` or `google` if you're using our hosted zrok.io, and any OIDC provider you've configured if self-hosting. You can parse the authenticated email address from the request cookie. Read more about the OAuth features in [this blog post](https://blog.openziti.io/the-zrok-oauth-public-frontend). This applies to both temporary and reserved public shares. +You can require a password or an OAuth login with certain email addresses. + +## OAuth Email + +You can allow specific email addresses or an email domain by setting `ZROK_OAUTH_PROVIDER` to `github` or `google` and `ZROK_SHARE_OPTS` to specify additional command-line options to `zrok reserve public`. Read more about the OAuth features in [this blog post](https://blog.openziti.io/the-zrok-oauth-public-frontend). ```bash title=".env" ZROK_OAUTH_PROVIDER="github" +ZROK_SHARE_OPTS="--oauth-email-domains @example.com" ``` ## Share Something Different diff --git a/docs/guides/frontdoor.mdx b/docs/guides/frontdoor.mdx index 9623cc95..001793f6 100644 --- a/docs/guides/frontdoor.mdx +++ b/docs/guides/frontdoor.mdx @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'; import LinuxService from './_linux-service.mdx'; import ReservedDocker from './docker-share/_reserved_public_share.mdx'; -zrok frontdoor is a way of using zrok-as-a-service from [zrok.io](https://zrok.io) as a shielded entry point to your website or service. This is useful if you want to expose a service to the public internet, but don't want to expose the service directly. +**zrok frontdoor** provides a shielded entry point for your production website or service. This is useful if you want to expose it to the public internet, but not directly.