Commit graph

15874 commits

Author SHA1 Message Date
Giteabot
c5fe09db72
Warn instead of reporting an error when a webhook cannot be found () ()
Backport  by @puni9869

Attemp fix: 
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>
2023-07-29 14:47:46 +00:00
Giteabot
09814117e3
Add changelog for 1.20.2 () ()
Backport  by @delvh

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-29 19:23:54 +08:00
Giteabot
499c5594c3
Fix allowed user types setting problem () ()
Backport  by @lunny

Fix 

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-07-29 14:42:40 +08:00
Giteabot
ecfbcced46
Prevent primary key update on migration () ()
Backport  by @KN4CK3R

Fixes 

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:

c622cdaf89/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>
2023-07-28 11:08:11 +02:00
Giteabot
892e24aaf1
Calculate MAX_WORKERS default value by CPU number () () 2023-07-27 19:24:07 +08:00
Lunny Xiao
666038a06d
Fix bug when pushing to a pull request which enabled dismiss approval automatically () ()
Fix 
Backport  

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">
2023-07-27 10:36:54 +08:00
Giteabot
54614767a2
Fix handling of plenty Nuget package versions () ()
Backport  by @KN4CK3R

Fixes 

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

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-07-26 21:41:40 +00:00
Giteabot
e42c5afadb
Fix typos in Contributing.md () ()
Co-authored-by: Niko Hoffrén <niko.hoffren@gmail.com>
2023-07-26 14:46:13 -05:00
Giteabot
72b55c8094
Update email-setup.en-us.md () ()
Backport  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>
2023-07-26 10:55:27 -05:00
Giteabot
a12d036a68
Fix bugs in LFS meta garbage collection () ()
Backport  by @Zettat123

This PR

- Fix . Replace `time.Time` with `timeutil.TimeStamp`
- Fix . 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>
2023-07-26 11:53:15 +00:00
Giteabot
65d6bdf0be
Fix UI regression of asciinema player () ()
Backport  by @wolfogre

It was caused by updating `asciinema-player`, the upstream changed the
CSS class prefix:
`40505e479e`

<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>
2023-07-26 12:34:55 +02:00
Lunny Xiao
c598741f01
Display deprecated warning in admin panel pages as well as in the log file () ()
backport  
Temporily resolve 
Related 

This PR includes  '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">
2023-07-26 09:22:39 +00:00
Lunny Xiao
bc73e6a85c
Update xorm version () ()
backport  to fix some serious bug.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-07-26 07:40:23 +00:00
Giteabot
a8445e9320
Remove "misc" scope check from public API endpoints () ()
Backport  by @wxiaoguang

Fix 

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-26 05:32:41 +00:00
Giteabot
0f73be0ae3
Fix LFS object list style () ()
Backport  by @wxiaoguang

Close  . 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>
2023-07-26 12:58:48 +08:00
John Olheiser
4033d95dbf
Docusaurus-ify 1.20 ()
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>
2023-07-26 10:00:14 +08:00
Giteabot
43213b816d
Fix CLI allowing creation of access tokens with existing name () ()
Backport  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
a12a5f3652/routers/api/v1/user/app.go (L101-L123)

Closes 

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2023-07-26 01:30:50 +00:00
Giteabot
a55924aaf4
Increase table cell horizontal padding () ()
Backport  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>
2023-07-26 00:42:23 +00:00
Giteabot
782b137682
Fix incorrect router logger () ()
Backport  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>
2023-07-26 08:37:43 +08:00
Giteabot
5992365fc1
added ssh mirror workaround description () ()
Backport  by @thigg

related  

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>
2023-07-25 18:32:39 +02:00
Giteabot
3b518a3af5
Improve commit graph alignment and truncating () ()
Backport  by @wxiaoguang

Fix 



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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-25 11:43:39 +00:00
Giteabot
08cdc0da3d
Fix wrong workflow status when rerun a job in an already finished workflow () ()
Backport  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>
2023-07-25 12:22:58 +02:00
Giteabot
3e07c54be3
Fix escape problems in the branch selector () ()
Backport  by @yp05327

Fix 

Co-authored-by: yp05327 <576951401@qq.com>
2023-07-25 06:14:18 +00:00
Giteabot
e2596b0a99
Avoid writing config file if not installed () ()
Backport  by @wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-25 13:31:50 +08:00
Giteabot
a424f6d4f8
Fix handling of Debian files with trailing slash () ()
Backport  by @KN4CK3R

Fixes 

- 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>
2023-07-24 14:56:13 +00:00
Giteabot
59713541b6
fix Missing 404 swagger response docs for /admin/users/{username} () ()
Backport  by @CaiCandong

close 

Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
2023-07-24 12:07:39 +02:00
Giteabot
8d9193680d
Use stderr as fallback if the log file can't be opened () ()
Backport  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 ....
2023-07-24 05:58:16 +00:00
Giteabot
ab4fd9aa1f
Fix duplicated url prefix on issue context menu () ()
Backport  by @lunny

Fix 

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-07-23 10:27:34 +00:00
Giteabot
221b90d289
Add changelog for 1.20.1 () ()
Backport  by @delvh

Co-authored-by: delvh <dev.lh@web.de>
2023-07-22 11:18:59 +02:00
Giteabot
81f5a87eb4
Fix version in rpm repodata/primary.xml.gz () ()
Co-authored-by: Peter Verraedt <peter.verraedt@gmail.com>
2023-07-21 20:06:51 +00:00
Giteabot
8b002b429d
Adding remaining enum for migration repo model type. () ()
Backport  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>
2023-07-21 08:54:43 +02:00
Giteabot
dfd371a363
RPM Registry: Show zypper commands for SUSE based distros as well () ()
Backport  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>
2023-07-20 21:15:47 -04:00
Giteabot
54a516e9da
Fix the route for pull-request's authors () ()
Backport  by @wxiaoguang

Close 



![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>
2023-07-20 13:38:12 +00:00
Giteabot
ac129d4b4c
Correctly refer to dev tags as nightly in the docker docs () ()
Backport  by @jolheiser

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

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-07-20 21:03:40 +08:00
Giteabot
4d5e3b9372
Fix env config parsing for "GITEA____APP_NAME" () ()
Backport  by @wxiaoguang

Regression of  

Fix the bug and add a test for it

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-20 11:56:36 +02:00
Giteabot
1ba0baa030
Fix commit status color on dashboard repolist () ()
Backport  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>
2023-07-19 23:24:04 +00:00
Giteabot
28e8c691a6
avoid hard-coding height in language dropdown menu () ()
Backport  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>
2023-07-20 01:05:22 +02:00
Giteabot
f81a612eb1
parseScope with owner/repo always sets owner to zero () ()
Backport  by @earl-warren

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

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
2023-07-19 22:57:17 +08:00
Giteabot
ee47face12
Update path related documents () ()
Backport  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>
2023-07-19 09:48:54 +00:00
Giteabot
864bdd0ac8
Make pending commit status yellow again () ()
Backport  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>
2023-07-19 06:43:41 +00:00
Giteabot
037a3f0d8c
Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled () ()
Backport  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>
2023-07-19 04:35:16 +00:00
Giteabot
227c3b67e0
Fix SSPI auth panic () ()
Backport  by @wxiaoguang

Try to fix 

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-18 22:28:06 +00:00
wxiaoguang
5c3662b902
Avoid creating directories when loading config () ()
Backport 

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 
2023-07-18 20:24:07 +00:00
KN4CK3R
ab54310731
Disallow dangerous URL schemes () ()
Regression: https://github.com/go-gitea/gitea/pull/24805
Closes: 

- 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>
2023-07-18 19:48:52 +00:00
Giteabot
b7d054e4b5
Ignore runs-on with expressions when warning no matched runners () ()
Backport  by @wolfogre

Fix 

Co-authored-by: Jason Song <i@wolfogre.com>
2023-07-18 06:40:28 +00:00
Giteabot
d032500687
Make environment-to-ini work with INSTALL_LOCK=true () ()
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
fix 
2023-07-17 18:28:54 +00:00
Giteabot
9159964ada
Avoid opening/closing PRs which are already merged () ()
Backport  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>
2023-07-17 12:14:22 +00:00
Giteabot
9369b38315
Skip unuseful error message in dev mode when watching local filesystem () ()
Backport  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>
2023-07-17 10:26:29 +00:00
Giteabot
6e82d0bb7c
Add shutting down notice () ()
Backport  by @KN4CK3R

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

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

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-07-17 09:44:10 +00:00
Giteabot
36b9a86bd8
Fix incorrect milestone count when provide a keyword () ()
Backport  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>
2023-07-17 11:12:59 +02:00