aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Use `crypto/sha256` (#29386)KN4CK3R2024-02-2522-32/+22
| | | | | | | | Go 1.21 improved the performance of `crypto/sha256`. It's now similar to `minio/sha256-simd`, so we should just use the standard libs. https://go.dev/doc/go1.21#crypto/sha256 https://go-review.googlesource.com/c/go/+/408795 https://github.com/multiformats/go-multihash/pull/173
* Add `io.Closer` guidelines (#29387)KN4CK3R2024-02-257-9/+16
| | | Co-authored-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery AJAX from the notice selection deletion button (#29381)Yarden Shoham2024-02-251-10/+7
| | | | | | | - Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the repo notice selection deletion button functionality and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Refactor Safe modifier (#29392)wxiaoguang2024-02-2526-65/+89
| | | | After this PR: no need to play with the Safe/Escape tricks anymore. See the changes for more details.
* Add attachment support for code review comments (#29220)Jimmy Praet2024-02-2515-73/+149
| | | | | | | Fixes #27960, #24411, #12183 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor modules/git global variables (#29376)wxiaoguang2024-02-258-25/+27
| | | Move some global variables into a struct to improve maintainability
* Remove jQuery from the code diff expansion buttons (#29385)Yarden Shoham2024-02-254-20/+12
| | | | | | | | | | | - Removed all jQuery AJAX calls and replaced with htmx - Tested the code diff expansion buttons functionality and it works as before plus a loading indicator # Demo using `htmx` instead of jQuery AJAX ![action](https://github.com/go-gitea/gitea/assets/20454870/afba7442-ed56-4d39-b764-835d1f6c3a9c) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Remove jQuery AJAX from the markdown editor preview (#29384)Yarden Shoham2024-02-251-10/+10
| | | | | | | | | | | - Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the markdown editor preview button functionality and it works as before # Demo using `fetch` instead of jQuery AJAX ![action](https://github.com/go-gitea/gitea/assets/20454870/3fc7abb8-4fdc-46e9-95f6-087d9526bb52) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Refactor `copy` button event handler (#29379)wxiaoguang2024-02-251-24/+17
| | | Use "closest" instead of "for-loop"
* Remove jQuery AJAX from the repo commit graph (#29373)Yarden Shoham2024-02-251-1/+4
| | | | | | | | | | | | - Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the repo collaborator mode dropdown functionality and it works as before # Demo using `fetch` instead of jQuery AJAX ![action](https://github.com/go-gitea/gitea/assets/20454870/7e2f166e-9941-4f26-9666-d00cdf3d9f60) Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Move citiation button to proper place (#29374)wxiaoguang2024-02-251-3/+3
| | | | | | | | The citiation button shouldn't be controlled by DisableDownloadSourceArchives (line 134) So move it out of that "if" block. Co-authored-by: Giteabot <teabot@gitea.io>
* Remove jQuery AJAX from repo collaborator mode dropdown (#29371)Yarden Shoham2024-02-251-9/+11
| | | | | | | | | | | | | | | - Removed all jQuery AJAX calls and replaced with our fetch wrapper - Tested the repo collaborator mode dropdown functionality and it works as before # Demo using `fetch` instead of jQuery AJAX ![action](https://github.com/go-gitea/gitea/assets/20454870/04466629-19b2-4469-9231-38820ee13c36) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Giteabot <teabot@gitea.io>
* Remove RenderEmojiPlain from template helper (#29375)wxiaoguang2024-02-246-20/+10
| | | | | | | | | | RenderEmojiPlain(emoji.ReplaceAliases) should be called explicitly for some contents, but not for everything. Actually in modern days, in most cases it doesn't need such "ReplaceAliases". So only keep it for issue/PR titles. If anyone really needs to do ReplaceAliases for some contents, I will propose a following fix.
* Apply to become a maintainer (zokkis) (#29383)Tim-Nicas Oelschläger2024-02-241-0/+1
|
* Remove jQuery from the Unicode escape button (#29369)Yarden Shoham2024-02-242-25/+25
| | | | | | | | | | | | | - Switched to plain JavaScript - Tested the Unicode escape button functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/664f0ced-876b-4cb7-a668-bd62169fc843) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor git attributes (#29356)KN4CK3R2024-02-249-100/+101
|
* Users with `read` permission of pull requests can be assigned too (#27263)Lunny Xiao2024-02-242-3/+5
| | | | This PR will also keep the consistent between list assigned users and check assigned users.
* Customizable "Open with" applications for repository clone (#29320)wxiaoguang2024-02-2419-53/+286
| | | | | | | | Users could customize the "clone" menu with their own application URLs on the admin panel. Replace #22378 Close #21121 Close #22149
* Allow non-admin users to delete review requests (#29057)Zettat1232024-02-2433-103/+656
| | | | | | | | Fix #14459 The following users can add/remove review requests of a PR - the poster of the PR - the owner or collaborators of the repository - members with read permission on the pull requests unit
* Remove jQuery from the issue reference context popup (#29367)Yarden Shoham2024-02-241-11/+14
| | | | | | | | | | | | | - Removed all jQuery calls - Tested the context popup functionality and it works as before # Demo without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/90b53de5-a8e9-4ed7-9236-1c9dfc324f38) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Do not double close reader (#29354)KN4CK3R2024-02-242-4/+11
| | | | | | | Fixes #29346 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Implement recent commits graph (#29210)Şahin Akkaya2024-02-249-1/+233
| | | | | | | This is the implementation of Recent Commits page. This feature was mentioned on #18262. It adds another tab to Activity page called Recent Commits. Recent Commits tab shows number of commits since last year for the repository.
* Add API to get merged PR of a commit (#29243)qwerty2872024-02-246-0/+128
| | | | | | | | Adds a new API `/repos/{owner}/{repo}/commits/{sha}/pull` that allows you to get the merged PR associated to a commit. --------- Co-authored-by: 6543 <6543@obermui.de>
* Properly migrate target branch change GitLab comment (#29340)Sebastian Brückner2024-02-244-8/+50
| | | | | | | | | | | | | | | | | | GitLab generates "system notes" whenever an event happens within the platform. Unlike Gitea, those events are stored and retrieved as text comments with no semantic details. The only way to tell whether a comment was generated in this manner is the `system` flag on the note type. This PR adds detection for a new specific kind of event: Changing the target branch of a PR. When detected, it is downloaded using Gitea's type for this event, and eventually uploaded into Gitea in the expected format, i.e. with no text content in the comment. This PR also updates the template used to render comments to add support for migrated comments of this type. ref: https://gitlab.com/gitlab-org/gitlab/-/blob/11bd6dc826e0bea2832324a1d7356949a9398884/app/services/system_notes/merge_requests_service.rb#L102
* Use the database object format name but not read from git repoisitory ↵Lunny Xiao2024-02-2417-56/+41
| | | | | | | | | | | | | everytime and fix possible migration wrong objectformat when migrating a sha256 repository (#29294) Now we can get object format name from git command line or from the database repository table. Assume the column is right, we don't need to read from git command line every time. This also fixed a possible bug that the object format is wrong when migrating a sha256 repository from external. <img width="658" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/6e9a9dcf-13bf-4267-928b-6bf2c2560423">
* Revert "Support SAML authentication (#25165)" (#29358)65432024-02-2437-1440/+69
| | | | | | | | | | This reverts #25165 (5bb8d1924d77c675467694de26697b876d709a17), as there was a chance some important reviews got missed. so after reverting this patch it will be resubmitted for reviewing again https://github.com/go-gitea/gitea/pull/25165#issuecomment-1960670242 temporary Open #5512 again
* Implement code frequency graph (#29191)Şahin Akkaya2024-02-2313-32/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Overview This is the implementation of Code Frequency page. This feature was mentioned on these issues: #18262, #7392. It adds another tab to Activity page called Code Frequency. Code Frequency tab shows additions and deletions over time since the repository existed. Before: <img width="1296" alt="image" src="https://github.com/go-gitea/gitea/assets/32161460/2603504f-aee7-4929-a8c4-fb3412a7a0f6"> After: <img width="1296" alt="image" src="https://github.com/go-gitea/gitea/assets/32161460/58c03721-729f-4536-a663-9f337f240963"> --- #### Features - See additions deletions over time since repository existed - Click on "Additions" or "Deletions" legend to show only one type of contribution - Use the same cache from Contributors page so that the loading of data will be fast once it is cached by visiting either one of the pages --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Fix validity of the FROM email address not being checked (#29347)Carlos Felgueiras2024-02-232-0/+7
| | | | | | | | | Fixes #27188. Introduces a check on the installation that tries to parse the FROM address. If it fails, shows a new error message to the user. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Refactor generate-svg.js (#29348)silverwind2024-02-231-4/+5
| | | | Small refactor to avoid `process` global and to sync it with `generate-images`.
* Make optional.Option[T] type serializable (#29282)65432024-02-233-10/+248
| | | | | | | make the generic `Option` type de-/serializable for json and yaml --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Remove jQuery from the stopwatch (#29351)Yarden Shoham2024-02-231-17/+21
| | | | | | | | | | - Switched to plain JavaScript - Tested the stopwatch functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/c8e9a401-45e5-4a1d-a683-0d655f1d570e) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Fix tarball/zipball download bug (#29342)Zettat1232024-02-232-1/+6
| | | | | | | Fix #29249 ~~Use the `/repos/{owner}/{repo}/archive/{archive}` API to download.~~ Apply #26430 to archive download URLs.
* Add support for `linguist-detectable` and `linguist-documentation` (#29267)KN4CK3R2024-02-234-69/+363
| | | | | | | | | Add support for `linguist-detectable` and `linguist-documentation` Add tests for the attributes https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#detectable https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#documentation
* Adjust changelog for v1.21.6 to move prs to correct labels (#29339) (#29343)Lunny Xiao2024-02-231-12/+10
| | | | | | | | | | When releasing, the releaser should read all the pull requests carefully and do some adjustments because some of pull requests' labels are not right when it's merged. And the changelog tool needs to be adjusted. If one pull request has both `bug` and `API`, it should mark it as `bug` but not `API`. Backport #29339
* Allow options to disable user deletion from the interface on app.ini (#29275)Lunny Xiao2024-02-236-12/+34
| | | | | | | | | | | | | Extract from #20549 This PR added a new option on app.ini `[admin]USER_DISABLED_FEATURES` to allow the site administrator to disable users visiting deletion user interface or allow. This options are also potentially allowed to define more features in future PRs. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Start to migrate from `util.OptionalBool` to `optional.Option[bool]` (#29329)65432024-02-2324-64/+84
| | | just create transition helper and migrate two structs
* Add slow SQL query warning (#27545)Earl Warren2024-02-234-20/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Databases are one of the most important parts of Forgejo, every interaction uses the database in one way or another. Therefore, it is important to maintain the database and recognize when the server is not doing well with the database. There already is the option to log *every* SQL query along with its execution time, but monitoring becomes impractical for larger instances and takes up unnecessary storage in the logs. - Add a QoL enhancement that allows instance administrators to specify a threshold value beyond which query execution time is logged as a warning in the xorm logger. The default value is a conservative five seconds to avoid this becoming a source of spam in the logs. - The use case for this patch is that with an instance the size of Codeberg, monitoring SQL logs is not very fruitful and most of them are uninteresting. Recently, in the context of persistent deadlock issues (https://codeberg.org/forgejo/forgejo/issues/220), I have noticed that certain queries hold locks on tables like comment and issue for several seconds. This patch helps to identify which queries these are and when they happen. - Added unit test. (cherry picked from commit 9cf501f1af4cd870221cef6af489618785b71186) --------- Co-authored-by: Gusted <postmaster@gusted.xyz> Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: 6543 <6543@obermui.de>
* Unify organizations header (#29248)Tim-Nicas Oelschläger2024-02-2315-153/+94
| | | | | | | | | | | | | | | Unify organizations header before: ![image](https://github.com/go-gitea/gitea/assets/72873130/74474e0d-33c3-4bbf-9324-d130ea2c62f8) after: ![image](https://github.com/go-gitea/gitea/assets/72873130/1c65de0d-fa0f-4b17-ab8d-067de8c7113b) --------- Co-authored-by: silverwind <me@silverwind.io>
* Frontport changelogs of minor releases (#29337)65432024-02-231-0/+236
| | | as title
* Support SAML authentication (#25165)techknowlogick2024-02-2337-69/+1440
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes https://github.com/go-gitea/gitea/issues/5512 This PR adds basic SAML support - Adds SAML 2.0 as an auth source - Adds SAML configuration documentation - Adds integration test: - Use bare-bones SAML IdP to test protocol flow and test account is linked successfully (only runs on Postgres by default) - Adds documentation for configuring and running SAML integration test locally Future PRs: - Support group mapping - Support auto-registration (account linking) Co-Authored-By: @jackHay22 --------- Co-authored-by: jackHay22 <jack@allspice.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: morphelinho <morphelinho@users.noreply.github.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io>
* Upgrade to fabric 6 (#29334)silverwind2024-02-234-21/+14
| | | | | | Upgrade fabric to latest v6 beta. It works for our use case, even thought it does not fix the upstream issue https://github.com/fabricjs/fabric.js/issues/9679 that https://github.com/go-gitea/gitea/issues/29326 relates to.
* Don't show third-party JS errors in production builds (#29303)silverwind2024-02-221-3/+12
| | | | | | | | So we don't get issues like https://github.com/go-gitea/gitea/issues/29080 and https://github.com/go-gitea/gitea/issues/29273 any more. Only active in [production builds](https://webpack.js.org/guides/production/#specify-the-mode), in non-production the errors will still show.
* Remove bountysource (#29330)Kyle D2024-02-223-7/+0
| | | | [Bountysource is dead](https://github.com/bountysource/core/issues/1586). So remove them from our repo.
* Remove unnecessary "Str2html" modifier from templates (#29319)wxiaoguang2024-02-2258-120/+121
| | | Follow #29165
* Ignore the linux anchor point to avoid linux migrate failure (#29295)Lunny Xiao2024-02-221-1/+3
| | | | | | | | | | Fix #28843 This PR will bypass the pushUpdateTag to database failure when syncAllTags. An error log will be recorded. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove jQuery from the repo commit functions (#29230)Yarden Shoham2024-02-221-46/+46
| | | | | | | | | | | | | | | | | - Switched to plain JavaScript - Tested the commit ellipsis button functionality and it works as before - Tested the commits statuses tippy functionality and it works as before - Tested the last commit loader functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/465516f8-0ff3-438c-a17e-26cbab82750b) ![action](https://github.com/go-gitea/gitea/assets/20454870/968da210-9382-4b50-a4c2-09419dc86e07) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
* Remove unnecessary "Safe" modifier from templates (#29318)wxiaoguang2024-02-2286-242/+242
| | | Follow #29165
* Remove jQuery from the image pasting functionality (#29324)Yarden Shoham2024-02-221-9/+11
| | | | | | | | | | - Switched to plain JavaScript - Tested the image pasting functionality and it works as before # Demo using JavaScript without jQuery ![demo](https://github.com/go-gitea/gitea/assets/20454870/018993ff-7b09-4d5f-88e0-f276368bacd6) Signed-off-by: Yarden Shoham <git@yardenshoham.com>
* Improve the `issue_comment` workflow trigger event (#29277)Zettat1232024-02-224-27/+130
| | | | | | | | | | | | | | | | | Fix #29175 Replace #29207 This PR makes some improvements to the `issue_comment` workflow trigger event. 1. Fix the bug that pull requests cannot trigger `issue_comment` workflows 2. Previously the `issue_comment` event only supported the `created` activity type. This PR adds support for the missing `edited` and `deleted` activity types. 3. Some events (including `issue_comment`, `issues`, etc. ) only trigger workflows that belong to the workflow file on the default branch. This PR introduces the `IsDefaultBranchWorkflow` function to check for these events.
* Properly migrate automatic merge GitLab comments (#27873)Sebastian Brückner2024-02-225-30/+111
| | | | | | | | | | | | | | | | | | | | | | | | GitLab generates "system notes" whenever an event happens within the platform. Unlike Gitea, those events are stored and retrieved as text comments with no semantic details. The only way to tell whether a comment was generated in this manner is the `system` flag on the note type. This PR adds detection for two specific kinds of events: Scheduling and un-scheduling of automatic merges on a PR. When detected, they are downloaded using Gitea's type for these events, and eventually uploaded into Gitea in the expected format, i.e. with no text content in the comment. This PR also updates the template used to render comments to add support for migrated comments of these two types. ref: https://gitlab.com/gitlab-org/gitlab/-/blob/11bd6dc826e0bea2832324a1d7356949a9398884/app/services/system_notes/merge_requests_service.rb#L6-L17 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>