summaryrefslogtreecommitdiffstats
path: root/routers (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * activitypub: warn instead of erroroliverpool2024-03-241-1/+3
| |
| * actions artifacts: warn instead of error on invalid requestoliverpool2024-03-243-3/+3
| |
* | Merge pull request 'Allow users to hide all "Add more units..." hints' ↵Earl Warren2024-03-243-0/+21
|\ \ | | | | | | | | | | | | | | | | | | (#2533) from algernon/forgejo:less-is-more into forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2533 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
| * | Allow users to hide all "Add more units..." hintsGergely Nagy2024-03-213-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repositories displaying an "Add more..." tab on the header is a neat way to let people discover they can enable more units. However, displaying it all the time for repository owners, even when they deliberately do not want to enable more units gets noisy very fast. As such, this patch introduces a new setting which lets people disable this hint under the appearance settings. Fixes #2378. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
* | | Merge pull request '[TESTS] webhook forms creation and edition' (#2755) from ↵Earl Warren2024-03-241-2/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | oliverpool/forgejo:webhook_1_tests into forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2755 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
| * | | [TESTS] webhook forms creation and editionoliverpool2024-03-231-2/+3
| | |/ | |/|
* | | Merge pull request '[PORT] Unify search boxes (gitea#29530)' (#2688) from ↵Earl Warren2024-03-244-13/+10
|\ \ \ | |/ / |/| | | | | | | | | | | | | | snematoda/port-29530 into forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2688 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
| * | simplify templateShiny Nematoda2024-03-201-2/+2
| | |
| * | Unify search boxes (#29530)Denys Konovalov2024-03-204-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify all but a few search boxes to use uniform style, uniform translations and shared templates where possible. Remove a few duplicated search templates, e. g. code search. <details><summary>Example after screenshots:</summary> ![grafik](https://github.com/go-gitea/gitea/assets/47871822/e20e7d6b-c6be-4a47-b132-672766f41421) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d5b11b9c-c12f-4a29-8fb0-24e5aa511d18) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d86bb444-36c7-426d-9cf1-c634963dffb1) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/a76c0319-0518-484a-a840-563d02b61198) </details> Also includes #29700 Co-authored-by: 6543 <6543@obermui.de> --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io> Conflicts: routers/web/repo/search.go templates/repo/home.tmpl templates/repo/search.tmpl templates/shared/repo_search.tmpl
* | | Customizable "Open with" applications for repository clone (#29320)wxiaoguang2024-03-233-10/+87
| |/ |/| | | | | | | | | | | | | Users could customize the "clone" menu with their own application URLs on the admin panel. Replace #22378 Close #21121 Close #22149
* | Fix repo badges when the label or text contains dashesGergely Nagy2024-03-201-2/+2
|/ | | | | | | | | | | | | | | | shields.io uses dashes to separate parts of the badge it needs to return. If our label or text parts contain dashes, we need to encode those for shields.io to recognise what we want it to do, and to have the correct text on the badge, too. Fortunately, this is as simple as replacing all dashes with double dashes in both the label and the text parts. We do not need to do the same for the color, because that part is not user controlled. This fixes the badges for cases when a workflow name includes dashes, or when a release's tag name does. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
* Merge pull request '[BUG] Reflect Cargo index state in settings' (#2698) ↵Earl Warren2024-03-201-1/+14
|\ | | | | | | | | | | | | from gusted/forgejo-cargo-index into forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2698 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
| * [BUG] Reflect Cargo index state in settingsGusted2024-03-201-1/+14
| | | | | | | | | | | | | | | | | | | | - Currently in the Cargo section of the packages setting menu two buttons are always shown, "Initalize index" and "Rebuild index", however only of these should be shown depending on the state of the index, if there's no index the "Initalize index" button should be shown and if there's an index the "Rebuild index" button should be shown. This patch does exactly that. - Resolves #2628
* | Fix PR creation via api between branches of same repo with head field ↵norohind2024-03-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | namespaced (#26986) Fix #20175 Current implementation of API does not allow creating pull requests between branches of the same repo when you specify *namespace* (owner of the repo) in `head` field in http request body. --- Although GitHub implementation of API allows performing such action and since Gitea targeting compatibility with GitHub API I see it as an appropriate change. I'm proposing a fix to the described problem and test case which covers this logic. My use-case just in case: https://github.com/go-gitea/gitea/issues/20175#issuecomment-1711283022 (cherry picked from commit ed02d1fab85c9b8206c0af84dcfc3792e61609cf)
* | Fix incorrect menu/link on webhook edit page (#29709)yp053272024-03-201-0/+1
| | | | | | | | | | | | | | | | | | Fix #29699 --------- Co-authored-by: silverwind <me@silverwind.io> (cherry picked from commit 2da13675c0cfdc531044553636c3b74f2fda3eb4)
* | Use relative links for commits, mentions, and issues in markdown (#29427)KN4CK3R2024-03-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #29404 Use relative links for - commits - mentions - issues --------- Co-authored-by: silverwind <me@silverwind.io> (cherry picked from commit 85c59d6c21e10ef9d3ccf11713548f50e47e920f)
* | Refactor to use optional.Option for issue index search option (#29739)65432024-03-203-38/+38
| | | | | | | | | | Signed-off-by: 6543 <6543@obermui.de> (cherry picked from commit 7fd0a5b276aadcf88dcc012fcd364fe160a58810)
* | Use Get but not Post to get actions artifacts (#29734)Lunny Xiao2024-03-201-1/+1
| | | | | | | | | | | | | | (cherry picked from commit 171d3d9a3c891d107001094b9118d93b0b00c02c) Conflicts: routers/web/web.go
* | Some performance optimization on dashboard and issues page (#29010)Lunny Xiao2024-03-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | This PR do some loading speed optimization for feeds user interface pages. - Load action users batchly but not one by one. - Load action repositories batchly but not one by one. - Load action's Repo Owners batchly but not one by one. - Load action's possible issues batchly but not one by one. - Load action's possible comments batchly but not one by one. (cherry picked from commit aed3b53abdd02a3ffbf9e8eb90272ff567333073)
* | remove repetitive words (#29695)pengqiseven2024-03-202-2/+2
| | | | | | | | | | Signed-off-by: pengqiseven <912170095@qq.com> (cherry picked from commit 7f856d5d742dcb6febdb8a3f22cd9a8fecc69a4d)
* | Add a warning for disallowed email domains (#29658)Zettat1232024-03-202-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve #29660 Follow #29522 and #29609 Add a warning for disallowed email domains when admins manually add/edit users. Thanks @yp05327 for the [comment](https://github.com/go-gitea/gitea/pull/29605#issuecomment-1980105119) ![image](https://github.com/go-gitea/gitea/assets/15528715/6737b221-a3a2-4180-9ef8-b846c10f96e0) (cherry picked from commit 4129e0e79bbf30e4297efd33feb2602c40322d10)
* | Use repo object format name instead of detecting from git repository (#29702)Lunny Xiao2024-03-202-12/+2
|/ | | | | | | | | | It's unnecessary to detect the repository object format from git repository. Just use the repository's object format name. (cherry picked from commit 3c6fc25a77c37d50686caa495d27a31dcef7f75f) Conflicts: services/pull/pull.go
* Merge pull request '[PORT] Refactor code_indexer to use an SearchOptions ↵Gusted2024-03-193-4/+33
|\ | | | | | | | | | | | | struct for PerformSearch (gitea#29724)' (#2686) from snematoda/port-29724 into forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2686 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
| * Refactor code_indexer to use an SearchOptions struct for PerformSearch (#29724)65432024-03-183-4/+33
| | | | | | | | | | | | | | | | | | | | similar to how it's already done for the issue_indexer --- *Sponsored by Kithara Software GmbH* Conflicts: routers/web/repo/search.go
* | Merge pull request '[Port] Sync branches to DB immediately when handle git ↵oliverpool2024-03-191-1/+63
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | hook calling gitea#29493' (#2684) from oliverpool/forgejo:sync_branch into forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2684 Reviewed-by: Otto <otto@codeberg.org> Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org>
| * | Sync branches first (gitea#29714)Jason Song2024-03-181-13/+13
| | | | | | | | | | | | | | | | | | Follow gitea#29493. Sync branches to DB first, then trigger push events.
| * | use gitRepo.GetCommit directlyoliverpool2024-03-181-3/+1
| | | | | | | | | | | | and give it a commitID instead of a branchName (a bit more correct and faster)
| * | Sync branches to DB immediately when handle git hook calling (gitea#29493)Jason Song2024-03-181-1/+65
| |/ | | | | | | | | | | | | | | | | | | | | | | Unlike other async processing in the queue, we should sync branches to the DB immediately when handling git hook calling. If it fails, users can see the error message in the output of the git command. It can avoid potential inconsistency issues, and help #29494. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* | Fix #2512 /api/forgejo/v1/version auth check (#2582)Ada2024-03-193-133/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | Add the same auth check and middlewares as the /v1/ API. It require to export some variable from /v1 API, i am not sure if is the correct way to do Co-authored-by: oliverpool <git@olivier.pfad.fr> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2582 Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Ada <ada@gnous.eu> Co-committed-by: Ada <ada@gnous.eu>
* | routers: Minor code cleanup in UsernameSubRouteGergely Nagy2024-03-181-1/+0
|/ | | | | | | | | The `reloadParam` function already calls `context.UserAssignmentWeb` with the same parameters, there's no need to do it again. Change cherry picked from gitea#29751. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
* fix #2501Shiny Nematoda2024-03-141-1/+1
|
* Makefile: check git diff exit-code (#2651)oliverpool2024-03-141-0/+1
| | | | | Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2651 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
* Patch in exact search for meilisearch (#29671)65432024-03-113-6/+6
| | | | | | | | | | | | | | | | | | | | | | meilisearch does not have an search option to contorl fuzzynes per query right now: - https://github.com/meilisearch/meilisearch/issues/1192 - https://github.com/orgs/meilisearch/discussions/377 - https://github.com/meilisearch/meilisearch/discussions/1096 so we have to create a workaround by post-filter the search result in gitea until this is addressed. For future works I added an option in backend only atm, to enable fuzzynes for issue indexer too. And also refactored the code so the fuzzy option is equal in logic to code indexer --- *Sponsored by Kithara Software GmbH* Conflicts: routers/web/repo/search.go trivial context confict s/isMatch/isFuzzy/
* Move get/set default branch from git package to gitrepo package to hide ↵Lunny Xiao2024-03-114-5/+8
| | | | | | | | | | | | | repopath (#29126) (cherry picked from commit 25b842df261452a29570ba89ffc3a4842d73f68c) Conflicts: routers/web/repo/wiki.go services/repository/branch.go services/repository/migrate.go services/wiki/wiki.go also apply to Forgejo specific usage of the refactored functions
* Make runs-on support variable expression (#29468)sillyguodong2024-03-111-68/+12
| | | | | | | | | | | As title. Close issue: https://gitea.com/gitea/act_runner/issues/445 Follow: https://gitea.com/gitea/act/pulls/91 Move `getSecretsOfTask` and `getVariablesOfTask` under `models` because of circular dependency issues. (cherry picked from commit a1f5dd767729e30d07ab42fda80c19f30a72679f)
* Fix 500 when deleting account with incorrect password or unsupported login ↵Lunny Xiao2024-03-111-2/+17
| | | | | | | | | | | type (#29579) Fix #26210 --------- Co-authored-by: Jason Song <i@wolfogre.com> (cherry picked from commit ce8a98f8789a7e4e9ee97ab0abac6064d78fb1f6)
* Cache repository default branch commit status to reduce query on commit ↵Lunny Xiao2024-03-112-22/+10
| | | | | | | | | | | | | | | | status table (#29444) After repository commit status has been introduced on dashaboard, the most top SQL comes from `GetLatestCommitStatusForPairs`. This PR adds a cache for the repository's default branch's latest combined commit status. When a new commit status updated, the cache will be marked as invalid. <img width="998" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/76759de7-3a83-4d54-8571-278f5422aed3"> (cherry picked from commit e308d25f1b2fe24b4735432b05e5e221879a2705)
* Detect broken git hooks (#29494)Jason Song2024-03-111-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Detect broken git hooks by checking if the commit id of branches in DB is the same with the git repo. It can help #29338 #28277 and maybe more issues. Users could complain about actions, webhooks, and activities not working, but they were not aware that it is caused by broken git hooks unless they could see a warning. <img width="1348" alt="image" src="https://github.com/go-gitea/gitea/assets/9418365/2b92a46d-7f1d-4115-bef4-9f970bd695da"> It should be merged after #29493. Otherwise, users could see a ephemeral warning after committing and opening the repo home page immediately. And it also waits for #29495, since the doc link (the anchor part) will be updated. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit a4bcfb8ef1d5b2b522f78c9560d53ddbdbb02218)
* Skip email domain check when admins edit user emails (#29609)Zettat1232024-03-112-2/+2
| | | | | | | | | Follow #29522 Administrators should be able to set a user's email address even if the email address is not in `EMAIL_DOMAIN_ALLOWLIST` (cherry picked from commit 136dd99e86eea9c8bfe61b972a12b395655171e8)
* Skip email domain check when admin users adds user manually (#29522)Zettat1232024-03-112-2/+2
| | | | | | | | | Fix #27457 Administrators should be able to manually create any user even if the user's email address is not in `EMAIL_DOMAIN_ALLOWLIST`. (cherry picked from commit 4fd9c56ed09b31e2f6164a5f534a31c6624d0478)
* Make "/user/login" page redirect if the current user has signed in (#29583)wxiaoguang2024-03-113-11/+64
| | | | | | | Fix #29582 and maybe more. Maybe fix #29116 (cherry picked from commit df1268ca08aaacae54c775a8eec34006dfe365e0)
* Allow options to disable user ssh keys configuration from the interface on ↵Lunny Xiao2024-03-112-0/+27
| | | | | | | | | | | | | | | | | app.ini (#29447) Follow #29275 Extract from #20549 Fix #24716 --------- Co-authored-by: delvh <dev.lh@web.de> (cherry picked from commit 8e12ba34bab7e728ac93ccfaecbe91e053ef1c89) Conflicts: custom/conf/app.example.ini trivial context conflict
* Merge pull request 'Better number for UserCards pagination' (#2584) from ↵Gusted2024-03-111-4/+4
|\ | | | | | | | | | | | | | | 0ko/forgejo:its39 into forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2584 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
| * Better number for UserCards pagination0ko2024-03-071-4/+4
| |
* | Port "Fix wrong test usage of AppSubURL"KN4CK3R2024-03-061-9/+9
|/ | | | | | | - Port of https://github.com/go-gitea/gitea/pull/29459 - The tests use an invalid `setting.AppSubURL`. The wrong behaviour disturbs other PRs like https://github.com/go-gitea/gitea/pull/29222 and https://github.com/go-gitea/gitea/pull/29427.
* Add an trailing slash to dashboard links (#29555)wxiaoguang2024-03-061-0/+17
| | | | | | | | | | | Fix #29533, and add some tests for "base/paginate.tmpl" (cherry picked from commit 8553b4600e3035b6f6ad6907c37cebd013fa4d64) Conflicts: services/contexttest/context_tests.go trivial conflict because "Improve user experience for outdated comments" was skipped
* Fix 500 when pushing release to an empty repo (#29554)Nanguan Lin2024-03-061-0/+5
| | | | | | | | As title. The former code directly used `ctx.Repo.GitRepo`, causing 500. https://github.com/go-gitea/gitea/blob/22b4f0c09f1de5e581929bd10f39833d30d2c482/routers/api/v1/repo/release.go#L241 (cherry picked from commit 6e2aafd5130cb9436f02209ae90bf79a58cc13ae)
* Filter Repositories by type (#29231)Tim-Niclas Oelschläger2024-03-064-0/+90
| | | | | | | | | | | | | | Filter Repositories by type (resolves #1170, #1318) before: ![image](https://github.com/go-gitea/gitea/assets/72873130/74e6be62-9010-4ab4-8f9b-bd8afbebb8fb) after: ![image](https://github.com/go-gitea/gitea/assets/72873130/e4d85ed6-7864-4150-8d72-5194dac1293f) (cherry picked from commit e3524c63d6d42865ea8288af89b372544d35474b)
* Fix incorrect cookie path for AppSubURL (#29534)wxiaoguang2024-03-061-0/+1
| | | | | | Regression of #24107 (cherry picked from commit 44398e405ffe297997c6b9c8dbb97f966926b65a)
* Add option to set language in admin user view (#28449)65432024-03-061-0/+1
| | | | | | | | | | | | | ![image](https://github.com/go-gitea/gitea/assets/24977596/be7e3f92-af3f-4628-b4ed-abf6439687f3) `/admin/users/<UserID>/edit` ![image](https://github.com/go-gitea/gitea/assets/24977596/906af0dd-cceb-4ed9-9cd9-32c71ae1bf71) `/admin/users/<UserID>` --- *Sponsored by Kithara Software GmbH* (cherry picked from commit e3e6569c5fd8c69aa65384e6d1636cc14b23a32b)