]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoSet self-adjusting deadline for connection writing (#16068) (#16123)
zeripath [Thu, 10 Jun 2021 21:26:32 +0000 (22:26 +0100)]
Set self-adjusting deadline for connection writing (#16068) (#16123)

In #16055 it appears that the simple 5s deadline doesn't work for large
file writes. Now we can't - or at least shouldn't just set no deadline
as go will happily let these connections block indefinitely. However,
what seems reasonable is to set some minimum rate we expect for writing.

This PR suggests the following algorithm:

* Every write has a minimum timeout of 5s (adjustable at compile time.)
* If there has been a previous write - then consider its previous
deadline, add half of the minimum timeout + 2s per kb about to written.
* If that new deadline is after the minimum timeout use that.

Fix #16055

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix language switch for install page (#16043) (#16128)
a1012112796 [Thu, 10 Jun 2021 13:19:40 +0000 (21:19 +0800)]
Fix language switch for install page (#16043) (#16128)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoFix bug on getIssueIDsByRepoID (#16119) (#16124)
Lunny Xiao [Thu, 10 Jun 2021 05:12:18 +0000 (13:12 +0800)]
Fix bug on getIssueIDsByRepoID (#16119) (#16124)

* Fix bug on getIssueIDsByRepoID

* Add test

3 years agoFix data URI scramble (#16098) (#16118)
6543 [Wed, 9 Jun 2021 14:31:40 +0000 (16:31 +0200)]
Fix data URI scramble (#16098) (#16118)

* Fix data URI scramble (#16098)

* Removed unused method.

* No prefix for data uris.

* Added test to prevent regressions.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
3 years agoFix http path bug (#16117) (#16120)
6543 [Wed, 9 Jun 2021 13:58:00 +0000 (15:58 +0200)]
Fix http path bug (#16117) (#16120)

* Fix http path bug

* Add missed request

* add tests

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoMerge all deleteBranch as one function and also fix bug when delete branch don't...
Lunny Xiao [Mon, 7 Jun 2021 16:27:41 +0000 (00:27 +0800)]
Merge all deleteBranch as one function and also fix bug when delete branch don't close related PRs (#16067) (#16097)

* Fix bug when delete branch don't close related PRs

* Merge all deletebranch as one method

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoapi: fix overly strict edit pr permissions (#15900) (#16081)
6543 [Sun, 6 Jun 2021 10:22:05 +0000 (12:22 +0200)]
api: fix overly strict edit pr permissions (#15900) (#16081)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agogit migration: don't prompt interactively for clone credentials (#15902) (#16082)
6543 [Sun, 6 Jun 2021 06:02:34 +0000 (08:02 +0200)]
git migration: don't prompt interactively for clone credentials (#15902) (#16082)

* don't prompt interactively for clone credentials

* apply GIT_TERMINAL_PROMPT=0 to all git cmds

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoFix case change in ownernames (#16045) (#16050)
zeripath [Thu, 3 Jun 2021 05:09:43 +0000 (06:09 +0100)]
Fix case change in ownernames (#16045) (#16050)

Backport #16045

If you change the case of a username the change needs to be propagated to their
repositories.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd missing SameSite settings for the i_like_gitea cookie (#16037) (#16039)
zeripath [Tue, 1 Jun 2021 01:33:22 +0000 (02:33 +0100)]
Add missing SameSite settings for the i_like_gitea cookie (#16037) (#16039)

Backport #16037

The i_like_gitea cookie appears to be missing the SameSite settings. I think they
were present at some point but may have been removed in a merge.

This PR ensures that they are set.

Fix #15972

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDon't manipulate input params in email notification (#16011) (#16033)
Jimmy Praet [Mon, 31 May 2021 06:17:34 +0000 (08:17 +0200)]
Don't manipulate input params in email notification (#16011) (#16033)

Backport #16011

3 years agoFix setting of SameSite on cookies (#15989) (#15991)
techknowlogick [Thu, 27 May 2021 14:02:39 +0000 (10:02 -0400)]
Fix setting of SameSite on cookies (#15989) (#15991)

Fix #15972

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agofollow redirect when fetching theme archive (#15986) (#15990)
techknowlogick [Thu, 27 May 2021 01:05:24 +0000 (21:05 -0400)]
follow redirect when fetching theme archive (#15986) (#15990)

3 years agoRemove branch URL before IssueRefURL (#15970)
fnetX (aka fralix) [Tue, 25 May 2021 20:02:19 +0000 (22:02 +0200)]
Remove branch URL before IssueRefURL (#15970)

Revert change for account / org dashboard where IssueRefURLs do not
contain the full repo URL (case RepoLink is not true)

Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
3 years agofix layout of milestone view (#15940)
Tomás Warynyca [Sat, 22 May 2021 02:38:51 +0000 (23:38 -0300)]
fix layout of milestone view (#15940)

3 years agoRestore PAM user autocreation functionality (#15825) (#15867)
zeripath [Wed, 19 May 2021 14:42:36 +0000 (15:42 +0100)]
Restore PAM user autocreation functionality (#15825) (#15867)

Backport #15825

* Restore PAM user autocreation functionality

PAM autoregistration of users currently fails due to email invalidity.
This PR adds a new setting to PAM to allow an email domain to be set
or just sets the email to the noreply address and if that fails falls
back to uuid@localhost

Fix #15702

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoremove unimplemented searchbar from project view (#15905)
Norwin [Mon, 17 May 2021 11:22:08 +0000 (11:22 +0000)]
remove unimplemented searchbar from project view (#15905)

3 years agoMove sans-serif fallback font higher than emoji fonts (#15855) (#15892)
zeripath [Sun, 16 May 2021 13:42:12 +0000 (14:42 +0100)]
Move sans-serif fallback font higher than emoji fonts (#15855) (#15892)

Backport #15855

The Tor browser does not use the system-ui font and no other fonts in the stack match
its default fonts. In fact it is possible that it will in future only
match generic fonts. This means that all rendering will first try the
emoji fonts before falling back to the sans-serif font for glyphs.

In this case has the emoji fall back fonts for Tor contains empty glyphs
for numbers - in order to protect privacy - and leads to numbers being
rendered as empty glyphs. This is clearly not ideal and whilst we could
use the Arimo font - as I state above I suspect that Tor will eventually
ban detecting this and we should instead move the sans-serif font higher
in the stack so that it matches before the emoji fonts.

Partial fix of #15844

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoGitHub: migrate draft releases too (#15884) (#15888)
6543 [Sun, 16 May 2021 07:24:28 +0000 (09:24 +0200)]
GitHub: migrate draft releases too (#15884) (#15888)

* GitHub: migrate draft releases too

* refactor

3 years agoClose the gitrepo when deleting the repository (#15876) (#15887)
6543 [Sat, 15 May 2021 21:45:17 +0000 (23:45 +0200)]
Close the gitrepo when deleting the repository (#15876) (#15887)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUpgrade xorm to v1.1.0 (#15869) (#15885)
Lunny Xiao [Sat, 15 May 2021 18:32:17 +0000 (02:32 +0800)]
Upgrade xorm to v1.1.0 (#15869) (#15885)

3 years agoFix bound address/port for caddy's certmagic library (see #15848) (#15859) (#15878)
zeripath [Sat, 15 May 2021 17:28:14 +0000 (18:28 +0100)]
Fix bound address/port for caddy's certmagic library (see #15848) (#15859) (#15878)

Co-authored-by: Blake Miner <miner.blake@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix blame row height alignment (#15863) (#15883)
Norwin [Sat, 15 May 2021 16:12:07 +0000 (16:12 +0000)]
Fix blame row height alignment (#15863) (#15883)

* fix blame row alignment on firefox
* fix blame row alignment in chrome
* fix blame row alignment in safari

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix error message when saving generated LOCAL_ROOT_URL config (#15880) (#15882)
Naohisa Murakami [Sat, 15 May 2021 14:06:39 +0000 (23:06 +0900)]
Fix error message when saving generated LOCAL_ROOT_URL config (#15880) (#15882)

Backport of #15880.

3 years agoOnly write config in environment-to-ini if there are changes (#15861) (#15868)
zeripath [Sat, 15 May 2021 12:07:16 +0000 (13:07 +0100)]
Only write config in environment-to-ini if there are changes (#15861) (#15868)

Backport #15861

* Only write config in environment-to-ini if there are changes

Only write the new config in environment-to-ini if there are changes or the
destination is not the same as the customconf.

Fix #15719
Fix #15857

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoReturn go-get info on subdirs (#15642) (#15871)
zeripath [Sat, 15 May 2021 11:06:02 +0000 (12:06 +0100)]
Return go-get info on subdirs (#15642) (#15871)

Backport #15642

This PR is an alternative to #15628 and makes the go get handler a
handler.

Fix #15625

Close #15628

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd timeout to writing to responses (#15831) (#15872)
zeripath [Fri, 14 May 2021 16:42:27 +0000 (17:42 +0100)]
Add timeout to writing to responses (#15831) (#15872)

Backport #15831

In #15826 it has become apparent that there are a few occasions when a response can
hang during writing, and because there is no timeout go will happily just block
interminably. This PR adds a fixed 5 second timeout to all writes to a connection.

Fix #15826

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix LFS commit finder not working (#15856) (#15874)
KN4CK3R [Fri, 14 May 2021 15:39:59 +0000 (17:39 +0200)]
Fix LFS commit finder not working (#15856) (#15874)

* Create a copy of the sha bytes.

Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoStop calling WriteHeader in Write (#15862) (#15873)
zeripath [Fri, 14 May 2021 14:38:35 +0000 (15:38 +0100)]
Stop calling WriteHeader in Write (#15862) (#15873)

Backport #15862

Fixes http: superfluous response.WriteHeader call from code.gitea.io/gitea/modules/context.(*Response).WriteHeader (response.go:67)

* Looking again we don't need this writeHeader as all of our downstream
implementations will always do it for us

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoOnly offer hostcertificates if they exist (#15849) (#15853)
zeripath [Thu, 13 May 2021 15:12:41 +0000 (16:12 +0100)]
Only offer hostcertificates if they exist (#15849) (#15853)

Backport #15849

A common bug report is the otherwise harmless sshd logging:

```
Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory
```

This PR simply checks if these files exist before creation of sshd_config and if
they do not exist, doesn't add a reference to them.

Fix #14110 amongst others.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
3 years agofix truncate utf8 string (#15828) (#15854)
zeripath [Thu, 13 May 2021 14:10:29 +0000 (15:10 +0100)]
fix truncate utf8 string (#15828) (#15854)

Backport #15828

* fix truncate utf8 string.

* revoke truncated user info.

Co-authored-by: yan <sxty32@gmail.com>
3 years agoFix bound address/port for caddy's certmagic library (#15758) (#15848)
zeripath [Wed, 12 May 2021 22:36:46 +0000 (23:36 +0100)]
Fix bound address/port for caddy's certmagic library (#15758) (#15848)

Backport #15758

* Fix bound address/port for caddy's certmagic library

* Fix bug

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Blake Miner <miner.blake@gmail.com>
3 years agochange s3 bucket name (#15847)
techknowlogick [Wed, 12 May 2021 20:12:36 +0000 (16:12 -0400)]
change s3 bucket name (#15847)

3 years agoUpgrade unrolled/render to v1.1.1 (#15845) (#15846)
zeripath [Wed, 12 May 2021 19:54:50 +0000 (20:54 +0100)]
Upgrade unrolled/render to v1.1.1 (#15845) (#15846)

Backport #15845

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoTagger can be empty, as can Commit and Author - tolerate this (#15835) (#15839)
zeripath [Wed, 12 May 2021 19:09:16 +0000 (20:09 +0100)]
Tagger can be empty, as can Commit and Author - tolerate this (#15835) (#15839)

Backport #15835

Unfortunately some old repositories can have tags with empty Tagger, Commit
or Author. Go-Git variants will always have empty values for these whereas
the native git variant leaves them at nil. The simplest solution is just to
always have these set to empty Signatures.

v156 migration also makes the incorrect assumption that these cannot be empty.
Therefore add some handling to this and add logging and adjust broken
logging elsewhere in this migration.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoQueue manager FlushAll can loop rapidly - add delay (#15733) (#15840)
zeripath [Wed, 12 May 2021 17:48:11 +0000 (18:48 +0100)]
Queue manager FlushAll can loop rapidly - add delay (#15733) (#15840)

Backport #15733

* Queue manager FlushAll can loop rapidly - add delay

Add delay within FlushAll to prevent rapid loop when workers are busy

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per lunny

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoSet autocomplete off on branches selector (#15809) (#15833)
zeripath [Tue, 11 May 2021 22:18:07 +0000 (23:18 +0100)]
Set autocomplete off on branches selector (#15809) (#15833)

Backport #15809

Fix #15782

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd err to log (#15813) (#15824)
John Olheiser [Mon, 10 May 2021 20:38:37 +0000 (15:38 -0500)]
Add err to log (#15813) (#15824)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years agoMove restore repo to internal router and invoke from command to avoid open the same...
Lunny Xiao [Mon, 10 May 2021 13:14:59 +0000 (21:14 +0800)]
Move restore repo to internal router and invoke from command to avoid open the same db file or queues files (#15790) (#15816)

* Move restore repo to internal router and invoke from command to avoid open the same db file or queues files

* Follow @zeripath's review

* set no timeout for resotre repo private request

* make restore repo cancelable

3 years agoTests should use test files (#15801) (#15806)
6543 [Sun, 9 May 2021 17:39:14 +0000 (19:39 +0200)]
Tests should use test files (#15801) (#15806)

3 years agoChangelog v1.14.2 (#15794) v1.14.2
6543 [Sun, 9 May 2021 09:26:49 +0000 (11:26 +0200)]
Changelog v1.14.2 (#15794)

* changelog tool generate

* format & add

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoEnsure that ctx.Written is checked after issues(...) calls (#15797) (#15798)
6543 [Sun, 9 May 2021 08:48:52 +0000 (10:48 +0200)]
Ensure that ctx.Written is checked after issues(...) calls (#15797) (#15798)

Fix issue noted in #15783

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoDisplay conflict-free merge messages for pull requests (#15773) (#15796)
zeripath [Sun, 9 May 2021 02:32:48 +0000 (03:32 +0100)]
Display conflict-free merge messages for pull requests (#15773) (#15796)

Backport #15773

Repositories using external issue tracker tend to use numeric issues in
commits. To prevent conflicts during issue reference parsing or inside
commit hooks, this change respects these configuration and uses the !
character to refer to pull requests in merge commit messages.

For repositories using squash merges, this was already handled.

Signed-off-by: JustusBunsi <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Steven <61625851+justusbunsi@users.noreply.github.com>
3 years agoExponential Backoff for ByteFIFO (#15724) (#15793)
6543 [Sat, 8 May 2021 18:27:00 +0000 (20:27 +0200)]
Exponential Backoff for ByteFIFO (#15724) (#15793)

This PR is another in the vein of queue improvements. It suggests an
exponential backoff for bytefifo queues to reduce the load from queue
polling. This will mostly be useful for redis queues.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[API] make change repo settings work on empty repos (#15778) (#15789)
6543 [Sat, 8 May 2021 13:14:42 +0000 (15:14 +0200)]
[API] make change repo settings work on empty repos (#15778) (#15789)

* API: Fix #15602

* Add TEST

3 years agoUse pulls in commit graph unless pulls are disabled (#15734 & #15740 & #15774) (...
6543 [Fri, 7 May 2021 19:12:24 +0000 (21:12 +0200)]
Use pulls in commit graph unless pulls are disabled (#15734 & #15740 & #15774) (#15775)

* Commit Graph: Pull-Requests should not link to issues (#15734)

Use `/pulls` and simplify code.

* reverse #15734 partial and comment (#15740)

* reverse & comment

* Update templates/repo/graph/commits.tmpl

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
* Use pulls in commit graph unless pulls are disabled

Fix #15370

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <KN4CK3R@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoSet GIT_DIR correctly if it is not set (#15751) (#15769)
6543 [Fri, 7 May 2021 18:01:25 +0000 (20:01 +0200)]
Set GIT_DIR correctly if it is not set (#15751) (#15769)

* Set GIT_DIR correctly if it is not set

* Expand out templates

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoDefer closing the gitrepo until the end of the wrapped context functions (#15653...
zeripath [Fri, 7 May 2021 16:28:02 +0000 (17:28 +0100)]
Defer closing the gitrepo until the end of the wrapped context functions (#15653) (#15746)

* Defer closing the gitrepo until the end of the wrapped context functions (#15653)

Backport #15653

There was a mistake in #15372 where deferral of gitrepo close occurs before it should.

This PR fixes this.

3 years agoDrop back to use IsAnInteractiveSession for SVC (#15749) (#15762)
zeripath [Fri, 7 May 2021 15:44:35 +0000 (16:44 +0100)]
Drop back to use IsAnInteractiveSession for SVC (#15749) (#15762)

Backport #15749

* Drop back to use IsAnInteractiveSession for SVC

There is an apparent permission change problem when using
IsWindowsService to determine if the SVC manager should be
used.

This PR simply drops back to using IsAnInteractiveSession as
this does not change behaviour.

Fix #15454

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Yes staticcheck I know this is deprecated

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Just leave me alone lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix bug where repositories appear unadopted (#15757) (#15767)
6543 [Fri, 7 May 2021 15:07:39 +0000 (17:07 +0200)]
Fix bug where repositories appear unadopted (#15757) (#15767)

Fix bug where repositories with capital letters in their names appear unadopted.

Fix #15755

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agonot show `ref-in-new-issue` pop when issue was disabled (#15761) (#15765)
6543 [Fri, 7 May 2021 14:13:20 +0000 (16:13 +0200)]
not show `ref-in-new-issue` pop when issue was disabled (#15761) (#15765)

fix #15718

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years agoIssue list alignment tweaks (#15483) (#15766)
6543 [Fri, 7 May 2021 13:06:19 +0000 (15:06 +0200)]
Issue list alignment tweaks (#15483) (#15766)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix setting version table in dump (#15753) (#15759)
zeripath [Fri, 7 May 2021 12:04:17 +0000 (13:04 +0100)]
Fix setting version table in dump (#15753) (#15759)

Backport #15753

* Fix setting version table in dump

As noted on Discord there is a problem with gitea dump where the version table
is not being dumped correctly.

This is due to a missing pointer in the TableInfo.

This PR fixes this.

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

3 years agoFix close button change on delete in simplemde area (#15737) (#15747)
zeripath [Thu, 6 May 2021 22:14:15 +0000 (23:14 +0100)]
Fix close button change on delete in simplemde area (#15737) (#15747)

Backport #15737

* Fix close button change on delete in simplemde area

Fix issue with close button changing when deleting in the simplemde textarea.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* apply suggestion

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agofix some ui bug about draft release (#15137) (#15745)
a1012112796 [Thu, 6 May 2021 19:23:26 +0000 (03:23 +0800)]
fix some ui bug about draft release (#15137) (#15745)

* fix some ui bug about draft release

- should not show draft release in tag list because
  it will't create real tag
- still show draft release without tag and commit message
  for draft release instead of 404 error
- remove tag load for attachement links because it's useless

Signed-off-by: a1012112796 <1012112796@qq.com>
* add test code

* fix test

That's because has added a new release in relaese test database.

* fix dropdown link for draft release

3 years agoFix webkit calendar icon color on arc-green (#15728)
Tomás Warynyca [Wed, 5 May 2021 05:10:01 +0000 (02:10 -0300)]
Fix webkit calendar icon color on arc-green (#15728)

3 years agoOnly log Error on getLastCommitStatus error to let pull list still be visible (#15715)
6543 [Tue, 4 May 2021 12:03:31 +0000 (14:03 +0200)]
Only log Error on getLastCommitStatus error to let pull list still be visible (#15715)

3 years agoMove tooltip down to allow selection of Remove File on error (#15672) (#15714)
Kyle D [Tue, 4 May 2021 06:00:29 +0000 (00:00 -0600)]
Move tooltip down to allow selection of Remove File on error (#15672) (#15714)

3 years agoFix setting redis db path (#15698) (#15708)
zeripath [Mon, 3 May 2021 21:30:30 +0000 (22:30 +0100)]
Fix setting redis db path (#15698) (#15708)

Backport #15698

There is a bug setting the redis db in the common nosql manager whereby the db path
always fails.

This PR fixes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoImplement delete release attachments and update release attachments' name (#14130...
Kyle D [Mon, 3 May 2021 17:27:00 +0000 (11:27 -0600)]
Implement delete release attachments and update release attachments' name (#14130) (#15666)

* Implement delete release attachment

* Add attachments on release edit page

* Fix bug

* Finish del release attachments

* Fix frontend lint

* Fix tests

* Support edit release attachments

* Added tests

* Remove the unnecessary parameter isCreate from UpdateReleaseOrCreatReleaseFromTag

* Rename UpdateReleaseOrCreatReleaseFromTag to UpdateRelease

* Fix middle align

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoPerformance improvement for last commit cache and show-ref (#15455) (#15701)
zeripath [Mon, 3 May 2021 14:51:41 +0000 (15:51 +0100)]
Performance improvement for last commit cache and show-ref (#15455) (#15701)

Backport #15455

* Improve performance when there are multiple commits in the last commit cache

* read refs directly if we can

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix DB session cleanup (#15697) (#15700)
zeripath [Sun, 2 May 2021 09:43:01 +0000 (10:43 +0100)]
Fix DB session cleanup (#15697) (#15700)

Backport #15697

The DB session clean up needs to check expiry not created_unix.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFixed several activation bugs (#15473) (#15685)
6543 [Sat, 1 May 2021 00:14:36 +0000 (02:14 +0200)]
Fixed several activation bugs (#15473) (#15685)

* Removed unneeded form tag.

* Fixed typo.

* Fixed NPE.

* Use better error page.

* Splitted GET and POST.

Co-authored-by: KN4CK3R <KN4CK3R@users.noreply.github.com>
3 years agoDelete references if repository gets deleted (#15681) (#15684)
6543 [Fri, 30 Apr 2021 22:09:58 +0000 (00:09 +0200)]
Delete references if repository gets deleted (#15681) (#15684)

* Remove DeletedBranch and LFSLocks.

* Sort beans.

Co-authored-by: KN4CK3R <KN4CK3R@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix orphaned objects deletion bug (#15657) (#15683)
6543 [Fri, 30 Apr 2021 21:27:26 +0000 (23:27 +0200)]
Fix orphaned objects deletion bug (#15657) (#15683)

* Fix orphaned objects deletion bug

* extend test

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoDelete protected branch if repository gets removed (#15658) (#15676)
KN4CK3R [Fri, 30 Apr 2021 18:59:42 +0000 (20:59 +0200)]
Delete protected branch if repository gets removed (#15658) (#15676)

* Added missing error parameters.

* Delete protected branch if repository gets removed.

* Added doctor fix.

3 years ago[API] pull notification subject status: add "merged" (#15344) (#15654)
6543 [Wed, 28 Apr 2021 19:24:56 +0000 (21:24 +0200)]
[API] pull notification subject status: add "merged" (#15344) (#15654)

Current subject status can be "", "open" and "closed". This add "merged" to it.

3 years agoRemove spurious set name from eventsource.sharedworker.js (#15643) (#15652)
zeripath [Wed, 28 Apr 2021 17:50:56 +0000 (18:50 +0100)]
Remove spurious set name from eventsource.sharedworker.js (#15643) (#15652)

Backport #15643

Fix #15617

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agonot update updated uinx for `git gc` (#15637) (#15641)
zeripath [Wed, 28 Apr 2021 00:20:47 +0000 (01:20 +0100)]
not update updated uinx for `git gc` (#15637) (#15641)

Backport #15637

fix #15634

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years agoFix commit graph author link (#15627) (#15630)
zeripath [Mon, 26 Apr 2021 19:25:51 +0000 (20:25 +0100)]
Fix commit graph author link (#15627) (#15630)

Backport #15627

The author link on the commit graph is incorrect and isn't providing a link to the author.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agofix webhook timeout bug (#15613) (#15621)
Lunny Xiao [Mon, 26 Apr 2021 12:42:12 +0000 (20:42 +0800)]
fix webhook timeout bug (#15613) (#15621)

* Also fix the potential problem in httplib

3 years agoResolve panic on failed interface conversion in migration v156 (#15604) (#15610)
techknowlogick [Sun, 25 Apr 2021 15:58:42 +0000 (11:58 -0400)]
Resolve panic on failed interface conversion in migration v156 (#15604) (#15610)

go panics otherwise with `panic: interface conversion: error is git.ErrNotExist, not *git.ErrNotExist`, thanks to Codeberg/Andi for reporting this.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoBump unrolled/render to v1.1.0 (#15581) (#15608)
Nathan Smith [Sun, 25 Apr 2021 06:01:52 +0000 (23:01 -0700)]
Bump unrolled/render to v1.1.0 (#15581) (#15608)

v1.1.0 has improved buffer pooling

3 years agoFix missing storage init (#15589) (#15598)
Lunny Xiao [Fri, 23 Apr 2021 12:56:21 +0000 (20:56 +0800)]
Fix missing storage init (#15589) (#15598)

3 years agoIf the default branch is not present do not report error on stats indexing (follow...
zeripath [Thu, 22 Apr 2021 20:30:18 +0000 (21:30 +0100)]
If the default branch is not present do not report error on stats indexing (follow-up of #15546) (#15583) (#15594)

Backport #15546
Backport #15583

 #15546 doesn't completely fix this problem because the error returned is an ObjectNotExist
error not a BranchNotExist error.

Add test for ErrObjectNotExist too

Fix #15257

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix lfs management find (#15537) (#15578)
Lunny Xiao [Thu, 22 Apr 2021 18:32:48 +0000 (02:32 +0800)]
Fix lfs management find (#15537) (#15578)

* Fix lfs management find (#15537)

Fix #15236

* Do not do 40byte conversion within ParseTreeLine
* Missed a to40ByteSHA

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
* Remove space

Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd placeholder text to deploy key textarea (#15575) (#15576)
zeripath [Wed, 21 Apr 2021 21:59:50 +0000 (22:59 +0100)]
Add placeholder text to deploy key textarea (#15575) (#15576)

Backport #15575

Add placeholder text to deploy key textarea

Related #15574

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix NPE on view commit with notes (#15561) (#15573)
zeripath [Wed, 21 Apr 2021 19:11:43 +0000 (20:11 +0100)]
Fix NPE on view commit with notes (#15561) (#15573)

Backport #15561

Fix #15558

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoProject board improvements (#15429) (#15560)
silverwind [Tue, 20 Apr 2021 19:45:00 +0000 (21:45 +0200)]
Project board improvements (#15429) (#15560)

* Project board improvements

- Fix link colors
- Extract CSS to own file
- Various minor tweaks to make it look better

Fixes: https://github.com/go-gitea/gitea/issues/15424
Fixes: https://github.com/go-gitea/gitea/issues/15506
Fixes: https://github.com/go-gitea/gitea/pull/15511
* fix squashed cards on small view area

* more css fixes, add second row from issue list

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd ETag header (#15370) (#15552)
KN4CK3R [Tue, 20 Apr 2021 16:01:58 +0000 (18:01 +0200)]
Add ETag header (#15370) (#15552)

* Add ETag header.

* Comply with RFC 7232.

* Moved logic into httpcache.go

* Changed name.

* Lint

* Implemented If-None-Match list.

* Fixed missing header on *

* Removed weak etag support.

* Removed * support.

* Added unit test.

* Lint

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix bug on commit graph (#15517) (#15530)
Lunny Xiao [Sat, 17 Apr 2021 12:46:30 +0000 (20:46 +0800)]
Fix bug on commit graph (#15517) (#15530)

3 years agoSend size to /avatars if requested (#15459) (#15528)
zeripath [Sat, 17 Apr 2021 11:30:58 +0000 (12:30 +0100)]
Send size to /avatars if requested (#15459) (#15528)

Backport #15459

If an avatar is requested in a particular size ensure that /avatars also gets the size request

Fix #15453

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoPrevent migration 156 failure if tag commit missing (#15519) (#15527)
zeripath [Sat, 17 Apr 2021 10:13:15 +0000 (11:13 +0100)]
Prevent migration 156 failure if tag commit missing (#15519) (#15527)

Backport #15519

It is possible that tag commits could be deleted or missing from repos. This causes
migration 156 to fail and breaks upgrade.

This PR simply logs the failure.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoRepo branch page: label size, PR ref, new PR button alignment (#15363) (#15365)
Mike L [Fri, 16 Apr 2021 05:53:51 +0000 (07:53 +0200)]
Repo branch page: label size, PR ref, new PR button alignment (#15363) (#15365)

3 years agoChangelog v1.14.1 (#15498) v1.14.1
6543 [Fri, 16 Apr 2021 02:19:09 +0000 (04:19 +0200)]
Changelog v1.14.1 (#15498)

* RAW Changelog v1.14.1

* wordings

* Apply suggestions from code review

Co-authored-by: techknowlogick <matti@mdranta.net>
* Update CHANGELOG.md

Co-authored-by: 6543 <6543@obermui.de>
* Update CHANGELOG.md

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoPerformance improvement for list pull requests (#15447) (#15500)
6543 [Thu, 15 Apr 2021 22:14:14 +0000 (00:14 +0200)]
Performance improvement for list pull requests (#15447) (#15500)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoFix bug clone wiki (#15499) (#15502)
zeripath [Thu, 15 Apr 2021 19:40:10 +0000 (20:40 +0100)]
Fix bug clone wiki (#15499) (#15502)

Backport #15499

Fix #15494

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agodump: Add option to skip LFS/attachment files (#15407) (#15492)
zeripath [Thu, 15 Apr 2021 15:41:47 +0000 (16:41 +0100)]
dump: Add option to skip LFS/attachment files (#15407) (#15492)

Backport #15407

* Add option to skip dumping LFS/attachment files

* Fix fmt issues

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Johan Van de Wauw <johan@gisky.be>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoEnsure review dismissal only dismisses the correct review (#15477) (#15489)
zeripath [Thu, 15 Apr 2021 15:24:59 +0000 (16:24 +0100)]
Ensure review dismissal only dismisses the correct review (#15477) (#15489)

Backport #15477

Fix #15472

Signed-off-by: Andrew Thornton art27@cantab.net
Co-authored-by: 6543 <6543@obermui.de>
3 years agoUse subdir for URL (#15446) (#15493)
zeripath [Thu, 15 Apr 2021 15:24:30 +0000 (16:24 +0100)]
Use subdir for URL (#15446) (#15493)

Backport #15446

Fixes #15444

Co-authored-by: KN4CK3R <KN4CK3R@users.noreply.github.com>
Co-authored-by: KN4CK3R <KN4CK3R@users.noreply.github.com>
3 years agomigration: github: if rate limit is not enabled, ignore it (#15490) (#15495)
6543 [Thu, 15 Apr 2021 15:24:01 +0000 (17:24 +0200)]
migration: github: if rate limit is not enabled, ignore it (#15490) (#15495)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoUse index of the supported tags to choose user lang (#15452) (#15488)
zeripath [Thu, 15 Apr 2021 14:47:43 +0000 (15:47 +0100)]
Use index of the supported tags to choose user lang (#15452) (#15488)

Backport #15452

Fix #14793.

The previous implementation used the first return value of matcher.Match, which is the chosen language tag but may contain extensions such as de-DE-u-rg-chzzzz.

As mentioned in the documentation of language package, matcher.Match also returns the index of the supported tags, so I think it is better to use it rather than manipulate the returned language tag.

Co-authored-by: Naohisa Murakami <tiqwab.ch90@gmail.com>
3 years agoFix potential copy lfs records failure when fork a repository (#15441) (#15485)
Lunny Xiao [Thu, 15 Apr 2021 14:13:14 +0000 (22:13 +0800)]
Fix potential copy lfs records failure when fork a repository (#15441) (#15485)

3 years agoQuery the DB for the hash before inserting in to email_hash (#15457) (#15491)
zeripath [Thu, 15 Apr 2021 13:29:13 +0000 (14:29 +0100)]
Query the DB for the hash before inserting in to email_hash (#15457) (#15491)

Backport #15457

Some postgres users have logging which logs even failed transactions. So
just query the db before trying to insert.

Fix #15451

Signed-off-by: Andrew Thornton art27@cantab.net
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoBuild go-git variants for windows (#15482) (#15487)
zeripath [Thu, 15 Apr 2021 12:21:27 +0000 (13:21 +0100)]
Build go-git variants for windows (#15482) (#15487)

Backport #15482

It appears that there are significant performance problems with the pure git backend
on windows.

Therefore until we can sort this out - provide go-git backend builds.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoLock down build-images dependencies (#15480)
silverwind [Thu, 15 Apr 2021 11:02:57 +0000 (13:02 +0200)]
Lock down build-images dependencies (#15480)

Partial extraction from #15479 for 1.14. Locks down build-images
dependencies and adds missing node_modules dependency.

3 years agoPrevent superfluous response.WriteHeader (#15456) (#15476)
zeripath [Thu, 15 Apr 2021 10:02:42 +0000 (11:02 +0100)]
Prevent superfluous response.WriteHeader (#15456) (#15476)

Backport #15456

This PR simply checks the status before writing the header.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agofix wrong file link in code search page (#15466) (#15486)
a1012112796 [Thu, 15 Apr 2021 09:04:25 +0000 (17:04 +0800)]
fix wrong file link in code search page (#15466) (#15486)

in previous the grenrated link is
``testg/testrepo/src/commit/....``
which is not right.

the right version is ``/testg/testrepo/.......``
(start wiht ``/``)
or ``http://127.0.0.1:3000/xxxxx`` (full link)

to make it hase same result with explore page
I choose the secound style.

fix #15438

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoClone panel fixes (#15436)
silverwind [Wed, 14 Apr 2021 21:16:33 +0000 (23:16 +0200)]
Clone panel fixes (#15436)

- Use <button> over <div> for a button
- Fix absent border-right on wiki
- Fix absent border-radius on wiki

3 years agoquick fix (#15464) (#15481)
John Olheiser [Wed, 14 Apr 2021 19:42:30 +0000 (14:42 -0500)]
quick fix (#15464) (#15481)

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