Skip to content

feat(cli/support): confirm before creating bundle #12684

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

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update blurb
  • Loading branch information
johnstcn committed Mar 21, 2024
commit 6f00ef1177f44c1d19fb4c4b9a4b5104c89f456c
26 changes: 21 additions & 5 deletions cli/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ func (r *RootCmd) support() *serpent.Command {
return supportCmd
}

var supportBundleBlurb = cliui.Bold("This will collect the following information:\n") +
` - Coder deployment version
- Coder deployment Configuration (sanitized), including enabled experiments
- Coder deployment health snapshot
- Coder deployment Network troubleshooting information
- Workspace configuration, parameters, and build logs
- Template version and source code for the given workspace
- Agent details (with environment variable sanitized)
- Agent network diagnostics
- Agent logs
` + cliui.Bold("Note: ") +
cliui.Wrap(`While we try to sanitize sensitive data from support bundles, we cannot guarantee that they do not contain information that you or your organization may consider sensitive.\n`) +
cliui.Bold("Please confirm that you will:\n") +
" - Review the support bundle before distribution\n" +
" - Only distribute it via trusted channels\n" +
cliui.Bold("Type 'confirm' to continue:")

func (r *RootCmd) supportBundle() *serpent.Command {
var outputPath string
var coderURLOverride string
Expand Down Expand Up @@ -72,12 +89,11 @@ func (r *RootCmd) supportBundle() *serpent.Command {

if !confirm {
ans, err := cliui.Prompt(inv, cliui.PromptOptions{
Text: cliui.Bold("Note: ") + cliui.Wrap("While we try to sanitize sensitive data from support bundles, we cannot guarantee that they do not contain information that you or your organization may consider sensitive.\n") + cliui.Bold("Please confirm that you will:\n") + " - Review the support bundle before distribution\n - Only distribute it via trusted channels.\n",
Default: cliui.ConfirmNo,
Secret: false,
IsConfirm: true,
Text: supportBundleBlurb,
Default: "",
Secret: false,
})
if err != nil || ans != cliui.ConfirmYes {
if err != nil || ans != "confirm" {
return err
}
cliLog.Info(inv.Context(), "user confirmed manually", slog.F("answer", ans))
Expand Down