diff --git a/components/dashboard/src/App.tsx b/components/dashboard/src/App.tsx index 976f5aab892616..83f948a89afb90 100644 --- a/components/dashboard/src/App.tsx +++ b/components/dashboard/src/App.tsx @@ -47,7 +47,8 @@ import { StartWorkspaceModal } from "./workspaces/StartWorkspaceModal"; import { parseProps } from "./start/StartWorkspace"; import SelectIDEModal from "./settings/SelectIDEModal"; import { StartPage, StartPhase } from "./start/StartPage"; -import { isGitpodIo } from "./utils"; +import { isGitpodIo, isLocalPreview } from "./utils"; +import Alert from "./components/Alert"; import { BlockedRepositories } from "./admin/BlockedRepositories"; import { AppNotifications } from "./AppNotifications"; @@ -347,6 +348,28 @@ function App() {
+ {isLocalPreview() && ( +
+ + You are using a local preview installation, intended for exploring the product on a + single machine without requiring a Kubernetes cluster.{" "} + + Request a community license + {" "} + or{" "} + + contact sales + {" "} + to get a professional license for running Gitpod in production. + +
+ )} diff --git a/components/dashboard/src/utils.ts b/components/dashboard/src/utils.ts index 8c14ffe76a0b7c..c29b45f501f179 100644 --- a/components/dashboard/src/utils.ts +++ b/components/dashboard/src/utils.ts @@ -58,8 +58,12 @@ export function isGitpodIo() { ); } +export function isLocalPreview() { + return window.location.hostname === "preview.gitpod-self-hosted.com"; +} + function trimResource(resource: string): string { - return resource.split('/').filter(Boolean).join('/'); + return resource.split("/").filter(Boolean).join("/"); } // Returns 'true' if a 'pathname' is a part of 'resources' provided. @@ -69,9 +73,9 @@ function trimResource(resource: string): string { // 'pathname' arg can be provided via `location.pathname`. export function inResource(pathname: string, resources: string[]): boolean { // Removes leading and trailing '/' - const trimmedResource = trimResource(pathname) + const trimmedResource = trimResource(pathname); // Checks if a path is part of a resource. // E.g. "api/userspace/resource" path is a part of resource "api/userspace" - return resources.map(res => trimmedResource.startsWith(trimResource(res))).some(Boolean) + return resources.map((res) => trimmedResource.startsWith(trimResource(res))).some(Boolean); } diff --git a/install/preview/entrypoint.sh b/install/preview/entrypoint.sh index d33f57056ee2f4..dfb8da45746ba8 100755 --- a/install/preview/entrypoint.sh +++ b/install/preview/entrypoint.sh @@ -4,9 +4,9 @@ set -e -# Set Domain to `127-0-0-1.nip.io` if not set +# Set Domain to `preview.gitpod-self-hosted.com` if not set if [ -z "${DOMAIN}" ]; then - export DOMAIN="127-0-0-1.nip.io" + export DOMAIN="preview.gitpod-self-hosted.com" fi # Create a USER_ID to be used everywhere diff --git a/install/preview/manifests/coredns.yaml b/install/preview/manifests/coredns.yaml index 05478653cb2361..83330262ea6c02 100644 --- a/install/preview/manifests/coredns.yaml +++ b/install/preview/manifests/coredns.yaml @@ -56,18 +56,18 @@ metadata: namespace: kube-system data: gitpod.db: | - ; 127-0-0-1.nip.io test file - 127-0-0-1.nip.io. IN SOA sns.dns.icann.org. noc.dns.icann.org. 2015082541 7200 3600 1209600 3600 - 127-0-0-1.nip.io. IN CNAME proxy.default.svc.cluster.local. - *.127-0-0-1.nip.io. IN CNAME proxy.default.svc.cluster.local. - *.ws.127-0-0-1.nip.io. IN CNAME proxy.default.svc.cluster.local. + ; preview.gitpod-self-hosted.com test file + preview.gitpod-self-hosted.com. IN SOA sns.dns.icann.org. noc.dns.icann.org. 2015082541 7200 3600 1209600 3600 + preview.gitpod-self-hosted.com. IN CNAME proxy.default.svc.cluster.local. + *.preview.gitpod-self-hosted.com. IN CNAME proxy.default.svc.cluster.local. + *.ws.preview.gitpod-self-hosted.com. IN CNAME proxy.default.svc.cluster.local. Corefile: | .:53 { errors health ready - # extra configuration for `127-0-0-1.nip.io` - file /etc/coredns/gitpod.db 127-0-0-1.nip.io + # extra configuration for `preview.gitpod-self-hosted.com` + file /etc/coredns/gitpod.db preview.gitpod-self-hosted.com kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa