]> source.dussan.org Git - gitea.git/log
gitea.git
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>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 6 Apr 2021 00:12:35 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUpdate to bluemonday-1.0.6 (#15294)
zeripath [Mon, 5 Apr 2021 21:38:31 +0000 (22:38 +0100)]
Update to bluemonday-1.0.6 (#15294)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoCheck if stopwatch element empty (#15278)
Kyle D [Mon, 5 Apr 2021 16:45:01 +0000 (10:45 -0600)]
Check if stopwatch element empty (#15278)

3 years ago[refactor] replace int with httpStatusCodes (#15282)
6543 [Mon, 5 Apr 2021 15:30:52 +0000 (17:30 +0200)]
[refactor] replace int with httpStatusCodes (#15282)

* replace "200" (int) with "http.StatusOK" (const)

* ctx.Error & ctx.HTML

* ctx.JSON Part1

* ctx.JSON Part2

* ctx.JSON Part3

3 years agoFix typo in app.example.ini (#15287)
Ikko Ashimine [Mon, 5 Apr 2021 09:49:14 +0000 (18:49 +0900)]
Fix typo in app.example.ini (#15287)

seperated -> separated

Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix xorm log stack level (#15285)
Lunny Xiao [Mon, 5 Apr 2021 07:41:22 +0000 (15:41 +0800)]
Fix xorm log stack level (#15285)

3 years agoDrop the event source if we are unauthorized (#15275)
zeripath [Sun, 4 Apr 2021 21:37:50 +0000 (22:37 +0100)]
Drop the event source if we are unauthorized (#15275)

A previous commit that sent unauthorized if the user is unauthorized
simply leads to the repeated reopening of the eventsource. #

This PR changes the event returned to tell the client to close the
eventsource and thus prevents the repeated reopening.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 4 Apr 2021 00:12:19 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd size to Save function (#15264)
zeripath [Sat, 3 Apr 2021 16:19:59 +0000 (17:19 +0100)]
Add size to Save function (#15264)

Fix #15253

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoClose file on invalid range (#15166)
KN4CK3R [Sat, 3 Apr 2021 12:44:12 +0000 (14:44 +0200)]
Close file on invalid range (#15166)

* Close file on invalid range.

* Close on seek error

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 agoBranch page and misc css improvements (#15208)
silverwind [Sat, 3 Apr 2021 08:37:32 +0000 (10:37 +0200)]
Branch page and misc css improvements (#15208)

- Improve branches page, increase icon size, use octicons, use css vars
- Style placeholder color via css var
- Slightly increase contrast of input fields and active/hover states
- Add styling for select boxes in arc-green

3 years agoupdate golang libraries (#15258)
techknowlogick [Sat, 3 Apr 2021 03:02:27 +0000 (23:02 -0400)]
update golang libraries (#15258)

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

3 years ago[refactor] mailer service (#15072)
6543 [Fri, 2 Apr 2021 10:25:13 +0000 (12:25 +0200)]
[refactor] mailer service (#15072)

* Unexport SendUserMail

* Instead of "[]*models.User" or "[]string" lists infent "[]*MailRecipient" for mailer

* adopt

* code format

* TODOs for "i18n"

* clean

* no fallback for lang -> just use english

* lint

* exec testComposeIssueCommentMessage per lang and use only emails

* rm MailRecipient

* Dont reload from users from db if you alredy have in ram

* nits

* minimize diff

Signed-off-by: 6543 <6543@obermui.de>
* localize subjects

* linter ...

* Tr extend

* start tmpl edit ...

* Apply suggestions from code review

* use translation.Locale

* improve mailIssueCommentBatch

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

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

Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoFix release expansion issue (#15251)
zeripath [Fri, 2 Apr 2021 06:49:53 +0000 (07:49 +0100)]
Fix release expansion issue (#15251)

* Fix release expansion issue

Fix #14578

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* and update the npmrcs

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

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 2 Apr 2021 00:16:50 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoIntroduce esbuild on webpack (#14578)
Lunny Xiao [Fri, 2 Apr 2021 00:11:04 +0000 (08:11 +0800)]
Introduce esbuild on webpack (#14578)

* Vendor node mods as cache; fix esbuild/fomantic offline build

* Fix --exclude; use bsdtar for consistent globbing

* Fall back to GNU tar; forward-compatible for APT 2.0

* Avoid having extd. attrs with bsdtar

* Dependency and misc. optimizations

* Remove extra code after esbuild-loader update

Co-authored-by: Mike L <cl.jeremy@qq.com>
3 years agoFix graph pagination (#15225)
KN4CK3R [Thu, 1 Apr 2021 20:01:23 +0000 (22:01 +0200)]
Fix graph pagination (#15225)

* Fixed invalid HTML tag.

* Fixed pagination.

* Update templates/repo/graph/commits.tmpl

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoPrevent NPE in CommentMustAsDiff if no hunk header (#15199)
zeripath [Thu, 1 Apr 2021 18:29:14 +0000 (19:29 +0100)]
Prevent NPE in CommentMustAsDiff if no hunk header (#15199)

I do not understand how this can happen or why.

There is an apparent possibility for a comment.Patch to be missing a hunk header
- this should not happen and do not understand how. But it appears to happen on
1.13 at least in some case.

This PR will simply add a new section if the cursection is empty
thus preventing the NPE.

Fix #15198

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>
3 years agoSpeed up `enry.IsVendor` (#15213)
zeripath [Thu, 1 Apr 2021 17:41:09 +0000 (18:41 +0100)]
Speed up `enry.IsVendor` (#15213)

`enry.IsVendor` is kinda slow as it simply iterates across all regexps.
This PR ajdusts the regexps to combine them to make this process a
little quicker.

Related #15143

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoresponse simple text message for not html request when 404 (#15229)
a1012112796 [Thu, 1 Apr 2021 15:11:42 +0000 (23:11 +0800)]
response simple text message for not html request when 404 (#15229)

* response simple text message for not html request when response 404

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoFix timezone bug when clicking heatmap (#15141)
mayswind [Thu, 1 Apr 2021 10:52:17 +0000 (18:52 +0800)]
Fix timezone bug when clicking heatmap (#15141)

3 years agoresponse 404 for diff/patch of a commit that not exist (#15221)
a1012112796 [Thu, 1 Apr 2021 05:17:14 +0000 (13:17 +0800)]
response 404 for diff/patch of a commit that not exist (#15221)

* response 404 for diff/patch of a commit that not exist

fix #15217

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update routers/repo/commit.go

Co-authored-by: silverwind <me@silverwind.io>
* use ctx.NotFound()

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 1 Apr 2021 00:16:36 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoDiff box fixes (#15214)
silverwind [Wed, 31 Mar 2021 22:19:53 +0000 (00:19 +0200)]
Diff box fixes (#15214)

- Fix misaligned "Show Outdated" buttons via flexbox
- Add hover effect to "Show Outdated" buttons
- Remove overreaching margin from selector .diff-file-box and handle
  cases individually.

Fixes: https://github.com/go-gitea/gitea/issues/15097
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUpdate docs for bad ini syntax in noreply (#15226)
Kyle D [Wed, 31 Mar 2021 21:13:46 +0000 (15:13 -0600)]
Update docs for bad ini syntax in noreply (#15226)

3 years agoFix regression from #14623 - use debug SVC handler only on interactive sessions ...
zeripath [Wed, 31 Mar 2021 19:48:48 +0000 (20:48 +0100)]
Fix regression from #14623 - use debug SVC handler only on interactive sessions (#15210)

Unfortunately #14623 changed from the deprecated IsInteractiveSession to
IsWindowsService without recognising that they are the complement of
each other.

This means that Windows SVC control is not working correctly. This PR
adds some Tracing statements but also fixes the bug.

Fix #15159

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix documentation for the fallback mail subject (#15223)
David Crocker [Wed, 31 Mar 2021 15:36:21 +0000 (11:36 -0400)]
Fix documentation for the fallback mail subject (#15223)

The documentation for the [fallback mail subject](https://github.com/go-gitea/gitea/blob/d989247bb08d2b8eb144e7a0edeaedfc26d08175/services/mailer/mail_issue.go#L14-L16) was missing `{{}}` around `.Issue.Index`.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 31 Mar 2021 00:12:40 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoRemove vendored copy of fomantic-dropdown (#15193)
silverwind [Tue, 30 Mar 2021 17:27:06 +0000 (19:27 +0200)]
Remove vendored copy of fomantic-dropdown (#15193)

jQuery 3.6.0 seems to have broke the dropdown focus handling (focus
would get stuck on the dropdown) in this module which we have vendored
on top of fomantic for accessibility improvements.

Either downgrading jQuery to 3.5.1 or removing the vendor copy seems to
resolve the issue and I opted for removing the copy because I think such
changes should be done upstream and the removal also lightens the JS by
155kB before minify/gzip.

Fixes: https://github.com/go-gitea/gitea/issues/15172
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoadd 'fonts' into 'KnownPublicEntries' (#15188)
a1012112796 [Tue, 30 Mar 2021 12:47:34 +0000 (20:47 +0800)]
add 'fonts' into 'KnownPublicEntries' (#15188)

fix #15184

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoRemove file-loader dependency (#15196)
silverwind [Tue, 30 Mar 2021 11:17:24 +0000 (13:17 +0200)]
Remove file-loader dependency (#15196)

- Upgrade webpack to 5.28 to enable publicPath option
- Use asset modules in place of deprecated file-loader

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix webhook delivery and issue checklist for arc-green (#15195)
silverwind [Tue, 30 Mar 2021 06:02:41 +0000 (08:02 +0200)]
Fix webhook delivery and issue checklist for arc-green (#15195)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 30 Mar 2021 00:12:39 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd Tabular Diff for CSV files (#14661)
KN4CK3R [Mon, 29 Mar 2021 20:44:28 +0000 (22:44 +0200)]
Add Tabular Diff for CSV files (#14661)

Implements request #14320 The rendering of CSV files does match the diff style.

* Moved CSV logic into base package.

* Added method to create a tabular diff.

* Added CSV compare context.

* Added CSV diff template.

* Use new table style in CSV markup.

* Added file size limit for CSV rendering.

* Display CSV parser errors in diff.

* Lazy read single file.

* Lazy read rows for full diff.

* Added unit tests for various CSV changes.

3 years agoFix margin between avatars on org pages (#15194)
silverwind [Mon, 29 Mar 2021 19:57:27 +0000 (21:57 +0200)]
Fix margin between avatars on org pages (#15194)

Fixes: https://github.com/go-gitea/gitea/issues/15191
3 years agoImprove /api/v1/repos/issues/search by just getting repo ids (#15179)
zeripath [Mon, 29 Mar 2021 17:12:21 +0000 (18:12 +0100)]
Improve /api/v1/repos/issues/search by just getting repo ids (#15179)

/api/v1/repos/issues/search is a highly inefficient search which is unfortunately
the basis for our dependency searching algorithm. In particular it currently loads
all of the repositories and their owners and their primary coding language all of
which is immediately thrown away.

This PR makes one simple change - just get the IDs.

Related #14560
Related #12827

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoshould run RetrieveRepoMetas() for empty pr (#15187)
a1012112796 [Mon, 29 Mar 2021 06:58:48 +0000 (14:58 +0800)]
should run RetrieveRepoMetas() for empty pr (#15187)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 29 Mar 2021 00:12:37 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agouse level config in main section when subsection not set level (#15176)
a1012112796 [Sun, 28 Mar 2021 19:08:19 +0000 (03:08 +0800)]
use level config in main section when subsection not set level (#15176)

in previouse if a log subsetcion not set level
it will use ``info`` as default value.

this pr will make default value (``[log] -> LEVEL``) useable.

example config:
```INI
[log]
MODE = console
LEVEL = Trace

[log.console]
LEVEL =
STDERR = false
```

previous result:
```JSON
// console:
{
  "level": "info",
  ...................
}
```

after change:

```JSON
// console:
{
  "level": "track",
  ...................
}
```

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoUpdate repository size on cron gc task (#15177)
zeripath [Sun, 28 Mar 2021 03:56:28 +0000 (04:56 +0100)]
Update repository size on cron gc task (#15177)

git gc cron could change the size of the repository therefore we should update the
size of the repo stored in our database.

Also significantly improve the efficiency of counting lfs associated with the
repository

3 years agoupdate docs to reference 1.13.6 (#15182)
techknowlogick [Sun, 28 Mar 2021 03:09:01 +0000 (23:09 -0400)]
update docs to reference 1.13.6 (#15182)

3 years agoExpose resolver via API (#15167)
sotho [Sat, 27 Mar 2021 23:37:51 +0000 (00:37 +0100)]
Expose resolver via API (#15167)

* Expose resolver via API

3 years ago[refactor] Unify the export of user data via API (#15144)
6543 [Sat, 27 Mar 2021 16:45:26 +0000 (17:45 +0100)]
[refactor] Unify the export of user data via API (#15144)

* [refactor] unify how user data is exported via API

* test time via unix timestamp

3 years agoAdd DefaultMergeStyle option to repository (#14789)
parnic [Sat, 27 Mar 2021 14:55:40 +0000 (09:55 -0500)]
Add DefaultMergeStyle option to repository (#14789)

Fixes #12293

3 years agofix org navbar (#15173)
Jimmy Praet [Fri, 26 Mar 2021 21:15:13 +0000 (22:15 +0100)]
fix org navbar (#15173)

3 years agofix regression of 15139 (#15164)
6543 [Fri, 26 Mar 2021 02:46:41 +0000 (03:46 +0100)]
fix regression of 15139 (#15164)

3 years agoClusterfuzz found another way (#15160)
zeripath [Thu, 25 Mar 2021 23:21:00 +0000 (23:21 +0000)]
Clusterfuzz found another way (#15160)

Clusterfuzz found another way so I found another way to stop it

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 25 Mar 2021 00:12:38 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix wrong user returned in API (#15139)
sotho [Wed, 24 Mar 2021 20:26:15 +0000 (21:26 +0100)]
Fix wrong user returned in API (#15139)

The API call: GET /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments
returns always the reviewer, but should return the poster.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoCreate Proper Migration Tests (#15116)
zeripath [Wed, 24 Mar 2021 18:27:22 +0000 (18:27 +0000)]
Create Proper Migration Tests (#15116)

* Create Proper Migration tests

Unfortunately our testing regime has so far meant that migrations do not
get proper testing.

This PR begins the process of creating migration tests for this.

* Add test for v176

* fix mssql drop db

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix Migration 176 yet again (#15131)
zeripath [Tue, 23 Mar 2021 23:10:19 +0000 (23:10 +0000)]
Fix Migration 176 yet again (#15131)

* Fix Migration 176 yet again

Whilst creating a test for v176 in the migrations_test PR
it has become clear that this was still wrong.

This is now fixed. Genuinely.

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix bug on avatar middleware (#15124)
Lunny Xiao [Tue, 23 Mar 2021 17:20:24 +0000 (01:20 +0800)]
Fix bug on avatar middleware (#15124)

3 years agoFix consistency check (#15120)
zeripath [Tue, 23 Mar 2021 10:23:33 +0000 (10:23 +0000)]
Fix consistency check (#15120)

In my last fix I missed adding the label_ prefix to the
consistency check count.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 23 Mar 2021 00:12:49 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoRemove raw-loader dependency (#15112)
silverwind [Mon, 22 Mar 2021 22:10:09 +0000 (23:10 +0100)]
Remove raw-loader dependency (#15112)

Webpack now includes this functionality, allowing us to drop this
now-deprecated dependency.

Ref: https://webpack.js.org/guides/asset-modules/
Ref: https://webpack.js.org/loaders/raw-loader/

3 years agoFix the v176 migration (#15110)
zeripath [Mon, 22 Mar 2021 18:26:38 +0000 (18:26 +0000)]
Fix the v176 migration (#15110)

There is a serious issue with the v176 migration where there is a mistaken missing
label_id selection.

*introduced by #14912*

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[Vendor] update gitea-sdk v0.14.0 (#15103)
6543 [Mon, 22 Mar 2021 17:03:18 +0000 (18:03 +0100)]
[Vendor] update gitea-sdk v0.14.0 (#15103)

* upgraded code.gitea.io/sdk/gitea v0.13.2 => v0.14.0

* rm workaround

3 years agoImplement delete release attachments and update release attachments' name (#14130)
Lunny Xiao [Mon, 22 Mar 2021 16:09:51 +0000 (00:09 +0800)]
Implement delete release attachments and update release attachments' name (#14130)

* Implement delete release attachment

* Add attachments on release edit page

* Fix bug

* Finish del release attachments

* Fix frontend lint

* Fix tests

* Support edit release attachments

* Added tests

* Remove the unnecessary parameter isCreate from UpdateReleaseOrCreatReleaseFromTag

* Rename UpdateReleaseOrCreatReleaseFromTag to UpdateRelease

* Fix middle align

3 years agoUpdate JS dependencies (#15033)
silverwind [Mon, 22 Mar 2021 04:04:19 +0000 (05:04 +0100)]
Update JS dependencies (#15033)

* Update JS dependencies

- Update all JS dependencies
- For octicons, rename trashcan to trash
- For svgo, migrate to v2 api, output seems to have slightly changed but icons look the same
- For stylelint, update config, fix custom property duplicates
- For monaco, drop legacy Edge support
- For eslint, enable new rules, fix new issues
- For less-loader, remove deprecated import syntax

* update svgo usage in generate-images and rebuild logo.svg with it

3 years agoFix another clusterfuzz identified issue (#15096)
zeripath [Mon, 22 Mar 2021 01:45:01 +0000 (01:45 +0000)]
Fix another clusterfuzz identified issue (#15096)

* Fix another clusterfuzz identified issue

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 22 Mar 2021 00:12:36 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFixed previous fix. (#15098)
KN4CK3R [Sun, 21 Mar 2021 19:51:54 +0000 (20:51 +0100)]
Fixed previous fix. (#15098)

3 years agoFix lock modal content rendering outside modal (#15095)
silverwind [Sun, 21 Mar 2021 18:58:28 +0000 (19:58 +0100)]
Fix lock modal content rendering outside modal (#15095)

* Fix lock modal content rendering outside modal

The .content was not a child to .modal so was rendering outside. This is
a recent regression but I'm not certain when it was introduced.

* remove extraneous closing div

3 years agoChangelog v1.13.5 (#15084) (#15093)
6543 [Sun, 21 Mar 2021 17:58:19 +0000 (18:58 +0100)]
Changelog v1.13.5 (#15084) (#15093)

* Changelog v1.13.5 (#15084)

* fix unrel. nit

3 years agoPlace wrapper around comment as diff to catch panics (#15085)
zeripath [Sun, 21 Mar 2021 16:59:58 +0000 (16:59 +0000)]
Place wrapper around comment as diff to catch panics (#15085)

There are a few recurrent issues with comment as diff reporting panics that are resistant to fixing due to the fact that the panic occurs in the template render and is swallowed by the template renderer.

This PR just adds some logging to force the panic to properly logged and re-propagates back up to the template renderer so we can actually detect what the issue is.

Signed-off-by: Andrew Thornton art27@cantab.net
3 years agoUse i18n.Reset to reload locales (#15073)
6543 [Sun, 21 Mar 2021 15:11:36 +0000 (16:11 +0100)]
Use i18n.Reset to reload locales (#15073)

3 years agofix double 'push tag' action feed (#15078)
a1012112796 [Sun, 21 Mar 2021 10:11:22 +0000 (18:11 +0800)]
fix double 'push tag' action feed (#15078)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoHandle unauthorized user events gracefully (#15071)
Lauris BH [Sat, 20 Mar 2021 20:39:43 +0000 (22:39 +0200)]
Handle unauthorized user events gracefully (#15071)

3 years ago[Refactor] remove possible resource leak (#15067)
6543 [Sat, 20 Mar 2021 16:30:29 +0000 (17:30 +0100)]
[Refactor] remove possible resource leak (#15067)

* move "copy uploaded lfs files 2 repo" to own function for "defer file.Close()"

* rm type overload

* Update modules/repofiles/upload.go

Co-authored-by: zeripath <art27@cantab.net>
3 years agoUpdate to goldmark 1.3.3 (#15059)
zeripath [Sat, 20 Mar 2021 11:23:55 +0000 (11:23 +0000)]
Update to goldmark 1.3.3 (#15059)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix markdown rendering in milestone content (#15056)
silverwind [Sat, 20 Mar 2021 09:36:52 +0000 (10:36 +0100)]
Fix markdown rendering in milestone content (#15056)

- Add missing markdown class for rendered markdown.
- Increase font size of milestone name in list.

Fixes: https://github.com/go-gitea/gitea/issues/15046
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 20 Mar 2021 00:12:40 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAllow read/write to user root and only read to group git on documentation (#15041) v1.15.0-dev
Lasse Brandt Thomsen [Fri, 19 Mar 2021 23:45:04 +0000 (00:45 +0100)]
Allow read/write to user root and only read to group git on documentation (#15041)

Co-authored-by: Lasse Brandt Thomsen <lasse@bitmand.dk>
3 years agoFix bug when upload on web (#15042)
Lunny Xiao [Fri, 19 Mar 2021 22:49:29 +0000 (06:49 +0800)]
Fix bug when upload on web (#15042)

* Fix bug when upload on web

* move into own function

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoChangelog for 1.14.0-RC1 (#14935)
6543 [Fri, 19 Mar 2021 20:42:57 +0000 (21:42 +0100)]
Changelog for 1.14.0-RC1 (#14935)

* Changelog for 1.14.0-RC1

* api

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
* Apply suggestions from code review

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

* Apply suggestions from code review

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

Co-authored-by: techknowlogick <matti@mdranta.net>
* update

* Update CHANGELOG.md

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
* Apply suggestions from code review

* Move things to SECURITY that are SECURITY

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

Co-authored-by: Lauris BH <lauris@nix.lv>
* Update CHANGELOG.md

* Apply suggestions from code review

Co-authored-by: Norwin <noerw@users.noreply.github.com>
* Update CHANGELOG.md

Co-authored-by: Kyle D. <kdumontnu@gmail.com>
* sort

* Update CHANGELOG.md

Co-authored-by: Kyle D. <kdumontnu@gmail.com>
* :gitea: :rocket:

* Update date

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: Kyle D. <kdumontnu@gmail.com>
3 years agoDelete Labels & IssueLabels on Repo Delete too (#15039)
6543 [Fri, 19 Mar 2021 19:01:24 +0000 (20:01 +0100)]
Delete Labels & IssueLabels on Repo Delete too (#15039)

* Doctor: find IssueLabels without existing label

* on Repo Delete: delete labels & issue_labels too

* performance nits

* Add Migration: Delete orphaned IssueLabels

* Migration v174: use Sync2

* USE sess !!!

* better func name

* code format & comment

* RAW SQL

* Update models/migrations/v176.go

* next try?

3 years agoPrevent addition of labels from outside the repository or organisation in issues...
zeripath [Fri, 19 Mar 2021 13:25:14 +0000 (13:25 +0000)]
Prevent addition of labels from outside the repository or organisation in issues (#14912)

* Never add labels not from this repository or organisation and remove org labels on transfer

Prevent the addition of labels from outside of the repository or
organisation and remove organisation labels on transfer.

Related #14908

Signed-off-by: Andrew Thornton <art27@cantab.net>
* switch to use sql

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Give me some AS?

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

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* once more around the merry go round

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add outside label consistency check into doctor

This PR adds another consistency check into doctor in order to detect
labels that have been added from outside of repositories and organisations

Fix #14908

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* prep for merge

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix UI elements getting underline like links (#15038)
Mike L [Fri, 19 Mar 2021 02:21:28 +0000 (03:21 +0100)]
Fix UI elements getting underline like links (#15038)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 19 Mar 2021 00:13:12 +0000 (00:13 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix CJK fonts again and misc. font issues (#14575)
Mike L [Thu, 18 Mar 2021 23:43:43 +0000 (00:43 +0100)]
Fix CJK fonts again and misc. font issues (#14575)

* Push system-ui further down the stack, fix #12966

* Fix Firefox showing U+300x in emoji font and more

* Revert emoji font and fix long-standing Safari bug

* Exclude Safari emoji fix above 1.25x zoom

* Minor correctness/typo fix, affects only legacy platforms

* Emoji consistency for monospace (e.g. EasyMDE)

* Override paradigm; macOS/iOS-specific metric fix

* Move whitespace fix to font-face

* Handle metric calculation errors with Firefox

* One last workaround for aliased fonts in Linux