]> source.dussan.org Git - gitea.git/log
gitea.git
9 months agoInclude heap pprof in diagnosis report to help debugging memory leaks (#28596) (...
Giteabot [Sun, 24 Dec 2023 01:18:43 +0000 (09:18 +0800)]
Include heap pprof in diagnosis report to help debugging memory leaks (#28596) (#28599)

9 months agoFix wrong due date rendering in issue list page (#28588) (#28591)
Giteabot [Fri, 22 Dec 2023 17:25:43 +0000 (01:25 +0800)]
Fix wrong due date rendering in issue list page (#28588) (#28591)

Backport #28588 by @yardenshoham

It included the hours, minutes, and seconds. By removing these, the date
renders correctly.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
9 months agoFix `status_check_contexts` matching bug (#28582) (#28589)
Giteabot [Fri, 22 Dec 2023 15:32:22 +0000 (23:32 +0800)]
Fix `status_check_contexts` matching bug (#28582) (#28589)

Backport #28582 by @Zettat123

Fix #28570
Follow #24633

---
Copied from
https://github.com/go-gitea/gitea/issues/28570#issuecomment-1867327999

The feature introduced in #24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.

https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663

Co-authored-by: Zettat123 <zettat123@gmail.com>
9 months agoFix 405 method not allowed CORS / OIDC (#28583) (#28586)
Giteabot [Fri, 22 Dec 2023 12:55:43 +0000 (20:55 +0800)]
Fix 405 method not allowed CORS / OIDC (#28583) (#28586)

Backport #28583 by @morphelinho

Follow #28184
Follow #28515

Fix problem with 405 method not allowed for CORS wrt OIDC

Co-authored-by: morphelinho <morphelinho@users.noreply.github.com>
9 months agoFix 500 error of searching commits (#28576) (#28579)
Giteabot [Fri, 22 Dec 2023 02:29:28 +0000 (10:29 +0800)]
Fix 500 error of searching commits (#28576) (#28579)

Backport #28576 by wxiaoguang

Regression of #28454 . Now the string is escaped HTML, so it doesn't
need `| Safe`.

Fix #28575

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoimprove possible performance bottleneck (#28547) (#28578)
Giteabot [Thu, 21 Dec 2023 23:37:08 +0000 (07:37 +0800)]
improve possible performance bottleneck (#28547) (#28578)

Backport #28547 by @lunny

Replace #28500

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoUse information from previous blame parts (#28572) (#28577)
Giteabot [Thu, 21 Dec 2023 22:47:34 +0000 (06:47 +0800)]
Use information from previous blame parts (#28572) (#28577)

Backport #28572 by @KN4CK3R

Fixes #28545

`git blame` output can contain blocks without commit information if it
was outputted before (the `0dafa97ea3f6d9662299579e5be1875cd28baaae 48
26 1` line):
```
fec25436488499df7231f63b857f66457c193d5c 24 25 1
author Bastien Montagne
author-mail <bastien@blender.org>
author-time 1660731031
author-tz +0200
committer Bastien Montagne
committer-mail <bastien@blender.org>
committer-time 1660731031
committer-tz +0200
summary LibOverride: Add Make/Reset/Clear entries to IDTemplate contextual menu.
previous 839ece6477203382b7a7483062961540180ff1cd source/blender/editors/interface/interface_ops.c
filename source/blender/editors/interface/interface_ops.c
        #include "BLT_translation.h"
0dafa97ea3f6d9662299579e5be1875cd28baaae 48 26 1

3d57bc4397fca53bc9702a27bbf50102827829b0 27 27 1
author Hans Goudey
author-mail <hans@blender.org>
author-time 1700131315
author-tz +0100
committer Hans Goudey
committer-mail <hooglyboogly@noreply.localhost>
committer-time 1700131315
committer-tz +0100
summary Cleanup: Move several blenkernel headers to C++
previous 451c054d9b7d3148a646caa5a72fb127a5b5c408 source/blender/editors/interface/interface_ops.cc
filename source/blender/editors/interface/interface_ops.cc
        #include "BKE_context.hh"
```
This PR reuses data from the previous blame part to fill these gaps.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
9 months agoUpdate mermaid for 1.21 (#28571)
wxiaoguang [Thu, 21 Dec 2023 12:14:50 +0000 (20:14 +0800)]
Update mermaid for 1.21 (#28571)

Try to fix #28170

9 months agoAdd changelog for 1.21.3 (#28569) v1.21.3
Lunny Xiao [Thu, 21 Dec 2023 07:47:15 +0000 (15:47 +0800)]
Add changelog for 1.21.3 (#28569)

9 months agoFix merging artifact chunks error when minio storage basepath is set (#28555) (#28568)
Giteabot [Thu, 21 Dec 2023 07:38:39 +0000 (15:38 +0800)]
Fix merging artifact chunks error when minio storage basepath is set (#28555) (#28568)

Backport #28555 by @fuxiaohei

Related to  https://github.com/go-gitea/gitea/issues/28279

When merging artifact chunks, it lists chunks from storage. When storage
is minio, chunk's path contains `MINIO_BASE_PATH` that makes merging
break.

<del>So trim the `MINIO_BASE_PATH` when handle chunks.</del>

Update the chunk file's basename to retain necessary information. It
ensures that the directory in the chunk's path remains unaffected.

Co-authored-by: FuXiaoHei <fuxiaohei@vip.qq.com>
9 months agoUpdate actions document about comparsion as Github Actions (#28560) (#28564)
Giteabot [Wed, 20 Dec 2023 21:00:30 +0000 (05:00 +0800)]
Update actions document about comparsion as Github Actions (#28560) (#28564)

Backport #28560 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoFix inperformant query on retrifing review from database. (#28552) (#28562)
Giteabot [Wed, 20 Dec 2023 15:55:08 +0000 (23:55 +0800)]
Fix inperformant query on retrifing review from database. (#28552) (#28562)

Backport #28552 by @6543

can we please PLEAS PLEASE only use raw SQL statements if it is relay
needed!!!

source is https://github.com/go-gitea/gitea/pull/28544 (before
refactoring)

Co-authored-by: 6543 <m.huber@kithara.com>
9 months agoFix the issue ref rendering for wiki (#28556) (#28559)
Giteabot [Wed, 20 Dec 2023 14:51:25 +0000 (22:51 +0800)]
Fix the issue ref rendering for wiki (#28556) (#28559)

Backport #28556 by wxiaoguang

Fix #28526, regression of
* #26365

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoFix duplicate ID when deleting repo (#28520) (#28528)
Giteabot [Tue, 19 Dec 2023 08:40:03 +0000 (16:40 +0800)]
Fix duplicate ID when deleting repo (#28520) (#28528)

Backport #28520 by @framitdavid

There is an accessibility issue in the interface when attempting to
delete a repository. When I click on "Delete repository," a dialog box
appears, requiring confirmation to proceed with the repository deletion.
However, when I press the "Repo name" label, the wrong input field gains
focus. The focused field is located behind the dialog and is intended
for renaming the repository.

I am submitting these pull requests to ensure that the correct input
field is focused when the user clicks on the label. This change will
also facilitate the writing of tests using Playwright or Testing Library
to retrieve elements based on roles. This PR will also improve
acessibility of this area.

Co-authored-by: David Øvrelid <46874830+framitdavid@users.noreply.github.com>
9 months agoOnly check online runner when detecting matching runners in workflows (#28286) (...
Giteabot [Tue, 19 Dec 2023 04:06:31 +0000 (12:06 +0800)]
Only check online runner when detecting matching runners in workflows (#28286) (#28512)

Backport #28286 by @yp05327

Mentioned:
[#28277](https://github.com/go-gitea/gitea/issues/28277#issuecomment-1831325276)

We should only check online runner when detecting matching runners in
workflows,
as if runner is not online, the workflow will not run.

![image](https://github.com/go-gitea/gitea/assets/18380374/11855e9d-7241-4b7a-b8d7-49dbb94ba1c5)

Co-authored-by: yp05327 <576951401@qq.com>
9 months agochore(api): support ignore password if login source type is LDAP for creating user...
Giteabot [Tue, 19 Dec 2023 03:14:06 +0000 (11:14 +0800)]
chore(api): support ignore password if login source type is LDAP for creating user API (#28491) (#28525)

Backport #28491 by @appleboy

- Modify the `Password` field in `CreateUserOption` struct to remove the
`Required` tag
- Update the `v1_json.tmpl` template to include the `email` field and
remove the `password` field

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
9 months agoUpdate golang.org/x/crypto (#28519)
wxiaoguang [Mon, 18 Dec 2023 23:04:21 +0000 (07:04 +0800)]
Update golang.org/x/crypto (#28519)

ref: https://groups.google.com/g/golang-announce/c/qA3XtxvMUyg,
CVE-2023-48795, https://go.dev/issue/64784

9 months agoImprove the prompt for "ssh-keygen sign" (#28509) (#28510)
Giteabot [Mon, 18 Dec 2023 15:25:52 +0000 (23:25 +0800)]
Improve the prompt for "ssh-keygen sign" (#28509) (#28510)

Backport #28509 by wxiaoguang

Close #28505

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
9 months agoAdd option to disable ambiguous unicode characters detection (#28454) (#28499)
wxiaoguang [Mon, 18 Dec 2023 04:20:37 +0000 (12:20 +0800)]
Add option to disable ambiguous unicode characters detection (#28454) (#28499)

Backport #28454 (the only conflict is caused by some comments)

* Close #24483
* Close #28123
* Close #23682
* Close #23149

10 months agoInitalize stroage for orphaned repository doctor (#28487) (#28490)
Giteabot [Sat, 16 Dec 2023 14:06:37 +0000 (22:06 +0800)]
Initalize stroage for orphaned repository doctor (#28487) (#28490)

Backport #28487 by @earl-warren

- When a repository is orphaned and has objects stored in any of the
storages such as repository avatar or attachments the delete function
would error, because the storage module wasn't initalized.
- Add code to initialize the storage module.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1954

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
10 months agoUpdate docs for DISABLE_QUERY_AUTH_TOKEN (#28485) (#28488)
Giteabot [Sat, 16 Dec 2023 05:04:05 +0000 (13:04 +0800)]
Update docs for DISABLE_QUERY_AUTH_TOKEN (#28485) (#28488)

Backport #28485 by @kdumontnu

As described
[here](https://github.com/go-gitea/gitea/pull/28390#issuecomment-1857553331).

Co-authored-by: Kyle D <kdumontnu@gmail.com>
10 months agoRefactor SSH clone URL generation code (#28421) (#28480)
Giteabot [Fri, 15 Dec 2023 06:54:40 +0000 (14:54 +0800)]
Refactor SSH clone URL generation code (#28421) (#28480)

Backport #28421 by wxiaoguang

Refactor the code and add tests, keep the old logic.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoPolyfill SubmitEvent for PaleMoon (#28441) (#28478)
Giteabot [Fri, 15 Dec 2023 03:04:37 +0000 (11:04 +0800)]
Polyfill SubmitEvent for PaleMoon (#28441) (#28478)

Backport #28441 by wxiaoguang

Fix #28319

It only polyfills if there is no "SubmitEvent" class, so it has no side
effect for most users.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoFix Chinese translation of config cheat sheet[API] (#28472) (#28473)
Giteabot [Thu, 14 Dec 2023 23:54:32 +0000 (07:54 +0800)]
Fix Chinese translation of config cheat sheet[API] (#28472) (#28473)

Backport #28472 by @CaiCandong

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
10 months agoFix documents for "custom/public/assets/" (#28465) (#28467)
Giteabot [Thu, 14 Dec 2023 09:00:39 +0000 (17:00 +0800)]
Fix documents for "custom/public/assets/" (#28465) (#28467)

Backport #28465 by wxiaoguang

Fix #28463

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoRetry SSH key verification with additional CRLF if it failed (#28392) (#28464)
Giteabot [Thu, 14 Dec 2023 04:50:26 +0000 (12:50 +0800)]
Retry SSH key verification with additional CRLF if it failed (#28392) (#28464)

Backport #28392 by @nekrondev

Windows-based shells will add a CRLF when piping the token into
ssh-keygen command resulting in
verification error. This resolves #21527.

Co-authored-by: nekrondev <heiko@noordsee.de>
Co-authored-by: Heiko Besemann <heiko.besemann@qbeyond.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoAdd endpoint for not implemented Docker auth (#28457) (#28462)
Giteabot [Wed, 13 Dec 2023 21:06:24 +0000 (05:06 +0800)]
Add endpoint for not implemented Docker auth (#28457) (#28462)

Backport #28457 by @KN4CK3R

Recently Docker started to use the optional `POST /v2/token` endpoint
which should respond with a `404 Not Found` status code instead of the
current `405 Method Not Allowed`.

> Note: Not all token servers implement oauth2. If the request to the
endpoint returns 404 using the HTTP POST method, refer to Token
Documentation for using the HTTP GET method supported by all token
servers.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
10 months agoFix possible nil pointer access (#28428) (#28440)
Giteabot [Tue, 12 Dec 2023 15:35:32 +0000 (23:35 +0800)]
Fix possible nil pointer access (#28428) (#28440)

Backport #28428 by @KN4CK3R

There could be a nil pointer exception if the file is not found because
that specific error is suppressed but not handled.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
10 months agoDon't show unnecessary citation JS error on UI (#28433) (#28437)
Giteabot [Tue, 12 Dec 2023 13:14:04 +0000 (21:14 +0800)]
Don't show unnecessary citation JS error on UI (#28433) (#28437)

Backport #28433 by wxiaoguang

Fix #28226

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months ago1.21.2 changelog (#28387) v1.21.2
techknowlogick [Tue, 12 Dec 2023 06:23:54 +0000 (22:23 -0800)]
1.21.2 changelog (#28387)

To be rebuilt with latest golang version

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 months agoDo some missing checks (#28423) (#28432)
Lunny Xiao [Tue, 12 Dec 2023 06:20:18 +0000 (14:20 +0800)]
Do some missing checks (#28423) (#28432)

backport #28423

10 months agoDeprecate query string auth tokens (#28390) (#28430)
Giteabot [Tue, 12 Dec 2023 05:45:00 +0000 (13:45 +0800)]
Deprecate query string auth tokens (#28390) (#28430)

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>
10 months agoRecover from panic in cron task (#28409) (#28425)
Giteabot [Tue, 12 Dec 2023 03:28:56 +0000 (11:28 +0800)]
Recover from panic in cron task (#28409) (#28425)

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>
10 months agoImprove doctor cli behavior (#28422) (#28424)
Giteabot [Mon, 11 Dec 2023 16:28:27 +0000 (00:28 +0800)]
Improve doctor cli behavior (#28422) (#28424)

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>
10 months agoFix links in docs (#28302) (#28418)
Giteabot [Mon, 11 Dec 2023 14:53:59 +0000 (22:53 +0800)]
Fix links in docs (#28302) (#28418)

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>
10 months agoAlso sync DB branches on push if necessary (#28361) (#28403)
Lunny Xiao [Mon, 11 Dec 2023 06:16:56 +0000 (14:16 +0800)]
Also sync DB branches on push if necessary (#28361) (#28403)

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.

10 months agoFix missing check (#28406) (#28411)
Giteabot [Mon, 11 Dec 2023 01:10:48 +0000 (09:10 +0800)]
Fix missing check (#28406) (#28411)

Backport #28406 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 months agoenable system users search via the API (#28013) (#28018)
Giteabot [Fri, 8 Dec 2023 21:46:08 +0000 (05:46 +0800)]
enable system users search via the API (#28013) (#28018)

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>
10 months agoFix Docker meta action for releases (#28232) (#28395)
Giteabot [Fri, 8 Dec 2023 00:29:17 +0000 (08:29 +0800)]
Fix Docker meta action for releases (#28232) (#28395)

10 months agoMake gogit Repository.GetBranchNames consistent (#28348) (#28386)
Giteabot [Thu, 7 Dec 2023 18:03:27 +0000 (02:03 +0800)]
Make gogit Repository.GetBranchNames consistent (#28348) (#28386)

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>
10 months agoFix margin in server signed signature verification view (#28379) (#28381)
Giteabot [Thu, 7 Dec 2023 02:37:12 +0000 (10:37 +0800)]
Fix margin in server signed signature verification view (#28379) (#28381)

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>
10 months agoFix object does not exist error when checking citation file (#28314) (#28369)
Giteabot [Wed, 6 Dec 2023 22:06:51 +0000 (06:06 +0800)]
Fix object does not exist error when checking citation file (#28314) (#28369)

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>
10 months agoFix incorrect default value of `[attachment].MAX_SIZE` (#28373) (#28376)
Giteabot [Wed, 6 Dec 2023 19:32:23 +0000 (03:32 +0800)]
Fix incorrect default value of `[attachment].MAX_SIZE` (#28373) (#28376)

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>
10 months agoUse `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378)
Giteabot [Wed, 6 Dec 2023 17:22:18 +0000 (01:22 +0800)]
Use `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Fix #28300

10 months agoFix the runs will not be displayed bug when the main branch have no workflows but...
Giteabot [Wed, 6 Dec 2023 07:28:00 +0000 (15:28 +0800)]
Fix the runs will not be displayed bug when the main branch have no 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>
10 months agohandle repository.size column being NULL in migration v263 (#28336) (#28363)
Giteabot [Tue, 5 Dec 2023 14:51:56 +0000 (22:51 +0800)]
handle repository.size column being NULL in migration v263 (#28336) (#28363)

Co-authored-by: Nate Levesque <nate@thenaterhood.com>
10 months agoConvert git commit summary to valid UTF8. (#28356) (#28358)
Giteabot [Tue, 5 Dec 2023 09:19:08 +0000 (17:19 +0800)]
Convert git commit summary to valid UTF8. (#28356) (#28358)

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>
10 months agoFix migration panic due to an empty review comment diff (#28334) (#28362)
Giteabot [Tue, 5 Dec 2023 08:58:15 +0000 (16:58 +0800)]
Fix migration panic due to an empty review comment diff (#28334) (#28362)

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>
10 months agoAdd `HEAD` support for rpm repo files (#28309) (#28360)
Giteabot [Tue, 5 Dec 2023 08:24:57 +0000 (16:24 +0800)]
Add `HEAD` support for rpm repo files (#28309) (#28360)

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>
10 months agoRefactor template empty checks (#28351) (#28354)
Giteabot [Tue, 5 Dec 2023 06:07:15 +0000 (14:07 +0800)]
Refactor template empty checks (#28351) (#28354)

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>
10 months agoFix RPM/Debian signature key creation (#28352) (#28353)
Giteabot [Tue, 5 Dec 2023 05:42:41 +0000 (13:42 +0800)]
Fix RPM/Debian signature key creation (#28352) (#28353)

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>
10 months agoKeep profile tab when clicking on Language (#28320) (#28331)
Giteabot [Sun, 3 Dec 2023 14:54:53 +0000 (22:54 +0800)]
Keep profile tab when clicking on Language (#28320) (#28331)

Backport #28320 by @JakobDev

Fixes https://codeberg.org/Codeberg/Community/issues/1355

Co-authored-by: JakobDev <jakobdev@gmx.de>
10 months agoFix missing issue search index update when changing status (#28325) (#28330)
Giteabot [Sun, 3 Dec 2023 11:43:17 +0000 (19:43 +0800)]
Fix missing issue search index update when changing status (#28325) (#28330)

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>
10 months agoFix wrong link in `protect_branch_name_pattern_desc` (#28313) (#28315)
Giteabot [Fri, 1 Dec 2023 12:06:08 +0000 (20:06 +0800)]
Fix wrong link in `protect_branch_name_pattern_desc` (#28313) (#28315)

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>
10 months agoRead `previous` info from git blame (#28306) (#28310)
Giteabot [Fri, 1 Dec 2023 07:27:35 +0000 (15:27 +0800)]
Read `previous` info from git blame (#28306) (#28310)

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>
10 months agoIgnore "non-existing" errors when getDirectorySize calculates the size (#28276) ...
wxiaoguang [Thu, 30 Nov 2023 16:39:16 +0000 (00:39 +0800)]
Ignore "non-existing" errors when getDirectorySize calculates the size (#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.

10 months agoUse appSubUrl for OAuth2 callback URL tip (#28266) (#28275)
Giteabot [Thu, 30 Nov 2023 00:26:47 +0000 (08:26 +0800)]
Use appSubUrl for OAuth2 callback URL tip (#28266) (#28275)

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>
10 months agoMeilisearch: require all query terms to be matched (#28293) (#28296)
Giteabot [Wed, 29 Nov 2023 15:38:04 +0000 (23:38 +0800)]
Meilisearch: require all query terms to be matched (#28293) (#28296)

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
10 months agoFix required error for token name (#28267) (#28284)
Giteabot [Wed, 29 Nov 2023 15:00:32 +0000 (23:00 +0800)]
Fix required error for token name (#28267) (#28284)

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>
10 months agoFix issue will be detected as pull request when checking `First-time contributor...
Giteabot [Wed, 29 Nov 2023 02:49:33 +0000 (10:49 +0800)]
Fix issue will be detected as pull request when checking `First-time contributor` (#28237) (#28271)

Backport #28237 by @yp05327

Fix #28224

Co-authored-by: yp05327 <576951401@qq.com>
10 months agoCheck for v prefix on tags for release clean name (#28257) (#28270)
Giteabot [Tue, 28 Nov 2023 22:02:26 +0000 (06:02 +0800)]
Check for v prefix on tags for release clean name (#28257) (#28270)

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
10 months agoUse full width for project boards (#28225) (#28245)
Giteabot [Mon, 27 Nov 2023 18:20:53 +0000 (02:20 +0800)]
Use full width for project boards (#28225) (#28245)

Backport #28225 by @denyskon

Inspired by #28182

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
10 months agoIncrease "version" when update the setting value to a same value as before (#28243...
Giteabot [Mon, 27 Nov 2023 17:58:39 +0000 (01:58 +0800)]
Increase "version" when update the setting value to a same value as before (#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>
10 months agoRevert move installation/upgrade-from-gogs.md in 1.21 (#28235)
yp05327 [Mon, 27 Nov 2023 14:28:48 +0000 (23:28 +0900)]
Revert move installation/upgrade-from-gogs.md in 1.21 (#28235)

https://github.com/go-gitea/gitea/pull/28233#discussion_r1405539630

10 months agoFix links in docs (#28234) (#28238)
Giteabot [Mon, 27 Nov 2023 07:36:15 +0000 (15:36 +0800)]
Fix links in docs (#28234) (#28238)

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>
10 months agoChange log for 1.21.1 (#28222) v1.21.1
Lunny Xiao [Sun, 26 Nov 2023 10:33:07 +0000 (18:33 +0800)]
Change log for 1.21.1 (#28222)

As title.

---------

Co-authored-by: delvh <dev.lh@web.de>
10 months agoFix comment permissions (#28213) (#28216)
Lunny Xiao [Sat, 25 Nov 2023 23:43:23 +0000 (07:43 +0800)]
Fix comment permissions (#28213) (#28216)

backport #28213

This PR will fix some missed checks for private repositories' data on
web routes and API routes.

10 months agoFix actions when tagging (#28061) (#28218)
Giteabot [Sat, 25 Nov 2023 18:46:08 +0000 (02:46 +0800)]
Fix actions when tagging (#28061) (#28218)

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>
10 months agoDocs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup (#28205) (...
Giteabot [Sat, 25 Nov 2023 07:41:01 +0000 (15:41 +0800)]
Docs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup (#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>
10 months agoFix some incorrect links in docs (#28191) (#28201)
Giteabot [Fri, 24 Nov 2023 19:55:08 +0000 (03:55 +0800)]
Fix some incorrect links in docs (#28191) (#28201)

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>
10 months agoFix delete-orphaned-repos (#28200) (#28202)
pitpalme [Fri, 24 Nov 2023 19:54:14 +0000 (20:54 +0100)]
Fix delete-orphaned-repos (#28200) (#28202)

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

10 months agoUse full width for PR comparison (#28182) (#28186)
Giteabot [Thu, 23 Nov 2023 16:14:20 +0000 (00:14 +0800)]
Use full width for PR comparison (#28182) (#28186)

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>
10 months agoMake CORS work for oauth2 handlers (#28184) (#28185)
Giteabot [Thu, 23 Nov 2023 14:27:00 +0000 (22:27 +0800)]
Make CORS work for oauth2 handlers (#28184) (#28185)

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>
10 months agoFix missing buttons (#28179) (#28181)
Giteabot [Thu, 23 Nov 2023 11:24:34 +0000 (19:24 +0800)]
Fix missing buttons (#28179) (#28181)

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>
10 months agoRevert "Fix EOL handling in web editor" (#28101) (#28172)
Giteabot [Wed, 22 Nov 2023 10:06:13 +0000 (18:06 +0800)]
Revert "Fix EOL handling in web editor" (#28101) (#28172)

Backport #28101 by @lng2020

Reverts go-gitea/gitea#27141
close #28097

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
10 months agoFix swagger title (#28164) (#28167)
Giteabot [Wed, 22 Nov 2023 09:06:38 +0000 (17:06 +0800)]
Fix swagger title (#28164) (#28167)

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>
10 months agoFix the description about the default setting for action in quick start document...
Giteabot [Wed, 22 Nov 2023 08:46:11 +0000 (16:46 +0800)]
Fix the description about the default setting for action in quick start 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>
10 months agoAdd guide page to actions when there's no workflows (#28145) (#28153)
Giteabot [Wed, 22 Nov 2023 02:29:54 +0000 (10:29 +0800)]
Add guide page to actions when there's no workflows (#28145) (#28153)

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>
10 months agoDo not display search box when there's no packages yet (#28146) (#28159)
Giteabot [Wed, 22 Nov 2023 02:07:13 +0000 (10:07 +0800)]
Do not display search box when there's no packages yet (#28146) (#28159)

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>
10 months agoFix no ActionTaskOutput table waring (#28149) (#28152)
Giteabot [Tue, 21 Nov 2023 14:23:57 +0000 (22:23 +0800)]
Fix no ActionTaskOutput table waring (#28149) (#28152)

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>
10 months agoFix empty action run title (#28113) (#28148)
Giteabot [Tue, 21 Nov 2023 04:28:14 +0000 (12:28 +0800)]
Fix empty action run title (#28113) (#28148)

Backport #28113 by @lunny

Fix #27901

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 months agoUse "is-loading" to avoid duplicate form submit for code comment (#28143) (#28147)
Giteabot [Tue, 21 Nov 2023 04:02:58 +0000 (12:02 +0800)]
Use "is-loading" to avoid duplicate form submit for code comment (#28143) (#28147)

Backport #28143 by @wxiaoguang

Compare by ignoring spaces:
https://github.com/go-gitea/gitea/pull/28143/files?diff=split&w=1

When the form is going to be submitted, add the "is-loading" class to
show an indicator and avoid user UI events.

When the request finishes (success / error), remove the "is-loading"
class to make user can interact the UI.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoFix typo in `packages.cleanup.success` (#28133) (#28136)
Giteabot [Mon, 20 Nov 2023 13:43:40 +0000 (21:43 +0800)]
Fix typo in `packages.cleanup.success` (#28133) (#28136)

Backport #28133 by @wolfogre

Follow
https://github.com/go-gitea/gitea/pull/28129#discussion_r1398971596

Co-authored-by: Jason Song <i@wolfogre.com>
10 months agoAdd missing `packages.cleanup.success` (#28129) (#28132)
Giteabot [Mon, 20 Nov 2023 09:39:54 +0000 (17:39 +0800)]
Add missing `packages.cleanup.success` (#28129) (#28132)

Backport #28129 by @wolfogre

Co-authored-by: Jason Song <i@wolfogre.com>
10 months agoUpdate docs for docusaurus v3 (#28126)
John Olheiser [Mon, 20 Nov 2023 05:24:50 +0000 (23:24 -0600)]
Update docs for docusaurus v3 (#28126)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
10 months agoFix Matrix and MSTeams nil dereference (#28089) (#28105)
Giteabot [Fri, 17 Nov 2023 13:50:45 +0000 (21:50 +0800)]
Fix Matrix and MSTeams nil dereference (#28089) (#28105)

Backport #28089 by @KN4CK3R

Fixes #28088
Fixes #28094

Added missing tests.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
10 months agoChange default size of attachments and repo files (#28100) (#28106)
Giteabot [Fri, 17 Nov 2023 12:30:42 +0000 (20:30 +0800)]
Change default size of attachments and repo files (#28100) (#28106)

Backport #28100 by @lng2020

https://github.com/go-gitea/gitea/pull/27946 forgets to change them in
code. Sorry about that.

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
10 months agoFix incorrect pgsql conn builder behavior (#28085) (#28098)
Giteabot [Fri, 17 Nov 2023 10:45:04 +0000 (18:45 +0800)]
Fix incorrect pgsql conn builder behavior (#28085) (#28098)

Backport #28085 by @wxiaoguang

Fix #28083 and fix the tests

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months agoFix permissions for Token DELETE endpoint to match GET and POST (#27610) (#28099)
Giteabot [Fri, 17 Nov 2023 04:24:16 +0000 (12:24 +0800)]
Fix permissions for Token DELETE endpoint to match GET and POST (#27610) (#28099)

Backport #27610 by @evantobin

Fixes #27598

In #27080, the logic for the tokens endpoints were updated to allow
admins to create and view tokens in other accounts. However, the same
functionality was not added to the DELETE endpoint. This PR makes the
DELETE endpoint function the same as the other token endpoints and adds
unit tests

Co-authored-by: Evan Tobin <me@evantob.in>
11 months agoFix system config cache expiration timing (#28072) (#28090)
Giteabot [Thu, 16 Nov 2023 13:37:57 +0000 (21:37 +0800)]
Fix system config cache expiration timing (#28072) (#28090)

Backport #28072

To avoid unnecessary database access, the `cacheTime` should always be
set if the revision has been checked.

Fix #28057

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
11 months agoRestricted users only see repos in orgs which their team was assigned to (#28025...
Giteabot [Tue, 14 Nov 2023 15:44:46 +0000 (23:44 +0800)]
Restricted users only see repos in orgs which their team was assigned to (#28025) (#28051)

Backport #28025 by @6543

---
*Sponsored by Kithara Software GmbH*

Co-authored-by: 6543 <m.huber@kithara.com>
11 months agoAdd v1.21.0 changelog (#28005) (#28048) v1.21.0
Denys Konovalov [Tue, 14 Nov 2023 14:02:59 +0000 (15:02 +0100)]
Add v1.21.0 changelog (#28005) (#28048)

Backport changelog for v1.21.0 as Giteabot doesn't seem to be in the
mood for it

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
11 months agoenable system users for comment.LoadPoster (#28014) (#28032)
Giteabot [Tue, 14 Nov 2023 13:50:05 +0000 (21:50 +0800)]
enable system users for comment.LoadPoster (#28014) (#28032)

Backport #28014 by @earl-warren

System users (Ghost, ActionsUser, etc) have a negative id and may be the
author of a comment, either because it was created by a now deleted user
or via an action using a transient token.

The GetPossibleUserByID function has special cases related to system
users and will not fail if given a negative id.

Refs: https://codeberg.org/forgejo/forgejo/issues/1425

(cherry picked from commit 6a2d2fa24390116d31ae2507c0a93d423f690b7b)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
11 months agoFix viewing wiki commit on empty repo (#28040) (#28044)
Giteabot [Tue, 14 Nov 2023 13:49:12 +0000 (21:49 +0800)]
Fix viewing wiki commit on empty repo (#28040) (#28044)

Backport #28040 by @JakobDev

Fixes https://codeberg.org/forgejo/forgejo/issues/1758

For some weird reason we need to cast this nil.

Co-authored-by: JakobDev <jakobdev@gmx.de>
11 months agoAdd word break to the repo list in admin settings page (#28034) (#28035)
Giteabot [Tue, 14 Nov 2023 06:31:43 +0000 (14:31 +0800)]
Add word break to the repo list in admin settings page (#28034) (#28035)

Backport #28034 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/ed464937-e20d-4f5b-b997-e86c2d96469d)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/471e77b3-516e-4ae9-b901-0cf8745eb9aa)

Co-authored-by: yp05327 <576951401@qq.com>
11 months agofixed duplicate attachments on dump on windows (#28019) (#28031)
Giteabot [Tue, 14 Nov 2023 01:56:21 +0000 (09:56 +0800)]
fixed duplicate attachments on dump on windows (#28019) (#28031)

Backport #28019 by @anudeepreddy

Hi,

This PR fixes #27988. The use of `path.join`(which uses `/` as the file
separator) to construct paths and comparing them with paths constructed
using `filepath.join`(which uses platform specific file separator) is
the root cause of this issue.

The desired behavior is to ignore attachments when dumping data
directory. Due to the what's mentioned above, the function
`addRecursiveExclude` is not actually ignoring the attachments directory
and is being written to the archive. The attachment directory is again
added to the archive (with different file separator as mentioned in the
issue) causing a duplicate entry on windows.

The solution is to use `filepath.join` in `addResursiveExclude` to
construct `currentAbsPath`.

Co-authored-by: Anudeep Reddy <anudeepc85@gmail.com>
11 months agoDont leak private users via extensions (#28023) (#28029)
Giteabot [Mon, 13 Nov 2023 23:03:42 +0000 (07:03 +0800)]
Dont leak private users via extensions (#28023) (#28029)

Backport #28023 by @6543

there was no check in place if a user could see a other user, if you
append e.g. `.rss`

11 months agoChange default size of issue/pr attachments and repo file (#27946) (#28017)
Giteabot [Mon, 13 Nov 2023 14:27:39 +0000 (22:27 +0800)]
Change default size of issue/pr attachments and repo file (#27946) (#28017)

Backport #27946 by @lng2020

As title. Some attachments and file sizes can easily be larger than
these limits

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
11 months agoFix wrong xorm Delete usage(backport for 1.21) (#28002)
Nanguan Lin [Sun, 12 Nov 2023 12:58:22 +0000 (20:58 +0800)]
Fix wrong xorm Delete usage(backport for 1.21) (#28002)

manually backport for https://github.com/go-gitea/gitea/pull/27995
The conflict is `ctx` and `db.Defaultctx`.

11 months agoMove some JS code from `fomantic.js` to standalone files (#27994) (#28001)
Giteabot [Sun, 12 Nov 2023 10:29:56 +0000 (18:29 +0800)]
Move some JS code from `fomantic.js` to standalone files (#27994) (#28001)

Backport #27994 by @wxiaoguang

To improve maintainability, this PR:

1. Rename `web_src/js/modules/aria` to `web_src/js/modules/fomantic`
(the code there are all for aria of fomantic)
2. Move api/transition related code to
`web_src/js/modules/fomantic/api.js` and
`web_src/js/modules/fomantic/transition.js`

No logic is changed.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>