Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: show warning in AppLink if hostname is long enough to break port forwarding#19506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aqandrew merged 5 commits intomainfromaqandrew/coder-app-hostname-too-long-error
Aug 27, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletionssite/src/modules/resources/AppLink/AppLink.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -168,6 +168,21 @@ export const InternalApp: Story = {
},
};

export const InternalAppHostnameTooLong: Story = {
args: {
workspace: MockWorkspace,
app: {
...MockWorkspaceApp,
display_name: "Check my URL",
subdomain: true,
subdomain_name:
// 64 characters long; surpasses DNS hostname limit of 63 characters
"app_name_makes_subdomain64--agent_name--workspace_name--username",
},
agent: MockWorkspaceAgent,
},
};

export const BlockingStartupScriptRunning: Story = {
args: {
workspace: MockWorkspace,
Expand Down
27 changes: 25 additions & 2 deletionssite/src/modules/resources/AppLink/AppLink.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
import type * as TypesGen from "api/typesGenerated";
import { DropdownMenuItem } from "components/DropdownMenu/DropdownMenu";
import { Link } from "components/Link/Link";
import { Spinner } from "components/Spinner/Spinner";
import {
Tooltip,
Expand All@@ -11,7 +12,7 @@ import { useProxy } from "contexts/ProxyContext";
import { CircleAlertIcon } from "lucide-react";
import { isExternalApp, needsSessionToken } from "modules/apps/apps";
import { useAppLink } from "modules/apps/useAppLink";
import { type FC, useState } from "react";
import { type FC,type ReactNode,useState } from "react";
import { AgentButton } from "../AgentButton";
import { BaseIcon } from "./BaseIcon";
import { ShareIcon } from "./ShareIcon";
Expand DownExpand Up@@ -48,7 +49,7 @@ export const AppLink: FC<AppLinkProps> = ({
// To avoid bugs in the healthcheck code locking users out of apps, we no
// longer block access to apps if they are unhealthy/initializing.
let canClick = true;
let primaryTooltip = "";
let primaryTooltip: ReactNode = "";
let icon = !iconError && (
<BaseIcon app={app} onIconPathError={() => setIconError(true)} />
);
Expand DownExpand Up@@ -80,6 +81,28 @@ export const AppLink: FC<AppLinkProps> = ({
"Your admin has not configured subdomain application access";
}

if (app.subdomain_name && app.subdomain_name.length > 63) {
icon = (
<CircleAlertIcon
aria-hidden="true"
className="size-icon-sm text-content-warning"
/>
);
primaryTooltip = (
<>
Port forwarding will not work because hostname is too long, see the{" "}
<Link
href="https://coder.com/docs/user-guides/workspace-access/port-forwarding#dashboard"
target="_blank"
size="sm"
>
documentation
</Link>{" "}
for more details
</>
);
}

if (isExternalApp(app) && needsSessionToken(app) && !link.hasToken) {
canClick = false;
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp