diff --git a/PLAN.md b/PLAN.md index f7bd97c..cd490a2 100644 --- a/PLAN.md +++ b/PLAN.md @@ -672,7 +672,7 @@ func TestMain(m *testing.M) { ```hcl provider "artifactapi" { - endpoint = "https://artifactapi.k8s.syd1.au.unkin.net" + endpoint = "https://artifactapi.example.com" } resource "artifactapi_remote" "terraform_registry" { diff --git a/docs/docker/local.md b/docs/docker/local.md index 2c72b81..54d7a55 100644 --- a/docs/docker/local.md +++ b/docs/docker/local.md @@ -5,9 +5,9 @@ Docker Registry HTTP API V2 for both push and pull, so any client (`docker`, `podman`, `skopeo`, `buildah`) can use it directly. ```sh -docker tag myapp:latest artifactapi.k8s.syd1.au.unkin.net/docker-internal/myapp:latest -docker push artifactapi.k8s.syd1.au.unkin.net/docker-internal/myapp:latest -docker pull artifactapi.k8s.syd1.au.unkin.net/docker-internal/myapp:latest +docker tag myapp:latest artifactapi.example.com/docker-internal/myapp:latest +docker push artifactapi.example.com/docker-internal/myapp:latest +docker pull artifactapi.example.com/docker-internal/myapp:latest ``` The first path segment after `/v2/` is the artifactapi repo name; the remainder diff --git a/docs/helm/local.md b/docs/helm/local.md index f8c3a17..898ff88 100644 --- a/docs/helm/local.md +++ b/docs/helm/local.md @@ -10,6 +10,6 @@ member of a helm virtual to serve it alongside remotes. ```bash helm package ./mychart curl -fsSL --upload-file mychart-0.1.0.tgz \ - https://artifactapi.k8s.syd1.au.unkin.net/api/v2/remotes//files/mychart-0.1.0.tgz -helm repo add https://artifactapi.k8s.syd1.au.unkin.net/api/v1/local/ + https://artifactapi.example.com/api/v2/remotes//files/mychart-0.1.0.tgz +helm repo add https://artifactapi.example.com/api/v1/local/ ``` diff --git a/docs/puppet/local.md b/docs/puppet/local.md index 1cd8e57..c5258d0 100644 --- a/docs/puppet/local.md +++ b/docs/puppet/local.md @@ -8,7 +8,7 @@ release's `metadata.json` at `/api/v1/local/`. Versions are immutable. ```bash puppet module build ./hello curl -fsSL --upload-file pkg/unkin-hello-0.1.0.tar.gz \ - https://artifactapi.k8s.syd1.au.unkin.net/api/v2/remotes//files/unkin-hello-0.1.0.tar.gz + https://artifactapi.example.com/api/v2/remotes//files/unkin-hello-0.1.0.tar.gz puppet module install unkin-hello \ - --module_repository https://artifactapi.k8s.syd1.au.unkin.net/api/v1/local/ + --module_repository https://artifactapi.example.com/api/v1/local/ ``` diff --git a/docs/terraform/local.md b/docs/terraform/local.md index fc438fb..2b3e0d4 100644 --- a/docs/terraform/local.md +++ b/docs/terraform/local.md @@ -9,7 +9,7 @@ no `.terraformrc` mirror config: terraform { required_providers { artifactapi = { - source = "artifactapi.k8s.syd1.au.unkin.net//" + source = "artifactapi.example.com//" version = "0.1.2" } } diff --git a/ui/src/components/UsageInstructions.tsx b/ui/src/components/UsageInstructions.tsx index de70bba..1059f53 100644 --- a/ui/src/components/UsageInstructions.tsx +++ b/ui/src/components/UsageInstructions.tsx @@ -3,25 +3,14 @@ import './UsageInstructions.css'; import { packageTypes } from '../packagetypes'; import type { RepoClass, Snippet } from '../packagetypes/types'; -// baseURL resolves the externally reachable origin of this artifactapi instance. -// The UI is served on the same origin as the API (client BASE is ''), so -// window.location.origin is the address a host would actually curl/pull against -// — no hardcoded hostname, works in prod and in `npm run dev` behind a proxy. +// The UI is served on the same origin as the API, so this is the address clients use. function baseURL(): string { - if (typeof window !== 'undefined' && window.location?.origin) { - return window.location.origin.replace(/\/$/, ''); - } - return 'https://artifactapi.k8s.syd1.au.unkin.net'; + return window.location.origin; } -// hostOnly is the bare host[:port] with no scheme, for docker/terraform source -// addresses which are scheme-less. +// hostOnly is host[:port] for scheme-less docker/terraform addresses. function hostOnly(): string { - try { - return new URL(baseURL()).host; - } catch { - return 'artifactapi.k8s.syd1.au.unkin.net'; - } + return window.location.host; } // remoteProxyBase is where a remote (or virtual) repo's proxied artifacts live.