]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoUpdate Goldmark to Goldmark 1.4.4 (#18420)
zeripath [Sat, 29 Jan 2022 13:17:21 +0000 (13:17 +0000)]
Update Goldmark to Goldmark 1.4.4 (#18420)

* Update Goldmark to Goldmark 1.4.4
* nolint the deprecation

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoEnsure git tag tests and others create test repos in tmpdir (#18447)
zeripath [Sat, 29 Jan 2022 12:41:44 +0000 (12:41 +0000)]
Ensure git tag tests and others create test repos in tmpdir (#18447)

* Ensure git tag tests and other create test repos in tmpdir

There are a few places where tests appear to reuse testing repos which
causes random CI failures.

This PR simply changes these tests to ensure that cloning always happens
into new temporary directories.

Fix #18444

* Change log root for integration tests to use the REPO_TEST_DIR

There is a potential race in the drone integration tests whereby test-mysql etc
will start writing to log files causing make test-check fail.

Fix #18077

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAttempt to prevent the deadlock in the QueueDiskChannel Test again (#18415)
zeripath [Sat, 29 Jan 2022 11:37:08 +0000 (11:37 +0000)]
Attempt to prevent the deadlock in the QueueDiskChannel Test again (#18415)

* Attempt to prevent the deadlock in the QueueDiskChannel Test again

This time we're going to adjust the pause tests to only test the right
flag.

* Only switch off pushback once we know that we are not pushing anything else
* Ensure full redirection occurs
* More nicely handle a closed datachan
* And handle similar problems in queue_channel_test

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

2 years agoUse explicit jQuery import, remove unused eslint globals (#18435)
silverwind [Fri, 28 Jan 2022 21:00:11 +0000 (13:00 -0800)]
Use explicit jQuery import, remove unused eslint globals (#18435)

- Don't rely on globals (window.$) for jQuery import
- Remove eslint globals no longer in use

2 years agoFix typo (#18436)
Gusted [Fri, 28 Jan 2022 13:56:31 +0000 (13:56 +0000)]
Fix typo (#18436)

As title

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoAllow to filter repositories by language in explore, user and organization repositori...
Lauris BH [Fri, 28 Jan 2022 11:29:04 +0000 (13:29 +0200)]
Allow to filter repositories by language in explore, user and organization repositories lists (#18430)

2 years agoFix broken when no commits and default branch is not master (#18422)
Lunny Xiao [Fri, 28 Jan 2022 02:51:16 +0000 (10:51 +0800)]
Fix broken when no commits and default branch is not master (#18422)

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

* Fix IsEmpty check

* Improve codes

* Add timeout

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

2 years agoAutomatically pause queue if index service is unavailable (#15066)
Lauris BH [Thu, 27 Jan 2022 08:30:51 +0000 (10:30 +0200)]
Automatically pause queue if index service is unavailable (#15066)

* Handle keyword search error when issue indexer service is not available

* Implement automatic disabling and resume of code indexer queue

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 27 Jan 2022 00:28:24 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoOnly view milestones from current repo (#18414)
zeripath [Wed, 26 Jan 2022 20:01:35 +0000 (20:01 +0000)]
Only view milestones from current repo (#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 agoValidate migration files (#18203)
Aravinth Manivannan [Wed, 26 Jan 2022 09:45:51 +0000 (09:45 +0000)]
Validate migration files (#18203)

JSON Schema validation for data used by Gitea during migrations

Discussion at https://forum.forgefriends.org/t/common-json-schema-for-repository-information/563

Co-authored-by: Loïc Dachary <loic@dachary.org>
2 years agoUse base32 for 2FA scratch token (#18384)
wxiaoguang [Wed, 26 Jan 2022 04:10:10 +0000 (12:10 +0800)]
Use base32 for 2FA scratch token (#18384)

* Use base32 for 2FA scratch token
* rename Secure* to Crypto*, add comments

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

2 years agoFix broken oauth2 authentication source edit page (#18412)
zeripath [Wed, 26 Jan 2022 00:23:46 +0000 (00:23 +0000)]
Fix broken oauth2 authentication source edit page (#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 agoPrevent deadlocks in persistable channel pause test (#18410)
zeripath [Tue, 25 Jan 2022 23:09:57 +0000 (23:09 +0000)]
Prevent deadlocks in persistable channel pause test (#18410)

* Prevent deadlocks in persistable channel pause test

Because of reuse of the old paused/resumed channels in this test there
was a potential for deadlock. This PR ensures that the channels are always
reobtained.

It further adds some control code to detect hangs in future - and it
ensures that the pausing warning is not shown on shutdown.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* do not warn but do pause

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoBump golangci-lint version (#18411)
Gusted [Tue, 25 Jan 2022 22:09:49 +0000 (22:09 +0000)]
Bump golangci-lint version (#18411)

- Bump golangci-lint version to v1.44.0 (no new linter errors detected)

2 years agoUnexport git.GlobalCommandArgs (#18376)
6543 [Tue, 25 Jan 2022 18:15:58 +0000 (19:15 +0100)]
Unexport git.GlobalCommandArgs (#18376)

Unexport the git.GlobalCommandArgs variable.

2 years agoPlace inline diff comment dialogs on split diff in 4th and 8th columns (#18403)
zeripath [Tue, 25 Jan 2022 12:18:30 +0000 (12:18 +0000)]
Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403)

Fix #18391
Fix #18320

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAPI: Return primary language and repository language stats API URL (#18396)
Lauris BH [Tue, 25 Jan 2022 06:33:40 +0000 (08:33 +0200)]
API: Return primary language and repository language stats API URL (#18396)

2 years agoUpdate to work with latest VS Code go debugger (#18397)
Lauris BH [Tue, 25 Jan 2022 05:00:55 +0000 (07:00 +0200)]
Update to work with latest VS Code go debugger (#18397)

2 years agoFix restore without topic failure (#18387)
Lunny Xiao [Tue, 25 Jan 2022 02:44:12 +0000 (10:44 +0800)]
Fix restore without topic failure (#18387)

Co-authored-by: zeripath <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 25 Jan 2022 00:28:50 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoMake WrappedQueues and PersistableChannelUniqueQueues Pausable (#18393)
zeripath [Mon, 24 Jan 2022 22:54:35 +0000 (22:54 +0000)]
Make WrappedQueues and PersistableChannelUniqueQueues Pausable (#18393)

Implements the Pausable interface on WrappedQueues and PersistableChannelUniqueQueues

Reference #15928

Signed-off-by: Andrew Thornton art27@cantab.net
2 years agoFix commit's time (#18375)
Gusted [Mon, 24 Jan 2022 22:11:40 +0000 (22:11 +0000)]
Fix commit's time (#18375)

* Fix commit's time

- Use the Committer's `when` as the CommitDate will be modified when the
commit is being moved around in the git tree(e.g. being rebased on top
of newer commits). The Author's `when` is created once and never touched
again.

* Update templates/repo/view_list.tmpl

* Commmt unstaged

* Add fallback

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoPrevent showing webauthn error for every time visiting `/user/settings/security`...
wxiaoguang [Mon, 24 Jan 2022 19:57:01 +0000 (03:57 +0800)]
Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385)

2 years agoRefactor webhooks i18n (#18380)
wxiaoguang [Mon, 24 Jan 2022 11:36:54 +0000 (19:36 +0800)]
Refactor webhooks i18n (#18380)

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

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

- Pass the Global command args into serviceRPC.
- Fixes error with partial cloning.
- Add partial clone test
- Include diff

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoSwitch to non-deprecation setting (#18358)
Gusted [Sun, 23 Jan 2022 19:02:29 +0000 (19:02 +0000)]
Switch to non-deprecation setting (#18358)

* Switch to non-deprecation setting
  (Avoid by-default: "Deprecated fallback `[server]` `LFS_CONTENT_PATH` present. Use `[lfs]` `PATH` instead. This fallback will be removed in v1.18.0")

* Update all references

2 years agoUpdate the SSH passthrough documentation (#18366)
zeripath [Sun, 23 Jan 2022 17:25:25 +0000 (17:25 +0000)]
Update the SSH passthrough documentation (#18366)

2 years agoDon't underline commit status icon on hover (#18372)
Gusted [Sun, 23 Jan 2022 17:02:15 +0000 (17:02 +0000)]
Don't underline commit status icon on hover (#18372)

- Don't underline the commit status icon, as it isn't a link per-se.

2 years agoAdd packagist webhook (#18224)
Dr. Tobias Quathamer [Sun, 23 Jan 2022 13:46:30 +0000 (14:46 +0100)]
Add packagist webhook (#18224)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix mime-type detection for HTTP server (#18370)
wxiaoguang [Sun, 23 Jan 2022 12:19:49 +0000 (20:19 +0800)]
Fix mime-type detection for HTTP server (#18370)

Bypass the unstable behavior of Golang's mime.TypeByExtension

2 years agoAlways use git command but not os.Command (#18363)
Lunny Xiao [Sun, 23 Jan 2022 05:57:52 +0000 (13:57 +0800)]
Always use git command but not os.Command (#18363)

2 years agoAdd deprecated for LFS_CONTENT_PATH on zh-cn docs (#18362)
Lunny Xiao [Sun, 23 Jan 2022 05:03:26 +0000 (13:03 +0800)]
Add deprecated for LFS_CONTENT_PATH on zh-cn docs (#18362)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 23 Jan 2022 00:28:40 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoMake gitea, gitea-vet future-proof (#18361)
Gusted [Sat, 22 Jan 2022 21:59:34 +0000 (21:59 +0000)]
Make gitea, gitea-vet future-proof (#18361)

* Make gitea, gitea-vet future-proof

- Ref: https://gitea.com/gitea/gitea-vet/pulls/18

* Correct order

Co-authored-by: zeripath <art27@cantab.net>
2 years agoPause queues (#15928)
zeripath [Sat, 22 Jan 2022 21:22:14 +0000 (21:22 +0000)]
Pause queues (#15928)

* Start adding mechanism to return unhandled data

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Create pushback interface

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add Pausable interface to WorkerPool and Manager

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Implement Pausable and PushBack for the bytefifos

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Implement Pausable and Pushback for ChannelQueues and ChannelUniqueQueues

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Wire in UI for pausing

Signed-off-by: Andrew Thornton <art27@cantab.net>
* add testcases and fix a few issues

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* prevent "race" in the test

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

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add warnings for no worker configurations and prevent data-loss with redis/levelqueue

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoDisable content sniffing on `PlainTextBytes` (#18359)
Gusted [Sat, 22 Jan 2022 18:32:35 +0000 (18:32 +0000)]
Disable content sniffing on `PlainTextBytes` (#18359)

- Disable the browser's function to "sniff" for the content-type on the
provided plain text, this will prevent the possible usage of
user-controlled data being sent, which could be malicious.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoUpdate github.com/duo-labs/webauthn (#18357)
6543 [Sat, 22 Jan 2022 17:01:40 +0000 (18:01 +0100)]
Update github.com/duo-labs/webauthn (#18357)

2 years agoFix route wrap (#18360)
wxiaoguang [Sat, 22 Jan 2022 15:05:22 +0000 (23:05 +0800)]
Fix route wrap (#18360)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 22 Jan 2022 00:28:20 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd config options to hide issue events (#17414)
qwerty287 [Fri, 21 Jan 2022 17:59:26 +0000 (18:59 +0100)]
Add config options to hide issue events (#17414)

* Add config option to hide issue events
Adds a config option `HIDE_ISSUE_EVENTS` to hide most issue events (changed labels, milestones, projects...) on the issue detail page.
If this is true, only the following events (comment types) are shown:
* plain comments
* closed/reopned/merged
* reviews

* Make configurable using a list

* Add docs

* Add missing newline

* Fix merge issues

* Allow changes per user settings

* Fix lint

* Rm old docs

* Apply suggestions from code review

* Use bitsets

* Rm comment

* fmt

* Fix lint

* Use variable/constant to provide key

* fmt

* fix lint

* refactor

* Add a prefix for user setting key

* Add license comment

* Add license comment

* Update services/forms/user_form_hidden_comments.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>
* check len == 0

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoAdd js vendor directory to .gitattributes (#18350)
silverwind [Fri, 21 Jan 2022 15:42:38 +0000 (07:42 -0800)]
Add js vendor directory to .gitattributes (#18350)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 21 Jan 2022 00:30:19 +0000 (00:30 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRefactor jwt.StandardClaims to RegisteredClaims (#18344)
zeripath [Thu, 20 Jan 2022 21:52:56 +0000 (21:52 +0000)]
Refactor jwt.StandardClaims to RegisteredClaims (#18344)

* Refactor jwt.StandardClaims to RegisteredClaims

go-jwt/jwt has deprecated the StandardClaims interface to use RegisteredClaims
instead. This PR migrates to use this new format.

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

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
2 years agoformat with gofumpt (#18184)
6543 [Thu, 20 Jan 2022 17:46:10 +0000 (18:46 +0100)]
format with gofumpt (#18184)

* gofumpt -w -l .

* gofumpt -w -l -extra .

* Add linter

* manual fix

* change make fmt

2 years agoEnable deprecation error for v1.17.0 (#18341)
Gusted [Thu, 20 Jan 2022 17:00:38 +0000 (18:00 +0100)]
Enable deprecation error for v1.17.0 (#18341)

Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years agoUse correct translation key for errors (#18342)
Gusted [Thu, 20 Jan 2022 15:18:46 +0000 (16:18 +0100)]
Use correct translation key for errors (#18342)

- Noted by:
https://github.com/go-gitea/gitea/issues/17876#issuecomment-1017503614

2 years agoRefactor Router Logger (#17308)
wxiaoguang [Thu, 20 Jan 2022 11:41:25 +0000 (19:41 +0800)]
Refactor Router Logger (#17308)

Make router logger more friendly, show the related function name/file/line.

[BREAKING]
This PR substantially changes the logging format of the router logger. If you use this logging for monitoring e.g. fail2ban you will need to update this to match the new format.

2 years agoUpdated Chroma to v0.10.0 (#18270)
Jelle Hulter [Thu, 20 Jan 2022 09:59:15 +0000 (10:59 +0100)]
Updated Chroma to v0.10.0 (#18270)

2 years agoChange initial TrustModel to committer (#18335)
zeripath [Thu, 20 Jan 2022 02:41:59 +0000 (02:41 +0000)]
Change initial TrustModel to committer (#18335)

2 years agorefactor httplib (#18338)
Gusted [Thu, 20 Jan 2022 00:31:39 +0000 (01:31 +0100)]
refactor httplib (#18338)

- Remove a lot of unused code(most if not all were introduced in gogs
for webhooks usages).

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoPropagate context and ensure git commands run in request context (#17868)
zeripath [Wed, 19 Jan 2022 23:26:57 +0000 (23:26 +0000)]
Propagate context and ensure git commands run in request context (#17868)

This PR continues the work in #17125 by progressively ensuring that git
commands run within the request context.

This now means that the if there is a git repo already open in the context it will be used instead of reopening it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoUpgrade Alpine from 3.13 to 3.15 (#18050) v1.17.0-dev
Grzegorz Alibożek [Wed, 19 Jan 2022 21:55:17 +0000 (22:55 +0100)]
Upgrade Alpine from 3.13 to 3.15 (#18050)

* Upgrade alpine to 3.15

* Add executability test to entrypoint for too old dockers

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update docker/rootless/usr/local/bin/docker-entrypoint.sh

Co-authored-by: zeripath <art27@cantab.net>
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