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

Improve users management through the CLI (#6001) #10492

Merged
merged 556 commits into from
Oct 16, 2020

Conversation

ydelafollye
Copy link
Contributor

  • add user subcommand
  • add list, create, delete, change-password microcommands
  • delete create-user and change-password subcommands

@techknowlogick
Copy link
Member

Thanks for PR :) as this is draft I’ll just provide some guidance rather than a formal review. For the commands that have changed, could you add output if someone calls them what the new command will be?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 26, 2020
@ydelafollye
Copy link
Contributor Author

ydelafollye commented Feb 27, 2020

Thanks for your response, here are outputs for the commands :)
(it's very verbose so I created a file)

https://gist.github.com/ydelafollye/fd2016811178dfd294e76ec94d7bdd41

@codecov-io
Copy link

codecov-io commented Feb 27, 2020

Codecov Report

Merging #10492 into master will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10492      +/-   ##
==========================================
- Coverage   42.08%   42.05%   -0.03%     
==========================================
  Files         681      681              
  Lines       75115    75145      +30     
==========================================
- Hits        31609    31600       -9     
- Misses      38352    38390      +38     
- Partials     5154     5155       +1     
Impacted Files Coverage Δ
cmd/admin.go 0.00% <0.00%> (ø)
models/user.go 54.58% <0.00%> (-0.17%) ⬇️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
models/repo_mirror.go 2.38% <0.00%> (-11.91%) ⬇️
modules/cron/tasks_basic.go 87.35% <0.00%> (-3.45%) ⬇️
modules/notification/ui/ui.go 80.55% <0.00%> (-2.78%) ⬇️
modules/log/event.go 59.90% <0.00%> (-1.89%) ⬇️
modules/git/blame.go 75.43% <0.00%> (-1.76%) ⬇️
services/mirror/mirror.go 18.51% <0.00%> (-1.35%) ⬇️
models/notification.go 65.76% <0.00%> (-0.91%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4fbe645...1f47e3d. Read the comment docs.

@ydelafollye ydelafollye marked this pull request as ready for review February 27, 2020 01:17
@guillep2k guillep2k added this to the 1.12.0 milestone Feb 27, 2020
@guillep2k guillep2k added the type/enhancement An improvement of existing functionality label Feb 27, 2020
@guillep2k
Copy link
Member

Could you please also update the docs?
https://docs.gitea.io/en-us/command-line/

They're located at docs/content/doc/usage/command-line.en-us.md

Copy link
Member

@guillep2k guillep2k left a comment

Choose a reason for hiding this comment

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

Creating/deleting users in a separate instance might be a problem (e.g. xorm cache).

models/user.go Outdated Show resolved Hide resolved
models/user.go Outdated Show resolved Hide resolved
@a1012112796
Copy link
Member

Hello,I think It would be fun if you can add a way to import users by a csv file, thanks.

cmd/admin.go Show resolved Hide resolved
cmd/admin.go Outdated Show resolved Hide resolved
@lunny lunny added the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Mar 31, 2020
@lunny
Copy link
Member

lunny commented Mar 31, 2020

@a1012112796 I think we are waiting @ydelafollye's changes since we have some reviews.

@6543
Copy link
Member

6543 commented Apr 6, 2020

can somebody "update" this feature branch?

@ydelafollye
Copy link
Contributor Author

Hello there, are you waiting for me to do something else before approving?

@GiteaBot GiteaBot 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 May 11, 2020
@6543
Copy link
Member

6543 commented May 11, 2020

I like the more structured way :) admin -> user -> * action *

@lafriks lafriks modified the milestones: 1.12.0, 1.13.0 May 16, 2020
@lunny
Copy link
Member

lunny commented Jul 7, 2020

CI failed

@6543
Copy link
Member

6543 commented Jul 8, 2020

pleace Update Branch

@6543
Copy link
Member

6543 commented Jul 9, 2020

@ydelafollye lint error!

Make sure wiki editor sets wiki to true so gitea renders it as a wiki page.

Also change the context data attr for edit form. This looks wrong but everywhere else in our code assumes the urlPrefix to be just the repo url when rendering and manually adds /wiki to the rendered url regardless.

Fixes go-gitea#11540
lafriks and others added 20 commits July 31, 2020 14:30
…ne (go-gitea#11777)

* Make LogDescriptions race safe

* Add manager commands for pausing, resuming, adding and removing loggers

Signed-off-by: Andrew Thornton <[email protected]>

* Placate lint

* Ensure that file logger is run!

* Add support for smtp and conn

Signed-off-by: Andrew Thornton <[email protected]>

* Add release-and-reopen

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
…sitory's Clone From URL (go-gitea#12053)

* update the wiki repository remote origin go-gitea#12050

* wikiRemoteURL is under repo_module

* export WikiRemoteURL func

* remove redundant space and empty line

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
- Use system fonts only for text to avoid FOUT
- Move font-awesome to npm/webpack
- Move NotoColorEmoji to web_src
- Remove presumably unneccesary 'PT Sans Narrow'
- Simplify webpack import exclusions

Fixes: go-gitea#11818
Fixes: go-gitea#11814

Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
When attempting to verify subkeys the email address verification step
requires checking the emails however, these emails are not stored on
subkeys but instead on the primary key.

This PR will obtain the primaryKey and check against these emails too.

Fix go-gitea#12128

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
Previously this used a USB icon which required a separate font file used
nowhere else so replace it with a octicon and fix the background color
on arc-green too.
* Decrease the  num_stars when deleting a repo

fix go-gitea#11949

Signed-off-by: a1012112796 <[email protected]>

* Add migration

* use batch

* Apply suggestions from code review

Co-authored-by: Lauris BH <[email protected]>

* fix lint

* fix lint

* fix ci

* fix ci2

* add doctor

* duplicate code

* fix migration

* fix some nits

* add start

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
* Trim to 255 runes instead of bytes

Prevents invalid UTF-8 encoding for Description and Website. Refs go-gitea#7905

* Apply suggestions from code review

Co-authored-by: zeripath <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
* Remove newline when highlighting random chunks of code

Somewhere when tokenizing a newline gets added to code formatted by chroma. This breaks the case of 'added-code' inside of an 'added-line' in a diff. Just remove any newline when processing chunks of code since we don't need it.

Fixes go-gitea#12172

* don't process empty lines

* This is the proper way to fix this by telling chroma not to add the newline in the first place
* Enable Git Wire Protocol v2 over HTTP

* use RunInDirTimeoutEnv

* pass $HOME environment variable to git upload-pack
- Update all dependencies excluding octicons
- Configure new eslint 7.3.0 rules

Co-authored-by: techknowlogick <[email protected]>
@lunny
Copy link
Member

lunny commented Sep 10, 2020

Rebase seems broken.

@lunny lunny modified the milestones: 1.13.0, 1.14.0 Sep 10, 2020
@GiteaBot GiteaBot 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 Oct 16, 2020
@techknowlogick techknowlogick merged commit cb171db into go-gitea:master Oct 16, 2020
ivanvc added a commit to ivanvc/gitea that referenced this pull request Oct 16, 2020
…ments-in-pull-request-label-style

* origin/master:
  [skip ci] Updated translations via Crowdin
  Fix diff skipping lines (go-gitea#13154)
  Update go-version v1.2.3 -> v1.2.4 (go-gitea#13169)
  Vendor Update Go Libs (go-gitea#13166)
  Prevent panics with missing storage (go-gitea#13164)
  Improve users management through the CLI (go-gitea#6001) (go-gitea#10492)
  Change order of possible-owner organizations to alphabetical (go-gitea#13160)
  Slightly simplify the queue settings code to help reduce the risk of problems (go-gitea#12976)
  [Vendor] Update go-ldap to v3.2.4 (go-gitea#13163)
  [skip ci] Updated translations via Crowdin
  Update external-renderers.en-us.md (go-gitea#13165)
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 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. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.