summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [skip ci] Updated translations via CrowdinGiteaBot2021-02-1919-19/+19
|
* Move the stopwatches to the eventsource stream (#14588)zeripath2021-02-193-1/+89
| | | | | | | | | Move the stopwatches to the eventsource stream Use the /user/events eventsource to update the stopwatches instead of polling /api/v1/user/stopwatches if the eventsource is enabled. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix misleading word on delete repositories' archives (#14737)Lunny Xiao2021-02-191-1/+1
|
* [skip ci] Updated translations via CrowdinGiteaBot2021-02-191-0/+2
|
* Fix when a commit not found returned 500 (#14732)Lunny Xiao2021-02-181-0/+6
| | | Co-authored-by: Lauris BH <lauris@nix.lv>
* models/repo: Fix typo in comment (#14731)Jacob Hrbek2021-02-181-2/+2
| | | | | | | * models/repo: Fix typo in comment * another typo Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-02-181-0/+2
|
* routers/routes/web: Fix typo in comment (#14729)Jacob Hrbek2021-02-181-1/+1
|
* Issue template addition: Are you using Gitea behind CloudFlare? (#14098)wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf2021-02-181-0/+3
| | | | | | | | | | | | | | | | | | | | * chore: are you using Gitea behind CloudFlare since more often than not CF appears to serve stale cache and cause troubles, I'd argue it might be helpful to ask about it in this here issue template * implement suggestion: change question to comment * as per @techknowlogick's suggestion * chore: edit comment * implement @mrsdizzie's suggestion * as the comment grows, rather span multiple lines * Gitea --> gitea to match case used in the rest of the template Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [API] Add Restricted Field to User (#14630)65432021-02-186-6/+36
| | | | | | | | | | | | * Expose Restricted field for User * Add Option to Change Restricted on User via adminEditUser API * Add test who change restricted & test if it changed it ... * make generate-swagger Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* remove outdated notice in makefile (#14720)techknowlogick2021-02-171-1/+0
| | | Co-authored-by: 6543 <6543@obermui.de>
* #14699 Make branch names in PR description clickable (#14716)Jimmy Praet2021-02-183-6/+41
|
* Remove NULs byte arrays passed to PostProcess (#14587)zeripath2021-02-181-1/+23
| | | | | | | | | | | | PostProcess is supposed to be parsing and handling HTML fragments, but on fuzzing it appears that there is a weird issue with NUL elements that could cause a memory address error in downstream libraries. The simplest solution is to strip out the weird NULs - they should not be there in any case and would be stripped out anyway. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix github download on migration (#14703)Lunny Xiao2021-02-181-4/+19
| | | | | | | * Fix github download on migration * Use Context for Client Co-authored-by: zeripath <art27@cantab.net>
* Reduce calls to git cat-file -s (#14682)zeripath2021-02-179-28/+141
| | | | | | | | | | | | | * Reduce calls to git cat-file -s There are multiple places where there are repeated calls to git cat-file -s due to the blobs not being created with their size. Through judicious use of git ls-tree -l and slight adjustments to the indexer code we can avoid a lot of these calls. * simplify by always expecting the long format * Also always set the sized field and tell the indexer the update is sized
* Use cat-file --batch in GetLanguageStats (#14685)zeripath2021-02-171-30/+100
| | | | | | | | | | | | | | | | | | | | | | * Use cat-file --batch in GetLanguageStats This PR moves to using a single cat-file --batch in GetLanguageStats significantly reducing the number of processes spawned during language stat processing. Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint Signed-off-by: Andrew Thornton <art27@cantab.net> * Update modules/git/repo_language_stats_nogogit.go Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Vendor Update (#14696)65432021-02-16137-1310/+3346
| | | | | | | | | | | | | * github.com/yuin/goldmark v1.3.1 -> v1.3.2 * github.com/xanzy/go-gitlab v0.42.0 -> v0.44.0 * github.com/prometheus/client_golang v1.8.0 -> v1.9.0 * github.com/minio/minio-go v7.0.7 -> v7.0.9 * github.com/lafriks/xormstore v1.3.2 -> v1.4.0 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-02-161-0/+5
|
* Add Password Algorithm option to install page (#14701)zeripath2021-02-165-1/+36
| | | | | | | Add Password Algorithm option to install page Fix #14674 Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Restore detection of branches are equal on compare page (#14586)zeripath2021-02-162-27/+18
| | | | | | | | Somehow the test for detecting if branches are equal broke this PR restores this functionality. Fix #14502 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated translations via CrowdinGiteaBot2021-02-161-0/+2
|
* Add fullTextSearch to dropdowns by default (#14694)zeripath2021-02-162-4/+11
| | | | | | | | | | | | | | | This PR adds `fullTextSearch: 'exact'` to most dropdown invocations meaning that if there is a search box for the dropdown it will automatically do a fullTextSearch looking for the provided fragment instead of starting at the beginning We should consider changing other places that use `fullTextSearch: true` to `'exact'` because these will be using a fuzzy-textual search that doesn't necessarily return the expected results. Fix #14689 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Create DB session provider(based on xorm) (#13031)zeripath2021-02-158-2/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Create Xorm session provider This PR creates a Xorm session provider which creates the appropriate Session table for macaron/session. Fix #7137 Signed-off-by: Andrew Thornton <art27@cantab.net> * extraneous l Signed-off-by: Andrew Thornton <art27@cantab.net> * fix lint Signed-off-by: Andrew Thornton <art27@cantab.net> * use key instead of ID to be compatible with go-macaron/session Signed-off-by: Andrew Thornton <art27@cantab.net> * And change the migration too. Signed-off-by: Andrew Thornton <art27@cantab.net> * Update spacing of imports Co-authored-by: 6543 <6543@obermui.de> * Update modules/session/xorm.go Co-authored-by: techknowlogick <matti@mdranta.net> * add xorm provider to the virtual provider Signed-off-by: Andrew Thornton <art27@cantab.net> * prep for master merge * prep for merge master * As per @lunny * move migration out of the way * Move to call this db session as per @lunny Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Allow blocking some email domains from registering an account (#14667)Damien Goutte-Gattat2021-02-157-22/+61
| | | | | | | | | Gitea allows to whitelist email domains so that only email addresses from certain domains are allowed to register an account, but does not currently allows to do the opposite: blacklisting email domains so that addresses from certain domains are *forbidden* to register an account. The idea has been briefly mentioned in the discussion about issue #6350, but never implemented. This PR does that. The rationale is that, in my experience of running a Gitea instance, *a single email domain* is responsible for *most* of the spam accounts, and for *all* of the spam accounts that manage to get past the email confirmation step. So on top of the other spam mitigation measures already available (email confirmation, CAPTCHA, etc.), having the option to block a particularly annoying domain would be helpful. close #13628
* Fix svg spacing (#14638)Kyle D2021-02-142-1/+10
| | | | | * Add right margin to icons in menu items * Reduce padding on user profile submenu to fit in one line by default (english)
* [skip ci] Updated translations via CrowdinGiteaBot2021-02-141-4/+11
|
* Fix broken spans in diffs (#14678)zeripath2021-02-142-6/+228
| | | | | | | | | | | | | | | | | | | | | Gitea runs diff on highlighted code fragment for each line in order to provide code highlight diffs. Unfortunately this diff algorithm is not aware that span tags and entities are atomic and cannot be split. The current fixup code makes some attempt to fix these broken tags however, it cannot handle situations where a tag is split over multiple blocks. This PR provides a more algorithmic fixup mechanism whereby spans and entities are completely coalesced into their respective blocks. This may result in a incompletely reduced diff but - it will definitely prevent the broken entities and spans that are currently possible. As a result of this fixup several inconsistencies were discovered in our testcases and these were also fixed. Fix #14231 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated licenses and gitignoresGiteaBot2021-02-143-2/+25
|
* Prevent template renderer from rendering error (#14646)zeripath2021-02-131-6/+7
| | | | | | | | | | | When there is a panic during template rendering unrolled/render will automatically render the error. This leads to the panic being displayed in the page and not a 500 page Fix #14467 Fix #14525 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent race in PersistableChannelUniqueQueue.Has (#14651)zeripath2021-02-131-0/+5
| | | | | | | | | | | There is potentially a race with a slow starting internal queue causing a NPE if Has is checked before the internal queue has been setup. This PR adds a lock on the Has() fn. Fix #14311 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Turn default hash password algorightm back to pbkdf2 from argon2 until we ↵Lunny Xiao2021-02-133-3/+3
| | | | | | | found a better one (#14673) * Turn default hash password algorightm back to pbkdf2 from argon2 until we found a better one * Add a warning on document
* [skip ci] Updated translations via CrowdinGiteaBot2021-02-131-0/+7
|
* rm gogs relict (#14665)65432021-02-141-6/+0
|
* Whitespace in commits (#14650)vnkmpf2021-02-136-32/+41
| | | | | | | | | * Add whitespace to commit view * Add whitespace to /compare/a...b * Move repeated whitespaceFlags to gitdiff * Add whitespace for wiki pages
* Show Gitea version in swagger (#14654)techknowlogick2021-02-122-2/+2
| | | | | Show Gitea version in swagger Co-authored-by: 6543 <6543@obermui.de>
* Add v171 (addSortingColToProjectBoard) migration for #14634 (#14652)65432021-02-123-1/+25
| | | | | | | * add v171 Migration for #14634 * NOT NULL Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix truncated organization names (#14655)vnkmpf2021-02-1212-65/+71
| | | | | | | * Fix truncated organization names Previous ellipsis implementation hid vertical overflow - image + descent line of letters. Organization visibility in select on dashboard was not always visible. This commit extracts classes which don't make collisions with other items on page.
* Fix PATCH /repos/{owner}/{repo} panic (#14637)Anton Khimich2021-02-111-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix a runtime error when modifying a repository through API call Using the `PATCH /repos/{owner}/{repo}` endpoint and attempting to modify `default_branch` on an empty repository will cause a panic. This commit adds a check for a nil pointer before attempting to dereference it. * Apply suggestions from code review * Apply suggestions from code review * Ensure that the git repository is loaded If you change the default branch for a repository you must change it in git too. Therefore you must open the repository before changing the default branch. Signed-off-by: Andrew Thornton <art27@cantab.net> * Allow empty repos to have their default branches changed Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Anton Khimich <anton.khimicha@mail.utoronto.ca> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Make fileheader sticky in diffs (#14616)vnkmpf2021-02-114-2/+56
| | | | | | | | | | | | | | | | | | | | | * Make fileheader sticky #12552 * Remove sticky filenames when width is 480px or less On mobile phone sticky filename is hidden due to the combination of many possible widths and lengths. * Fix text color for .markdown-info * Fix visual of sticky diff box on 480px or less - Hide arrow for select buttons. - Fix changes, additions and deletions. With flexbox they look very broken. This commit hides some words to, so the result is: "123 changed files 987 additions 456 deletions" - center text in buttons Co-authored-by: zeripath <art27@cantab.net>
* Added option to disable webhooks (#13176)Paweł Bogusławski2021-02-1112-25/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Added option to disable web hooks This mod introduces DISABLE_WEB_HOOKS parameter in [security] section of app.ini (by default set to false). If set to true it disables web hooks feature. Any existing undelivered web hook tasks will be cancelled. Any existing web hook definitions will be left untouched in db but its delivery tasks will be ignored. Author-Change-Id: IB#1105130 * Webhook spelling fixed Webhook spelling fixed. Fixes: 07df6614dc84cdd2e9f39c57577fa1062bd70012 Related: https://github.com/go-gitea/gitea/pull/13176#pullrequestreview-510868421 Author-Change-Id: IB#1105174 * Parameter description fixed Parameter description fixed. Fixes: 07df6614dc84cdd2e9f39c57577fa1062bd70012 Related: https://github.com/go-gitea/gitea/pull/13176#pullrequestreview-514086107 Author-Change-Id: IB#1105174
* Add dismiss review feature (#12674)a10121127962021-02-1136-39/+593
| | | | | | | | | | | | | | | * Add dismiss review feature refs: https://github.blog/2016-10-12-dismissing-reviews-on-pull-requests/ https://developer.github.com/v3/pulls/reviews/#dismiss-a-review-for-a-pull-request * change modal ui and error message * Add unDismissReview api Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Sort / Move project boards (#14634)Romain2021-02-116-16/+73
| | | Sort Project board (#14533)
* [Vendor] Update go-redis to v8.5.0 (#13749)65432021-02-10139-4958/+16110
| | | | | | | | | | | | | | | | | | | | | * Update go-redis to v8.4.0 * github.com/go-redis/redis/v8 v8.4.0 -> v8.5.0 * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> * TODO * Use the Queue termination channel as the default context for pushes Signed-off-by: Andrew Thornton <art27@cantab.net> * missed one Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Allow org labels to be set with issue templates (#14593)zeripath2021-02-101-1/+8
| | | | | | Fix #13688 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Do not assume all 40 char strings are SHA1s (#14624)zeripath2021-02-101-11/+15
| | | | | | | | | | GetCommit() assumes that all 40 char strings are SHA1s. This leads to an error if you try to do a PR on a branch which is 40 characters long. This PR attempts the SHA first - and if it fails will switch to using rev-parse. Fix #14470 Signed-off-by: Andrew Thornton <art27@cantab.net>
* HasPreviousCommit causes recursive load of commits unnecessarily (#14598)zeripath2021-02-102-13/+50
| | | | | | | | This PR improves HasPreviousCommit to prevent the automatic and recursive loading of previous commits using git merge-base --is-ancestor and git rev-list Fix #13684 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Improve the comment on comment type (#14609)Lunny Xiao2021-02-101-32/+32
|
* Prevent adding nil label to .AddedLabels or .RemovedLabels (#14623)zeripath2021-02-104-5/+39
| | | | | | | | | | | | | | | | | | * Prevent adding nil label to .AddedLabels or .RemovedLabels There are possibly a few old databases out there with malmigrated data that can cause panics with empty labels being migrated. This PR adds a few tests to prevent nil labels being added. Fix #14466 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add doctor command to remove the broken label comments Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Ensure memcache TTL cannot be over 30 days (#14592)zeripath2021-02-097-10/+29
| | | | | | | | | | Memcached TTL cannot be > 30 days and if it is attempted the TTL is interpreted as a unix timestamp. This PR ensures that the TTL is switched to a unix timestamp in those cases. Fix #14571 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Truncated organisations name #14583 (#14615)vnkmpf2021-02-0911-28/+39
| | | | | - truncate to max length 40 - add CSS ellipsis