-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some features improvement #11
base: master
Are you sure you want to change the base?
Changes from 2 commits
bc790f8
c897017
a94d8cd
306b5d1
00ec833
b57358a
c0fa90c
98546e7
bb8899f
770ba4a
e352cb7
33d0bab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,8 @@ var ( | |
ver *bool | ||
// If true, https connection will ignore verification error | ||
insecure *bool | ||
// If ture, promote user to enter registry password | ||
enterPwd *bool | ||
) | ||
|
||
const ( | ||
|
@@ -63,6 +65,8 @@ func init() { | |
username = flag.String("username", "", "registry username to login") | ||
// registry password (default = "") | ||
password = flag.String("password", "", "registry password to login") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not fond of Plaintext passwords as args, we should do this in an extra step (just as |
||
// Promote to enter password | ||
enterPwd = flag.Bool("promote", false, "promote to enter password") | ||
// Maximum age of iamges to consider for deletion in days (default = 0) | ||
day = flag.Int("day", 0, "max age in days") | ||
// Maximum age of months to consider for deletion in days (default = 0) | ||
|
@@ -100,6 +104,12 @@ func main() { | |
if *debug { | ||
log.SetLevel(log.DebugLevel) | ||
} | ||
|
||
if *enterPwd { | ||
fmt.Println("Enter registry login password:") | ||
fmt.Scanln(password) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not the proper way to read passwords in terminal. See here |
||
} | ||
|
||
// Empty context for all requests in sequel | ||
ctx := context.Background() | ||
transport := http.DefaultTransport | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave this out and see if any value is given after
-password
or not. If not, prompt user.