summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Changelog v1.12.3 (#12356)v1.12.365432020-07-281-0/+11
| | | | | | | * Changelog v1.12.3 * better description for 12351 * @techknowlogick suggestions
* Backport to v1.12 for #12341 - Release date fix (#12351)Richard Mahn2020-07-282-1/+152
| | | | | | | | | * Backport for Issue #12341 PR #12343 - Release date fix * Adds sleep for comparing times * Fixes imports * Fixes tests
* Show 404 page when release not found (#12328) (#12332)techknowlogick2020-07-271-0/+4
| | | | | | | | 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>
* Backport emoji fixes to 1.12 (#12327)silverwind2020-07-254-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix double-indirection bug in logging IDs (#12294) (#12308)techknowlogick2020-07-241-1/+1
| | | | | | | | 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>
* [ui] Link to pr list page on sidebar when view pr (#12256) (#12263)techknowlogick2020-07-161-3/+3
| | | | | | | Fix #12254 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: 赵智超 <1012112796@qq.com>
* Extend Notifications API and return pinned notifications by default (#12164) ↵zeripath2020-07-137-24/+206
| | | | | | | | | | | | | (#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
* Changelog for v1.12.2 (#12214)v1.12.2Lauris BH2020-07-111-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Decrease the num_stars when deleting a repo (#11954) (#12188)赵智超2020-07-083-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix regression: Gitea commits API again returns commit summaries, not full ↵techknowlogick2020-07-081-1/+1
| | | | | | | messages (#12186) (#12187) Closes #12185 Co-authored-by: Kristian Antonsen <kristian@derfor.dk>
* properly set symbolic-ref HEAD when a repo is created with a non-master ↵techknowlogick2020-07-081-0/+7
| | | | | | | 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>
* Trim to 255 runes instead of bytes (#12150)Jürgen Hötzel2020-07-071-4/+5
| | | | | | | | | | | | | | * 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>
* Ensure Subkeys are verified (#12155) (#12168)zeripath2020-07-061-1/+41
| | | | | | | | | | | | | | | | | 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>
* Use hash of repo path, ref and entrypath as cache key (#12151) (#12161)Lauris BH2020-07-061-2/+8
|
* Multiple small admin dashboard fixes (#12153) (#12156)zeripath2020-07-055-10/+16
| | | | | | | | * 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>
* Remove spurious logging (#12139) (#12148)zeripath2020-07-051-3/+0
| | | | | | | | | | | | 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>
* templates/repo/empty.tmpl : fix repo setup instructions (#12147)Andreas Shimokawa2020-07-051-1/+1
| | | | Co-authored-by: codeberg <codeberg@codeberg.org> Co-authored-by: zeripath <art27@cantab.net>
* Move EventSource to SharedWorker (#12095) (#12130)zeripath2020-07-059-37/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix ui bug in wiki commit page (#12089) (#12125)赵智超2020-07-031-2/+9
| | | | | | | | | | | | | | | * 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>
* Set the base url when migrating from Gitlab using access token or username ↵zeripath2020-07-021-1/+1
| | | | | | | | | | | | 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>
* Fix gitgraph branch continues after merge (#12044) (#12105)zeripath2020-07-021-0/+7
| | | | | | | | | | | | | | | | | | | 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>
* Fix merge section in dark theme (#12086) (#12109)Lauris BH2020-07-021-26/+29
| | | | | | | Backport #12086 * Fix merge section in dark theme * Fix lint
* Ensure BlameReaders close at end of request (#12102) (#12103)zeripath2020-07-013-8/+19
| | | | | | | | | | | | | | | | | | | | | 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>
* Disable go module when downloading global binaries (#12030) (#12084)Stefan Bethke2020-06-281-6/+6
| | | | | | | | | | | | | 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>
* Fix comments webhook panic backport (#12058)Cornel2020-06-258-9/+39
| | | | | * Handle HookIssueReviewed action in webhook * Fix webhook comment handling type cast panic
* Disable dropzone's timeout (#12024) (#12032)silverwind2020-06-241-0/+2
| | | | | | | | | | | | | | 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>
* Changelog for v1.12.1 (#12006)v1.12.1Lauris BH2020-06-221-0/+14
|
* Handle multiple merges in gitgraph.js (#11996) (#12000)zeripath2020-06-212-40/+39
| | | | | | | | | | | | 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>
* Add serviceworker.js to KnownPublicEntries (#11992) (#11994)silverwind2020-06-202-10/+8
| | | | | 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.
* For language detection do not try to analyze big files by content (#11971) ↵Lauris BH2020-06-191-3/+7
| | | | (#11975)
* Fix scrollable header on dropdowns (#11893) (#11965)Cirno the Strongest2020-06-181-1/+1
| | | | | | 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)
* Changelog v1.12.0 (#11927)v1.12.065432020-06-181-55/+66
| | | | | | | | | * merge RC-logs * Update * Update CHANGELOG.md Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Changelog v1.11.7 (#11953) (#11955)65432020-06-181-0/+9
| | | | | * Changelog v1.11.7 * Update CHANGELOG.md
* Fix commenting on non-utf8 encoded files (#11916) (#11950)65432020-06-186-4/+41
| | | | | | | | | | | * 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>
* Use google/uuid to instead satori/go.uuid (#11943) (#11946)Lunny Xiao2020-06-1838-817/+967
| | | | | | Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net>
* Align show/hide outdated button on code review block (#11932) (#11944)Cirno the Strongest2020-06-181-0/+6
| | | | | Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io> (cherry picked from commit 6c38f371ea3ed98a2ed0534261f5d175c11c628d)
* [Backport] Update to go-git v5.1.0 (#11936) (#11941)65432020-06-1876-555/+3133
| | | | | | | * update go-git 5.0.0 -> v5.1.0 * vendor Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Global default branch setting (#11918) (#11937)techknowlogick2020-06-177-3/+11
| | | | | | | | | | | | | | | * 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>
* Use ID or Where to instead directly use Get when load object from database ↵65432020-06-179-28/+25
| | | | | | | | | | (#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>
* Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) ↵65432020-06-161-1/+10
| | | | | | | (#11915) * Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) * CI.restart()
* Invalidate comments when file is shortened (#11882) (#11884)zeripath2020-06-151-1/+4
| | | | | | | Backport #11882 Fix #10686 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Rework api/user/repos for pagination (#11827) (#11877)Cirno the Strongest2020-06-133-29/+48
| | | | | | | | | | | | | | | * 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)
* Handle more pathological branch and tag names (#11843) (#11863)zeripath2020-06-127-87/+41
| | | | | | | | | | | | | | | | 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>
* Fix search form button overlap (#11840) (#11864)Cirno the Strongest2020-06-122-10/+6
| | | | Co-authored-by: techknowlogick <techknowlogick@gitea.io> (cherry picked from commit 8770bceafa3844a97f35d3f8a35089438bf2f33b)
* Add doctor check to set IsArchived false if it is null (partial backport ↵zeripath2020-06-112-0/+28
| | | | | | | | | | | | | #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>
* Prevent panic on empty HOST for mysql (#11850) (#11856)zeripath2020-06-111-1/+1
| | | | | Backport #11850 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831) ↵Cirno the Strongest2020-06-101-1/+4
| | | | | | (#11836) Co-authored-by: techknowlogick <techknowlogick@gitea.io> (cherry picked from commit 2b2b3e4c3726ef224e87bb444340bebd3a70badb)
* Fix reply octicon (#11821) (#11822)John Olheiser2020-06-092-2/+2
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Honor DEFAULT_PAGING_NUM for API (#11805) (#11813)Cirno the Strongest2020-06-095-15/+16
| | | | | | | | | | | * 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)
* Ensure rejected push to refs/pull/index/head fails nicely (#11724) (#11809)zeripath2020-06-082-5/+37
| | | | | | | | | | | 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>