]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoChangelog for 1.15.4 v1.15.4
Matti R [Fri, 8 Oct 2021 18:01:42 +0000 (14:01 -0400)]
Changelog for 1.15.4

3 years agoAPI: don't allow merged PRs to be reopened (#17271)
Norwin [Fri, 8 Oct 2021 17:54:26 +0000 (19:54 +0200)]
API: don't allow merged PRs to be reopened (#17271)

3 years agodon't try to interpret treepath as hash (#17272)
Norwin [Fri, 8 Oct 2021 17:53:54 +0000 (19:53 +0200)]
don't try to interpret treepath as hash (#17272)

...when path contains no hash-path-separator ('/')

This is a workaround to #17179.

Entering this case when `path` does not contain a '/' does not really
make sense, as that means the tree path is empty, but this case is only
entered for routes that expect a non-empty tree path.

Treepaths like <40-char-dirname>/<filename> will still fail,
but hopefully don't occur that often. A more complete fix that avoids
this case too is outlined in #17185, but too big of a change to backport

3 years agoFix incorrect repository count on organization tab of dashboard (#17266)
Jimmy Praet [Fri, 8 Oct 2021 09:33:16 +0000 (11:33 +0200)]
Fix incorrect repository count on organization tab of dashboard (#17266)

Fixes #17249

3 years agoFix unwanted team review request deletion (#17257) (#17264)
Jimmy Praet [Thu, 7 Oct 2021 21:58:13 +0000 (23:58 +0200)]
Fix unwanted team review request deletion (#17257) (#17264)

Add missing issue_id = ? to where clause
Fixes #17251

3 years agoCI: migrate from 'plugins/s3:1' to 'woodpeckerci/plugin-s3:latest' (#17234) (#17260)
6543 [Thu, 7 Oct 2021 20:02:07 +0000 (22:02 +0200)]
CI: migrate from 'plugins/s3:1' to 'woodpeckerci/plugin-s3:latest' (#17234) (#17260)

- this fixes the CI release upload issues, as the docker image for this is freshly built (unlike the mostly unmaintained "official" drone plugins), thus containing current CA certs needed for letsencrypt since 2021-09-31.
- woodpecker is a drone-ci fork maintained partially by @6543. it's API compatible with current drone plugins afaik

3 years agoRemove dead badge on README.md (#17261)
6543 [Thu, 7 Oct 2021 19:40:11 +0000 (21:40 +0200)]
Remove dead badge on README.md (#17261)

3 years agoFix broken Activities link in team dashboard (#17255) (#17258)
Jimmy Praet [Thu, 7 Oct 2021 18:58:59 +0000 (20:58 +0200)]
Fix broken Activities link in team dashboard (#17255) (#17258)

Remove '/' suffix from organization dashboard link

Fixes #17250

3 years agoAPI pull's head/base have correct permission(#17214) (#17245)
pricly-yellow [Thu, 7 Oct 2021 09:39:23 +0000 (16:39 +0700)]
API pull's head/base have correct permission(#17214) (#17245)

* for all pull requests API return permissions of caller
* for all webhook return empty permissions

Signed-off-by: Danila Kryukov <pricly_yellow@dismail.de>
* Fix incorrect error handler

Co-authored-by: delvh <dev.lh@web.de>
* Fix wrong assumption in tests

* Change paramenter name to doer to indicate source

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227)
pricly-yellow [Tue, 5 Oct 2021 18:16:22 +0000 (01:16 +0700)]
Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227)

Fix GetPullRequestByIndex by validate index > 1

Signed-off-by: Danila Kryukov <pricly_yellow@dismail.de>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years agoCheck user instead of organization when creating a repo from a template via API ...
6543 [Fri, 1 Oct 2021 08:16:28 +0000 (10:16 +0200)]
Check user instead of organization when creating a repo from a template via API (#16346) (#17195)

* Check user instead of organization

* Enforce that only admins can copy a repo to another user

Co-authored-by: Ion Jaureguialzo Sarasola <ion@jaureguialzo.com>
3 years agoupgrade xorm to v1.2.5 (#17177) (#17188)
Lunny Xiao [Thu, 30 Sep 2021 06:03:42 +0000 (14:03 +0800)]
upgrade xorm to v1.2.5 (#17177) (#17188)

3 years agofix sprintf verbs in locales (#17187)
Alexey 〒erentyev [Thu, 30 Sep 2021 04:03:21 +0000 (07:03 +0300)]
fix sprintf verbs in locales (#17187)

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix missing repo link in issue/pull assigned emails (#17183) (#17184)
zeripath [Wed, 29 Sep 2021 23:21:12 +0000 (00:21 +0100)]
Fix missing repo link in issue/pull assigned emails (#17183) (#17184)

Backport #17183

There was a mistake in the template file: `templates/mail/issue/assigned.tmpl`
where the repourl was generated from a non-existent release instead of the issue.

This PR changes this to use the issue but also ensure that the issue repo is loaded.

It also slightly improves the English and the Russian locale string.

Fix #17160

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix bug of get context user (#17169) (#17172)
Lunny Xiao [Tue, 28 Sep 2021 13:42:43 +0000 (21:42 +0800)]
Fix bug of get context user (#17169) (#17172)

Co-authored-by: 6543 <6543@obermui.de>
3 years agoNicely handle missing user in collaborations (#17049) (#17166)
zeripath [Tue, 28 Sep 2021 06:41:12 +0000 (07:41 +0100)]
Nicely handle missing user in collaborations (#17049) (#17166)

Backport #17049

It is possible to have a collaboration in a repository which refers to a no-longer
existing user. This causes the repository transfer to fail with an unusual error.

This PR makes `repo.getCollaborators()` nicely handle the missing user by ghosting
the collaboration but also adds consistency check. It also adds an
Access consistency check.

Fix #17044

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
3 years agoCreate doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 (#17136...
zeripath [Mon, 27 Sep 2021 17:30:11 +0000 (18:30 +0100)]
Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 (#17136) (#17137)

Backport #17136

There was a serious issue with the `gitea dump` command in 1.14.3-1.14.6 which led to corruption of the `config` field of the `repo_unit` table.

This PR adds a doctor command to attempt to fix the broken repo_units. Users affected by #16961 should run:

```
gitea doctor --fix --run fix-broken-repo-units
```

Fix #16961

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd Horizontal scrollbar to inner menu on Chrome (#17086) (#17164)
zeripath [Mon, 27 Sep 2021 16:44:22 +0000 (17:44 +0100)]
Add Horizontal scrollbar to inner menu on Chrome (#17086) (#17164)

3 years agoFix wrong i18n keys (#17150) (#17153)
6543 [Sun, 26 Sep 2021 00:25:12 +0000 (02:25 +0200)]
Fix wrong i18n keys (#17150) (#17153)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agocorrect transaction ending (#17151)
Alexey 〒erentyev [Sat, 25 Sep 2021 15:45:39 +0000 (18:45 +0300)]
correct transaction ending (#17151)

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
3 years agoPrevent panic in Org mode HighlightCodeBlock (#17140) (#17141)
zeripath [Fri, 24 Sep 2021 13:29:47 +0000 (14:29 +0100)]
Prevent panic in Org mode HighlightCodeBlock (#17140) (#17141)

Backport #17140

When rendering source in org mode there is a mistake in the highlight code that
causes a panic.

This PR fixes this.

Fix #17139

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoChangelog 1.15.3 (#17091) v1.15.3
zeripath [Mon, 20 Sep 2021 04:02:52 +0000 (05:02 +0100)]
Changelog 1.15.3 (#17091)

## [1.15.3](https://github.com/go-gitea/gitea/releases/tag/v1.15.3) - 2021-09-19

* ENHANCEMENTS
  * Add fluid to ui container class to remove margin (#16396) (#16976)
  * Add caller to cat-file batch calls (#17082) (#17089)
* BUGFIXES
  * Render full plain readme. (#17083) (#17090)
  * Upgrade xorm to v1.2.4 (#17059)
  * Fix bug of migrate comments which only fetch one page (#17055) (#17058)
  * Do not show issue context popup on external issues (#17050) (#17054)
  * Decrement Fork Num when converting from Fork (#17035) (#17046)
  * Correctly rollback in ForkRepository (#17034) (#17045)
  * Fix missing close in WalkGitLog (#17008) (#17009)
  * Add prefix to SVG id/class attributes (#16997) (#17000)
  * Fix bug of migrated repository not index (#16991) (#16996)
  * Skip AllowedUserVisibilityModes validation on update user if it is an organisation (#16988) (#16990)
  * Fix storage Iterate bug and Add storage doctor to delete garbage attachments (#16971) (#16977)
  * Fix issue with issue default mail template (#16956) (#16975)
  * Ensure that rebase conflicts are handled in updates (#16952) (#16960)
  * Prevent panic on diff generation (#16950) (#16951)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd caller to cat-file batch calls (#17082) (#17089)
zeripath [Sun, 19 Sep 2021 16:07:35 +0000 (17:07 +0100)]
Add caller to cat-file batch calls (#17082) (#17089)

Some people still appear to report unclosed cat-files. This PR simply adds the caller
to the process descriptor for the CatFileBatch and CatFileBatchCheck calls.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoRender full plain readme. (#17083) (#17090)
zeripath [Sun, 19 Sep 2021 14:01:19 +0000 (15:01 +0100)]
Render full plain readme. (#17083) (#17090)

Backport #17083

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
3 years agoFix bug of migrate comments which only fetch one page (#17055) (#17058)
Lunny Xiao [Wed, 15 Sep 2021 18:01:54 +0000 (02:01 +0800)]
Fix bug of migrate comments which only fetch one page (#17055) (#17058)

* Fix bug of migrate comments which only fetch one page

* add next page to trace

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUpgrade xorm to v1.2.4 (#17059)
Lunny Xiao [Wed, 15 Sep 2021 15:27:46 +0000 (23:27 +0800)]
Upgrade xorm to v1.2.4 (#17059)

3 years agoDo not show issue context popup on external issues (#17050) (#17054)
zeripath [Wed, 15 Sep 2021 09:38:20 +0000 (10:38 +0100)]
Do not show issue context popup on external issues (#17050) (#17054)

Backport #17050

The issues pop-up context cannot work for external issues - therefore do not show
these.

Fix #17047

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoCorrectly rollback in ForkRepository (#17034) (#17045)
zeripath [Wed, 15 Sep 2021 05:42:09 +0000 (06:42 +0100)]
Correctly rollback in ForkRepository (#17034) (#17045)

Backport #17034

The rollback functionality in
services/repository/repository.go:ForkRepository is incorrect and could
lead to a deadlock as it uses DeleteRepository to delete the rolled-back
repository - a function which creates its own transaction.

This PR adjusts the rollback function to only use RemoveAll as any
database changes will be automatically rolled-back. It also handles
panics and adjusts the Close within WithTx to ensure that if there is a
panic the session will always be closed.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoDecrement Fork Num when converting from Fork (#17035) (#17046)
zeripath [Wed, 15 Sep 2021 02:05:47 +0000 (03:05 +0100)]
Decrement Fork Num when converting from Fork (#17035) (#17046)

Backport #17035

When converting repositories from forks to normal the root NumFork needs to be
decremented too.

Fix #17026

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix missing close in WalkGitLog (#17008) (#17009)
zeripath [Fri, 10 Sep 2021 09:46:06 +0000 (10:46 +0100)]
Fix missing close in WalkGitLog (#17008) (#17009)

Backport #17008

When the external context is cancelled it is possible for the
GitLogReader to not itself be Closed.

This PR does three things:

1. Instead of adding a plain defer it wraps the `g.Close` in a func as
`g` may change.
2. It adds the missing explicit g.Close - although the defer fix makes
this unnecessary.
3. It passes down the external context as the base context for the
GitLogReader meaning that the cancellation of the external context will
pass down automatically.

Fix #17007

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUse filename as id/class prefix. (#16997) (#17000)
KN4CK3R [Thu, 9 Sep 2021 09:47:28 +0000 (11:47 +0200)]
Use filename as id/class prefix. (#16997) (#17000)

Currently the svg minifier (`make svg`) rewrites all `id` and `class` attributes in svg files. Every file gets the ids `a, b, ...`. If multiple svgs with ids are used on a page these ids are conflicting and the results are broken images.

| minified ids | unique ids |
| - | - |
| ![grafik](https://user-images.githubusercontent.com/1666336/132579375-59d3996f-c4e5-43b8-8c8d-82280c90d9e3.png) | ![grafik](https://user-images.githubusercontent.com/1666336/132579413-05bf9285-4e3b-4d0d-8f95-90b212405b05.png) |

This PR adds a prefix (the filename) to every id/class.

Follow up problem: Because we embed svg images there are duplicated ids if one svg image is used multiple times on a page. As those ids refer to the same content it may be no real problem because browser handle that fine.

3 years agoFix bug of migrated repository not index (#16991) (#16996)
6543 [Thu, 9 Sep 2021 06:02:22 +0000 (08:02 +0200)]
Fix bug of migrated repository not index (#16991) (#16996)

Fix #16986, #16152

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoSkip AllowedUserVisibilityModes validation on update user if it is an organisation...
6543 [Wed, 8 Sep 2021 15:58:00 +0000 (17:58 +0200)]
Skip AllowedUserVisibilityModes validation on update user if it is an organisation (#16988) (#16990)

if AllowedUserVisibilityModes allow only public & limited, and orgs can be private, a user can create a repo to that organisation whitch will result in an update of the user. On this call the user is validaten and will be rejected since private is not allowed, but its not an user its an valid org ...

Co-authored-by: Alexey 〒erentyev <axifnx@gmail.com>
Co-authored-by: Alexey 〒erentyev <axifnx@gmail.com>
3 years agoFix storage Iterate bug and Add storage doctor to delete garbage attachments (#16971...
Lunny Xiao [Tue, 7 Sep 2021 18:39:05 +0000 (02:39 +0800)]
Fix storage Iterate bug and Add storage doctor to delete garbage attachments (#16971) (#16977)

* Fix storage Iterate bug and Add storage doctor to delete garbage attachments

* Close object when used

3 years agoFix issue with issue default mail template (#16956) (#16975)
Prasad Katti [Tue, 7 Sep 2021 02:06:59 +0000 (19:06 -0700)]
Fix issue with issue default mail template (#16956) (#16975)

Backport #16956

The mail template rendering was failing with the error -
`...vices/mailer/mail.go:301:composeIssueCommentMessages() [E] ExecuteTemplate [issue/default/body]: template: issue/default:65:10: executing "issue/default" at <.i18n.Tr>: can't evaluate field i18n in type *models.Comment`

The issue was the template variable i18n is available in the outer scope.

Fix #16877

Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd fluid to ui container class to remove margin (#16396) (#16976)
silverwind [Tue, 7 Sep 2021 01:37:32 +0000 (03:37 +0200)]
Add fluid to ui container class to remove margin (#16396) (#16976)

Co-authored-by: Stanley Hu <stanthetiger@yahoo.com>
3 years agoEnsure that rebase conflicts are handled in updates (#16952) (#16960)
zeripath [Sun, 5 Sep 2021 16:54:13 +0000 (17:54 +0100)]
Ensure that rebase conflicts are handled in updates (#16952) (#16960)

Backport #16952

PR #16125 did not update the error handlers to handle conflict errors relating
to rebases. This PR adds them.

Fix #16922

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoPrevent panic on diff generation (#16950) (#16951)
zeripath [Sun, 5 Sep 2021 10:17:42 +0000 (11:17 +0100)]
Prevent panic on diff generation (#16950) (#16951)

Backport #16950

The lastLeftIdx should be reset at the same time as creating a new section otherwise
it is possible for a second addition to end up attempting to read a nil entry.

Fix #16943

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoChangelog 1.15.2 (#16940) v1.15.2
zeripath [Fri, 3 Sep 2021 11:50:32 +0000 (12:50 +0100)]
Changelog 1.15.2 (#16940)

## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03

* BUGFIXES
  * Add unique constraint back into issue_index (#16938)
  * Close storage objects before cleaning (#16934) (#16942)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoClose storage objects before cleaning (#16934) (#16942)
zeripath [Fri, 3 Sep 2021 11:17:07 +0000 (12:17 +0100)]
Close storage objects before cleaning (#16934) (#16942)

Backport #16934

Storage.Iterate provides the path and an open object. On windows using
local storage means that the objects will be locked thus preventing clean
from deleting them.

This PR simply closes the objects early.

Fix #16932

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd unique constraint back into issue_index (#16938)
zeripath [Fri, 3 Sep 2021 09:35:18 +0000 (10:35 +0100)]
Add unique constraint back into issue_index (#16938)

There is a flaw in #16820 where it was missed that although xorm will
not add a primary key to a table during syncing, it will remove an
unique constraint.

Users upgrading from 1.15.0 to 1.15.1 will therefore lose the unique
constraint that makes this table work unless they run `gitea doctor
recreate-table issue_index`.  Postgres helpfully warns about this
situation but MySQL does not.

Main/1.16-dev is not affected by this issue as there is a migration that
does the above recreation by default. Users moving directly to 1.15.1
from 1.14.x or lower are also not affected.

Whilst we could force all users who ran 1.15.0 to do the above
recreate-table call, this PR proposes an alternative: Just add the
unique constraint back in for 1.15.x. This won't have any long term
effects - just some wasted space for the unnecessary index.

Fix #16936

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoChangelog 1.15.1 (#16925) v1.15.1
zeripath [Thu, 2 Sep 2021 17:23:40 +0000 (18:23 +0100)]
Changelog 1.15.1 (#16925)

## [1.15.1](https://github.com/go-gitea/gitea/releases/tag/v1.15.1) - 2021-09-02

* BUGFIXES
  * Allow BASIC authentication access to /:owner/:repo/releases/download/* (#16916) (#16923)
  * Prevent leave changes dialogs due to autofill fields (#16912) (#16920)
  * Ignore review comment when ref commit is missed (#16905) (#16919)
  * Fix wrong attachment removal (#16915) (#16917)
  * Gitlab Migrator: dont ignore reactions of last request (#16903) (#16913)
  * Correctly return the number of Repositories for Organizations (#16807) (#16911)
  * Test if LFS object is accessible (#16865) (#16904)
  * Fix git.Blob.DataAsync(): close pipe since we return a NopCloser (#16899) (#16900)
  * Fix dump and restore respository (#16698) (#16898)
  * Repare and Improve GetDiffRangeWithWhitespaceBehavior (#16894) (#16895)
  * Fix wiki raw commit diff/patch view (#16891) (#16892)
  * Ensure wiki repos are all closed (#16886) (#16888)
  * List limited and private orgs if authenticated on API (#16866) (#16879)
  * Simplify split diff view generation and remove JS dependency (#16775) (#16863)
  * Ensure that the default visibility is set on the user create page (#16845) (#16862)
  * In Render tolerate not being passed a context (#16842) (#16858)
  * Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16848)
  * Report the correct number of pushes on the feeds (#16811) (#16822)
  * Add primary_key to issue_index (#16813) (#16820)
  * Prevent NPE on empty commit (#16812) (#16819)
  * Fix branch pagination error (#16805) (#16816)
  * Add missing return to handleSettingRemoteAddrError (#16794) (#16795)
  * Remove spurious / from issues.opened_by (#16793)
  * Ensure that template compilation panics are sent to the logs (#16788) (#16792)
  * Update caddyserver/certmagic (#16789) (#16790)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAllow BASIC authentication access to /:owner/:repo/releases/download/* (#16916) ...
zeripath [Thu, 2 Sep 2021 16:34:49 +0000 (17:34 +0100)]
Allow BASIC authentication access to /:owner/:repo/releases/download/* (#16916) (#16923)

Backport #16916

Duplicate #15987 to allow access to releases download through BASIC authentication.

Fix #16914

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoPrevent leave changes dialogs due to autofill fields (#16912) (#16920)
zeripath [Thu, 2 Sep 2021 16:00:20 +0000 (17:00 +0100)]
Prevent leave changes dialogs due to autofill fields (#16912) (#16920)

Backport #16912

Add ignore-dirty to /user/settings/account
Add autocomplete="off" to push_mirror_address form on /:owner/:repo/settings

Fix #16861

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoIgnore review comment when ref commit is missed (#16905) (#16919)
Lunny Xiao [Thu, 2 Sep 2021 10:51:32 +0000 (18:51 +0800)]
Ignore review comment when ref commit is missed (#16905) (#16919)

backport #16905

3 years agoFix wrong attachment removal (#16915) (#16917)
wxiaoguang [Thu, 2 Sep 2021 05:50:11 +0000 (13:50 +0800)]
Fix wrong attachment removal (#16915) (#16917)

Backport #16917

3 years agoGitlab Migrator: dont ignore reactions of last request (#16903) (#16913)
zeripath [Wed, 1 Sep 2021 21:52:38 +0000 (22:52 +0100)]
Gitlab Migrator: dont ignore reactions of last request (#16903) (#16913)

Backport #16903

Fix bug related to early breaking when migrating reactions.

Co-authored-by: 6543 <6543@obermui.de>
3 years agoCorrectly return the number of Repositories for Organizations (#16807) (#16911)
zeripath [Wed, 1 Sep 2021 17:20:35 +0000 (18:20 +0100)]
Correctly return the number of Repositories for Organizations (#16807) (#16911)

Backport #16807

Calculate and return the number of Repositories on the dashboard
Organization list.

This PR restores some of the logic that was removed in #14032 to
calculate the number of repos on the dashboard orgs list.

Fix #16648
Replaces #16799

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoTest if LFS object is accessible (#16865) (#16904)
6543 [Tue, 31 Aug 2021 15:58:39 +0000 (17:58 +0200)]
Test if LFS object is accessible (#16865) (#16904)

* Test if object is accessible.

* Added more logging.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
3 years ago List limited and private orgs if authenticated on API (#16866) (#16879)
6543 [Tue, 31 Aug 2021 10:49:02 +0000 (12:49 +0200)]
 List limited and private orgs if authenticated on API (#16866) (#16879)

3 years agoFix dump and restore respository (#16698) (#16898)
Lunny Xiao [Tue, 31 Aug 2021 09:44:14 +0000 (17:44 +0800)]
Fix dump and restore respository (#16698) (#16898)

* Fix dump and restore
* return different error message for get commit
* Fix missing delete release attachment when deleting repository
* Fix ci and add some comments

back port #16698

Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix git.Blob.DataAsync(): close pipe since we return a NopCloser (#16899) (#16900)
6543 [Tue, 31 Aug 2021 08:06:01 +0000 (10:06 +0200)]
Fix git.Blob.DataAsync(): close pipe since we return a NopCloser (#16899) (#16900)

* make sure headGitRepo is closed on err too
* refactor
* Fix git.Blob.DataAsync(): exec cancel since we already read all bytes (close pipe since we return a NopCloser)

Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix wiki raw commit diff/patch view (#16891) (#16892)
6543 [Tue, 31 Aug 2021 06:13:08 +0000 (08:13 +0200)]
Fix wiki raw commit diff/patch view (#16891) (#16892)

3 years agoRepare and Improve GetDiffRangeWithWhitespaceBehavior (#16894) (#16895)
6543 [Tue, 31 Aug 2021 03:02:27 +0000 (05:02 +0200)]
Repare and Improve GetDiffRangeWithWhitespaceBehavior (#16894) (#16895)

fix pipe leak

3 years agoEnsure wiki repos are all closed (#16886) (#16888)
6543 [Mon, 30 Aug 2021 21:00:45 +0000 (23:00 +0200)]
Ensure wiki repos are all closed (#16886) (#16888)

There are multiple places where wiki git repositories are not properly closed.

This PR ensures they are closed.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoSimplify split diff view generation and remove JS dependency (#16775) (#16863)
zeripath [Mon, 30 Aug 2021 15:43:06 +0000 (16:43 +0100)]
Simplify split diff view generation and remove JS dependency (#16775) (#16863)

Backport #16775

Gitea has relied on some slow JS code to match up added and deleted lines on the
diff pages. This can cause a considerable slow down on large diff pages.

This PR makes a small change meaning that the matching up can occur much more simply.

Partial fix #1351

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoEnsure that the default visibility is set on the user create page (#16845) (#16862)
zeripath [Sun, 29 Aug 2021 15:33:13 +0000 (16:33 +0100)]
Ensure that the default visibility is set on the user create page (#16845) (#16862)

Backport #16845

Set the default visibility on the user create page.

Fix #16840

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoIn Render tolerate not being passed a context (#16842) (#16858)
6543 [Sun, 29 Aug 2021 14:25:45 +0000 (16:25 +0200)]
In Render tolerate not being passed a context (#16842) (#16858)

* In Render tolerate not being passed a context

It is possible for RenderString to be passed to an external renderer if markdown
is set to be rendered by an external renderer. No context is currently sent to these
meaning that this will error out.

Fix #16835

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add Context to Repo calls for RenderString

All calls from routers can easily add the context - so add it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUpgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources...
zeripath [Sat, 28 Aug 2021 11:16:19 +0000 (12:16 +0100)]
Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16848)

* Upgrade xorm to v1.2.2 (#16663)

Backport #16663

Fix #16683

* Add test to ensure that dumping of login sources remains correct (#16847)

#16831 has occurred because of a missed regression. This PR adds a simple test to
try to prevent this occuring again.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoReport the correct number of pushes on the feeds (#16811) (#16822)
techknowlogick [Thu, 26 Aug 2021 06:30:13 +0000 (02:30 -0400)]
Report the correct number of pushes on the feeds (#16811) (#16822)

* Report the correct number of pushes on the feeds

Since the number of commits in the Action table has been limited to 5
the number of commits reported on the feeds page is now incorrectly also
limited to 5. The correct number is available as the Len and this PR
changes this to report this.

Fix #16804

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update templates/user/dashboard/feeds.tmpl

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdd primary_key to issue_index (#16813) (#16820)
zeripath [Wed, 25 Aug 2021 22:10:15 +0000 (23:10 +0100)]
Add primary_key to issue_index (#16813) (#16820)

Backport #16813

Make the group_id a primary key in issue_index. This already has an
unique index and therefore is a good candidate for becoming a primary
key.

This PR also changes all other uses of this table to add the group_id as
the primary key.

The migration v192 from #16813 has not been backported but Xorm will
work fine with non-primary keyed tables. If a user on 1.15 wishes to
have the correct schema sooner than 1.16 - they can use gitea doctor
recreate-table issue_index and gitea will recreate the table with the
primary key.

Fix #16802

Signed-off-by: Andrew Thornton art27@cantab.net
3 years agoPrevent NPE on empty commit (#16812) (#16819)
zeripath [Wed, 25 Aug 2021 12:22:48 +0000 (13:22 +0100)]
Prevent NPE on empty commit (#16812) (#16819)

Backport #16812

Handle completely empty commit as the first commit to a repository.

Fix #16668

Signed-off-by: Andrew Thornton art27@cantab.net
3 years agoFix branch pagination error (#16805) (#16816)
Lunny Xiao [Wed, 25 Aug 2021 10:11:54 +0000 (18:11 +0800)]
Fix branch pagination error (#16805) (#16816)

Backport #16805

Fix #16801

Even if default branch is removed from the current page, but the total branches number should be still kept. So that the pagination calculation will be correct.

3 years agoEnsure that template compilation panics are sent to the logs (#16788) (#16792)
zeripath [Mon, 23 Aug 2021 23:50:04 +0000 (00:50 +0100)]
Ensure that template compilation panics are sent to the logs (#16788) (#16792)

Backport #16788

Although panics within the rendering pipeline are caught and dealt with,
panics that occur before that starts are unprotected and will kill Gitea
without being sent to the logs.

This PR adds a basic recovery handler to catch panics that occur after
the logger is initialised and ensure that they're sent to the logger.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoRemove spurious / from issues.opened_by (#16793)
zeripath [Mon, 23 Aug 2021 22:24:30 +0000 (23:24 +0100)]
Remove spurious / from issues.opened_by (#16793)

Fix #16713

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd missing return to handleSettingRemoteAddrError (#16794) (#16795)
zeripath [Mon, 23 Aug 2021 22:09:28 +0000 (23:09 +0100)]
Add missing return to handleSettingRemoteAddrError (#16794) (#16795)

Backport #16794

There is a missing return in handleSettingRemoteAddrError which means
that the error page for repo settings is duplicately rendered.

Fix #16771

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUpdate only certmagic (#16790)
zeripath [Mon, 23 Aug 2021 22:07:44 +0000 (23:07 +0100)]
Update only certmagic (#16790)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
3 years agochangelog for 1.15.0 (#16760) v1.15.0
techknowlogick [Sun, 22 Aug 2021 00:38:22 +0000 (20:38 -0400)]
changelog for 1.15.0 (#16760)

* changelog for 1.15.0

* Slight rename of GPG feature

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoKeep attachments on tasklist update (#16750) (#16757)
KN4CK3R [Sat, 21 Aug 2021 19:10:04 +0000 (21:10 +0200)]
Keep attachments on tasklist update (#16750) (#16757)

* Send attachments too.

* Use tasklist flag.

* use action="ignoreAttachments" instead of "tasklist"

* Use boolean parameter.

* when the update request doesn't intend to update attachments (eg: change checkbox state), ignore attachment updates (#16762)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years agoRecreate Tables should Recreate indexes on MySQL (#16718) (#16739)
zeripath [Sat, 21 Aug 2021 02:47:37 +0000 (03:47 +0100)]
Recreate Tables should Recreate indexes on MySQL (#16718) (#16739)

The MySQL indexes are not being renamed at the same time as RENAME table despite the
CASCADE. Therefore it is probably better to just recreate the indexes instead.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix dependency translations (#16755)
Steven [Fri, 20 Aug 2021 17:11:26 +0000 (19:11 +0200)]
Fix dependency translations (#16755)

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
3 years agoDo not use thin scrollbars on Firefox (#16738) (#16745)
Elouan Martinet [Fri, 20 Aug 2021 05:19:22 +0000 (07:19 +0200)]
Do not use thin scrollbars on Firefox (#16738) (#16745)

In #7269, thin scrollbars were added in Arc Green theme. It got moved
in base theme in #13361.

This PR removes the use of thin scrollbars which causes an
accessibility issue. The scrollbars become too thin to be dragged.

Signed-off-by: Elouan Martinet <exa@elou.world>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix wrong user in OpenID response (#16736) (#16741)
KN4CK3R [Thu, 19 Aug 2021 21:26:44 +0000 (23:26 +0200)]
Fix wrong user in OpenID response (#16736) (#16741)

* Fix wrong user in OpenID response (#16736)

* Fixed usage of wrong user.

* Added tests.

* Fixed wrong import.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoRestore functionality for pushing non-standard refs (Partial #16705) (#16706)
zeripath [Tue, 17 Aug 2021 08:24:47 +0000 (09:24 +0100)]
Restore functionality for pushing non-standard refs (Partial #16705) (#16706)

Partial Backport #16705

There was an inadvertent breaking change in #15629 meaning that notes refs and other
git extension refs will be automatically rejected.

This PR removes this incorrect forced rejection of non-standard refs.

Fix #16688

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agorelease/v1.15: set min go version to min upstream supported go1.16 (#16710)
techknowlogick [Tue, 17 Aug 2021 07:09:44 +0000 (03:09 -0400)]
release/v1.15: set min go version to min upstream supported go1.16 (#16710)

* release/v1.15: set min go version to min upstream supported 1.16

* update drone

3 years agoUpgrade levelqueue 0.4.1 (#16696) (#16700)
Lunny Xiao [Mon, 16 Aug 2021 07:37:27 +0000 (15:37 +0800)]
Upgrade levelqueue 0.4.1 (#16696) (#16700)

3 years agoEnsure empty lines are copiable and final new line too (#16678) (#16692)
zeripath [Sun, 15 Aug 2021 03:39:23 +0000 (04:39 +0100)]
Ensure empty lines are copiable and final new line too (#16678) (#16692)

Backport #16678

When files are highlighted the newline character needs to be added in a whitespace
compliant mode. Also ensure the final empty newline is rendered.

Fix #16434

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago If PatchURL is empty, skip pull patch download when migrating (Partial #16356) ...
6543 [Fri, 13 Aug 2021 16:26:19 +0000 (18:26 +0200)]
 If PatchURL is empty, skip pull patch download when migrating (Partial #16356) (#16681)

Partial backport #16356

Whilst looking at adding migration support for onedev it has become apparent that gitea would attempt to pull patches on other migration targets even if that PatchURL was empty.

3 years agoUpdate issue_index to finish migration (#16685) (#16687)
6543 [Fri, 13 Aug 2021 14:13:03 +0000 (16:13 +0200)]
Update issue_index to finish migration (#16685) (#16687)

* update issue_index to finish migration

* One Func to RecalculateIssueIndexForRepo

3 years agoFix NPE in fuzzer (#16680) (#16682)
6543 [Fri, 13 Aug 2021 05:51:13 +0000 (07:51 +0200)]
Fix NPE in fuzzer (#16680) (#16682)

The fuzzer found an issue with the issue pattern processor where there is a spurious
path.Clean which does not need to be there. This PR also sets the default AppURL for
the fuzzer too.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoChange the implementation of the go-git version of GetNote to mirror the non go-git...
nitul1991 [Mon, 9 Aug 2021 19:24:31 +0000 (00:54 +0530)]
Change the implementation of the go-git version of GetNote to mirror the non go-git version when passed a non-existent commit (#16658) (#16659)

Backport #16658

Fixes #16657

3 years agoFix direct creation of external users on admin page (#16613)
zeripath [Mon, 9 Aug 2021 12:18:40 +0000 (13:18 +0100)]
Fix direct creation of external users on admin page (#16613)

From #16612 it was noticed that when creating new external users directly it was not
possible to set their username correctly. This PR restores this ability.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoRestore compatibility with SQLServer 2008 R2 in migrations (#16638)
zeripath [Sun, 8 Aug 2021 10:32:07 +0000 (11:32 +0100)]
Restore compatibility with SQLServer 2008 R2 in migrations (#16638)

This fixes two problems with MSSQL:

* `ALTER TABLE DROP ... IF EXISTS ...` is only supported in SQL Server >16.

The `IF EXISTS` here is a belt-and-braces and does not need to be present. Therefore
can be dropped. Also stop attempting to drop the indexes as constraints as they're indexes!

* System tables like: `sys.indexes` should be lowercase not uppercase because of collation issues.

Fix #13615

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoChangelog for 1.15.0-rc3 (#16621) v1.15.0-rc3
zeripath [Fri, 6 Aug 2021 20:08:13 +0000 (21:08 +0100)]
Changelog for 1.15.0-rc3 (#16621)

* Changelog for 1.15.0-rc3

 ## [1.15.0-rc3](https://github.com/go-gitea/gitea/releases/tag/v1.15.0-rc3) - 2021-08-04

* BREAKING
  * Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
* SECURITY
  * Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
  * Switch to maintained jwt lib (#16532) (#16533)
  * Correctly create of git-daemon-export-ok files (#16508) (#16514)
  * Don't show private user's repo in explore view (#16550) (#16554)
* API
  * Swagger AccessToken fixes (#16574) (#16597)
  * Set AllowedHeaders on API CORS handler (#16524) (#16618)
* BUGFIXES
  * Restore Accessibility for Dropdown (#16576) (#16617)
  * Pass down SignedUserName down to AccessLogger context (#16605) (#16616)
  * Fix table alignment in markdown (#16596) (#16602)
  * Fix 500 on first wiki page (#16586) (#16598)
  * Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup (#16564) (#16570)
  * Upgrade levelqueue to v0.4.0 (#16560) (#16561)
  * Handle too long PR titles correctly (#16517) (#16549)
  * Fix data race in bleve indexer (#16474) (#16509)
  * Restore CORS on git smart http protocol (#16496) (#16506)
  * Fix race in log (#16490) (#16505)
  * Fix prepareWikiFileName to respect existing unescaped files (#16487) (#16498)
  * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16480)
  * Update notification table with only latest data (#16445) (#16469)
  * Revert to use alpine 3.13 (#16451) (#16452)
  * Fix crash following ldap authentication update (#16447) (#16448)
  * Fix direct creation of external users on admin page (partial #16612) (#16613)

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Update CHANGELOG.md

Co-authored-by: zeripath <art27@cantab.net>
* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoPrevent 500 on draft releases without tag (#16634) (#16636)
techknowlogick [Fri, 6 Aug 2021 08:09:33 +0000 (04:09 -0400)]
Prevent 500 on draft releases without tag (#16634) (#16636)

It is possible to create draft releases prior to creating a tag. This will cause a
500 on the releases page due to compare page failing.

This PR only shows the compare button if there is a SHA1 present.

Fix #16610

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFrontport changelog for v1.14.6 (#16633)
zeripath [Thu, 5 Aug 2021 22:17:44 +0000 (23:17 +0100)]
Frontport changelog for v1.14.6 (#16633)

* Frontport changelog for v1.14.6

Frontport #16619

Changelog frontported to below v1.15.0-rc1.

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUpdate node tar dependency to 6.1.6 (#16622) (#16623)
zeripath [Thu, 5 Aug 2021 04:40:25 +0000 (05:40 +0100)]
Update node tar dependency to 6.1.6 (#16622) (#16623)

Backport #16622

Forcibly update dev dependency on tar to 6.1.6

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoSet AllowedHeaders on API CORS handler (#16524) (#16618)
zeripath [Wed, 4 Aug 2021 19:57:59 +0000 (20:57 +0100)]
Set AllowedHeaders on API CORS handler (#16524) (#16618)

Backport #16524

Set AllowedHeaders on API CORS handler and add missing Access-Control-Expose-Headers
to pull API.

Fix #16100

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoPass down SignedUserName down to AccessLogger context (#16605) (#16616)
zeripath [Wed, 4 Aug 2021 17:26:35 +0000 (18:26 +0100)]
Pass down SignedUserName down to AccessLogger context (#16605) (#16616)

Backport #16605

Unfortunately when the AccessLogger was moved back before the contexters the
SignedUserName reporting was lost. This is due to Request.WithContext leading to a
shallow copy of the Request and the modules/context/Context being within that request.

This PR adds a new context variable of a string pointer which is set and handled
in the contexters.

Fix #16600

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoRestore #10096/#8638 and re-fix #15172 (#16576) (#16617)
zeripath [Wed, 4 Aug 2021 12:31:10 +0000 (13:31 +0100)]
Restore #10096/#8638 and re-fix #15172 (#16576) (#16617)

Backport #16576

This PR restores the vendored and patched dropdow from #8638. It
however, it partially abandons the call to `click()` using instead the
default dropdown click calls instead. This prevents the issue of the
dropdown grabbing focus permanently however, this may have negative
effects on the effect of focus on the dropdowns.

Of note, the behaviour of the template selector dropdown on the repo
creation page is slightly odd - I don't believe that this odd behaviour
is caused by this PR but rather by the feed source for this. I suspect
that the dropdown should be adding a delete button to its selection.

Fix #15172
References: #7057

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix table alignment in markdown (#16596) (#16602)
zeripath [Tue, 3 Aug 2021 23:16:00 +0000 (00:16 +0100)]
Fix table alignment in markdown (#16596) (#16602)

Backport #16596

Set the TableOptions in markdown to allow alignment of the tables to work correctly

Fix #15959

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix 500 on first wiki page (#16586) (#16598)
zeripath [Tue, 3 Aug 2021 22:46:08 +0000 (23:46 +0100)]
Fix 500 on first wiki page (#16586) (#16598)

Backport #16586

There is a mistake in #16319 and #16487 which means that the first time
a wiki page is created a 500 is reported because the `master` branch is
not in existence in that wiki yet.

This PR simply checks for this error and returns not found.

Fix #16584

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUpgrade to the latest version of golang-jwt (#16590) (#16606)
zeripath [Tue, 3 Aug 2021 21:22:52 +0000 (22:22 +0100)]
Upgrade to the latest version of golang-jwt (#16590) (#16606)

* Upgrade to the latest version of golang-jwt.

Backport #16590

* Forcibly update the vendored versions too
* Update our minimal go lang version to 1.15 (differs from 1.16 in #16590)

Signed-off-by: Andrew Thornton <art27@cantab.net>
 ### :warning: BREAKING :warning:

This PR raises the minimal version of go supported to 1.15 which will mean the end of support of 32-bit Mac and Mac OS versions before Sierra.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* update minimal go required

Signed-off-by: Andrew Thornton <art27@cantab.net>
* update config.yaml

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoSwagger AccessToken fixes (#16574) (#16597)
zeripath [Mon, 2 Aug 2021 18:24:47 +0000 (19:24 +0100)]
Swagger AccessToken fixes (#16574) (#16597)

Backport #16574

There is a subtle problem with the Swagger definition for AccessTokens which causes
autogeneration of APIs for these endpoints to fail.

This PR corrects these errors.

Ref: https://github.com/zeripath/java-gitea-api/issues/4
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[CI] Use node v14 instead of node v16 until it will pass again (#16595) (#16599)
6543 [Mon, 2 Aug 2021 06:41:58 +0000 (08:41 +0200)]
[CI] Use node v14 instead of node v16 until it will pass again (#16595) (#16599)

* for CI release: use node 14 (lts) to build until 16 do fail

* all in for node v14.x

3 years agoLock goth/gothic and Re-attempt OAuth2 registration on login if registration failed...
zeripath [Thu, 29 Jul 2021 17:52:38 +0000 (18:52 +0100)]
Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup (#16570)

Backport #16564

This PR has two parts:

* Add locking to goth and gothic calls with a RWMutex

The goth and gothic calls are currently unlocked and thus are a cause of multiple potential races

* Reattempt OAuth2 registration on login if registration failed

If OAuth2 registration fails at startup we currently disable the login_source however an alternative approach could be to reattempt registration on login attempt.

Fix #16096

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUpgrade levelqueue to v0.4.0 (#16560) (#16561)
Lunny Xiao [Tue, 27 Jul 2021 16:59:06 +0000 (00:59 +0800)]
Upgrade levelqueue to v0.4.0 (#16560) (#16561)

Fix #16546

3 years agonot show private user's repo in explore view (#16550) (#16554)
a1012112796 [Tue, 27 Jul 2021 06:34:25 +0000 (14:34 +0800)]
not show private user's repo in explore view (#16550) (#16554)

after #16069, visibility is also usefull for user,
so this limit is not usefull.

fix #16545

3 years agoFix session bugs (#16552) (#16553)
6543 [Tue, 27 Jul 2021 01:44:44 +0000 (03:44 +0200)]
Fix session bugs (#16552) (#16553)

* Fix session bugs (#16552)

* fix deadlog bug

* Fix models/issue_stopwatch.go

* Update models/issue_stopwatch.go

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

Co-authored-by: zeripath <art27@cantab.net>
3 years agoHandle too long PR titles correctly (#16517) (#16549)
zeripath [Mon, 26 Jul 2021 15:49:48 +0000 (16:49 +0100)]
Handle too long PR titles correctly (#16517) (#16549)

Backport #16517

The CompareAndPullRequestPost handler for POST to /compare
incorrectly handles returning errors to the user. For a start
it does not set the necessary markers to switch SimpleMDE
but it also does not immediately return to the form.

This PR fixes this by setting the appropriate values, fixing
the templates and preventing the suggestion of a too long
title.

Fix #16507

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