Commit graph

18790 commits

Author SHA1 Message Date
Giteabot 9de4bebbf7
Fix empty field login_name in API response JSON when creating user (#30511) (#30516)
Backport #30511 by @yp05327

Fix #30508

ps: if `sourceID` is not set, `LoginName` will be ignored

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit f9a025f6a358aa6e34408743a59f5081f397d47c)
2024-04-21 18:07:51 +02:00
Giteabot c044cb2de3
Fix various overflows on actions view (#30344) (#30505)
Backport #30344 by @silverwind

Fix a number of text overflow issues in actions view and run list. Also
improve mobile view of run list.

Fixes: https://github.com/go-gitea/gitea/issues/30328

<img width="782" alt="Screenshot 2024-04-08 at 23 10 16"
src="https://github.com/go-gitea/gitea/assets/115237/3d9f9f88-3eab-44a0-8144-30c2b58b24cb">
<img width="935" alt="Screenshot 2024-04-08 at 23 17 46"
src="https://github.com/go-gitea/gitea/assets/115237/581d73ea-a31d-416b-be3a-47313b879b12">
<img width="1008" alt="Screenshot 2024-04-08 at 23 49 05"
src="https://github.com/go-gitea/gitea/assets/115237/c5d10565-f285-477f-8659-1caf94797647">
<img width="397" alt="Screenshot 2024-04-08 at 23 55 30"
src="https://github.com/go-gitea/gitea/assets/115237/368aaa75-1903-4058-9d75-d1fe91c564d6">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 00179f637d9add4e42edf6185cd641eb98115970)
2024-04-21 18:07:00 +02:00
Giteabot 889469fb74
Convert max file name length to 255 (#30489) (#30504)
Backport #30489 by @yp05327

Quick/Partly fix #29907

In Linux and MacOS, by default the max file name length is 255.
In windows, it depends on the version and settings, and has no file name
length limitation, but has path length limitation.
By default it is 260, considering path length is longer than filename,
so I think it is ok to do this.

For Windows, see
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
For Linux, see
https://github.com/torvalds/linux/blob/master/include/uapi/linux/limits.h#L12-L13
For MacOS, see
https://discussions.apple.com/thread/254788848?sortBy=best

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit f52b1db305f887c917e6c875b8ac4f8b784b825b)
2024-04-21 18:06:23 +02:00
Lunny Xiao 05523fc96f
Fix commit status cache which missed target_url (#30426) (#30444)
Fix #30421
Backport #30426

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 7ffc0acc424b3116e1a478962b3ea51611c710e3)

Conflicts:
	services/repository/commitstatus/commitstatus.go
	resolved in the same way as https://codeberg.org/forgejo/forgejo/pulls/3245/files#diff-1122f6e98dabe36f18c4ec06bce75fc9a799d83c
2024-04-21 18:02:50 +02:00
Giteabot ce31e611e2
Fix overflow on issue dependency (#30484) (#30494)
Backport #30484 by @silverwind

Small tweak here to prevent this and likely other events from
overflowing in the timeline:

<img width="895" alt="Screenshot 2024-04-14 at 22 53 17"
src="https://github.com/go-gitea/gitea/assets/115237/001b4f6b-f649-44ff-b2f0-c8e0dedeb384">

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 2efc81d200106cd8707dae1a1bf50ea586b4c846)
2024-04-21 17:45:36 +02:00
wxiaoguang 55447525f6
Improve "must-change-password" logic and document (#30472)
Unify the behaviors of "user create" and "user change-password".

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 4c6e2da088cf092a9790df5c84b7b338508fede7)

Conflicts:
	- cmd/admin_user_create.go
          Resolved by favoring Gitea's version of the conflicting areas.
	- docs/content/administration/command-line.en-us.md
          Removed, Gitea specific.
(cherry picked from commit b122c6ef8b)
2024-04-21 17:44:11 +02:00
Giteabot 65ba5b924f
fix: Fix to delete cookie when AppSubURL is non-empty (#30375) (#30469)
Backport #30375 by @jtran

Cookies may exist on "/subpath" and "/subpath/" for some legacy reasons
(eg: changed CookiePath behavior in code). The legacy cookie should be
removed correctly.

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Kyle D <kdumontnu@gmail.com>
(cherry picked from commit e64926c5193e9ccc30b34f187d96c74d104179ae)
2024-04-21 17:39:14 +02:00
0ko b4ccfe1bc5 Merge pull request 'Backport Translations update from Weblate (#3244)' (#3352) from 0ko/forgejo:i18n-backport-20240421 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3352
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-21 14:51:35 +00:00
Codeberg Translate 2c6fa1efd0 [I18N] Translations update from Weblate (#3244)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Justman10000 <Justman10000@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: EssGeeEich <EssGeeEich@users.noreply.translate.codeberg.org>
Co-authored-by: Zughy <Zughy@users.noreply.translate.codeberg.org>
Co-authored-by: Xinayder <Xinayder@users.noreply.translate.codeberg.org>
Co-authored-by: m0s <m0s@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3244
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-04-21 19:19:54 +05:00
Earl Warren f569f4f5dc Merge pull request '[v7.0/forgejo] cleanup(tests): remove manual testing submodule' (#3348) from bp-v7.0/forgejo-69c6141 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3348
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-21 09:15:30 +00:00
Earl Warren a1f56a159b cleanup(tests): remove manual testing submodule
It is not effective, a different approach is needed

(cherry picked from commit 69c614162f)
2024-04-21 08:46:56 +00:00
Earl Warren b349f82a62 Merge pull request '[v7.0/forgejo] Fix some edge cases with permalink rendering' (#3341) from bp-v7.0/forgejo-acfae43-e9eacde-5b6b3f3 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3341
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-20 11:09:20 +00:00
Mai-Lapyst 9641273b2b Fix panic where now a third link breaks everything
(cherry picked from commit acfae43253)
2024-04-20 10:24:54 +00:00
Mai-Lapyst ae0615561a Fix issue where rendering stops after the first invalid parmalink
(cherry picked from commit e9eacdecd2)
2024-04-20 10:24:54 +00:00
Mai-Lapyst 9c81060eb9 Fix some edge cases; closes #3232
- Fixes wrong usage of AppURL
- Fixes wrong rendering with extra path segments when AppSubURL is empty
- Now also renders all links when 2+ permalinks are present

(cherry picked from commit 5b6b3f3fb3)
2024-04-20 10:24:54 +00:00
Earl Warren 25ddcd4b40 Merge pull request '[v7.0/forgejo] hooks: Harden when we accept push options that change repo settings' (#3338) from bp-v7.0/forgejo-8eba631 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3338
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-20 10:17:49 +00:00
Gergely Nagy aacc13fca8 hooks: Harden when we accept push options that change repo settings
It is possible to change some repo settings (its visibility, and
template status) via `git push` options: `-o repo.private=true`, `-o
repo.template=true`.

Previously, there weren't sufficient permission checks on these, and
anyone who could `git push` to a repository - including via an AGit
workflow! - was able to change either of these settings. To guard
against this, the pre-receive hook will now check if either of these
options are present, and if so, will perform additional permission
checks to ensure that these can only be set by a repository owner or
an administrator. Additionally, changing these settings is disabled for
forks, even for the fork's owner.

There's still a case where the owner of a repository can change the
visibility of it, and it will not propagate to forks (it propagates to
forks when changing the visibility via the API), but that's an
inconsistency, not a security issue.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Signed-off-by: Earl Warren <contact@earl-warren.org>
(cherry picked from commit 8eba631f8d)
2024-04-20 05:58:39 +00:00
Earl Warren 67232bd44e Merge pull request '[backport] gitea#30406: Check the token's owner and repository when registering a runner' (#3262) from algernon/forgejo:backport/3257-to-7.0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3262
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-19 15:41:18 +00:00
Earl Warren 129e91956e Merge pull request '[v7.0/forgejo] services: Use proper Message-IDs for release mails' (#3326) from bp-v7.0/forgejo-b0c0167 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3326
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-19 15:40:20 +00:00
Earl Warren bc1f64e3bf Merge pull request '[v7.0/forgejo] [TEST] cancel all processes on PrepareTestEnv' (#3130) from bp-v7.0/forgejo-8ffaa08-aba99ab into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3130
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-19 15:39:36 +00:00
Earl Warren 2f54b76c5c
fix(tests): 30s to cancel processes to avoid false negatives
on slower machines it can take more than 1 second to cancel leftover
tasks

(cherry picked from commit 6316e21be2)
2024-04-19 17:04:53 +02:00
0ko 59cfbf2070 Merge pull request '[v7.0/forgejo] Remove EasyMDE from various areas' (#3331) from bp-v7.0/forgejo-089e370-703aee4-f5c7cca into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3331
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-19 14:25:39 +00:00
0ko ae128c617b Add integration test for EasyMDE button
(cherry picked from commit 089e37026f)
2024-04-19 13:49:21 +00:00
0ko 99effab1eb Remove EasyMDE from various areas
Ref https://codeberg.org/forgejo/forgejo/issues/2831

Removed from:
- form for creating comment
- form for updating comment
- popup reviewing form
- line reviewing form
- I did not check the use of textarea.tmpl but I belive its used for issue templates, so also removed
- I did not check the use of box.tmpl, could not get any comments on compare

EasyMDE is left for these pages:
- release notes editor
- wiki editor

(cherry picked from commit 703aee4cad)
2024-04-19 13:49:20 +00:00
0ko 4b0e8f227d Make display of EasyMDE in UI optional to template
This commit adds EasyMDE field to combomarkdowneditor, as well as to all its calls.

(cherry picked from commit f5c7ccaeff)
2024-04-19 13:49:20 +00:00
Earl Warren 7784a6c331 Merge pull request '[v7.0/forgejo] Fix release published actions not triggering for releases created from existing tags' (#3273) from bp-v7.0/forgejo-8506dbe-46977b0 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3273
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-19 12:51:01 +00:00
Gergely Nagy 405162178b services: Use proper Message-IDs for release mails
When sending notification emails about a release, use a properly
formatted, RFC-compliant message id, rather than the release's HTML URL
wrapped in angle brackets (which would not be compliant).

Fixes #3105.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit b0c0167c54)
2024-04-19 08:42:18 +00:00
Earl Warren 4db1b2fb96 Merge pull request '[v7.0/forgejo] fix(release): add missing ARG RELEASE_VERSION' (#3292) from bp-v7.0/forgejo-97189d4 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3292
2024-04-17 16:48:51 +00:00
Earl Warren c8017a2853 fix(release): add missing ARG RELEASE_VERSION
The ARG RELEASE_VERSION set in the build-env image does not propagate
to the images that follow. As a result the value of the version label
is always empty.

This should have been caught by the test in the CI but although it
notified the problem in the output, it did not fail. Upgrade to the
forgejo-build-publish version that fixes this false positive.

(cherry picked from commit 97189d41f3)
2024-04-17 16:06:43 +00:00
Earl Warren d81a814fe5 Merge pull request '[v7.0/forgejo] Allow admins to fork repos even when creation limits are exhausted' (#3282) from bp-v7.0/forgejo-ea4071c into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3282
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 10:17:50 +00:00
Earl Warren 8956825bac Merge pull request '[v7.0/forgejo] feat(release): add OCI labels to container images' (#3281) from bp-v7.0/forgejo-028d19c into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3281
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 06:33:31 +00:00
Gergely Nagy 261fc87673 Allow admins to fork repos even when creation limits are exhausted (#3277)
This is a continuation of #2728, with a test case added.

Fixes #2633.

I kept @zareck 's commit as is, because I believe it is correct. We can't move the check to `owner.CanForkRepo()`, because `owner` is the future owner of the forked repo, and may be an organization. We need to check the admin permission of the `doer`, like in the case of repository creation.

I verified that the test fails without the `ForkRepository` change, and passes with it.

Co-authored-by: Cassio Zareck <cassiomilczareck@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3277
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Co-committed-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit ea4071ca9f)
2024-04-17 06:06:48 +00:00
Earl Warren 989d35d748 feat(release): add OCI labels to container images
(cherry picked from commit 028d19c0fe)
2024-04-17 05:48:38 +00:00
Laura Hausmann 145cac0865 Add tests for webhook release events
Co-authored-by: oliverpool <git@olivier.pfad.fr>
(cherry picked from commit 8506dbe2e5)
2024-04-16 18:28:54 +00:00
Laura Hausmann ee500dacd0 Fix release published actions not triggering for releases created from existing tags
(cherry picked from commit 46977b0f01)
2024-04-16 18:28:53 +00:00
0ko 515d71bffa Merge pull request '[v7.0/forgejo] [BUG] Escape editor.add_tmpl translation' (#3272) from bp-v7.0/forgejo-a0f47b8 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3272
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-16 18:04:47 +00:00
Gusted 0f72cd8508 [BUG] Escape editor.add_tmpl translation
- Previously translations were escaped, but now translations are
accepted as-is and will be rendered as HTML. Use `TrString` to escape
the translation value.
- Adds integration test.
- Regression of 65248945c9.
- Resolves #3260

(cherry picked from commit a0f47b8de7)
2024-04-16 16:23:25 +00:00
Earl Warren 430083ba46 Merge pull request '[v7.0/forgejo] [BUG] Fix styling of close button' (#3271) from bp-v7.0/forgejo-7fcb9c3 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3271
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 16:18:56 +00:00
Gusted a1bba9c547 [BUG] Fix styling of close button
- This is a partial revert of c2280a2009,
it was already fixed upstream, but not for the `.basic` variant.
- Resolves #3252

(cherry picked from commit 7fcb9c3636)
2024-04-16 15:20:43 +00:00
Zettat123 1173663f17
Check the token's owner and repository when registering a runner (#30406)
Fix #30378

(cherry picked from commit 0fe9f93eb4c94d55e43b18b9c3cc6d513a34c0b5)

Conflicts:
	- models/organization/org.go
	- services/repository/delete.go
	- services/user/delete.go
	In all three cases, conflicts were resolved by manually adding
        the lines added by the Gitea patch, keeping the Forgejo code
        surrounding them.
2024-04-16 11:43:08 +02:00
Earl Warren 335abbbc9d Merge pull request '[v1.22/gitea] week 16 cherry pick to v7.0' (#3235) from earl-warren/forgejo:wip-v7.0-gitea-cherry-pick into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3235
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-16 09:31:46 +00:00
Earl Warren 3fb1036156 Merge pull request '[v7.0/forgejo] [BUG] Use correct empty commit ID' (#3255) from bp-v7.0/forgejo-eeaef55 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3255
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 08:42:47 +00:00
Earl Warren 9f192dc2e5 Merge pull request '[v7.0/forgejo] [BUG] Fix archive button on release page' (#3254) from bp-v7.0/forgejo-39c3295 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3254
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 08:42:05 +00:00
Earl Warren f83e55b1ca Merge pull request '[v7.0/forgejo] Some NuGet package enhancements' (#3256) from bp-v7.0/forgejo-2e613ad into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3256
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-16 08:41:03 +00:00
oliverpool 8f06a99c2c
[TEST] make the indexer and pull tasks cancellable (without shutdown)
See
https://codeberg.org/forgejo/forgejo/pulls/3130#issuecomment-1763440
for the conflict resolution.

(cherry picked from commit d79690ce18)
2024-04-16 10:37:59 +02:00
Earl Warren ec6b255c2c
[TESTS] disable test failure on log.Error for now (part 2)
Fixes: https://codeberg.org/forgejo/forgejo/issues/3153
(cherry picked from commit fd62033b98)
2024-04-16 10:28:48 +02:00
oliverpool dd474b72df
add missing defer
(cherry picked from commit 8ffaa08b04)
2024-04-16 10:28:48 +02:00
oliverpool 569b73e495
[TEST] cancel all processes on PrepareTestEnv
(cherry picked from commit aba99ab8fc)
2024-04-16 10:28:48 +02:00
Michael Kriese a1716fcdfc Some NuGet package enhancements
- https://github.com/go-gitea/gitea/pull/30280

(cherry picked from commit 2e613ad5e7)
2024-04-16 06:54:35 +00:00
Gusted ef0ce374a5 [BUG] Use correct empty commit ID
- `RemoveFilesFromIndex` used an hardcoded empty commit ID for the SHA1
object format, this would result in an error if the repository was
initialized to use the sha256 object format. Get the object format of
the Git repository and use that to get the empty commit id.
- Adds unit test.
- Resolves #3184

(cherry picked from commit eeaef556c2)
2024-04-16 06:47:31 +00:00