]> source.dussan.org Git - gitea.git/log
gitea.git
14 months agoIntroduce ctx.PathParamRaw to avoid incorrect unescaping (#26392) (#26405)
Giteabot [Wed, 9 Aug 2023 07:31:44 +0000 (15:31 +0800)]
Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392) (#26405)

Backport #26392 by @wxiaoguang

Fix #26389

And complete an old TODO: `ctx.Params does un-escaping,..., which is
incorrect.`

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix incorrect sort link with `.profile` repository (#26374) (#26379)
Giteabot [Wed, 9 Aug 2023 00:57:47 +0000 (08:57 +0800)]
Fix incorrect sort link with  `.profile`  repository (#26374) (#26379)

Backport #26374 by @CaiCandong

fix #26360
Before:

![before](https://github.com/go-gitea/gitea/assets/50507092/5606afe1-9aa2-455e-8d6f-123ff1ac7011)

After:

![After](https://github.com/go-gitea/gitea/assets/50507092/14ff544a-e614-4d41-8615-5244b4ba56eb)

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
14 months agoFix text truncate (#26354) (#26384)
Giteabot [Tue, 8 Aug 2023 02:14:25 +0000 (10:14 +0800)]
Fix text truncate (#26354) (#26384)

Backport #26354 by @Maks1mS

Fixes: https://github.com/go-gitea/gitea/issues/25597
Before:

![image](https://github.com/go-gitea/gitea/assets/36362599/c8c27bcb-469f-4def-8521-d9e054c16ecb)

After:

![image](https://github.com/go-gitea/gitea/assets/36362599/2405b6e8-fc5c-4b13-b66b-007bc11edbc4)

Co-authored-by: Maxim Slipenko <no-reply@maxim.slipenko.com>
14 months agoBypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (...
Giteabot [Mon, 7 Aug 2023 10:55:25 +0000 (18:55 +0800)]
Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368)

Backport #26279 by @wxiaoguang

Close #26277
Fix #26285

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoDisplay human-readable text instead of cryptic filemodes (#26352) (#26358)
delvh [Sun, 6 Aug 2023 21:15:01 +0000 (23:15 +0200)]
Display human-readable text instead of cryptic filemodes (#26352) (#26358)

Backport #26352

Now, you don't need to be a git expert anymore to know what these numbers mean.

## Before

![grafik](https://github.com/go-gitea/gitea/assets/51889757/9a964bf6-10fd-40a6-aeb2-ac8f437f8c32)

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/84573cb9-55b6-4dde-9866-95f71b657554)

or when the mode actually changed:

![grafik](https://github.com/go-gitea/gitea/assets/51889757/0f327538-ebdc-40e7-8c99-f9e21b67f638)

14 months ago[docs] Add missing backtick in quickstart.zh-cn.md (#26349) (#26357)
Giteabot [Sun, 6 Aug 2023 19:57:21 +0000 (03:57 +0800)]
[docs] Add missing backtick in quickstart.zh-cn.md (#26349) (#26357)

14 months ago[docs] Fix Gmail configuration (#26356)
Brian Lachniet [Sun, 6 Aug 2023 16:02:43 +0000 (12:02 -0400)]
[docs] Fix Gmail configuration (#26356)

14 months agoFix API leaking Usermail if not logged in (#25097) (#26350)
wxiaoguang [Sun, 6 Aug 2023 12:11:39 +0000 (20:11 +0800)]
Fix API leaking Usermail if not logged in (#25097) (#26350)

Backport #25097

The API should only return the real Mail of a User, if the caller is
logged in. The check do to this don't work. This PR fixes this. This not
really a security issue, but can lead to Spam.

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: silverwind <me@silverwind.io>
14 months agoHide `last indexed SHA` when a repo could not be indexed yet (#26340) (#26345)
Giteabot [Sat, 5 Aug 2023 16:08:17 +0000 (00:08 +0800)]
Hide `last indexed SHA` when a repo could not be indexed yet (#26340) (#26345)

Backport #26340 by @CaiCandong

Now, for a new repo without any commit, the Last indexed SHA field looks
like this:
Before:

![image](https://github.com/go-gitea/gitea/assets/50507092/cecc6e24-3366-4093-ae07-c361ea34b373)
After:

![image](https://github.com/go-gitea/gitea/assets/50507092/9b6ba703-b0d5-4648-ad6b-9a2341dd60f9)

fix #26336

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
14 months agoRemove backslashed newlines on markdown (#26344) (#26348)
Giteabot [Sat, 5 Aug 2023 15:42:45 +0000 (23:42 +0800)]
Remove backslashed newlines on markdown (#26344) (#26348)

Backport #26344 by @lunny

Fix https://gitea.com/gitea/gitea-docusaurus/issues/56

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
14 months agoFix incorrect CLI exit code and duplicate error message (#26346) (#26347)
wxiaoguang [Sat, 5 Aug 2023 15:37:04 +0000 (23:37 +0800)]
Fix incorrect CLI exit code and duplicate error message (#26346) (#26347)

Backport #26346

Follow the CLI refactoring, and add tests.

14 months agoFix log typo in task.go (#26337) (#26343)
Giteabot [Sat, 5 Aug 2023 10:15:49 +0000 (18:15 +0800)]
Fix log typo in task.go (#26337) (#26343)

Backport #26337 by @cassiozareck

Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
14 months agoPrevent newline errors with Debian packages (#26332) (#26342)
Giteabot [Sat, 5 Aug 2023 09:41:30 +0000 (17:41 +0800)]
Prevent newline errors with Debian packages (#26332) (#26342)

Backport #26332 by @KN4CK3R

Fixes #26313

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
14 months agoFix bug with sqlite load read (#26305) (#26339)
Giteabot [Sat, 5 Aug 2023 07:35:08 +0000 (15:35 +0800)]
Fix bug with sqlite load read (#26305) (#26339)

Backport #26305 by @lunny

Possible fix #26280

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
14 months agoMake git batch operations use parent context timeout instead of default timeout ...
Giteabot [Fri, 4 Aug 2023 13:44:25 +0000 (21:44 +0800)]
Make git batch operations use parent context timeout instead of default timeout (#26325) (#26330)

Backport #26325 by @wxiaoguang

Fix #26064

Some git commands should use parent context, otherwise it would exit too
early (by the default timeout, 10m), and the "cmd.Wait" waits till the
pipes are closed.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix the wrong derive path (#26271) (#26318)
Giteabot [Fri, 4 Aug 2023 06:24:13 +0000 (14:24 +0800)]
Fix the wrong derive path (#26271) (#26318)

Backport #26271 by @lunny

This PR will fix #26264, caused by #23911.

The package configuration derive is totally wrong when storage type is
local in that PR.

This PR fixed the inherit logic when storage type is local with some
unit tests.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix the topic validation rule and suport dots (#26286) (#26303)
Giteabot [Fri, 4 Aug 2023 05:00:49 +0000 (13:00 +0800)]
Fix the topic validation rule and suport dots (#26286) (#26303)

Backport #26286 by @wxiaoguang

1. Allow leading and trailing spaces by user input, these spaces have
already been trimmed at backend
2. Allow using dots in the topic

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoSupport getting changed files when commit ID is `EmptySHA` (#26290) (#26316)
Giteabot [Fri, 4 Aug 2023 03:27:45 +0000 (11:27 +0800)]
Support getting changed files when commit ID is `EmptySHA` (#26290) (#26316)

Backport #26290 by @Zettat123

Fixes #26270.

Co-Author: @wxiaoguang

Thanks @lunny for providing this solution

As
https://github.com/go-gitea/gitea/issues/26270#issuecomment-1661695151
said, at present we cannot get the names of changed files correctly when
the `OldCommitID` is `EmptySHA`. In this PR, the `GetCommitFilesChanged`
method is added and will be used to get the changed files by commit ID.

References:
- https://stackoverflow.com/a/424142

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoUpgrade x/net to 0.13.0 (#26301)
Lunny Xiao [Thu, 3 Aug 2023 10:05:07 +0000 (18:05 +0800)]
Upgrade x/net to 0.13.0 (#26301)

backport #26297

14 months agoClarify the logger's MODE config option (#26267) (#26281)
Giteabot [Tue, 1 Aug 2023 23:08:28 +0000 (07:08 +0800)]
Clarify the logger's MODE config option (#26267) (#26281)

Backport #26267 by @wxiaoguang

1. Fix the wrong document (add the missing `MODE=`)
2. Add a more friendly log message to tell users to add `MODE=` in their
config

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix due date rendering the wrong date in issue (#26268) (#26274)
Giteabot [Tue, 1 Aug 2023 16:40:35 +0000 (00:40 +0800)]
Fix due date rendering the wrong date in issue (#26268) (#26274)

Backport #26268 by @yardenshoham

Closes #26263

We have to pass the date without the time.

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/6b6cb43d-2b1c-4679-951d-20f48c94bfdd)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/50441baf-2c52-452b-bb0d-6034a407abde)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
14 months agoUpdate Arch linux URL from community to extra (#26273) (#26276)
Giteabot [Tue, 1 Aug 2023 15:32:23 +0000 (23:32 +0800)]
Update Arch linux URL from community to extra (#26273) (#26276)

Co-authored-by: minijaws <minijaws@gmail.com>
14 months agoUse shared template for webhook icons (#26242) (#26246)
Giteabot [Mon, 31 Jul 2023 10:09:13 +0000 (18:09 +0800)]
Use shared template for webhook icons (#26242) (#26246)

Backport #26242 by @silverwind

Fixes: https://github.com/go-gitea/gitea/issues/26241
Co-authored-by: silverwind <me@silverwind.io>
14 months agoFix pull request check list is limited (#26179) (#26245)
Giteabot [Mon, 31 Jul 2023 08:56:46 +0000 (16:56 +0800)]
Fix pull request check list is limited (#26179) (#26245)

Backport #26179 by @CaiCandong

In the original implementation, we can only get the first 30 records of
the commit status (the default paging size), if the commit status is
more than 30, it will lead to the bug #25990. I made the following two
changes.
- On the page, use the ` db.ListOptions{ListAll: true}` parameter
instead of `db.ListOptions{}`
- The `GetLatestCommitStatus` function makes a determination as to
whether or not a pager is being used.

fixed #25990

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
14 months agoDon't autosize textarea in diff view (#26233) (#26244)
Giteabot [Mon, 31 Jul 2023 08:02:25 +0000 (16:02 +0800)]
Don't autosize textarea in diff view (#26233) (#26244)

Backport #26233 by @silverwind

Resizing the comment editor can be a very expensive operation because it
triggers page reflows, which on large PRs can take upwards of seconds to
complete. Disable this mechanism on the diff page only where we know
that the page can get large.

Fixes https://github.com/go-gitea/gitea/issues/26201 for the textarea
editor.

I don't think this can be fixed for EasyMDE because as far as I can
tell, it exposes no option to disable this resizing.

Co-authored-by: silverwind <me@silverwind.io>
14 months agoFix attachment clipboard copy on insecure origin (#26224) (#26231)
silverwind [Sun, 30 Jul 2023 22:12:01 +0000 (00:12 +0200)]
Fix attachment clipboard copy on insecure origin (#26224) (#26231)

Backport https://github.com/go-gitea/gitea/pull/26224.

14 months agoFixed incorrect locale references (#26218) (#26222)
Giteabot [Sat, 29 Jul 2023 21:54:35 +0000 (05:54 +0800)]
Fixed incorrect locale references (#26218) (#26222)

Backport #26218 by @kerwin612

Fixed two incorrect headers for setting the page navigation bar:
* User settings page, should not use the title "`org.settings`"
* Repo settings page, should not use the title "`org.settings`"

Co-authored-by: Kerwin Bryant <kerwin612@qq.com>
14 months agoFix access check for org-level project (#26182) (#26223)
Giteabot [Sat, 29 Jul 2023 18:50:58 +0000 (02:50 +0800)]
Fix access check for org-level project (#26182) (#26223)

Backport #26182 by @Zettat123

Fix #25934

Add `ignoreGlobal` parameter to `reqUnitAccess` and only check global
disabled units when `ignoreGlobal` is true. So the org-level projects
and user-level projects won't be affected by global disabled
`repo.projects` unit.

Co-authored-by: Zettat123 <zettat123@gmail.com>
14 months agoFix commit compare style (#26209) (#26226)
Giteabot [Sat, 29 Jul 2023 16:54:51 +0000 (00:54 +0800)]
Fix commit compare style (#26209) (#26226)

Backport #26209 by @puni9869

as title

Fixes : #25825
Before
<img width="1334" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c54a41b0-39bd-4094-a956-081a8f4128f2">

After change
<img width="1340" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c112d235-6bbe-4bcb-9529-78da3ab0fa14">

Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
14 months agoWarn instead of reporting an error when a webhook cannot be found (#26039) (#26211)
Giteabot [Sat, 29 Jul 2023 14:47:46 +0000 (22:47 +0800)]
Warn instead of reporting an error when a webhook cannot be found (#26039) (#26211)

Backport #26039 by @puni9869

Attemp fix: #25744
Fixing the log level when we delete any repo then we get error hook not
found by id. That should be warn level to reduce the noise in the logs.

Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
14 months agoAdd changelog for 1.20.2 (#26208) (#26217) v1.20.2
Giteabot [Sat, 29 Jul 2023 11:23:54 +0000 (19:23 +0800)]
Add changelog for 1.20.2 (#26208) (#26217)

Backport #26208 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix allowed user types setting problem (#26200) (#26206)
Giteabot [Sat, 29 Jul 2023 06:42:40 +0000 (14:42 +0800)]
Fix allowed user types setting problem (#26200) (#26206)

Backport #26200 by @lunny

Fix #25951

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
14 months agoPrevent primary key update on migration (#26192) (#26199)
Giteabot [Fri, 28 Jul 2023 09:08:11 +0000 (17:08 +0800)]
Prevent primary key update on migration (#26192) (#26199)

Backport #26192 by @KN4CK3R

Fixes #25918

The migration fails on MSSQL because xorm tries to update the primary
key column. xorm prevents this if the column is marked as auto
increment:

https://gitea.com/xorm/xorm/src/commit/c622cdaf893fbfe3f40a6b79f6bc17ee10f53865/internal/statements/update.go#L38-L40

I think it would be better if xorm would check for primary key columns
here because updating such columns is bad practice. It looks like if
that auto increment check should do the same.

fyi @lunny

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
14 months agoCalculate MAX_WORKERS default value by CPU number (#26177) (#26183)
Giteabot [Thu, 27 Jul 2023 11:24:07 +0000 (19:24 +0800)]
Calculate MAX_WORKERS default value by CPU number (#26177) (#26183)

14 months agoFix bug when pushing to a pull request which enabled dismiss approval automatically...
Lunny Xiao [Thu, 27 Jul 2023 02:36:54 +0000 (10:36 +0800)]
Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158)

Fix #25858
Backport #25882

The option `dissmiss stale approvals` was listed on protected branch but
never implemented. This PR fixes that.

<img width="1006" alt="图片"

src="https://github.com/go-gitea/gitea/assets/81045/60bfa968-4db7-4c24-b8be-2e5978f91bb9">

<img width="1021" alt="图片"

src="https://github.com/go-gitea/gitea/assets/81045/8dabc14d-2dfe-40c2-94ed-24fcbf6e0e8f">

14 months agoFix handling of plenty Nuget package versions (#26075) (#26173)
Giteabot [Wed, 26 Jul 2023 21:41:40 +0000 (05:41 +0800)]
Fix handling of plenty Nuget package versions (#26075) (#26173)

Backport #26075 by @KN4CK3R

Fixes #25953

- Do not load full version information (v3)
- Add pagination support (v2)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
14 months agoFix typos in Contributing.md (#26170) (#26172)
Giteabot [Wed, 26 Jul 2023 19:46:13 +0000 (03:46 +0800)]
Fix typos in Contributing.md (#26170) (#26172)

Co-authored-by: Niko Hoffrén <niko.hoffren@gmail.com>
14 months agoUpdate email-setup.en-us.md (#26068) (#26166)
Giteabot [Wed, 26 Jul 2023 15:55:27 +0000 (23:55 +0800)]
Update email-setup.en-us.md (#26068) (#26166)

Backport #26068 by @felixvictor

The setting `MAILER_TYPE` is deprecated.
According to the config cheat sheet, it should be `PROTOCOL`.

Co-authored-by: Felix Victor <felix.victor.na@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
14 months agoFix bugs in LFS meta garbage collection (#26122) (#26157)
Giteabot [Wed, 26 Jul 2023 11:53:15 +0000 (19:53 +0800)]
Fix bugs in LFS meta garbage collection (#26122) (#26157)

Backport #26122 by @Zettat123

This PR

- Fix #26093. Replace `time.Time` with `timeutil.TimeStamp`
- Fix #26135. Add missing `xorm:"extends"` to `CountLFSMetaObject` for
LFS meta object query
- Add a unit test for LFS meta object garbage collection

Co-authored-by: Zettat123 <zettat123@gmail.com>
14 months agoFix UI regression of asciinema player (#26159) (#26162)
Giteabot [Wed, 26 Jul 2023 10:34:55 +0000 (18:34 +0800)]
Fix UI regression of asciinema player (#26159) (#26162)

Backport #26159 by @wolfogre

It was caused by updating `asciinema-player`, the upstream changed the
CSS class prefix:
`https://github.com/asciinema/asciinema-player/commit/40505e479e8ba6833f178a3b7e85503c72491614`

<details>
<summary>Before:</summary>

<img width="1320" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/b91a2cf5-c1da-43d6-bac2-bc278728b11e">

</details>

<details>
<summary>After:</summary>

<img width="1311" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/c9872d25-e0bb-43d4-8b1e-d87c6b03c0a2">

</details>

Co-authored-by: Jason Song <i@wolfogre.com>
14 months agoDisplay deprecated warning in admin panel pages as well as in the log file (#26094...
Lunny Xiao [Wed, 26 Jul 2023 09:22:39 +0000 (17:22 +0800)]
Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154)

backport #26094
Temporily resolve #25915
Related #25994

This PR includes #26007 's changes but have a UI to prompt administrator
about the deprecated settings as well as the log or console warning.
Then users will have enough time to notice the problem and don't have
surprise like before.

<img width="1293" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/c33355f0-1ea7-4fb3-ad43-cd23cd15391d">

14 months agoUpdate xorm version (#26128) (#26150)
Lunny Xiao [Wed, 26 Jul 2023 07:40:23 +0000 (15:40 +0800)]
Update xorm version (#26128) (#26150)

backport #26128 to fix some serious bug.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
14 months agoRemove "misc" scope check from public API endpoints (#26134) (#26149)
Giteabot [Wed, 26 Jul 2023 05:32:41 +0000 (01:32 -0400)]
Remove "misc" scope check from public API endpoints (#26134) (#26149)

Backport #26134 by @wxiaoguang

Fix #26035

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix LFS object list style (#26133) (#26147)
Giteabot [Wed, 26 Jul 2023 04:58:48 +0000 (00:58 -0400)]
Fix LFS object list style (#26133) (#26147)

Backport #26133 by @wxiaoguang

Close #26104 . Only a quick fix, the UI is not perfect.

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/7b10d42d-8317-4d99-80f9-b6c5fe05c17e)

![image](https://github.com/go-gitea/gitea/assets/2114189/b43f1242-61a0-45e3-98b7-aa74b29f3813)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/a8d27f70-781d-4702-866f-a56df6dd6c0a)

![image](https://github.com/go-gitea/gitea/assets/2114189/379274e7-c67b-4c11-9cee-28a298b4ff5a)

</details>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoDocusaurus-ify 1.20 (#26052)
John Olheiser [Wed, 26 Jul 2023 02:00:14 +0000 (21:00 -0500)]
Docusaurus-ify 1.20 (#26052)

See https://github.com/go-gitea/gitea/pull/26051

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: JonRB <4564448+eeyrjmr@users.noreply.github.com>
14 months agoFix CLI allowing creation of access tokens with existing name (#26071) (#26144)
Giteabot [Wed, 26 Jul 2023 01:30:50 +0000 (21:30 -0400)]
Fix CLI allowing creation of access tokens with existing name (#26071) (#26144)

Backport #26071 by @yardenshoham

We are now:
- Making sure there is no existing access token with the same name
- Making sure the given scopes are valid (we already did this before but
now we have a message)

The logic is mostly taken from
https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/routers/api/v1/user/app.go#L101-L123

Closes #26044

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
14 months agoIncrease table cell horizontal padding (#26140) (#26142)
Giteabot [Wed, 26 Jul 2023 00:42:23 +0000 (20:42 -0400)]
Increase table cell horizontal padding (#26140) (#26142)

Backport #26140 by @silverwind

Extract from https://github.com/go-gitea/gitea/pull/26043, just the
padding increase.

Before and After (hard to notice, but it's there):
<img width="427" alt="Screenshot 2023-07-25 at 19 37 12"
src="https://github.com/go-gitea/gitea/assets/115237/9543dcda-eccb-4739-b7dd-06b076108ab4">
<img width="420" alt="Screenshot 2023-07-25 at 19 37 26"
src="https://github.com/go-gitea/gitea/assets/115237/0a9c3724-81a1-4c67-a13b-4b728a51fc3a">

Co-authored-by: silverwind <me@silverwind.io>
14 months agoFix incorrect router logger (#26137) (#26143)
Giteabot [Wed, 26 Jul 2023 00:37:43 +0000 (20:37 -0400)]
Fix incorrect router logger (#26137) (#26143)

Backport #26137 by @wxiaoguang

A low-level mistake:

* `log.Info` is global `Info` function, which calls "default" logger
* `logger.Info` is the for router's logger

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoadded ssh mirror workaround description (#26096) (#26136)
Giteabot [Tue, 25 Jul 2023 16:32:39 +0000 (12:32 -0400)]
added ssh mirror workaround description (#26096) (#26136)

Backport #26096 by @thigg

related #1635 #18159

This will probably be obsolete at some point, but it should not break
anything and it may help some users

Co-authored-by: thigg <thigg@users.noreply.github.com>
14 months agoImprove commit graph alignment and truncating (#26112) (#26127)
Giteabot [Tue, 25 Jul 2023 11:43:39 +0000 (07:43 -0400)]
Improve commit graph alignment and truncating (#26112) (#26127)

Backport #26112 by @wxiaoguang

Fix #26101

![image](https://github.com/go-gitea/gitea/assets/2114189/7507d201-822e-4534-8b20-e659d56b1268)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix wrong workflow status when rerun a job in an already finished workflow (#26119...
Giteabot [Tue, 25 Jul 2023 10:22:58 +0000 (06:22 -0400)]
Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124)

Backport #26119 by @yp05327

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/fb687592-b117-4cd5-b076-2ca5ca847ea4)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/c9b0683e-e81d-410b-8c35-fbe54327fab4)

After workflow finished, if you rerun a single job, the workflow status
will become to `Running` which is not correct as no jobs are running in
this workflow.

Co-authored-by: yp05327 <576951401@qq.com>
14 months agoFix escape problems in the branch selector (#25875) (#26103)
Giteabot [Tue, 25 Jul 2023 06:14:18 +0000 (02:14 -0400)]
Fix escape problems in the branch selector (#25875) (#26103)

Backport #25875 by @yp05327

Fix #25865

Co-authored-by: yp05327 <576951401@qq.com>
14 months agoAvoid writing config file if not installed (#26107) (#26113)
Giteabot [Tue, 25 Jul 2023 05:31:50 +0000 (01:31 -0400)]
Avoid writing config file if not installed (#26107) (#26113)

Backport #26107 by @wxiaoguang

Just like others (oauth2 secret, internal token, etc), do not generate
if no install lock

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix handling of Debian files with trailing slash (#26087) (#26098)
Giteabot [Mon, 24 Jul 2023 14:56:13 +0000 (10:56 -0400)]
Fix handling of Debian files with trailing slash (#26087) (#26098)

Backport #26087 by @KN4CK3R

Fixes #26022

- Fix handling of files with trailing slash
- Fix handling of duplicate package file errors
- Added test for both

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
14 months agofix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089)
Giteabot [Mon, 24 Jul 2023 10:07:39 +0000 (06:07 -0400)]
fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089)

Backport #26086 by @CaiCandong

close #26079

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
14 months agoUse stderr as fallback if the log file can't be opened (#26074) (#26083)
Giteabot [Mon, 24 Jul 2023 05:58:16 +0000 (01:58 -0400)]
Use stderr as fallback if the log file can't be opened (#26074) (#26083)

Backport #26074 by @wxiaoguang

If the log file can't be opened, what should it do? panic/exit? ignore
logs? fallback to stderr?

It seems that "fallback to stderr" is slightly better than others ....

14 months agoFix duplicated url prefix on issue context menu (#26066) (#26067)
Giteabot [Sun, 23 Jul 2023 10:27:34 +0000 (06:27 -0400)]
Fix duplicated url prefix on issue context menu (#26066) (#26067)

Backport #26066 by @lunny

Fix #26060

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
14 months agoAdd changelog for 1.20.1 (#26015) (#26056) v1.20.1
Giteabot [Sat, 22 Jul 2023 09:18:59 +0000 (05:18 -0400)]
Add changelog for 1.20.1 (#26015) (#26056)

Backport #26015 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
14 months agoFix version in rpm repodata/primary.xml.gz (#26009) (#26048)
Giteabot [Fri, 21 Jul 2023 20:06:51 +0000 (16:06 -0400)]
Fix version in rpm repodata/primary.xml.gz (#26009) (#26048)

Co-authored-by: Peter Verraedt <peter.verraedt@gmail.com>
14 months agoAdding remaining enum for migration repo model type. (#26021) (#26034)
Giteabot [Fri, 21 Jul 2023 06:54:43 +0000 (02:54 -0400)]
Adding remaining enum for migration repo model type. (#26021) (#26034)

Backport #26021 by @puni9869

Fixes: https://github.com/go-gitea/gitea/issues/26010
Adding remaining enum for migration repo model type.

Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
14 months agoRPM Registry: Show zypper commands for SUSE based distros as well (#25981) (#26020)
Giteabot [Fri, 21 Jul 2023 01:15:47 +0000 (21:15 -0400)]
RPM Registry: Show zypper commands for SUSE based distros as well (#25981) (#26020)

Backport #25981 by @asdil12

After RPM is supported with https://github.com/go-gitea/gitea/pull/23380
let's show the user
how to add the repo and install the RPM via all common package managers.

Co-authored-by: Dominik Heidler <dominik@heidler.eu>
14 months agoFix the route for pull-request's authors (#26016) (#26018)
Giteabot [Thu, 20 Jul 2023 13:38:12 +0000 (09:38 -0400)]
Fix the route for pull-request's authors (#26016) (#26018)

Backport #26016 by @wxiaoguang

Close #25906

![image](https://github.com/go-gitea/gitea/assets/2114189/e689f3e1-9a90-46c0-89f4-2d61394d34d3)

Succeeded logs:

```
[I] router: completed GET /root/test/issues/posters?&q=%20&_=1689853025011 for [::1]:59271, 200 OK in 127.7ms @ repo/issue.go:3505(repo.IssuePosters)

[I] router: completed GET /root/test/pulls/posters?&q=%20&_=1689853968204 for [::1]:59269, 200 OK in 94.3ms @ repo/issue.go:3509(repo.PullPosters)
```

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoCorrectly refer to dev tags as nightly in the docker docs (#26004) (#26019)
Giteabot [Thu, 20 Jul 2023 13:03:40 +0000 (09:03 -0400)]
Correctly refer to dev tags as nightly in the docker docs (#26004) (#26019)

Backport #26004 by @jolheiser

As title, `dev` tags are no longer used since we switched to `nightly`

Signed-off-by: jolheiser <john.olheiser@gmail.com>
14 months agoFix env config parsing for "GITEA____APP_NAME" (#26001) (#26013)
Giteabot [Thu, 20 Jul 2023 09:56:36 +0000 (05:56 -0400)]
Fix env config parsing for "GITEA____APP_NAME" (#26001) (#26013)

Backport #26001 by @wxiaoguang

Regression of #24832

Fix the bug and add a test for it

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoFix commit status color on dashboard repolist (#25993) (#25998)
Giteabot [Wed, 19 Jul 2023 23:24:04 +0000 (19:24 -0400)]
Fix commit status color on dashboard repolist (#25993) (#25998)

Backport #25993 by @silverwind

Followup to https://github.com/go-gitea/gitea/pull/25935 which has
missed to change the icon on the repolist because the logic is not
shared with templates.

Co-authored-by: silverwind <me@silverwind.io>
14 months agoavoid hard-coding height in language dropdown menu (#25986) (#25997)
Giteabot [Wed, 19 Jul 2023 23:05:22 +0000 (19:05 -0400)]
avoid hard-coding height in language dropdown menu (#25986) (#25997)

Backport #25986 by @earl-warren

This commit removes the hard-coded height of 500px, using that as a
max-height instead. The height of items in the dropdown menu, assuming a
default font size of 16px, is 36px, so the old CSS would cause overly
large dropdown menus in instances where less than 14 languages are
offered.

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

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: rome-user <rome-user@noreply.codeberg.org>
14 months agoparseScope with owner/repo always sets owner to zero (#25987) (#25989)
Giteabot [Wed, 19 Jul 2023 14:57:17 +0000 (10:57 -0400)]
parseScope with owner/repo always sets owner to zero (#25987) (#25989)

Backport #25987 by @earl-warren

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

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
14 months agoUpdate path related documents (#25417) (#25982)
Giteabot [Wed, 19 Jul 2023 09:48:54 +0000 (05:48 -0400)]
Update path related documents (#25417) (#25982)

Backport #25417 by @wxiaoguang

Update WorkPath/WORK_PATH related documents, remove out-dated
information.

Remove "StaticRootPath" on the admin config display page, because few
end user really need it, it only causes misconfiguration.

![image](https://github.com/go-gitea/gitea/assets/2114189/8095afa4-da76-436b-9e89-2a92c229c01d)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoMake pending commit status yellow again (#25935) (#25968)
Giteabot [Wed, 19 Jul 2023 06:43:41 +0000 (02:43 -0400)]
Make pending commit status yellow again (#25935) (#25968)

Backport #25935 by @silverwind

With the introduction of Actions, the pending commit icon has changed
from yellow to grey for Drone integrations which never set the "running"
status, so it stays in "pending" until completion.

I find it better to have this icon colored like on 1.19. Now both the
"pending" and "running" icons look the same, but I guess we could add an
animation to the "running" state similar to GitHub has to it later.

Before:
<img width="339" alt="Screenshot 2023-07-17 at 19 14 19"
src="https://github.com/go-gitea/gitea/assets/115237/2f4886e4-74fd-42ea-b59e-9af8f141bf1f">

After:
<img width="335" alt="Screenshot 2023-07-17 at 19 14 30"
src="https://github.com/go-gitea/gitea/assets/115237/53189642-e72d-47f6-9cbe-f14eda28f730">

Also, it matches GH's icon:

<img width="466" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/5804ff90-d223-4a3c-8093-7a9abbaacf87">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
14 months agoShow the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947...
Giteabot [Wed, 19 Jul 2023 04:35:16 +0000 (00:35 -0400)]
Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947) (#25972)

Backport #25947 by @wolfogre

Since OAuth2 will callback the root URL, if the user starts signing in
from a wrong host, Gitea will return 500 because it cannot find the
session.

<details>
<summary>How to reproduce</summary>

<img width="901" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2c2e255c-e13e-4a11-9be7-b226bee54920">

<img width="1014" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/b31cfcf6-a320-483d-9ce5-ba8562f065e1">

</details>

So show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is
enabled.

<img width="1015" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/99e80b17-c790-49a3-bbf2-2bd9396a7daa">

Co-authored-by: Jason Song <i@wolfogre.com>
14 months agoFix SSPI auth panic (#25955) (#25969)
Giteabot [Tue, 18 Jul 2023 22:28:06 +0000 (18:28 -0400)]
Fix SSPI auth panic (#25955) (#25969)

Backport #25955 by @wxiaoguang

Try to fix #25952

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoAvoid creating directories when loading config (#25944) (#25957)
wxiaoguang [Tue, 18 Jul 2023 20:24:07 +0000 (04:24 +0800)]
Avoid creating directories when loading config (#25944) (#25957)

Backport #25944

The "creating dir/file during load config" is a longstanding and complex
problem.

This PR only does a quick patch, it still needs more refactorings in the
future.

Fix #25938

14 months agoDisallow dangerous URL schemes (#25960) (#25964)
KN4CK3R [Tue, 18 Jul 2023 19:48:52 +0000 (21:48 +0200)]
Disallow dangerous URL schemes (#25960) (#25964)

Regression: https://github.com/go-gitea/gitea/pull/24805
Closes: #25945
- Disallow `javascript`, `vbscript` and `data` (data uri images still
work) url schemes even if all other schemes are allowed
- Fixed older `cbthunderlink` tests

---------

Co-authored-by: delvh <dev.lh@web.de>
15 months agoIgnore `runs-on` with expressions when warning no matched runners (#25917) (#25933)
Giteabot [Tue, 18 Jul 2023 06:40:28 +0000 (02:40 -0400)]
Ignore `runs-on` with expressions when warning no matched runners (#25917) (#25933)

Backport #25917 by @wolfogre

Fix #25905

Co-authored-by: Jason Song <i@wolfogre.com>
15 months agoMake environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937)
Giteabot [Mon, 17 Jul 2023 18:28:54 +0000 (14:28 -0400)]
Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937)

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

15 months agoAvoid opening/closing PRs which are already merged (#25883) (#25903)
Giteabot [Mon, 17 Jul 2023 12:14:22 +0000 (08:14 -0400)]
Avoid opening/closing PRs which are already merged (#25883) (#25903)

Backport #25883 by @yp05327

We can select PRs to open/close them by one click, but we forgot to
check whether it is merged.
You can get an opening merged PR:

![image](https://github.com/go-gitea/gitea/assets/18380374/22c2e747-4bb9-4742-a9aa-ef39d5308bc5)

You can confirm this in:
https://try.gitea.io/yp05327/testrepo/pulls/5

Co-authored-by: yp05327 <576951401@qq.com>
15 months agoSkip unuseful error message in dev mode when watching local filesystem (#25919) ...
Giteabot [Mon, 17 Jul 2023 10:26:29 +0000 (06:26 -0400)]
Skip unuseful error message in dev mode when watching local filesystem (#25919) (#25927)

Backport #25919 by @wxiaoguang

Before, in dev mode, there might be some error logs like:

```
2023/07/17 13:54:51 ...s/assetfs/layered.go:221:WatchLocalChanges() [E] Unable to watch directory .: lstat /data/work/gitea/custom/templates: no such file or directory

```

Because there is no "custom/templates" directory.

After: ignore such error, no such error message anymore.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoAdd shutting down notice (#25920) (#25922)
Giteabot [Mon, 17 Jul 2023 09:44:10 +0000 (05:44 -0400)]
Add shutting down notice (#25920) (#25922)

Backport #25920 by @KN4CK3R

Got the same problem as #25915 when updating an instance. The
`log.Fatal` should have been marked as breaking in #23911.

This PR adds a notice that the system is shutting down because of the
deprecated setting.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
15 months agoFix incorrect milestone count when provide a keyword (#25880) (#25904)
Giteabot [Mon, 17 Jul 2023 09:12:59 +0000 (05:12 -0400)]
Fix incorrect milestone count when provide a keyword (#25880) (#25904)

Backport #25880 by @yp05327

You can confirm this issue in:
https://try.gitea.io/yp05327/testrepo/milestones?state=open&q=a
There's no milestone, but the count is 1.

![image](https://github.com/go-gitea/gitea/assets/18380374/25e58cee-aeeb-43c1-8ec8-6e2ec6bf1284)

Co-authored-by: yp05327 <576951401@qq.com>
15 months agoAdd 1.20.0 changelog (#25901) (#25910) v1.20.0
delvh [Sun, 16 Jul 2023 19:08:53 +0000 (21:08 +0200)]
Add 1.20.0 changelog (#25901) (#25910)

Backport of #25901

15 months agofix incorrect repo url when changed the case of ownername (#25733) (#25881)
Giteabot [Sat, 15 Jul 2023 17:47:24 +0000 (13:47 -0400)]
fix incorrect repo url when changed the case of ownername (#25733) (#25881)

Backport #25733 by @hiifong

When only the casing of the username changes, update the owner name of the repo,
and keep the original logic consistent with other conditions.

example: assume your username is `gitea`, lowercase username is `gitea` too,
repo URL is `.../gitea/{repo}`.
You change your username to `Gitea`, `GiTea` or something like that,
as long as the lowercase username is still `gitea`, the repo URL remained `.../gitea/{repo}`.

this pr keeps the new username consistent with the repo URL.

Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/84177296-f0ff-4176-84f1-1f9ec3f5b86f)
![image](https://github.com/go-gitea/gitea/assets/89133723/8f8f4a12-ecdd-4dec-af89-85c009b0ccfe)

After:

![image](https://github.com/go-gitea/gitea/assets/89133723/0564edb6-9467-405a-8cd4-d6f70e6f614b)
![image](https://github.com/go-gitea/gitea/assets/89133723/554ecd6e-e5a1-43bc-a46d-99e988c2ff58)

Co-authored-by: hiifong <i@hiif.ong>
15 months agoBackport locales to v1.20 (#25899)
Denys Konovalov [Sat, 15 Jul 2023 15:26:40 +0000 (17:26 +0200)]
Backport locales to v1.20 (#25899)

15 months agoMake `add line comment` buttons focusable (#25894) (#25896)
Giteabot [Sat, 15 Jul 2023 10:18:49 +0000 (06:18 -0400)]
Make `add line comment` buttons focusable (#25894) (#25896)

Backport #25894 by @sebastian-sauer

Use a real button and add an aria-label.
Additionally, show the button whenever it is focused.
See https://codeberg.org/forgejo/forgejo/issues/998 for explanation.

Our handling of this button is now equal to that of GitHub.
Nothing has changed visually.

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
15 months agoAdd support for different Maven POM encoding (#25873) (#25890)
Giteabot [Fri, 14 Jul 2023 10:27:15 +0000 (06:27 -0400)]
Add support for different Maven POM encoding (#25873) (#25890)

Backport #25873 by @KN4CK3R

Fixes #25853

- Maven POM files aren't always UTF-8 encoded.
- Reject the upload of unparsable POM files

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
15 months agoFix incorrect release count (#25879) (#25887)
Giteabot [Fri, 14 Jul 2023 09:32:43 +0000 (05:32 -0400)]
Fix incorrect release count (#25879) (#25887)

Backport #25879 by @yp05327

Release count is not correct:
https://try.gitea.io/yp05327/testrepo/tags

![image](https://github.com/go-gitea/gitea/assets/18380374/07f97c62-d450-4ccb-b3f2-3e0af9d9fc52)

https://try.gitea.io/yp05327/testrepo/releases

![image](https://github.com/go-gitea/gitea/assets/18380374/6f1d55a4-bb68-445d-84b9-90552a40f403)

https://try.gitea.io/yp05327/testrepo/releases/tag/testtag

![image](https://github.com/go-gitea/gitea/assets/18380374/09ab5d51-52b6-4621-a571-3100198eb260)

We already have correct release count, no need to calculate it again.

https://github.com/go-gitea/gitea/blob/c5e187c389b35b9e080a3187b93a775a3c81e585/modules/context/repo.go#L547

Co-authored-by: yp05327 <576951401@qq.com>
15 months agoFix empty project displayed in issue sidebar (#25802) (#25854)
Giteabot [Wed, 12 Jul 2023 17:07:03 +0000 (13:07 -0400)]
Fix empty project displayed in issue sidebar (#25802) (#25854)

Backport #25802 by @yp05327

You can confirm this issue in
https://try.gitea.io/yp05327/testrepo/issues/2

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/1ab476dc-2f9b-4c85-9e87-105fc73af1ee)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/786f984d-5c27-4eff-b3d9-159f68034ce4)

This issue comes from the change in #25468.
`LoadProject` will always return at least one record, so we use
`ProjectID` to check whether an issue is linked to a project in the old
code.
As other `issue.LoadXXX` functions, we need to check the return value
from `xorm.Session.Get`.

In recent unit tests, we only test `issueList.LoadAttributes()` but
don't test `issue.LoadAttributes()`. So I added a new test for
`issue.LoadAttributes()` in this PR.

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Denys Konovalov <privat@denyskon.de>
15 months agoFix the error message when the token is incorrect (#25701) (#25836)
Giteabot [Wed, 12 Jul 2023 10:18:27 +0000 (06:18 -0400)]
Fix the error message when the token is incorrect (#25701) (#25836)

Backport #25701 by @CaiCandong

we refactored `userIDFromToken` for the token parsing part into a new
function `parseToken`. `parseToken` returns the string `token` from
request, and a boolean `ok` representing whether the token exists or
not. So we can distinguish between token non-existence and token
inconsistency in the `verfity` function, thus solving the problem of no
proper error message when the token is inconsistent.
close #24439
related #22119

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: Jason Song <i@wolfogre.com>
15 months agoBackport locale to 1.20 (#25840)
wxiaoguang [Wed, 12 Jul 2023 09:43:57 +0000 (17:43 +0800)]
Backport locale to 1.20 (#25840)

With manual fixes

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoShow correct SSL Mode on "install page" (#25818) (#25838)
Giteabot [Wed, 12 Jul 2023 06:01:38 +0000 (02:01 -0400)]
Show correct SSL Mode on "install page" (#25818) (#25838)

Backport #25818 by @wxiaoguang

Fix #25817

![image](https://github.com/go-gitea/gitea/assets/2114189/49f7b85d-c229-41b5-86fd-58cd812eaca6)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoFix incorrect oldest sort in project list (#25806) (#25835)
Giteabot [Wed, 12 Jul 2023 05:22:17 +0000 (01:22 -0400)]
Fix incorrect oldest sort in project list (#25806) (#25835)

Backport #25806 by @yp05327

sort type `oldest` should be `Asc`.
Added a test for this.

I see we have `SearchOrderBy` in db model, but we are using many
different ways to define the sort type.
~Maybe we can improve this later.~
↑ Improved in this PR

Co-authored-by: yp05327 <576951401@qq.com>
15 months agoFix activity type match in `matchPullRequestEvent` (#25746) (#25796)
Zettat123 [Tue, 11 Jul 2023 06:42:07 +0000 (14:42 +0800)]
Fix activity type match in `matchPullRequestEvent` (#25746) (#25796)

Backport #25746

Fix #25736
Caused by #24048

Right now we only check the activity type for `pull_request` event when
`types` is specified or there are no `types` and filter. If a workflow
only specifies filters but no `types` like this:
```
on:
  pull_request:
    branches: [main]
```
the workflow will be triggered even if the activity type is not one of
`[opened, reopened, sync]`. We need to check the activity type in this
case.

15 months agoFor API attachments, use API URL (#25639) (#25814)
Giteabot [Mon, 10 Jul 2023 12:56:16 +0000 (08:56 -0400)]
For API attachments, use API URL (#25639) (#25814)

Backport #25639 by @lunny

Fix #25257

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
15 months agoMake "install page" respect environment config (#25648) (#25799)
wxiaoguang [Mon, 10 Jul 2023 11:51:05 +0000 (19:51 +0800)]
Make "install page" respect environment config (#25648) (#25799)

Backport #25648

Replace #25580

Fix #19453

The problem was: when users set "GITEA__XXX__YYY" , the "install page"
doesn't respect it.

So, to make the result consistent and avoid surprising end users, now
the "install page" also writes the environment variables to the config
file.

And, to make things clear, there are enough messages on the UI to tell
users what will happen.

There are some necessary/related changes to `environment-to-ini.go`:

* The "--clear" flag is removed and it was incorrectly written there.
The "clear" operation should be done if INSTALL_LOCK=true
* The "--prefix" flag is removed because it's never used, never
documented and it only causes inconsistent behavior.

The only conflict during backport is "ui divider" in
templates/install.tmpl

15 months agoAvoid amending the Rebase and Fast-forward merge if there is no message template...
Giteabot [Mon, 10 Jul 2023 10:23:54 +0000 (06:23 -0400)]
Avoid amending the Rebase and Fast-forward merge if there is no message template (#25779) (#25809)

Backport #25779 by @wxiaoguang

Related #22669. Close #25177

After the fix:

![image](https://github.com/go-gitea/gitea/assets/2114189/0e900927-ea72-4f8f-bde6-5ed927cb02f4)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoFix WORK_DIR for docker (root) image (#25738) (#25811)
Giteabot [Mon, 10 Jul 2023 08:54:16 +0000 (04:54 -0400)]
Fix WORK_DIR for docker (root) image (#25738) (#25811)

Backport #25738 by @wxiaoguang

Fix #25726

#17846 chose an incorrect WORK_DIR path for docker root image.

Gitea's work-path was already used as the base path for various paths
(like AppDataPath), so, the work-path should be mounted to a volume in a
docker image.

Now, for docker root image, it's unavoidable to mix the
WorkPath/CustomPath/AppDataPath in the same directory ("/data/gitea"),
because some of them have already been mixed.

Some directories in the screenshot are for "CustomPath" , while others
are for "AppDataPath", due to the technical debts in old code:

```
CUSTOM_PATH="/data/gitea"
APP_DATA_PATH = /data/gitea
```

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/9f0648ac-f731-4a08-9f26-1af01a1824b1)

</details>

This PR is breaking but this is the only way at the moment to avoid
users losing their data accidently

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoClarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764)
wxiaoguang [Sun, 9 Jul 2023 22:19:24 +0000 (06:19 +0800)]
Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764)

Backport  #25763

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoRevert package access change from #23879 (#25707) (#25785)
Giteabot [Sun, 9 Jul 2023 21:00:42 +0000 (17:00 -0400)]
Revert package access change from #23879 (#25707) (#25785)

Backport #25707 by @KN4CK3R

Fixes (?) #25538
Fixes https://codeberg.org/forgejo/forgejo/issues/972

Regression #23879

#23879 introduced a change which prevents read access to packages if a
user is not a member of an organization.

That PR also contained a change which disallows package access if the
team unit is configured with "no access" for packages. I don't think
this change makes sense (at the moment). It may be relevant for private
orgs. But for public or limited orgs that's useless because an
unauthorized user would have more access rights than the team member.
This PR restores the old behaviour "If a user has read access for an
owner, they can read packages".

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
15 months agoRemove unused code (#25734) (#25788)
Giteabot [Sun, 9 Jul 2023 19:47:58 +0000 (15:47 -0400)]
Remove unused code (#25734) (#25788)

Backport #25734 by @KN4CK3R

The method is only used in the test. Found it because I changed the
fixtures and had a hard time fixing this test. My revenge is deleting
it.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
15 months agoFix notification list bugs (#25781) (#25787)
Giteabot [Sun, 9 Jul 2023 19:15:00 +0000 (15:15 -0400)]
Fix notification list bugs (#25781) (#25787)

Backport #25781 by @wxiaoguang

Fix #25627

1. `ctx.Data["Link"]` should use relative URL but not AppURL
2. The `data-params` is incorrect because it doesn't contain "page". JS
can simply use "window.location.search" to construct the AJAX URL
3. The `data-xxx` and `id` in notification_subscriptions.tmpl were
copied&pasted, they don't have affect.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoTest if container blob is accessible before mounting (#22759) (#25784)
Giteabot [Sun, 9 Jul 2023 12:00:04 +0000 (08:00 -0400)]
Test if container blob is accessible before mounting (#22759) (#25784)

Backport #22759 by @KN4CK3R

related #16865

This PR adds an accessibility check before mounting container blobs.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>