Skip to content

Commit

Permalink
Add flag to configure audit keep settings. (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Jul 31, 2023
1 parent f7b883e commit e124a3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/metal-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ func init() {
rootCmd.Flags().String("auditing-api-key", "secret", "api key for the auditing service")
rootCmd.Flags().String("auditing-index-prefix", "auditing", "auditing index prefix")
rootCmd.Flags().String("auditing-index-interval", "@daily", "auditing index creation interval, can be one of @hourly|@daily|@monthly")
rootCmd.Flags().Int64("auditing-keep", 14, "the amount of indexes to keep until cleanup")

rootCmd.Flags().String("headscale-addr", "", "address of headscale server")
rootCmd.Flags().String("headscale-cp-addr", "", "address of headscale control plane")
Expand Down Expand Up @@ -920,9 +921,10 @@ func createAuditingClient(log *zap.SugaredLogger) (auditing.Auditing, error) {
Component: "metal-api",
URL: viper.GetString("auditing-url"),
APIKey: viper.GetString("auditing-api-key"),
Log: log,
IndexPrefix: viper.GetString("auditing-index-prefix"),
RotationInterval: auditing.Interval(viper.GetString("auditing-index-interval")),
Keep: viper.GetInt64("auditing-keep"),
Log: log,
}
return auditing.New(c)
}
Expand Down

0 comments on commit e124a3c

Please sign in to comment.