Skip to content
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

Add change-password admin command #1304

Merged
merged 4 commits into from
Mar 20, 2017
Merged

Conversation

strk
Copy link
Member

@strk strk commented Mar 17, 2017

Not working yet, need help

cmd/admin.go Outdated

subcmdChangePassword = cli.Command{
Name: "change-password",
Usage: "Print encoded version of a given password",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not being printed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant, that the encoded password isn't being printed. Should the usage not just be "change password of a user" ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, of course, will fix and squash

@strk
Copy link
Member Author

strk commented Mar 17, 2017 via email

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 17, 2017
@appleboy
Copy link
Member

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 17, 2017
@strk strk changed the title Add change-password admin command (panicing) Add change-password admin command Mar 17, 2017
@strk
Copy link
Member Author

strk commented Mar 17, 2017

@ptman better now ?

Do you think an error should be printed for users whose LoginSource != LOCAL/PLAIN ?
(but note that the OAuth2 users still have a broken LoginSource: #1143)

@ptman
Copy link
Contributor

ptman commented Mar 17, 2017

Yes, much better. And you're right about giving an error for users where it wouldn't be effective or some other method may still allow them to log in (if trying to disable with password change)

@strk
Copy link
Member Author

strk commented Mar 17, 2017

@ptman I'd postpone that part to after #1143 is done, or I'd have to add more conditionals there to deal with OAuth2 in a special way, which I'd hate...

@lunny lunny added this to the 1.2.0 milestone Mar 18, 2017
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Mar 18, 2017
@@ -57,8 +58,59 @@ to make automatic initialization process more smoothly`,
},
},
}

subcmdChangePassword = cli.Command{
Name: "change-password",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just password?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason, this was suggested by @bkcsoft on IRC if I recall correctly, and I thought it was a clean and self-describing name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change-password is too long for a command, I think password is better!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vote password

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lunny @appleboy we already have create-user so I don't really see the issue with change-password. Then it becomes self-explaining :)

@pgaskin
Copy link
Contributor

pgaskin commented Mar 18, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 18, 2017
@strk
Copy link
Member Author

strk commented Mar 19, 2017 via email

cmd/admin.go Outdated
Action: runChangePassword,
Flags: []cli.Flag{
cli.StringFlag{
Name: "username",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support -u or --username. Maybe username,u

cmd/admin.go Outdated
Usage: "Username",
},
cli.StringFlag{
Name: "password",
Copy link
Member

@appleboy appleboy Mar 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support -p or --password. Maybe password,p

@lunny
Copy link
Member

lunny commented Mar 19, 2017

agree with @appleboy

@strk
Copy link
Member Author

strk commented Mar 19, 2017

This PR has 2 LGTM, please merge

@appleboy
Copy link
Member

@strk Do you see my suggestions about adding more flags?

@strk
Copy link
Member Author

strk commented Mar 19, 2017

@appleboy added -u and -p options, and rebased

@strk
Copy link
Member Author

strk commented Mar 19, 2017

so I'm also happy with just "passwd" as the admin name (to reflect the unix command) but as the only existing command is create-user I think it's consistent to have change-password as is. Can it be merged now ? (the rules say 2 LGTM are enough to merge...)

Copy link
Member

@tboerger tboerger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I would prefer a user sub-command instead of admin.

cmd/admin.go Outdated
cli.StringFlag{
Name: "username,u",
Value: "",
Usage: "Username",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty useless usage information.

cmd/admin.go Outdated
cli.StringFlag{
Name: "password,p",
Value: "",
Usage: "Password",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty useless usage information.

@strk
Copy link
Member Author

strk commented Mar 19, 2017

If every single maintainer complains about something this will become much slower than Gogs. It's already happening that Gogs is ahead. This PR got 2 positive reviews, so about the rules it should just be merged.

If you think maintainers should also have veto powers so please add a section about that in the CONTRIBUTING.md file.

@bkcsoft
Copy link
Member

bkcsoft commented Mar 20, 2017

@tboerger don't really see the point of having gitea user [...] since they are inheritly admin commands 😉

@bkcsoft
Copy link
Member

bkcsoft commented Mar 20, 2017

LGTM working?

@appleboy
Copy link
Member

LGTM is working but waiting build status.

@appleboy
Copy link
Member

@bkcsoft Thanks for improving usage information

@bkcsoft bkcsoft merged commit e158689 into go-gitea:master Mar 20, 2017
@strk strk deleted the change-password branch March 20, 2017 08:35
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants