Skip to content

Commit

Permalink
Set metric reporting default to false
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattias- committed Dec 5, 2023
1 parent 2f89d24 commit 8cf7251
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/vanity-ssh-keygen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type cli struct {
Threads int `short:"j" help:"Execution threads. Defaults to the number of logical CPU cores" default:"${default_threads}"`
Profile bool `help:"Profile the process. Write pprof CPU profile to ./pprof" default:"false"`
PyroscopeProfile bool `help:"Profile the process and upload data to Pyroscope" default:"false"`
Metrics bool `help:"Enable metrics server." default:"true" negatable:""`
Metrics bool `help:"Enable metrics server." default:"false"`
Output string `short:"o" help:"Output format. One of: pem-files|json-file." default:"pem-files"`
OutputDir string `help:"Output directory." default:"./" type:"existingdir"`
StatsLogInterval time.Duration `help:"Statistics will be printed at this interval, set to 0 to disable" default:"2s"`
Expand Down Expand Up @@ -170,7 +170,7 @@ func main() {
profiler, err := pyroscope.Start(pyroscope.Config{
Logger: pyroscope.StandardLogger,
ApplicationName: serviceName,
//ServerAddress: os.Getenv("PYROSCOPE_SERVER"),
// ServerAddress: os.Getenv("PYROSCOPE_SERVER"),
BasicAuthUser: os.Getenv("GRAFANA_INSTANCE_ID"),
BasicAuthPassword: os.Getenv("TOKEN"),
Tags: map[string]string{
Expand Down Expand Up @@ -230,8 +230,8 @@ func outputKey(c cli, elapsed time.Duration, result keygen.SSHKey) {
if c.Output == "pem-files" {
privkeyFileName := outDir + c.MatchString
pubkeyFileName := outDir + c.MatchString + ".pub"
_ = os.WriteFile(privkeyFileName, privK, 0600)
_ = os.WriteFile(pubkeyFileName, pubK, 0600)
_ = os.WriteFile(privkeyFileName, privK, 0o600)
_ = os.WriteFile(pubkeyFileName, pubK, 0o600)
slog.Info("Result keypair stored", "privkey_file", privkeyFileName, "pubkey_file", pubkeyFileName)
} else if c.Output == "json-file" {
file, _ := json.MarshalIndent(OutputData{
Expand All @@ -243,7 +243,7 @@ func outputKey(c cli, elapsed time.Duration, result keygen.SSHKey) {
},
}, "", " ")
jsonFileName := outDir + "result.json"
_ = os.WriteFile(jsonFileName, file, 0600)
_ = os.WriteFile(jsonFileName, file, 0o600)
slog.Info("Result keypair stored", "json_file", jsonFileName)
}
}

0 comments on commit 8cf7251

Please sign in to comment.