aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* Add API endpoint to get latest release (#21267)JakobDev2023-01-264-0/+96
| | | | | | This PR adds a new API endpoint to get the latest stable release of a repo, similar to [GitHub API](https://docs.github.com/en/rest/releases/releases#get-the-latest-release).
* Add ARIA support for Fomantic UI checkboxes (#22599)wxiaoguang2023-01-252-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Replace #22593 This is a general approach to add ARIA support for all Fomantic UI checkboxes (including radioboxes) * Pros: * General approach, it works for all Fomantic UI checkboxes / radioboxes * No need to write IDs manually everywhere * No need to tell new contributors to write IDs again and again * Cons: * Slightly affects performance, but it's really trivial, because there was already a heavy `$('.ui.checkbox').checkbox()` for Fomantic UI before. So everything is still fine. Screenshot (from the repo setting page, which has various checkboxes): <details> ![image](https://user-images.githubusercontent.com/2114189/214480937-3a54d36f-55c3-49de-9c45-c4bb21f1f4c6.png) </details>
* Webhooks: for issue close/reopen action, add commit ID that caused it (#22583)Brecht Van Lommel2023-01-2415-21/+25
| | | | | | | | The `commit_id` property name is the same as equivalent functionality in GitHub. If the action was not caused by a commit, an empty string is used. This can for example be used to automatically add a Resolved label to an issue fixed by a commit, or clear it when the issue is reopened.
* Add templates to customize text when creating and migrating repositoriesBrecht Van Lommel2023-01-244-4/+5
| | | | | These can be used to explain which types of repositories a Gitea instance is willing to host, or other rules for creating repositories.
* Prevent duplicate labels when importing more than 99 (#22591)Sybren2023-01-241-1/+1
| | | | | | | | | | | Importing labels (via `gitea restore-repo`) did not split them up into batches properly. The first "batch" would create all labels, the second "batch" would create all labels except those in the first "batch", etc. This meant that when importing more than 99 labels (the batch size) there would always be duplicate ones. This is solved by actually passing `labels[:lbBatchSize]` to the `CreateLabels()` function, instead of the entire list `labels`.
* Remove address from DCO (#22595)Yarden Shoham2023-01-241-3/+1
| | | I copy-pasted from https://developercertificate.org/
* Allow setting `redirect_to` cookie on OAuth login (#22594)Sybren2023-01-241-0/+5
| | | | | | | | | | | | | | The regular login flow can use a `redirect_to` cookie to ensure the user ends their authentication flow on the same page as where they started it. This commit adds the same functionality to the OAuth login URLs, so that you can use URLs like these to directly use a specific OAuth provider: `/user/oauth2/{provider}?redirect_to={post-login path}` Only the `auth.SignInOAuth()` function needed a change for this, as the rest of the login flow is aware of this cookie and uses it properly already.
* Project links should use parent link methods (#22587)John Olheiser2023-01-231-2/+2
| | | | | | Instead of re-creating, these should use the available `Link` methods from the "parent" of the project, which also take sub-urls into account. Signed-off-by: jolheiser <john.olheiser@gmail.com>
* link update in README files (#22582)rekayno2023-01-232-8/+8
| | | Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Frontport 1.18.2 and 1.18.3 Changelogs (#22580)John Olheiser2023-01-231-0/+19
| | | | | Frontport #22530 #22575 Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix incorrect Redis URL snippets in the example app.ini (#22573)tiny69962023-01-231-4/+4
| | | | | Fixes #22571 Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
* Prevent multiple `To` recipients (#22566)KN4CK3R2023-01-227-20/+23
| | | | | | Change the mailer interface to prevent leaking of possible hidden email addresses when sending to multiple recipients. Co-authored-by: Gusted <williamzijl7@hotmail.com>
* gitlab supports ssh key signing (#22564)techknowlogick2023-01-221-1/+1
|
* Address feedback from #22517 (#22563)Francesco Siddi2023-01-211-4/+5
| | | | - use octicons for icon - use fomantic for centering the link
* Fix bug on user setting (#22539)Lunny Xiao2023-01-211-4/+10
| | | | | Fix #22537 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Update JS dependencies (#22538)silverwind2023-01-21294-1535/+1257
| | | | | | | | | | - Update all JS dependencies - Add new eslint rules - Rebuild SVGs - Tested citation and build SVG changes are because of https://github.com/primer/octicons/pull/883. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Split default gitpod view to include all tasks (#22555)Yarden Shoham2023-01-201-4/+6
| | | | | It was showing only the `docs` process Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
* fix: read:org scope (#22556)John Olheiser2023-01-201-2/+2
| | | | | | Hard to see in the diff, but this was duplicated in the wrong section. ![read-org](https://user-images.githubusercontent.com/42128690/213774506-9b47ce23-d2e5-4dfd-af49-6ae4947ac724.png)
* Pull Requests: add color to approved/reject icon in pull requests listBrecht Van Lommel2023-01-201-2/+2
| | | | Makes it easier to scan the list of pull requests and see the status.
* Truncate commit summary on repo files table. (#22551)zeripath2023-01-201-0/+5
| | | | | | | | | | | | | | There was an unintended regression in #21124 which assumed that `.commits-list .message-wrapper` would only match the commit summaries on `/{owner}/{name}/commits/*`. This assumption is incorrect as the directory/file view also uses a `.commits-list` wrapper. Rather than completely restructure this page this PR simply adjusts the styling to again use `display: inline-block;` for `#repo-files-table .commit-list .message-wrapper` Fix #22360 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Support org/user level projects (#22235)Lunny Xiao2023-01-2030-176/+1556
| | | | | | | | Fix #13405 <img width="1151" alt="image" src="https://user-images.githubusercontent.com/81045/209442911-7baa3924-c389-47b6-b63b-a740803e640e.png"> Co-authored-by: 6543 <6543@obermui.de>
* Fix template bug of access scope (#22540)Lunny Xiao2023-01-201-1/+1
| | | | | Fix https://github.com/go-gitea/gitea/pull/20908#discussion_r1082075526 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Mute all links in issue timeline (#22533)silverwind2023-01-201-49/+49
| | | | | | | | | | | | | | | | https://github.com/go-gitea/gitea/pull/21799 introduced a regression where some links in the issue timeline were not muted any more. Fix it by replacing all `class="text grey"` with `class="text grey muted-links"` in the file. Before: <img width="384" alt="Screenshot 2023-01-19 at 22 23 05" src="https://user-images.githubusercontent.com/115237/213565351-1bb82f4e-fa72-4cd7-8e36-e527bbfe5c5f.png"> After: <img width="377" alt="Screenshot 2023-01-19 at 22 23 11" src="https://user-images.githubusercontent.com/115237/213565359-87e14855-6599-472a-be0b-61297b168f9a.png"> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* When updating by rebase we need to set the environment for head repo (#22535)zeripath2023-01-192-10/+18
| | | | | | | | | | | | | | | | | The update by rebase code reuses the merge code but shortcircuits and pushes back up to the head. However, it doesn't set the correct pushing environment - and just uses the same environment as the base repo. This leads to the push update failing and thence the PR becomes out-of-sync with the head. This PR fixes this and adjusts the trace logging elsewhere to help make this clearer. Fix #18802 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Fix assignment to `cm.AssigneeID` when importing comments (#22528)Sybren2023-01-191-1/+3
| | | | | | | | | | | This is a fix for https://github.com/go-gitea/gitea/pull/22510 The code assumed that the `AssigneeID` from the comment YAML was an `int64`, but it is actually an `int`, causing a panic. It also had no check on whether the type cast was actually valid, so badly formatted YAML could also cause a panic. Both these issues have been fixed.
* Dropzone: Add "Copy link" button for new uploads (#22517)Francesco Siddi2023-01-191-0/+15
| | | | | | | Once an attachment is successfully uploaded via Dropzone, display a "Copy link" under the "Remove file" button. Once the button is clicked, depending if the attachment is an image or a file, the appropriate markup is written to the clipboard, so it can be conveniently pasted in the description.
* Support importing comment types (#22510)Sybren2023-01-184-2/+39
| | | | | | | | | | | | | | | | | | | | This commit adds support for specifying comment types when importing with `gitea restore-repo`. It makes it possible to import issue changes, such as "title changed" or "assigned user changed". An earlier version of this pull request was made by Matti Ranta, in https://future.projects.blender.org/blender-migration/gitea-bf/pulls/3 There are two changes with regard to Matti's original code: 1. The comment type was an `int64` in Matti's code, and is now using a string. This makes it possible to use `comment_type: title`, which is more reliable and future-proof than an index into an internal list in the Gitea Go code. 2. Matti's code also had support for including labels, but in a way that would require knowing the database ID of the labels before the import even starts, which is impossible. This can be solved by using label names instead of IDs; for simplicity I I left that out of this PR.
* Fix issue not auto-closing when it includes a reference to a branch (#22514)Brecht Van Lommel2023-01-181-1/+3
| | | | Ensure branch prefix is stripped away for both when comparing the branch name.
* Fix invalid issue branch reference if not specified in template (#22513)Brecht Van Lommel2023-01-181-1/+2
| | | | When an issue template does not contain a ref, it would end up with an invalid `ref/heads/` value instead of having no branch referenced .
* Fix 500 error viewing pull request when fork has pull requests disabled (#22512)Brecht Van Lommel2023-01-181-0/+3
| | | | | | Swallow error just like in #20839, for the case where there is no protected branch. Fixes #20826 for me, though I can't tell if this now covers all cases.
* Load asciicast css async (#22502)Jason Song2023-01-182-3/+4
| | | | | Load asciicast css asynchronously. Related to #22448.
* Reliable selection of admin user (#22509)Sybren2023-01-181-1/+4
| | | | | | | | | | | | | When importing a repository via `gitea restore-repo`, external users will get remapped to an admin user. This admin user is obtained via `users.GetAdminUser()`, which unfortunately picks a more-or-less random admin to return. This makes it hard to predict which admin user will get assigned. This patch orders the admin by ascending ID before choosing the first one, i.e. it picks the admin with the lowest ID. Even though it would be nicer to have full control over which user is chosen, this at least gives us a predictable result.
* Display unreferenced packages total size in package admin panel (#22498)Lunny Xiao2023-01-186-10/+29
|
* Simplify the error message when `index.js` couldn't be loaded (#22354)wxiaoguang2023-01-171-1/+1
| | | | | | | | | | | In some cases, the loading failure of `index.js` is not related to the ROOT_URL directly, ex: https://gitea.com/gitea/helm-chart/issues/392 If the user's reversed proxy is mis-configured: `http://public-domain/gitea/xxx` -> `http://gitea:3000/gitea/xxx`, it also causes the loading failure. So this PR removes the ROOT_URL related tip from the error message.
* Support asciicast files as new markup (#22448)Jason Song2023-01-189-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support [asciicast files](https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md) as a new markup via [asciinema-player](https://github.com/asciinema/asciinema-player). For more on asciinema, see the [introduction](https://asciinema.org/). So users can use asciinema recorder to generate an asciicast file (or you can download a sample file from https://asciinema.org/a/335480.cast?dl=1), then upload it to Gitea and play it on Gitea. Snapshots: <details> ## Upload asciicast files <img width="1134" alt="image" src="https://user-images.githubusercontent.com/9418365/212461061-cc2c7181-0e14-4534-af55-1ec60a639fd1.png"> ## Open an asciicast file <img width="1137" alt="image" src="https://user-images.githubusercontent.com/9418365/212461090-a3b5141f-4894-430d-a2b4-ea257801a0ed.png"> ## Play it <img width="1144" alt="image" src="https://user-images.githubusercontent.com/9418365/212461157-4e82db69-0e41-471d-928f-ac1fe0737105.png"> ## Copy contents from the "video" <img width="1145" alt="image" src="https://user-images.githubusercontent.com/9418365/212461286-211612bc-15d6-427a-89a9-6abff5c6a0a5.png"> ## View the source <img width="1140" alt="image" src="https://user-images.githubusercontent.com/9418365/212461187-05473b2d-ba3d-4072-84a6-4aa1e7d82182.png"> </details> Known issue: Don't support the [v1 version asciicast files](https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v1.md), it's a poorly designed version, it does not specify the file extension and uses `*.json` usually, so it's impossible to recognize the files. Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Support scoped access tokens (#20908)Chongyi Zheng2023-01-1779-448/+1220
| | | | | | | | | | | | | | | | | | | | | | | | | | | This PR adds the support for scopes of access tokens, mimicking the design of GitHub OAuth scopes. The changes of the core logic are in `models/auth` that `AccessToken` struct will have a `Scope` field. The normalized (no duplication of scope), comma-separated scope string will be stored in `access_token` table in the database. In `services/auth`, the scope will be stored in context, which will be used by `reqToken` middleware in API calls. Only OAuth2 tokens will have granular token scopes, while others like BasicAuth will default to scope `all`. A large amount of work happens in `routers/api/v1/api.go` and the corresponding `tests/integration` tests, that is adding necessary scopes to each of the API calls as they fit. - [x] Add `Scope` field to `AccessToken` - [x] Add access control to all API endpoints - [x] Update frontend & backend for when creating tokens - [x] Add a database migration for `scope` column (enable 'all' access to past tokens) I'm aiming to complete it before Gitea 1.19 release. Fixes #4300
* some refactor about code comments (#20821)Lunny Xiao2023-01-177-188/+260
|
* docs: add swagger.json file location to FAQ (#22489)John Olheiser2023-01-171-0/+2
| | | | | | This just adds a mention on how to get the `swagger.json` for an instance. Signed-off-by: jolheiser <john.olheiser@gmail.com>
* docs: bump Gitea version (#22490)John Olheiser2023-01-171-1/+1
| | | | | Forgot to do this with the frontport Signed-off-by: jolheiser <john.olheiser@gmail.com>
* chore: changelog 1.18.1 (#22471) (#22487)John Olheiser2023-01-171-0/+41
| | | | | Frontport #22471 Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fixed lint warnings in Grafana raised by Mixtool (#22486)Emily2023-01-171-3/+9
| | | | | | | | | | | | This PR introduces a few minor changes to the gitea-monitoring-mixin, specifically linting issues raised by [Mixtool](https://github.com/monitoring-mixins/mixtool): - Query selectors using `job` and `instance` have been update to allow multi-select - Added missing attributes to `job` and `instance` template As this change is very minor I haven't created an issue, but please let me know if you'd like me to do so. According to the guidelines, it seemed to only be for larger designs :)
* Set disable_gravatar/enable_federated_avatar when offline mode is true (#22479)Jason Song2023-01-172-0/+37
| | | | When offline mode is true, we should set `disable_gravatar` to `true` and `enable_federated_avatar` to `false` in system settings.
* Fix pull request API field `closed_at` always being `null` (#22482)Yarden Shoham2023-01-171-0/+4
| | | Fix #22480