]> source.dussan.org Git - gitea.git/log
gitea.git
4 years agoFix incorrect error logging in Stats indexer and OAuth2 (#12387) (#12422)
techknowlogick [Tue, 4 Aug 2020 08:27:43 +0000 (04:27 -0400)]
Fix incorrect error logging in Stats indexer and OAuth2 (#12387) (#12422)

* Fix incorrect logging in oauth2.go

Fix #11945

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Handle ErrAlreadyInQueue in stats indexer

Fix #12380

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fixes type in error message of indexer

Add the missing character in the error message.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lieven Hollevoet <hollie@lika.be>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lieven Hollevoet <hollie@lika.be>
4 years ago[Vendor] upgrade google/go-github to v32.1.0 (#12361) (#12390)
6543 [Fri, 31 Jul 2020 16:02:23 +0000 (18:02 +0200)]
[Vendor] upgrade google/go-github to v32.1.0 (#12361) (#12390)

* upgrate go-github client to v32.1.0

* migrate

4 years agoRendoer emoji's of Commit message on feed-page (#12373)
6543 [Wed, 29 Jul 2020 21:09:47 +0000 (23:09 +0200)]
Rendoer emoji's of Commit message on feed-page (#12373)

4 years agoGit 2.28 no longer permits diff with ... on unrelated branches (#12370)
zeripath [Wed, 29 Jul 2020 16:42:22 +0000 (17:42 +0100)]
Git 2.28 no longer permits diff with ... on unrelated branches (#12370)

Backport #12364

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoChangelog v1.12.3 (#12356) v1.12.3
6543 [Tue, 28 Jul 2020 20:41:36 +0000 (22:41 +0200)]
Changelog v1.12.3 (#12356)

* Changelog v1.12.3

* better description for 12351

* @techknowlogick suggestions

4 years agoBackport to v1.12 for #12341 - Release date fix (#12351)
Richard Mahn [Tue, 28 Jul 2020 18:10:50 +0000 (14:10 -0400)]
Backport to v1.12 for #12341 - Release date fix (#12351)

* Backport for Issue #12341 PR #12343 - Release date fix

* Adds sleep for comparing times

* Fixes imports

* Fixes tests

4 years agoShow 404 page when release not found (#12328) (#12332)
techknowlogick [Sun, 26 Jul 2020 21:39:44 +0000 (17:39 -0400)]
Show 404 page when release not found (#12328) (#12332)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 赵智超 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoBackport emoji fixes to 1.12 (#12327)
silverwind [Sat, 25 Jul 2020 16:50:57 +0000 (18:50 +0200)]
Backport emoji fixes to 1.12 (#12327)

* Fix emoji detection in certain cases (#12320)

* Fix emoji detection certain cases

Previous tests weren't complicated enough so there were some situations where emojis were't detected properly. Find the earliest occurance in addition to checking for the longest combination.

Fixes #12312

* ok spell bot

Co-authored-by: Lauris BH <lauris@nix.lv>
* Reduce emoji size (#12317)

* Reduce emoji size

Rendering should now pretty much match GitHub with 1.25em. I verified
that emojis don't increase the line height and removed unecessary size
overrides because now all emojis should appear similar in relation to
the font size.

* fix reaction hover

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoFix double-indirection bug in logging IDs (#12294) (#12308)
techknowlogick [Thu, 23 Jul 2020 23:24:22 +0000 (19:24 -0400)]
Fix double-indirection bug in logging IDs (#12294) (#12308)

This PR fixes a bug in log.NewColoredIDValue() which led to a double
indirection and incorrect IDs being printed out.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years ago[ui] Link to pr list page on sidebar when view pr (#12256) (#12263)
techknowlogick [Thu, 16 Jul 2020 15:56:09 +0000 (11:56 -0400)]
[ui] Link to pr list page on sidebar when view pr (#12256) (#12263)

Fix #12254

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: 赵智超 <1012112796@qq.com>
4 years agoExtend Notifications API and return pinned notifications by default (#12164) (#12232)
zeripath [Mon, 13 Jul 2020 20:52:05 +0000 (21:52 +0100)]
Extend Notifications API and return pinned notifications by default (#12164) (#12232)

Backport #12164

This PR extends the notifications API to allow specific notification statuses to be searched for and to allow setting of notifications to statuses other than read.

By default unread and pinned statuses will be returned when querying for notifications - however pinned statuses will not be marked as read.

Close #12152

Signed-off-by: Andrew Thornton art27@cantab.net
4 years agoChangelog for v1.12.2 (#12214) v1.12.2
Lauris BH [Sat, 11 Jul 2020 16:53:26 +0000 (19:53 +0300)]
Changelog for v1.12.2 (#12214)

* Changelog for v1.12.2

* Update CHANGELOG.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Update CHANGELOG.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Update CHANGELOG.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Update CHANGELOG.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Update CHANGELOG.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Update CHANGELOG.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Update CHANGELOG.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
* Update CHANGELOG.md

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: mrsdizzie <info@mrsdizzie.com>
4 years agoDecrease the num_stars when deleting a repo (#11954) (#12188)
赵智超 [Wed, 8 Jul 2020 21:52:40 +0000 (05:52 +0800)]
Decrease the  num_stars when deleting a repo (#11954) (#12188)

* Decrease the  num_stars when deleting a repo

fix #11949

Signed-off-by: a1012112796 <1012112796@qq.com>
* Add migration

* use batch

* Apply suggestions from code review

Co-authored-by: Lauris BH <lauris@nix.lv>
* fix lint

* fix lint

* fix ci

* fix ci2

* add doctor

* duplicate code

* fix migration

* fix some nits

* add start

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoFix regression: Gitea commits API again returns commit summaries, not full messages...
techknowlogick [Wed, 8 Jul 2020 15:22:07 +0000 (11:22 -0400)]
Fix regression: Gitea commits API again returns commit summaries, not full messages  (#12186) (#12187)

Closes #12185

Co-authored-by: Kristian Antonsen <kristian@derfor.dk>
4 years agoproperly set symbolic-ref HEAD when a repo is created with a non-master default branc...
techknowlogick [Wed, 8 Jul 2020 04:40:22 +0000 (00:40 -0400)]
properly set symbolic-ref HEAD when a repo is created with a non-master default branch (#12135) (#12182)

This fixes an issue I noticed with #10803: when you create a repo with a non-master default branch, gitea doesn't change the remote ref HEAD, so it still points at refs/heads/master. As a result, cloning my repos gives me error messages and doesn't check out the desired default branch, so I need to manually check it out after cloning.

Co-authored-by: xenofem <45297511+xenofem@users.noreply.github.com>
4 years agoTrim to 255 runes instead of bytes (#12150)
Jürgen Hötzel [Tue, 7 Jul 2020 21:35:52 +0000 (23:35 +0200)]
Trim to 255 runes instead of bytes (#12150)

* Trim to 255 runes instead of bytes

Prevents invalid UTF-8 encoding for Description and Website. Refs #7905

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoEnsure Subkeys are verified (#12155) (#12168)
zeripath [Tue, 7 Jul 2020 00:13:18 +0000 (01:13 +0100)]
Ensure Subkeys are verified (#12155) (#12168)

Backport #12155

When attempting to verify subkeys the email address verification step
requires checking the emails however, these emails are not stored on
subkeys but instead on the primary key.

This PR will obtain the primaryKey and check against these emails too.

Fix #12128

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoUse hash of repo path, ref and entrypath as cache key (#12151) (#12161)
Lauris BH [Mon, 6 Jul 2020 08:51:45 +0000 (11:51 +0300)]
Use hash of repo path, ref and entrypath as cache key (#12151) (#12161)

4 years agoMultiple small admin dashboard fixes (#12153) (#12156)
zeripath [Sun, 5 Jul 2020 20:19:53 +0000 (21:19 +0100)]
Multiple small admin dashboard fixes (#12153) (#12156)

* Prevent (EXTRA string) comments in Task headers
* Redirect tasks started from monitor page back to monitor
* Fix #12107 - redirects from process cancel should use AppSubUrl
* When wrapping queues set the name correctly

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoRemove spurious logging (#12139) (#12148)
zeripath [Sun, 5 Jul 2020 16:09:13 +0000 (17:09 +0100)]
Remove spurious logging (#12139) (#12148)

Backport #12139

Unfortunately #10745 merged a spurious logging message. This PR removes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agotemplates/repo/empty.tmpl : fix repo setup instructions (#12147)
Andreas Shimokawa [Sun, 5 Jul 2020 12:56:10 +0000 (14:56 +0200)]
templates/repo/empty.tmpl : fix repo setup instructions (#12147)

Co-authored-by: codeberg <codeberg@codeberg.org>
Co-authored-by: zeripath <art27@cantab.net>
4 years ago Move EventSource to SharedWorker (#12095) (#12130)
zeripath [Sat, 4 Jul 2020 22:08:03 +0000 (23:08 +0100)]
 Move EventSource to SharedWorker (#12095) (#12130)

* Move EventSource to SharedWorker (#12095)

Backport #12095

Move EventSource to use a SharedWorker. This prevents issues with HTTP/1.1
open browser connections from preventing gitea from opening multiple tabs.

Also allow setting EVENT_SOURCE_UPDATE_TIME to disable EventSource updating

Fix #11978

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Bugfix for shared event source

For some reason our eslint configuration is not working correctly
and a bug has become apparent when trying to backport this to 1.12.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Re-fix #12095 again

Unfortunately some of the suggested changes to #12095 introduced
bugs which due to caching behaviour of sharedworkers were not caught
on simple tests.

These are as follows:

* Changing from simple for loop to use includes here:

```js
  register(port) {
    if (!this.clients.includes(port)) return;

    this.clients.push(port);

    port.postMessage({
      type: 'status',
      message: `registered to ${this.url}`,
    });
  }
```

The additional `!` prevents any clients from being added and should
read:

```js
    if (this.clients.includes(port)) return;
```

* Dropping the use of jQuery `$(...)` selection and using DOM
`querySelector` here:

```js
async function receiveUpdateCount(event) {
  try {
    const data = JSON.parse(event.data);

    const notificationCount = document.querySelector('.notification_count');
    if (data.Count > 0) {
      notificationCount.classList.remove('hidden');
    } else {
      notificationCount.classList.add('hidden');
    }

    notificationCount.text() = `${data.Count}`;
    await updateNotificationTable();
  } catch (error) {
    console.error(error, event);
  }
}
```

Requires that `notificationCount.text()` be changed to use `textContent`
instead.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix ui bug in wiki commit page (#12089) (#12125)
赵智超 [Fri, 3 Jul 2020 04:49:55 +0000 (12:49 +0800)]
Fix ui bug in wiki commit page (#12089) (#12125)

* Fix ui bug in wiki commit page

TODO: Maybe we should allow wiki to have its own ``.editorconfig`` file.

Signed-off-by: a1012112796 <1012112796@qq.com>
* fix a small nit

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoSet the base url when migrating from Gitlab using access token or username without...
zeripath [Thu, 2 Jul 2020 12:26:47 +0000 (13:26 +0100)]
Set the base url when migrating from Gitlab using access token or username without password (#11852) (#12104)

Backport #11852

When migrating from gitlab, set the baseUrl in NewGitlabDownloader when using an access token or username without password

Fix #11851

Co-authored-by: Gernot Eger <gernot.eger@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoFix gitgraph branch continues after merge (#12044) (#12105)
zeripath [Thu, 2 Jul 2020 10:46:06 +0000 (11:46 +0100)]
Fix gitgraph branch continues after merge (#12044) (#12105)

Backport #12044

* Fix gitgraph branch continues after merge

After fixing the initial problem in #11981 another
problem has come to light...

Fix #11981 (part 2)

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update web_src/js/vendor/gitgraph.js

* Apply suggestions from code review

Co-authored-by: silverwind <me@silverwind.io>
4 years agoFix merge section in dark theme (#12086) (#12109)
Lauris BH [Thu, 2 Jul 2020 09:36:45 +0000 (12:36 +0300)]
Fix merge section in dark theme (#12086) (#12109)

Backport #12086

* Fix merge section in dark theme

* Fix lint

4 years agoEnsure BlameReaders close at end of request (#12102) (#12103)
zeripath [Wed, 1 Jul 2020 15:43:25 +0000 (16:43 +0100)]
Ensure BlameReaders close at end of request (#12102) (#12103)

Backport #12102

this was thought to be due to timeouts, however on closer look this
appears to be due to the Close() function of the BlameReader hanging
with a blocked stdout pipe.

This PR fixes this Close function to:

* Cancel the context of the cmd
* Close the StdoutReader - ensuring that the output pipe is closed

Further it makes the context of the `git blame` command a child of the
request context - ensuring that even if Close() is not called, on
cancellation of the Request the blame is command will also be cancelled.

Fixes #11716
Closes #11727

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoDisable go module when downloading global binaries (#12030) (#12084)
Stefan Bethke [Sun, 28 Jun 2020 18:14:22 +0000 (20:14 +0200)]
Disable go module when downloading global binaries (#12030) (#12084)

Prevent `go get` from touching `go.mod` and `go.sum` when executing
global binaries during the build process. Once
https://github.com/golang/go/issues/30515 is fixed, we should is
whatever solution is provided there.

Fixes: https://github.com/go-gitea/gitea/pull/12010
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix comments webhook panic backport (#12058)
Cornel [Fri, 26 Jun 2020 01:19:11 +0000 (04:19 +0300)]
Fix comments webhook panic backport (#12058)

* Handle HookIssueReviewed action in webhook

* Fix webhook comment handling type cast panic

4 years agoDisable dropzone's timeout (#12024) (#12032)
silverwind [Wed, 24 Jun 2020 14:24:27 +0000 (16:24 +0200)]
Disable dropzone's timeout (#12024) (#12032)

Dropzone 4.4 introduced a 30s XHR timeout that will kill any upload
still in progress. This disable that timeout again.

Ref: https://www.dropzonejs.com/#config-timeout
Ref: https://github.com/go-gitea/gitea/pull/10645
Ref: https://xhr.spec.whatwg.org/#the-timeout-attribute
Fixes: https://github.com/go-gitea/gitea/issues/12022
Fixes: https://github.com/go-gitea/gitea/issues/11906
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoChangelog for v1.12.1 (#12006) v1.12.1
Lauris BH [Sun, 21 Jun 2020 22:12:42 +0000 (01:12 +0300)]
Changelog for v1.12.1 (#12006)

4 years agoHandle multiple merges in gitgraph.js (#11996) (#12000)
zeripath [Sun, 21 Jun 2020 15:08:25 +0000 (16:08 +0100)]
Handle multiple merges in gitgraph.js (#11996) (#12000)

Backport #11996

There is a bug in web_src/js/vendor/gitgraph.js whereby it fails to
handle multiple merges in a single commit correctly. This PR adds
changes to make this work.

Fix #11981

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoAdd serviceworker.js to KnownPublicEntries (#11992) (#11994)
silverwind [Sat, 20 Jun 2020 14:23:04 +0000 (16:23 +0200)]
Add serviceworker.js to KnownPublicEntries (#11992) (#11994)

Fixes a wrong 302 redirect to the login page, see https://github.com/go-gitea/gitea/issues/11989.
Also made it so the reserved username list is extended with those known
entries so we avoid code duplication.

4 years agoFor language detection do not try to analyze big files by content (#11971) (#11975)
Lauris BH [Fri, 19 Jun 2020 10:10:03 +0000 (13:10 +0300)]
For language detection do not try to analyze big files by content (#11971) (#11975)

4 years agoFix scrollable header on dropdowns (#11893) (#11965)
Cirno the Strongest [Fri, 19 Jun 2020 00:25:58 +0000 (02:25 +0200)]
Fix scrollable header on dropdowns (#11893) (#11965)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
(cherry picked from commit 1fb783efb0dbb3cb866f37ee6b77a003b636de59)

4 years agoChangelog v1.12.0 (#11927) v1.12.0
6543 [Thu, 18 Jun 2020 15:54:33 +0000 (17:54 +0200)]
Changelog v1.12.0 (#11927)

* merge RC-logs

* Update

* Update CHANGELOG.md

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoChangelog v1.11.7 (#11953) (#11955)
6543 [Thu, 18 Jun 2020 15:44:35 +0000 (17:44 +0200)]
Changelog v1.11.7 (#11953) (#11955)

* Changelog v1.11.7

* Update CHANGELOG.md

4 years agoFix commenting on non-utf8 encoded files (#11916) (#11950)
6543 [Thu, 18 Jun 2020 15:22:43 +0000 (17:22 +0200)]
Fix commenting on non-utf8 encoded files (#11916) (#11950)

* Add comment on non-unicode line to force fail

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Just quote/unquote patch

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoUse google/uuid to instead satori/go.uuid (#11943) (#11946)
Lunny Xiao [Thu, 18 Jun 2020 14:06:48 +0000 (22:06 +0800)]
Use google/uuid to instead satori/go.uuid (#11943) (#11946)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoAlign show/hide outdated button on code review block (#11932) (#11944)
Cirno the Strongest [Thu, 18 Jun 2020 09:32:36 +0000 (11:32 +0200)]
Align show/hide outdated button on code review block (#11932) (#11944)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 6c38f371ea3ed98a2ed0534261f5d175c11c628d)

4 years ago[Backport] Update to go-git v5.1.0 (#11936) (#11941)
6543 [Thu, 18 Jun 2020 01:05:30 +0000 (03:05 +0200)]
[Backport] Update to go-git v5.1.0 (#11936) (#11941)

* update go-git 5.0.0 -> v5.1.0

* vendor

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoGlobal default branch setting (#11918) (#11937)
techknowlogick [Wed, 17 Jun 2020 23:32:06 +0000 (19:32 -0400)]
Global default branch setting (#11918) (#11937)

* Global default branch setting (#11918)

* Global default branch setting

* add to app.ini example per @silverwind

* update per @lunny

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Update modules/setting/repository.go

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
4 years agoUse ID or Where to instead directly use Get when load object from database (#11925...
6543 [Wed, 17 Jun 2020 19:53:43 +0000 (21:53 +0200)]
Use ID or Where to instead directly use Get when load object from database (#11925) (#11934)

Backport #11925

Use ID or Where to instead directly use Get when load object from database

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoUpdate CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) (#11915)
6543 [Tue, 16 Jun 2020 19:56:47 +0000 (21:56 +0200)]
Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) (#11915)

* Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912)

* CI.restart()

4 years agoInvalidate comments when file is shortened (#11882) (#11884)
zeripath [Mon, 15 Jun 2020 17:26:30 +0000 (18:26 +0100)]
Invalidate comments when file is shortened (#11882) (#11884)

Backport #11882

Fix #10686

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoRework api/user/repos for pagination (#11827) (#11877)
Cirno the Strongest [Sat, 13 Jun 2020 17:35:13 +0000 (19:35 +0200)]
Rework api/user/repos for pagination (#11827) (#11877)

* Add count to `GetUserRepositories` so that pagination can be supported for `/user/{username}/repos`
* Rework ListMyRepos to use models.SearchRepository

ListMyRepos was an odd one. It first fetched all user repositories and then tried to supplement them with accessible map. The end result was that:

* Limit for pagination did not work because accessible repos would always be appended
* The amount of pages was incorrect if one were to calculate it
* When paginating, all accessible repos would be shown on every page

Hopefully it should now work properly. Fixes #11800 and does not require any change on Drone-side as it can properly interpret and act on Link header which we now set.

Co-authored-by: Lauris BH <lauris@nix.lv>
(cherry picked from commit 0159851cc3fa80e4df4908a5e760afa20452f712)

4 years agoHandle more pathological branch and tag names (#11843) (#11863)
zeripath [Fri, 12 Jun 2020 18:01:44 +0000 (19:01 +0100)]
Handle more pathological branch and tag names (#11843) (#11863)

Backport #11843

It's possible to push quite pathological appearing branch names to gitea
using git push gitea reasonable-branch:refs/heads/-- at which point
large parts of the UI will break. Similarly you can git push origin
reasonable-tag:refs/tags/-- which wil return an error.

This PR fixes the problems these cause. It also changes the code from
creating branches to pushing to ensure that branch restoration has to
pass hooks.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix search form button overlap (#11840) (#11864)
Cirno the Strongest [Fri, 12 Jun 2020 12:23:13 +0000 (14:23 +0200)]
Fix search form button overlap (#11840) (#11864)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 8770bceafa3844a97f35d3f8a35089438bf2f33b)

4 years agoAdd doctor check to set IsArchived false if it is null (partial backport #11853)...
zeripath [Thu, 11 Jun 2020 21:08:13 +0000 (22:08 +0100)]
Add doctor check to set IsArchived false if it is null (partial backport #11853) (#11859)

Partial backport of #11853

Add doctor check to set IsArchived false if it is null.

(Migration change unfortunately not possible to be backported.)

Fix #11824

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoPrevent panic on empty HOST for mysql (#11850) (#11856)
zeripath [Thu, 11 Jun 2020 18:27:59 +0000 (19:27 +0100)]
Prevent panic on empty HOST for mysql (#11850) (#11856)

Backport #11850

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoUse DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) (#11836)
Cirno the Strongest [Wed, 10 Jun 2020 17:42:10 +0000 (19:42 +0200)]
Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) (#11836)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 2b2b3e4c3726ef224e87bb444340bebd3a70badb)

4 years agoFix reply octicon (#11821) (#11822)
John Olheiser [Tue, 9 Jun 2020 17:25:32 +0000 (12:25 -0500)]
Fix reply octicon (#11821) (#11822)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
4 years agoHonor DEFAULT_PAGING_NUM for API (#11805) (#11813)
Cirno the Strongest [Tue, 9 Jun 2020 13:05:21 +0000 (15:05 +0200)]
Honor DEFAULT_PAGING_NUM for API (#11805) (#11813)

* Honor DEFAULT_PAGING_NUM for API

* set pagination to 10 for tests

* lint

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit cefbf73aea912c510a8dd194532233076b822d37)

4 years agoEnsure rejected push to refs/pull/index/head fails nicely (#11724) (#11809)
zeripath [Mon, 8 Jun 2020 19:00:12 +0000 (20:00 +0100)]
Ensure rejected push to refs/pull/index/head fails nicely (#11724) (#11809)

Backport #11724

A pre-receive hook that rejects pushes to refs/pull/index/head
will cause a broken PR which causes an internal server error
whenever it is viewed. This PR handles prevents the internal server
error by handling non-existent pr heads and sends a flash error
informing the creator there was a problem.

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoChangelog v1.12.0-rc2 (#11799) v1.12.0-rc2
6543 [Mon, 8 Jun 2020 06:42:17 +0000 (08:42 +0200)]
Changelog v1.12.0-rc2 (#11799)

* Update

* format

* seperate

* Update CHANGELOG.md

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

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoMake tabular menu styling consistent for arc-green (#11570) (#11798)
Cirno the Strongest [Sun, 7 Jun 2020 22:27:31 +0000 (00:27 +0200)]
Make tabular menu styling consistent for arc-green (#11570) (#11798)

* Make tabular menu styling consistent for arc-green

* rework completely

* transparent borders

* use darker color for active item; override only colors for borders

* Update web_src/less/themes/theme-arc-green.less

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
(cherry picked from commit 4395c607ed79985602a99dda251f090fbd2f5cf9)

4 years agoAdd option to API to update PullRequest base branch (#11666) (#11796)
6543 [Sun, 7 Jun 2020 20:20:53 +0000 (22:20 +0200)]
Add option to API to update PullRequest base branch (#11666) (#11796)

* EditPull: add option to change base

Close #11552

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoIn File Create/Update API return 404 if Branch does not exist (#11791) (#11795)
6543 [Sun, 7 Jun 2020 19:50:19 +0000 (21:50 +0200)]
In File Create/Update API return 404 if Branch does not exist (#11791) (#11795)

* In File Create/Update API return 404 if Branch does not exist (#11791)

* v1.12 version ;)

4 years agoFix doer of rename repo (#11789) (#11794)
赵智超 [Sun, 7 Jun 2020 16:55:50 +0000 (00:55 +0800)]
Fix doer of rename repo (#11789) (#11794)

fix #11725

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoIncrease maximum SQLite variables count to 32766 (#11696) (#11783)
Cirno the Strongest [Sun, 7 Jun 2020 04:04:00 +0000 (06:04 +0200)]
Increase maximum SQLite variables count to 32766 (#11696) (#11783)

* Increase maximum SQLite variables count to 32766 (#11696)

per https://www.sqlite.org/limits.html

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit a5aa5c58c1bf5a0c91226e0cbbd7b95bb8f74692)

* Fix missing CGO_EXTRA_FLAGS build arg for docker

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoInitialize SimpleMDE when making a code comment (#11749) (#11785)
zeripath [Sun, 7 Jun 2020 00:11:51 +0000 (01:11 +0100)]
Initialize SimpleMDE when making a code comment (#11749) (#11785)

Backport #11749

Fix #11704

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-Authored-By: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix to allow comment poster to edit or delete his own comments (#11671) (#11774)
赵智超 [Sat, 6 Jun 2020 21:43:01 +0000 (05:43 +0800)]
Fix to allow comment poster to edit or delete his own comments (#11671) (#11774)

* bug: fix comment update permision check

No the ui only allow poster to update or delet comment, which
is not reasonable and different with handle logic, this pr
change it to allow poster of comment do it

ref code:
https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1636

https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1681

fix #11663

Signed-off-by: a1012112796 <1012112796@qq.com>
* simplify code

* fix sign in

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoFix timezone on issue deadline (#11697) (#11784)
Cirno the Strongest [Sat, 6 Jun 2020 12:44:16 +0000 (14:44 +0200)]
Fix timezone on issue deadline (#11697) (#11784)

* Fix timezone on issue deadline

* FormatDate

Co-authored-by: zeripath <art27@cantab.net>
(cherry picked from commit bbe13b60cdf93d8296f4c6dab624df2b571db234)

4 years agoEuropean Portuguese translation (#11568) (#11778)
Emanuel Angelo [Sat, 6 Jun 2020 09:41:06 +0000 (10:41 +0100)]
European Portuguese translation (#11568) (#11778)

This PR includes the modifications necessary to make use of the European Portuguese translation from the default setting.

Co-authored-by: zeripath <art27@cantab.net>
4 years agoUpdate emoji dataset with skin tone variants (#11678) (#11763)
mrsdizzie [Thu, 4 Jun 2020 18:56:28 +0000 (14:56 -0400)]
Update emoji dataset with skin tone variants (#11678) (#11763)

* Update emoji dataset with skin tone variants

Since the format of emoji that support skin tone modifiers is predictable we can add different variants into our dataset when generating it so that we can match and properly style most skin tone variants of emoji. No real code change here other than what generates the dataset and the data itself.

* use escape unicode sequence in map

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[API] on 500 error only show message if gitea in dev mode (#11641) (#11753)
6543 [Thu, 4 Jun 2020 02:24:47 +0000 (04:24 +0200)]
[API] on 500 error only show message if gitea in dev mode (#11641) (#11753)

* add API specific InternalServerError()

* return 500 error msg only if not Production mode

* rm unnessesary change

4 years agoAdd missing templates (#11729) (#11748)
S7evinK [Wed, 3 Jun 2020 18:23:45 +0000 (20:23 +0200)]
Add missing templates (#11729) (#11748)

Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
4 years agoFix verification of subkeys of default gpg key (#11713) (#11747)
zeripath [Wed, 3 Jun 2020 17:01:32 +0000 (18:01 +0100)]
Fix verification of subkeys of default gpg key (#11713) (#11747)

* Fix verification of subkeys of default gpg key

Fix #10309

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove debug log

* Update models/gpg_key.go

* As per @6543

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoFix styling for commiter on diff view (#11715) (#11744)
Cirno the Strongest [Wed, 3 Jun 2020 08:29:19 +0000 (10:29 +0200)]
Fix styling for commiter on diff view (#11715) (#11744)

* Fix styling for commiter on diff view

* Update options/locale/locale_en-US.ini

* Update templates/repo/commit_page.tmpl

Co-authored-by: silverwind <me@silverwind.io>
* Update templates/repo/commit_page.tmpl

Co-authored-by: silverwind <me@silverwind.io>
* Apply suggestions from code review

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 8e035f81c01ba6c1ccf8952ffad37bef063aad2d)

4 years agoProperly truncate system notices (#11714) (#11742)
zeripath [Tue, 2 Jun 2020 23:44:05 +0000 (00:44 +0100)]
Properly truncate system notices (#11714) (#11742)

Backport #11714

* Properly truncate system notices

As noted in #11658 the system notifications list will always suffix
system notices with ... even when the notice is longer than 120
characters.

Instead we should use .text.truncate to auto truncate and make the
notices clickable to view their details.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* As per @CirnoT make table cell clickable

* ensure that pre wraps

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoChange language statistics to save size instead of percentage (#11681) (#11690)
Lauris BH [Tue, 2 Jun 2020 17:55:21 +0000 (20:55 +0300)]
Change language statistics to save size instead of percentage (#11681) (#11690)

* Change language statistics to save size instead of percentage (#11681)

* Change language statistics to save size instead of percentage in database

Co-Authored-By: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
* Do not exclude if only language

* Fix edge cases with special langauges

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
* Fix language stat calculation (#11692)

* Fix language stat calculation

* Group languages and ignore 0 size files

* remove unneeded code

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
4 years agoHandle expected errors in FileCreate & FileUpdate API (#11643) (#11718)
6543 [Mon, 1 Jun 2020 06:28:52 +0000 (08:28 +0200)]
Handle expected errors in FileCreate & FileUpdate API (#11643) (#11718)

as title

needed for #11641

4 years agoAdd changelog for 1.11.6 (#11695) (#11701)
guillep2k [Sun, 31 May 2020 05:28:42 +0000 (02:28 -0300)]
Add changelog for 1.11.6 (#11695) (#11701)

* Add changelog for 1.11.6

* Update CHANGELOG.md

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

Co-authored-by: techknowlogick <matti@mdranta.net>
* Apply suggestions from @lafriks

* #11459 is bugfix

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoAdd logging to long migrations (#11647) (#11691)
zeripath [Sun, 31 May 2020 01:44:14 +0000 (02:44 +0100)]
Add logging to long migrations (#11647) (#11691)

* Add logging to long migrations

Also fix v136 to not use models

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoFix alignment for commits on dashboard (#11595) (#11680)
mrsdizzie [Sat, 30 May 2020 08:20:02 +0000 (04:20 -0400)]
Fix alignment for commits on dashboard (#11595) (#11680)

Fix alignment issue between commit SHA and commit message

4 years agoUpdate emoji regex (#11584) (#11679)
mrsdizzie [Fri, 29 May 2020 21:12:53 +0000 (17:12 -0400)]
Update emoji regex (#11584) (#11679)

When matching emoji, use a regex built from the data we have instead of something generic using unicode ranges. A generic regex can't tell the difference between two separate emoji next to each other or one emoji that is built out of two separate emoji next to each other.

This means that emoji that are next to each other without space in between will be now accurately spanned individually with proper title etc...

4 years agoFix missing authorization check on pull for public repos of private/limited org ...
Cirno the Strongest [Fri, 29 May 2020 20:00:22 +0000 (22:00 +0200)]
Fix missing authorization check on pull for public repos of private/limited org (#11656) (#11682)

Fixes #11651

(cherry picked from commit 02fa329a7c2190d947cd5e02ea90d2d4406653be)

4 years agoDoctor check & fix db consistency (#11111) (#11676)
6543 [Fri, 29 May 2020 18:00:43 +0000 (20:00 +0200)]
Doctor check & fix db consistency (#11111) (#11676)

needed to fix issue as described in #10280

* rename check-db to check-db-version
* add check-db-consistency:
* find issues without existing repository
* find pulls without existing issues
* find tracked times without existing issues/pulls
* find labels without repository or org reference

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years agoDefault MSSQL port 0 to allow automatic detection by default (#11642) (#11673)
zeripath [Fri, 29 May 2020 13:28:37 +0000 (14:28 +0100)]
Default MSSQL port 0 to allow automatic detection by default (#11642) (#11673)

Backport #11642

Fix #11633

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoExclude generated files from language statistics (#11653) (#11670)
Lauris BH [Fri, 29 May 2020 09:02:00 +0000 (12:02 +0300)]
Exclude generated files from language statistics (#11653) (#11670)

* Update go-enry to v2.5.2

4 years agoUse -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635) (#11662)
zeripath [Thu, 28 May 2020 23:05:16 +0000 (00:05 +0100)]
Use -1 to disable key algorithm type in ssh.minimum_key_sizes (#11635) (#11662)

Backport #11635

Fix #11634

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoHandle expected errors in AddGPGkey API (#11644) (#11661)
6543 [Thu, 28 May 2020 22:16:41 +0000 (00:16 +0200)]
Handle expected errors in AddGPGkey API  (#11644) (#11661)

* handle GPG Parse & Email Errors

* correct TEST

* update Swagger

* more Docu

4 years agoReturn json on 500 error from API (#11574) (#11659)
6543 [Thu, 28 May 2020 18:27:51 +0000 (20:27 +0200)]
Return json on 500 error from API (#11574) (#11659)

Backport #11574

add API specific InternalServerError()

InternalServerError

4 years agoWhen must change password only show Signout (#11600) (#11637)
guillep2k [Wed, 27 May 2020 07:08:14 +0000 (04:08 -0300)]
When must change password only show Signout (#11600) (#11637)

When "Must Change Password" simplify the navbar header to only show the
signout button as all other links will redirect back. This prevents the
notifications icon from showing preventing initialization of the
event-source and hence preventing redirect_to being set, however in
addition do not set the redirect_to cookie if we are looking at the
/user/events page.

Fix #11554

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoBackport various styling fixes (#11619)
Cirno the Strongest [Tue, 26 May 2020 02:33:57 +0000 (04:33 +0200)]
Backport various styling fixes (#11619)

* Fix inconsistent font size for markdown preview on new PR view (#11565)

We use same method for new issue form and issue view, but was missing from new PR view making it one place where markdown preview is inconsistent in font size.

(cherry picked from commit 04afd9d1e2399d61978fdeeab7e7ac8ff9057a93)

* Fix margin on PR form (#11566)

(cherry picked from commit f2a0be1683daf3330a7c94fa65300e7056e9bc98)

* Fix margin for attached top header on code review (#11571)

Introduced naively by #11463

The margin was being applied too widely.

(cherry picked from commit e682a922957ebb1d40843be4da902fe13b15adde)

* Fix styling for PR merge section when no checks (#11609)

Makes styling consistent between two cases. Also removed unnecessary double border.

* Normalize avatar radius

4 years agoFix wrong milestone in webhook message (#11596) (#11611)
Gary Kim [Mon, 25 May 2020 05:01:49 +0000 (13:01 +0800)]
Fix wrong milestone in webhook message (#11596) (#11611)

Backport of #11596

Signed-off-by: Gary Kim <gary@garykim.dev>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoWhen initialising repositories ensure that the user doing the creation is the initial...
zeripath [Mon, 25 May 2020 04:24:49 +0000 (05:24 +0100)]
When initialising repositories ensure that the user doing the creation is the initializer (#11601) (#11608)

Backport #11601

Fix #10760

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoFix serviceworker output file and misc improvements (#11562) (#11610)
silverwind [Sun, 24 May 2020 21:12:02 +0000 (23:12 +0200)]
Fix serviceworker output file and misc improvements (#11562) (#11610)

* Fix serviceworker output file and misc improvements

- Fix output file location for production build
- Cache more asset types: fonts and worker variants
- Parallelize a few tasks during initalization
- Only invalidate caches starting with our prefix
- Remove public/serviceworker.js before building
- Remove font preloads, they cause strange cors issues
- Misc eslint config adjustments

* remove webpack output files on watch-frontend

4 years agoPrevent (caught) panic on login (#11590) (#11597)
zeripath [Sun, 24 May 2020 17:12:25 +0000 (18:12 +0100)]
Prevent (caught) panic on login (#11590) (#11597)

Backport #11590

Unfortunately when the virtual session is released it requires that the
real session does not exist. This worked fine when sessions were only
saved at the end of request/response cycle however, now sessions are
saved proactively this does not hold.

The result is a caught panic in the logs during every log-in.  This
panic has no significant side-effects but should not occur.

This PR marks the virtual session as released when released and updates
it if the same session is released again.

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoPrevent empty query parameter being set on dashboard (#11561) (#11604)
zeripath [Sun, 24 May 2020 14:20:09 +0000 (15:20 +0100)]
Prevent empty query parameter being set on dashboard (#11561) (#11604)

Prevent the dashboard from setting an empty query parameter

Fix #11543

Signed-off-by: Andrew Thornton art27@cantab.net
4 years agoFix images in wiki edit preview (#11546) (#11602)
mrsdizzie [Sun, 24 May 2020 13:01:10 +0000 (09:01 -0400)]
Fix images in wiki edit preview (#11546) (#11602)

Make sure wiki editor sets wiki to true so gitea renders it as a wiki page.

Also change the context data attr for edit form. This looks wrong but everywhere else in our code assumes the urlPrefix to be just the repo url when rendering and manually adds /wiki to the rendered url regardless.

Fixes #11540

4 years agoAllow different HardBreaks settings for documents and comments (#11515) (#11599)
zeripath [Sun, 24 May 2020 10:45:56 +0000 (11:45 +0100)]
Allow different HardBreaks settings for documents and comments (#11515) (#11599)

GH has different HardBreaks behaviour for markdown comments and documents.

Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting.

Here we split the setting in to two - one for documents and one for comments and other things.

Signed-off-by: Andrew Thornton art27@cantab.net
Changes to index.js as per @silverwind
Co-authored-by: silverwind <me@silverwind.io>
Changes to docs as per @guillep2k
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoEnforce transparent background on editor toolbar elements (#11569) (#11583)
Cirno the Strongest [Sat, 23 May 2020 23:36:24 +0000 (01:36 +0200)]
Enforce transparent background on editor toolbar elements (#11569) (#11583)

Co-authored-by: Lauris BH <lauris@nix.lv>
(cherry picked from commit 38c773d8a5d6168ebb3030513a6063381976bd22)

Co-authored-by: zeripath <art27@cantab.net>
4 years agoEnsure serviceworker is created as /serviceworker.js (#11577) (#11582)
zeripath [Sat, 23 May 2020 20:41:33 +0000 (21:41 +0100)]
Ensure serviceworker is created as /serviceworker.js (#11577) (#11582)

#11538 moved the serviceworker to webbox but unfortunately
created the serviceworker in public/js rather than public/

This PR fixes this, fixing multiple issues with broken js
as a result of that change.

Signed-off-by: Andrew Thornton art27@cantab.net
4 years agoPrevent transferring repos to invisible orgs (#11517) (#11549)
guillep2k [Sat, 23 May 2020 02:12:20 +0000 (23:12 -0300)]
Prevent transferring repos to invisible orgs (#11517) (#11549)

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoFix webpack chunk loading with STATIC_URL_PREFIX (#11526) (#11542)
silverwind [Fri, 22 May 2020 19:18:44 +0000 (21:18 +0200)]
Fix webpack chunk loading with STATIC_URL_PREFIX (#11526) (#11542)

Previously, we had only set __webpack_public_path__ to a path which
caused webpack chunks to be loaded from the current origin which is
incorrect when STATIC_URL_PREFIX points to another origin.

This should fix the issue curretnly seen on gitea.com.

4 years agoClose EventSource before unloading the page (#11539) (#11557)
silverwind [Fri, 22 May 2020 18:30:30 +0000 (20:30 +0200)]
Close EventSource before unloading the page (#11539) (#11557)

Should eliminate a error in the Firefox console regarding the connection
being interrupted while the page was loading.

4 years agoFix the bug that the emoji don't disappear(#11489) (#11530)
L0veSunshine [Fri, 22 May 2020 16:36:25 +0000 (00:36 +0800)]
Fix the bug that the emoji don't disappear(#11489) (#11530)

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoMove serviceworker to workbox and fix SSE interference (#11538) (#11547)
silverwind [Fri, 22 May 2020 15:46:39 +0000 (17:46 +0200)]
Move serviceworker to workbox and fix SSE interference (#11538) (#11547)

* Move serviceworker to workbox and fix SSE interference

Instead of statically hardcoding every frontend asset, this uses a
type-based approach to cache all js,css and manifest.json requests.

This also fixes the issue that the service worker was interfering with
EventSource because it was unconditionally handling all requests which
this new implementation doesn't.

Fixes: https://github.com/go-gitea/gitea/issues/11092
Fixes: https://github.com/go-gitea/gitea/issues/7372
* rethrow error instead of logging

* await .register

* Revert "rethrow error instead of logging"

This reverts commit 043162ba1f18b98a4bf9635959fd28d16e839fc5.

* improve comment

* remove JSRenderer

* add version-based cache invalidation

* refactor

* more refactor

* remove comment

* rename item to fit cache name

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
4 years agoEnsure emoji render with regular font-weight (#11541) (#11545)
silverwind [Fri, 22 May 2020 10:57:13 +0000 (12:57 +0200)]
Ensure emoji render with regular font-weight (#11541) (#11545)

Emoji characters don't support bold attributes and may do weird things
like rendering monochrome when bolded.