Commit Graph

9611 Commits

Author SHA1 Message Date
zeripath
f984a7e6c6
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>
2020-07-05 12:09:13 -04:00
Andreas Shimokawa
c96da610c2
templates/repo/empty.tmpl : fix repo setup instructions (#12147)
Co-authored-by: codeberg <codeberg@codeberg.org>
Co-authored-by: zeripath <art27@cantab.net>
2020-07-05 15:56:10 +03:00
zeripath
e46dbec294
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>
2020-07-05 01:08:03 +03:00
赵智超
8f64017058
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>
2020-07-03 00:49:55 -04:00
zeripath
d737eaa63a
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>
2020-07-02 20:26:47 +08:00
zeripath
058ee52333
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>
2020-07-02 11:46:06 +01:00
Lauris BH
47b1fc5149
Fix merge section in dark theme (#12086) (#12109)
Backport #12086

* Fix merge section in dark theme

* Fix lint
2020-07-02 10:36:45 +01:00
zeripath
20c2bdf86b
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>
2020-07-01 18:43:25 +03:00
Stefan Bethke
df13fc8818
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>
2020-06-28 21:14:22 +03:00
Cornel
445992d929
Fix comments webhook panic backport (#12058)
* Handle HookIssueReviewed action in webhook

* Fix webhook comment handling type cast panic
2020-06-25 21:19:11 -04:00
silverwind
d059156c3a
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>
2020-06-24 10:24:27 -04:00
Lauris BH
12f51ec7dd
Changelog for v1.12.1 (#12006) 2020-06-22 01:12:42 +03:00
zeripath
82b843a5ab
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>
2020-06-21 16:08:25 +01:00
silverwind
dcbbf37082
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.
2020-06-20 15:23:04 +01:00
Lauris BH
3e8618a543
For language detection do not try to analyze big files by content (#11971) (#11975) 2020-06-19 13:10:03 +03:00
Cirno the Strongest
3a2679db2e
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 1fb783efb0)
2020-06-18 20:25:58 -04:00
6543
6839010bd6
Changelog v1.12.0 (#11927)
* merge RC-logs

* Update

* Update CHANGELOG.md

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-18 11:54:33 -04:00
6543
80da796025
Changelog v1.11.7 (#11953) (#11955)
* Changelog v1.11.7

* Update CHANGELOG.md
2020-06-18 11:44:35 -04:00
6543
113c99512b
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>
2020-06-18 18:22:43 +03:00
Lunny Xiao
82343f4943
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>
2020-06-18 10:06:48 -04:00
Cirno the Strongest
d534007bc4
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 6c38f371ea)
2020-06-18 17:32:36 +08:00
6543
6466053b4d
[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>
2020-06-18 09:05:30 +08:00
techknowlogick
7dc8db9ea8
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>
2020-06-17 19:32:06 -04:00
6543
ecad970a26
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>
2020-06-17 20:53:43 +01:00
6543
47a5c8e1f7
Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) (#11915)
* Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912)

* CI.restart()
2020-06-16 15:56:47 -04:00
zeripath
6abb8d751c
Invalidate comments when file is shortened (#11882) (#11884)
Backport #11882

Fix #10686

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-06-15 13:26:30 -04:00
Cirno the Strongest
fdc6287973
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 0159851cc3)
2020-06-13 18:35:13 +01:00
zeripath
320031fce6
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>
2020-06-12 14:01:44 -04:00
Cirno the Strongest
ef2f18964e
Fix search form button overlap (#11840) (#11864)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 8770bceafa)
2020-06-12 13:23:13 +01:00
zeripath
f2bde40804
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>
2020-06-11 17:08:13 -04:00
zeripath
6b1e5f7f88
Prevent panic on empty HOST for mysql (#11850) (#11856)
Backport #11850

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-06-11 14:27:59 -04:00
Cirno the Strongest
56660c3fd0
Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) (#11836)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 2b2b3e4c37)
2020-06-10 13:42:10 -04:00
John Olheiser
87a82138c6
Fix reply octicon (#11821) (#11822)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-06-09 12:25:32 -05:00
Cirno the Strongest
d06f98d9a2
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 cefbf73aea)
2020-06-09 16:05:21 +03:00
zeripath
c52f81eecc
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>
2020-06-08 20:00:12 +01:00
6543
9749c35656
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>
2020-06-08 09:42:17 +03:00
Cirno the Strongest
fc15e59475
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 4395c607ed)
2020-06-07 18:27:31 -04:00
6543
78f0b5b92b
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>
2020-06-07 23:20:53 +03:00
6543
20951c5c21
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 ;)
2020-06-07 22:50:19 +03:00
赵智超
99f7ec8f45
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>
2020-06-07 19:55:50 +03:00
Cirno the Strongest
a076cb2a4c
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 a5aa5c58c1)

* Fix missing CGO_EXTRA_FLAGS build arg for docker

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-06-07 00:04:00 -04:00
zeripath
530ae650f3
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>
2020-06-06 20:11:51 -04:00
赵智超
821570c0b0
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:
e8955173a9/routers/repo/issue.go (L1636)

e8955173a9/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>
2020-06-06 17:43:01 -04:00
Cirno the Strongest
287e2c781b
Fix timezone on issue deadline (#11697) (#11784)
* Fix timezone on issue deadline

* FormatDate

Co-authored-by: zeripath <art27@cantab.net>
(cherry picked from commit bbe13b60cd)
2020-06-06 13:44:16 +01:00
Emanuel Angelo
921a5c0b62
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>
2020-06-06 10:41:06 +01:00
mrsdizzie
0ad4083cba
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>
2020-06-04 15:56:28 -03:00
6543
99058de553
[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
2020-06-03 22:24:47 -04:00
S7evinK
fb155b8fa3
Add missing templates (#11729) (#11748)
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
2020-06-03 19:23:45 +01:00
zeripath
7dd9506d06
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>
2020-06-03 18:01:32 +01:00
Cirno the Strongest
f428d40822
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 8e035f81c0)
2020-06-03 09:29:19 +01:00