]> source.dussan.org Git - gitea.git/log
gitea.git
4 years agoAdd missing commit states to PR checks template (#11085)
CirnoT [Thu, 16 Apr 2020 19:08:20 +0000 (21:08 +0200)]
Add missing commit states to PR checks template (#11085)

* Add missing commit states to PR checks template

* Add separate translation strings for warning and error

* Fix failure status string

* Revert accidental change with whitespace

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 16 Apr 2020 15:35:01 +0000 (15:35 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoRemove nonexistant serviceworker entries (#11091)
silverwind [Thu, 16 Apr 2020 15:33:22 +0000 (17:33 +0200)]
Remove nonexistant serviceworker entries (#11091)

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 16 Apr 2020 10:45:52 +0000 (10:45 +0000)]
[skip ci] Updated translations via Crowdin

4 years ago[BugFix] ReviewCount: GetApprovalCounts func sorted wrong (#11086)
6543 [Thu, 16 Apr 2020 10:44:34 +0000 (12:44 +0200)]
[BugFix] ReviewCount: GetApprovalCounts  func sorted wrong (#11086)

* FIX by simplify

* code reformat and optimize

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 15 Apr 2020 20:36:28 +0000 (20:36 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix merge dialog on protected branch with missing required statuses (#11074)
6543 [Wed, 15 Apr 2020 20:35:18 +0000 (22:35 +0200)]
Fix merge dialog on protected branch with missing required statuses (#11074)

It is possible for misconfigured protected branches to have required status checks that are not in any of the current statuses: Pending, Success, Error, Failure, or Warning - presumably because the CI has not contacted us as yet.

Fix #10636 by adding case: missing StatusChecks when these are missing

4 years agoAlign review-item svg octicons (#11065)
CirnoT [Wed, 15 Apr 2020 18:41:55 +0000 (20:41 +0200)]
Align review-item svg octicons (#11065)

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 15 Apr 2020 17:42:06 +0000 (17:42 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoMigrate to go-enry new version (#10906)
Lauris BH [Wed, 15 Apr 2020 17:40:39 +0000 (20:40 +0300)]
Migrate to go-enry new version (#10906)

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 15 Apr 2020 13:04:26 +0000 (13:04 +0000)]
[skip ci] Updated translations via Crowdin

4 years agodocument 404 responce and meaning (#11073)
6543 [Wed, 15 Apr 2020 13:03:05 +0000 (15:03 +0200)]
document 404 responce and meaning (#11073)

4 years agoContents API should return 404 on not exist (#10323)
zeripath [Wed, 15 Apr 2020 05:18:51 +0000 (06:18 +0100)]
Contents API should return 404 on not exist (#10323)

* Return 404 on not exist

* swagger update and use git.IsErrNotExist

* Handle delete too

* Handle delete too x2

* Fix pr 10323 (#3)

* fix TESTS

* leafe a note for fututre

* placate golangci-lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update integrations/api_repo_file_delete_test.go

Co-Authored-By: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoAdd translation head on docs site (#11063)
Lunny Xiao [Wed, 15 Apr 2020 04:42:09 +0000 (12:42 +0800)]
Add translation head on docs site (#11063)

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoReplace references to cron.update_migration_post_id with cron.update_migration_poster...
Kristian Antonsen [Wed, 15 Apr 2020 00:44:08 +0000 (02:44 +0200)]
Replace references to cron.update_migration_post_id with cron.update_migration_poster_id in docs (#11068)

Across several files, references to cron.update_migration_post_id are made, although the actual setting is called cron.update_migration_poster_id according to modules/setting/cron.go (https://github.com/go-gitea/gitea/blob/10e2f291442fdc7efc31c02f5ffcba79a36db9ac/modules/setting/cron.go#L54).

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
4 years agoFix Migration 136 (be less aggressive to open pulls missing git files) (#11072)
6543 [Tue, 14 Apr 2020 22:16:07 +0000 (00:16 +0200)]
Fix Migration 136 (be less aggressive to open pulls missing git files) (#11072)

* be less aggressife to open pulls when migrating

* remove unused

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 14 Apr 2020 18:33:15 +0000 (18:33 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoRemove check on username if AccessToken authentication (#11015)
zeripath [Tue, 14 Apr 2020 18:32:03 +0000 (19:32 +0100)]
Remove check on username if AccessToken authentication (#11015)

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agofix (#11066)
6543 [Tue, 14 Apr 2020 16:29:31 +0000 (18:29 +0200)]
fix (#11066)

4 years agoCache PullRequest Divergence (#10914)
6543 [Tue, 14 Apr 2020 13:53:34 +0000 (15:53 +0200)]
Cache PullRequest Divergence (#10914)

* Cache PullRequest Divergence

* only re-calc divergence if AddTestPullRequestTask() is exec

* migrate already open pulls

* finalize

* take care of closed&not-merged+deleted-branch pull requests

* fix nil pointer exeption

Signed-off-by: 6543 <6543@obermui.de>
* try this

* no error its a warn

* init gitea-repositories-meta

* dont use gitDivergence type

* CI.restart()

* CI.restart()

* CI.restart()

* CI.restart()

* check IsUserAllowedToUpdate independend from CommitsBehind

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 14 Apr 2020 11:38:33 +0000 (11:38 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoui: Change icon on title for merged PR to git-merge (#11064)
赵智超 [Tue, 14 Apr 2020 11:37:10 +0000 (19:37 +0800)]
ui: Change icon on title for merged PR to git-merge (#11064)

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years agoAdd charset handling to backup/restore doc (#11062)
maxm123 [Tue, 14 Apr 2020 02:55:20 +0000 (04:55 +0200)]
Add charset handling to backup/restore doc (#11062)

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoui: Add MergePull comment type instead of close for merge PR (#11058)
赵智超 [Tue, 14 Apr 2020 01:06:23 +0000 (09:06 +0800)]
ui: Add MergePull comment type instead of close for merge PR (#11058)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoFix language label vertical alignment (#11061)
silverwind [Mon, 13 Apr 2020 20:00:32 +0000 (22:00 +0200)]
Fix language label vertical alignment (#11061)

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoReject duplicate AccessToken names (#10994)
6543 [Mon, 13 Apr 2020 19:02:48 +0000 (21:02 +0200)]
Reject duplicate AccessToken names (#10994)

* make sure duplicate token names cannot be used

* add check to api routes too

* add @lunny s suggestion

* fix & don't forget User.ID

* AccessTokenByNameExists() return error too

* unique token for each test

* fix lint

Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: Lanre Adelowo <yo@lanre.wtf>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 13 Apr 2020 13:03:35 +0000 (13:03 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoMove syntax highlighting to web worker (#11017)
silverwind [Mon, 13 Apr 2020 13:02:31 +0000 (15:02 +0200)]
Move syntax highlighting to web worker (#11017)

This should eliminate page freezes when loading big files/diff.
`highlightBlock` is needed to preserve existing nodes when highlighting
and for that, highlight.js needs access to the DOM API so I added a DOM
implementation to make it work, which adds around 300kB to the output
file size of the lazy-loaded `highlight.js`.

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoadd 'make watch-frontend' and expand docs (#10931)
silverwind [Sun, 12 Apr 2020 03:50:59 +0000 (05:50 +0200)]
add 'make watch-frontend' and expand docs (#10931)

* add 'make watch-frontend' and expand docs

* add bindata note

* add .PHONY

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agofix 404 and 500 image size in small size screen (#11043)
赵智超 [Sat, 11 Apr 2020 20:31:17 +0000 (04:31 +0800)]
fix 404 and 500 image size in small size screen (#11043)

do it by define Semantic UI image class

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoTweak app.ini.sample (#11042)
silverwind [Sat, 11 Apr 2020 15:59:29 +0000 (17:59 +0200)]
Tweak app.ini.sample (#11042)

Few misc tweaks to the sample config

4 years agoFix CreateComment for SQLite and JS click event on Request Review (#11040)
赵智超 [Sat, 11 Apr 2020 04:44:50 +0000 (12:44 +0800)]
Fix CreateComment for SQLite and JS click event on Request Review (#11040)

* fix some bug about Request review

* fix ``CreateComment`` wrong using ,it will not work when use Sqlite
* fix wrong js click event code , it will send wrong data when it has
many choices

Signed-off-by: a1012112796 <1012112796@qq.com>
* Apply suggestions from code review

Co-Authored-By: Lauris BH <lauris@nix.lv>
* add getReviewerByIssueIDAndUserID
fix wrong conditions check in initIssueComments after #10972

* call CI again

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years ago[Docs] Cross Build Gitea from Source (#10999)
Bagas Sanjaya [Sat, 11 Apr 2020 03:13:31 +0000 (10:13 +0700)]
[Docs] Cross Build Gitea from Source (#10999)

* Add cross-build docs

Note that C cross compiler is required for building Gitea with `TAGS`.

* Apply suggestion from @mrsdizzie

Co-Authored-By: mrsdizzie <info@mrsdizzie.com>
* Apply suggestion from @guillep2k

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
4 years ago[Api] Check Notify (always return json) (#10059)
6543 [Fri, 10 Apr 2020 23:49:39 +0000 (01:49 +0200)]
[Api] Check Notify (always return json) (#10059)

* BEAKING: check return status based on struct not httpStatus

* update Tests

* CI.restart()

4 years agoPrettify Timeline (#10972)
Sorien [Fri, 10 Apr 2020 22:01:41 +0000 (00:01 +0200)]
Prettify Timeline (#10972)

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
4 years agoremove package code.gitea.io/gitea/modules/git import out of models (#11025)
6543 [Fri, 10 Apr 2020 11:26:37 +0000 (13:26 +0200)]
remove package code.gitea.io/gitea/modules/git import out of models (#11025)

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 10 Apr 2020 10:43:04 +0000 (10:43 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoLoad pr Issue Poster on API too (#11033)
6543 [Fri, 10 Apr 2020 10:40:36 +0000 (12:40 +0200)]
Load pr Issue Poster on API too (#11033)

4 years agoAdd Get/Update for api/v1/user/applications/oauth2 (#11008)
Dan Molik [Fri, 10 Apr 2020 00:37:31 +0000 (20:37 -0400)]
Add Get/Update for api/v1/user/applications/oauth2 (#11008)

Add api methods for getting and updating user oauth2 applications.

Signed-off-by: Dan Molik <dan@danmolik.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoAdd git hook tooltip (#11030)
John Olheiser [Thu, 9 Apr 2020 23:15:09 +0000 (18:15 -0500)]
Add git hook tooltip (#11030)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
4 years agoMatch arc-green code tag color to code blocks (#11023)
silverwind [Thu, 9 Apr 2020 19:03:14 +0000 (21:03 +0200)]
Match arc-green code tag color to code blocks (#11023)

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoui:Add flash notify for email preference seting success (#11027)
赵智超 [Thu, 9 Apr 2020 17:22:17 +0000 (01:22 +0800)]
ui:Add flash notify for email preference seting success (#11027)

* Add flash notify for email preference seting success

Signed-off-by: a1012112796 <1012112796@qq.com>
* add review suggest changes

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-Authored-By: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoHandle yaml frontmatter (#11016)
zeripath [Thu, 9 Apr 2020 10:54:50 +0000 (11:54 +0100)]
Handle yaml frontmatter (#11016)

Add goldmark-meta to render yaml frontmatter as a table

Fix #5377

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agointegrations: deprecate HeaderMaps (#11018)
Lars Lehtonen [Wed, 8 Apr 2020 23:30:03 +0000 (16:30 -0700)]
integrations: deprecate HeaderMaps (#11018)

4 years agoFix forked repo has no icon and language stat. (#10791)
L0veSunshine [Wed, 8 Apr 2020 12:13:04 +0000 (20:13 +0800)]
Fix forked repo has no icon and language stat. (#10791)

* Update header.tmpl

* Update _repository.less

* Update pull.go

* Update indexer.go

* Update pull.go

* Update pull.go

* Update indexer.go

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

* fix forked repo doesn't have language stat

Thanks the advice from lunny and 6543.

* fix forked repo doesn't have language stat

Modified as suggested by 6543.

* fix forked repo doesn't have language stat

simplify the function.

* fix forked repo doesn't have language stat

update the indexer after the loop

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[suggest] change merge strategy: do not check write access if user in merge white...
j.yao.SUSE [Wed, 8 Apr 2020 11:26:50 +0000 (19:26 +0800)]
[suggest] change merge strategy: do not check write access if user in merge white list (#10951)

* [suggest] change merge strategy: do not check write access if user in merge white list #10935

(cherry picked from commit ba74fc6389dfcad03c273441a49b54e4d38c86ee)

* fix NPE

* Fix cross compile (#10952)

* Fix cross compile

* Add test for cross compile

* Fix drone

* Fix drone

* Also prevent CC environment not to generate

Co-authored-by: zeripath <art27@cantab.net>
* fix merge box icon color bug (#10974)

that because need some space beturn ``text`` and color defines

Signed-off-by: a1012112796 <1012112796@qq.com>
* [skip ci] Updated translations via Crowdin

* Allow X in addition to x in tasks (#10979)

Signed-off-by: Andrew Thornton <art27@cantab.net>
* remove api: merge  reqRepoWriter

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 赵智超 <1012112796@qq.com>
Co-authored-by: GiteaBot <teabot@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoReturn error for authorized_keys and mergebase problems (#10990)
zeripath [Wed, 8 Apr 2020 05:04:19 +0000 (06:04 +0100)]
Return error for authorized_keys and mergebase problems (#10990)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[API] Get a single commit via Ref (#10915)
6543 [Wed, 8 Apr 2020 02:54:46 +0000 (04:54 +0200)]
[API] Get a single commit via Ref (#10915)

* GET /repos/:owner/:repo/commits/:ref

* add Validation Checks

* Fix & Extend TEST

* add two new tast cases

4 years agoAutomatically remove Watches, Assignments, etc if user loses access due to being...
6543 [Tue, 7 Apr 2020 21:52:01 +0000 (23:52 +0200)]
Automatically remove Watches, Assignments, etc if user loses access due to being removed as collaborator or from a team (#10997)

* remove a user from being assigned to any issue/PR if (s)he is removed as a collaborator

* fix gender specific comment

* do not remove users that still have access to the repo if they are a member of a team that can access the repo

* add context to errors

* updates

* incorporate review fixes

* Update models/repo_collaboration.go

Co-Authored-By: 6543 <6543@obermui.de>
* Update models/repo_collaboration.go

Co-Authored-By: 6543 <6543@obermui.de>
* Fix Rebase Relict

* Fix & Impruve

* use xorm builder

* all in one session

* generalize reconsiderIssueAssignees

* Only Unwatch if have no access anymore

* prepare for reuse

* Same things if remove User from Team

* fix lint

* let mysql take time to react

* add description

* CI.restart()

* CI.restart()

Co-authored-by: Lanre Adelowo <yo@lanre.wtf>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoupgrade to most recent bluemonday (#11007)
techknowlogick [Tue, 7 Apr 2020 20:08:47 +0000 (16:08 -0400)]
upgrade to most recent bluemonday (#11007)

* upgrade to most recent bluemonday

* make vendor

* update tests for bluemonday

* update tests for bluemonday

* update tests for bluemonday

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 7 Apr 2020 11:04:55 +0000 (11:04 +0000)]
[skip ci] Updated translations via Crowdin

4 years agotweak code tags in markdown (#11000)
silverwind [Tue, 7 Apr 2020 11:03:49 +0000 (13:03 +0200)]
tweak code tags in markdown (#11000)

- remove whitespace before and after
- increase horizontal padding
- make blocks more apparant on arc-green

4 years agoSupport running subtests manually (#10988)
Mura Li [Tue, 7 Apr 2020 04:31:11 +0000 (12:31 +0800)]
Support running subtests manually (#10988)

Since GNU Make does not allow '/' in the target patterns,
we tranlate the subsequent '.' into '/' for "go test -run".

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoFix Ctrl-Enter shortcut for issues (#10986)
Michael Kuhn [Tue, 7 Apr 2020 03:51:21 +0000 (05:51 +0200)]
Fix Ctrl-Enter shortcut for issues (#10986)

The js-quick-submit class needs to be applied to SimpleMDE's input
field, which is currently only done for wiki pages.

Fixes #10937

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years ago[feature] provide `OwnerName` field for README template (#10981)
j.yao.SUSE [Tue, 7 Apr 2020 01:40:38 +0000 (09:40 +0800)]
[feature] provide `OwnerName` field for README template (#10981)

Co-Authored-By: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[Docs] Add Note to Readme-Template about Variable Espansion (#10983)
6543 [Mon, 6 Apr 2020 23:43:17 +0000 (01:43 +0200)]
[Docs] Add Note to Readme-Template about Variable Espansion (#10983)

* add note with Espansion VarNames

* add context of Name

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 6 Apr 2020 20:20:08 +0000 (20:20 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAdd docs for gmail (#10995)
zeripath [Mon, 6 Apr 2020 20:18:42 +0000 (21:18 +0100)]
Add docs for gmail (#10995)

Fix #10971

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoFix release counter on API repository info (#10968)
6543 [Mon, 6 Apr 2020 18:42:30 +0000 (20:42 +0200)]
Fix release counter on API repository info (#10968)

Use the same mechanism as the webpage for calculating the release count

Fix #10946

4 years agoadd request review from specific reviewers feature in pull request (#10756)
赵智超 [Mon, 6 Apr 2020 16:33:34 +0000 (00:33 +0800)]
add request review from specific reviewers feature in pull request (#10756)

* add request review feature in pull request

add a way to notify specific reviewers to review like github , by add  or delet a  special type
review . The acton is  is similar to Assign ,  so many code reuse the function and items of
Assignee, but the meaning and result is different.

The Permission style is is similar to github, that only writer can add a review request from Reviewers,
but the poster can recall and remove a review request after a reviwer has revied even if he don't have
Write Premission. only manager , the poster and reviewer of a request review can remove it.

The reviewers can be requested to review contain all readers for private repo , for public, contain
all writers and watchers.

The offical Review Request will block merge if Reject can block it.

an other change: add ui otify for Assignees.

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Signed-off-by: a1012112796 <1012112796@qq.com>
* new change

* add placeholder string

* do some changes follow #10238 to add review requests num on lists also
change icon for review requests to eye

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoUsers should not be able to prohibit their own login (#10970)
赵智超 [Mon, 6 Apr 2020 14:23:15 +0000 (22:23 +0800)]
Users should not be able to prohibit their own login (#10970)

* ui: limit managers prohibit themself to login

Because I think it's crazy and not reasonale , that if a user can
prohibit themself to login. so suggest limit this choice on ui

Signed-off-by: a1012112796 <1012112796@qq.com>
* skip self Prohibit Login in post event handle

* fix comment

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoChange default charset for MySQL on install to utf8mb4 (#10989)
zeripath [Mon, 6 Apr 2020 13:33:15 +0000 (14:33 +0100)]
Change default charset for MySQL on install to utf8mb4 (#10989)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoMulitple Gitea Doctor improvements (#10943)
zeripath [Mon, 6 Apr 2020 10:44:47 +0000 (11:44 +0100)]
Mulitple Gitea Doctor improvements (#10943)

* Add `gitea doctor --list` flag to list the checks that will be run, including those by default
* Add `gitea doctor --run` to run specific checks
* Add `gitea doctor --all` to run all checks
* Add db version checker
* Add non-default recalculate merge bases check/fixer to doctor
* Add hook checker (Fix #9878) and ensure hooks are executable (Fix #6319)
* Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.)
* Add SCRIPT_TYPE check (Fix #10977)
* Add `gitea doctor --fix` to attempt to fix what is possible to easily fix
* Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.)

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoTurn off go modules for xgo and gxz (#10963)
John Olheiser [Mon, 6 Apr 2020 04:48:55 +0000 (23:48 -0500)]
Turn off go modules for xgo and gxz (#10963)

* Turn off go modules for xgo and gxz

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add test release for PR

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Try with go modules off

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Revert Makefile, force a release test

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Turn on GOPROXY for release

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* CI

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* CI

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Final commit

Signed-off-by: jolheiser <john.olheiser@gmail.com>
4 years agoMigrate ActivityHeatmap to Vue SFC (#10953)
Gary Kim [Mon, 6 Apr 2020 01:31:11 +0000 (09:31 +0800)]
Migrate ActivityHeatmap to Vue SFC (#10953)

* Migrate ActivityHeatmap to Vue SFC

Signed-off-by: Gary Kim <gary@garykim.dev>
* Readd vue compiler alias

Signed-off-by: Gary Kim <gary@garykim.dev>
* Remove unneeded use of v-html

Signed-off-by: Gary Kim <gary@garykim.dev>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoAllow X in addition to x in tasks (#10979) 10356/head
zeripath [Sun, 5 Apr 2020 22:39:05 +0000 (23:39 +0100)]
Allow X in addition to x in tasks (#10979)

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 5 Apr 2020 17:02:59 +0000 (17:02 +0000)]
[skip ci] Updated translations via Crowdin

4 years agofix merge box icon color bug (#10974)
赵智超 [Sun, 5 Apr 2020 17:01:12 +0000 (01:01 +0800)]
fix merge box icon color bug (#10974)

that because need some space beturn ``text`` and color defines

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years agoFix cross compile (#10952)
Lunny Xiao [Sun, 5 Apr 2020 12:28:18 +0000 (20:28 +0800)]
Fix cross compile (#10952)

* Fix cross compile

* Add test for cross compile

* Fix drone

* Fix drone

* Also prevent CC environment not to generate

Co-authored-by: zeripath <art27@cantab.net>
4 years agoAdd gitea-vet (#10948)
John Olheiser [Sun, 5 Apr 2020 06:20:50 +0000 (01:20 -0500)]
Add gitea-vet (#10948)

* Add copyright

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add gitea-vet and fix non-compliance

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Combine tools.go into build.go and clean up

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Remove extra GO111MODULE=on

Signed-off-by: jolheiser <john.olheiser@gmail.com>
4 years agoPrevent support libraries from compiling into Gitea (#10964)
guillep2k [Sun, 5 Apr 2020 03:35:02 +0000 (00:35 -0300)]
Prevent support libraries from compiling into Gitea (#10964)

* Prevent support libraries from compiling into Gitea

* Fix tag position

* Fix golangci-lint errors

* Refactor to make it work

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
4 years agoFix scrollbar issues in dropdowns (#10897)
silverwind [Sat, 4 Apr 2020 21:29:15 +0000 (23:29 +0200)]
Fix scrollbar issues in dropdowns (#10897)

* Fix scrollbar issues in dropdowns

Fixes: https://github.com/go-gitea/gitea/pull/10835
* remove wrapping

* grammar

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoAdjust label padding (#10957)
mrsdizzie [Sat, 4 Apr 2020 19:39:57 +0000 (15:39 -0400)]
Adjust label padding (#10957)

* Adjust label padding

* fix less complaint

* Make top/bottom padding a bit smaller to create better label look

4 years agoAvoiding directory execution on hook (#10954) (#10955)
Vasil Mikhalenya [Sat, 4 Apr 2020 16:29:58 +0000 (19:29 +0300)]
Avoiding directory execution on hook (#10954) (#10955)

* test -x is not enough https://stackoverflow.com/a/39489087

4 years agoEnable GO111MODULE=on globally in Makefile (#10939)
mrsdizzie [Sat, 4 Apr 2020 11:41:00 +0000 (07:41 -0400)]
Enable GO111MODULE=on globally in Makefile (#10939)

Now that our minimum required go version is 1.12 we can remove code that disables GO111MODULE globally and turn it on, so each command doesn't need it set specifically.

Also fixes a small bug with make pr that didn't work because GO111MODULE=on wasn't set

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoMove gocovmerge as vendor (#10947)
Lunny Xiao [Sat, 4 Apr 2020 08:45:26 +0000 (16:45 +0800)]
Move gocovmerge as vendor (#10947)

* Move gocovmerge as vendor

* Update Makefile

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoAdd titles and improve messages on sidebar menus (#10872)
赵智超 [Sat, 4 Apr 2020 05:39:48 +0000 (13:39 +0800)]
Add titles and improve messages on sidebar menus (#10872)

* ui: add more message on sidebar menus

* add title on the menus
* show some message instead of hide choose bar when have nothing to choose
* add simply filter for each menus
* do same changes in mew_form.tmpl
* remove some unusefull comments in mew_form.tmpl

Signed-off-by: a1012112796 <1012112796@qq.com>
* do review suggestions

* add filter message  on sidebar filter
* change IsIssueWriter to HasIssuesOrPullsWritePermission

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoRename scripts to build and add revive command as a new build tool command (#10942)
Lunny Xiao [Fri, 3 Apr 2020 19:29:12 +0000 (03:29 +0800)]
Rename scripts to build and add revive command as a new build tool command (#10942)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoUpdate docs to 1.11.4 (#10941)
techknowlogick [Fri, 3 Apr 2020 17:08:40 +0000 (13:08 -0400)]
Update docs to 1.11.4 (#10941)

4 years agoFix rebase conflict detection in git 2.26 (#10929)
zeripath [Fri, 3 Apr 2020 16:00:41 +0000 (17:00 +0100)]
Fix rebase conflict detection in git 2.26 (#10929)

* Fix rebase conflict detection in git 2.26

Git changed the technique used in rebase from
simple apply-patches to use merge. This breaks
our conflict detection code.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* As per @techknowlogick reduce copying

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoGenerate Diff and Patch direct from Pull head (#10936)
zeripath [Fri, 3 Apr 2020 13:21:41 +0000 (14:21 +0100)]
Generate Diff and Patch direct from Pull head (#10936)

* Generate Diff and Patch direct from Pull head

Fix #10932
Also fix "Empty Diff/Patch File when pull is merged"

Closes #10934

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add tests to ensure that diff does not change

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Ensure diffs and pulls pages work if head branch is deleted too

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoChange review status icons on PR view style to Github style (#10737)
赵智超 [Fri, 3 Apr 2020 05:12:42 +0000 (13:12 +0800)]
Change review status icons on PR view style to Github style (#10737)

* change the icon of ApproveReview pr from "eye" to "check" like github
* change the icon of RejectReview pr from "x" to "request-change" like github
* add "-" after "{{" which need to be one line (TODO: may be not change all)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years ago[UI] language status icon size (#10749)
j.yao.SUSE [Thu, 2 Apr 2020 11:18:35 +0000 (19:18 +0800)]
[UI] language status icon size (#10749)

* language status icon size

change the repository language status icon size

* Update _base.less

* fix: eslint rule  length-zero-no-unit

* [ui] .color-icon change size ti 14px

* Update web_src/less/_base.less

* Update web_src/less/_base.less

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 1 Apr 2020 19:05:15 +0000 (19:05 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoPrevent deadlock in pull_service.GetDiverging(pr) (#10905)
6543 [Wed, 1 Apr 2020 19:03:08 +0000 (21:03 +0200)]
Prevent deadlock in pull_service.GetDiverging(pr) (#10905)

* Switch to use a temporary repository instead of adding remotes to the base gitea repository to prevent deadlocking the base gitea repository.
* Add documentation on how to use func **createTemporaryRepo**

4 years agoChangelog v1.11.4 (#10916) (#10917)
6543 [Wed, 1 Apr 2020 16:59:05 +0000 (18:59 +0200)]
Changelog v1.11.4 (#10916) (#10917)

* output of changelog

* Apply suggestions from code review

* Update CHANGELOG.md

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years ago[Docs] Database Preparation - Connection over TLS (#10889)
Bagas Sanjaya [Wed, 1 Apr 2020 15:30:25 +0000 (22:30 +0700)]
[Docs] Database Preparation - Connection over TLS (#10889)

* Database Preparation - Connection over TLS

* Step 6 MySQL edit

- have been created [before -> earlier]
- recreate user, [and this time]

* Apply suggestions from @guillep2k

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* certificat[e] typo

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoOnly update merge_base in checker if not already merged (#10908)
zeripath [Wed, 1 Apr 2020 12:02:11 +0000 (13:02 +0100)]
Only update merge_base in checker if not already merged (#10908)

Fix #10766

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 1 Apr 2020 06:35:41 +0000 (06:35 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoExclude vendor dirs from git CRLF normalization (#10911)
silverwind [Wed, 1 Apr 2020 06:33:49 +0000 (08:33 +0200)]
Exclude vendor dirs from git CRLF normalization (#10911)

* Exclude vendor dirs from git CRLF normalization

Should get rid of a few warnings like at the end of `lint-backend` like
https://drone.gitea.io/go-gitea/gitea/23117/1/4

* make vendor

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoAdd Organization Wide Labels (#10814)
mrsdizzie [Wed, 1 Apr 2020 04:14:46 +0000 (00:14 -0400)]
Add Organization Wide Labels (#10814)

* Add organization wide labels

Implement organization wide labels similar to organization wide
webhooks. This lets you create individual labels for organizations that can be used
for all repos under that organization (so being able to reuse the same
label across multiple repos).

This makes it possible for small organizations with many repos to use
labels effectively.

Fixes #7406

* Add migration

* remove comments

* fix tests

* Update options/locale/locale_en-US.ini

Removed unused translation string

* show org labels in issue search label filter

* Use more clear var name

* rename migration after merge from master

* comment typo

* update migration again after rebase with master

* check for orgID <=0 per guillep2k review

* fmt

* Apply suggestions from code review

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* remove unused code

* Make sure RepoID is 0 when searching orgID per code review

* more changes/code review requests

* More descriptive translation var per code review

* func description/delete comment when issue label deleted instead of hiding it

* remove comment

* only use issues in that repo when calculating number of open issues for org label on repo label page

* Add integration test for IssuesSearch API with labels

* remove unused function

* Update models/issue_label.go

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Use subquery in GetLabelIDsInReposByNames

* Fix tests to use correct orgID

* fix more tests

* IssuesSearch api now uses new BuildLabelNamesIssueIDsCondition. Add a few more tests as well

* update comment for clarity

* Revert previous code change now that we can use the new BuildLabelNamesIssueIDsCondition

* Don't sort repos by date in IssuesSearch API

After much debugging I've found a strange issue where in some cases MySQL will return a different result than other enigines if a query is sorted by a null collumn. For example with our integration test data where we don't set updated_unix in repository fixtures:

SELECT `id`, `owner_id`, `owner_name`, `lower_name`, `name`, `description`, `website`, `original_service_type`, `original_url`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `status`, `is_fork`, `fork_id`, `is_template`, `template_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `avatar`, `created_unix`, `updated_unix` FROM `repository` ORDER BY updated_unix DESC LIMIT 15 OFFSET 45

Returns different results for MySQL than other engines. However, the similar query:

SELECT `id`, `owner_id`, `owner_name`, `lower_name`, `name`, `description`, `website`, `original_service_type`, `original_url`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `status`, `is_fork`, `fork_id`, `is_template`, `template_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `avatar`, `created_unix`, `updated_unix` FROM `repository` ORDER BY updated_unix DESC LIMIT 15 OFFSET 30

Returns the same results.

This causes integration tests to fail on MySQL in certain cases but would never show up in a real installation. Since this API call always returns issues based on the optionally provided repo_priority_id or the issueID itself, there is no change to results by changing the repo sorting method used to get ids earlier in the function.

* linter is back!

* code review

* remove now unused option

* Fix newline at end of files

* more unused code

* update to master

* check for matching ids before query

* Update models/issue_label.go

Co-Authored-By: 6543 <6543@obermui.de>
* Update models/issue_label.go

* update comments

* Update routers/org/setting.go

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
4 years agoAdd accordion to release list and compact non-latest (#10910)
John Olheiser [Tue, 31 Mar 2020 22:39:54 +0000 (17:39 -0500)]
Add accordion to release list and compact non-latest (#10910)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
4 years agoVarious Merge Base fixes (#10786)
zeripath [Tue, 31 Mar 2020 13:42:44 +0000 (14:42 +0100)]
Various Merge Base fixes (#10786)

* Fix broken merge base migration v128 for merged PR

* Allow PRs with deleted base branches to still show diff

* as per @lunny

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoFix milestones too many SQL variables bug (#10880)
Lunny Xiao [Tue, 31 Mar 2020 07:47:00 +0000 (15:47 +0800)]
Fix milestones too many SQL variables bug (#10880)

* Fix milestones too many SQL variables bug

* Fix test

* Don't display repositories with no milestone and fix tests

* Remove unused code and add some comments

4 years agoUpgrade golangci-lint to 1.24.0 (#10894)
zeripath [Mon, 30 Mar 2020 18:52:45 +0000 (19:52 +0100)]
Upgrade golangci-lint to 1.24.0 (#10894)

* upgrade golangci-lint to 1.24.0 to allow go 1.14 compatibility
* fix golangci-lint errors
* make make golangci-lint work when out of go-path

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoSplit dashboard elements into separate template files (#10885)
mrsdizzie [Mon, 30 Mar 2020 06:49:54 +0000 (02:49 -0400)]
Split dashboard elements into separate template files (#10885)

* Split dashboard elements into separate template files

No code change just Move Heatmap and Repo list/search into separate
template files (like feeds and navbar already are). This will let a
user more easily replace dashboard.tmpl without regularly becoming
out of sync with fixes or changes to the actual code.

Fixes #10870

* End file with an empty line

Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 30 Mar 2020 05:32:25 +0000 (05:32 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoUse subquery to instead In (#10874)
Lunny Xiao [Mon, 30 Mar 2020 05:30:39 +0000 (13:30 +0800)]
Use subquery to instead In (#10874)

* Use subquery to instead In

* Support excludedLabelNames on issues options

* Fix tests

Co-authored-by: zeripath <art27@cantab.net>
4 years agoAdd IIS Reverse Proxy documentation (#10881)
zeripath [Sun, 29 Mar 2020 21:11:15 +0000 (22:11 +0100)]
Add IIS Reverse Proxy documentation (#10881)

* Add IIS Reverse Proxy documentation

@mahdiit in #10748 described how to set up IIS as a reverse proxy. This
PR adds these to our documentation.

Close #10748

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update docs/content/doc/usage/reverse-proxies.en-us.md

Co-Authored-By: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: mrsdizzie <info@mrsdizzie.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 29 Mar 2020 19:53:00 +0000 (19:53 +0000)]
[skip ci] Updated translations via Crowdin