summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix heatmap test (#17381)Lunny Xiao2021-10-211-0/+6
|
* [skip ci] Updated translations via CrowdinGiteaBot2021-10-213-0/+33
|
* Ensure correct SSH permissions check for private and restricted users (#17370)zeripath2021-10-201-2/+7
| | | | | | | | | | | | Repositories owned by private users and organisations and pulls by restricted users need to have permissions checked. Previously Serv would simply assumed that if the user could log in and the repository was not private then it would be visible. Fix #17364 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Upgrade Bluemonday to v1.0.16 (#17372)zeripath2021-10-2014-24/+103
| | | | | | | Upgrade Bluemonday to latest version Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Offer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH (#17281)zeripath2021-10-201-0/+56
| | | | | | | | | | | | | | | | | | * Offer rsa-sha2-512 and rsa-sha2-256 algorithms in internal SSH There is a subtle bug in the SSH library x/crypto/ssh which makes the incorrect assumption that the public key type is the same as the signature algorithm type. This means that only ssh-rsa signatures are offered by default. This PR adds a workaround around this problem. Fix #17175 Signed-off-by: Andrew Thornton <art27@cantab.net> * as per review Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent NPE in CSV diff rendering when column removed (#17018)Richard Mahn2021-10-207-136/+351
| | | | | | | | | | | | | | | | Fixes #16837 if a column is deleted. We were clobbering the columns that were added by looping through the aline (base) and then when bline (head) was looped through, it clobbered what was in the "cells" array that is show in the diff, and then left a nil cell because nothing was shifted. This fix properly shifts the cells, and properly puts the b cell either at its location or after, according to what the aline placed in the cells. This includes test, adding a new test function since adding/removing cells works best with three columns, not two, which results in 4 columns of the resulting cells because it has a deleted column and an added column. If you try this locally, you can try those cases and others, such as adding a column. There was no need to do anything special for the rows when `aline == 0 || bline == 0` so that was removed. This allows the same code to be used for removed or added lines, with the bcell text always being the RightCell, acell text being the LeftCell. I still added the patch zeripath gave at https://github.com/go-gitea/gitea/issues/16837#issuecomment-913007382 so that just in case for some reason a cell is nil (which shouldn't happen now) it doesn't throw a 500 error, so the user can at least view the raw diff. Also fixes in the [view.go](https://github.com/go-gitea/gitea/pull/17018/files#diff-43a7f4747c7ba8bff888c9be11affaafd595fd55d27f3333840eb19df9fad393L521) file how if a CSV file is empty (either created empty or if you edit it and remove all contents) it throws a huge 500 error when you then save it (when you view the file). Since we allow creating, saving and pushing empty files, we shouldn't throw an error on an empty CSV file, but just show its empty contents. This doesn't happen if it is a Markdown file or other type of file that is empty. EDIT: Now handled in the markup/csv renderer code
* Use a variable but a function for IsProd because of a slight performance ↵Lunny Xiao2021-10-2012-22/+19
| | | | increment (#17368)
* "Copy branch name" button in pull request (#17323)Mario Lubenka2021-10-195-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | * Drop data-original from clipboard data-original attribute was removed. Instead, the original value from data-content is set after success/fail message was displayed. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * "Copy branch name" button in pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update templates/repo/issue/view_title.tmpl Co-authored-by: silverwind <me@silverwind.io> * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net>
* Rename .air.conf to .air.toml (#17360)silverwind2021-10-202-1/+1
| | | | As of https://github.com/cosmtrek/air/pull/90, the preferred file extension is .toml. The file format was always toml itself.
* Re-allow clipboard copy on non-https sites (#17118)Netduma Luke M2021-10-191-1/+32
| | | | * Re-allow clipboard copy on non-https sites * fallback clipboard functions
* Update JS dependencies (#17357)silverwind2021-10-1913-11482/+4391
| | | | | | | | | | | | | * Update JS dependencies - Upgrade to eslint 8 and add new plugin rules - Adapt to various API changes - Rebuild SVGs * fix webpack warning on license * order options alphabetically Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix dashboard repolist alignment and repolisting (#17355)zeripath2021-10-194-1/+16
| | | | | | | | | | | | | | Unfortunately #17301 broke the restriction of the dashboard repolist to the user's repos because it stopped passing in the uid for the current user. This PR restores this. There is also a weird alignment problem - not caused by that PR - where the menu items in the repolist spread over multiple lines. This PR simply reduces the padding on these items and switches the justification of the flex elements to space-evenly. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [skip ci] Updated translations via CrowdinGiteaBot2021-10-192-0/+8
|
* Disable form autofill (#17291)wxiaoguang2021-10-1913-15/+51
| | | | | | | ]* fix aria-hidden and tabindex * use {{template "base/disable_form_autofill"}} instead of {{DisableFormAutofill}} Co-authored-by: zeripath <art27@cantab.net>
* Allow mocking timeutil (#17354)John Olheiser2021-10-182-0/+22
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* docs: add permission notes to `SSH Container Passthrough` (#17347)Mashiro2021-10-181-0/+7
| | | | | | | * Update with-docker.en-us.md * Update with-docker.en-us.md Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* api: integration test for nodeinfo (#17346)techknowlogick2021-10-181-0/+31
|
* [skip ci] Updated translations via CrowdinGiteaBot2021-10-182-0/+7
|
* Use go1.16+ way of installing binaries (#17342)techknowlogick2021-10-171-6/+6
|
* Fix some lints (#17337)Lunny Xiao2021-10-178-15/+14
| | | Fix some linting problems.
* Move session to models/login (#17338)Lunny Xiao2021-10-172-9/+9
| | | Move model/session.go to models/login
* Hide command line merge instructions when user can't push (#17339)qwerty2872021-10-172-18/+22
| | | | Hides the command line instructions if the authenticated user can't push to the base branch. Closes #17121
* fix: repository summary on mobile (#17322)kolaente2021-10-171-0/+11
| | | | | | | | | | | This PR fixes the repository summary on mobile. Most of it is vertically centering things and some spacing. #### Before: ![Screen Shot 2021-10-15 at 19 12 25](https://user-images.githubusercontent.com/13721712/137528901-021867b5-73c3-4f48-8408-18bc573f5ee7.png) #### After: ![Screen Shot 2021-10-15 at 19 28 06](https://user-images.githubusercontent.com/13721712/137528970-058a66fd-d5d9-44ea-ba5f-998bf8cbf4fe.png)
* Make the Mirror Queue a queue (#17326)zeripath2021-10-177-76/+164
| | | | | | | | | Convert the old mirror syncing queue to the more modern queue format. Fix a bug in the from the repo-archive queue PR - the assumption was made that uniqueness could be enforced with by checking equality in a map in channel unique queues - however this only works for primitive types - which was the initial intention but is an imperfect. This is fixed by marshalling the data and placing the martialled data in the unique map instead. The documentation is also updated to add information about the deprecated configuration values. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Ensure popup text is aligned left (#17327)Mario Lubenka2021-10-171-0/+4
| | | | Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-10-1725-24/+12
|
* Fix the PR review form bug during frontend refactor (#17332)wxiaoguang2021-10-161-1/+1
|
* Split `index.js` to separate files (#17315)wxiaoguang2021-10-1742-3502/+3687
| | | | | | | | | | | | | | | | | | * split `index.js` to separate files * tune clipboard * fix promise * fix document * remove intermediate empty file * fix async event listener * use `export function` instead of `export {}`, add more comments Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Add RSS/Atom feed support for user actions (#16002)65432021-10-1622-39/+1521
| | | Return rss/atom feed for user based on rss url suffix or Content-Type header.
* Add simple update checker to Gitea (#17212)techknowlogick2021-10-168-3/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add simple update checker to Gitea * update struct and remove comments * fix lint * Update custom/conf/app.example.ini * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-authored-by: delvh <dev.lh@web.de> * Update custom/conf/app.example.ini Co-authored-by: delvh <dev.lh@web.de> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-authored-by: delvh <dev.lh@web.de> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-authored-by: Steven <61625851+justusbunsi@users.noreply.github.com> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md * Update modules/cron/tasks_extended.go Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> * Update custom/conf/app.example.ini Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> * take PR feedback into account and display banner on admin dashboard for alerts * Add more detailed message * placate lint * update per feedback Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Steven <61625851+justusbunsi@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update documents for Gitea behind reverse proxy. Fix some small bugs (some ↵wxiaoguang2021-10-155-20/+22
| | | | | | | | | | | URLs are generated without sub-path) (#17320) * Apache `ProxyPassReverse` only works for Location, Content-Location and URI headers on HTTP redirect responses, it causes more problems than it resolves. Now all URLs generated by Gitee have the correct prefix AppSubURL. We do not need to set `ProxyPassReverse`. * fix url param * use AppSubURL instead of AppURL in api/v1 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* fix: issue close/comment buttons on mobile (#17317)kolaente2021-10-151-29/+39
| | | | | | | | * fix: issue close/comment buttons on mobile * fix: lint Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* fix: code review comments on mobile (#17321)kolaente2021-10-163-5/+59
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-10-162-3/+15
|
* Check for context exceeded in WalkGitLog (#17319)zeripath2021-10-151-0/+3
| | | | | | | | | | | There is a slight race in checking of a context deadline exceed in #16467 which leads to a 500 on the repository page. The solution is to check the error coming back from `*LogNameStatusRepoParser.Next()` and if it is the `ContextDeadlineExceeded` break from the loop. Fix #17314 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add buttons to allow loading of incomplete diffs (#16829)zeripath2021-10-1512-154/+227
| | | | | | | | | | | | | | | | | This PR adds two buttons to the stats and the end of the diffs list to load the (some of) the remaining incomplete diff sections. Contains #16775 Signed-off-by: Andrew Thornton <art27@cantab.net> ## Screenshots ### Show more button at the end of the diff ![Screenshot from 2021-09-04 11-12-37](https://user-images.githubusercontent.com/1824502/132091009-b1f6113e-2c04-4be5-8a04-b8ecea56887b.png) ### Show more button at the end of the diff stats box ![Screenshot from 2021-09-04 11-14-54](https://user-images.githubusercontent.com/1824502/132091063-86da5a6d-6628-4b82-bea9-3655cd9f40f6.png)
* Multiple tokens support for migrating from github (#17134)Lunny Xiao2021-10-153-84/+134
| | | | | | | | | * multiple tokens support for migrating from github * improve code and token description * Fix bug * Add comment for get client
* Frontend refactor: move Vue related code from `index.js` to `components` ↵wxiaoguang2021-10-1520-634/+718
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dir, and remove unused codes. (#17301) * frontend refactor * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> * Update templates/base/head.tmpl Co-authored-by: delvh <dev.lh@web.de> * Update docs/content/doc/developers/guidelines-frontend.md Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * fix typo * fix typo * refactor PageData to pageData * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> * Simply for the visual difference. Co-authored-by: delvh <dev.lh@web.de> * Revert "Apply suggestions from code review" This reverts commit 4d78ad9b0e96ca180e0823de17659a2e0814c099. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* [skip ci] Updated translations via CrowdinGiteaBot2021-10-151-0/+25
|
* Show direct match on top for user search (#17303)Maximilian Weiler2021-10-151-2/+8
| | | | | | | | | This PR makes sure that direct matches in the user search always show on top of the result list. The following places were checked to follow the desired behavior now: - Search when adding a user to a team - Search when adding a user as a collaborator to a repository Signed-off-by: Maximilian Weiler <16721506+maweil@users.noreply.github.com>
* Don't panic if we fail to parse U2FRegistration data (#17304)David Jimenez2021-10-143-2/+28
| | | | | | | | | * Don't panic if we fail to parse a U2FRegistration data Downgrade logging statement from Fatal to Error so that errors parsing U2FRegistration data does not panic; instead, the invalid key will be skipped and we will attempt to parse the next one, if available. Signed-off-by: David Jimenez <dvejmz@sgfault.com>
* Upgrade chi to v5 (#17298)Lunny Xiao2021-10-1335-132/+2692
|
* [skip ci] Updated translations via CrowdinGiteaBot2021-10-141-0/+25
|
* Ensure that git daemon export ok is created for mirrors (#17243)zeripath2021-10-137-29/+81
| | | | | | | | | | | | | * Ensure that git daemon export ok is created for mirrors There is an issue with #16508 where it appears that create repo requires that the repo does not exist. This causes #17241 where an error is reported because of this. This PR fixes this and also runs update-server-info for mirrors and generated repos. Fix #17241 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Disable core.protectNTFS (#17300)zeripath2021-10-134-0/+10
| | | | | | | | | | | | | | core.protectNTFS protects NTFS from files which may be difficult to remove or interact with using the win32 api, however, it also appears to prevent such files from being entered into the git indexes - fundamentally causing breakages with PRs that affect these files. However, deliberately setting this to false may cause security issues due to the remain sparse checkout of files in the merge pipeline. The only sensible option therefore is to provide an optional setting which admins could set which would forcibly switch this off if they are affected by this issue. Fix #17092 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use pointer for wrappedConn methods (#17295)zeripath2021-10-121-3/+3
| | | | | Fix #17294 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add user status filter to admin user management page (#16770)wxiaoguang2021-10-1217-36/+233
| | | | | | | | | | | | | | | | | | | | It makes Admin's life easier to filter users by various status. * introduce window.config.PageData to pass template data to javascript module and small refactor move legacy window.ActivityTopAuthors to window.config.PageData.ActivityTopAuthors make HTML structure more IDE-friendly in footer.tmpl and head.tmpl remove incorrect <style class="list-search-style"></style> in head.tmpl use log.Error instead of log.Critical in admin user search * use LEFT JOIN instead of SubQuery when admin filters users by 2fa. revert non-en locale. * use OptionalBool instead of status map * refactor SearchUserOptions.toConds to SearchUserOptions.toSearchQueryBase * add unit test for user search * only allow admin to use filters to search users
* [API] Add endpount to get user org permissions (#17232)Romain2021-10-127-1/+325
| | | | | | | | | | | | * Add endpoint * Add swagger response + generate swagger * Stop execution if user / org is not found * Add tests Co-authored-by: 6543 <6543@obermui.de>
* [skip ci] Updated translations via CrowdinGiteaBot2021-10-122-0/+19
|
* AutoRegistration is supposed to be working with disabled registration (#17219)Viktor Kuzmin2021-10-111-1/+1
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>