From cfe8961745f3ec6d55b64fb162b5e1f64357c138 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Wed, 26 Feb 2025 12:04:51 -0500 Subject: [PATCH] api-v1 --- CHANGELOG.md | 2 ++ docs/guides/self-hosting/instance-configuration.mdx | 2 +- docs/guides/self-hosting/linux/index.mdx | 2 +- environment/env_v0_3/api.go | 2 +- environment/env_v0_4/api.go | 2 +- nfpm/zrok-enable.bash | 2 +- nfpm/zrok-share.env | 4 ++-- sdk/nodejs/sdk/src/environment/root.ts | 2 +- sdk/python/examples/pastebin/README.md | 2 +- sdk/python/sdk/zrok/zrok/environment/root.py | 2 +- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fc990f9..f22a2c19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ FEATURE: `zrok test canary` CLI tree replaces the old `zrok test loop` tree; new FEATURE: New `/api/v1/versions` endpoint to return comprehensive, full stack version information about the deployed service instance. Currently only returns a single `controllerVersion` property (https://github.com/openziti/zrok/issues/881) +CHANGE: The default API URL for `v1.0.x` zrok clients is now `https://api-v1.zrok.io` (instead of the older `https://api.zrok.io`). The zrok.io deployment will now be maintaining version-specific DNS for versioned API endpoints. + CHANGE: Refactored API implementation. Cleanup, lint removal, additional data elements added, unused data removed (https://github.com/openziti/zrok/issues/834) CHANGE: Deprecated the `passwords` configuration stanza. The zrok controller and API console now use a hard-coded set of (what we believe to be) reasonable assumptions about password quality (https://github.com/openziti/zrok/issues/834) diff --git a/docs/guides/self-hosting/instance-configuration.mdx b/docs/guides/self-hosting/instance-configuration.mdx index bc0d7480..b8b4b58a 100644 --- a/docs/guides/self-hosting/instance-configuration.mdx +++ b/docs/guides/self-hosting/instance-configuration.mdx @@ -9,7 +9,7 @@ This guide is relevant if you are self-hosting or using a friend's `zrok` instan The `zrok` *command* on your computer uses a `zrok` *instance* over the network. -The default instance API endpoint for the `zrok` command is `api.zrok.io`. Set the API endpoint to another instance's API endpoint: +The default instance API endpoint for the `zrok` command is `api-v1.zrok.io`. Set the API endpoint to another instance's API endpoint: ```text zrok config set apiEndpoint https://zrok.example.com diff --git a/docs/guides/self-hosting/linux/index.mdx b/docs/guides/self-hosting/linux/index.mdx index c942a4fa..68351eaf 100644 --- a/docs/guides/self-hosting/linux/index.mdx +++ b/docs/guides/self-hosting/linux/index.mdx @@ -117,7 +117,7 @@ See the separate guides on [configuring metrics](/guides/self-hosting/metrics-an ## Environment Variables -The `zrok` binaries are configured to work with the global `zrok.io` service, and default to using `api.zrok.io` as the endpoint for communicating with the service. +The `zrok` binaries are configured to work with the global `zrok.io` service, and default to using `api-v1.zrok.io` as the endpoint for communicating with the service. To work with a self-hosted `zrok` deployment, you'll need to set the `ZROK_API_ENDPOINT` environment variable to point to the address where your `zrok` controller will be listening, according to `endpoint` in the configuration file above. diff --git a/environment/env_v0_3/api.go b/environment/env_v0_3/api.go index b877c2dc..cab59ed0 100644 --- a/environment/env_v0_3/api.go +++ b/environment/env_v0_3/api.go @@ -62,7 +62,7 @@ func (r *Root) Client() (*rest_client_zrok.Zrok, error) { } func (r *Root) ApiEndpoint() (string, string) { - apiEndpoint := "https://api.zrok.io" + apiEndpoint := "https://api-v1.zrok.io" from := "binary" if r.Config() != nil && r.Config().ApiEndpoint != "" { diff --git a/environment/env_v0_4/api.go b/environment/env_v0_4/api.go index 2b51d4e1..1f53dc8b 100644 --- a/environment/env_v0_4/api.go +++ b/environment/env_v0_4/api.go @@ -61,7 +61,7 @@ func (r *Root) Client() (*rest_client_zrok.Zrok, error) { } func (r *Root) ApiEndpoint() (string, string) { - apiEndpoint := "https://api.zrok.io" + apiEndpoint := "https://api-v1.zrok.io" from := "binary" if r.Config() != nil && r.Config().ApiEndpoint != "" { diff --git a/nfpm/zrok-enable.bash b/nfpm/zrok-enable.bash index 7c8b49ba..292fa3b2 100644 --- a/nfpm/zrok-enable.bash +++ b/nfpm/zrok-enable.bash @@ -51,7 +51,7 @@ if [[ -z "${ZROK_ENABLE_TOKEN}" ]]; then echo "ERROR: ZROK_ENABLE_TOKEN is not defined" >&2 exit 1 else - zrok config set apiEndpoint "${ZROK_API_ENDPOINT:-https://api.zrok.io}" + zrok config set apiEndpoint "${ZROK_API_ENDPOINT:-https://api-v1.zrok.io}" echo "INFO: running: zrok enable ..." exec zrok enable --headless --description "${ZROK_ENVIRONMENT_NAME:-${DEFAULT_ZROK_ENVIRONMENT_NAME}}" "${ZROK_ENABLE_TOKEN}" fi diff --git a/nfpm/zrok-share.env b/nfpm/zrok-share.env index 8539ad12..a63b9b97 100644 --- a/nfpm/zrok-share.env +++ b/nfpm/zrok-share.env @@ -20,7 +20,7 @@ ZROK_ENABLE_TOKEN="" ZROK_ENVIRONMENT_NAME="" # You MUST set this if not using the default API endpoint -#ZROK_API_ENDPOINT="https://api.zrok.io" +#ZROK_API_ENDPOINT="https://api-v1.zrok.io" # ## ZROK BACKEND MODE AND TARGET @@ -88,7 +88,7 @@ ZROK_TARGET="" # e.g., http://127.0.0.1:3000 # WARNING: changes take effect the next time the frontend URL is reserved #ZROK_UNIQUE_NAME="" -# you MAY set one OAuth2/OIDC provider; "google" and "github" are valid for the default instance api.zrok.io +# you MAY set one OAuth2/OIDC provider; "google" and "github" are valid for the default instance api-v1.zrok.io # WARNING: changes take effect the next time the frontend URL is reserved # NOTE: basic auth and oauth are mutually exclusive #ZROK_OAUTH_PROVIDER="google" diff --git a/sdk/nodejs/sdk/src/environment/root.ts b/sdk/nodejs/sdk/src/environment/root.ts index 1e8e8eec..bb244328 100644 --- a/sdk/nodejs/sdk/src/environment/root.ts +++ b/sdk/nodejs/sdk/src/environment/root.ts @@ -76,7 +76,7 @@ export class Root { } public ApiEndpoint(): ApiEndpoint { - let apiEndpoint = "https://api.zrok.io" + let apiEndpoint = "https://api-v1.zrok.io" let frm = "binary" if (this.cfg.ApiEndpoint != "") { diff --git a/sdk/python/examples/pastebin/README.md b/sdk/python/examples/pastebin/README.md index be016135..18cbef8d 100644 --- a/sdk/python/examples/pastebin/README.md +++ b/sdk/python/examples/pastebin/README.md @@ -4,7 +4,7 @@ This example shows the use of the zrok SDK spinning up a simple pastebin command ## Self-hosting Setup :wrench: -You don't need this section if you're using hosted zrok from NetFoundry (https://api.zrok.io/). +You don't need this section if you're using hosted zrok from NetFoundry (https://api-v1.zrok.io/). Refer to the [setup guide](../../../docs/guides/self-hosting/self_hosting_guide.md) for details on setting up your zrok environment if you're self-hosting zrok. diff --git a/sdk/python/sdk/zrok/zrok/environment/root.py b/sdk/python/sdk/zrok/zrok/environment/root.py index ad7ae6ef..94c176d6 100644 --- a/sdk/python/sdk/zrok/zrok/environment/root.py +++ b/sdk/python/sdk/zrok/zrok/environment/root.py @@ -61,7 +61,7 @@ class Root: return zrock_client def ApiEndpoint(self) -> ApiEndpoint: - apiEndpoint = "https://api.zrok.io" + apiEndpoint = "https://api-v1.zrok.io" frm = "binary" if self.cfg.ApiEndpoint != "":