summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Do some missing checks (#28423) (#28432)Lunny Xiao2023-12-123-3/+62
| | | backport #28423
* Deprecate query string auth tokens (#28390) (#28430)Giteabot2023-12-125-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #28390 by @jackHay22 ## Changes - Add deprecation warning to `Token` and `AccessToken` authentication methods in swagger. - Add deprecation warning header to API response. Example: ``` HTTP/1.1 200 OK ... Warning: token and access_token API authentication is deprecated ... ``` - Add setting `DISABLE_QUERY_AUTH_TOKEN` to reject query string auth tokens entirely. Default is `false` ## Next steps - `DISABLE_QUERY_AUTH_TOKEN` should be true in a subsequent release and the methods should be removed in swagger - `DISABLE_QUERY_AUTH_TOKEN` should be removed and the implementation of the auth methods in question should be removed ## Open questions - Should there be further changes to the swagger documentation? Deprecation is not yet supported for security definitions (coming in [OpenAPI Spec version 3.2.0](https://github.com/OAI/OpenAPI-Specification/issues/2506)) - Should the API router logger sanitize urls that use `token` or `access_token`? (This is obviously an insufficient solution on its own) Co-authored-by: Jack Hay <jack@allspice.io> Co-authored-by: delvh <dev.lh@web.de>
* Recover from panic in cron task (#28409) (#28425)Giteabot2023-12-121-5/+7
| | | | | | | | | | | | | | | | | Backport #28409 by @earl-warren - Currently there's code to recover gracefully from panics that happen within the execution of cron tasks. However this recover code wasn't being run, because `RunWithShutdownContext` also contains code to recover from any panic and then gracefully shutdown Forgejo. Because `RunWithShutdownContext` registers that code as last, that would get run first which in this case is not behavior that we want. - Move the recover code to inside the function, so that is run first before `RunWithShutdownContext`'s recover code (which is now a noop). Fixes: https://codeberg.org/forgejo/forgejo/issues/1910 Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: Gusted <postmaster@gusted.xyz>
* Improve doctor cli behavior (#28422) (#28424)Giteabot2023-12-113-34/+66
| | | | | | | | | | Backport #28422 by wxiaoguang 1. Do not sort the "checks" slice again and again when "Register", it just wastes CPU when the Gitea instance runs 2. If a check doesn't exist, tell the end user 3. Add some tests Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix links in docs (#28302) (#28418)Giteabot2023-12-115-10/+6
| | | | | | | | | | | | | Backport #28302 by @yp05327 Close #28287 ## How to test it in local convert Makefile L34 into: ``` cd .tmp/upstream-docs && git clean -f && git reset --hard && git fetch origin pull/28302/head:pr28302 && git switch pr28302 ``` Co-authored-by: yp05327 <576951401@qq.com>
* Also sync DB branches on push if necessary (#28361) (#28403)Lunny Xiao2023-12-1112-69/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #28056 Backport #28361 This PR will check whether the repo has zero branch when pushing a branch. If that, it means this repository hasn't been synced. The reason caused that is after user upgrade from v1.20 -> v1.21, he just push branches without visit the repository user interface. Because all repositories routers will check whether a branches sync is necessary but push has not such check. For every repository, it has two states, synced or not synced. If there is zero branch for a repository, then it will be assumed as non-sync state. Otherwise, it's synced state. So if we think it's synced, we just need to update branch/insert new branch. Otherwise do a full sync. So that, for every push, there will be almost no extra load added. It's high performance than yours. For the implementation, we in fact will try to update the branch first, if updated success with affect records > 0, then all are done. Because that means the branch has been in the database. If no record is affected, that means the branch does not exist in database. So there are two possibilities. One is this is a new branch, then we just need to insert the record. Another is the branches haven't been synced, then we need to sync all the branches into database.
* Fix missing check (#28406) (#28411)Giteabot2023-12-112-4/+24
| | | | | Backport #28406 by @lunny Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* enable system users search via the API (#28013) (#28018)Giteabot2023-12-083-12/+49
| | | | | | | | | | | | Backport #28013 by @earl-warren Refs: https://codeberg.org/forgejo/forgejo/issues/1403 (cherry picked from commit dd4d17c159eaf8b642aa9e6105b0532e25972bb7) --------- Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix Docker meta action for releases (#28232) (#28395)Giteabot2023-12-072-3/+4
|
* Make gogit Repository.GetBranchNames consistent (#28348) (#28386)Giteabot2023-12-071-13/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #28348 by @AdamMajer nogogit GetBranchNames() lists branches sorted in reverse commit date order. On the other hand the gogit implementation doesn't apply any ordering resulting in unpredictable behaviour. In my case, the unit tests requiring particular order fail repo_branch_test.go:24: Error Trace: ./gitea/modules/git/repo_branch_test.go:24 Error: elements differ extra elements in list A: ([]interface {}) (len=1) { (string) (len=6) "master" } extra elements in list B: ([]interface {}) (len=1) { (string) (len=7) "branch1" } listA: ([]string) (len=2) { (string) (len=6) "master", (string) (len=7) "branch2" } listB: ([]string) (len=2) { (string) (len=7) "branch1", (string) (len=7) "branch2" } Test: TestRepository_GetBranches To fix this, we sort branches based on their commit date in gogit implementation. Fixes: #28318 Co-authored-by: Adam Majer <amajer@suse.de>
* Fix margin in server signed signature verification view (#28379) (#28381)Giteabot2023-12-071-1/+1
| | | | | | | | | | | | | Backport #28379 by @lafriks Before: ![image](https://github.com/go-gitea/gitea/assets/165205/e2e2256d-03c5-4ab8-8ed9-08ef68571a43) After: ![image](https://github.com/go-gitea/gitea/assets/165205/804132ef-18f9-4ab8-949d-f6c71e7f4d24) Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix object does not exist error when checking citation file (#28314) (#28369)Giteabot2023-12-061-13/+6
| | | | | | | | | | | Backport #28314 by @yp05327 Fix #28264 `DataAsync()` will be called twice. Caused by https://github.com/go-gitea/gitea/pull/27958. I'm sorry, I didn't completely remove all unnecessary codes. Co-authored-by: yp05327 <576951401@qq.com>
* Fix incorrect default value of `[attachment].MAX_SIZE` (#28373) (#28376)Giteabot2023-12-061-1/+1
| | | | | | | | | Backport #28373 by @capvor In the documents, the `[attachment] MAX_SIZE` default value should be 4. Reference the source code `modules/setting/attachment.go` line 29. Co-authored-by: capvor <capvor@sina.com>
* Use `filepath` instead of `path` to create SQLite3 database file (#28374) ↵Giteabot2023-12-061-2/+1
| | | | | | | (#28378) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Fix #28300
* Fix the runs will not be displayed bug when the main branch have no ↵Giteabot2023-12-062-1/+2
| | | | | | | | | | | | | | workflows but other branches have (#28359) (#28365) Backport #28359 by @lunny The left menu will only display the default branch's workflows but the right side will display the runs triggered by all branches' workflows. So we cannot hide right side if default branch has no workflows. Fix #28332 Replace #28333 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* handle repository.size column being NULL in migration v263 (#28336) (#28363)Giteabot2023-12-051-1/+6
| | | | Co-authored-by: Nate Levesque <nate@thenaterhood.com>
* Convert git commit summary to valid UTF8. (#28356) (#28358)Giteabot2023-12-051-1/+2
| | | | | | | | | | | Backport #28356 by @darrinsmart The summary string ends up in the database, and (at least) MySQL & PostgreSQL require valid UTF8 strings. Fixes #28178 Co-authored-by: darrinsmart <darrin@djs.to> Co-authored-by: Darrin Smart <darrin@filmlight.ltd.uk>
* Fix migration panic due to an empty review comment diff (#28334) (#28362)Giteabot2023-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Backport #28334 by @lng2020 Fix #28328 ``` func (p *PullRequestComment) GetDiffHunk() string { if p == nil || p.DiffHunk == nil { return "" } return *p.DiffHunk } ``` This function in the package `go-github` may return an empty diff. When it's empty, the following code will panic because it access `ss[1]` https://github.com/go-gitea/gitea/blob/ec1feedbf582b05b6a5e8c59fb2457f25d053ba2/services/migrations/gitea_uploader.go#L861-L867 https://github.com/go-gitea/gitea/blob/ec1feedbf582b05b6a5e8c59fb2457f25d053ba2/modules/git/diff.go#L97-L101 Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
* Add `HEAD` support for rpm repo files (#28309) (#28360)Giteabot2023-12-053-2/+35
| | | | | | | | | | | | | | | Backport #28309 by @KN4CK3R Fixes https://codeberg.org/forgejo/forgejo/issues/1810 zypper uses HEAD requests to check file existence. https://github.com/openSUSE/libzypp/blob/HEAD/zypp/RepoManager.cc#L2549 https://github.com/openSUSE/libzypp/blob/HEAD/zypp-curl/ng/network/private/downloaderstates/basicdownloader_p.cc#L116 @ExplodingDragon fyi Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Refactor template empty checks (#28351) (#28354)Giteabot2023-12-0511-23/+23
| | | | | | | | | | | | Backport #28351 by @KN4CK3R Fix #28347 As there is no info how to reproduce it, I can't test it. Fix may be `section_split.tmpl @ 126/130`. Other changes are "empty check" refactorings. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix RPM/Debian signature key creation (#28352) (#28353)Giteabot2023-12-052-4/+3
| | | | | | | | | | | Backport #28352 by @KN4CK3R Fixes #28324 The name parameter can't contain some characters (https://github.com/keybase/go-crypto/blob/master/openpgp/keys.go#L680) but is optional. Therefore just use an empty string. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Keep profile tab when clicking on Language (#28320) (#28331)Giteabot2023-12-031-1/+1
| | | | | | | Backport #28320 by @JakobDev Fixes https://codeberg.org/Codeberg/Community/issues/1355 Co-authored-by: JakobDev <jakobdev@gmx.de>
* Fix missing issue search index update when changing status (#28325) (#28330)Giteabot2023-12-031-0/+22
| | | | | | | | | Backport #28325 by @brechtvl Changing an issue status, assignee, labels or milestone without also adding a comment would not update the index, resulting in wrong search results. Co-authored-by: Brecht Van Lommel <brecht@blender.org>
* Fix wrong link in `protect_branch_name_pattern_desc` (#28313) (#28315)Giteabot2023-12-011-1/+1
| | | | | | | | Backport #28313 by @yp05327 The current href will link to `https://domain/owner/repo/settings/branches/github.com/gobwas/glob` Co-authored-by: yp05327 <576951401@qq.com>
* Read `previous` info from git blame (#28306) (#28310)Giteabot2023-12-013-54/+49
| | | | | | | | | | Backport #28306 by @KN4CK3R Fixes #28280 Reads the `previous` info from the `git blame` output instead of calculating it afterwards. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Ignore "non-existing" errors when getDirectorySize calculates the size ↵wxiaoguang2023-11-301-11/+12
| | | | | | | | | | | (#28276) (#28285) Backport #28276 The git command may operate the git directory (add/remove) files in any time. So when the code iterates the directory, some files may disappear during the "walk". All "IsNotExist" errors should be ignored.
* Use appSubUrl for OAuth2 callback URL tip (#28266) (#28275)Giteabot2023-11-301-2/+3
| | | | | | | | | | | | | Backport #28266 by @earl-warren - When crafting the OAuth2 callbackURL take into account `appSubUrl`, which is quite safe given that its strictly formatted. - No integration testing as this is all done in Javascript. - Resolves https://codeberg.org/forgejo/forgejo/issues/1795 (cherry picked from commit 27cb6b7956136f87aa78067d9adb5a4c4ce28a24) Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: Gusted <postmaster@gusted.xyz>
* Meilisearch: require all query terms to be matched (#28293) (#28296)Giteabot2023-11-291-4/+5
| | | | Co-authored-by: Brecht Van Lommel <brecht@blender.org>
* Fix required error for token name (#28267) (#28284)Giteabot2023-11-291-1/+1
| | | | | | | | | | | | Backport #28267 by @earl-warren - Say to the binding middleware which locale should be used for the required error. - Resolves https://codeberg.org/forgejo/forgejo/issues/1683 (cherry picked from commit 5a2d7966127b5639332038e9925d858ab54fc360) Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: Gusted <postmaster@gusted.xyz>
* Fix issue will be detected as pull request when checking `First-time ↵Giteabot2023-11-291-1/+1
| | | | | | | | | contributor` (#28237) (#28271) Backport #28237 by @yp05327 Fix #28224 Co-authored-by: yp05327 <576951401@qq.com>
* Check for v prefix on tags for release clean name (#28257) (#28270)Giteabot2023-11-282-2/+2
| | | | Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Use full width for project boards (#28225) (#28245)Giteabot2023-11-273-53/+59
| | | | | | | Backport #28225 by @denyskon Inspired by #28182 Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
* Increase "version" when update the setting value to a same value as before ↵Giteabot2023-11-282-1/+13
| | | | | | | | | | (#28243) (#28244) Backport #28243 Setting the same value should not trigger DuplicateKey error, and the "version" should be increased Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Revert move installation/upgrade-from-gogs.md in 1.21 (#28235)yp053272023-11-272-0/+2
| | | https://github.com/go-gitea/gitea/pull/28233#discussion_r1405539630
* Fix links in docs (#28234) (#28238)Giteabot2023-11-273-3/+3
| | | | | | | | | | | | | Backport #28234 by @yp05327 Follow #28191 Changes: - `(doc/administration/config-cheat-sheet.md` is incorrect: ![image](https://github.com/go-gitea/gitea/assets/18380374/1c417dd7-61a0-49ba-8d50-871fd4c9bf20) - remove `../../` Co-authored-by: yp05327 <576951401@qq.com>
* Change log for 1.21.1 (#28222)v1.21.1Lunny Xiao2023-11-261-0/+27
| | | | | | | As title. --------- Co-authored-by: delvh <dev.lh@web.de>
* Fix comment permissions (#28213) (#28216)Lunny Xiao2023-11-2541-129/+441
| | | | | | | backport #28213 This PR will fix some missed checks for private repositories' data on web routes and API routes.
* Fix actions when tagging (#28061) (#28218)Giteabot2023-11-252-1/+9
| | | | | | | | Backport #28061 by @lunny close https://github.com/go-gitea/gitea/issues/28053 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Docs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup ↵Giteabot2023-11-252-2/+2
| | | | | | | | | | | | | | | (#28205) (#28208) Backport #28205 by @CodeShakingSheep In the [docs for email setup](https://docs.gitea.com/administration/email-setup) `mailer.IS_TLS_ENABLED` is mentioned which was replaced by `mailer.PROTOCOL` in release 1.18.0 according to https://blog.gitea.com/release-of-1.18.0/ . This change wasn't reflected in the docs for email setup. I just replaced the deprecated mailer setting. Co-authored-by: CodeShakingSheep <19874562+CodeShakingSheep@users.noreply.github.com>
* Fix some incorrect links in docs (#28191) (#28201)Giteabot2023-11-247-7/+5
| | | | | | | | | | | | Backport #28191 by @yp05327 https://gitea.com/gitea/gitea-docusaurus/actions/runs/661/jobs/0#jobstep-9-39 I noticed that there are many warning logs in building docs. It is causing 404 in docs.gitea.com now, so we need to fix it. And there are also some other problems in v1.19 which can not be done in this PR. Co-authored-by: yp05327 <576951401@qq.com>
* Fix delete-orphaned-repos (#28200) (#28202)pitpalme2023-11-241-2/+2
| | | | | | | | | Backport #28200 gitea doctor failed at checking and fixing 'delete-orphaned-repos', because table name 'user' needs quoting to be correctly recognized by at least PostgreSQL. fixes #28199
* Use full width for PR comparison (#28182) (#28186)Giteabot2023-11-231-2/+2
| | | | | | | | | | | | | | Backport #28182 by @lng2020 Follow-up #22844 close #28142 Before ![ksnip_20231123-183906](https://github.com/go-gitea/gitea/assets/70063547/78428a22-b0a0-45f9-9458-7fd5ec73aa29) After ![full](https://github.com/go-gitea/gitea/assets/70063547/047242cf-9d6c-4b3a-9f92-54102740c27e) Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
* Make CORS work for oauth2 handlers (#28184) (#28185)Giteabot2023-11-233-0/+10
| | | | | | | | | | Backport #28184 Fix #25473 Although there was `m.Post("/login/oauth/access_token", CorsHandler()...`, it never really worked, because it still lacks the "OPTIONS" handler. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix missing buttons (#28179) (#28181)Giteabot2023-11-231-0/+4
| | | | | | | | | | | | | Backport #28179 by @lng2020 fix #28173 regression #25948 That PR is supposed to only change the style but somehow delete a code snippet. See the diff(https://github.com/go-gitea/gitea/pull/25948/files#diff-7c36d66fe058f4ff9f2beaac73cf710dca45b350d0dd98daf806828a4745fe62L125-L129) for details. Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Revert "Fix EOL handling in web editor" (#28101) (#28172)Giteabot2023-11-223-22/+6
| | | | | | | | Backport #28101 by @lng2020 Reverts go-gitea/gitea#27141 close #28097 Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
* Fix swagger title (#28164) (#28167)Giteabot2023-11-222-2/+2
| | | | | | | | | Backport #28164 by @yp05327 ![image](https://github.com/go-gitea/gitea/assets/18380374/380859b2-a643-42fd-b53e-78c93c05c826) Don't know why there's a `.` behind. 🤔 Co-authored-by: yp05327 <576951401@qq.com>
* Fix the description about the default setting for action in quick start ↵Giteabot2023-11-222-2/+2
| | | | | | | | | | | | document (#28160) (#28168) Backport #28160 by @yp05327 Since #27054, Actions are enabled by default. so we should also edit the document. 😃 ps: I think this should be backport to 1.21.0. Co-authored-by: yp05327 <576951401@qq.com>
* Add guide page to actions when there's no workflows (#28145) (#28153)Giteabot2023-11-224-0/+16
| | | | | | | | | | | | | Backport #28145 by @yp05327 Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/599d40c1-9b8d-4189-9286-c9c36fb780dd) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/848a73d1-aaec-478f-93a7-adcc7ee18907) Co-authored-by: yp05327 <576951401@qq.com>
* Do not display search box when there's no packages yet (#28146) (#28159)Giteabot2023-11-221-0/+2
| | | | | | | | | | | | | | | | | Backport #28146 by @yp05327 Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/3012f544-7ff5-4ccb-ac80-ce24d50abe97) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/4084312a-9ac0-4103-8c93-ea178ae24493) ![image](https://github.com/go-gitea/gitea/assets/18380374/3c47d175-0735-476d-8979-da2bc0a4fc95) ![image](https://github.com/go-gitea/gitea/assets/18380374/033c6a81-d1f7-4426-8063-5793d0b47462) Co-authored-by: yp05327 <576951401@qq.com>
* Fix no ActionTaskOutput table waring (#28149) (#28152)Giteabot2023-11-211-0/+4
| | | | | | | | | | | | | | | | | | | Backport #28149 by @yp05327 Reproduce: - Create a new Gitea instance - Register a runner - Create a repo and add a workflow - Check the log, you will see warnings: ![image](https://github.com/go-gitea/gitea/assets/18380374/5f1278e0-114b-48bc-8113-8ba1404d9975) It comes from: ![image](https://github.com/go-gitea/gitea/assets/18380374/c2807831-e137-4229-9536-87f6114c8a5b) The reason is that we forgot registering `ActionTaskOutput` model. So `action_table_output` table will be missing in your db. Co-authored-by: yp05327 <576951401@qq.com>