]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoSeparate the details links of commit-statuses in headers (#18661) (#18730)
zeripath [Sat, 12 Feb 2022 03:40:55 +0000 (03:40 +0000)]
Separate the details links of commit-statuses in headers (#18661) (#18730)

Backport #18661

2 years agoFix release typo (#18728) (#18731)
Lunny Xiao [Sat, 12 Feb 2022 01:15:34 +0000 (09:15 +0800)]
Fix release typo (#18728) (#18731)

2 years agoUpdate object repo with the migrated repository (#18684) (#18726)
wxiaoguang [Fri, 11 Feb 2022 16:23:41 +0000 (00:23 +0800)]
Update object repo with the migrated repository (#18684) (#18726)

When migrating a repository (from GitHub) using the API (**POST** `repos/migrate`), the Code Indexer is not updated. Searching in the user interface will not return any results.

When migrating the same repository using **+/New Migration** in the web interface, the search index is updated and searching works as expected.

Caused by the fact that object `repo` is never updated with the migrated repo so `setting.Indexer.RepoIndexerEnabled && !repo.IsEmpty` in `modules/notification/indexer/indexer.go:NotifyMigrateRepository` always evaluates to `false`.

Tested with gitea:1.16.1, MariaDB:10, Breve in `Run Mode: Dev`.

Co-authored-by: Hugo Hoitink <10838836+hoitih@users.noreply.github.com>
2 years agoFix bug for version update hint (#18701) (#18705)
Lunny Xiao [Thu, 10 Feb 2022 18:35:24 +0000 (02:35 +0800)]
Fix bug for version update hint (#18701) (#18705)

* Fix bug for version update hint (#18701)
* Add translation for zh-CN

Co-authored-by: silverwind <me@silverwind.io>
2 years agoPrevent security failure due to bad APP_ID (#18678) (#18682)
zeripath [Thu, 10 Feb 2022 15:17:44 +0000 (15:17 +0000)]
Prevent security failure due to bad APP_ID (#18678) (#18682)

Backport #18678

WebAuthn may cause a security exception if the provided APP_ID is not allowed for the
current origin. Therefore we should reattempt authentication without the appid
extension.

Also we should allow [u2f] as-well as [U2F] sections.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix issue with docker-rootless shimming script (#18690) (#18699)
zeripath [Thu, 10 Feb 2022 11:37:53 +0000 (11:37 +0000)]
Fix issue with docker-rootless shimming script (#18690) (#18699)

Backport #18690

There is a problem with the current shimming script in that it will double quote the
provided GITEA_APP_INI due to a mistake in the bash. Here we change this to use a bash array.

Fix https://gitea.com/gitea/helm-chart/issues/287

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoC preprocessor colors improvement (#18671) (#18696)
silverwind [Thu, 10 Feb 2022 02:12:03 +0000 (03:12 +0100)]
C preprocessor colors improvement (#18671) (#18696)

* C preprocessor colors improvement

Fixes #18670

* Update web_src/less/chroma/light.less

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* typo

missing semi

* add color for #include filenames

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Bruno Raoult <braoult@users.noreply.github.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoLet return correct perm (#18675) (#18689)
Gusted [Wed, 9 Feb 2022 20:19:48 +0000 (21:19 +0100)]
Let  return correct perm (#18675) (#18689)

Backport of #18675

2 years agoRestart zero worker if there is still work to do (#18658) (#18672)
zeripath [Tue, 8 Feb 2022 21:28:21 +0000 (21:28 +0000)]
Restart zero worker if there is still work to do (#18658) (#18672)

* Restart zero worker if there is still work to do (#18658)

Backport #18658

It is possible for the zero worker to timeout before all the work is finished.
This may mean that work may take a long time to complete because a worker will only
be induced on repushing.

Also ensure that requested count is reset after pulls and push mirror sync requests and add some more trace logging to the queue push.

Fix #18607

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

2 years agoBackport: fix the missing i18n key for update checker (#18646) (#18665)
wxiaoguang [Tue, 8 Feb 2022 09:03:47 +0000 (17:03 +0800)]
Backport: fix the missing i18n key for update checker (#18646) (#18665)

2 years agoNo longer show the db-downgrade SQL in production (#18654)
wxiaoguang [Mon, 7 Feb 2022 14:07:11 +0000 (22:07 +0800)]
No longer show the db-downgrade SQL in production (#18654)

2 years agoIf rendering has failed due to a net.OpError stop rendering (#18642) (#18645)
zeripath [Mon, 7 Feb 2022 01:25:05 +0000 (01:25 +0000)]
If rendering has failed due to a net.OpError stop rendering (#18642) (#18645)

Backport #18642

When a net.OpError occurs during rendering the underlying connection is essentially
dead and therefore attempting to render further data will only cause further errors.

Therefore in serverErrorInternal detect if the passed in error is an OpError and
if so do not attempt any further rendering.

Fix #18629

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAdd changelog for v1.16.1 (#18614) v1.16.1
Lunny Xiao [Sun, 6 Feb 2022 12:35:24 +0000 (20:35 +0800)]
Add changelog for v1.16.1 (#18614)

Add changelog for v1.16.1

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
2 years agocomments on migrated issues/prs must link to the comment ID (#18637)
singuliere [Sun, 6 Feb 2022 11:40:08 +0000 (12:40 +0100)]
comments on migrated issues/prs must link to the comment ID (#18637)

Instead of the issue ID which is not a valid anchor.

Signed-off-by: singuliere <singuliere@autistici.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoStop logging an error when notes are not found (#18626) (#18635)
zeripath [Sun, 6 Feb 2022 09:43:15 +0000 (09:43 +0000)]
Stop logging an error when notes are not found (#18626) (#18635)

Backport #18626

This is an unnecessary logging event.

Fix #18616

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoOnly attempt to flush queue if the underlying worker pool is not finished (#18593...
zeripath [Sun, 6 Feb 2022 06:55:44 +0000 (06:55 +0000)]
Only attempt to flush queue if the underlying worker pool is not finished (#18593) (#18620)

* Only attempt to flush queue if the underlying worker pool is not finished (#18593)

Backport #18593

There is a possible race whereby a worker pool could be cancelled but yet the
underlying queue is not empty. This will lead to flush-all cycling because it
cannot empty the pool.

* On shutdown of Persistant Channel Queues close datachan and empty

Partial Backport #18415

Although we attempt to empty the datachan in queues - due to
races we are better off just closing the channel and forcibly emptying
it in shutdown.

Fix #18618

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move zero workers warning to debug

Fix #18617

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

Co-authored-by: Gusted <williamzijl7@hotmail.com>
* Update modules/queue/manager.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
2 years agoEnsure that blob-excerpt links work for wiki (#18587) (#18624)
zeripath [Sun, 6 Feb 2022 04:22:20 +0000 (04:22 +0000)]
Ensure that blob-excerpt links work for wiki (#18587) (#18624)

Backport #18587

It appears that the blob-excerpt links do not work on the wiki - likely since their
introduction.

This PR adds support for the wiki on these links.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAttempt to prevent intermittent failure TestGit/xxx/BranchProtectMerge/MergePR (...
zeripath [Sat, 5 Feb 2022 20:49:53 +0000 (20:49 +0000)]
Attempt to prevent intermittent failure TestGit/xxx/BranchProtectMerge/MergePR (#18451) (#18619)

Backport #18451

One of the repeated intermittent failures we see in testing is a failure due to
branches not being ready to merge.

Prior to the immediate queue implementation we would attempt to flush all the queues
and this would prevent the issue. However, the immediate queue is not flushable so
the flushall is not successful at preventing this.

This PR proposes an alternative solution - wait some time and try again up to 5 times.

If this fails then there is a genuine issue and we should fail.

Related #17719

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoEnsure commit-statuses box is sized correctly in headers (#18538) (#18606)
zeripath [Fri, 4 Feb 2022 17:03:41 +0000 (17:03 +0000)]
Ensure commit-statuses box is sized correctly in headers (#18538) (#18606)

* Ensure commit-statuses box is sized correctly in headers (#18538)

Backport #18538
Backport #18605

* Ensure commit-statuses box is sized correctly in headers

When viewing commits as commits the commit-status box will be fixed at 30px in height
due to being forced to be this size by a fomantic selector. This PR simply adds a
few more selectors to force this to have height auto.

Fix #18498

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove the spurious space in the .ui.right additional selector

Somehow a spurious space sneaked in to #18538
this PR simply removes it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoPrevent merge messages from being sorted to the top of email chains (#18566) (#18588)
zeripath [Fri, 4 Feb 2022 08:30:36 +0000 (08:30 +0000)]
Prevent merge messages from being sorted to the top of email chains (#18566) (#18588)

Backport #18566

Gitea will currrently resend the same message-id for the closed/merged/reopened
messages for issues. This will cause the merged message to leap to the top of an
email chain and become out of sync.

This PR adds specific suffices for these actions.

Fix #18560

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix pushing to 1-x-dev docker tag (#18578) (#18579)
zeripath [Thu, 3 Feb 2022 21:46:24 +0000 (21:46 +0000)]
Fix pushing to 1-x-dev docker tag (#18578) (#18579)

* Fix pushing to 1-x-dev docker tag

It appears that #18551 and #18573 have a mistake in that raymond does not have
an {{else}} on {{#equal}}. This PR notes that Sprig has a hasPrefix function
and so we use this with another if.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix pushing to 1-x-dev docker tag (part 2)

Although we now have the manifest working, we need to create the images.

Here we adjust the .drone.yml to force building of the images

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix pushing to 1-x-dev docker tag

OK now we have the images building we should make sure that the main ones stays
dev and the release/v* ones become *-dev-*

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoCollaborator trust model should trust collaborators (#18539) (#18557)
zeripath [Thu, 3 Feb 2022 16:20:37 +0000 (16:20 +0000)]
Collaborator trust model should trust collaborators (#18539) (#18557)

Backport #18539

There was an unintended regression in #17917 which leads to only
repository admin commits being trusted. This PR restores the old logic.

Fix #18501

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoPrevent panic on prohibited user login with oauth2 (#18562) (#18563)
zeripath [Thu, 3 Feb 2022 13:36:42 +0000 (13:36 +0000)]
Prevent panic on prohibited user login with oauth2 (#18562) (#18563)

Backport #18562

There was an unfortunate regression in #17962 where following detection of the
UserProhibitLogin error the err is cast to a pointer by mistake.

This causes a panic due to an interface error.

Fix #18561

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoMake docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch (...
zeripath [Thu, 3 Feb 2022 12:00:33 +0000 (12:00 +0000)]
Make docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch (#18551) (#18569)

Backport #18551

(Backporting this will enable this target to create 1.16-dev)

One of the problems with our current docker tagging is that although we
have strict version tags, latest and dev we do not have a way for docker
users to track the current release branch. This PR simply suggests that
we use the 1.x-dev tag for these and we build and push these. This will
give users who want or need unreleased bug fixes the option of tracking
the pre-release version instead of simply jumping to dev.

(Also contains backport for #18573)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd dropdown icon to template loading dropdown (#18571)
fnetX (aka fralix) [Thu, 3 Feb 2022 10:28:27 +0000 (11:28 +0100)]
Add dropdown icon to template loading dropdown (#18571)

2 years agoDetect conflicts with 3way merge (#18536) (#18537)
zeripath [Wed, 2 Feb 2022 14:35:25 +0000 (14:35 +0000)]
Detect conflicts with 3way merge (#18536) (#18537)

Backport #18536

Unforunately git apply --3way reports conflicts differently than standard patches
resulting in conflicts being missed.

Adjust the conflict detection code to account for this different error reporting.

Fix #18514

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoUpdate JS dependencies, fix lint (#18389) (#18540)
silverwind [Wed, 2 Feb 2022 08:42:23 +0000 (00:42 -0800)]
Update JS dependencies, fix lint (#18389) (#18540)

- Update all JS dependencies, including a security issue in mermaid
- Fix new linter errors related to value-keyword-case
- Tested Mermaid and Swagger

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoAdd `GetUserTeams` (#18499) (#18531)
zeripath [Wed, 2 Feb 2022 08:40:04 +0000 (08:40 +0000)]
Add `GetUserTeams` (#18499) (#18531)

Backport #18499

* Correct use `UserID` in `SearchTeams`

- Use `UserID` in the `SearchTeams` function, currently it was useless
to pass such information. Now it does a INNER statement to `team_user`
which obtains UserID -> TeamID data.
- Make OrgID optional.
- Resolves #18484

* Seperate searching specific user

* Add condition back

* Use correct struct type

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoFix review excerpt (#18502) (#18530)
zeripath [Wed, 2 Feb 2022 08:38:28 +0000 (08:38 +0000)]
Fix review excerpt (#18502) (#18530)

Backport #18502

Currently the "File Changed" tab of a PR is somehow broken. This is also true for the current release 1.16.0.

When you are on the "File Changed" tab, and want to look at code excerpt before or after the code changes, the layout breaks. You can test this on try.gitea.io here: https://try.gitea.io/testnotexisting/magic_enum/pulls/2/files

The problem occurs for the unified view and for the split view.

Kind of the same problem was there for commenting a line of code, this was fixed in #18321 and #18403.

For consistency, I changed the solution of #18321, I removed the ``colspan`` and instead added a ``<td>``. The goal was to have code similarly with the split view.

Also the separator line in the split view was in the wrong column, this was fixed too.* more consistent unified review comment

Fix #18516

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: confusedsushi <confused.sushi@googlemail.com>
2 years agoFix for AvatarURL database type (#18487) (#18529)
zeripath [Wed, 2 Feb 2022 03:30:52 +0000 (03:30 +0000)]
Fix for AvatarURL database type (#18487) (#18529)

Backport #18487

Co-authored-by: Viktor Kuzmin <kvaster@gmail.com>
2 years agoIn docker rootless use $GITEA_APP_INI if provided (#18524) (#18535)
zeripath [Tue, 1 Feb 2022 22:46:45 +0000 (22:46 +0000)]
In docker rootless use $GITEA_APP_INI if provided (#18524) (#18535)

Currently when calling `gitea` from any shell in rootless docker image it won't respect my `$GITEA_APP_INI`. Which this change it will use that value when defined instead of the default value.

- https://discourse.gitea.io/t/gitea-1-16-0-unable-to-find-configuration-file/4543
- https://gitea.com/gitea/helm-chart/issues/287

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoUpdate 1.16.0 changelog to set #17846 as breaking (#18533) (#18534)
zeripath [Tue, 1 Feb 2022 22:09:07 +0000 (22:09 +0000)]
Update 1.16.0 changelog to set #17846 as breaking (#18533) (#18534)

Backport #18533

Unfortunately #17846 was determined to be breaking due to affecting ssh passthrough
however, this discovery happened after the changelog was created. Update the
Changelog to mark this as breaking.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoUse "read" value for General Access (#18496) (#18500)
Gusted [Tue, 1 Feb 2022 20:24:27 +0000 (21:24 +0100)]
Use "read" value for General Access (#18496) (#18500)

- Backport of #18496

2 years agoUse `ImagedProvider` for gplus oauth2 provider (#18504) (#18505)
Gusted [Tue, 1 Feb 2022 02:45:58 +0000 (03:45 +0100)]
Use `ImagedProvider` for gplus oauth2 provider (#18504) (#18505)

- Bacport of #18504

Co-authored-by: 6543 <6543@obermui.de>
2 years agopoint to s3 endpoint directly (#18497) (#18510)
techknowlogick [Mon, 31 Jan 2022 22:50:41 +0000 (17:50 -0500)]
point to s3 endpoint directly (#18497) (#18510)

2 years agoFix OAuth Source Edit Page (#18495) (#18503)
zeripath [Mon, 31 Jan 2022 21:36:34 +0000 (21:36 +0000)]
Fix OAuth Source Edit Page (#18495) (#18503)

Backport #18495

* Fix OAuth Source Edit Page to ensure restricted and group settings are set
* Also tolerate []interface in the groups

Fix #18432

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPrevent NPE on partial match of compare URL and allow short SHA1 compare URLs (#18472...
Gusted [Sun, 30 Jan 2022 23:49:17 +0000 (00:49 +0100)]
Prevent NPE on partial match of compare URL and allow short SHA1 compare URLs (#18472) (#18473)

* Don't panic & allow shorter sha1 (#18472)

- Backport of #18472

* Improve comment

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years agoChangelog 1.16.0 (#18468) v1.16.0
zeripath [Sun, 30 Jan 2022 17:42:12 +0000 (17:42 +0000)]
Changelog 1.16.0 (#18468)

* Changelog for 1.16.0

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoGitLab reviews may not have the updated_at field set (#18450) (#18461)
Aravinth Manivannan [Sun, 30 Jan 2022 13:56:39 +0000 (13:56 +0000)]
GitLab reviews may not have the updated_at field set (#18450) (#18461)

Fallback to created_at if that the case and to time.Now() if it is
also missing.

Fixes: #18434
Co-authored-by: Loïc Dachary <loic@dachary.org>
Conflicts:
services/migrations/gitlab.go
trivial context conflict because var reviews became reviews := in 1.17

2 years agoFix broken when no commits and default branch is not master (#18423)
Lunny Xiao [Fri, 28 Jan 2022 06:48:36 +0000 (14:48 +0800)]
Fix broken when no commits and default branch is not master (#18423)

* Fix broken when no commits and default branch is not master

* Fix IsEmpty check

* Improve codes

2 years agoFix broken oauth2 authentication source edit page (#18412) (#18419)
zeripath [Wed, 26 Jan 2022 23:48:33 +0000 (23:48 +0000)]
Fix broken oauth2 authentication source edit page (#18412) (#18419)

Backport #18412

It appears that there was a broken merge of the edit.tmpl page during the merge
of #16594 - I am not entirely sure how this happened as the PR was correct.

This PR fixes the broken template.

Fix #18388

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoOnly view milestones from current repo (#18414) (#18417)
zeripath [Wed, 26 Jan 2022 22:09:07 +0000 (22:09 +0000)]
Only view milestones from current repo (#18414) (#18417)

Backport #18414

The endpoint /{username}/{reponame}/milestone/{id} is not currently restricted to
the repo. This PR restricts the milestones to those within the repo.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPlace inline diff comment dialogs on split diff in 4th and 8th columns (#18403) ...
zeripath [Tue, 25 Jan 2022 12:44:18 +0000 (12:44 +0000)]
Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403)  (#18404)

Backport #18403

Fix #18391
Fix #18320

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix restore without topic failure (#18387) (#18400)
Lunny Xiao [Tue, 25 Jan 2022 07:28:28 +0000 (15:28 +0800)]
Fix restore without topic failure (#18387) (#18400)

Co-authored-by: zeripath <art27@cantab.net>
2 years agoFix commit's time (#18375) (#18392)
Gusted [Tue, 25 Jan 2022 05:48:56 +0000 (05:48 +0000)]
Fix commit's time (#18375) (#18392)

- Backport of #18375

2 years agoPrevent showing webauthn error for every time visiting `/user/settings/security`...
wxiaoguang [Tue, 25 Jan 2022 00:11:49 +0000 (08:11 +0800)]
Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385) (#18386)

Backport #18385

2 years agoFix partial cloning a repo (#18373) (#18377)
Gusted [Sun, 23 Jan 2022 21:46:09 +0000 (21:46 +0000)]
Fix partial cloning a repo (#18373) (#18377)

* Fix partial cloning a repo (#18373)

- Backport from: #18373
- Backport isn't 1-1, because the frontport had a refactor in that area,
which v1.16 doesn't have.

* Include diff & use copy

* Add partial clone test

* patch

* Apply suggestions from code review

* globalArgs first

* avoid copy but make GlobalCMDArgs append first

* please linter

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix mime-type detection for HTTP server (#18371)
wxiaoguang [Sun, 23 Jan 2022 13:17:20 +0000 (21:17 +0800)]
Fix mime-type detection for HTTP server (#18371)

2 years agoBackport: Disable content sniffing on `PlainTextBytes` (#18365)
Gusted [Sat, 22 Jan 2022 23:58:09 +0000 (23:58 +0000)]
Backport: Disable content sniffing on `PlainTextBytes` (#18365)

- Backport of #18359

2 years agoUpdate github.com/duo-labs/webauthn (#18357) (#18364)
6543 [Sat, 22 Jan 2022 18:32:10 +0000 (19:32 +0100)]
Update github.com/duo-labs/webauthn (#18357) (#18364)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Jan 2022 21:28:43 +0000 (21:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoStop trimming preceding and suffixing spaces from editor filenames (#18334) v1.16.0-rc1
zeripath [Wed, 19 Jan 2022 21:03:15 +0000 (21:03 +0000)]
Stop trimming preceding and suffixing spaces from editor filenames (#18334)

* Stop trimming preceding and suffixing spaces from editor filenames

In #5702 it was decided to trim preceding and suffixed spaces aswell as / from
editing file filenames. This was because at this point in time the url-safety of
Gitea was much poorer.

We can now drop this requirement and file editing should work correctly.

Fix #18176

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Jan 2022 20:29:22 +0000 (20:29 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoLeft-Align text in Unicode warning boxes (#18331)
silverwind [Wed, 19 Jan 2022 19:25:08 +0000 (11:25 -0800)]
Left-Align text in Unicode warning boxes (#18331)

Wrapped text is more readable when left-aligned.

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoOnly warn on bidi but still escape non-bidi (#18333)
zeripath [Wed, 19 Jan 2022 19:24:15 +0000 (19:24 +0000)]
Only warn on bidi but still escape non-bidi (#18333)

Fix #18324

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix incorrect OAuth message (#18332)
wxiaoguang [Wed, 19 Jan 2022 19:05:06 +0000 (03:05 +0800)]
Fix incorrect OAuth message (#18332)

As the title,

Fix #18327

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Jan 2022 18:28:18 +0000 (18:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoChangelog for 1.16.0-rc1 (#18309)
techknowlogick [Wed, 19 Jan 2022 17:08:23 +0000 (12:08 -0500)]
Changelog for 1.16.0-rc1 (#18309)

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoRestore propagation of ErrDependenciesLeft (#18325)
zeripath [Tue, 18 Jan 2022 23:26:42 +0000 (23:26 +0000)]
Restore propagation of ErrDependenciesLeft (#18325)

Unfortunately #17643 prevented all propagation of ErrDependenciesLeft meaning
that dependency errors that prevent closing of issues get swallowed.

This PR restores propagation of the error but instead swallows the error in the
places where it needs to be swallowed.

Fix #18223

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix PR comments UI (#18323)
wxiaoguang [Tue, 18 Jan 2022 17:28:38 +0000 (01:28 +0800)]
Fix PR comments UI (#18323)

Closes:
* Review comment cannot be edited #17768
* Changing PR Comment Resolved State Disables Further Changes #18315

2 years agoMake the height of the editor in Review Box smaller (4 lines as GitHub) (#18319)
wxiaoguang [Tue, 18 Jan 2022 16:57:57 +0000 (00:57 +0800)]
Make the height of the editor in Review Box smaller (4 lines as GitHub) (#18319)

And shrink the height of Dropzone.

2 years agoFix commit links on compare page (#18310)
Gusted [Tue, 18 Jan 2022 16:12:10 +0000 (16:12 +0000)]
Fix commit links on compare page (#18310)

* Fix commit links on compare page

- Use the correct repo link for each commit(the headrepo). As for
compare pages were baserepo != headrepo, it wouldn't have the correct
link.

Co-authored-by: zeripath <art27@cantab.net>
2 years agoUpdate JS dependencies, remove eslint-plugin-github (#18317)
silverwind [Tue, 18 Jan 2022 15:01:36 +0000 (07:01 -0800)]
Update JS dependencies, remove eslint-plugin-github (#18317)

- Update all JS dependencies
- Add new lint rules
- Regenerate SVGs
- Tested Monaco and Mermaid
* Remove eslint-plugin-github

2 years agoAdd MirrorUpdated field to Repository API type (#18267)
Peter Gardfjäll [Tue, 18 Jan 2022 13:18:30 +0000 (14:18 +0100)]
Add MirrorUpdated field to Repository API type (#18267)

Add the last update time to the repository api type.

Close #18266

2 years agoreplace satori/go.uuid with gofrs/uuid (#18311)
zeripath [Tue, 18 Jan 2022 11:04:24 +0000 (11:04 +0000)]
replace satori/go.uuid with gofrs/uuid (#18311)

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPlace inline diff comment dialogs in the 4th column. (#18321)
JonRB [Tue, 18 Jan 2022 10:28:45 +0000 (10:28 +0000)]
Place inline diff comment dialogs in the 4th column. (#18321)

Comment dialogs for inline comments should appear in 4th column (not 3rd column), this PR changes the column that the inline review comment is associated with.

This problem has occurred due to an unrecognised conflict between #17562 and #17315.

Fix as zeripath suggested in #18320

Fix #18320

Co-authored-by: zeripath <art27@cantab.net>
2 years agoUse indirect comparison when showing pull requests (#18313)
zeripath [Tue, 18 Jan 2022 07:45:43 +0000 (07:45 +0000)]
Use indirect comparison when showing pull requests (#18313)

When generating the commits list and number of files changed for PRs and
compare we should use "..." always not "..".

Fix #18303

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPrevent ambiguous column error in organizations page (#18314)
zeripath [Tue, 18 Jan 2022 07:45:14 +0000 (07:45 +0000)]
Prevent ambiguous column error in organizations page (#18314)

Explicitly set the table for the org_id column queries on the organizations pages.

Fix #18229

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoCorrectly upload LFS files (#18316)
zeripath [Tue, 18 Jan 2022 07:44:30 +0000 (07:44 +0000)]
Correctly upload LFS files (#18316)

We need to use the cached .gitattributes file for checking if a file
should be stored in the lfs.

Fix #18297

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 18 Jan 2022 00:31:56 +0000 (00:31 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoupdate description about vendoring in CONTRIBUTING.md (#18280)
a1012112796 [Mon, 17 Jan 2022 18:39:07 +0000 (02:39 +0800)]
update description about vendoring in CONTRIBUTING.md (#18280)

* update description about vendoring in CONTRIBUTING.md

follow #18277

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update CONTRIBUTING.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* fix and readd test-vendor step

* remove vendor from .gitattributes @silverwind

* simplify go mod check

Signed-off-by: a1012112796 <1012112796@qq.com>
* Revert "remove vendor from .gitattributes @silverwind"

This reverts commit 4789e704cb7a2c80934e4a4cd31efb161e6c8666.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix CheckRepoStats and reuse it during migration (#18264)
Aravinth Manivannan [Mon, 17 Jan 2022 18:31:58 +0000 (18:31 +0000)]
Fix CheckRepoStats and reuse it during migration (#18264)

The CheckRepoStats function missed the following counters:

- label num_closed_issues & num_closed_pulls
- milestone num_closed_issues & num_closed_pulls

The update SQL statements for updating the repository
num_closed_issues & num_closed_pulls fields were repeated in three
functions (repo.CheckRepoStats, migrate.insertIssues and
models.Issue.updateClosedNum) and were moved to a single helper.

The UpdateRepoStats is implemented and called in the Finish migration method so that it happens immediately instead of wating for the
CheckRepoStats to run.

Signed-off-by: Loïc Dachary loic@dachary.org
---
[source](https://lab.forgefriends.org/forgefriends/forgefriends/-/merge_requests/34)

2 years agoMinor tweak to tag list (#18295)
silverwind [Mon, 17 Jan 2022 13:26:35 +0000 (05:26 -0800)]
Minor tweak to tag list (#18295)

Slightly reduce the font size and padding in the tags table, it seemed a bit too big to me.

2 years agoshow pull link for agit pull request also (#18235)
a1012112796 [Mon, 17 Jan 2022 05:56:43 +0000 (13:56 +0800)]
show pull link for agit pull request also (#18235)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 17 Jan 2022 00:28:33 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd some .ignore entries (#18296)
silverwind [Sun, 16 Jan 2022 17:26:15 +0000 (09:26 -0800)]
Add some .ignore entries (#18296)

Exclude node_modules and minified files from search tools like `rg` and `ag`.

2 years agoRemove unneeded debug messages to stdout. (#18298)
Ben Niemann [Sun, 16 Jan 2022 15:42:06 +0000 (16:42 +0100)]
Remove unneeded debug messages to stdout. (#18298)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoHandle missing default branch better in owner/repo/branches page (#18290)
zeripath [Sun, 16 Jan 2022 14:59:16 +0000 (14:59 +0000)]
Handle missing default branch better in owner/repo/branches page (#18290)

This PR more nicely handles a missing default branch in owner/repo/branches

Fix #18265

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoRevert "Prevent possible XSS when using jQuery (#18289)" (#18293)
wxiaoguang [Sun, 16 Jan 2022 11:19:26 +0000 (19:19 +0800)]
Revert "Prevent possible XSS when using jQuery (#18289)" (#18293)

This reverts commit 661d3d28e97bb49bef075c0314edad5879148aaa.

2 years agonot show double error response in git hook (#18292)
a1012112796 [Sun, 16 Jan 2022 09:32:32 +0000 (17:32 +0800)]
not show double error response in git hook (#18292)

if return a error message to cli, it will print it
to stderr which is duplicate with our code (line 82
in same file). so user will see two line same
error message in git output. I think it's not mecessary,
so suggerst not return error message to cli. Thanks.

Signed-off-by: a1012112796 <1012112796@qq.com>
2 years agoRemove accidental debugging in blob_excerpt.tmpl (#18287)
zeripath [Sun, 16 Jan 2022 09:31:41 +0000 (09:31 +0000)]
Remove accidental debugging in blob_excerpt.tmpl (#18287)

* Remove accidental debugging in blob_excerpt.tmpl

Unfortunately it appears that a small bit of debugging code was left in blob_excerpt.tmpl
This breaks diff expansion causing #18281.

Fix #18281

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoPrevent possible XSS when using jQuery (#18289)
Gusted [Sun, 16 Jan 2022 05:14:32 +0000 (05:14 +0000)]
Prevent possible XSS when using jQuery (#18289)

In the case of misuse or misunderstanding from a developer whereby,
if `sel` can receive user-controlled data, jQuery `$(sel)` can lead to the
creation of a new element. Current usage is using hard-coded selectors
in the templates, but nobody prevents that from expanding to
user-controlled somehow.

2 years agoReturn nicer error if trying to pull from non-existent user (#18288)
zeripath [Sun, 16 Jan 2022 03:44:11 +0000 (03:44 +0000)]
Return nicer error if trying to pull from non-existent user (#18288)

* Return nicer error if trying to pull from non-existent user

Gitea serv will currently return an 500 if we try to pull from a repository where
the owner does not exist.

This PR checks for the UserNotExist Error when checking for the user and will
return a NotFound error instead.

Fix #18225

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 16 Jan 2022 00:28:39 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agodocs: mention client_max_body_size affects LFS (#18291)
Jan Tojnar [Sat, 15 Jan 2022 22:26:01 +0000 (23:26 +0100)]
docs: mention client_max_body_size affects LFS (#18291)

2 years agoAdd lockfile-check (#18285)
silverwind [Sat, 15 Jan 2022 20:06:29 +0000 (12:06 -0800)]
Add lockfile-check (#18285)

* Add lockfile-check

This check runs `npm install` which will rewrite the lockfile in case it
is inconsistent with package.json. This check detects this and will fail
the CI in such a case.

2 years agoWebauthn nits (#18284)
zeripath [Sat, 15 Jan 2022 16:52:56 +0000 (16:52 +0000)]
Webauthn nits (#18284)

This contains some additional fixes and small nits related to #17957

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoUpdate `package-lock.json` (#18283)
Gusted [Sat, 15 Jan 2022 14:25:25 +0000 (14:25 +0000)]
Update `package-lock.json` (#18283)

- NPM didn't like that package-lock.json was out-of-sync, webpack
throwed some errors as well with building.
- Follow-up for: #18278

2 years agoUpgrade EasyMDE to 2.16.1 (#18278)
wxiaoguang [Sat, 15 Jan 2022 10:20:47 +0000 (18:20 +0800)]
Upgrade EasyMDE to 2.16.1 (#18278)

2 years agoRemove golang vendored directory (#18277)
techknowlogick [Fri, 14 Jan 2022 23:16:05 +0000 (18:16 -0500)]
Remove golang vendored directory (#18277)

* rm go vendor

* fix drone yaml

* add to gitignore

2 years agoChangelog for 1.15.10 (#18274) (#18276)
zeripath [Fri, 14 Jan 2022 20:02:37 +0000 (20:02 +0000)]
Changelog for 1.15.10 (#18274) (#18276)

* Changelog for 1.15.10 (#18274)

[1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14

* BUGFIXES
  * Fix inconsistent PR comment counts (#18260) (#18261)
  * Fix release link broken (#18252) (#18253)
  * Fix update user from site administration page bug (#18250) (#18251)
  * Set HeadCommit when creating tags (#18116) (#18173)
  * Use correct translation key for error messages due to max repo limits (#18135 & #18153) (#18152)
  * Fix purple color in suggested label colors (#18241) (#18242)
* SECURITY
  * Bump mermaid from 8.10.1 to 8.13.8 (#18198) (#18206)

* update docs/config.yaml

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Richard Mahn <richmahn@users.noreply.github.com>
2 years agoSupport webauthn (#17957)
Lunny Xiao [Fri, 14 Jan 2022 15:03:31 +0000 (23:03 +0800)]
Support webauthn (#17957)

Migrate from U2F to Webauthn

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 14 Jan 2022 00:29:34 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoImprove the comment for 2FA filter in admin panel (#18017)
Gusted [Thu, 13 Jan 2022 20:32:28 +0000 (20:32 +0000)]
Improve the comment for 2FA filter in admin panel (#18017)

Replace TODO with explanation

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agofix regression from #16075 (#18260)
Norwin [Thu, 13 Jan 2022 16:50:43 +0000 (17:50 +0100)]
fix regression from #16075 (#18260)

we don't want reviews to count towards comments, as this needs changes
in other components as well (eg repo stats cron job, etc).

Co-authored-by: 6543 <6543@obermui.de>
2 years agoPrevent underline hover on cards (#18259)
silverwind [Thu, 13 Jan 2022 14:33:04 +0000 (06:33 -0800)]
Prevent underline hover on cards (#18259)

Prevent a undesired underline effect on hovered cards.

This was regressed by #17898.

2 years agoFix release link broken (#18252)
Lunny Xiao [Thu, 13 Jan 2022 13:14:53 +0000 (21:14 +0800)]
Fix release link broken (#18252)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agomigrations: a deadline at January 1st, 1970 is valid (#18237)
Aravinth Manivannan [Thu, 13 Jan 2022 06:03:30 +0000 (06:03 +0000)]
migrations: a deadline at January 1st, 1970 is valid (#18237)

* migrations: a deadline at January 1st, 1970 is valid

Do not change the deadline value if it is set to January 1st, 1970.

Setting the deadline to year 9999 when it is zero (which is equal to
January 1st, 1970) modifies a deadline set to January 1st, 1970 which
is a valid date. In addition, setting a date in year 9999 will be
converted to a null date in some cases.

Signed-off-by: Loïc Dachary <loic@dachary.org>
* tests: set milestone.deadline_unix in fixtures

The value of deadline_unix must be set to 253370764800 (i.e. 9999-01-01) in
fixtures, otherwise it will be inserted as null which leads to
unexpected errors. For instance, DumpRepository will store a null
deadline_unix as 0 (i.e. 1970-01-01) and RestoreRepository will change
it to 9999-01-01.

Signed-off-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix documents for development and bug report (#18249)
wxiaoguang [Thu, 13 Jan 2022 02:58:46 +0000 (10:58 +0800)]
Fix documents for development and bug report (#18249)

2 years agoAdd/update SMTP auth providers via cli (#18197)
Zoran Peričić [Wed, 12 Jan 2022 22:54:53 +0000 (23:54 +0100)]
Add/update SMTP auth providers via cli (#18197)

Allow adding/updating SMTP authentication source via CLI using:
- gitea admin  auth add-smtp
- gitea admin  auth update-smtp

Signed-off-by: Zoran Peričić <zpericic@netst.org>