]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoRemove pt-pt from doc config file (#14830)
a1012112796 [Sun, 28 Feb 2021 10:46:21 +0000 (18:46 +0800)]
Remove pt-pt from doc config file (#14830)

Because it not has any content now. It's not necessary to
show this link on the footer.

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoFix missleading sentence (#14829)
6543 [Sun, 28 Feb 2021 07:54:12 +0000 (08:54 +0100)]
Fix missleading sentence (#14829)

3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 28 Feb 2021 00:43:14 +0000 (00:43 +0000)]
[skip ci] Updated licenses and gitignores

3 years agoFix a couple of CommentAsPatch issues. (#14804)
zeripath [Sat, 27 Feb 2021 18:46:14 +0000 (18:46 +0000)]
Fix a couple of CommentAsPatch issues.  (#14804)

* CutDiffAroundLine makes the incorrect assumption that `---` and `+++` always represent part of the header of a diff.

This PR adds a flag to its parsing to prevent this problem and adds a streaming parsing technique to CutDiffAroundLine using an io.pipe instead of just sending data to an unbounded buffer.

Fix #14711

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Handle unquoted comment patch files

When making comment patches unfortunately the patch does not always quote the filename
This makes the diff --git header ambiguous again.

This PR finally adds handling for ambiguity in to parse patch

Fix #14812

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add in testing for no error

There is no way currently for CutDiffAroundLine in this test to cause an
error however, it should still be tested.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd Image Diff options in Pull Request Diff view (#14450)
KN4CK3R [Sat, 27 Feb 2021 17:25:00 +0000 (18:25 +0100)]
Add Image Diff options in Pull Request Diff view (#14450)

Implemented GitHub style image diff

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 27 Feb 2021 00:19:24 +0000 (00:19 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoDisable broken OAuth2 providers at startup (#14802)
zeripath [Fri, 26 Feb 2021 03:20:58 +0000 (03:20 +0000)]
Disable broken OAuth2 providers at startup (#14802)

Instead of causing a log.Fatal, we should handle broken OAuth2
providers by disabling them.

Fix #8930

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 26 Feb 2021 00:19:27 +0000 (00:19 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix dashboard UI bugs and more (#14767)
Mike L [Thu, 25 Feb 2021 12:35:43 +0000 (13:35 +0100)]
Fix dashboard UI bugs and more (#14767)

This PR fixes a few UI bugs I spontaneously encountered:

- Fixes emojis in repo titles getting head-cut and tail-cut in dashboard feed due to introduction of 1.25 em emojis at 1 em line-height, by simply using the original 1 3/7 em value of `semantic.css`
- Fixes regression (too long repo names should be capped to 70%) in #13828 due to flex children not respecting properties like `overflow: hidden;`, and removes a block of dead style code
- Follow-up to #14761, removes extraneous code for top navbar and correct right margin for Font Awesome
- Fixes color emphasis inversion in arc-green theme for top right buttons (edit, delete) on commit view boxes

3 years agouse gogs.ico to create a better svg for migration page (#14795)
6543 [Thu, 25 Feb 2021 06:13:44 +0000 (07:13 +0100)]
use gogs.ico to create a better svg for migration page (#14795)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 25 Feb 2021 00:19:26 +0000 (00:19 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoGenerate man pages (#13901)
6543 [Wed, 24 Feb 2021 22:36:48 +0000 (23:36 +0100)]
Generate man pages (#13901)

* extend gitignore

* first working draft

* use docs subcomand

* rm config-sheet-sheet-2-man

3 years agoAdd environment-to-ini to docker image (#14762)
Kyle D [Tue, 23 Feb 2021 19:21:44 +0000 (14:21 -0500)]
Add environment-to-ini to docker image (#14762)

* Add environment-to-app.ini routine

* Call environment-to-ini in docker setup scripts

* Automatically convert section vars to lower case to match documentation

* Remove git patch instructions

* Add env variable documentation to Install Docker

3 years agoExclude running docker build on cron tasks (#14778)
techknowlogick [Tue, 23 Feb 2021 03:55:35 +0000 (22:55 -0500)]
Exclude running docker build on cron tasks (#14778)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 23 Feb 2021 00:19:34 +0000 (00:19 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoCI: translation update as cron task (#14774)
6543 [Mon, 22 Feb 2021 23:16:02 +0000 (00:16 +0100)]
CI: translation update as cron task (#14774)

3 years agoAdd EasyMDE support for release content editor (#14744)
a1012112796 [Mon, 22 Feb 2021 20:17:51 +0000 (04:17 +0800)]
Add EasyMDE support for release content editor (#14744)

* Add easyMDE(simpleMDE) support for release content editor

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agofix a small nit (#14769)
a1012112796 [Mon, 22 Feb 2021 18:54:01 +0000 (02:54 +0800)]
fix a small nit (#14769)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 22 Feb 2021 13:46:10 +0000 (13:46 +0000)]
[skip ci] Updated translations via Crowdin

3 years agobuild for only available darwin target (#14771)
techknowlogick [Mon, 22 Feb 2021 13:44:54 +0000 (08:44 -0500)]
build for only available darwin target (#14771)

3 years agoMake release-linux archtectures via envs (#14184)
Lunny Xiao [Mon, 22 Feb 2021 07:01:57 +0000 (15:01 +0800)]
Make release-linux archtectures via envs (#14184)

3 years agoFix repo-restore bug with poster not replaced (#14759)
Lunny Xiao [Mon, 22 Feb 2021 03:57:41 +0000 (11:57 +0800)]
Fix repo-restore bug with poster not replaced (#14759)

* Fix restore bug

* Fix restore bug

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix double alert in oauth2 application edit view (#14764)
a1012112796 [Mon, 22 Feb 2021 02:51:45 +0000 (10:51 +0800)]
Fix double alert in oauth2 application edit view (#14764)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agofix link account ui (#14763)
a1012112796 [Mon, 22 Feb 2021 01:14:27 +0000 (09:14 +0800)]
fix link account ui (#14763)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoOnly for direct descendants of items (#14761)
Kyle D [Sun, 21 Feb 2021 21:22:15 +0000 (16:22 -0500)]
Only for direct descendants of items (#14761)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 21 Feb 2021 16:52:24 +0000 (16:52 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix go get (#14758)
Lunny Xiao [Sun, 21 Feb 2021 16:51:15 +0000 (00:51 +0800)]
Fix go get (#14758)

* Fix go get

* Fix default branch

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 21 Feb 2021 10:00:43 +0000 (10:00 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd helper descriptions on new repo page (#14591)
Bagas Sanjaya [Sun, 21 Feb 2021 09:59:31 +0000 (16:59 +0700)]
Add helper descriptions on new repo page (#14591)

* Add helper descriptions on new repo page

Add helpers for:
  * repo description
  * .gitignore
  * license
  * README
  * default branch
  * signature trust model

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
* Oops, rename trust_model_helper

To match similar helper.

trust_model_helper_intro -> trust_model_helper

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 21 Feb 2021 00:19:09 +0000 (00:19 +0000)]
[skip ci] Updated licenses and gitignores

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 20 Feb 2021 22:10:05 +0000 (22:10 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoHeatmap days clickable (#13935)
gordon-- [Sat, 20 Feb 2021 22:08:58 +0000 (23:08 +0100)]
Heatmap days clickable (#13935)

* Heatmap days clickable

* Error handling

* Unselect filter

* better dayclick handler

* made linter happy

* clickable heatmap for profiles

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoRemove unused commit (#14741)
Lunny Xiao [Sat, 20 Feb 2021 14:02:39 +0000 (22:02 +0800)]
Remove unused commit (#14741)

* Remove unused commit

* a small nit

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 20 Feb 2021 10:19:10 +0000 (10:19 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoExport LFS & TimeTracking function status (#14753)
6543 [Sat, 20 Feb 2021 10:17:51 +0000 (11:17 +0100)]
Export LFS & TimeTracking function status (#14753)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 20 Feb 2021 04:28:10 +0000 (04:28 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoPrevent endless loop if templates missing (#14752)
zeripath [Sat, 20 Feb 2021 04:26:57 +0000 (04:26 +0000)]
Prevent endless loop if templates missing (#14752)

Since the chi upgrade if the templates are missing an endless loop will occur if
status/500.tmpl is missing.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agostopwatch notif: check if timetracking is enabled (#14750)
Norwin [Fri, 19 Feb 2021 23:06:56 +0000 (23:06 +0000)]
stopwatch notif: check if timetracking is enabled (#14750)

fixes #14435

3 years agoClarify the suffices and prefixes of setting.AppSubURL and setting.AppURL (#12999)
zeripath [Fri, 19 Feb 2021 21:36:43 +0000 (21:36 +0000)]
Clarify the suffices and prefixes of setting.AppSubURL and setting.AppURL (#12999)

Also removes some unnecessary uses of fmt.Sprintf and adds documentation
strings

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agofix preview status switch button on wiki editr (#14742)
a1012112796 [Fri, 19 Feb 2021 18:58:11 +0000 (02:58 +0800)]
fix preview status switch button on wiki editr (#14742)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years ago[docs] Fix typo in command-line.en-us.md (#14746)
Ikko Ashimine [Fri, 19 Feb 2021 16:29:22 +0000 (01:29 +0900)]
[docs] Fix typo in command-line.en-us.md (#14746)

seperated -> separated

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 19 Feb 2021 15:46:38 +0000 (15:46 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUpdate golangci-lint v1.35.2 -> v1.37.0 (#14747)
6543 [Fri, 19 Feb 2021 15:45:23 +0000 (16:45 +0100)]
Update golangci-lint v1.35.2 -> v1.37.0 (#14747)

3 years agoAdd UI to delete tracked times (#14100)
Norwin [Fri, 19 Feb 2021 10:52:11 +0000 (10:52 +0000)]
Add UI to delete tracked times (#14100)

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 19 Feb 2021 10:06:49 +0000 (10:06 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMove the stopwatches to the eventsource stream (#14588)
zeripath [Fri, 19 Feb 2021 10:05:35 +0000 (10:05 +0000)]
Move the stopwatches to the eventsource stream (#14588)

Move the stopwatches to the eventsource stream

Use the /user/events eventsource to update the stopwatches
instead of polling /api/v1/user/stopwatches if the eventsource
is enabled.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix misleading word on delete repositories' archives (#14737)
Lunny Xiao [Fri, 19 Feb 2021 06:24:51 +0000 (14:24 +0800)]
Fix misleading word on delete repositories' archives (#14737)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 19 Feb 2021 00:41:31 +0000 (00:41 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix when a commit not found returned 500 (#14732)
Lunny Xiao [Fri, 19 Feb 2021 00:40:17 +0000 (08:40 +0800)]
Fix when a commit not found returned 500 (#14732)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agomodels/repo: Fix typo in comment (#14731)
Jacob Hrbek [Thu, 18 Feb 2021 15:39:04 +0000 (15:39 +0000)]
models/repo: Fix typo in comment (#14731)

* models/repo: Fix typo in comment

* another typo

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 18 Feb 2021 14:48:40 +0000 (14:48 +0000)]
[skip ci] Updated translations via Crowdin

3 years agorouters/routes/web: Fix typo in comment (#14729)
Jacob Hrbek [Thu, 18 Feb 2021 14:47:23 +0000 (14:47 +0000)]
routers/routes/web: Fix typo in comment (#14729)

3 years agoIssue template addition: Are you using Gitea behind CloudFlare? (#14098)
wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf [Thu, 18 Feb 2021 11:28:07 +0000 (12:28 +0100)]
Issue template addition: Are you using Gitea behind CloudFlare? (#14098)

* chore: are you using Gitea behind CloudFlare

since more often than not CF appears to serve stale cache and cause
troubles, I'd argue it might be helpful to ask about it in this here
issue template

* implement suggestion: change question to comment

* as per @techknowlogick's suggestion

* chore: edit comment

* implement @mrsdizzie's suggestion
* as the comment grows, rather span multiple lines
* Gitea --> gitea to match case used in the rest of the template

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[API] Add Restricted Field to User (#14630)
6543 [Thu, 18 Feb 2021 08:25:35 +0000 (09:25 +0100)]
[API] Add Restricted Field to User (#14630)

* Expose Restricted field for User

* Add Option to Change Restricted on User via adminEditUser API

* Add test who change restricted & test if it changed it ...

* make generate-swagger

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoremove outdated notice in makefile (#14720)
techknowlogick [Thu, 18 Feb 2021 02:48:12 +0000 (21:48 -0500)]
remove outdated notice in makefile (#14720)

Co-authored-by: 6543 <6543@obermui.de>
3 years ago#14699 Make branch names in PR description clickable (#14716)
Jimmy Praet [Thu, 18 Feb 2021 02:45:49 +0000 (03:45 +0100)]
#14699 Make branch names in PR description clickable (#14716)

3 years agoRemove NULs byte arrays passed to PostProcess (#14587)
zeripath [Thu, 18 Feb 2021 01:32:14 +0000 (01:32 +0000)]
Remove NULs byte arrays passed to PostProcess (#14587)

PostProcess is supposed to be parsing and handling HTML
fragments, but on fuzzing it appears that there is a weird
issue with NUL elements that could cause a memory address
error in downstream libraries.

The simplest solution is to strip out the weird NULs - they
should not be there in any case and would be stripped out
anyway.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix github download on migration (#14703)
Lunny Xiao [Thu, 18 Feb 2021 00:36:49 +0000 (08:36 +0800)]
Fix github download on migration (#14703)

* Fix github download on migration

* Use Context for Client

Co-authored-by: zeripath <art27@cantab.net>
3 years agoReduce calls to git cat-file -s (#14682)
zeripath [Wed, 17 Feb 2021 21:32:25 +0000 (21:32 +0000)]
Reduce calls to git cat-file -s (#14682)

* Reduce calls to git cat-file -s

There are multiple places where there are repeated calls to git cat-file
-s due to the blobs not being created with their size.

Through judicious use of git ls-tree -l and slight adjustments to the
indexer code we can avoid a lot of these calls.

* simplify by always expecting the long format

* Also always set the sized field and tell the indexer the update is sized

3 years agoUse cat-file --batch in GetLanguageStats (#14685)
zeripath [Wed, 17 Feb 2021 19:32:47 +0000 (19:32 +0000)]
Use cat-file --batch in GetLanguageStats (#14685)

* Use cat-file --batch in GetLanguageStats

This PR moves to using a single cat-file --batch in GetLanguageStats
significantly reducing the number of processes spawned during language stat
processing.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update modules/git/repo_language_stats_nogogit.go

Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoVendor Update (#14696)
6543 [Wed, 17 Feb 2021 03:47:24 +0000 (04:47 +0100)]
Vendor Update (#14696)

* github.com/yuin/goldmark v1.3.1 -> v1.3.2

* github.com/xanzy/go-gitlab v0.42.0 -> v0.44.0

* github.com/prometheus/client_golang v1.8.0 -> v1.9.0

* github.com/minio/minio-go v7.0.7 -> v7.0.9

* github.com/lafriks/xormstore v1.3.2 -> v1.4.0

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 16 Feb 2021 22:38:34 +0000 (22:38 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd Password Algorithm option to install page (#14701)
zeripath [Tue, 16 Feb 2021 22:37:20 +0000 (22:37 +0000)]
Add Password Algorithm option to install page (#14701)

Add Password Algorithm option to install page

Fix #14674

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
3 years agoRestore detection of branches are equal on compare page (#14586)
zeripath [Tue, 16 Feb 2021 15:39:45 +0000 (15:39 +0000)]
Restore detection of branches are equal on compare page (#14586)

Somehow the test for detecting if branches are equal broke
this PR restores this functionality.

Fix #14502

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 16 Feb 2021 03:04:48 +0000 (03:04 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd fullTextSearch to dropdowns by default (#14694)
zeripath [Tue, 16 Feb 2021 03:03:32 +0000 (03:03 +0000)]
Add fullTextSearch to dropdowns by default (#14694)

This PR adds `fullTextSearch: 'exact'` to most dropdown
invocations meaning that if there is a search box for the
dropdown it will automatically do a fullTextSearch looking
for the provided fragment instead of starting at the beginning

We should consider changing other places that use
`fullTextSearch: true` to `'exact'` because these will be using a
fuzzy-textual search that doesn't necessarily return the
expected results.

Fix #14689

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoCreate DB session provider(based on xorm) (#13031)
zeripath [Mon, 15 Feb 2021 05:33:31 +0000 (05:33 +0000)]
Create DB session provider(based on xorm) (#13031)

* Create Xorm session provider

This PR creates a Xorm session provider which creates
the appropriate Session table for macaron/session.

Fix #7137

Signed-off-by: Andrew Thornton <art27@cantab.net>
* extraneous l

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
* use key instead of ID to be compatible with go-macaron/session

Signed-off-by: Andrew Thornton <art27@cantab.net>
* And change the migration too.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update spacing of imports

Co-authored-by: 6543 <6543@obermui.de>
* Update modules/session/xorm.go

Co-authored-by: techknowlogick <matti@mdranta.net>
* add xorm provider to the virtual provider

Signed-off-by: Andrew Thornton <art27@cantab.net>
* prep for master merge

* prep for merge master

* As per @lunny

* move migration out of the way

* Move to call this db session as per @lunny

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoAllow blocking some email domains from registering an account (#14667)
Damien Goutte-Gattat [Sun, 14 Feb 2021 23:31:29 +0000 (23:31 +0000)]
Allow blocking some email domains from registering an account (#14667)

Gitea allows to whitelist email domains so that only email addresses from certain domains are allowed to register an account, but does not currently allows to do the opposite: blacklisting email domains so that addresses from certain domains are *forbidden* to register an account.

The idea has been briefly mentioned in the discussion about issue #6350, but never implemented. This PR does that.

The rationale is that, in my experience of running a Gitea instance, *a single email domain* is responsible for *most* of the spam accounts, and for *all* of the spam accounts that manage to get past the email confirmation step. So on top of the other spam mitigation measures already available (email confirmation, CAPTCHA, etc.), having the option to block a particularly annoying domain would be helpful.

close #13628

3 years agoFix svg spacing (#14638)
Kyle D [Sun, 14 Feb 2021 16:49:22 +0000 (11:49 -0500)]
Fix svg spacing (#14638)

* Add right margin to icons in menu items

* Reduce padding on user profile submenu to fit in one line by default (english)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 14 Feb 2021 14:52:16 +0000 (14:52 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix broken spans in diffs (#14678)
zeripath [Sun, 14 Feb 2021 14:51:00 +0000 (14:51 +0000)]
Fix broken spans in diffs (#14678)

Gitea runs diff on highlighted code fragment for each line in order to provide
code highlight diffs. Unfortunately this diff algorithm is not aware that span tags
and entities are atomic and cannot be split.

The current fixup code makes some attempt to fix these broken tags however, it cannot
handle situations where a tag is split over multiple blocks.

This PR provides a more algorithmic fixup mechanism whereby spans and entities are
completely coalesced into their respective blocks.

This may result in a incompletely reduced diff but - it will definitely prevent the
broken entities and spans that are currently possible.

As a result of this fixup several inconsistencies were discovered in our testcases
and these were also fixed.

Fix #14231

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 14 Feb 2021 00:19:09 +0000 (00:19 +0000)]
[skip ci] Updated licenses and gitignores

3 years agoPrevent template renderer from rendering error (#14646)
zeripath [Sat, 13 Feb 2021 19:41:53 +0000 (19:41 +0000)]
Prevent template renderer from rendering error (#14646)

When there is a panic during template rendering unrolled/render
will automatically render the error. This leads to the
panic being displayed in the page and not a 500 page

Fix #14467
Fix #14525

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoPrevent race in PersistableChannelUniqueQueue.Has (#14651)
zeripath [Sat, 13 Feb 2021 19:02:09 +0000 (19:02 +0000)]
Prevent race in PersistableChannelUniqueQueue.Has (#14651)

There is potentially a race with a slow starting internal
queue causing a NPE if Has is checked before the internal
queue has been setup.

This PR adds a lock on the Has() fn.

Fix #14311

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoTurn default hash password algorightm back to pbkdf2 from argon2 until we found a...
Lunny Xiao [Sat, 13 Feb 2021 17:03:29 +0000 (01:03 +0800)]
Turn default hash password algorightm back to pbkdf2 from argon2 until we found a better one (#14673)

* Turn default hash password algorightm back to pbkdf2 from argon2 until we found a better one

* Add a warning on document

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 13 Feb 2021 16:08:31 +0000 (16:08 +0000)]
[skip ci] Updated translations via Crowdin

3 years agorm gogs relict (#14665)
6543 [Sat, 13 Feb 2021 16:07:17 +0000 (17:07 +0100)]
rm gogs relict (#14665)

3 years agoWhitespace in commits (#14650)
vnkmpf [Sat, 13 Feb 2021 04:35:43 +0000 (05:35 +0100)]
Whitespace in commits (#14650)

* Add whitespace to commit view

* Add whitespace to /compare/a...b

* Move repeated whitespaceFlags to gitdiff

* Add whitespace for wiki pages

3 years agoShow Gitea version in swagger (#14654)
techknowlogick [Fri, 12 Feb 2021 20:51:56 +0000 (15:51 -0500)]
Show Gitea version in swagger (#14654)

Show Gitea version in swagger

Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd v171 (addSortingColToProjectBoard) migration for #14634 (#14652)
6543 [Fri, 12 Feb 2021 11:01:26 +0000 (12:01 +0100)]
Add v171 (addSortingColToProjectBoard) migration for #14634 (#14652)

* add v171 Migration for #14634

* NOT NULL

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix truncated organization names (#14655)
vnkmpf [Fri, 12 Feb 2021 01:29:07 +0000 (02:29 +0100)]
Fix truncated organization names (#14655)

* Fix truncated organization names

Previous ellipsis implementation hid vertical overflow - image + descent line of letters.
Organization visibility in select on dashboard was not always visible.
This commit extracts classes which don't make collisions with other items on page.

3 years agoFix PATCH /repos/{owner}/{repo} panic (#14637)
Anton Khimich [Thu, 11 Feb 2021 19:53:41 +0000 (14:53 -0500)]
Fix PATCH /repos/{owner}/{repo} panic (#14637)

* Fix a runtime error when modifying a repository through API call

Using the `PATCH /repos/{owner}/{repo}` endpoint and attempting to
modify `default_branch` on an empty repository will cause a
panic. This commit adds a check for a nil pointer before attempting
to dereference it.

* Apply suggestions from code review

* Apply suggestions from code review

* Ensure that the git repository is loaded

If you change the default branch for a repository you must change it in
git too. Therefore you must open the repository before changing the
default branch.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Allow empty repos to have their default branches changed

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Anton Khimich <anton.khimicha@mail.utoronto.ca>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoMake fileheader sticky in diffs (#14616)
vnkmpf [Thu, 11 Feb 2021 18:28:51 +0000 (19:28 +0100)]
Make fileheader sticky in diffs (#14616)

* Make fileheader sticky #12552

* Remove sticky filenames when width is 480px or less

On mobile phone sticky filename is hidden due to the combination
of many possible widths and lengths.

* Fix text color for .markdown-info

* Fix visual of sticky diff box on 480px or less

- Hide arrow for select buttons.
- Fix changes, additions and deletions.
With flexbox they look very broken.
This commit hides some words to, so the result is:
"123 changed files  987 additions  456 deletions"
- center text in buttons

Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdded option to disable webhooks (#13176)
Paweł Bogusławski [Thu, 11 Feb 2021 17:34:34 +0000 (18:34 +0100)]
Added option to disable webhooks (#13176)

* Added option to disable web hooks

This mod introduces DISABLE_WEB_HOOKS parameter in [security] section
of app.ini (by default set to false). If set to true it disables web
hooks feature. Any existing undelivered web hook tasks will be cancelled.
Any existing web hook definitions will be left untouched in db but
its delivery tasks will be ignored.

Author-Change-Id: IB#1105130

* Webhook spelling fixed

Webhook spelling fixed.

Fixes: 07df6614dc84cdd2e9f39c57577fa1062bd70012
Related: https://github.com/go-gitea/gitea/pull/13176#pullrequestreview-510868421
Author-Change-Id: IB#1105174

* Parameter description fixed

Parameter description fixed.

Fixes: 07df6614dc84cdd2e9f39c57577fa1062bd70012
Related: https://github.com/go-gitea/gitea/pull/13176#pullrequestreview-514086107
Author-Change-Id: IB#1105174

3 years agoAdd dismiss review feature (#12674)
a1012112796 [Thu, 11 Feb 2021 17:32:25 +0000 (01:32 +0800)]
Add dismiss review feature (#12674)

* Add dismiss review feature

refs:
    https://github.blog/2016-10-12-dismissing-reviews-on-pull-requests/
    https://developer.github.com/v3/pulls/reviews/#dismiss-a-review-for-a-pull-request

* change modal ui and error message

* Add unDismissReview api

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoSort / Move project boards (#14634)
Romain [Thu, 11 Feb 2021 16:32:27 +0000 (17:32 +0100)]
Sort / Move project boards (#14634)

Sort Project board (#14533)

3 years ago[Vendor] Update go-redis to v8.5.0 (#13749)
6543 [Wed, 10 Feb 2021 21:28:32 +0000 (22:28 +0100)]
[Vendor] Update go-redis to v8.5.0 (#13749)

* Update go-redis to v8.4.0

* github.com/go-redis/redis/v8  v8.4.0 -> v8.5.0

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
* TODO

* Use the Queue termination channel as the default context for pushes

Signed-off-by: Andrew Thornton <art27@cantab.net>
* missed one

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoAllow org labels to be set with issue templates (#14593)
zeripath [Wed, 10 Feb 2021 17:18:22 +0000 (17:18 +0000)]
Allow org labels to be set with issue templates (#14593)

Fix #13688

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDo not assume all 40 char strings are SHA1s (#14624)
zeripath [Wed, 10 Feb 2021 07:37:25 +0000 (07:37 +0000)]
Do not assume all 40 char strings are SHA1s (#14624)

GetCommit() assumes that all 40 char strings are SHA1s. This leads to an
error if you try to do a PR on a branch which is 40 characters long.

This PR attempts the SHA first - and if it fails will switch to using rev-parse.

Fix #14470

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoHasPreviousCommit causes recursive load of commits unnecessarily (#14598)
zeripath [Wed, 10 Feb 2021 07:00:57 +0000 (07:00 +0000)]
HasPreviousCommit causes recursive load of commits unnecessarily (#14598)

This PR improves HasPreviousCommit to prevent the automatic and recursive loading
of previous commits using git merge-base --is-ancestor and git rev-list

Fix #13684

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoImprove the comment on comment type (#14609)
Lunny Xiao [Wed, 10 Feb 2021 03:57:30 +0000 (11:57 +0800)]
Improve the comment on comment type (#14609)

3 years agoPrevent adding nil label to .AddedLabels or .RemovedLabels (#14623)
zeripath [Wed, 10 Feb 2021 02:50:44 +0000 (02:50 +0000)]
Prevent adding nil label to .AddedLabels or .RemovedLabels (#14623)

* Prevent adding nil label to .AddedLabels or .RemovedLabels

There are possibly a few old databases out there with malmigrated data that can
cause panics with empty labels being migrated.

This PR adds a few tests to prevent nil labels being added.

Fix #14466

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add doctor command to remove the broken label comments

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoEnsure memcache TTL cannot be over 30 days (#14592)
zeripath [Tue, 9 Feb 2021 22:29:03 +0000 (22:29 +0000)]
Ensure memcache TTL cannot be over 30 days (#14592)

Memcached TTL cannot be > 30 days and if it is attempted the TTL is interpreted as
a unix timestamp.

This PR ensures that the TTL is switched to a unix timestamp in those cases.

Fix #14571

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoTruncated organisations name #14583 (#14615)
vnkmpf [Tue, 9 Feb 2021 19:51:01 +0000 (20:51 +0100)]
Truncated organisations name #14583 (#14615)

- truncate to max length 40
- add CSS ellipsis

3 years agoAdd support for ref parameter to get raw file API (#14602)
zeripath [Tue, 9 Feb 2021 00:15:47 +0000 (00:15 +0000)]
Add support for ref parameter to get raw file API (#14602)

Fix #14597

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFixed irritating error message related to go version (#14611)
uli-heller [Mon, 8 Feb 2021 15:16:53 +0000 (16:16 +0100)]
Fixed irritating error message related to go version (#14611)

I do have go-1.13.8 installed and get the error message

```
Gitea requires Go 1.13 or greater to build. You can get it at https://golang.org/dl/
```

I do thing that Go 1.14 or greater is actually required

3 years agoUse OldRef instead of CommitSHA for DeleteBranch comments (#14604)
zeripath [Mon, 8 Feb 2021 03:09:14 +0000 (03:09 +0000)]
Use OldRef instead of CommitSHA for DeleteBranch comments (#14604)

Fix #14545

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoAdd information on how to build statically (#14594)
zeripath [Mon, 8 Feb 2021 02:06:21 +0000 (02:06 +0000)]
Add information on how to build statically (#14594)

Fix #14576

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 8 Feb 2021 01:01:27 +0000 (01:01 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoExclude the current dump file from the dump (#14606)
zeripath [Mon, 8 Feb 2021 01:00:12 +0000 (01:00 +0000)]
Exclude the current dump file from the dump (#14606)

* Exclude the current dump file from the dump

Always prevent the current file from being added to the dump.

Fix #13618

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add skip custom directory option

Signed-off-by: Andrew Thornton <art27@cantab.net>
* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>