Redacts redacted info from all (#112)

This commit is contained in:
Mrxbox98 2022-01-17 18:55:29 -08:00 committed by GitHub
parent cdb86abac1
commit ed4d903f21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,6 +188,16 @@ func diagnosticsCmdRun(cmd *cobra.Command, args []string) {
survey.AskOne(&survey.Confirm{Message: "Upload to " + diagnosticsArgs.HastebinURL + "?", Default: false}, &upload)
}
if upload {
if !diagnosticsArgs.IncludeEndpoints {
s := output.String()
output.Reset()
a := strings.ReplaceAll(cfg.PanelLocation, s, "{redacted}")
a = strings.ReplaceAll(cfg.Api.Host, a, "{redacted}")
a = strings.ReplaceAll(cfg.Api.Ssl.CertificateFile, a, "{redacted}")
a = strings.ReplaceAll(cfg.Api.Ssl.KeyFile, a, "{redacted}")
a = strings.ReplaceAll(cfg.System.Sftp.Address, a, "{redacted}")
output.WriteString(a)
}
u, err := uploadToHastebin(diagnosticsArgs.HastebinURL, output.String())
if err == nil {
fmt.Println("Your report is available here: ", u)