From b887e33a307689aa352b0707f6a29b80b39c90db Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Mon, 11 Dec 2023 11:34:59 -0500 Subject: [PATCH] explain UNIQUE_NAME in the reserved public share context --- docker/compose/zrok-public-reserved/compose.yml | 2 +- nfpm/zrok-share.bash | 4 ++-- nfpm/zrok-share.env | 4 ++-- sdk/python/sdk/zrok/zrok/listener.py | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docker/compose/zrok-public-reserved/compose.yml b/docker/compose/zrok-public-reserved/compose.yml index 931e0f76..9fc29559 100644 --- a/docker/compose/zrok-public-reserved/compose.yml +++ b/docker/compose/zrok-public-reserved/compose.yml @@ -38,7 +38,7 @@ services: STATE_DIRECTORY: /mnt # zrok homedir in container # most relevant options - ZROK_SUBDOMAIN: # frontend subdomain, e.g. "myapp" for "myapp.in.zrok.io" + UNIQUE_NAME: # vanity share token is used to construct frontend subdomain, e.g. "myapp" for "myapp.in.zrok.io" ZROK_BACKEND_MODE: # web, caddy, drive, proxy ZROK_TARGET: # backend target, is a path in container filesystem unless proxy mode ZROK_INSECURE: # "--insecure" if proxy target has unverifiable TLS server certificate diff --git a/nfpm/zrok-share.bash b/nfpm/zrok-share.bash index 353ee8e6..207bb209 100644 --- a/nfpm/zrok-share.bash +++ b/nfpm/zrok-share.bash @@ -110,8 +110,8 @@ case "${ZROK_BACKEND_MODE}" in ;; esac -[[ -n "${ZROK_SUBDOMAIN:-}" ]] && { - ZROK_CMD+=" --unique-name ${ZROK_SUBDOMAIN}" +[[ -n "${UNIQUE_NAME:-}" ]] && { + ZROK_CMD+=" --unique-name ${UNIQUE_NAME}" } ZROK_CMD+=" --backend-mode ${ZROK_BACKEND_MODE} ${ZROK_TARGET}" diff --git a/nfpm/zrok-share.env b/nfpm/zrok-share.env index bd0a9761..d192a921 100644 --- a/nfpm/zrok-share.env +++ b/nfpm/zrok-share.env @@ -64,10 +64,10 @@ ZROK_SHARE_OPTS="" ## ZROK FRONTEND # -# you MAY customize the subdomain that is reserved for the frontend; must be a valid DNS subdomain; if not set a random +# you MAY customize the share token that is used to construct the reserved subdomain; if not set a random # subdomain is reserved # WARNING: changes take effect the next time the frontend URL is reserved -#ZROK_SUBDOMAIN="" +#UNIQUE_NAME="" # you MAY set one OAuth2/OIDC provider; "google" and "github" are valid for the default instance api.zrok.io # WARNING: changes take effect the next time the frontend URL is reserved diff --git a/sdk/python/sdk/zrok/zrok/listener.py b/sdk/python/sdk/zrok/zrok/listener.py index bce83cb7..1e884844 100644 --- a/sdk/python/sdk/zrok/zrok/listener.py +++ b/sdk/python/sdk/zrok/zrok/listener.py @@ -1,6 +1,7 @@ -from zrok.environment.root import Root import openziti - +from zrok.environment.root import Root + + class Listener(): shrToken: str root: Root @@ -23,4 +24,4 @@ class Listener(): self.__server.listen() def close(self): - self.__server.close() \ No newline at end of file + self.__server.close()