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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
556 commits
Select commit Hold shift + click to select a range
9aebef4
Fix images in wiki edit preview (#11546)
mrsdizzie May 24, 2020
399fe30
Prevent empty query parameter being set on dashboard (#11561)
zeripath May 24, 2020
2dde170
Fix wrong milestone in webhook message (#11596)
gary-kim May 24, 2020
9f2f938
[skip ci] Updated translations via Crowdin
GiteaBot May 24, 2020
bc09785
When initialising repositories ensure that the user doing the creatio…
zeripath May 24, 2020
ec4676c
Fix inconsistent font size for markdown preview on new PR view (#11565)
CirnoT May 24, 2020
3f5719b
Add chocolatey package install instructions (#11586)
doggy8088 May 24, 2020
30d58ec
Do not show avatar for "{{user}} added X commits" (#11591)
CirnoT May 24, 2020
b0e5c72
Add warning to mailer documentation about authentication (#11563)
zeripath May 24, 2020
93cfec8
Fix margin for attached top header on code review (#11571)
CirnoT May 25, 2020
d63db47
Fix margin on PR form (#11566)
CirnoT May 25, 2020
969e612
Right-align status icon on pull request commit history (#11594)
CirnoT May 25, 2020
df51c5d
Style code review comment for arc-green (#11572)
CirnoT May 25, 2020
cae8954
Fix styling for PR merge section when no checks (#11609)
CirnoT May 25, 2020
446c73c
Make issues.force_push_codes message shorter (#11575)
CirnoT May 25, 2020
6c777d5
Fix missing styling for shabox on PR commit history (#11625)
CirnoT May 26, 2020
082df4c
[skip ci] Updated translations via Crowdin
GiteaBot May 26, 2020
a5156f5
Apply padding to approval icons on PR list (#11622)
CirnoT May 26, 2020
a751389
Fix numbr of files, total additions, and deletions (#11614)
zeripath May 26, 2020
6ddfb0b
Add link to owners election tickets, reorder to most-recent first (#1…
strk May 26, 2020
1d7f57d
[skip ci] Updated translations via Crowdin
GiteaBot May 26, 2020
18c335f
When must change password only show Signout (#11600)
zeripath May 26, 2020
83dc522
Fix alignment for commits on dashboard (#11595)
mrsdizzie May 27, 2020
3f7272f
[skip ci] Updated translations via Crowdin
GiteaBot May 27, 2020
ee1d1a7
Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635)
zeripath May 28, 2020
6a01886
Return json on 500 error from API (#11574)
6543 May 28, 2020
580be49
Handle expected errors in AddGPGkey API (#11644)
6543 May 28, 2020
371ee8a
Add debug option to hooks (#11624)
zeripath May 29, 2020
6ac6461
Default MSSQL port 0 to allow automatic detection by default (#11642)
zeripath May 29, 2020
b696fee
Exclude generated files from language statistics (#11653)
lafriks May 29, 2020
9fd31d2
translate: Change translate for admin.config.enable_captcha (#11657)
a1012112796 May 29, 2020
8e0c05e
Doctor check & fix db consistency (#11111)
6543 May 29, 2020
5f30b77
[skip ci] Updated translations via Crowdin
GiteaBot May 29, 2020
16ba303
Fix missing authorization check on pull for public repos of private/l…
CirnoT May 29, 2020
a2e30fe
Update emoji regex (#11584)
mrsdizzie May 29, 2020
1857768
Normalize avatar radius (#11589)
CirnoT May 29, 2020
8a72579
Add API Endpoint for Branch Creation (#11607)
tle-huu May 29, 2020
b22038f
Fix issue with DiffIndex on initial commit (#11677)
zeripath May 29, 2020
f362530
Add logging to long migrations (#11647)
zeripath May 29, 2020
32a9fcf
Make tabular menu styling consistent for arc-green (#11570)
CirnoT May 29, 2020
6c2b002
Change language statistics to save size instead of percentage (#11681)
lafriks May 30, 2020
6e23696
Fix language stat calculation (#11692)
CirnoT May 30, 2020
8d668c7
Update Caddy reverse-proxy instructions (#11655)
TheLastZombie May 31, 2020
08c74f6
Narrow down Edge version in browser support docs (#11640)
silverwind May 31, 2020
99ee0eb
models: include LFS when calculating repo size (#11060)
cuonglm May 31, 2020
192940f
Add changelog for 1.11.6 (#11695) (#11700)
guillep2k May 31, 2020
f29b101
Handle expected errors in FileCreate & FileUpdate API (#11643)
6543 May 31, 2020
73f440b
[skip ci] Updated translations via Crowdin
GiteaBot May 31, 2020
e0f7d79
Issue/Pull expose IsLocked Property on API (#11708)
6543 Jun 1, 2020
cddc418
log slow tests (#11487)
zeripath Jun 2, 2020
f287d33
Update emoji dataset with skin tone variants (#11678)
mrsdizzie Jun 2, 2020
6fcd6fc
Properly truncate system notices (#11714)
zeripath Jun 2, 2020
746a69e
Fix chardet test and add ordering option (#11621)
zeripath Jun 2, 2020
3d520af
Show full GPG commit status on PR commit history (#11702)
CirnoT Jun 3, 2020
40ef33e
Allow site admin to disable mirrors (#11740)
jolheiser Jun 3, 2020
72d0b73
[Contrib] Change License Link to Full CC0 Legalcode (PP and TOS) (#10…
bagasme Jun 3, 2020
319dff6
Add missing templates (#11729)
S7evinK Jun 3, 2020
e8c633f
Fix styling for commiter on diff view (#11715)
CirnoT Jun 3, 2020
a797c15
bug: fix wrong poster message for code comment on Pull view (#11721)
a1012112796 Jun 3, 2020
ccc712a
[skip ci] Updated translations via Crowdin
GiteaBot Jun 3, 2020
7c81ee3
Update from-package.zh-tw.md (#11626)
doggy8088 Jun 3, 2020
0124154
Fix message wrapping on PR commit list (#11616)
CirnoT Jun 3, 2020
a01d040
[skip ci] Updated translations via Crowdin
GiteaBot Jun 3, 2020
b33f2d4
export monaco editor on window.codeEditors (#11739)
silverwind Jun 3, 2020
afc2333
Fix verification of subkeys of default gpg key (#11713)
zeripath Jun 3, 2020
db54b71
[skip ci] Updated translations via Crowdin
GiteaBot Jun 3, 2020
6eb18a6
[API] on 500 error only show message if gitea in dev mode (#11641)
6543 Jun 3, 2020
262ed2b
[skip ci] Updated translations via Crowdin
GiteaBot Jun 3, 2020
01cef4f
Don't put integration test data outside of test folder (#11746)
mrsdizzie Jun 3, 2020
9d9c136
Alpine 3.12 (#11720)
techknowlogick Jun 3, 2020
8d92802
Update fomantic-ui to 2.8.5 (#11736)
silverwind Jun 4, 2020
0178bbf
Include query in sign in redirect (#11579)
mrsdizzie Jun 4, 2020
6757c0d
[API] Expose allowed Reactions (#11735)
6543 Jun 4, 2020
f92edf7
API: Return error when Mirrors globaly disabled and like to create on…
6543 Jun 4, 2020
8fddeeb
Fix bug with globally disabling mirror (#11760)
6543 Jun 4, 2020
4bfb0ad
European Portuguese translation (#11568)
emansije Jun 5, 2020
dd5983f
Fix to allow comment poster to edit or delete his own comments (#11671)
a1012112796 Jun 5, 2020
8f97277
Provide diff and patch API endpoints (#11751)
zeripath Jun 5, 2020
6a11203
Add internal-repo octicon for public repos of private org (#11529)
CirnoT Jun 5, 2020
b8452ad
Fix typo (#11773)
successgo Jun 5, 2020
8b9a90f
[skip ci] Updated translations via Crowdin
GiteaBot Jun 5, 2020
dca9a16
Add compare link to releases (#11752)
jolheiser Jun 5, 2020
32bfe50
Add hide activity option (#11353)
l-jonas Jun 5, 2020
f7583ca
[skip ci] Updated translations via Crowdin
GiteaBot Jun 5, 2020
40bd1d5
Dump: add output format tar and output to stdout (#10376)
PhilippHomann Jun 5, 2020
85499a8
[skip ci] Updated translations via Crowdin
GiteaBot Jun 5, 2020
0524a25
Fix timezone on issue deadline (#11697)
CirnoT Jun 5, 2020
2af091e
[skip ci] Updated translations via Crowdin
GiteaBot Jun 5, 2020
493d1d6
Increase maximum SQLite variables count to 32766 (#11696)
CirnoT Jun 5, 2020
27c4a08
1.11.6 is latest version (#11780)
techknowlogick Jun 6, 2020
fe78b4f
Initialize SimpleMDE when making a code comment (#11749)
zeripath Jun 6, 2020
e530f6d
[skip ci] Updated translations via Crowdin
GiteaBot Jun 6, 2020
29cb97d
Fix align issues and decrease avatar size on PR timeline (#11689)
CirnoT Jun 6, 2020
73fb2f2
[skip ci] Updated translations via Crowdin
GiteaBot Jun 6, 2020
1467092
Fix missing CGO_EXTRA_FLAGS build arg for docker (#11782)
CirnoT Jun 6, 2020
a0d8ebc
Fix visibility of forked public repos from private orgs (#11717)
CirnoT Jun 7, 2020
a282991
Add language statistics API endpoint (#11737)
lafriks Jun 7, 2020
f880a03
[skip ci] Updated translations via Crowdin
GiteaBot Jun 7, 2020
e38eba1
Fix doer of rename repo (#11789)
a1012112796 Jun 7, 2020
10fb242
[skip ci] Updated translations via Crowdin
GiteaBot Jun 7, 2020
5b06f90
In File Create/Update API return 404 if Branch does not exist (#11791)
6543 Jun 7, 2020
fdff2e8
Work around fomantic 2.8.5 bugs (#11767)
CirnoT Jun 7, 2020
dee33df
Add option to API to update PullRequest base branch (#11666)
6543 Jun 7, 2020
661c33c
Ensure rejected push to refs/pull/index/head fails nicely (#11724)
zeripath Jun 8, 2020
8117a23
[skip ci] Updated translations via Crowdin
GiteaBot Jun 8, 2020
cd3c9c4
give gitea time to calculate language stats (#11812)
6543 Jun 9, 2020
a988057
Honor DEFAULT_PAGING_NUM for API (#11805)
CirnoT Jun 9, 2020
4d01190
Remove page size limit comment from swagger (#11806)
CirnoT Jun 9, 2020
b7dd0fd
Use crispEdges rendering for octicon-internal-repo (#11801)
CirnoT Jun 9, 2020
3dde1b4
Fix reply octicon (#11821)
jolheiser Jun 9, 2020
5b75f9e
Refactor: Remove Dependencys from Migration v112-v119 (#11811)
6543 Jun 9, 2020
9481d81
rework eslint config (#11615)
silverwind Jun 9, 2020
d18205c
API allow to create closed milestones (#11745)
6543 Jun 9, 2020
9cd3512
API expose usefull General Repo settings settings (#11758)
6543 Jun 10, 2020
bd25e14
[skip ci] Updated translations via Crowdin
GiteaBot Jun 10, 2020
8684090
fix a small nit (#11834)
a1012112796 Jun 10, 2020
26bb724
Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (…
CirnoT Jun 10, 2020
9fe48da
Fix inserting excerpt on compare diff (#11833)
CirnoT Jun 10, 2020
40341bf
Replace jquery-datetimepicker with native date input (#11684)
silverwind Jun 10, 2020
6e7bcf9
Re-center the cog on the center of the lock (#11844)
zeripath Jun 10, 2020
9fcc8f2
Don't add same line code comment box twice (#11837)
silverwind Jun 10, 2020
32253f8
Don't consider tag refs as valid for branch name (#11847)
CirnoT Jun 10, 2020
3c760c5
Update JS dependencies (#11842)
silverwind Jun 11, 2020
789b642
Set the base url when migrating from Gitlab using access token or use…
gernoteger Jun 11, 2020
8d82012
Prevent panic on empty HOST for mysql (#11850)
zeripath Jun 11, 2020
4ee891b
cloudron: update link to demo (#11857)
gramakri Jun 11, 2020
a8bf66c
Show exact tag for commit on diff view (#11846)
CirnoT Jun 11, 2020
f933242
Add migration to set IsArchived false if it is null (#11853)
zeripath Jun 11, 2020
14bce84
Improve label edit buttons labels (#11841)
silverwind Jun 11, 2020
ce1d709
Fix commit search in all branches (#11849)
CirnoT Jun 11, 2020
d1cb2f6
[skip ci] Updated translations via Crowdin
GiteaBot Jun 11, 2020
899aae2
Handle more pathological branch and tag names (#11843)
zeripath Jun 11, 2020
aa9594d
Fix search form button overlap (#11840)
CirnoT Jun 12, 2020
bb8eca3
[skip ci] Updated translations via Crowdin
GiteaBot Jun 12, 2020
bacc22e
Fix nil pointer in default issue mail template (#11862)
mrsdizzie Jun 12, 2020
eeb0bfc
Add automatic JS license generation (#11810)
silverwind Jun 12, 2020
aa894f2
Fix 500 error on repos with no tags (#11870)
mrsdizzie Jun 12, 2020
d5e627f
[skip ci] Updated translations via Crowdin
GiteaBot Jun 12, 2020
c3c7a9c
Fix repo internal icon when avatar is present (#11873)
CirnoT Jun 12, 2020
f670b6c
Disable all typographic replacements in markdown renderer (#11871)
silverwind Jun 13, 2020
f85efe6
Rework api/user/repos for pagination (#11827)
CirnoT Jun 13, 2020
38642fc
ui: Show update branch item in merge box when it's necessary (#11761)
a1012112796 Jun 13, 2020
4d7e78e
Only write to global gitconfig if necessary (#11876)
zeripath Jun 13, 2020
b2ab0e8
Invalidate comments when file is shortened (#11882)
zeripath Jun 14, 2020
fb11659
[skip ci] Updated translations via Crowdin
GiteaBot Jun 14, 2020
5dc8207
Better align items using flex within review request box (#11879)
CirnoT Jun 15, 2020
174cdd3
Vertically align review icons on repository sidebar (#11880)
CirnoT Jun 15, 2020
74f3d7c
[skip ci] Updated translations via Crowdin
GiteaBot Jun 15, 2020
817656e
Rework blame template and styling (#11885)
CirnoT Jun 15, 2020
639b747
Fix alignment for show/hide outdated link on resolved conversation (#…
CirnoT Jun 15, 2020
69a49a4
Upgrade xorm to v1.0.2 (#11900)
lunny Jun 15, 2020
ab3762b
Make repository size unclickable on repo summary bar (#11887)
CirnoT Jun 16, 2020
c7a2f71
pq -> v1.7.0 (#11905)
techknowlogick Jun 16, 2020
a591288
UI: Fix wrong closing tag (#11910)
6543 Jun 16, 2020
ede58eb
Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912)
6543 Jun 16, 2020
16d2ca0
Fix double divider on issue sidebar (#11919)
CirnoT Jun 17, 2020
a1b69de
Use ID or Where to instead directly use Get when load object from dat…
lunny Jun 17, 2020
6c84648
upgrade to use testfixtures v3 (#11904)
techknowlogick Jun 17, 2020
03a476f
Global default branch setting (#11918)
techknowlogick Jun 17, 2020
938eaf4
Update to go-git v5.1.0 (#11936)
zeripath Jun 17, 2020
6b2f705
Align show/hide outdated button on code review block (#11932)
CirnoT Jun 18, 2020
661e813
Update Fomantic-UI to 2.8.6 and remove old workarounds (#11933)
CirnoT Jun 18, 2020
c1ee70b
Rename custom/conf/app.ini.sample to custom/conf/app.example.ini for …
lunny Jun 18, 2020
d2ba000
Use google/uuid to instead satori/go.uuid (#11943)
lunny Jun 18, 2020
2bcb3b8
Fix commenting on non-utf8 encoded files (#11916)
zeripath Jun 18, 2020
8c7f6de
recommend bindata for building (#11938)
techknowlogick Jun 18, 2020
dbe79e7
Changelog v1.11.7 (#11953) (#11956)
6543 Jun 18, 2020
f646707
Changelog v1.12.0 (#11927) (#11957)
6543 Jun 18, 2020
4bd316b
Fix scrollable header on dropdowns (#11893)
CirnoT Jun 18, 2020
aa802b1
Update docs to specify utf8mb4 default (#11962)
silverwind Jun 18, 2020
e010af1
1.12.0 is latest stable version (#11964)
techknowlogick Jun 18, 2020
a383350
Use only first line of commit when creating referenced comment (#11960)
CirnoT Jun 19, 2020
833e10e
For language detection do not try to analyze big files by content (#1…
lafriks Jun 19, 2020
f060a20
Use enry language type to detect special languages (#11974)
lafriks Jun 19, 2020
82f6640
Add serviceworker.js to KnownPublicEntries (#11992)
silverwind Jun 20, 2020
f0e0072
Add public/img/svg to WEBPACK_DEST_ENTRIES (#11993)
silverwind Jun 20, 2020
4bdd4cf
Handle multiple merges in gitgraph.js (#11996)
zeripath Jun 20, 2020
011b2ae
Add pagination headers on endpoints that support total count from dat…
CirnoT Jun 21, 2020
1bde14a
Adds a TODOs Badge to the README (#11999)
patrickdevivo Jun 21, 2020
e9237f3
Use octicons for all repo header buttons (#11890)
CirnoT Jun 21, 2020
6c006d5
Fix missing styling for dropdown icon on review button (#11998)
CirnoT Jun 22, 2020
563572b
Changelog for v1.11.8 and v1.12.1 (#12006) (#12007)
lafriks Jun 22, 2020
2ad9ce8
Fix typo (#12013)
successgo Jun 22, 2020
bef9356
Make tabs smaller (#12003)
silverwind Jun 22, 2020
f85972e
API: Move AllowedReactions endpoint into GetGenneralUI endpoint + cre…
6543 Jun 22, 2020
9a04944
Fix sticky diff stats container (#12002)
CirnoT Jun 22, 2020
d0b8ee1
Use label to describe repository type (#11891)
CirnoT Jun 22, 2020
0aaba3b
Disable dropzone's timeout (#12024)
silverwind Jun 24, 2020
ed640aa
[skip ci] Updated translations via Crowdin
GiteaBot Jun 24, 2020
4c4abb1
Don't use -webkit-font-smoothing (#12029)
mrsdizzie Jun 24, 2020
bebbf01
fix bug about can't skip commits base on base branch (#11555)
a1012112796 Jun 24, 2020
0d24c06
[UI] Sortable Tables Header By Click (#7980)
6543 Jun 24, 2020
3cf3e2f
Update Goldmark v1.1.25 -> v1.1.32 (#12048)
6543 Jun 25, 2020
7cbbbd4
Fix comments webhook panic (#12046)
cornelk Jun 25, 2020
bb2fa20
Fix gitgraph branch continues after merge (#12044)
zeripath Jun 25, 2020
e8f63ad
Use Fomantic's fluid padded for blame full width (#12023)
CirnoT Jun 25, 2020
143bddb
Add org avatar on top of internal repo icon (#11895)
CirnoT Jun 26, 2020
0866015
Show description on individual milestone view (#12055)
mrsdizzie Jun 26, 2020
b1fc8b9
Shorten markdown heading anchors links (#11903)
silverwind Jun 26, 2020
91c620b
[skip ci] Updated translations via Crowdin
GiteaBot Jun 26, 2020
c115fb4
Disable go module when downloading global binaries (#12030)
silverwind Jun 26, 2020
3f7a39a
Fix some periods and language usage in en-US locale (#12067)
linkjay Jun 27, 2020
ddeca12
Fix swagger docs for /repos/issues (#12069)
CirnoT Jun 27, 2020
f0fb491
[skip ci] Updated translations via Crowdin
GiteaBot Jun 27, 2020
868b917
Do not override API issue pagination with UI settings (#12068)
CirnoT Jun 27, 2020
e11abc2
Move fomantic and jQuery to main webpack bundle (#11997)
silverwind Jun 28, 2020
9cf0e9f
Use custom SVGs for commit signing lock icon (#12017)
CirnoT Jun 28, 2020
4f9107e
Fix potential make error related to fomantic files (#12079)
silverwind Jun 29, 2020
89b7ebc
Fix commit icon position (#12087)
lafriks Jun 30, 2020
845b9f1
Server-side syntax highlighting for all code (#12047)
mrsdizzie Jun 30, 2020
0e553e3
Fix merge section in dark theme (#12086)
lafriks Jun 30, 2020
4d1edb8
Ensure BlameReaders close at end of request (#12102)
zeripath Jul 1, 2020
7f27870
Improve arc-green code colors (#12111)
silverwind Jul 1, 2020
2221c54
[skip ci] Updated translations via Crowdin
GiteaBot Jul 1, 2020
f767a5a
Fix missing gitgraph css import (#12112)
silverwind Jul 1, 2020
2ffcd54
Provide option to unlink a fork (#11858)
zeripath Jul 2, 2020
a8c803a
Fix repo API listing stability (#12057)
cboylan Jul 2, 2020
73c86fa
[skip ci] Updated translations via Crowdin
GiteaBot Jul 2, 2020
680d4f5
Fix ui bug in wiki commit page (#12089)
a1012112796 Jul 2, 2020
cf4bdb1
Move EventSource to SharedWorker (#12095)
zeripath Jul 3, 2020
d35a447
templates/repo/empty.tmpl : fix repo setup instructions (#12122)
ashimokawa Jul 3, 2020
71f3e1f
Bugfix for shared event source (#12129)
zeripath Jul 4, 2020
fb2723c
Re-fix #12095 again (#12138)
zeripath Jul 4, 2020
690ce52
Rewrite GitGraph.js (#12137)
zeripath Jul 5, 2020
d4455f1
Remove spurious logging (#12139)
zeripath Jul 5, 2020
7e405da
Enable a few more eslint rules (#12145)
silverwind Jul 5, 2020
1d583c4
properly set symbolic-ref HEAD when a repo is created with a non-mast…
xenofem Jul 5, 2020
fa15381
Ensure tabs wrap correctly on user profile page (#12144)
scar45 Jul 5, 2020
00b1cf1
Multiple small admin dashboard fixes (#12153)
zeripath Jul 5, 2020
b68d3cf
Use hash of repo path, ref and entrypath as cache key (#12151)
lafriks Jul 5, 2020
c4645d4
[skip ci] Updated translations via Crowdin
GiteaBot Jul 5, 2020
5c46132
Pause, Resume, Release&Reopen, Add and Remove Logging from command li…
zeripath Jul 6, 2020
ef62887
Update the wiki repository remote origin while update the mirror repo…
yisiliang Jul 6, 2020
a8b61c6
Fonts rework (#12114)
silverwind Jul 6, 2020
b06bdba
[skip ci] Updated translations via Crowdin
GiteaBot Jul 6, 2020
c3fb904
models: break out of loops (#12159)
alrs Jul 6, 2020
c479749
fix a spelling error (#12163)
9nix00 Jul 6, 2020
1d554d5
Ensure Subkeys are verified (#12155)
zeripath Jul 6, 2020
ef37f0f
Fix U2F button icon (#12167)
silverwind Jul 6, 2020
409a8ae
Adjust margin-top for repo header label (#12174)
CirnoT Jul 7, 2020
1e35e98
Decrease the num_stars when deleting a repo (#11954)
a1012112796 Jul 7, 2020
6543353
Trim to 255 runes instead of bytes (#12150)
juergenhoetzel Jul 7, 2020
0b5b3a3
Remove newline when highlighting random chunks of code (#12180)
mrsdizzie Jul 7, 2020
adc87c5
Enable cloning via Git Wire Protocol v2 over HTTP (#12170)
billiegoose Jul 7, 2020
c1815ef
Update JS dependencies (#12181)
silverwind Jul 8, 2020
bb4c84b
Fix regression: Gitea commits API again returns commit summaries, not…
kbadk Jul 8, 2020
ef132f1
Merge branch 'CLI_users' of https://github.com/ydelafollye/gitea into…
Jul 31, 2020
c7c738f
Revert "Update models/user.go"
Jul 31, 2020
3990ea2
Merge branch 'master' into CLI_users
zeripath Jul 31, 2020
1f47e3d
Merge branch 'master' into CLI_users
techknowlogick Oct 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 84 additions & 5 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,38 @@ var (
Name: "admin",
Usage: "Command line interface to perform common administrative operations",
Subcommands: []cli.Command{
subcmdCreateUser,
subcmdChangePassword,
subcmdUser,
subcmdRepoSyncReleases,
subcmdRegenerate,
subcmdAuth,
},
}

subcmdCreateUser = cli.Command{
Name: "create-user",
subcmdUser = cli.Command{
Name: "user",
Usage: "Modify users",
Subcommands: []cli.Command{
microcmdUserCreate,
microcmdUserList,
microcmdUserChangePassword,
microcmdUserDelete,
},
}

microcmdUserList = cli.Command{
Name: "list",
Usage: "List users",
Action: runListUsers,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "admin",
Usage: "List only admin users",
},
},
}

microcmdUserCreate = cli.Command{
Name: "create",
Usage: "Create a new user in database",
Action: runCreateUser,
Flags: []cli.Flag{
Expand Down Expand Up @@ -83,7 +105,7 @@ var (
},
}

subcmdChangePassword = cli.Command{
microcmdUserChangePassword = cli.Command{
Name: "change-password",
Usage: "Change a user's password",
Action: runChangePassword,
Expand All @@ -101,6 +123,13 @@ var (
},
}

microcmdUserDelete = cli.Command{
Name: "delete",
Usage: "Delete specific user",
Flags: []cli.Flag{idFlag},
Action: runDeleteUser,
}

subcmdRepoSyncReleases = cli.Command{
Name: "repo-sync-releases",
Usage: "Synchronize repository releases with tags",
Expand Down Expand Up @@ -377,6 +406,56 @@ func runCreateUser(c *cli.Context) error {
return nil
}

func runListUsers(c *cli.Context) error {
if err := initDB(); err != nil {
return err
}

users, err := models.GetAllUsers()
ydelafollye marked this conversation as resolved.
Show resolved Hide resolved

if err != nil {
return err
}

w := tabwriter.NewWriter(os.Stdout, 5, 0, 1, ' ', 0)

if c.IsSet("admin") {
fmt.Fprintf(w, "ID\tUsername\tEmail\tIsActive\n")
for _, u := range users {
if u.IsAdmin {
fmt.Fprintf(w, "%d\t%s\t%s\t%t\n", u.ID, u.Name, u.Email, u.IsActive)
}
}
} else {
fmt.Fprintf(w, "ID\tUsername\tEmail\tIsActive\tIsAdmin\n")
for _, u := range users {
fmt.Fprintf(w, "%d\t%s\t%s\t%t\t%t\n", u.ID, u.Name, u.Email, u.IsActive, u.IsAdmin)
}

}

w.Flush()
return nil

}

func runDeleteUser(c *cli.Context) error {
if !c.IsSet("id") {
return fmt.Errorf("--id flag is missing")
}

if err := initDB(); err != nil {
return err
}

user, err := models.GetUserByID(c.Int64("id"))
if err != nil {
return err
}

return models.DeleteUser(user)
}

func runRepoSyncReleases(c *cli.Context) error {
if err := initDB(); err != nil {
return err
Expand Down
50 changes: 31 additions & 19 deletions docs/content/doc/usage/command-line.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,40 @@ Starts the server:
Admin operations:

- Commands:
- `create-user`
- Options:
- `--name value`: Username. Required. As of gitea 1.9.0, use the `--username` flag instead.
- `--username value`: Username. Required. New in gitea 1.9.0.
- `--password value`: Password. Required.
- `--email value`: Email. Required.
- `--admin`: If provided, this makes the user an admin. Optional.
- `--access-token`: If provided, an access token will be created for the user. Optional. (default: false).
- `--must-change-password`: If provided, the created user will be required to choose a newer password after
- `user`:
- `list`:
- Options:
- `--admin`: List only admin users. Optional.
- Description: lists all users that exist
- Examples:
- `gitea admin user list`
- `delete`:
- Options:
- `--id`: ID of user to be deleted. Required.
- Examples:
- `gitea admin user delete --id 1`
- `create`:
- Options:
- `--name value`: Username. Required. As of gitea 1.9.0, use the `--username` flag instead.
- `--username value`: Username. Required. New in gitea 1.9.0.
- `--password value`: Password. Required.
- `--email value`: Email. Required.
- `--admin`: If provided, this makes the user an admin. Optional.
- `--access-token`: If provided, an access token will be created for the user. Optional. (default: false).
- `--must-change-password`: If provided, the created user will be required to choose a newer password after
the initial login. Optional. (default: true).
- ``--random-password``: If provided, a randomly generated password will be used as the password of
- ``--random-password``: If provided, a randomly generated password will be used as the password of
the created user. The value of `--password` will be discarded. Optional.
- `--random-password-length`: If provided, it will be used to configure the length of the randomly
- `--random-password-length`: If provided, it will be used to configure the length of the randomly
generated password. Optional. (default: 12)
- Examples:
- `gitea admin create-user --username myname --password asecurepassword --email [email protected]`
- `change-password`
- Options:
- `--username value`, `-u value`: Username. Required.
- `--password value`, `-p value`: New password. Required.
- Examples:
- `gitea admin change-password --username myname --password asecurepassword`
- Examples:
- `gitea admin create-user --username myname --password asecurepassword --email [email protected]`
- `change-password`:
- Options:
- `--username value`, `-u value`: Username. Required.
- `--password value`, `-p value`: New password. Required.
- Examples:
- `gitea admin change-password --username myname --password asecurepassword`
- `regenerate`
- Options:
- `hooks`: Regenerate git-hooks for all repositories
Expand Down
6 changes: 6 additions & 0 deletions models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ func (u *User) GetEmail() string {
return u.Email
}

// GetAllUsers returns a slice of all users found in DB.
func GetAllUsers() ([]*User, error) {
users := make([]*User, 0)
return users, x.OrderBy("id").Find(&users)
}
ydelafollye marked this conversation as resolved.
Show resolved Hide resolved

// APIFormat converts a User to api.User
func (u *User) APIFormat() *api.User {
if u == nil {
Expand Down