Commit graph

15988 commits

Author SHA1 Message Date
Giteabot
37d327ab5d
Add changelog for 1.20.1 (#26015) (#26056)
Backport #26015 by @delvh

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 221b90d289)
2023-07-24 07:59:10 +02:00
Giteabot
2a4dcad472
Fix version in rpm repodata/primary.xml.gz (#26009) (#26048)
Co-authored-by: Peter Verraedt <peter.verraedt@gmail.com>
(cherry picked from commit 81f5a87eb4)
2023-07-24 07:59:10 +02:00
Giteabot
8e4f521381
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>
(cherry picked from commit 8b002b429d)
2023-07-24 07:59:10 +02:00
Giteabot
7cc4d211b1
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>
(cherry picked from commit dfd371a363)
2023-07-24 07:59:10 +02:00
Giteabot
884f2c125c
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>
(cherry picked from commit 54a516e9da)
2023-07-24 07:59:10 +02:00
Giteabot
9a3778b230
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>
(cherry picked from commit ac129d4b4c)
2023-07-24 07:59:10 +02:00
Giteabot
d4fa6a846a
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>
(cherry picked from commit 4d5e3b9372)
2023-07-24 07:59:10 +02:00
Giteabot
de7f99d339
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>
(cherry picked from commit 1ba0baa030)
2023-07-24 07:59:10 +02:00
Giteabot
321909de7e
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>
(cherry picked from commit 28e8c691a6)
2023-07-24 07:59:10 +02:00
Giteabot
f890856cf4
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>
(cherry picked from commit ee47face12)
2023-07-24 07:58:56 +02:00
Giteabot
3d033a3aa7
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>
(cherry picked from commit 864bdd0ac8)
2023-07-24 07:58:56 +02:00
Giteabot
a50dfca667
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>
(cherry picked from commit 037a3f0d8c)
2023-07-24 07:58:56 +02:00
Giteabot
0593018dba
Fix SSPI auth panic (#25955) (#25969)
Backport #25955 by @wxiaoguang

Try to fix #25952

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 227c3b67e0)
2023-07-24 07:58:56 +02:00
wxiaoguang
8630d63f57
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

(cherry picked from commit 5c3662b902)
2023-07-24 07:58:56 +02:00
KN4CK3R
7ad63bc41e
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>
(cherry picked from commit ab54310731)
2023-07-24 07:58:56 +02:00
Giteabot
16102d3787
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>
(cherry picked from commit b7d054e4b5)
2023-07-24 07:58:56 +02:00
Giteabot
d5c4f3430e
Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
fix #25924

(cherry picked from commit d032500687)
2023-07-24 07:58:56 +02:00
Giteabot
27a40aeb6b
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>
(cherry picked from commit 9159964ada)
2023-07-24 07:58:56 +02:00
Giteabot
d1ed7ea9e3
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>
(cherry picked from commit 9369b38315)
2023-07-24 07:58:56 +02:00
Giteabot
61c6814c15
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>
(cherry picked from commit 36b9a86bd8)
2023-07-24 07:58:50 +02:00
Earl Warren
2de8602855
[GITEA] do not use deprecatedSettingFatal for cosmetic reasons
It breaks existing instances that would otherwise work perfectly
fine. Failing to start an instance should only happen when there is a
compelling reason to do so, for instance if the `app.ini` could not be
modified in a way that is backward compatible. If the only motivation
is to remove the setting for cosmetic reason, it must not be fatal.

(cherry picked from commit c09ef82e9a)
(cherry picked from commit e80aaa11d9)
2023-07-24 07:58:17 +02:00
Giteabot
6c0932f8a4
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>
(cherry picked from commit 6e82d0bb7c)
2023-07-24 07:56:33 +02:00
Earl Warren
f405880230
Revert "[GITEA] do not use deprecatedSettingFatal for cosmetic reasons"
This reverts commit e80aaa11d9.
2023-07-24 07:55:43 +02:00
Loïc Dachary
1ceadbbfda Merge pull request '[GITEA] do not enforce misc scope tokens for public API endpoints' (#1100) from dachary/forgejo:wip-v1.20-api-public into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1100
2023-07-23 21:19:22 +00:00
Loïc Dachary
666f43fb64
[GITEA] do not enforce misc scope tokens for public API endpoints
(cherry picked from commit e353d1c4b7)
2023-07-23 22:35:11 +02:00
Loïc Dachary
4ad5e21f1f Merge pull request '[GITEA] do not use deprecatedSettingFatal for cosmetic reasons' (#1096) from earl-warren/forgejo:wip-v1.20-deprecated into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1096
2023-07-23 20:05:03 +00:00
Earl Warren
e80aaa11d9
[GITEA] do not use deprecatedSettingFatal for cosmetic reasons
It breaks existing instances that would otherwise work perfectly
fine. Failing to start an instance should only happen when there is a
compelling reason to do so, for instance if the `app.ini` could not be
modified in a way that is backward compatible. If the only motivation
is to remove the setting for cosmetic reason, it must not be fatal.

(cherry picked from commit c09ef82e9a)
2023-07-23 12:33:14 +02:00
Gusted
f255e50903 Merge pull request '[GITEA]: Render status of list items for Org mode' (#1078) from Gusted/forgejo:backport-1071 into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1078
2023-07-19 21:24:23 +00:00
Gusted
e1829f0728
[GITEA]: Render status of list items for Org mode
- The library that's being used for org-mode, [doesn't render the status
of list items](https://github.com/niklasfasching/go-org/issues/63).
- Add a modified version of the proposed CSS snippet to still display
the status for the list items. The alternative was parsing HTML and
transforming it, which is too complicated for this small task.
- Resolves https://codeberg.org/Codeberg/Community/issues/1099
2023-07-19 23:00:56 +02:00
Loïc Dachary
5b24dae483 Merge pull request '[CI] DEFAULT_ACTIONS_URL support for self & github (squash)' (#1072) from dachary/forgejo:wip-v1.20-default-actions into v1.20/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1072
2023-07-19 13:16:12 +00:00
Loïc Dachary
2eb558be4a
[CI] DEFAULT_ACTIONS_URL support for self & github (squash)
Refs: https://codeberg.org/forgejo/forgejo/issues/1062
(cherry picked from commit 74cc25376e)
2023-07-19 14:34:38 +02:00
Earl Warren
b65d458c3a
Merge remote-tracking branch 'forgejo/v1.20/forgejo-dependency' into v1.20/forgejo 2023-07-17 08:01:29 +02:00
Earl Warren
1371196064
Merge remote-tracking branch 'forgejo/v1.20/forgejo-moderation' into v1.20/forgejo 2023-07-17 08:01:23 +02:00
Earl Warren
c37099723e
Merge remote-tracking branch 'forgejo/v1.20/forgejo-branding' into v1.20/forgejo 2023-07-17 08:01:16 +02:00
Earl Warren
2dc0ce6b77
Merge remote-tracking branch 'forgejo/v1.20/forgejo-i18n' into v1.20/forgejo 2023-07-17 08:01:06 +02:00
Earl Warren
50158ca8e1
[GITEA] environment-to-ini fails if run as root
(cherry picked from commit 494f11afe8)
(cherry picked from commit 883d3f3f0f)
(cherry picked from commit ec2b69b0ec)
2023-07-17 00:27:19 +02:00
Earl Warren
8924d15dec
[GITEA] silently ignore obsolete sudo scope
Fixes: https://codeberg.org/forgejo/forgejo/issues/820
(cherry picked from commit 6a7022ebbb)
(cherry picked from commit 764eac47b5)
(cherry picked from commit 14480339f0)
(cherry picked from commit fb930bd719)
(cherry picked from commit 97d1166aba)
(cherry picked from commit 97b2abc767)
(cherry picked from commit 3854c9112f)
2023-07-17 00:27:19 +02:00
Gusted
73776d6195
[MODERATION] add user blocking API
- Follow up for: #540, #802
- Add API routes for user blocking from user and organization
perspective.
- The new routes have integration testing.
- The new model functions have unit tests.
- Actually quite boring to write and to read this pull request.

(cherry picked from commit f3afaf15c7)
(cherry picked from commit 6d754db3e5)
(cherry picked from commit d0fc8bc9d3)
(cherry picked from commit 9a53b0d1a0)
(cherry picked from commit 44a2a4fd48)
(cherry picked from commit 182025db9c)
(cherry picked from commit 558a35963e)
2023-07-17 00:26:42 +02:00
Gusted
cdf6318f51
[MODERATION] organization blocking a user (#802)
- Resolves #476
- Follow up for: #540
- Ensure that the doer and blocked person cannot follow each other.
- Ensure that the block person cannot watch doer's repositories.
- Add unblock button to the blocked user list.
- Add blocked since information to the blocked user list.
- Add extra testing to moderation code.
- Blocked user will unwatch doer's owned repository upon blocking.
- Add flash messages to let the user know the block/unblock action was successful.
- Add "You haven't blocked any users" message.
- Add organization blocking a user.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/802
(cherry picked from commit 0505a10421)
(cherry picked from commit 37b4e6ef9b)
(cherry picked from commit 217475385a)
(cherry picked from commit f2c38ce5c2)
(cherry picked from commit 1edfb68137)
(cherry picked from commit 2cbc12dc74)
(cherry picked from commit 79ff020f18)
2023-07-17 00:26:42 +02:00
Gusted
dc9499bdf9
[MODERATION] user blocking
- Add the ability to block a user via their profile page.
- This will unstar their repositories and visa versa.
- Blocked users cannot create issues or pull requests on your the doer's repositories (mind that this is not the case for organizations).
- Blocked users cannot comment on the doer's opened issues or pull requests.
- Blocked users cannot add reactions to doer's comments.
- Blocked users cannot cause a notification trough mentioning the doer.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/540
(cherry picked from commit 687d852480)
(cherry picked from commit 0c32a4fde5)
(cherry picked from commit 1791130e3c)
(cherry picked from commit 00f411819f)
(cherry picked from commit e0c039b0e8)
(cherry picked from commit b5a058ef00)
(cherry picked from commit 5ff5460d28)
(cherry picked from commit 97bc6e619d)
2023-07-17 00:26:42 +02:00
Loïc Dachary
234e6d3648
[BRANDING] alias {FORGEJO,GITEA}_{CUSTOM,WORK_DIR}
FORGEJO_* environment variables are set to the corresponding GITEA_*
variable when the cli starts. This approach is intended to minimize
the conflicts on rebase. All occurences of GITEA_* are left untouched
in the codebase and they are only changed to FORGEJO_* if exposed to
the user.

(cherry picked from commit e466f9d10e)
(cherry picked from commit e33e95931b)
(cherry picked from commit 2cfc6519b7)
(cherry picked from commit af8864373a)
(cherry picked from commit a0550ff339)
(cherry picked from commit 24dc0a5191)
(cherry picked from commit e255eea2b4)
(cherry picked from commit 0c4f5afa7a)
(cherry picked from commit 42fce708d0)
(cherry picked from commit e7278c3c22)
(cherry picked from commit 0fb9ed7e0e)
(cherry picked from commit a98308aa4d)
(cherry picked from commit b8695fcbe0)
(cherry picked from commit 4aee8719f5)
(cherry picked from commit 1c503c1ba7)
(cherry picked from commit cf1ed8551e)
(cherry picked from commit c52459b088)
(cherry picked from commit 92cac277b2)
(cherry picked from commit 2c744f1118)
(cherry picked from commit 1482cfabe5)
2023-07-17 00:25:56 +02:00
Earl Warren
266948e08a
[BRANDING] parse FORGEJO__* in the container environment
(cherry picked from commit b075991747)
(cherry picked from commit ac8503150a)
2023-07-17 00:25:56 +02:00
Caesar Schinas
6730fd099d
[BRANDING] fix code highlight color in Forgejo themes
(cherry picked from commit ffc49a4e99)
(cherry picked from commit c703523736)
(cherry picked from commit fc76689670)
2023-07-17 00:25:56 +02:00
Earl Warren
7565c91698
[BRANDING] Add Forgejo light, dark, and auto themes (squash) variables
Adapt to b6bcb79987 Improve notification
icon and navbar

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

[BRANDING] Add Forgejo light variables

Updates the Forgejo light theme with the changes in b6bcb7998

These are the same changes as made in 2574dbcff to the dark theme

Refs: forgejo/forgejo#893
(cherry picked from commit 6fa0d493a1)
(cherry picked from commit 4ccf8b62e4)
(cherry picked from commit 9f932d4cbc)
2023-07-17 00:25:56 +02:00
Gusted
f2ecd46d96
[BRANDING] Use forgejo binary name
- Use `forgejo` binary name for migration suggestions.
- Resolves https://codeberg.org/forgejo/forgejo/issues/869#issuecomment-944501

(cherry picked from commit 418a0bed8f)
(cherry picked from commit 734579ce9b)
(cherry picked from commit 8b7cf605f2)
(cherry picked from commit c59e1a4e61)
(cherry picked from commit e3877892e1)
(cherry picked from commit d7249a4b84)
2023-07-17 00:25:56 +02:00
Gusted
1ce2f72355
[BRANDING] Fix commit label for Forgejo Dark theme (#843)
- Define the `--color-label-text` variable with a light color, which is currently used for commit's SHA

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/843
(cherry picked from commit 74c186a380)
(cherry picked from commit 7e185c5ca5)
(cherry picked from commit 7e8eb1b2a1)
(cherry picked from commit 2e7b0209d7)
(cherry picked from commit ee2cfd1cd0)
(cherry picked from commit c731139bf3)
2023-07-17 00:25:56 +02:00
Caesar Schinas
e2c4609b8a
[BRANDING] fix invisible label in branch protection settings
(cherry picked from commit 23e5d45721)
(cherry picked from commit f02e4582e5)
(cherry picked from commit 51e0cb0fbc)
(cherry picked from commit 02a2657072)
(cherry picked from commit 5a42fa9dd4)
(cherry picked from commit 2f031c3bb2)
2023-07-17 00:25:56 +02:00
Earl Warren
36eae26e00
[BRANDING] How to start a runner: URL to Actions admin documentation
(cherry picked from commit da91799e6f)
(cherry picked from commit 28231663b6)
(cherry picked from commit bc93414ba9)
(cherry picked from commit 20a54b8c5c)
(cherry picked from commit c50ae6ce93)
(cherry picked from commit 29df22ac10)
(cherry picked from commit 6667da6550)
2023-07-17 00:25:56 +02:00
Earl Warren
0ed0f83c2c
[BRANDING] systemd service trim WatchdogSec=30s
Refs: https://codeberg.org/forgejo/forgejo/issues/777
(cherry picked from commit 11b646dc6a)
(cherry picked from commit e37847b9e6)
(cherry picked from commit 3af3a40009)
(cherry picked from commit a0004e95d8)
(cherry picked from commit 8a156cd22b)
(cherry picked from commit 49dfaff057)
(cherry picked from commit 0fb94b96b8)
2023-07-17 00:25:56 +02:00
Earl Warren
7a73391f50
[BRANDING] systemd service Type=simple
The problem is Type=notify - when that is set, systemd waits for a
signal from the service that it's ready so systemctl start forgejo
takes forever (or until it runs into a timeout).

Refs: https://codeberg.org/forgejo/forgejo/issues/777
(cherry picked from commit c127369bba)
(cherry picked from commit 883a7eb570)
(cherry picked from commit 4dfa4c7d21)
(cherry picked from commit 961163d010)
(cherry picked from commit ace05fd6a7)
(cherry picked from commit 2536140d72)
(cherry picked from commit ce79f05e76)
(cherry picked from commit 987df8acf4)
(cherry picked from commit 3039e6c753)
2023-07-17 00:25:56 +02:00