]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoFix docker enviroment variable from TYPE to DB_TYPE (#15585)
Björn Heinrichs [Thu, 22 Apr 2021 14:34:12 +0000 (16:34 +0200)]
Fix docker enviroment variable from TYPE to DB_TYPE (#15585)

As documented in https://docs.gitea.io/en-us/config-cheat-sheet/ the database type is defined using db_type not type.

3 years agoBump unrolled/render to v1.1.0 (#15581)
Nathan Smith [Thu, 22 Apr 2021 09:54:27 +0000 (02:54 -0700)]
Bump unrolled/render to v1.1.0 (#15581)

v1.1.0 has improved buffer pooling

3 years agoIf the default branch is not present do not report error on stats indexing (#15546)
zeripath [Thu, 22 Apr 2021 01:19:21 +0000 (02:19 +0100)]
If the default branch is not present do not report error on stats indexing (#15546)

* If the default branch is not present do not report error on stats indexing

Fix #15257

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd placeholder text to deploy key textarea (#15575)
zeripath [Wed, 21 Apr 2021 20:19:32 +0000 (21:19 +0100)]
Add placeholder text to deploy key textarea (#15575)

* Add placeholder text to deploy key textarea

Related #15574

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update templates/repo/settings/deploy_keys.tmpl

* Update templates/repo/settings/deploy_keys.tmpl

3 years agoFix NPE on view commit with notes (#15561)
zeripath [Wed, 21 Apr 2021 18:00:27 +0000 (19:00 +0100)]
Fix NPE on view commit with notes (#15561)

Fix #15558

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix lfs management find (#15537)
Lunny Xiao [Wed, 21 Apr 2021 16:31:59 +0000 (00:31 +0800)]
Fix lfs management find (#15537)

Fix #15236

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoOutput node min version variable (#15562)
Kyle D [Wed, 21 Apr 2021 06:15:18 +0000 (02:15 -0400)]
Output node min version variable (#15562)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 21 Apr 2021 00:12:23 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoProject board improvements (#15429)
silverwind [Tue, 20 Apr 2021 04:13:03 +0000 (06:13 +0200)]
Project board improvements (#15429)

* Project board improvements

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

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

* more css fixes, add second row from issue list

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdded OpenAPI document link to usage (#15535)
Nathan Zook [Tue, 20 Apr 2021 03:29:08 +0000 (20:29 -0700)]
Added OpenAPI document link to usage (#15535)

* Added OpenAPI document link to usage

The OpenAPI document at /api/swagger.v1.json needs an obvious reference.  Sadly, I am English monolingual, so someone else is going to have to do the other languages.  In the mean time, this PR should help anyone looking for the file.

* Update docs/content/doc/developers/api-usage.en-us.md

Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 20 Apr 2021 00:12:27 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoRefactor renders (#15175)
Lunny Xiao [Mon, 19 Apr 2021 22:25:08 +0000 (06:25 +0800)]
Refactor renders (#15175)

* Refactor renders

* Some performance optimization

* Fix comment

* Transform reader

* Fix csv test

* Fix test

* Fix tests

* Improve optimaziation

* Fix test

* Fix test

* Detect file encoding with reader

* Improve optimaziation

* reduce memory usage

* improve code

* fix build

* Fix test

* Fix for go1.15

* Fix render

* Fix comment

* Fix lint

* Fix test

* Don't use NormalEOF when unnecessary

* revert change on util.go

* Apply suggestions from code review

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

* Take NormalEOF back

Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix a broken link in customizing-gitea.en-us.md (#15543)
Raphael Kruse [Mon, 19 Apr 2021 15:47:49 +0000 (17:47 +0200)]
Fix a broken link in customizing-gitea.en-us.md (#15543)

3 years agoChange the chinese discuss link to discourse (#15533)
Lunny Xiao [Sun, 18 Apr 2021 11:12:16 +0000 (19:12 +0800)]
Change the chinese discuss link to discourse (#15533)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 18 Apr 2021 00:12:19 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix bug on commit graph (#15517)
Lunny Xiao [Sat, 17 Apr 2021 09:27:25 +0000 (17:27 +0800)]
Fix bug on commit graph (#15517)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 17 Apr 2021 00:12:20 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoPrevent migration 156 failure if tag commit missing (#15519)
zeripath [Fri, 16 Apr 2021 23:28:40 +0000 (00:28 +0100)]
Prevent migration 156 failure if tag commit missing (#15519)

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

This PR simply logs the failure.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoSend size to /avatars if requested (#15459)
zeripath [Fri, 16 Apr 2021 22:22:25 +0000 (23:22 +0100)]
Send size to /avatars if requested (#15459)

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

Fix #15453

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd tests for clone from wiki (#15513)
Lunny Xiao [Fri, 16 Apr 2021 21:39:21 +0000 (05:39 +0800)]
Add tests for clone from wiki (#15513)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix Benchmark tests, remove a broken one & add two new (#15250)
6543 [Fri, 16 Apr 2021 18:30:16 +0000 (20:30 +0200)]
Fix Benchmark tests, remove a broken one & add two new  (#15250)

* Benchmark Integration TESTS

* CI: add benching-arm64 pipeline

* BenchmarkRepo: name test case tests

* Fix BenchmarkRepoBranchCommit beside Create new Branch

* CI: benching use amd64

* rm total broken "BenchmarkRepo"

* dont run benchmark in CI

3 years agofrontport: 1.14.1 changelog (#15503)
techknowlogick [Fri, 16 Apr 2021 04:06:02 +0000 (00:06 -0400)]
frontport: 1.14.1 changelog (#15503)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoadd well-known config for OIDC (#15355)
techknowlogick [Fri, 16 Apr 2021 02:32:00 +0000 (22:32 -0400)]
add well-known config for OIDC (#15355)

* add well-known config for OIDC

* spacing per feedback

* Update oidc_wellknown.tmpl

* add id_token

* Update oidc_wellknown.tmpl

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoFix missing icons and colorpicker when mounted on suburl (#15501)
zeripath [Thu, 15 Apr 2021 22:15:51 +0000 (23:15 +0100)]
Fix missing icons and colorpicker when mounted on suburl (#15501)

* Fix missing icons and colorpicker when mounted on suburl

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix: npx webpack make: *** [Makefile:699: public/js/index.js] Error -… (#15465)
Kindyroo [Thu, 15 Apr 2021 20:07:31 +0000 (04:07 +0800)]
Fix: npx webpack make: *** [Makefile:699: public/js/index.js] Error -… (#15465)

* Fix: npx webpack make: *** [Makefile:699: public/js/index.js] Error -1073741819

* Update webpack.config.js

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
3 years agoFix bug clone wiki (#15499)
Lunny Xiao [Thu, 15 Apr 2021 18:57:19 +0000 (02:57 +0800)]
Fix bug clone wiki (#15499)

Fix #15494

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoPerformance improvement for list pull requests (#15447)
Lunny Xiao [Thu, 15 Apr 2021 17:34:43 +0000 (01:34 +0800)]
Performance improvement for list pull requests (#15447)

3 years agoDisable Stars config option (#14653)
Kyle D [Thu, 15 Apr 2021 16:53:57 +0000 (10:53 -0600)]
Disable Stars config option (#14653)

* Add config option to disable stars

* Replace "stars" with watched in user profile

* Add documentation

3 years agoSpecify relation between multiple signing options (#15496)
firesoft-de [Thu, 15 Apr 2021 16:06:32 +0000 (18:06 +0200)]
Specify relation between multiple signing options (#15496)

3 years agomigration: github: if rate limit is not enabled, ignore it (#15490)
6543 [Thu, 15 Apr 2021 13:34:22 +0000 (15:34 +0200)]
migration: github: if rate limit is not enabled, ignore it (#15490)

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

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

Fix #15451

Signed-off-by: Andrew Thornton art27@cantab.net
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoMake build scripts compatible with node 12 (#15479)
silverwind [Thu, 15 Apr 2021 11:02:34 +0000 (13:02 +0200)]
Make build scripts compatible with node 12 (#15479)

* Make build scripts compatible with node 12

"fs/promises" is not in node 12, use a more compatible way to import it.
Also, lock major down versions of the image build dependencies to
prevent future surprises.

* add node_modules dependency

3 years agoEnsure review dismissal only dismisses the correct review (#15477)
zeripath [Thu, 15 Apr 2021 10:03:11 +0000 (11:03 +0100)]
Ensure review dismissal only dismisses the correct review (#15477)

Fix #15472

Signed-off-by: Andrew Thornton art27@cantab.net
3 years agoBuild go-git variants for windows (#15482)
zeripath [Thu, 15 Apr 2021 09:02:44 +0000 (10:02 +0100)]
Build go-git variants for windows (#15482)

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix potential copy lfs records failure when fork a repository (#15441)
Lunny Xiao [Wed, 14 Apr 2021 21:15:28 +0000 (05:15 +0800)]
Fix potential copy lfs records failure when fork a repository (#15441)

3 years agoUse subdir for URL (#15446)
KN4CK3R [Wed, 14 Apr 2021 19:43:17 +0000 (21:43 +0200)]
Use subdir for URL (#15446)

Fixes #15444

3 years agoUse index of the supported tags to choose user lang (#15452)
Naohisa Murakami [Wed, 14 Apr 2021 18:52:01 +0000 (03:52 +0900)]
Use index of the supported tags to choose user lang (#15452)

Fix #14793.

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

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

3 years agoquick fix (#15464)
John Olheiser [Wed, 14 Apr 2021 17:54:54 +0000 (12:54 -0500)]
quick fix (#15464)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years agoFixed several typos. (#15470)
KN4CK3R [Wed, 14 Apr 2021 16:44:01 +0000 (18:44 +0200)]
Fixed several typos. (#15470)

3 years agofix wrong file link in code search page (#15466)
a1012112796 [Wed, 14 Apr 2021 15:59:42 +0000 (23:59 +0800)]
fix wrong file link in code search page (#15466)

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

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

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

fix #15438

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix ambiguous argument error on tags (#15432)
zeripath [Wed, 14 Apr 2021 14:22:37 +0000 (15:22 +0100)]
Fix ambiguous argument error on tags (#15432)

There is a weird gotcha with GetTagCommitID that because it uses git rev-list
can cause an ambiguous argument error.

This PR simply makes tags use the same code as branches.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDisplay more repository type on admin repository management (#15440)
Lunny Xiao [Wed, 14 Apr 2021 13:33:22 +0000 (21:33 +0800)]
Display more repository type on admin repository management (#15440)

3 years agoPrevent superfluous response.WriteHeader (#15456)
zeripath [Wed, 14 Apr 2021 12:57:18 +0000 (13:57 +0100)]
Prevent superfluous response.WriteHeader (#15456)

This PR simply checks the status before writing the header.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoOAuth2 auto-register (#5123)
Martin Michaelis [Wed, 14 Apr 2021 12:02:12 +0000 (14:02 +0200)]
OAuth2 auto-register (#5123)

* Refactored handleOAuth2SignIn in routers/user/auth.go

The function handleOAuth2SignIn was called twice but some code path could only
be reached by one of the invocations. Moved the unnecessary code path out of
handleOAuth2SignIn.

* Refactored user creation

There was common code to create a user and display the correct error message.
And after the creation the only user should be an admin and if enabled a
confirmation email should be sent. This common code is now abstracted into
two functions and a helper function to call both.

* Added auto-register for OAuth2 users

If enabled new OAuth2 users will be registered with their OAuth2 details.
The UserID, Name and Email fields from the gothUser are used.
Therefore the OpenID Connect provider needs additional scopes to return
the coresponding claims.

* Added error for missing fields in OAuth2 response

* Linking and auto linking on oauth2 registration

* Set default username source to nickname

* Add automatic oauth2 scopes for github and google

* Add hint to change the openid connect scopes if fields are missing

* Extend info about auto linking security risk

Co-authored-by: Viktor Kuzmin <kvaster@gmail.com>
Signed-off-by: Martin Michaelis <code@mgjm.de>
3 years agodocs: migration start new section (#15462)
6543 [Wed, 14 Apr 2021 06:46:17 +0000 (08:46 +0200)]
docs: migration start new section (#15462)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Apr 2021 00:12:38 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agov172 migration adds created_unix field instead of expiry (#15458)
zeripath [Wed, 14 Apr 2021 00:04:17 +0000 (01:04 +0100)]
v172 migration adds created_unix field instead of expiry (#15458)

The Session table must have an Expiry field not a created_unix field - somehow
this migration adds the incorrect named field leading to #15445 reports.

Fix #15445

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd NeedPostProcess for Parser interface to improve performance of csv render (#15153)
Lunny Xiao [Tue, 13 Apr 2021 07:06:31 +0000 (15:06 +0800)]
Add NeedPostProcess for Parser interface to improve performance of csv render (#15153)

3 years agoFix repository search (#15428)
KN4CK3R [Tue, 13 Apr 2021 02:09:46 +0000 (04:09 +0200)]
Fix repository search (#15428)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoPrevent NPE on avatar direct rendering if federated avatars disabled (#15434)
zeripath [Tue, 13 Apr 2021 00:57:12 +0000 (01:57 +0100)]
Prevent NPE on avatar direct rendering if federated avatars disabled (#15434)

#13649 assumed that direct avatar urls would always be libravatar urls - this leads
to NPEs if federated avatar service is disabled.

Fix #15421

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoClone panel fixes (#15435)
silverwind [Tue, 13 Apr 2021 00:10:57 +0000 (02:10 +0200)]
Clone panel fixes (#15435)

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

Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix wiki clone urls (#15430)
silverwind [Mon, 12 Apr 2021 21:52:48 +0000 (23:52 +0200)]
Fix wiki clone urls (#15430)

Fix wiki clone urls

Regressed by: https://github.com/go-gitea/gitea/commit/9a4050f1e839af1bd072aff9ac5fc69e650747c8
Fixes: https://github.com/go-gitea/gitea/issues/15420
3 years agodocs: rm deprecated docs regarding environment variable usage in docker image (#15405)
techknowlogick [Mon, 12 Apr 2021 19:42:02 +0000 (15:42 -0400)]
docs: rm deprecated docs regarding environment variable usage in docker image (#15405)

* docs: rm deprecated docs regarding environment variable usage in docker image

* Update docs/content/doc/installation/with-docker.en-us.md

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
3 years agoAdd ETag header (#15370)
KN4CK3R [Mon, 12 Apr 2021 14:49:26 +0000 (16:49 +0200)]
Add ETag header (#15370)

* Add ETag header.

* Comply with RFC 7232.

* Moved logic into httpcache.go

* Changed name.

* Lint

* Implemented If-None-Match list.

* Fixed missing header on *

* Removed weak etag support.

* Removed * support.

* Added unit test.

* Lint

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agodump: Add option to skip LFS/attachment files (#15407)
Johan Van de Wauw [Mon, 12 Apr 2021 09:33:32 +0000 (11:33 +0200)]
dump: Add option to skip LFS/attachment files (#15407)

* Add option to skip dumping LFS/attachment files

* Fix fmt issues

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agofix dingtalk icon url (#15417)
Tomás Warynyca [Mon, 12 Apr 2021 07:17:57 +0000 (04:17 -0300)]
fix dingtalk icon url (#15417)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 12 Apr 2021 00:12:18 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agouse repo1_bare to test against (#15402)
6543 [Sun, 11 Apr 2021 15:45:29 +0000 (17:45 +0200)]
use repo1_bare to test against (#15402)

3 years agoStandardise icon on projects PR page (#15387)
zeripath [Sun, 11 Apr 2021 15:00:14 +0000 (16:00 +0100)]
Standardise icon on projects PR page (#15387)

Fix #15272

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoadd some reponse status on api docs (#15399)
a1012112796 [Sun, 11 Apr 2021 08:53:23 +0000 (16:53 +0800)]
add some reponse status on api docs (#15399)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoChangelog v1.14.0 (#15360) (#15400)
6543 [Sun, 11 Apr 2021 05:23:55 +0000 (07:23 +0200)]
Changelog v1.14.0 (#15360) (#15400)

* Changelog v1.14.0 (#15360)

* clean & merge & update v1.14.0 changelog

* backport v1.13.x changelogs

* update latest gitea version

3 years agoEnforce tab indentation in templates (#15289)
silverwind [Sun, 11 Apr 2021 03:46:37 +0000 (05:46 +0200)]
Enforce tab indentation in templates (#15289)

* Enforce tab indendation in templates

This adds editorconfig-checker [1] to lint the template files so they
conform the editorconfig files. I fixed all current identation issues
using the fix mode of eclint [2] and some manual corrections.

We can extend this linting to other files later, for now I'd like this
PR to focus on HTML template files only.

[1] https://github.com/editorconfig-checker/editorconfig-checker
[2] https://github.com/jedmao/eclint

* fix indendation

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 11 Apr 2021 00:12:21 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix delete nonexist oauth application 500 and prevent deadlock (#15384)
Lunny Xiao [Sat, 10 Apr 2021 20:49:10 +0000 (04:49 +0800)]
Fix delete nonexist oauth application 500 and prevent deadlock (#15384)

* Fix delete nonexist oauth application 500

* Fix test

* Close the session

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

* Fix more missed sess.Close

* Remove unnecessary blank line

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoLinks in markdown should be absolute to the repository not the server (#15088)
zeripath [Sat, 10 Apr 2021 16:26:28 +0000 (17:26 +0100)]
Links in markdown should be absolute to the repository not the server (#15088)

* Links in markdown should be absolute to the repository not the server

Fix #15075

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAlways set the merge base used to merge the commit (#15352)
zeripath [Sat, 10 Apr 2021 08:27:29 +0000 (09:27 +0100)]
Always set the merge base used to merge the commit (#15352)

The issue is that the TestPatch will reset the PR MergeBase - and it is possible for TestPatch to update the MergeBase whilst a merge is ongoing. The ensuing merge will then complete but it doesn't re-set the MergeBase it used to merge the PR.

Fixes the intermittent error in git test.

Signed-off-by: Andrew Thornton art27@cantab.net
3 years agorsponse 404 when delete not exist email (#15383)
a1012112796 [Sat, 10 Apr 2021 06:12:38 +0000 (14:12 +0800)]
rsponse 404 when delete not exist email (#15383)

fix #15357

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoSHA in merged commit comment should be rendered ui sha (#15376)
zeripath [Sat, 10 Apr 2021 02:24:59 +0000 (03:24 +0100)]
SHA in merged commit comment should be rendered ui sha (#15376)

* SHA in merged commit comment should be rendered ui sha

On a PR page the sha of the merge commit should be rendered in monospace
as a SHA. Also fixes an issue with the manually merged string.

Fix #15049

Signed-off-by: Andrew Thornton <art27@cantab.net>
* issues.force_push_codes needs this too.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoTurn RepoRef and RepoAssignment back into func(*Context) (#15372)
zeripath [Sat, 10 Apr 2021 00:26:08 +0000 (01:26 +0100)]
Turn RepoRef and RepoAssignment back into func(*Context) (#15372)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 10 Apr 2021 00:13:11 +0000 (00:13 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoRemove usage of JS globals (#15378)
silverwind [Fri, 9 Apr 2021 23:42:38 +0000 (01:42 +0200)]
Remove usage of JS globals (#15378)

Refactor the exported globals in index.js to JS-initialized event
handlers.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUpgrade to bluemonday 1.0.7 (#15379)
zeripath [Fri, 9 Apr 2021 23:13:06 +0000 (00:13 +0100)]
Upgrade to bluemonday 1.0.7 (#15379)

* Upgrade to bluemonday 1.0.7

Fix #15349

Signed-off-by: Andrew Thornton <art27@cantab.net>
* resolve unit test

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUpdate MAINTAINERS (#15382)
KN4CK3R [Fri, 9 Apr 2021 23:11:31 +0000 (01:11 +0200)]
Update MAINTAINERS (#15382)

3 years agoUse semantic dropdown for code search query type (#15276)
Mike L [Fri, 9 Apr 2021 20:53:16 +0000 (22:53 +0200)]
Use semantic dropdown for code search query type (#15276)

Add comments to CSS rules

Co-authored-by: zeripath <art27@cantab.net>
3 years agoDropzone styling improvements (#15291)
silverwind [Fri, 9 Apr 2021 16:51:27 +0000 (18:51 +0200)]
Dropzone styling improvements (#15291)

* Dropzone styling improvements

- Move all dropzone styles to separate file
- Fix white background in arc-green
- Fix rendering of non-square images and previews

* increase thumbnail quality, set contain in js, replace blur effect with opacity

3 years agoFix mirror_lfs source string in en-US locale (#15369)
koalp [Fri, 9 Apr 2021 15:00:32 +0000 (17:00 +0200)]
Fix mirror_lfs source string in en-US locale (#15369)

The mirror_lfs source string was set to "Large File System" instead of "Large File Storage"

This has been fixed

3 years agoMove FCGI req.URL.Path fix-up to the FCGI listener (#15292)
zeripath [Fri, 9 Apr 2021 13:17:57 +0000 (14:17 +0100)]
Move FCGI req.URL.Path fix-up to the FCGI listener (#15292)

Simplify the web.go FCGI path by moving the req.URL.Path fix-up to listener

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoDisable Vue's console advertisments (#15354)
silverwind [Fri, 9 Apr 2021 10:12:55 +0000 (12:12 +0200)]
Disable Vue's console advertisments (#15354)

3 years agoFix `admin user list` (#15358)
6543 [Fri, 9 Apr 2021 08:16:10 +0000 (10:16 +0200)]
Fix `admin user list` (#15358)

3 years agoCode Formats, Nits & Unused Func/Var deletions (#15286)
6543 [Fri, 9 Apr 2021 07:40:34 +0000 (09:40 +0200)]
Code Formats, Nits & Unused Func/Var deletions (#15286)

* _ to unused func options

* rm useless brakets

* rm trifial non used models functions

* rm dead code

* rm dead global vars

* fix routers/api/v1/repo/issue.go

* dont overload import module

3 years agoStop packaging node_modules in release tarballs (#15273)
silverwind [Fri, 9 Apr 2021 05:08:14 +0000 (07:08 +0200)]
Stop packaging node_modules in release tarballs (#15273)

- Don't package node_modules in tarballs, they are not cross-platform
  anymore and npm cache should not be messed with directly. Instead,
  require an internet connection to rebuild the UI, which is not necessary
  in the general use case because prebuilt UI files are shipped in the
  public directory.
- Simplify the fomantic build and make the target phony. We don't need
  anything more for something that is rarely ran.
- Use regular tar again to build tarballs and add variable for excludes
- Disable annoying npm update notifications

Fixes: https://github.com/go-gitea/gitea/pull/14578
Fixes: https://github.com/go-gitea/gitea/pull/15256
Fixes: https://github.com/go-gitea/gitea/pull/15262
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix Dropzone following #15315 (#15353)
zeripath [Fri, 9 Apr 2021 02:32:30 +0000 (03:32 +0100)]
Fix Dropzone following #15315 (#15353)

* Fix Dropzone following #15315

#15315 appears to have caused a change in the way Dropzone is imported - and it
now produces a module rather than the constructor.

This PR rather hackily just adds another Dropzone call to the result.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* use destructured export

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago[API] pull notification subject status: add "merged" (#15344)
6543 [Fri, 9 Apr 2021 01:36:23 +0000 (03:36 +0200)]
[API] pull notification subject status: add "merged" (#15344)

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

3 years agoFix button border issue (#15350)
silverwind [Fri, 9 Apr 2021 00:52:32 +0000 (02:52 +0200)]
Fix button border issue (#15350)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd LFS Migration and Mirror (#14726)
KN4CK3R [Thu, 8 Apr 2021 22:25:57 +0000 (00:25 +0200)]
Add LFS Migration and Mirror (#14726)

* Implemented LFS client.

* Implemented scanning for pointer files.

* Implemented downloading of lfs files.

* Moved model-dependent code into services.

* Removed models dependency. Added TryReadPointerFromBuffer.

* Migrated code from service to module.

* Centralised storage creation.

* Removed dependency from models.

* Moved ContentStore into modules.

* Share structs between server and client.

* Moved method to services.

* Implemented lfs download on clone.

* Implemented LFS sync on clone and mirror update.

* Added form fields.

* Updated templates.

* Fixed condition.

* Use alternate endpoint.

* Added missing methods.

* Fixed typo and make linter happy.

* Detached pointer parser from gogit dependency.

* Fixed TestGetLFSRange test.

* Added context to support cancellation.

* Use ReadFull to probably read more data.

* Removed duplicated code from models.

* Moved scan implementation into pointer_scanner_nogogit.

* Changed method name.

* Added comments.

* Added more/specific log/error messages.

* Embedded lfs.Pointer into models.LFSMetaObject.

* Moved code from models to module.

* Moved code from models to module.

* Moved code from models to module.

* Reduced pointer usage.

* Embedded type.

* Use promoted fields.

* Fixed unexpected eof.

* Added unit tests.

* Implemented migration of local file paths.

* Show an error on invalid LFS endpoints.

* Hide settings if not used.

* Added LFS info to mirror struct.

* Fixed comment.

* Check LFS endpoint.

* Manage LFS settings from mirror page.

* Fixed selector.

* Adjusted selector.

* Added more tests.

* Added local filesystem migration test.

* Fixed typo.

* Reset settings.

* Added special windows path handling.

* Added unit test for HTTPClient.

* Added unit test for BasicTransferAdapter.

* Moved into util package.

* Test if LFS endpoint is allowed.

* Added support for git://

* Just use a static placeholder as the displayed url may be invalid.

* Reverted to original code.

* Added "Advanced Settings".

* Updated wording.

* Added discovery info link.

* Implemented suggestion.

* Fixed missing format parameter.

* Added Pointer.IsValid().

* Always remove model on error.

* Added suggestions.

* Use channel instead of array.

* Update routers/repo/migrate.go

* fmt

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoShow diff on rename with diff changes (#15338)
zeripath [Thu, 8 Apr 2021 19:35:36 +0000 (20:35 +0100)]
Show diff on rename with diff changes (#15338)

More recent versions of git have increased support for detection of renames meaning
that a rename with diff changes is now supported.

Although ParsePatch supports this - our templates do not and the simplest solution
is simply to show the diff.

Fix #15335

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoDisable cssnano's colormin plugin (#15347)
silverwind [Thu, 8 Apr 2021 18:28:41 +0000 (20:28 +0200)]
Disable cssnano's colormin plugin (#15347)

It produces odd rgba values which also seem to cause issues in monaco's
color parser where the scoll shadow went red for some reason.

Regression by: https://github.com/go-gitea/gitea/pull/15333

3 years agoPrepend AppSubUrl to links for default avatar (#15341)
zeripath [Thu, 8 Apr 2021 13:25:06 +0000 (14:25 +0100)]
Prepend AppSubUrl to links for default avatar (#15341)

Fix #15334

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd dashboard milestone search and repo milestone search by name (#14866)
Roger Luo [Thu, 8 Apr 2021 11:53:59 +0000 (19:53 +0800)]
Add dashboard milestone search and repo milestone search by name (#14866)

Feature for issue #13845:
 - Add milestones search by name on dashboard milestones page.
 - Add milestones search by name on repo issue/milestones page.

3 years agoAdd frontend testing, require node 12 (#15315)
silverwind [Thu, 8 Apr 2021 10:41:57 +0000 (12:41 +0200)]
Add frontend testing, require node 12 (#15315)

- Add basic frontend unit testing infrastructure using jest in ESM mode
- Rename 'make test' to 'make test-backend'
- Introduce 'make test-frontend' and 'make test' that runs both
- Bump Node.js requirement to v12. v10 will be EOL in less than a month.
- Convert all build-related JS files to ESM.

I opted to run frontend tests run as part of the compliance pipeline because
they complete fast and are not platform-specific like the golang tests.

3 years agoMonaco improvements (#15333)
silverwind [Thu, 8 Apr 2021 09:53:00 +0000 (11:53 +0200)]
Monaco improvements (#15333)

- Create theme at runtime which follows the CSS variables of the site
- Disable a few opinionated Monaco defaults like minimap and word highlights
- Move styles to separate file

Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix handling of logout event (#15323)
zeripath [Wed, 7 Apr 2021 23:48:13 +0000 (00:48 +0100)]
Fix handling of logout event (#15323)

It appears that there is a slight bug in the handling of the data of logout event -
the javascript should be testing the data field of the data field for the logout
instruction.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[Frontport] Changelog (v1.13.6, v1.13.7, v1.14.0-rc2) (#15328)
6543 [Wed, 7 Apr 2021 17:41:02 +0000 (19:41 +0200)]
[Frontport] Changelog (v1.13.6, v1.13.7, v1.14.0-rc2) (#15328)

* Changelog v1.13.7 (#15319)

* Update Changelog (#15322)

* update

* next

* RC2

* Update Docs Version

3 years agoFix CanCreateRepo check (#15311)
John Olheiser [Wed, 7 Apr 2021 07:26:41 +0000 (02:26 -0500)]
Fix CanCreateRepo check (#15311)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 7 Apr 2021 00:12:18 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMove modules/forms to services/forms (#15305)
zeripath [Tue, 6 Apr 2021 19:44:05 +0000 (20:44 +0100)]
Move modules/forms to services/forms (#15305)

Forms are dependent on models and therefore should be in services.

This PR also removes the old auth. aliasing

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoReduce memory usage in testgit (#15306)
zeripath [Tue, 6 Apr 2021 16:44:02 +0000 (17:44 +0100)]
Reduce memory usage in testgit (#15306)

* reduce memory use in rawtest

* just use hashsum for diffs

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix bug in Wrap (#15302)
zeripath [Tue, 6 Apr 2021 15:40:56 +0000 (16:40 +0100)]
Fix bug in Wrap (#15302)

Whilst doing other work I have noticed that there is an issue with Wrap when passing an
http.Handler - the next should be the next handler in line not empty.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoClose file on invalid range (Addition to #15166) (#15268)
KN4CK3R [Tue, 6 Apr 2021 13:22:34 +0000 (15:22 +0200)]
Close file on invalid range (Addition to #15166) (#15268)

* Close file on invalid range.

* Close on seek error

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Moved 'Seek' into server.

* io.ReadSeekCloser is only available in Go 1.16

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoUpdate JS dependencies (#15290)
silverwind [Tue, 6 Apr 2021 01:03:07 +0000 (03:03 +0200)]
Update JS dependencies (#15290)

- Update all JS dependencies to latest version, no functional changes.
- Remove unused direct dependencies core-js and terser-webpack-plugin.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>