From 21a53eec5bc518d86717bfe119fb54232821b021 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Wed, 26 Jun 2024 14:58:14 -0400 Subject: [PATCH 1/2] demonstrate adding public share containers to the compose project --- .../compose/zrok-public-reserved/.gitignore | 3 +- .../zrok-public-reserved/compose.override.yml | 18 ++++++ docker/compose/zrok-public-share/.gitignore | 2 - docker/compose/zrok-public-share/compose.yml | 62 ------------------- 4 files changed, 19 insertions(+), 66 deletions(-) create mode 100644 docker/compose/zrok-public-reserved/compose.override.yml delete mode 100644 docker/compose/zrok-public-share/.gitignore delete mode 100644 docker/compose/zrok-public-share/compose.yml diff --git a/docker/compose/zrok-public-reserved/.gitignore b/docker/compose/zrok-public-reserved/.gitignore index f19fff7f..2eea525d 100644 --- a/docker/compose/zrok-public-reserved/.gitignore +++ b/docker/compose/zrok-public-reserved/.gitignore @@ -1,2 +1 @@ -.env -*compose.override.yml \ No newline at end of file +.env \ No newline at end of file diff --git a/docker/compose/zrok-public-reserved/compose.override.yml b/docker/compose/zrok-public-reserved/compose.override.yml new file mode 100644 index 00000000..e922efe8 --- /dev/null +++ b/docker/compose/zrok-public-reserved/compose.override.yml @@ -0,0 +1,18 @@ +services: + my-other-zrok-share: + image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok} + restart: unless-stopped + entrypoint: zrok-share.bash + depends_on: + zrok-enable: + condition: service_completed_successfully + volumes: + - zrok_env:/mnt + - ./Caddyfile:/Caddyfile + environment: + # most relevant options + ZROK_UNIQUE_NAME: "my-other-zrok-share" + ZROK_BACKEND_MODE: caddy + ZROK_TARGET: /Caddyfile + # internal configuration + STATE_DIRECTORY: /mnt # zrok homedir in container diff --git a/docker/compose/zrok-public-share/.gitignore b/docker/compose/zrok-public-share/.gitignore deleted file mode 100644 index f19fff7f..00000000 --- a/docker/compose/zrok-public-share/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.env -*compose.override.yml \ No newline at end of file diff --git a/docker/compose/zrok-public-share/compose.yml b/docker/compose/zrok-public-share/compose.yml deleted file mode 100644 index 47d58266..00000000 --- a/docker/compose/zrok-public-share/compose.yml +++ /dev/null @@ -1,62 +0,0 @@ -services: - - # set file ownership - zrok-init: - image: busybox - # matches uid:gid of "ziggy" in zrok container image - command: chown -Rc 2171:2171 /mnt/.zrok - user: root - volumes: - - zrok_env:/mnt/.zrok - - # enable zrok environment - zrok-enable: - image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok} - depends_on: - zrok-init: - condition: service_completed_successfully - entrypoint: zrok-enable.bash - volumes: - - zrok_env:/mnt - environment: - STATE_DIRECTORY: /mnt - ZROK_ENABLE_TOKEN: - ZROK_API_ENDPOINT: - ZROK_ENVIRONMENT_NAME: docker-public-share - - # provision a temporary zrok frontend subdomain and start sharing the backend target - zrok-share: - image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok} - restart: no - entrypoint: zrok-share.bash - depends_on: - zrok-enable: - condition: service_completed_successfully - volumes: - - zrok_env:/mnt - environment: - # internal configuration - STATE_DIRECTORY: /mnt # zrok homedir in container - ZROK_FRONTEND_MODE: temp-public # tells zrok-share.bash to create a temporary subdomain and share until exit - - # most relevant options - ZROK_BACKEND_MODE: proxy # web, caddy, drive, proxy - ZROK_TARGET: http://zrok-test:9090 # backend target, is a path in container filesystem unless proxy mode - ZROK_INSECURE: # "--insecure" if proxy target has unverifiable TLS server certificate - ZROK_OAUTH_PROVIDER: # google, github - ZROK_OAUTH_EMAILS: # allow space-separated list of OAuth email address glob patterns - ZROK_BASIC_AUTH: # username:password, mutually-exclusive with ZROK_OAUTH_PROVIDER - - # least relevant options - ZROK_VERBOSE: # "--verbose" - ZROK_SHARE_OPTS: # additional arguments to "zrok share public" command - ZROK_FRONTENDS: # "public" - PFXLOG_NO_JSON: "true" # suppress JSON logging format - - # demo server you can share with zrok - zrok-test: - image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok} - command: test endpoint --address 0.0.0.0 # 9090 - -volumes: - zrok_env: From ef8c179dde98d2e612536d862b186e34fdbeea08 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Thu, 27 Jun 2024 11:50:27 -0400 Subject: [PATCH 2/2] announce in changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b46c554d..fe653c16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ FIX: Fix for mixing limited and unlimited (-1) resource counts in the limits system (https://github.com/openziti/zrok/issues/680) +CHANGE: add Docker compose example for multiple share containers using the same enabled environment in [compose.override.yml](./docker/compose/zrok-public-reserved/compose.override.yml) + ## v0.4.33 FIX: Fix for log message in `Agent.CanAccessShare` (`"account '#%d' over frontends per share limit '%d'"`), which was not returning the correct limit value.