mirror of
1
Fork 0
Commit Graph

20730 Commits

Author SHA1 Message Date
Gusted 06d42e6f03 Merge pull request '[SEC] Ensure propagation of API scopes for Conan and Container authentication' (#5149) from gusted/forgejo-api-scope into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5149
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-08-28 08:43:01 +00:00
Gusted 5a871f6095
[SEC] Ensure propagation of API scopes for Conan and Container authentication
- The Conan and Container packages use a different type of
authentication. It first authenticates via the regular way (api tokens
or user:password, handled via `auth.Basic`) and then generates a JWT
token that is used by the package software (such as Docker) to do the
action they wanted to do. This JWT token didn't properly propagate the
API scopes that the token was generated for, and thus could lead to a
'scope escalation' within the Conan and Container packages, read
access to write access.
- Store the API scope in the JWT token, so it can be propagated on
subsequent calls that uses that JWT token.
- Integration test added.
- Resolves #5128
2024-08-28 10:33:32 +02:00
Otto 8d0530650e Merge pull request 'Remove 15 unused strings' (#5139) from 0ko/forgejo:i18n-cleanup-15x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5139
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-08-27 11:06:13 +00:00
Earl Warren 9addaedaf3 Merge pull request '[gitea] week 2024-35 cherry pick (gitea/main -> forgejo)' (#5109) from algernon/wcp/2024-35 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5109
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-08-27 06:09:19 +00:00
0ko 3c00c60b84 i18n(en): remove 15 unused strings 2024-08-27 10:31:35 +05:00
Otto a8d01a77cb Merge pull request 'fix: correct doctor commands and rename to forgejo' (#5133) from fnetx/fix-doctor-help into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5133
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-27 01:43:21 +00:00
Otto bf65f1e510 Merge pull request 'feat: Trivial default quota configuration' (#5125) from algernon/forgejo:falling-in-reverse into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5125
Reviewed-by: Otto <otto@codeberg.org>
2024-08-27 01:22:41 +00:00
Otto Richter 94af0e53e5 fix: correct doctor commands and rename to forgejo
The syntax is `doctor check --run` , see https://forgejo.org/docs/latest/admin/command-line/#doctor
2024-08-27 02:40:55 +02:00
Gusted a9a8973894 Merge pull request 'chore(release-notes): Update module github.com/go-enry/go-enry/v2 to v2.8.9' (#5124) from earl-warren/forgejo:wip-enry into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5124
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-26 22:36:15 +00:00
Otto c856f77622 Merge pull request 'Update links affected by the renaming of 'developer' documentation sub-path into 'contributor'' (#5129) from floss4good/forgejo__forgejo:contrib-doc into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5129
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-08-26 18:50:40 +00:00
Otto e5ea08b38b Merge pull request 'feat: Improve diffs generated by Forgejo' (#5110) from fnetx/better-diffs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5110
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-26 18:47:21 +00:00
Gusted d623126103 Merge pull request '[PORT] Refactor the usage of batch catfile (gitea#31754)' (#5122) from gusted/forgejo-port-gt-31754 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5122
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-08-26 16:04:47 +00:00
floss4good 5879cdc6fa
Update the translator contributing guide from user language settings. 2024-08-26 17:43:35 +03:00
Gusted 58ee9fdc4a feat: Improve diff being generated
Add `DiffCleanupSemantic` into the mix when generated diffs (PR review,
commit view and issue/comment history). This avoids trying to produce a
optimal diff and tries to reduce the amount of edits, by combing them
into larger edits, which is nicer and easier to 'look at'. There's no
need for a perfect minimal diff, as the output isn't being parsed by a
computer, it's parsed by people.

Ref: https://codeberg.org/forgejo/forgejo/issues/4996
2024-08-26 13:58:17 +02:00
Otto Richter d97e36f6d7 Playwright testing for commit diffs
includes:

- easier repo declaration for playwright tests by @Gusted
- full backend build for pushing Git repos by @Gusted
- playwright testing (which fails with the current diff algorithm, but
  passes with the new)
- disable eslint rule for conditional expect, because it defeats the
  purpose (working around it would result in much more complex test code
  in our cases)
2024-08-26 13:57:42 +02:00
floss4good 018aefe29f
Replace Developer Guide links with the new Contributor Guide one for PR template and release workflows comments. 2024-08-26 14:29:10 +03:00
Gergely Nagy 3b70949651
feat: Trivial default quota configuration
This adds a new configuration setting: `[quota.default].TOTAL`, which
will be used if no groups are configured for a particular user. The new
option makes it possible to entirely skip configuring quotas via the API
if all that one wants is a total size.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-08-26 13:25:34 +02:00
floss4good 2190b67507
docs: replace Developer Guide link with the new Contributor Guide one. 2024-08-26 13:22:39 +03:00
Earl Warren 190b5a3859 Merge pull request '[FIX] Don't allow SSH authentication without ssh executable' (#5123) from gusted/forgejo-prevent-no-ssh into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5123
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-08-26 08:03:52 +00:00
Earl Warren 681b5e5113
chore(release-notes): Update module github.com/go-enry/go-enry/v2 to v2.8.9 2024-08-26 09:54:03 +02:00
Earl Warren e2ae389184 Merge pull request '[CHORE] Move to new sessioner library' (#5090) from gusted/forgejo-sessioner-fork into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5090
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-08-26 07:31:56 +00:00
Earl Warren 2514ba4e36 Merge pull request '[CHORE] Remove unused `exclude`' (#5118) from gusted/forgejo-tidy-gomod into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5118
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-08-26 07:28:52 +00:00
Gusted 1a68d14cf8
[FIX] Don't allow SSH authentication without ssh executable
- Follow up of #4819
- When no `ssh` executable is present, disable the UI and backend bits
that allow the creation of push mirrors that use SSH authentication. As
this feature requires the usage of the `ssh` binary.
- Integration test added.
2024-08-26 08:58:35 +02:00
Gusted b44dcf553c
[TESTS] Fix usage of `LoadRepoCommit`
It loads the Commit with a temporary open GitRepo. This is incorrect,
the GitRepo should be open as long as the Commit can be used. This
mainly removes the usage of this function as it's not needed.
2024-08-26 08:03:48 +02:00
Gergely Nagy 4afbeb3cb6
chore(release-notes): weekly cherry-pick week 2024-35
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-08-26 07:44:20 +02:00
Gusted a5b51e9145 Merge pull request 'Update renovate to v38.52.3 (forgejo)' (#5119) from renovate/forgejo-renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5119
2024-08-26 05:02:21 +00:00
Renovate Bot fbe464309b Update renovate to v38.52.3 2024-08-26 04:05:34 +00:00
Gusted 5541537b1b Merge pull request 'Update module github.com/go-enry/go-enry/v2 to v2.8.9 (forgejo)' (#5120) from renovate/forgejo-github.com-go-enry-go-enry-v2-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5120
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-26 02:53:41 +00:00
Gusted 24bbf051c3
[TESTS] Add test for CatFileBatch(Check) 2024-08-26 04:48:52 +02:00
Renovate Bot ec4e648e3a Update module github.com/go-enry/go-enry/v2 to v2.8.9 2024-08-26 02:05:27 +00:00
Lunny Xiao 0ca13c5eae
[PORT] Refactor the usage of batch catfile (gitea#31754)
When opening a repository, it will call `ensureValidRepository` and also
`CatFileBatch`. But sometimes these will not be used until repository
closed. So it's a waste of CPU to invoke 3 times git command for every
open repository.

This PR removed all of these from `OpenRepository` but only kept
checking whether the folder exists. When a batch is necessary, the
necessary functions will be invoked.

---
Conflict resolution: Because of the removal of go-git in (#4941)
`_nogogit.go` files were either renamed or merged into the 'common'
file. Git does handle the renames correctly, but for those that were
merged has to be manually copied pasted over. The patch looks the same,
201 additions 90 deletions as the original patch.

(cherry picked from commit c03baab678ba5b2e9d974aea147e660417f5d3f7)
2024-08-26 03:48:51 +02:00
Gusted 3af7e03aeb
[CHORE] Remove unused `exclude`
This was introduced in https://github.com/go-gitea/gitea/pull/18311 to
exclude a vulnerable dependency. I am not sure when this happened or
with which dependency update, but this dependency is no longer being
used by another dependency and therefore these `exclude`s are no longer
needed. (Verified via `go mod graph`).
2024-08-26 03:31:07 +02:00
Gusted cbedd7e5be Merge pull request '[PORT] Enable `no-jquery/no-class-state` (gitea#31639) & Remove `eslint-plugin-jquery` (gitea#31402)' (#5107) from gusted/forgejo-port-gt-31402 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5107
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>
2024-08-26 00:01:43 +00:00
Gusted e726b7ec3b Merge pull request '[SKIP CI] Don't duplicate key' (#5115) from gusted/forgejo-translation-unique-key into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5115
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-08-25 16:20:22 +00:00
Gusted 5c2445d643
[SKIP CI] Don't duplicate key
- Follow up #4819.
- It introduces a duplicate key, which is wrong. Move to a unique
translation key to avoid conflicts.
2024-08-25 18:07:22 +02:00
Otto 32735b1e61 Merge pull request '[TESTS] Move `CreateDeclarativeRepo` to more accessible location' (#5108) from gusted/forgejo-chore-declerative-repo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5108
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-08-25 11:15:22 +00:00
Gergely Nagy 0aa3e6e4e4
tests: Use require.NoError in tests picked from Gitea
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-08-25 13:02:19 +02:00
Lunny Xiao ef5ac9a8ee
Use correct function name (#31887)
(cherry picked from commit 0299bb97f038685aee794a992fa4a9f5cf83652e)
2024-08-25 11:56:35 +02:00
william-allspice 79f6f2f62e
Move lock icon position and add additional tooltips to branch list page (#31839)
This Pull Request adds missing tool tips for the protected, copy, and rss icons on the branch list page. It also moved protected icon position after the branch name.

(cherry picked from commit 40036b610224338ff730acb6e182aa8a6ebdb009)
2024-08-25 11:56:35 +02:00
Lunny Xiao 3ade4d9b2b
Don't return 500 if mirror url contains special chars (#31859)
Fix #31640

(cherry picked from commit d158472a5a9ead8052095b153821a9f26c294452)
2024-08-25 11:56:35 +02:00
Lunny Xiao dda53569b1
Fix agit automerge (#31207)
(cherry picked from commit 8b92eba21f5c5cca277b8101ada0ea7a1fb32ae0)
2024-08-25 10:47:37 +02:00
Rowan Bohde 1b845b2722
add CfTurnstileSitekey context data to all captcha templates (#31874)
In the OpenID flows, the "CfTurnstileSitekey" wasn't populated, which
caused those flows to fail if using Turnstile as the Captcha
implementation.

This adds the missing context variables, allowing Turnstile to be used
in the OpenID flows.

(cherry picked from commit 0d24c9f383255605d68a92cc5f087c3f16a1d735)
2024-08-25 10:47:02 +02:00
Lunny Xiao bdf477f6ef
Fix actions notify bug (#31866)
Try to fix
https://github.com/go-gitea/gitea/issues/31757#issuecomment-2295131062

(cherry picked from commit 4f5c96627b4622d64593db2d436b1f3befa5f3c3)
2024-08-25 10:41:24 +02:00
Gusted fc40a5e242
[CHORE] Move to new sessioner library
- Moves to a fork of gitea.com/go-chi/session that removed support for
couchbase (and ledis, but that was never made available in Forgejo)
along with other code improvements.
f8ce677595..main
- The rationale for removing Couchbase is quite simple. Its not licensed
under FOSS
license (https://www.couchbase.com/blog/couchbase-adopts-bsl-license/)
and therefore cannot be tested by Forgejo and shouldn't be supported.
This is a similair vein to the removal of MSSQL
support (https://codeberg.org/forgejo/discussions/issues/122)
- A additional benefit is that this reduces the Forgejo binary by ~600Kb.
2024-08-25 03:47:08 +02:00
Gusted d34d8ec2cf Merge pull request 'fix: include last line in file previews with no trailing newline' (#5085) from solomonv/fix-previews-without-trailing-eol into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5085
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-25 00:58:14 +00:00
silverwind 98349a1889
[PORT] Enable `no-jquery/no-class-state` (gitea#31639)
Just 4 validations and I specifically tested this by
selecting/unselecting issue labels.

Co-authored-by: Giteabot <teabot@gitea.io>

---
Clean port. Fixed two additional warnings

(cherry picked from commit 3a7454df7a518f810fbeb34b9d784e7c29d173ff)
2024-08-25 02:57:50 +02:00
Gusted f78e397dd6
[TESTS] Move `CreateDeclarativeRepo` to more accessible location
- This allows `CreateDeclarativeRepo` to be used by other testing
packages such as E2EE testing.
- Removes unused function in `services/webhook/sourcehut/builds_test.go`.
2024-08-25 02:54:43 +02:00
Gusted 4f54918381 Merge pull request 'fix(ui): prevent exceptions on other users' repo migration pages' (#4875) from solomonv/forgejo:fix-migration-guest-exception into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4875
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-24 23:49:20 +00:00
Solomon Victorino 8f53a69c2e fix: include last line in file previews with no trailing newline 2024-08-24 17:10:31 -06:00
silverwind 04cd89709c
[PORT] Remove `eslint-plugin-jquery` (gitea#31402)
- Remove `eslint-plugin-jquery` as `eslint-plugin-no-jquery` does all it
does and is actually the maintained fork of it.

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

---
Modification: Only keep removal of eslint-plugin-jquery

(cherry picked from commit 17baf1af10de025a47ade1f16f1e5c51646d7fcf)
2024-08-25 00:48:47 +02:00