summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add main landmark to templates and adjust titles (#22670)Felipe Leopoldo Sologuren Gutiérrez2023-02-01171-176/+177
| | | | | | | * Add main aria landmark to templates * Adjust some titles to improve understanding of location in navigation Contributed by @Forgejo
* Fix cache-control header clearing comment text when editing issue (#22604)Brecht Van Lommel2023-02-011-2/+2
| | | | | | | | | | | The `no-store` cache control added in #20432 is causing form input to be cleared unnecessarily on page reload. Instead use `max-age=0,private,must-revalidate` which avoids this. This was particularly a problem when typing a long comment for an issue and then for example changing the label. The page would be reloaded and lose the unsubmitted comment. Fixes #22603
* Enable `@<user>`- completion popup on the release description textarea (#22359)delvh2023-02-012-2/+17
| | | | For some unknown reason, this was previously disabled. Additionally removed an unused return value.
* Add Conda package registry (#22262)KN4CK3R2023-02-0124-3/+1244
| | | This PR adds a [Conda](https://conda.io/) package registry.
* Add user secrets (#22191)KN4CK3R2023-02-0117-255/+310
| | | | | | | | | | | | Fixes #22183 Replaces #22187 This PR adds secrets for users. I refactored the files for organizations and repos to use the same logic and templates. I splitted the secrets from deploy keys again and reverted the fix from #22187. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add missing close bracket in imagediff (#22710)zeripath2023-02-011-1/+1
| | | | | | | | | | | There was a missing `]` in imagediff.js: ``` const $range = $container.find("input[type='range'"); ``` This PR simply adds this. Fix #22702
* Explain that the no-access team unit does not affect public repositories ↵yp053272023-02-011-1/+1
| | | | | | | | | | | (#22661) Fixes https://github.com/go-gitea/gitea/issues/22600 Add explanations to team unit access control. --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Fix bugs with WebAuthn preventing sign in and registration. (#22651)zeripath2023-02-013-18/+25
| | | | | | | | | | | | | | | | This PR fixes two bugs with Webauthn support: * There was a longstanding bug within webauthn due to the backend using URLEncodedBase64 but the javascript using decoding using plain base64. This causes intermittent issues with users reporting decoding errors. * Following the recent upgrade to webauthn there was a change in the way the library expects RPOrigins to be configured. This leads to the Relying Party Origin not being configured and prevents registration. Fix #22507 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add more events details supports for actions (#22680)Lunny Xiao2023-02-014-8/+154
| | | | | | | | | | | | | | | #21937 implemented only basic events based on name because of `act`'s limitation. So I sent a PR to parse all possible events details in https://gitea.com/gitea/act/pulls/11 and it merged. The ref documentation is https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows This PR depends on that and make more detail responses for `push` events and `pull_request` events. And it lefts more events there for future PRs. --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Improve checkbox accessibility a bit by adding the title attribute (#22593)Felipe Leopoldo Sologuren Gutiérrez2023-02-016-11/+12
| | | | | | | EDIT: The main change of this PR was resolved by #22599. This complements that PR for some cases without label and complicated layout to be added. NOTE: Contributed by @Forgejo.
* Add repository setting to enable/disable releases unit (#22671)Brecht Van Lommel2023-02-014-0/+24
| | | | To go along with similar settings for issues, pulls, projects, packages.
* Use relative url in actions view (#22675)Jason Song2023-01-312-6/+6
| | | Use relative url in actions view.
* Fix ref to trigger Actions (#22679)Jason Song2023-01-313-4/+38
| | | | | | | | | | | | | | If triggered by PR, the ref should be `pull/<index>/head` instead of `repo.DefaultBranch`. And improve UI: <img width="493" alt="image" src="https://user-images.githubusercontent.com/9418365/215731280-312564f2-2450-45d0-b986-1accb0670976.png"> Related to #21937.
* Rootless Docker - Mistake with the repo-avatars parent folder name (#22637)Melroy van den Berg2023-01-311-1/+1
| | | | | | | | | | | | There was a mistake when choosing the structure for the repo avatars parent folder and it added a spurious /gitea. The `data` directory should contain folders like: - `attachments/` - `avatars/` - `log/` - `repo-avatars/`
* Fix missing title and filter in issue sidebar project menu (#22557)Brecht Van Lommel2023-01-311-0/+7
| | | These exist in the new issue form but were seemingly forgotten here.
* Fix wrong hint when deleting a branch successfully from pull request UI (#22673)Lunny Xiao2023-01-312-2/+2
| | | Fix #18785
* Add Contributed backport command (#22643)zeripath2023-01-313-18/+481
| | | | | | | | | | | | This PR provides a contributed backport command to help create backports for Gitea. It represents a significant improvement on my previously described shell-script. It can be installed using `go install contrib/backport/backport.go`. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix typo in command-line.en-us.md (#22681)Ivan Maximov2023-01-311-1/+1
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix typo in linked-references.en-us.md (#22682)Ivan Maximov2023-01-311-1/+1
|
* Fix typo in guidelines-backend.en-us.md (#22690)Ivan Maximov2023-01-311-1/+1
|
* Fix typo in storage.en-us.md (#22694)Ivan Maximov2023-01-311-1/+1
|
* Hide collapse icon in diff with no lines (#21094)JakobDev2023-01-311-7/+9
| | | | Sometimes (e.g. renaming a file) nothing of the content is changed. In this case, it makes no sense to show the collapse icon in a diff.
* Fixes accessibility behavior of Watching, Staring and Fork buttons (#22634)Felipe Leopoldo Sologuren Gutiérrez2023-01-311-3/+3
| | | Add tabindex to buttons of repository views.
* Disable test for incoming email (#22686)KN4CK3R2023-01-311-1/+1
| | | | | | Disable this test for the moment because the used imap container image seems unstable which results in many failed CI builds. Co-authored-by: Jason Song <i@wolfogre.com>
* Remove label color from global issue filters (#22660)Francesco Siddi2023-01-311-2/+2
| | | | | | | | | | | | | | | | The use of ui colors (red, green, etc) should be limited to actionable or dismissable entries. Before this commit, a green/red label was used to display issues count on each repository. This did not add any meaningful information to the list. Removing the label reduces ambiguity and makes the list easier to scan visually. ![label_compare](https://user-images.githubusercontent.com/451841/215360696-a881b765-207d-4ffa-8bec-398f8e5dab1e.jpg) --------- Co-authored-by: delvh <dev.lh@web.de>
* Use correct captured group range when parsing cross-reference (#22672)wxiaoguang2023-01-312-4/+4
| | | | | | | Fixes #22666 (Replace #22668) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: zeripath <art27@cantab.net>
* set user visibility class to basic (#22674)yp053272023-01-311-2/+2
| | | | | | | | | | | | Same to https://github.com/go-gitea/gitea/pull/22605 ![user package](https://user-images.githubusercontent.com/18380374/215669905-71fe01c3-c011-4867-97a6-3df5f940a6bf.PNG) ![user projects](https://user-images.githubusercontent.com/18380374/215669909-1a4f74f1-bbde-4913-9ba5-51c44cc63862.PNG) These two page are both used at user and org, so if i fixed the org page, the user page will be also be fixed.
* Fix README TOC links (#22577)crystal2023-01-311-2/+9
| | | | | | Fixes anchored markup links by adding `user-content-` (which is prepended to IDs) Closes https://codeberg.org/Codeberg/Community/issues/894
* Implement actions (#21937)Jason Song2023-01-31117-122/+7539
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close #13539. Co-authored by: @lunny @appleboy @fuxiaohei and others. Related projects: - https://gitea.com/gitea/actions-proto-def - https://gitea.com/gitea/actions-proto-go - https://gitea.com/gitea/act - https://gitea.com/gitea/act_runner ### Summary The target of this PR is to bring a basic implementation of "Actions", an internal CI/CD system of Gitea. That means even though it has been merged, the state of the feature is **EXPERIMENTAL**, and please note that: - It is disabled by default; - It shouldn't be used in a production environment currently; - It shouldn't be used in a public Gitea instance currently; - Breaking changes may be made before it's stable. **Please comment on #13539 if you have any different product design ideas**, all decisions reached there will be adopted here. But in this PR, we don't talk about **naming, feature-creep or alternatives**. ### ⚠️ Breaking `gitea-actions` will become a reserved user name. If a user with the name already exists in the database, it is recommended to rename it. ### Some important reviews - What is `DEFAULT_ACTIONS_URL` in `app.ini` for? - https://github.com/go-gitea/gitea/pull/21937#discussion_r1055954954 - Why the api for runners is not under the normal `/api/v1` prefix? - https://github.com/go-gitea/gitea/pull/21937#discussion_r1061173592 - Why DBFS? - https://github.com/go-gitea/gitea/pull/21937#discussion_r1061301178 - Why ignore events triggered by `gitea-actions` bot? - https://github.com/go-gitea/gitea/pull/21937#discussion_r1063254103 - Why there's no permission control for actions? - https://github.com/go-gitea/gitea/pull/21937#discussion_r1090229868 ### What it looks like <details> #### Manage runners <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205870657-c72f590e-2e08-4cd4-be7f-2e0abb299bbf.png"> #### List runs <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205872794-50fde990-2b45-48c1-a178-908e4ec5b627.png"> #### View logs <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205872501-9b7b9000-9542-4991-8f55-18ccdada77c3.png"> </details> ### How to try it <details> #### 1. Start Gitea Clone this branch and [install from source](https://docs.gitea.io/en-us/install-from-source). Add additional configurations in `app.ini` to enable Actions: ```ini [actions] ENABLED = true ``` Start it. If all is well, you'll see the management page of runners: <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205877365-8e30a780-9b10-4154-b3e8-ee6c3cb35a59.png"> #### 2. Start runner Clone the [act_runner](https://gitea.com/gitea/act_runner), and follow the [README](https://gitea.com/gitea/act_runner/src/branch/main/README.md) to start it. If all is well, you'll see a new runner has been added: <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205878000-216f5937-e696-470d-b66c-8473987d91c3.png"> #### 3. Enable actions for a repo Create a new repo or open an existing one, check the `Actions` checkbox in settings and submit. <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205879705-53e09208-73c0-4b3e-a123-2dcf9aba4b9c.png"> <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205879383-23f3d08f-1a85-41dd-a8b3-54e2ee6453e8.png"> If all is well, you'll see a new tab "Actions": <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205881648-a8072d8c-5803-4d76-b8a8-9b2fb49516c1.png"> #### 4. Upload workflow files Upload some workflow files to `.gitea/workflows/xxx.yaml`, you can follow the [quickstart](https://docs.github.com/en/actions/quickstart) of GitHub Actions. Yes, Gitea Actions is compatible with GitHub Actions in most cases, you can use the same demo: ```yaml name: GitHub Actions Demo run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 on: [push] jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest steps: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - name: Check out repository code uses: actions/checkout@v3 - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - run: echo "🖥️ The workflow is now ready to test your code on the runner." - name: List files in the repository run: | ls ${{ github.workspace }} - run: echo "🍏 This job's status is ${{ job.status }}." ``` If all is well, you'll see a new run in `Actions` tab: <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205884473-79a874bc-171b-4aaf-acd5-0241a45c3b53.png"> #### 5. Check the logs of jobs Click a run and you'll see the logs: <img width="1792" alt="image" src="https://user-images.githubusercontent.com/9418365/205884800-994b0374-67f7-48ff-be9a-4c53f3141547.png"> #### 6. Go on You can try more examples in [the documents](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions) of GitHub Actions, then you might find a lot of bugs. Come on, PRs are welcome. </details> See also: [Feature Preview: Gitea Actions](https://blog.gitea.io/2022/12/feature-preview-gitea-actions/) --------- Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: ChristopherHX <christopher.homberger@web.de> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Pull request yaml template support for including commit body in a field (#22629)Brecht Van Lommel2023-01-301-5/+19
| | | | | | | When using a markdown template the commit body is prepended to text in the description. This adds the same functionality for yaml templates, adding the commit message in a field with id "body". Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Don't return duplicated users who can create org repo (#22560)Gusted2023-01-306-9/+28
| | | | | | | | | | | | | | | - Currently the function `GetUsersWhoCanCreateOrgRepo` uses a query that is able to have duplicated users in the result, this is can happen under the condition that a user is in team that either is the owner team or has permission to create organization repositories. - Add test code to simulate the above condition for user 3, [`TestGetUsersWhoCanCreateOrgRepo`](https://github.com/go-gitea/gitea/blob/a1fcb1cfb84fd6b36c8fe9fd56588119fa4377bc/models/organization/org_test.go#L435) is the test function that tests for this. - The fix is quite trivial use a map keyed by user id in order to drop duplicates. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix poor alignment of organization description on organization home page ↵Brecht Van Lommel2023-01-301-1/+1
| | | | | | | | | (#22656) Don't generate nested `<p>`, use `<div>` like description on the user profile page. Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Issues: support setting issue template field values with query (#22545)techknowlogick2023-01-301-0/+8
|
* Add support for commit cross references (#22645)KN4CK3R2023-01-303-0/+101
| | | | | | | | | | | Fixes #22628 This PR adds cross references for commits by using the format `owner/repo@commit` . References are rendered like [go-gitea/lgtm@6fe88302](#dummy). --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix missing message in git hook when pull requests disabled on fork (#22625)Brecht Van Lommel2023-01-291-10/+13
| | | | | And also the other way around, it would show an non-working URL in the message when pull requests are disabled on the base repository but enabled on the fork.
* Check quota limits for container uploads (#22450)KN4CK3R2023-01-295-31/+106
| | | | The test coverage has revealed that container packages were not checked against the quota limits.
* Consume hcaptcha and pwn deps (#22610)John Olheiser2023-01-2910-24/+530
| | | | | | | | | | | This PR just consumes the [hcaptcha](https://gitea.com/jolheiser/hcaptcha) and [haveibeenpwned](https://gitea.com/jolheiser/pwn) modules directly into Gitea. Also let this serve as a notice that I'm fine with transferring my license (which was already MIT) from my own name to "The Gitea Authors". Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Issues: add Project filter to issues list and search (#22544)techknowlogick2023-01-296-33/+67
| | | | | | | | | | | | Currently only a single project like milestone, not multiple like labels. Implements #14298 Code by @brechtvl --------- Co-authored-by: Brecht Van Lommel <brecht@blender.org>
* Improve accessibility of navigation bar and footer (#22635)Felipe Leopoldo Sologuren Gutiérrez2023-01-293-4/+10
| | | | | | | | | | Added ARIA navigation landmark to navigation bar and aria label for both nav bar and footer. Contributed by @forgejo. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Support system hook API (#14537)Lunny Xiao2023-01-288-78/+450
| | | This add system hook API
* Improve checkIfPRContentChanged (#22611)zeripath2023-01-282-53/+61
| | | | | | | | | | | | | | | | The code for checking if a commit has caused a change in a PR is extremely inefficient and affects the head repository instead of using a temporary repository. This PR therefore makes several significant improvements: * A temporary repo like that used in merging. * The diff code is then significant improved to use a three-way diff instead of comparing diffs (possibly binary) line-by-line - in memory... Ref #22578 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Link issue and pull requests status change in UI notifications directly to ↵Felipe Leopoldo Sologuren Gutiérrez2023-01-281-0/+1
| | | | | | | | | their event in the timelined view. (#22627) Adding the related comment to the issue and pull request status change in the UI notifications allows to navigate directly to the specific event in its dedicated view, easing the reading of last comments and to the editor for additional comments if desired.
* fix permission check for creating comment while mail (#22524)a10121127962023-01-281-1/+7
| | | | | | | | | | | | | | only creating comment on locked issue request write permission, for others, read permission is enough. related to https://github.com/go-gitea/gitea/pull/22056 /cc @KN4CK3R --------- Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix error on account activation with wrong passwd (#22609)Otto Richter (fnetX)2023-01-283-4/+7
| | | | | | | | | | | | | | On activating local accounts, the error message didn't differentiate between using a wrong or expired token, or a wrong password. The result could already be obtained from the behaviour (different screens were presented), but the error message was misleading and lead to confusion for new users on Codeberg with Forgejo. Now, entering a wrong password for a valid token prints a different error message. The problem was introduced in 0f14f69e6070c9aca09f57c419e7d6007d0e520b. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fixes accessibility of empty repository commit status (#22632)Felipe Leopoldo Sologuren Gutiérrez2023-01-281-1/+1
| | | | | | | | | | | | | | | | | | Avoid empty labelled anchor in repo without commits. Contributed by @forgejo. <!-- Please check the following: 1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for bug fixes. 2. Read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md 3. Describe what your pull request does and which issue you're targeting (if any) -->
* Use `--index-url` in PyPi description (#22620)KN4CK3R2023-01-272-1/+3
| | | | | Fixes #22616 Co-authored-by: zeripath <art27@cantab.net>
* Show migration validation error (#22619)KN4CK3R2023-01-271-1/+1
| | | | | | | | Discord request: https://discord.com/channels/322538954119184384/322910365237248000/1067083214096703488 If there is a json schema validation error the full file content gets dumped into the log. That does not help and may be a lot of data. This PR prints the schema validation error message instead.
* Allow issue templates to not render title (#22589)techknowlogick2023-01-262-3/+11
| | | | | | This adds a yaml attribute that will allow the option for when markdown is rendered that the title will be not included in the output Based on work from @brechtvl
* Fix `delete_repo` in template (#22606)John Olheiser2023-01-261-1/+1
| | | | | | | | Currently the value doesn't match the model, so selecting it results in a 500. https://github.com/go-gitea/gitea/blob/e8ac6a9aeacf0adf21982abc51baa8938e5dd6bb/models/auth/token_scope.go#L42 Signed-off-by: jolheiser <john.olheiser@gmail.com>
* set org visibility class to basic in header (#22605)yp053272023-01-261-2/+2
| | | | | | | Fixes https://github.com/go-gitea/gitea/issues/22601 At people and team page, we have red private tag or orange limited tag, but at repo page, it is gray (basic). I think it is better to set them into same color (basic).