-
Notifications
You must be signed in to change notification settings - Fork 0
feat(web): forward --allow-insecure-origin from the node install command #5
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,12 +25,15 @@ const runInstaller = `$s \${s:+--preserve-env=http_proxy,https_proxy,no_proxy,HT | |
| /** | ||
| * Adds this host as a node. The one-time token reaches the installer only on | ||
| * standard input (`printf` is a shell builtin), never in an argument, the | ||
| * environment or sudo's command line. | ||
| * environment or sudo's command line. `allowInsecureOrigin` forwards the | ||
| * installer's `--allow-insecure-origin`, which lets a plain-HTTP Core origin | ||
| * enroll; it stays off unless the caller explicitly asks for it, so the default | ||
| * command is byte-for-byte unchanged. | ||
| */ | ||
| export function nodeInstallCommand({ token, coreUrl, sourceUrl, provider, installationId, scriptDigest }: { | ||
| token: string; coreUrl: string; sourceUrl: string; provider: "docker" | "microsandbox"; installationId: string; scriptDigest: string; | ||
| export function nodeInstallCommand({ token, coreUrl, sourceUrl, provider, installationId, scriptDigest, allowInsecureOrigin = false }: { | ||
| token: string; coreUrl: string; sourceUrl: string; provider: "docker" | "microsandbox"; installationId: string; scriptDigest: string; allowInsecureOrigin?: boolean; | ||
| }): string { | ||
| return `${nodeInstaller(sourceUrl, scriptDigest)}printf '%s\\n' ${quote(token)} | ${runInstaller} --enrollment-token-stdin --source-url ${quote(sourceUrl)} --core-url ${quote(coreUrl)} --provider ${quote(provider)} --installation-id ${quote(installationId)})`; | ||
| return `${nodeInstaller(sourceUrl, scriptDigest)}printf '%s\\n' ${quote(token)} | ${runInstaller} --enrollment-token-stdin --source-url ${quote(sourceUrl)} --core-url ${quote(coreUrl)}${allowInsecureOrigin ? " --allow-insecure-origin" : ""} --provider ${quote(provider)} --installation-id ${quote(installationId)})`; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a caller sets AGENTS.md reference: AGENTS.md:L13-L13 Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For an installation with
allow_insecure_origin=trueand a non-loopbackhttp://public URL, this parameter is never true in the real dialog:NodeEnrollment.tsx:139callsnodeInstallCommandwithout it, so this default wins, andnodeSourceUrlincore-origin.ts:23-25rejects the HTTP URL before a command can be shown. Administrators therefore still receive the HTTPS configuration blocker and cannot enroll a node; plumb the applied setting and relax that source-origin gate only when it is enabled.Useful? React with 👍 / 👎.