Documentation ¶
Overview ¶
Package flare is used for collecting, sanitizing, and packaging lakeFS configuration, log files, and environment variables for debugging and troubleshooting purposes.
Index ¶
Constants ¶
const ( DirPermissions = 0700 FilePremissions = 0600 FlareUmask = 077 )
Variables ¶
var ( ErrExtractDateFromJSONLogLine = errors.New("failed to extract date from log line") ErrDateNotFound = errors.New("date not found in log line") )
Functions ¶
func SetBaselinePermissions ¶ added in v1.28.1
func SetBaselinePermissions(mask int)
SetBaselinePermissions sets the Umask for all files created by flare for posix operating systems on Windows this is a noop as permissions are set according to the parent directory
Types ¶
type FileWriter ¶
type FileWriter struct{}
func (*FileWriter) Close ¶
func (fw *FileWriter) Close() error
func (*FileWriter) GetFileWriter ¶
func (fw *FileWriter) GetFileWriter(name string) (io.WriteCloser, error)
type Flare ¶
type Flare struct { // LogDateLayout is the layout used by time.Parse to parse dates in log lines. // The default value is time.RFC3339. // This can be changed using the WithLogDateLayout option. LogDateLayout string // contains filtered or unexported fields }
func (*Flare) ProcessConfig ¶
func (f *Flare) ProcessConfig(cfg interface{}, outputPath, fileName string, getWriterFunc GetFileWriterFunc) (retErr error)
ProcessConfig takes a config struct, marshals it to YAML and writes it out to outputPath
func (*Flare) ProcessEnvVars ¶
func (f *Flare) ProcessEnvVars(outPath, fileName string, getWriterFunc GetFileWriterFunc) (retErr error)
ProcessEnvVars iterates over all defined env vars, filters them according to the defined prefixes, redacts secrets, and writes them out to file.
type FlareOutputWriter ¶
type FlareOutputWriter interface { GetFileWriter(name string) (io.WriteCloser, error) Close() error }
type GetFileWriterFunc ¶
type GetFileWriterFunc func(name string) (io.WriteCloser, error)
type LogFormat ¶
type LogFormat string
LogFormat is a log file format supported by the flare package
type Option ¶
type Option func(*Flare)
func WithAdditionalEnvVarPrefix ¶
WithAdditionalEnvVarPrefix adds additional environment prefixes to the default list that flare processes. The default list is "LAKEFS_", "HTTP_", "HOSTNAME".
func WithEnvVarBlacklist ¶
WithEnvVarBlacklist adds a list of environment variable keys that will be explicitly redacted.
func WithEnvVarPrefixes ¶
WithEnvVarPrefixes replaces the default list of environment variable prefixes that flare processes. The default list is "LAKEFS_", "HTTP_", "HOSTNAME".
func WithSecretReplacerFunc ¶
func WithSecretReplacerFunc(fn RedactedValueReplacer) Option
WithSecretReplacerFunc replaces the default secret replacement func with a function that takes the raw value and returns the redacted value The default secret replacement func replaces the secret with a SHA512 hash of the secret value. This allows comparison of values without exposing the secret values.
type RedactedValueReplacer ¶
type StdoutWriter ¶
type StdoutWriter struct{}
func (*StdoutWriter) Close ¶
func (sw *StdoutWriter) Close() error
func (*StdoutWriter) GetFileWriter ¶
func (sw *StdoutWriter) GetFileWriter(name string) (io.WriteCloser, error)
type StdoutWriterCloser ¶
func (StdoutWriterCloser) Close ¶
func (swc StdoutWriterCloser) Close() error
type ZipWriter ¶
func NewZipWriter ¶
func (*ZipWriter) GetFileWriter ¶
func (zw *ZipWriter) GetFileWriter(name string) (io.WriteCloser, error)
type ZipWriterCloser ¶
func (ZipWriterCloser) Close ¶
func (zwc ZipWriterCloser) Close() error