Added --trace flag and new log.Trace() lines for sensitive information (#541)

pull/515/head
Sebastiaan Tammer 5 years ago committed by GitHub
parent 4f47851263
commit 7052346570
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -64,6 +64,9 @@ func PreRun(cmd *cobra.Command, args []string) {
if enabled, _ := f.GetBool("debug"); enabled {
log.SetLevel(log.DebugLevel)
}
if enabled, _ := f.GetBool("trace"); enabled {
log.SetLevel(log.TraceLevel)
}
pollingSet := f.Changed("interval")
schedule, _ := f.GetString("schedule")

@ -72,12 +72,22 @@ Environment Variable: WATCHTOWER_REMOVE_VOLUMES
Enable debug mode with verbose logging.
```
Argument: --debug
Argument: --debug, -d
Environment Variable: WATCHTOWER_DEBUG
Type: Boolean
Default: false
```
## Trace
Enable trace mode with very verbose logging. Caution: exposes credentials!
```
Argument: --trace
Environment Variable: WATCHTOWER_TRACE
Type: Boolean
Default: false
```
## Docker host
Docker daemon socket to connect to. Can be pointed at a remote Docker host by specifying a TCP endpoint as "tcp://hostname:port".

@ -18,8 +18,8 @@ The types of notifications to send are set by passing a comma-separated list of
## Settings
- `--notifications-level` (env. `WATCHTOWER_NOTIFICATIONS_LEVEL`): Controls the log level which is used for the notifications. If omitted, the default log level is `info`. Possible values are: `panic`, `fatal`, `error`, `warn`, `info` or `debug`.
- Whatchtower will post a notification every time is started. This behavior [can be changed](https://containrrr.github.io/watchtower/arguments/#without_sending_a_startup_message) with an argument.
- `--notifications-level` (env. `WATCHTOWER_NOTIFICATIONS_LEVEL`): Controls the log level which is used for the notifications. If omitted, the default log level is `info`. Possible values are: `panic`, `fatal`, `error`, `warn`, `info`, `debug` or `trace`.
- Watchtower will post a notification every time it is started. This behavior [can be changed](https://containrrr.github.io/watchtower/arguments/#without_sending_a_startup_message) with an argument.
## Available services

@ -84,6 +84,12 @@ func RegisterSystemFlags(rootCmd *cobra.Command) {
viper.GetBool("WATCHTOWER_DEBUG"),
"enable debug mode with verbose logging")
flags.BoolP(
"trace",
"",
viper.GetBool("WATCHTOWER_TRACE"),
"enable trace mode with very verbose logging - caution, exposes credentials")
flags.BoolP(
"monitor-only",
"m",

@ -16,7 +16,7 @@ func GetPullOptions(imageName string) (types.ImagePullOptions, error) {
if auth == "" {
return types.ImagePullOptions{}, nil
}
log.Debugf("Got auth value")
log.Tracef("Got auth value: %s", auth)
return types.ImagePullOptions{
RegistryAuth: auth,

@ -37,6 +37,7 @@ func EncodedEnvAuth(ref string) (string, error) {
Password: password,
}
log.Debugf("Loaded auth credentials for user %s on registry %s", auth.Username, ref)
log.Tracef("Using auth password %s", auth.Password)
return EncodeAuth(auth)
}
return "", errors.New("Registry auth environment variables (REPO_USER, REPO_PASS) not set")
@ -69,6 +70,7 @@ func EncodedConfigAuth(ref string) (string, error) {
return "", nil
}
log.Debugf("Loaded auth credentials for user %s, on registry %s, from file %s", auth.Username, ref, configFile.Filename)
log.Tracef("Using auth password %s", auth.Password)
return EncodeAuth(auth)
}

Loading…
Cancel
Save