aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Allow `<video>` in MarkDown (#22892)Sybren2023-03-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As you can imagine, for the Blender development process it is rather nice to be able to include videos in issues, pull requests, etc. This PR allows the `<video>` HTML tag to be used in MarkDown, with the `src`, `autoplay`, and `controls` attributes. ## Help Needed To have this fully functional, personally I feel the following things are still missing, and would appreciate some help from the Gitea team. ### Styling Some CSS is needed, but I couldn't figure out which of the LESS files would work. I tried `web_src/less/markup/content.less` and `web_src/less/_base.less`, but after running `make` the changes weren't seen in the frontend. This I would consider a minimal set of CSS rules to be applied: ```css video { max-width: 100%; max-height: 100vh; } ``` ### Default Attributes It would be fantastic if Gitea could add some default attributes to the `<video>` tag. Basically `controls` should always be there, as there is no point in disallowing scrolling through videos, looping them, etc. ### Integration with the attachments system Another thing that could be added, but probably should be done in a separate PR, is the integration with the attachments system. Dragging in a video should attach it, then generate the appropriate MarkDown/HTML.
* Pull Requests: add button to compare force pushed commits (#22857)Brecht Van Lommel2023-03-013-0/+17
| | | To quickly see what changed without having to re-read the whole diff.
* Do not create commit graph for temporary repos (#23219)Brecht Van Lommel2023-03-011-2/+8
| | | | | | | When fetching remotes for conflict checking, skip unnecessary and potentially slow writing of commit graphs. In a test with the Blender repository, this reduces conflict checking time for one pull request from about 2s to 0.1s.
* Use the correct selector to hide the checkmark of selected labels on clear ↵wxiaoguang2023-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | (#23224) Regression of #10107 (https://github.com/go-gitea/gitea/pull/10107/files#diff-a15e36f2f9c13339f7fdd38bc2887db2ff2945cb8434464318ab9105fcc846bdR460) Fix #22222 Before: the "clear" action couldn't remove these check marks. ![image](https://user-images.githubusercontent.com/2114189/222212998-c9f33459-b71d-4e80-8588-2935f3b7050c.png) After: the "clear" action can remove these check marks. ![image](https://user-images.githubusercontent.com/2114189/222213048-2be98ed0-cac0-4e27-b72c-1dd0ac2637d5.png)
* Order pull request conflict checking by recently updated, for each push (#23220)Brecht Van Lommel2023-03-011-0/+1
| | | | | | | | | | | | | When a change is pushed to the default branch and many pull requests are open for that branch, conflict checking can take some time. Previously it would go from oldest to newest pull request. Now prioritize pull requests that are likely being actively worked on or prepared for merging. This only changes the order within one push to one repository, but the change is trivial and can already be quite helpful for smaller Gitea instances where a few repositories have most pull requests. A global order would require deeper changes to queues.
* Fix incorrect checkbox behaviors in the dashboard repolist's filter (#23147)wxiaoguang2023-03-012-113/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-author: yp05327 , this PR is based on yp05327's #22813. The problems of the old DashboardRepoList / repolist.tmpl: * It mixes many different frameworks together * It "just works", bug on bug * It uses many anti-pattern of Vue This PR: * Fix bugs and close #22800 * Decouple the "checkbox" elements from Fomantic UI (only use CSS styles) * Simplify the HTML layout * Simplify JS logic * Make it easier to refactor the DashboardRepoList into a pure Vue component in the future. ### Screenshots #### Default ![image](https://user-images.githubusercontent.com/2114189/221355768-a3eb5b23-85b4-4e3d-b906-844d8b15539d.png) #### Click "Archived" to make it checked ![image](https://user-images.githubusercontent.com/2114189/221355777-9a104ddf-52a7-4504-869a-43a73827d802.png) #### Click "Archived" to make it intermediate ![image](https://user-images.githubusercontent.com/2114189/221355802-0f67a073-67ad-4e92-84a6-558c432103a5.png) #### Click "Archived" to make it unchecked ![image](https://user-images.githubusercontent.com/2114189/221355810-acf1d9d8-ccce-47fe-a02e-70cf4e666331.png) --------- Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2023-03-012-0/+71
|
* Properly flush unique queues on startup (#23154)zeripath2023-02-287-21/+332
| | | | | | | | | | | | | | | | | | | | | | | There have been a number of reports of PRs being blocked whilst being checked which have been difficult to debug. In investigating #23050 I have realised that whilst the Warn there is somewhat of a miscall there was a real bug in the way that the LevelUniqueQueue was being restored on start-up of the PersistableChannelUniqueQueue. Next there is a conflict in the setting of the internal leveldb queue name - This wasn't being set so it was being overridden by other unique queues. This PR fixes these bugs and adds a testcase. Thanks to @brechtvl for noticing the second issue. Fix #23050 and others --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use context parameter in services/repository (#23186)Jason Song2023-02-2829-100/+102
| | | | | | | | Use context parameter in `services/repository`. And use `cache.WithCacheContext(ctx)` to generate push action history feeds. Fix #23160
* Pass `--global` when calling `git config --get`, for consistency with `git ↵Philip Peterson2023-02-281-4/+4
| | | | | | | | config --set` (#23157) This arose out of #22451; it seems we are checking using non-global settings to see if a config value is set, in order to decide whether to call another global(-indeed) configuration command. This PR changes it so that both the check and the set are for global configuration.
* Make `gitea serv` respect git binary home (#23138)wxiaoguang2023-02-281-10/+15
| | | | | | | | | | | | | Close #23137 The old code is too old (8-9 years ago) Let's try to execute the git commands from git bin home directly. The verb has been checked above, it could only be: * git-upload-pack * git-upload-archive * git-receive-pack * git-lfs-authenticate
* Write Gitpod `app.ini` only once (#23192)Yarden Shoham2023-02-281-3/+6
| | | | | | | | | | | | | | Before this change, the `app.ini` would get overwritten on each workspace start, confusing Gitea. It asked for reinstallation each time. This makes sure the file is written only once by checking it does not exist before creating it. --- [Review without whitespace diff](https://github.com/go-gitea/gitea/pull/23192/files?w=1) --------- Co-authored-by: delvh <dev.lh@web.de>
* Avoid too long names for actions (#23162)Jason Song2023-02-283-2/+6
| | | | | The name of the job or step comes from the workflow file, while the name of the runner comes from its registration. If the strings used for these names are too long, they could cause db issues.
* [skip ci] Updated translations via CrowdinGiteaBot2023-02-2829-3003/+2331
|
* Change button text for commenting and closing an issue at the same time (#23135)wxiaoguang2023-02-272-1/+10
| | | | | | | | | Close #10468 Without SimpleMDE/EasyMDE, using Simple Textarea, the button text could be changed when content changes. After introducing SimpleMDE/EasyMDE, there is no code for updating the button text.
* Don't run unnecessary steps when only docs changed (#23103)Lunny Xiao2023-02-271-0/+21
| | | | | Remove some unnecessary steps from drone when only docs changed. ref: https://drone.gitea.io/go-gitea/gitea/68090/1/3
* Add word-break to sidebar-item-link (#23146)yp053272023-02-271-1/+1
| | | | | | | Fixes https://github.com/go-gitea/gitea/issues/22953 ![image](https://user-images.githubusercontent.com/18380374/221351117-1e4b8922-04ca-4717-8e3b-c338a61bc062.png) Co-authored-by: delvh <leon@kske.dev>
* Speed up HasUserStopwatch & GetActiveStopwatch (#23051)zeripath2023-02-274-39/+28
| | | | | | | | | | | | GetActiveStopwatch & HasUserStopwatch is a hot piece of code that is repeatedly called and on examination of the cpu profile for TestGit it represents 0.44 seconds of CPU time. This PR reduces this time to 80ms. --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <leon@kske.dev>
* Add InsecureSkipVerify to Minio Client for Storage (#23166)Yarden Shoham2023-02-275-9/+28
| | | | | | | Allows using Minio with untrusted certificates Closes #23128 Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Fix Fomantic UI's `touchstart` fastclick, always use `click` for click ↵wxiaoguang2023-02-272-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | events (#23065) Using `touchstart` for `click` events is a black magic for mobile browsers (Google: `fastclick`). However, it causes many UX problems if the fastclick is used without careful design. Fomantic UI uses this fastclick for its `dimmer` and `dropdown`, it makes mobile users feel strange when they "touch" the dropdown menu. This PR uses a simple patch to fix that behavior. Then the Fomantic dropdown only uses `click` for click events. This PR is simple enough and won't cause hidden bugs even if the patch doesn't work. In the future, if there are more patches for Fomantic UI, the patches could be placed in a directory like `web_src/fomantic/patches/001-fix-click-touchstart`, etc. ![image](https://user-images.githubusercontent.com/2114189/220551915-bd28e8cc-507f-43c7-bb4a-b24f7ff3934d.png) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove useless comment in #23114 (#23173)Zettat1232023-02-271-1/+0
| | | | | | The `isAdmin` param is no longer used so the comment should be removed. https://github.com/go-gitea/gitea/blob/d27d36f2f4dd389050e613967ad2a5d02d250acc/routers/web/explore/repo.go#L36-L37
* Remove xin-u from maintainers (#23170)xin-u2023-02-271-1/+0
|
* Revert "[skip ci] Updated translations via Crowdin" (#23167)Lunny Xiao2023-02-2798-136529/+46506
|
* [skip ci] Updated translations via CrowdinGiteaBot2023-02-2798-46506/+136529
|
* Return 404 instead of 403 if user can not access the repo (#23155)yp053272023-02-261-1/+1
| | | | | | | | | | | | | Fixes https://github.com/go-gitea/gitea/issues/23150 Before: ![image](https://user-images.githubusercontent.com/18380374/221390802-2317c6bc-d163-4def-b68b-6bb297143fe2.png) After: ![image](https://user-images.githubusercontent.com/18380374/221390823-87490351-39c3-4a40-b1d2-11fc5b85fa24.png) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated licenses and gitignoresGiteaBot2023-02-2632-0/+1144
|
* Fix secrets overview page missing from docs sidebar (#23143)Yarden Shoham2023-02-252-2/+2
| | | | | | | | | | | | | | | | There was a warning while building the docs: `Building sites … WARN 2023/02/25 08:56:37 "/workspace/gitea/docs/content/doc/secrets/overview.en-us.md:1:1": duplicate menu entry with identifier "overview" in menu "sidebar"`. ### Before ![image](https://user-images.githubusercontent.com/20454870/221348741-55cef254-f2ac-4507-9a66-818b406c668f.png) ### After ![image](https://user-images.githubusercontent.com/20454870/221348757-42066303-e1b7-43fe-9c4f-e05182fbabdd.png) Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* Add "Reviewed by you" filter for pull requests (#22927)Brecht Van Lommel2023-02-249-7/+100
| | | | | | | | | | This includes pull requests that you approved, requested changes or commented on. Currently such pull requests are not visible in any of the filters on /pulls, while they may need further action like merging, or prodding the author or reviewers. Especially when working with a large team on a repository it's helpful to get a full overview of pull requests that may need your attention, without having to sift through the complete list.
* Projects: rename Board to Column in interface and improve consistency (#22767)Brecht Van Lommel2023-02-245-68/+70
|
* Fix DBConsistency checks on MSSQL (#23132)zeripath2023-02-241-4/+4
| | | | | | | | | | | | | Unfortunately xorm's `builder.Select(...).From(...)` does not escape the table names. This is mostly not a problem but is a problem with the `user` table. This PR simply escapes the user table. No other uses of `From("user")` where found in the codebase so I think this should be all that is needed. Fix #23064 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add pagination for dashboard and user activity feeds (#22937)Brecht Van Lommel2023-02-249-32/+81
| | | | Previously only the last few activities where available. This works for all activity and for activity on a date chosen on the heatmap.
* Update go.mod dependencies (#23126)zeripath2023-02-244-334/+144
| | | | | | | | | | | | | | This PR does a bulk update of a lot of our go deps. I have not included nektos/act and xorm for the following reasons: * Xorm updates can sometimes be complex and I'd rather do that in a separate PR * I think people more update with the actions code should double check that the latest nektos/act library works correctly. --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Show empty repos in Admin Repository Management page (#23114)Zettat1232023-02-242-21/+23
| | | | | | | | | | | | | | | | | | | | | The **Admin Repository Management** page and the **Explore Repository** page both use the `RenderRepoSearch` function. In this function, the `OnlyShowRelevant` search option is `true` when querying repositories for admin page. https://github.com/go-gitea/gitea/blob/edf98a2dc30956c8e04b778bb7f1ce55c14ba963/routers/web/explore/repo.go#L99-L115 Refer to [#19361](https://github.com/go-gitea/gitea/pull/19361/files#diff-8058dfb85557010e0592d586675ec62ce406af7068e6311f39c160deac37f149R497), the repositories with `is_empty=true` will be hidden if `OnlyShowRelevant` is `true`. Administrators should be able to see all repositories. So `OnlyShowRelevant` shouldn't be set to `true` . --------- Co-authored-by: Andrew Thornton <art27@cantab.net>
* Redirect to the commit page after applying patch (#23056)yp053272023-02-241-6/+4
| | | | | Fixes https://github.com/go-gitea/gitea/issues/22621
* Bump go.etcd.io/bbolt and blevesearch deps (#23062)WÁNG Xuěruì2023-02-242-18/+15
| | | | | | | | This notably brings support for GOARCH=loong64, among other fixes. --------- Signed-off-by: WANG Xuerui <xen0n@gentoo.org> Co-authored-by: zeripath <art27@cantab.net>
* Fix height for sticky head on large screen on PR page (#23111)HesterG2023-02-241-10/+2
| | | | | | | | | | | | | | | Right now on the PR 'File Change' Tab, the file title header sticky to the top on large screens has wrong height, resulting in wrong ui behavior when scrolling down. This PR is to fix this. Before: <img width="964" alt="截屏2023-02-24 17 12 29" src="https://user-images.githubusercontent.com/17645053/221140409-025c4a84-6bbe-4b5b-a13f-bd2b79063522.png"> After: <img width="1430" alt="截屏2023-02-24 21 10 12" src="https://user-images.githubusercontent.com/17645053/221186750-0344d652-4610-4a90-a4c0-7f6269f950d6.png">
* Fix db.Find bug (#23115)Lunny Xiao2023-02-242-2/+50
| | | | | Caused by #20821 Fix #23110
* Avoid warning for system setting when start up (#23054)Lunny Xiao2023-02-2411-34/+43
| | | | | | | | | | | | | Partially fix #23050 After #22294 merged, it always has a warning log like `cannot get context cache` when starting up. This should not affect any real life but it's annoying. This PR will fix the problem. That means when starting up, getting the system settings will not try from the cache but will read from the database directly. --------- Co-authored-by: Lauris BH <lauris@nix.lv>
* Require approval to run actions for fork pull request (#22803)Jason Song2023-02-2410-16/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, Gitea will run actions automatically which are triggered by fork pull request. It's a security risk, people can create a PR and modify the workflow yamls to execute a malicious script. So we should require approval for first-time contributors, which is the default strategy of a public repo on GitHub, see [Approving workflow runs from public forks](https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks). Current strategy: - don't need approval if it's not a fork PR; - always need approval if the user is restricted; - don't need approval if the user can write; - don't need approval if the user has been approved before; - otherwise, need approval. https://user-images.githubusercontent.com/9418365/217207121-badf50a8-826c-4425-bef1-d82d1979bc81.mov GitHub has an option for that, you can see that at `/<owner>/<repo>/settings/actions`, and we can support that later. <img width="835" alt="image" src="https://user-images.githubusercontent.com/9418365/217199990-2967e68b-e693-4e59-8186-ab33a1314a16.png"> --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix nil context in RenderMarkdownToHtml (#23092)Zettat1232023-02-2413-23/+24
| | | | | | | | | | Fix #23082. This bug is caused by a nil context in https://github.com/go-gitea/gitea/issues/23082#issuecomment-1441276546 . --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add HesterG to maintainers (#23104)HesterG2023-02-241-1/+2
| | | | [List of mine merged PR](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3AHesterG+is%3Amerged+)
* improve FindProjects (#23085)yp053272023-02-241-10/+3
| | | | | | | | I found `FindAndCount` which can `Find` and `Count` in the same time Maybe it is better to use it in `FindProjects` --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make issue meta dropdown support Enter, confirm before reloading (#23014)wxiaoguang2023-02-245-20/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the title. Label/assignee share the same code. * Close #22607 * Close #20727 Also: * partially fix for #21742, now the comment reaction and menu work with keyboard. * partially fix for #17705, in most cases the comment won't be lost. * partially fix for #21539 * partially fix for #20347 * partially fix for #7329 ### The `Enter` support Before, if user presses Enter, the dropdown just disappears and nothing happens or the window reloads. After, Enter can be used to select/deselect labels, and press Esc to hide the dropdown to update the labels (still no way to cancel .... maybe you can do a Cmd+R or F5 to refresh the window to discard the changes .....) This is only a quick patch, the UX is still not perfect, but it's much better than before. ### The `confirm` before reloading And more fixes for the `reload` problem, the new behaviors: * If nothing changes (just show/hide the dropdown), then the page won't be reloaded. * If there are draft comments, show a confirm dialog before reloading, to avoid losing comments. That's the best effect can be done at the moment, unless completely refactor these dropdown related code. Screenshot of the confirm dialog: <details> ![image](https://user-images.githubusercontent.com/2114189/220538288-e2da8459-6a4e-43cb-8596-74057f8a03a2.png) </details> --------- Co-authored-by: Brecht Van Lommel <brecht@blender.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix SyncOnCommit always return false in API of push_mirrors (#23088)sillyguodong2023-02-231-0/+1
| | | | | | | | | | Fix: #22990 --- Before, the return value of the api is always false,regrardless of whether the entry of `sync_on_commit` is true or false. I have confirmed that the value of `sync_on_commit` dropped into the database is correct. So, I think it is enough to make some small changes.
* Fix commit name in Apply Patch page (#23086)yp053272023-02-232-1/+4
| | | | Fixes https://github.com/go-gitea/gitea/issues/22621#issuecomment-1439309200
* Add wrapper to author to avoid long name ui problem (#23030)HesterG2023-02-232-7/+18
| | | | | | This PR is a possible solution for issue #22866. Main change is to add a `author-wrapper` class around author name, like the wrapper added to message. The `max-width` is set to 200px on PC, and 100px on mobile device for now.
* Avoid Hugo from adding quote to actions url (#23097)Sven2023-02-231-1/+1
|
* Remove all package data after tests (#22984)KN4CK3R2023-02-2316-9/+62
| | | | | | | | Fixes #21020 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Change style to improve whitespaces trimming inside inline markdown code ↵HesterG2023-02-231-0/+1
| | | | | | | | | | | | | | | | | (#23093) Given mardown source ``` x ` a` y x `a ` y x ` a ` y ``` Render <img width="1421" alt="2023-02-23 15 33 14" src="https://user-images.githubusercontent.com/17645053/220844280-a304c788-ac79-4a26-a55a-0db00f2fb3f3.png"> Fixes #23080.
* Nest metadata in refactoring docs (#23087)techknowlogick2023-02-231-5/+5
| | | | | Whitespace was missing from refactoring docs metadata. backport label applied so it is included in versioned docs.