Compare commits

...

334 commits

Author SHA1 Message Date
Gusted
022eeee657 fix: ignore expired artifacts for quota calculation (#7976)
- Expired artifacts are kept in the database but the artifact has been deleted from the storage. Ignore them for the quota calculation.
- Added unit test.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7976
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-28 18:22:10 +02:00
Robert Wolff
e78d1c8210 fix: pull request cross references (#7979)
Closes #7974.

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7979
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
2025-05-28 14:50:05 +02:00
Gusted
7d2a7b8559 feat: add validating user password as trace region (#7981)
- Password hashing can take a measurable amount of time, make this more visible in the trace by capturing the computations done in the password hash in their own region.
- Ref: forgejo/forgejo#6470

## Screenshot

![image](/attachments/9834b094-a78f-4ac2-847e-91f221a84833)

The upper part are where the tasks are shown (and nothing else). The bottom part is where the interesting execution tracing happens and the part where the user password hashing happens is now properly indicated/highlighted and does not need to be inferred by looking at the stack traces.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7981
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-28 14:46:23 +02:00
Earl Warren
4c4fe595c2 chore(cleanup): fix and simplify API comparison helper (#7978)
headIsTag := headGitRepo.IsCommitExist(baseBranch)

is wrong on two counts:

- it must be assigned to commitIsTag
- it must check headBranch and not baseBranch

this is not a bug but it certainly is confusing.

Also, the logic below

 	headBranchRef := headBranch
	if headIsBranch {
		headBranchRef = headBranch
	} else if headIsTag {
		headBranchRef = headBranch
	}

can be simplified as:

 	headBranchRef := headBranch

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7978
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-05-28 14:44:51 +02:00
kramo
a9f9e7c013 fix(i18n): use correct base capitalization style (#7975)
Update several strings according to https://forgejo.org/docs/next/contributor/localization-english/#capitalization

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7975
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: kramo <git@kramo.page>
Co-committed-by: kramo <git@kramo.page>
2025-05-28 13:22:10 +02:00
0ko
e2278e5a38 fix(ui): change escaping button bg on selected lines (#7944)
* add escape part of line to the list of selectors, so it doesn't cause a hole in selected lines
* fix duplicated element ID in template
* move some CSS out of base.css to dedicated files, so it is less cluttered

Before: https://codeberg.org/attachments/0eaa277b-98e7-42de-98a2-6aca99ffcbe4

After: https://codeberg.org/attachments/124bbb86-c377-4fef-a0e3-403e8c850275

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7944
Reviewed-by: floss4good <floss4good@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-05-28 05:16:19 +02:00
0ko
ee663c5af8 Merge commit: i18n: update of translations from Codeberg Translate (#7895)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7895
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-26 16:40:45 +02:00
Codeberg Translate
40d678d4b9
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <git@alius.cz>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Infernus <infernus@noreply.codeberg.org>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Kita Ikuyo <kitakita@disroot.org>
Co-authored-by: Miguel P.L <miguel_pl@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: artnay <artnay@noreply.codeberg.org>
Co-authored-by: hugoalh <hugoalh@noreply.codeberg.org>
Co-authored-by: huskee <huskee@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@noreply.codeberg.org>
Co-authored-by: kwoot <kwoot@noreply.codeberg.org>
Co-authored-by: milimarg <milimarg@noreply.codeberg.org>
Co-authored-by: nekoedges <nekoedges@noreply.codeberg.org>
Co-authored-by: oscarotero <oscarotero@noreply.codeberg.org>
Co-authored-by: smlxdesign <smlxdesign@noreply.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: xtex <xtexchooser@duck.com>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/gl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/el/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/he/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/sv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hant/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-05-26 14:12:01 +00:00
Renovate Bot
d4bccedf8d Update renovate to v40.31.0 (forgejo) (#7959)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-26 10:17:13 +02:00
Renovate Bot
8d5d3fc47c Lock file maintenance (forgejo) (#7961)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

🔧 This Pull Request updates lock files to use the latest dependency versions.

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4yNi4wIiwidXBkYXRlZEluVmVyIjoiNDAuMjYuMCIsInRhcmdldEJyYW5jaCI6ImZvcmdlam8iLCJsYWJlbHMiOlsiZGVwZW5kZW5jeS11cGdyYWRlIiwidGVzdC9ub3QtbmVlZGVkIl19-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7961
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-26 07:53:24 +02:00
Danko Aleksejevs
d483dc674a Reimplement editor Tab handling with accessibility safeguards (#6813)
The primary goal is to balance having the editor work as expected by developers (with Tab key affecting indentation) while also not impeding keyboard navigation.

* Tab indents, Shift+Tab unindents, but only when that indent would be valid. E.g. moving existing list items down or up one level.
* Indenting a selection always works.
* When an "invalid" indent is attempted, nothing happens and a toast is shown with a hint to press again to leave the editor.
* Attempting the same action again allows the textarea lose focus by allowing the browser's default key handler.
* Pressing Esc also loses focus immediately.
* No tab handling happens until the text editor has been interacted with (other than just having been focused).
* Changing indentation in block quotes adds or removes quote levels instead.

Screenshot of the toast being shown:
a6287d29-4ce0-4977-aae8-ef1aff2ac89f

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6813
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Danko Aleksejevs <danko@very.lv>
Co-committed-by: Danko Aleksejevs <danko@very.lv>
2025-05-25 19:17:03 +02:00
0ko
8b93f41aaa fix(ui): ensure same width of usercards in grid (#6799)
Followup to https://codeberg.org/forgejo/forgejo/pulls/4760

* some refactoring
    * move rules out of repo.css to a new module
    * simplify selectors by omitting .list: it is now only used to style the list itself, they're still precise enough in scope of .user-cards
* apply wrap/ellipsis to cards' content. Done via CSS to avoid spamming gt-ellipsis in the template
    * prevent cards with long content from taking horizontal space from other cards
    * prevent such cards from causing horizontal overflow on mobile
    * prevent varying card height, it doesn't look good even with text wrapping

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6799
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-25 13:31:53 +02:00
0ko
0dd605a8d3 chore(ui): clean up hashbox CSS, small design changes (#7822)
Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7822
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
2025-05-25 12:51:27 +02:00
Gusted
62ec469394 feat: replace go-rpmutils library with our own (#7953)
- While doing cross-compiling of Forgejo (with CGO enabled) it was noticed that besides compiling sqlite3, github.com/DataDog/zstd (a CGO wrapper around the reference zstd library) took a long time to compile. Upon investigating why this library was included in the first place I concluded that this library is not even used and compiling this package is a waste of time and CPU cycles.
- https://github.com/sassoftware/go-rpmutils is the library that uses the CGO zstd library, and would use it the pure Go variant (https://github.com/klauspost/compress/zstd) if CGO is enabled (which is the default). It uses zstd to uncompress the payload of a RPM packages. This is a operation that Forgejo does not use in the slightest, hence being unused code.
- It is not possible to force compiling the pure Go variant if CGO is enabled. Therefore forking and removing this code is the only option to avoid compiling the zstd C library. The changes made to the fork can be seen here: 2660c86d57...v1.0.0
- Via [actiongraph](https://github.com/icio/actiongraph) you can precisely see where the Go compiler is spending time, on a beefy machine the compilation takes of the zstd C library takes ~40s. For reference compiling the sqlite3 C library takes ~50s.
- The forgejo binary (build via `make backend`) reduced its size by 835776 bytes (0.8 MiB).

TL;DR forked library to remove unused code to avoid Go spending a considerable amount of time compiling the reference zstd library that in the end is never used.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7953): <!--number 7953 --><!--line 0 --><!--description cmVwbGFjZSBnby1ycG11dGlscyBsaWJyYXJ5IHdpdGggb3VyIG93bg==-->replace go-rpmutils library with our own<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7953
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-25 12:30:04 +02:00
Renovate Bot
006f488577 Update forgejo go-chi packages (forgejo) (#7954)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7954
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-25 12:17:48 +02:00
Beowulf
0e8d752d86 fix(ui): relative time elements were reset on htmx swap (#7950)
Regression cf03286b5b

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7950
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-05-24 23:46:21 +02:00
Renovate Bot
3ae188652a Update module github.com/ProtonMail/go-crypto to v1.3.0 (forgejo) (#7952)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7952
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-24 23:43:27 +02:00
pboguslawski
1b0eef4957 Fix TestSSHPushMirror/Normal/Check_mirrored_content test (#7852)
On slower CI hardware test `TestSSHPushMirror/Normal/Check_mirrored_content ` may throw an error like
```
=== TestSSHPushMirror/Normal/Check_known_host_keys (tests/integration/mirror_push_test.go:312)
--- FAIL: TestSSHPushMirror (5.38s)
    testlogger.go:405: 2025/05/12 15:48:41 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /src/forgejo/tests/gitea-lfs-meta
    testlogger.go:405: 2025/05/12 15:48:42 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user/login for test-mock:12345, 200 OK in 4.6ms @ auth/auth.go:145(auth.SignIn)
    testlogger.go:405: 2025/05/12 15:48:42 ...eb/routing/logger.go:102:func1() [I] router: completed POST /user/login for test-mock:12345, 303 See Other in 14.8ms @ auth/auth.go:179(auth.SignInPost)
    testlogger.go:405: 2025/05/12 15:48:42 ...odels/user/avatar.go:59:GenerateRandomAvatar() [I] New random avatar created: 2
    testlogger.go:405: 2025/05/12 15:48:42 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/repo2/settings for test-mock:12345, 200 OK in 53.9ms @ setting/setting.go:300(setting.Settings)
    --- FAIL: TestSSHPushMirror/Normal (2.81s)
        --- FAIL: TestSSHPushMirror/Normal/Check_mirrored_content (2.26s)
            testlogger.go:405: 2025/05/12 15:48:43 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/repo2 for test-mock:12345, 200 OK in 89.1ms @ repo/view.go:798(repo.Home)
            testlogger.go:405: 2025/05/12 15:48:43 ...eb/routing/logger.go:102:func1() [I] router: completed GET /api/internal/serv/command/10000/user2/push-mirror-test?mode=2&verb=git-receive-pack for 127.0.0.1:0, 200 OK in 5.2ms @ private/serv.go:79(private.ServCommand)
            testlogger.go:405: 2025/05/12 15:48:43 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/pre-receive/user2/push-mirror-test for 127.0.0.1:0, 200 OK in 10.0ms @ private/hook_pre_receive.go:178(private.HookPreReceive)
            mirror_push_test.go:304:
                    Error Trace:    /src/forgejo/tests/integration/integration_test.go:564
                                                /src/forgejo/tests/integration/integration_test.go:228
                                                /src/forgejo/tests/integration/mirror_push_test.go:304
                                                /usr/lib/go-1.24/src/runtime/asm_amd64.s:1700
                    Error:          Not equal:
                                    expected: 200
                                    actual  : 303
                    Test:           TestSSHPushMirror/Normal/Check_mirrored_content
                    Messages:       Request: GET /user2/push-mirror-test
            mirror_push_test.go:304: Response:  <a href="/user2/push-mirror-test">See Other</a>.

            testlogger.go:405: 2025/05/12 15:48:44 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/push-mirror-test for test-mock:12345, 303 See Other in 34.7ms @ repo/view.go:798(repo.Home)
            testlogger.go:405: 2025/05/12 15:48:44 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/post-receive/user2/push-mirror-test for 127.0.0.1:0, 200 OK in 304.3ms @ private/hook_post_receive.go:35(private.HookPostReceive)
            testlogger.go:405: 2025/05/12 15:48:44 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/ssh/10000/update/10000 for 127.0.0.1:0, 200 OK in 6.6ms @ private/key.go:16(private.UpdatePublicKeyInRepo)
            testlogger.go:405: 2025/05/12 15:48:45 ...eb/routing/logger.go:102:func1() [I] router: completed GET /user2/push-mirror-test for test-mock:12345, 200 OK in 121.0ms @ repo/view.go:798(repo.Home)
```
because it does not allow temporary 303 responses while waiting in `assert.Eventually` for repo to be updated.

Fixes: 03508b33a8
Author-Change-Id: IB#1160889
Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7852
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: pboguslawski <pboguslawski@noreply.codeberg.org>
Co-committed-by: pboguslawski <pboguslawski@noreply.codeberg.org>
2025-05-24 11:06:48 +02:00
pat-s
0077015755 fix: overflow-wrap strategy in .markup CSS class (#7945)
This has been introduced in the cherry-picked commit from https://github.com/go-gitea/gitea/pull/34072

To me, adding this seems to be a bug as it forces a hard stop to any overflow nested within a markup div.

Why should it be removed again?
Because otherwise (wide) markdown tables might look super odd because the column breaking/wrapping logic is strange (likely related to the "anywhere" strategy being used).

- [Example of current state with `overflow-wrap`](https://codefloe.com/devxy/helm-rdepot/src/branch/main/charts/rdepot)
- [Example with `overflow-wrap` being removed](https://codefloe.com/devxy/helm-rdepot/src/branch/main/charts/rdepot)

| Current  | Patched  |
|---------|---------|
| ![image](/attachments/d4a32804-858c-4ed7-838a-30b969bbbf12) | ![image](/attachments/a1261dc2-da25-4d10-b46f-03967fcf57bb) |

The initial change in Gitea was motivated to resolve issues of content overflow caused by the expandable file list tree view they introduced lately. However, this seem to have caused the whole README to overflow in their case, which doesn't apply to Forgejo.

When removing this in Forgejo, only large markdown content (i.e. tables) are allowed to overflow. The whole README div will not overflow (I tested this with an extreme markdown table case).
These tables are then horizontally scrollable, similar to how GitHub handles this.

If the expandable tree view is going to be added to Forgejo, this should then be handled entirely differently. This specific change is not a solution.

I've also checked other value settings to `overflow-wrap` but none had any or any desirable effect.
I did not check all other possible CSS-related options for overflow*, but this might as well be a different task per se.

For the reasons outlined above, I am quite certain this change should be reverted (again).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7945
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2025-05-23 23:42:19 +02:00
0ko
765e7bd1b6 feat(ui): messages for empty usercards (#7947)
Show a message about list being empty, so the page doesn't look broken-ish empty.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7947
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-23 23:34:40 +02:00
Antonin Delpeuch
2b30c83a0c fix: url validation in webhook add/edit API (#7932)
Cherry-pick from 972381097c (see #7909).

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7932
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
2025-05-23 22:50:43 +02:00
Gusted
b2a3966e64 feat: remove API authentication methods that uses the URL query (#7924)
- They have been marked as deprecated since 2023 and adequate warnings have been given about this method being deprecated, remove it for Forgejo v12.
- For clarity: the reason they are deprecated is that these methods allow authentication material to be given via a URL query. This results in the authentication material being logged, which is undesired behavior.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7924
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-23 22:47:43 +02:00
Renovate Bot
a5260b7f08 Update renovate to v40.14.5 (forgejo) (#7907)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-23 10:58:16 +02:00
Antonin Delpeuch
d2fce8360c fix: Add error reporting to PRs with invalid workflows (#7930)
Hello all, I am finally taking the time to follow-up on #6277 to get this implemented :)

## Checklist

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7930): <!--number 7930 --><!--line 0 --><!--description QWRkIGVycm9yIHJlcG9ydGluZyB0byBQUnMgd2l0aCBpbnZhbGlkIHdvcmtmbG93cw==-->Add error reporting to PRs with invalid workflows<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7930
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
2025-05-22 16:48:48 +02:00
Granular9241
1faab33da5 fix(ui): center footer links (#7925)
The links on the right side of the footer are misaligned.

Especially prominent when there's more links, see images:
* https://codeberg.org/attachments/7744bff6-322d-4ec1-bf57-7c62088a14c0
* https://codeberg.org/attachments/78cd441c-83c9-4889-b770-d119befe2668

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7925
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Granular9241 <granular9241@noreply.codeberg.org>
Co-committed-by: Granular9241 <granular9241@noreply.codeberg.org>
2025-05-22 15:27:00 +02:00
famfo
dda37e86bd feat: relax email requirements (#7829)
The current email restrictions were put in place because of a security issue with sendmail (https://github.com/go-gitea/gitea/pull/17688). Remove this restriction and instead ensure that this security issue cannot happen with sendmail.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7829
Reviewed-by: Ellen Εμιλία Άννα Zscheile <fogti@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: famfo <famfo@famfo.xyz>
Co-committed-by: famfo <famfo@famfo.xyz>
2025-05-22 12:20:25 +02:00
Earl Warren
de1adf224d fix: do not unconditionally append $(GITEA_COMPATIBILITY) in version (#7933)
If the environment variable FORGEJO_VERSION is set and already contains $(GITEA_COMPATIBILITY), it must not be append again.

This particular use case occurs when a pull request is tested in https://code.forgejo.org/forgejo/end-to-end. It sets the version at

796a32d6c1/lib/build.sh (L39)

which is drawn from a file generated at

6c6035bc49/.forgejo/cascading-pr-end-to-end (L33)

The version is generated from a checkout of the PR which leads to
something like:

```
$ make show-version-full
12.0.0-dev-307-6c6035bc49+gitea-1.22.0
```

## Testing

```
git clone https://codeberg.org/forgejo/forgejo
cd forgejo
export FORGEJO_VERSION=$(make show-version-full)
test "$FORGEJO_VERSION" = "$(make show-version-full)" || echo FAIL!
```

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7933
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Antonin Delpeuch <wetneb@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-05-22 12:14:31 +02:00
Shiny Nematoda
6c6035bc49 feat(ui): allow admins to reindex issues per repo (#7896)
Added a new option to reindex only a select repository.

The option is present under `[REPO_LINK]/settings` > Administrator Settings

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7896
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Lucas <sclu1034@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
2025-05-21 17:43:18 +02:00
Gusted
fa2a135f68 chore: QoL improvements to tests (#7917)
- Use mock helper functions, instead of home-brew solutions.
- Disable cron jobs that are not important to be run during integration tests and might even interfere.
- Avoid sleeping unnecessary, if there's some requirement then sleep or retry until that requirement is met.
- Avoid trying to deliver webhooks that will always result in a failure.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7917
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-21 15:45:56 +02:00
Renovate Bot
112ba66637 Update go-openapi packages (forgejo) (#7922)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7922
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-21 15:14:35 +02:00
Renovate Bot
5d47d2ed28 Update dependency go to v1.24.3 (forgejo) (#7807)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7807
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-21 15:10:06 +02:00
Renovate Bot
511718fb4f Lock file maintenance (forgejo) (#7908)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7908
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-21 13:46:57 +02:00
Renovate Bot
e2a4b47cd0 Update dependency webpack to v5.99.9 (forgejo) (#7919)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7919
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-21 09:56:53 +02:00
Renovate Bot
b416bbea54 Update dependency sharp to v0.34.2 (forgejo) (#7918)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7918
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-21 09:54:54 +02:00
Granular9241
7fb99379f6 fix: include activity needed for entire heatmap (#7893)
Problem: Only data from the past 365 days (31536000s) is loaded.
However, on the activity heatmap, there are 53 cols, each is 7 rows, so squares for at most 371 days (32054400s) are on the heatmap.
This results in a few blank squares on the very left side, despite activity.

Solution: Simply changing 31536000s (365d) to 32054400s (371d) to load all the needed activity.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7893
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Granular9241 <granular9241@noreply.codeberg.org>
Co-committed-by: Granular9241 <granular9241@noreply.codeberg.org>
2025-05-21 05:25:39 +02:00
Renovate Bot
f3294f0b2d Update dependency clippie to v4.1.7 (forgejo) (#7910)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7910
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-20 23:22:36 +02:00
Ryan Lerch
a0f902f635 fix(ui): make limits clearer in create repo form (#7402)
Resolves: #7341

Previously, the Create Repository button was only enabled if a user was able to create a repo in their own namespace. However, if they had reached the global repo limit, but were stlll able to create a repo in an org, the button would still be disabled.

In this pull request, the create repo form now:

1. Behaves like it always did previously if the user has not reached the repo limit.

2. If the User has reached the repo limit, and they are unable to create a repo in any of their orgs (or they have no orgs), the create repo form is displayed as:
![Screenshot](/attachments/9f22f43d-0036-4c48-b794-54302c0f241c)

3. If the User has reached the repo limit, and the **limit is greater than zero**, an alert appears at the top of the form, and they are only allowed to choose from the orgs that they are allowed to create repos in:
![Screenshot](/attachments/f5508e05-74fd-4858-9e95-967bd7017abd)

4. If the User has reached the repo limit, and the **limit is equal to zero**, no alert is displayed, as no user can create repos on that instance, and they are only allowed to choose from the orgs that they are allowed to create repos in:
![localhost_3000_repo_create (4).png](/attachments/e7a87da8-c19c-47e1-845e-2afc3667ab02)

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7402
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Ryan Lerch <rlerch@redhat.com>
Co-committed-by: Ryan Lerch <rlerch@redhat.com>
2025-05-20 16:37:15 +02:00
Michael Kriese
43fee56011 chore(renovate): disable indirect major updates for stable branches (#7914)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7914
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-20 11:00:56 +02:00
Renovate Bot
c0187aa789 Migrate renovate config (#7877)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7877
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-20 10:47:08 +02:00
0ko
75258cfa2a chore(ui): cleanup unused color CSS (#7898)
Careful removal of unused classes and rules from editable CSS. One class was used once in the UI and could have been easily replaced, others were only used in a devtest page.

Removed completely:
* pink
* olive
* violet
* background

Removed partially:
* blue

Some of them are also present in generated Fomantic code, but it's not possible to remove them easily here.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7898
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-19 14:04:28 +02:00
Renovate Bot
b6dcae9b50 Update module github.com/alecthomas/chroma/v2 to v2.18.0 (forgejo) (#7890)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7890
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-18 18:48:40 +00:00
Renovate Bot
a775c855cb Update module github.com/yuin/goldmark to v1.7.12 (forgejo) (#7901)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7901
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-18 18:46:44 +00:00
Otto
e168c8448b fix(ui): fix force-push compare line layout (#7894)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7894
Reviewed-by: Otto <otto@codeberg.org>
2025-05-18 10:41:30 +00:00
floss4good
dc56486b1f feat!: Abusive content reporting (#6977)
This implements milestones 1. and 4. from **Task F. Moderation features: Reporting** (part of [amendment of the workplan](https://codeberg.org/forgejo/sustainability/src/branch/main/2022-12-01-nlnet/2025-02-07-extended-workplan.md#task-f-moderation-features-reporting) for NLnet 2022-12-035):

> 1. A reporting feature is implemented in the database. It ensures that content remains available for review, even if a user deletes it after a report was sent.

> 4. Users can report the most relevant content types (at least: issue comments, repositories, users)

### See also:
- forgejo/discussions#291
- forgejo/discussions#304
- forgejo/design#30

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6977
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: floss4good <floss4good@disroot.org>
Co-committed-by: floss4good <floss4good@disroot.org>
2025-05-18 08:05:16 +00:00
0ko
c1fad04473 (merge commit) i18n: update of translations from Codeberg Translate (#7819)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7819
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-17 11:16:01 +00:00
0ko
0b09ef8380 fix(ui): fix force-push compare line layout 2025-05-17 15:49:57 +05:00
Codeberg Translate
121623582a
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Coral Pink <coralpink@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <git@alius.cz>
Co-authored-by: Ricky-Tigg <ricky-tigg@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: guillerpsanchez <guillerpsanchez@noreply.codeberg.org>
Co-authored-by: hook <hook@noreply.codeberg.org>
Co-authored-by: milimarg <milimarg@noreply.codeberg.org>
Co-authored-by: pixelcode <pixelcode@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/sl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-05-17 10:37:51 +00:00
Gusted
c4c4b8867b fix: parse change-id in the git commit header (#7884)
- `change-id` is a commit header set by [jj-vcs](https://jj-vcs.github.io/jj/). Modify the commit parser to consider this header to be a valid header, this in turn fixes the signature validation on git commits that contain this header.
- Resolves forgejo/forgejo#7836
- Added unit test.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7884
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-16 21:14:41 +00:00
Renovate Bot
5e9e146545 Update module github.com/blevesearch/bleve/v2 to v2.5.1 (forgejo) (#7881)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7881
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-16 19:52:56 +00:00
Gusted
8deb184043 fix: quote reply in Chromium (#7883)
- Chromium would unselect the text if some text is written in another element, so temporarily store the range and restore after this writing has happened.
- Resolves forgejo/forgejo#7841
- No E2E test, there is already a test case that perfectly matches the reproduce steps of this bug, however Chromium does not produce consistent behavior on this case.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7883
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-16 18:43:32 +00:00
Gusted
7c150be23d feat: improved performances when checking for conflicts on pull requests (#7727)
- `testPatch` is a function that is called to test a pull request and determine the state of the pull request. Checking for merge conflicts, check if the diff is empty and if the pull request modifies any protected files.
- The checking for merge conflict and if the diff is empty used git commands that relied on a working tree to correctly functions. Forgejo store repositories in a bare format which do not contain a working tree. This means that a temporary copy was created every time a pull request had to be re-checked and for large repositories involving quite some I/O interaction.
- This patch adjusts those codepaths to instead use newer Git plumbing commands that work without requiring a work tree and can thus be used directly on the bare repository. The merge conflict is now done via [`git-merge-tree(1)`](https://git-scm.com/docs/git-merge-tree/) and checking if the diff is empty is done via [`git-diff-tree(1)`](https://git-scm.com/docs/git-diff-tree).
- If the function is called to test a patch where the head and base repository are not the same, then [Git alternate](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefalternateobjectdatabaseaalternateobjectdatabase) is used to make the head commit available in the base repository, this done on a per git command basis via the `GIT_ALTERNATE_OBJECT_DIRECTORIES` environment.
- As far as I can understand the documentation and the existing code, there's no edge case that the new code cannot handle. It also results in a cleaner codepath, as the existing code did a lot of checking and merging in a more traditional approach that required a lot of (parsing) code, while the new code offloads this to git and has a trivial parser of the output.
- Resolves forgejo/forgejo#7701
- Added exhaustive integration testing.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7727
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-16 12:40:38 +00:00
Renovate Bot
2ab5b585f6 Lock file maintenance (forgejo) (#7840)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7840
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-16 12:25:17 +00:00
Renovate Bot
9911450bd8 Update dependency vue to v3.5.14 (forgejo) (#7879)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-16 12:14:07 +00:00
Jolly_Good
1ec20030af fix(ui): disable autocapitalization/autocorrect for username inputs (#7872)
Closes #7842

Currently mobile devices add autocapitalization & autocorrect to input fields with type `text`. In login form it can either be username or email address.

There's currently no testing. This is only trivial change

Co-authored-by: Jolly Good <1671375+good-lly@users.noreply.github.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7872
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Jolly_Good <jolly_good@noreply.codeberg.org>
Co-committed-by: Jolly_Good <jolly_good@noreply.codeberg.org>
2025-05-15 18:35:37 +00:00
Renovate Bot
3a670596f5 Update renovate to v40 (forgejo) (major) (#7777)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7777
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-15 15:21:16 +00:00
John Moon
09f7dbecda fix: Remove "create branch" button on mirrored repos (#7640)
Currently, if you have a mirrored repo, the button on the "branches"
page to create a new branch is available to be pressed. Once you name
your new branch and click submit, you get a 404 page that doesn't explain
what went wrong.

As new branch creation is not supported on mirrored repos, let's just
take that button away if the repo is a mirror. This is already done for
archived repos, so we just need to add another check.

Fixes #7639.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7640
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: John Moon <john.moon@vts-i.com>
Co-committed-by: John Moon <john.moon@vts-i.com>
2025-05-14 23:26:12 +00:00
Lucas Dohmen
63543afa2b chore: remove unused linters (#7680)
Remove linters from the repository that are not used. This also removes the Python setup as it was only used for those linters.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7680
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Lucas Dohmen <lucas@dohmen.io>
Co-committed-by: Lucas Dohmen <lucas@dohmen.io>
2025-05-14 23:20:32 +00:00
0ko
0383e2e15a fix(ui): improve force-push compare line layout (#7746)
On large screens, use grid to force right position of the button.

On small screens, just left it hang out wherever it fits. It's not possible to not make it hide behind mergebox while keeping `float`, and with grid it would overflow too much.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7746
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-14 23:13:50 +00:00
0ko
2c9f272d42 chore: remove unused update-locales.sh (#7866)
According to the script, it helps Gitea fix Crowdin output to be consistent with what Unknwon's INI library expects.

I'm not aware of it being used in Forgejo. But want to see green CI checks just in case.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7866
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-14 23:05:32 +00:00
0ko
e3ba342665 fix(ui): disable spellcheck on TOTP form fields (#7868)
Ref https://codeberg.org/forgejo/forgejo/issues/7842#issuecomment-4574366

Currently browsers could offer spellcheck on these fields, my browser does.

MDN [recommends](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/spellcheck#security_and_privacy_concerns) that on fields with sensitive information this property is set to `false` in case 3rd party not-fully-trusted spellchecking service is used. I consider these fields as containing sensitive information, and spellcheck is not useful on them anyway.

### Testing

There's currently no integration testing for these TOTP forms. I do plan to add some in my other TOTP-related work.

I tested that this did change the behavior in my browser and don't think we need additional testing right now.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7868
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-14 23:04:43 +00:00
Maxim Slipenko
b22bea8b45 fix: remove redundant permission check in RemoveLabel (#7835)
Closes #2415
Permissions checks are already done by the callee, which also do more correct permission checks.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7835
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Maxim Slipenko <maks1ms@altlinux.org>
Co-committed-by: Maxim Slipenko <maks1ms@altlinux.org>
2025-05-14 16:20:43 +00:00
Renovate Bot
263d125849 Update module code.forgejo.org/forgejo/act to v1.26.0 (forgejo) (#7856)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7856
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-14 04:49:59 +00:00
Renovate Bot
9f69eee8f9 Update module github.com/msteinert/pam/v2 to v2.1.0 (forgejo) (#7857)
Closes forgejo/forgejo#7855

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7857
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-14 02:36:04 +00:00
Renovate Bot
4d1f216241 Update github.com/golang-jwt/jwt/v4 (indirect) to v4.5.2 [SECURITY] (forgejo) (#7849)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7849
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-14 02:08:17 +00:00
Renovate Bot
ee02ad2630 Update module github.com/go-webauthn/webauthn to v0.13.0 (forgejo) (#7830)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7830
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-14 01:56:07 +00:00
Renovate Bot
a55755f9c1 Update module github.com/niklasfasching/go-org to v1.8.0 (forgejo) (#7847)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7847
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-14 01:48:53 +00:00
pat-s
eb010e0fca fix: add missing loadbalancing policies for EngineGroup connections (#7799)
This is a follow-up PR to #7212 (unreleased) in which some load balancing policy options were missed.

- `WeightRoundRobin` follows the same logic as `WeightRandomPolicy` WRT to weight assignment.
- `LeastConn` has no options

related docs PR: https://codeberg.org/forgejo/docs/pulls/1109

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7799
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2025-05-14 01:17:57 +00:00
Michael Kriese
c56ab9f10c ci(renovate): only fail on error (#7848)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7848
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-13 16:15:57 +00:00
Renovate Bot
e57d0c248f Update renovate to v39.264.0 (forgejo) (#7776)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-13 09:46:55 +00:00
Beowulf
a50b467d9f test(ui-e2e): fix flaky repo wiki test (#7833)
The Webkit environment in CI for some reason has issues with the ratio, so decrease the ratio a bit for Webkit.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7833
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-05-10 17:11:24 +00:00
Daniel Kilimnik
a696ad132c fix: replace ß with ss in normalizeUserName (#7817)
When using an oauth provider for login, we can't always make sure that only supported characters are included in the name. Therefore there exist normalization rules for the username. In German some names contain the `ß` letter which usually gets replaces by `ss`. Therefore I added this to the `customCharsReplacement` list.
Without this fix, the user gets an undescriptive internal server error and the log states `CreateUser: name is invalid [<name>]: must be valid alpha or numeric or dash(-_) or dot characters`.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7817
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Daniel Kilimnik <daniel@neodyme.io>
Co-committed-by: Daniel Kilimnik <daniel@neodyme.io>
2025-05-08 16:59:41 +00:00
Gusted
0234d00ace [skip ci] chore: remove backport script (#7792)
- It doesn't work in Forgejo and we already have a backport action.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7792
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-08 11:31:34 +00:00
Leni Kadali
f4af3191ef fix: cancel a review (#7454)
- Fixes #7152
- If a review no longer has any pending comments, remove that review from the database.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7454
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Leni Kadali <lenikadali@noreply.codeberg.org>
Co-committed-by: Leni Kadali <lenikadali@noreply.codeberg.org>
2025-05-08 11:21:00 +00:00
0ko
4183fa9a03 Merge commit: i18n: update of translations from Codeberg Translate (#7742)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7742
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-08 10:54:54 +00:00
Codeberg Translate
e9ec11df4b
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Adolfo Jayme Barrientos <fito@noreply.codeberg.org>
Co-authored-by: Atul_Eterno <atul_eterno@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <fjuro@noreply.codeberg.org>
Co-authored-by: GiannosOB <giannosob@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Hiers <hiers@noreply.codeberg.org>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Kita Ikuyo <kitakita@disroot.org>
Co-authored-by: Miguel P.L <miguel_pl@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: Ricky-Tigg <ricky-tigg@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Xinayder <xinayder@noreply.codeberg.org>
Co-authored-by: ZilloweZ <zillowez@noreply.codeberg.org>
Co-authored-by: antaanimosity <antaanimosity@noreply.codeberg.org>
Co-authored-by: artnay <artnay@noreply.codeberg.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@noreply.codeberg.org>
Co-authored-by: mahlzahn <mahlzahn@posteo.de>
Co-authored-by: otf31 <otf31@noreply.codeberg.org>
Co-authored-by: ruikkaa <ruikkaa@noreply.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: thodorisl <thodorisl@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ar/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/el/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ar/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/el/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_BR/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-05-08 06:08:41 +00:00
Renovate Bot
b3e25cf536 Update dependency globals to v16.1.0 (forgejo) (#7814)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7814
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-08 05:23:27 +00:00
Renovate Bot
683305e5b9 Update module golang.org/x/oauth2 to v0.30.0 (forgejo) (#7809)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7809
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-07 18:41:48 +00:00
Renovate Bot
332705d841 Update module golang.org/x/net to v0.40.0 (forgejo) (#7798)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7798
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-07 17:38:15 +00:00
Renovate Bot
f6573b9f3b Update module golang.org/x/image to v0.27.0 (forgejo) (#7797)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7797
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-06 06:06:50 +00:00
Renovate Bot
0ce1f70820 Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.1.6 (forgejo) (#7789)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-05 15:32:00 +00:00
Gusted
03785a8169 [SKIP CI] chore: update CODEOWNERS (#7785)
- Remove crystal and caesar from the CODEOWNERS file. They have not reviewed in a long time.
- Add Beowulf to frontend.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7785
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-05 14:57:27 +00:00
Gusted
ed9693f236 fix(api): document is_system_webhook field (#7784)
- Document that `is_system_webhook` field is accepted for the `POST /admin/hooks` endpoint.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7784
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-05 13:58:55 +00:00
Gusted
2a568f3b82 fix: make hash pattern more strict (#7775)
- Ensure that the last path is `commit/`, `tree/` or `blob/`.
- Resolves forgejo/forgejo#7767
- Follow up forgejo/forgejo#6784
- Added unit test

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7775
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-05 05:29:55 +00:00
Renovate Bot
52f20da52a Lock file maintenance (forgejo) (#7778)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

🔧 This Pull Request updates lock files to use the latest dependency versions.

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjEuNCIsInVwZGF0ZWRJblZlciI6IjM5LjI2MS40IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7778
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-05 05:25:22 +00:00
Gusted
4a57f73072 fix: remove artificial delay for PR update (#7773)
- I was not able to find a reasoning in the pull request (https://github.com/go-gitea/gitea/pull/9784) for the existence of this `time.Sleep`. The best I could come up with during manual testing is that there's a brief moment where 'this pull request is missing fork information' is shown, this was caused by an incorrect condition.
- Added integration test.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7773
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-04 21:54:55 +00:00
Renovate Bot
8b03d3260d Update module github.com/42wim/httpsig to v1.2.3 (forgejo) (#7770)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7770
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-04 12:36:55 +00:00
Beowulf
bf02da9fd9 chore: Fix outdated usage of unittest.OverrideFixtures (#7772)
The function unittest.OverrideFixtures was changed with 7e489eed25.
The PR with the util_misc_test was older and merged after the change to
the unittest.OverrideFixtures function. So the test was still using the
old function, which leads to a conflict / error when running tests.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7772
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-05-03 15:24:56 +00:00
Benedikt Straub
cf03286b5b Replace the 'relative-time' element scripting with custom, translatable rewrite (#6154)
This is my take to fix #6078
Should also resolve #6111

As far as I can tell, Forgejo uses only a subset of the relative-time functionality, and as far as I can see, this subset can be implemented using browser built-in date conversion and arithmetic. So I wrote a JavaScript to format the relative-time element accordingly, and a Go binding to generate the translated elements.

This is my first time writing Go code, and my first time coding for a large-scale server application, so please tell me if I'm doing something wrong, or if the whole approach is not acceptable.

---

Screenshot: Localized times in Low German
![grafik](/attachments/6f787e17-e666-4b88-8599-af0b8357ffbe)
Screenshot: The same with Forgejo in English
![grafik](/attachments/af09c873-b9f3-423d-b12b-7e62093e2623)

---

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [x] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6154
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-committed-by: Benedikt Straub <benedikt-straub@web.de>
2025-05-03 14:11:01 +00:00
Beowulf
37d566bdb0 Show if commit is signed in activity feed and unify sha box (#6933)
Old activities are shown like before, new commits are displayed like commits in e.g. the commits list. _(Second commit)_

| New signed commits | Old (signed) commits |
|:--:|:--:|
| ![image](/attachments/cd81c761-eda6-44bf-8c43-ac3b7e6f16eb) | ![image](/attachments/243080f3-1b77-4ca7-bc03-bbf855c39c99) |

Additionally the sha box was moved in an own component to unify the usage. _(First commit)_

Closes #1824

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/6933): <!--number 6933 --><!--line 0 --><!--description U2hvdyBpZiBjb21taXQgaXMgdmVyaWZpZWQgaW4gYWN0aXZpdHkgZmVlZCBvZiBhbiB1c2VyIG9yIGFuIG9yZ2FuaXphdGlvbiBmb3IgbmV3IGFjdGl2aXR5-->Show if commit is verified in activity feed of an user or an organization for new activity<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6933
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-05-03 10:54:52 +00:00
Renovate Bot
82477cb55c Update github.com/42wim/sshsig digest to 5100632 (forgejo) (#7768)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/42wim/sshsig](https://github.com/42wim/sshsig) | require | digest | `841cf5b` -> `5100632` |

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjEuNCIsInVwZGF0ZWRJblZlciI6IjM5LjI2MS40IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7768
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-03 06:37:53 +00:00
Renovate Bot
8b90eddc56 Update dependency @github/relative-time-element to v4.4.6 (forgejo) (#7769)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7769
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-03 00:37:25 +00:00
Gusted
3ebd96ef73 [gitea] week 2025-16 cherry pick (gitea/main -> forgejo) (#7602)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7602
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-05-02 18:35:33 +00:00
Gabriel Bjørnager Jensen
f07456286e
fix(ui): Improve chronological sorting of user (#7596)
This PR changes `newest` and `oldest` sorting under *Explore/User* and *Explore/Organization* to refer to the `created_unix` column rather than `id`.

Fixes: #7595

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7596
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Gabriel Bjørnager Jensen <gabriel@achernar.io>
Co-committed-by: Gabriel Bjørnager Jensen <gabriel@achernar.io>
2025-05-02 20:33:57 +02:00
forgejo-release-manager
dbfc24001f chore(release-notes): Forgejo v7.0.15 (#7765)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7765
Co-authored-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
Co-committed-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
2025-05-02 15:13:14 +00:00
forgejo-release-manager
481c7aaf19 chore(release-notes): Forgejo v11.0.1 (#7764)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7764
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
Co-committed-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
2025-05-02 14:42:26 +00:00
0ko
5ac2c0a2ba fix(ui): multiple fixes of sync fork UI (#7740)
Followup to https://codeberg.org/forgejo/forgejo/pulls/2364
Replaces https://codeberg.org/forgejo/forgejo/pulls/7666

Fix multiple issues with the original implementation:
* `SyncFork` web handler used `{branch}` as a parameter, so it failed for branches with `/` in names
    * Originally I switched it to use `*` like other branch web handlers, but I found that it was easier to move it out from URL to POST request values
* Security: `SyncFork` web handler was using GET method, so just visiting the link was enough to execute the action
    * It was switched to POST done via form with CSRF, which also allowed to put branch name in it's values
* Security: in template, branch name was not escaped but rendered with `SafeHTML`, allowing for rendering fun characters like `&amp;` and for script execution. Also the link was not escaped correctly and would be leading to 404
    * To avoid having to change all translations, only the branch name+link part was changed and is now escaped with `HTMLFormat` before being passed to TrN

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7740
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-05-02 14:25:05 +00:00
Earl Warren
aec8f4c57a fix: document that /repos/{owner}/{repo}/pulls may contain nulls (#7762)
The null means a server side bug prevents the pull request from being
retrieved.

Closes https://codeberg.org/forgejo/forgejo/issues/6571

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7762
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-05-02 13:53:08 +00:00
Renovate Bot
b7b70dbaf2 Update dependency forgejo/release-notes-assistant to v1.2.5 (forgejo) (#7760)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [forgejo/release-notes-assistant](https://code.forgejo.org/forgejo/release-notes-assistant) | minor | `v1.1.1` -> `v1.2.5` |

---

### Release Notes

<details>
<summary>forgejo/release-notes-assistant (forgejo/release-notes-assistant)</summary>

### [`v1.2.5`](https://code.forgejo.org/forgejo/release-notes-assistant/releases/tag/v1.2.5)

[Compare Source](https://code.forgejo.org/forgejo/release-notes-assistant/compare/v1.2.4...v1.2.5)

<!--start release-notes-assistant-->

<!--URL:https://placeholder:ca61bc9776c376e293039231cd01158c2c2f0a4f@code.forgejo.org/forgejo/release-notes-assistant-->

-   bug fixes
    -   [PR](https://placeholder:ca61bc9776c376e293039231cd01158c2c2f0a4f@code.forgejo.org/forgejo/release-notes-assistant/pulls/60): <!--number 60 --><!--line 0 --><!--description Zml4OiBza2lwIGlmIHRoZSBsaXN0IG9mIFBScyBjb250YWlucyBhIG51bGwgZWxlbWVudA==-->fix: skip if the list of PRs contains a null element<!--description-->
-   other
    -   [PR](https://placeholder:ca61bc9776c376e293039231cd01158c2c2f0a4f@code.forgejo.org/forgejo/release-notes-assistant/pulls/55): <!--number 55 --><!--line 0 --><!--description VXBkYXRlIHJlbGVhc2UgYWN0aW9uIHRhZw==-->Update release action tag<!--description-->

<!--end release-notes-assistant-->

### [`v1.2.4`](https://code.forgejo.org/forgejo/release-notes-assistant/releases/tag/v1.2.4)

[Compare Source](https://code.forgejo.org/forgejo/release-notes-assistant/compare/v1.2.3...v1.2.4)

<!--start release-notes-assistant-->

<!--URL:https://placeholder:ca61bc9776c376e293039231cd01158c2c2f0a4f@code.forgejo.org/forgejo/release-notes-assistant-->

-   other
    -   [PR](https://placeholder:ca61bc9776c376e293039231cd01158c2c2f0a4f@code.forgejo.org/forgejo/release-notes-assistant/pulls/52): <!--number 52 --><!--line 0 --><!--description VXBkYXRlIGBzZXR1cC1mb3JnZWpvYCB0YWc=-->Update `setup-forgejo` tag<!--description-->
    -   [PR](https://placeholder:ca61bc9776c376e293039231cd01158c2c2f0a4f@code.forgejo.org/forgejo/release-notes-assistant/pulls/51): <!--number 51 --><!--line 0 --><!--description VXNlIFJOQSBmcm9tIGBmb3JnZWpvLXJlbGVhc2VgIGFjdGlvbg==-->Use RNA from `forgejo-release` action<!--description-->
    -   [PR](https://placeholder:ca61bc9776c376e293039231cd01158c2c2f0a4f@code.forgejo.org/forgejo/release-notes-assistant/pulls/47): <!--number 47 --><!--line 0 --><!--description QWRkIG5hbWUgdG8gQ0kgdGFza3M=-->Add name to CI tasks<!--description-->
    -   [PR](https://placeholder:ca61bc9776c376e293039231cd01158c2c2f0a4f@code.forgejo.org/forgejo/release-notes-assistant/pulls/45): <!--number 45 --><!--line 0 --><!--description VXNlIGBmb3JnZWpvLXJlbGVhc2VAdjJgIGFjdGlvbg==-->Use `forgejo-release@v2` action<!--description-->

<!--end release-notes-assistant-->

### [`v1.2.3`](https://code.forgejo.org/forgejo/release-notes-assistant/releases/tag/v1.2.3)

[Compare Source](https://code.forgejo.org/forgejo/release-notes-assistant/compare/v1.2.2...v1.2.3)

<!--start release-notes-assistant-->

<!--URL:https://code.forgejo.org/forgejo/release-notes-assistant-->

-   features
    -   [PR](https://code.forgejo.org/forgejo/release-notes-assistant/pulls/42): <!--number 42 --><!--line 0 --><!--description ZmVhdChjaSk6IHVzZSBSTkEgd2l0aCBSTkE=-->feat(ci): use RNA with RNA<!--description-->

<!--end release-notes-assistant-->

### [`v1.2.2`](https://code.forgejo.org/forgejo/release-notes-assistant/compare/v1.2.1...v1.2.2)

[Compare Source](https://code.forgejo.org/forgejo/release-notes-assistant/compare/v1.2.1...v1.2.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjEuNCIsInVwZGF0ZWRJblZlciI6IjM5LjI2MS40IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7760
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-02 08:53:48 +00:00
Michael Kriese
4096d0d2d6 chore(renovate): use gitea-releases datasource for rna (#7759)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7759
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-02 08:05:26 +00:00
Michael Kriese
e08f2ac7f1 chore(renovate): allow updating release notes assistant (#7758)
Extract release notes assistent version to a variable, so renovate can easily update it

fed044d3a3
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7758
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-02 07:44:09 +00:00
Earl Warren
beb985062d fix(sec): add tests for OAuth2 signup (#7755)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7755
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-05-02 06:25:56 +00:00
Earl Warren
c57ab693f9 fix(sec): only degrade permission check for git push (#7752)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7752
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-05-02 06:25:41 +00:00
Gusted
aa4ae81fe0
fix(sec): add tests for OAuth2 signup
Test two scenarios:
1. Account linking is set to `auto` and tries to link against a user who
is enrolled into Webauthn should show 2FA screen.
2. User is already linked and logins via OAuth2 and is enrolled into
WebAuthn should show 2FA screen.
2025-05-02 07:21:08 +02:00
Gusted
60c1af244a
fix(sec): only degrade permission check for git push
- A permission check is done when incoming SSH connections are handled (this is
run before git hooks). If this check is for write access and AGit flow
is supported, then this check is degraded to a read check. The
motivation behind this is that for AGit flow the user does not need
write permissions but only read permissions.
- The `if` condition cannot check if this is for AGit flow, as the Git
protocol has not run yet and thus has to delay this permission check.
This `if` condition failed to consider that this also might be run for
LFS which does not care about AGit flow and would not do a delayed
permission check, so ensure that this degradition only happens when the
`git-receive-pack` command is being run (which roughly equals to `git
push`).
- Clarify code comment.
- Added integration test.
2025-05-02 06:56:30 +02:00
Gusted
4a1487c193 feat: remove the legacy TEST_CONFLICTING_PATCHES_WITH_GIT_APPLY setting (#7745)
- The way of doing conflict testing via `git apply` stems from Gogs, it was replaced in Gitea 1.18 by `git read-tree -m` which uses 3-way merge [^0]. The option to disable the fallback `git apply` was introduced in Gitea 1.19 and enabled by default [^1].
- Given it was mostly kept just in case `git read-tree -m` was shown to be unreliable and it has been sufficiently battle tested with no known issues (in Forgejo), it's time to remove this way of conflict testing. I am not aware of anyone using this option or having any benefits over a 3-way merge via `git read-tree -m`.

[^0]: https://github.com/go-gitea/gitea/pull/18004
[^1]: https://github.com/go-gitea/gitea/pull/22130

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Breaking features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7745): <!--number 7745 --><!--line 0 --><!--description cmVtb3ZlIHRoZSBsZWdhY3kgYFRFU1RfQ09ORkxJQ1RJTkdfUEFUQ0hFU19XSVRIX0dJVF9BUFBMWWAgc2V0dGluZw==-->remove the legacy `TEST_CONFLICTING_PATCHES_WITH_GIT_APPLY` setting<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7745
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-01 16:35:23 +00:00
Renovate Bot
fbc32463fc Update dependency eslint-plugin-unicorn to v59 (forgejo) (#7744)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-01 12:54:35 +00:00
Panagiotis "Ivory" Vasilopoulos
b51ce74552 chore(ci): add clarification regarding test label (#7732)
Contributors use CI pipeline runs as a frame of reference to figure out
whether their work adhere's to Forgejo's quality assurance standards.
If a test label is missing and the CI does not run, the 'error message'
shown can cause confusion, as it might give the contributor the idea
that some action is expected from their part.

This change explicitly mentions that a reviewer must set the test
label.

Fixes forgejo/forgejo#7686.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7732
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-committed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
2025-05-01 11:52:22 +00:00
Renovate Bot
55f4ee214d Update module github.com/alecthomas/chroma/v2 to v2.17.2 (forgejo) (#7738)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7738
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-01 10:41:26 +00:00
Earl Warren
2846aebc6a i18n: update of translations from Codeberg Translate (#7637)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7637
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-05-01 10:23:41 +00:00
Codeberg Translate
4a51a1f360
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <fjuro@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Miguel P.L <miguel_pl@noreply.codeberg.org>
Co-authored-by: Panagiotis \"Ivory\" Vasilopoulos <git@n0toose.net>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Yushu <yushu@noreply.codeberg.org>
Co-authored-by: aleksi <aleksi@noreply.codeberg.org>
Co-authored-by: artnay <artnay@noreply.codeberg.org>
Co-authored-by: docudoc <docudoc@noreply.codeberg.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: hugoalh <hugoalh@noreply.codeberg.org>
Co-authored-by: mimsee <mimsee@noreply.codeberg.org>
Co-authored-by: pixelcode <pixelcode@noreply.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: xtex <xtexchooser@duck.com>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hant/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/el/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/sv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hant/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-05-01 09:50:01 +00:00
Renovate Bot
8bbac4c679 Update module github.com/redis/go-redis/v9 to v9.8.0 (forgejo) (#7739)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) | require | minor | `v9.7.3` -> `v9.8.0` |

---

### Release Notes

<details>
<summary>redis/go-redis (github.com/redis/go-redis/v9)</summary>

### [`v9.8.0`](https://github.com/redis/go-redis/releases/tag/v9.8.0)

[Compare Source](https://github.com/redis/go-redis/compare/v9.7.3...v9.8.0)

### 9.8.0 (2025-04-30)

#### 🚀 Highlights

-   **Redis 8 Support**: Full compatibility with Redis 8.0, including testing and CI integration
-   **Enhanced Hash Operations**: Added support for new hash commands (`HGETDEL`, `HGETEX`, `HSETEX`) and `HSTRLEN` command
-   **Search Improvements**: Enabled Search DIALECT 2 by default and added `CountOnly` argument for `FT.Search`

####  New Features

-   Added support for new hash commands: `HGETDEL`, `HGETEX`, `HSETEX` ([#&#8203;3305](https://github.com/redis/go-redis/pull/3305))
-   Added `HSTRLEN` command for hash operations ([#&#8203;2843](https://github.com/redis/go-redis/pull/2843))
-   Added `Do` method for raw query by single connection from `pool.Conn()` ([#&#8203;3182](https://github.com/redis/go-redis/pull/3182))
-   Prevent false-positive marshaling by treating zero time.Time as empty in isEmptyValue ([#&#8203;3273](https://github.com/redis/go-redis/pull/3273))
-   Added FailoverClusterClient support for Universal client ([#&#8203;2794](https://github.com/redis/go-redis/pull/2794))
-   Added support for cluster mode with `IsClusterMode` config parameter ([#&#8203;3255](https://github.com/redis/go-redis/pull/3255))
-   Added client name support in `HELLO` RESP handshake ([#&#8203;3294](https://github.com/redis/go-redis/pull/3294))
-   **Enabled Search DIALECT 2 by default** ([#&#8203;3213](https://github.com/redis/go-redis/pull/3213))
-   Added read-only option for failover configurations ([#&#8203;3281](https://github.com/redis/go-redis/pull/3281))
-   Added `CountOnly` argument for `FT.Search` to use `LIMIT 0 0` ([#&#8203;3338](https://github.com/redis/go-redis/pull/3338))
-   Added `DB` option support in `NewFailoverClusterClient` ([#&#8203;3342](https://github.com/redis/go-redis/pull/3342))
-   Added `nil` check for the options when creating a client ([#&#8203;3363](https://github.com/redis/go-redis/pull/3363))

#### 🐛 Bug Fixes

-   Fixed `PubSub` concurrency safety issues ([#&#8203;3360](https://github.com/redis/go-redis/pull/3360))
-   Fixed panic caused when argument is `nil` ([#&#8203;3353](https://github.com/redis/go-redis/pull/3353))
-   Improved error handling when fetching master node from sentinels ([#&#8203;3349](https://github.com/redis/go-redis/pull/3349))
-   Fixed connection pool timeout issues and increased retries ([#&#8203;3298](https://github.com/redis/go-redis/pull/3298))
-   Fixed context cancellation error leading to connection spikes on Primary instances ([#&#8203;3190](https://github.com/redis/go-redis/pull/3190))
-   Fixed RedisCluster client to consider `MASTERDOWN` a retriable error ([#&#8203;3164](https://github.com/redis/go-redis/pull/3164))
-   Fixed tracing to show complete commands instead of truncated versions ([#&#8203;3290](https://github.com/redis/go-redis/pull/3290))
-   Fixed OpenTelemetry instrumentation to prevent multiple span reporting ([#&#8203;3168](https://github.com/redis/go-redis/pull/3168))
-   Fixed `FT.Search` Limit argument and added `CountOnly` argument for limit 0 0 ([#&#8203;3338](https://github.com/redis/go-redis/pull/3338))
-   Fixed missing command in interface ([#&#8203;3344](https://github.com/redis/go-redis/pull/3344))
-   Fixed slot calculation for `COUNTKEYSINSLOT` command ([#&#8203;3327](https://github.com/redis/go-redis/pull/3327))
-   Updated PubSub implementation with correct context ([#&#8203;3329](https://github.com/redis/go-redis/pull/3329))

#### 📚 Documentation

-   Added hash search examples ([#&#8203;3357](https://github.com/redis/go-redis/pull/3357))
-   Fixed documentation comments ([#&#8203;3351](https://github.com/redis/go-redis/pull/3351))
-   Added `CountOnly` search example ([#&#8203;3345](https://github.com/redis/go-redis/pull/3345))
-   Added examples for list commands: `LLEN`, `LPOP`, `LPUSH`, `LRANGE`, `RPOP`, `RPUSH` ([#&#8203;3234](https://github.com/redis/go-redis/pull/3234))
-   Added `SADD` and `SMEMBERS` command examples ([#&#8203;3242](https://github.com/redis/go-redis/pull/3242))
-   Updated `README.md` to use Redis Discord guild ([#&#8203;3331](https://github.com/redis/go-redis/pull/3331))
-   Updated `HExpire` command documentation ([#&#8203;3355](https://github.com/redis/go-redis/pull/3355))
-   Featured OpenTelemetry instrumentation more prominently ([#&#8203;3316](https://github.com/redis/go-redis/pull/3316))
-   Updated `README.md` with additional information ([#&#8203;310ce55](310ce55))

####  Performance and Reliability

-   Bound connection pool background dials to configured dial timeout ([#&#8203;3089](https://github.com/redis/go-redis/pull/3089))
-   Ensured context isn't exhausted via concurrent query ([#&#8203;3334](https://github.com/redis/go-redis/pull/3334))

#### 🔧 Dependencies and Infrastructure

-   Updated testing image to Redis 8.0-RC2 ([#&#8203;3361](https://github.com/redis/go-redis/pull/3361))
-   Enabled CI for Redis CE 8.0 ([#&#8203;3274](https://github.com/redis/go-redis/pull/3274))
-   Updated various dependencies:
    -   Bumped golangci/golangci-lint-action from 6.5.0 to 7.0.0 ([#&#8203;3354](https://github.com/redis/go-redis/pull/3354))
    -   Bumped rojopolis/spellcheck-github-actions ([#&#8203;3336](https://github.com/redis/go-redis/pull/3336))
    -   Bumped golang.org/x/net in example/otel ([#&#8203;3308](https://github.com/redis/go-redis/pull/3308))
-   Migrated golangci-lint configuration to v2 format ([#&#8203;3354](https://github.com/redis/go-redis/pull/3354))

#### ⚠️ Breaking Changes

-   **Enabled Search DIALECT 2 by default** ([#&#8203;3213](https://github.com/redis/go-redis/pull/3213))
-   Dropped RedisGears (Triggers and Functions) support ([#&#8203;3321](https://github.com/redis/go-redis/pull/3321))
-   Dropped FT.PROFILE command that was never enabled ([#&#8203;3323](https://github.com/redis/go-redis/pull/3323))

#### 🔒 Security

-   Fixed network error handling on SETINFO (CVE-2025-29923) ([#&#8203;3295](https://github.com/redis/go-redis/pull/3295))

#### 🧪 Testing

-   Added integration tests for Redis 8 behavior changes in Redis Search ([#&#8203;3337](https://github.com/redis/go-redis/pull/3337))
-   Added vector types INT8 and UINT8 tests ([#&#8203;3299](https://github.com/redis/go-redis/pull/3299))
-   Added test codes for search_commands.go ([#&#8203;3285](https://github.com/redis/go-redis/pull/3285))
-   Fixed example test sorting ([#&#8203;3292](https://github.com/redis/go-redis/pull/3292))

#### 👥 Contributors

We would like to thank all the contributors who made this release possible:

[@&#8203;alexander-menshchikov](https://github.com/alexander-menshchikov), [@&#8203;EXPEbdodla](https://github.com/EXPEbdodla), [@&#8203;afti](https://github.com/afti), [@&#8203;dmaier-redislabs](https://github.com/dmaier-redislabs), [@&#8203;four_leaf_clover](https://github.com/four_leaf_clover), [@&#8203;alohaglenn](https://github.com/alohaglenn), [@&#8203;gh73962](https://github.com/gh73962), [@&#8203;justinmir](https://github.com/justinmir), [@&#8203;LINKIWI](https://github.com/LINKIWI), [@&#8203;liushuangbill](https://github.com/liushuangbill), [@&#8203;golang88](https://github.com/golang88), [@&#8203;gnpaone](https://github.com/gnpaone), [@&#8203;ndyakov](https://github.com/ndyakov), [@&#8203;nikolaydubina](https://github.com/nikolaydubina), [@&#8203;oleglacto](https://github.com/oleglacto), [@&#8203;andy-stark-redis](https://github.com/andy-stark-redis), [@&#8203;rodneyosodo](https://github.com/rodneyosodo), [@&#8203;dependabot](https://github.com/dependabot), [@&#8203;rfyiamcool](https://github.com/rfyiamcool), [@&#8203;frankxjkuang](https://github.com/frankxjkuang), [@&#8203;fukua95](https://github.com/fukua95), [@&#8203;soleymani-milad](https://github.com/soleymani-milad), [@&#8203;ofekshenawa](https://github.com/ofekshenawa), [@&#8203;khasanovbi](https://github.com/khasanovbi)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjEuNCIsInVwZGF0ZWRJblZlciI6IjM5LjI2MS40IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7739
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-01 08:45:55 +00:00
Renovate Bot
7ed278dec9 Update linters (forgejo) (#7736)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-01 08:41:20 +00:00
Renovate Bot
e1d8afdf32 Update dependency happy-dom to v17.4.6 (forgejo) (#7735)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-05-01 08:40:11 +00:00
Gusted
d7baf25a6b chore: fix test to avoid data race (#7731)
- The global Git version can be accessed by background services such as the PR checker, to minimize data race because of `MockVariableValue` resetting it. Run the mocked Git version as first test.
- Followup of forgejo/forgejo#7527

CI that is failing: https://codeberg.org/forgejo/forgejo/actions/runs/73021/jobs/10

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7731
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-30 14:59:33 +00:00
Gusted
c5d274a384 [gitea] week 2025-17 cherry pick (gitea/main -> forgejo) (#7713)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7713
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-30 14:50:18 +00:00
Lucas Schwiderski
9cc0d4b3d1 Show warning in locked issue discussion (#7726)
Closes: #7334

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7726
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Lucas Schwiderski <lucas@lschwiderski.de>
Co-committed-by: Lucas Schwiderski <lucas@lschwiderski.de>
2025-04-30 14:03:37 +00:00
Remo Senekowitsch
ec076e66d8 feat: use git-replay for rebasing (#7527)
Closes #7525

This is better for performance, because it can do more work in-memory. It also preserves unknown headers, which can be important for some clients. For example, Jujutsu uses a non-standard "change-id" header to track commits across rebase and amend, but regular git-rebase drops such unknown headers.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7527
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Remo Senekowitsch <remo@buenzli.dev>
Co-committed-by: Remo Senekowitsch <remo@buenzli.dev>
2025-04-29 20:51:56 +00:00
Gusted
32e64ccd34 chore: replace github.com/go-testfixtures/testfixtures (#7715)
- Replaces `github.com/go-testfixtures/testfixtures` with a homebrew solution that is fully compatible.
- The reason to replace this library is that it pulls in a lot of other libraries which is causing issues: (1) the test binary becomes bigger than necessary which really shows in incremental build times (this patch removes 27.6MiB of the integration test binary) (2) it pulls in libraries (mainly database drivers) that are not used and are not easy to upgrade in case of a security vulnerability, causing CI failures.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7715
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-29 19:28:56 +00:00
Earl Warren
a16350d9f4 chore(release): next-digest moved to invisible.forgejo.org (#7720)
In order to improve the security of the Forgejo infrastructure the next-digest repository was moved to a private instance.

## Testing

- After the merge, trigger a mirror to build a new v12.0-test release
- Verify in experimental that the workflows works as expected
- Verify v12.next.forgejo.org is upgraded with the latest commit
- Once the test completes
    - Tag for backport to v11 & v7
    - Manual backport to v7 because it conflicts

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7720
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-29 15:53:08 +00:00
Squel
8c81dca8b9 feat: allow access to /api/v1/packages/{username} without token (#7716)
- Only require tokens on package endpoints that modify packages, this being deletion of a package and (un)link of a package.
- Allows reading data via the API of otherwise public data
- Integration test added.

Some references to related past commits:
- de484e86bc Started requiring tokens for reading packages "mimicking the design of GitHub OAuth scopes".
- 18de83b2a3 Adjusted the scope further, but kept the GitHub design.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7716
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Squel <squeljur+git@gmail.com>
Co-committed-by: Squel <squeljur+git@gmail.com>
2025-04-29 14:37:19 +00:00
Kenneth Bruen
f6599099ee feat: add label for avatar settings (#7678)
By redirecting the user to the settings when clicking on the avatar, it is not immediately obvious that the user has to scroll down the page to change their avatar. By adding an id to reference in the fragment, we fix this.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7678
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Kenneth Bruen <kenny@kbruen.ro>
Co-committed-by: Kenneth Bruen <kenny@kbruen.ro>
2025-04-29 13:31:07 +00:00
Gusted
df5d656827 feat: consider WebAuthn & SSH for instance signing (#7693)
- Currently the options `pubkey` and `twofa` only consider TOTP and GPG keys respectively. Adjust the code to also consider WebAuthn credentials and SSH keys.
- While adding the new unified functions I noticed that certain places also benefited from using these unified functions and took the liberty (where it was either a trivial translation or it was covered under testing) to use the new unified functions.
- Resolves forgejo/forgejo#7658
- Adds unit and integration tests.

Documentation PR: https://codeberg.org/forgejo/docs/pulls/1166

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7693
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-29 10:34:07 +00:00
Lunny Xiao
d07a9a1b56 Update token creation API swagger documentation (#34288)
Fix #34231

(cherry picked from commit 0376c09fc27d848dbac471b629c83fd7a231852b)
2025-04-29 10:12:45 +02:00
christopher-besch
386e7f8208 send mail on failed or recovered workflow run (#7509)
Send a Mail when an action run fails or a workflow recovers.

This PR depends on https://codeberg.org/forgejo/forgejo/pulls/7491

closes #3719

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7509): <!--number 7509 --><!--line 0 --><!--description c2VuZCBtYWlsIG9uIGZhaWxlZCBvciByZWNvdmVyZWQgd29ya2Zsb3cgcnVu-->send mail on failed or recovered workflow run<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7509
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: christopher-besch <mail@chris-besch.com>
Co-committed-by: christopher-besch <mail@chris-besch.com>
2025-04-29 06:58:05 +00:00
Earl Warren
bc99bf5e8f fix: do not set GOPROXY=direct in Dockerfile* (#7707)
The default should be https://proxy.golang.org,direct otherwise someone trying to build the container image from sources will run into throttling limits imposed by code.forgejo.org (making more tha 10 request per second).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7707
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Lucas <sclu1034@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-28 17:35:25 +00:00
0ko
b25091f757 chore(ui): remove unused fomantic font size classes (#7705)
One can grep `massive` and `huge` on the current codebase and not find any evidence of these classes being used anywhere in the UI, probably because there's a good reason for this. So these rules are a dead weight.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7705
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-28 16:43:22 +00:00
Michael Jerger
bc8c3cc009 fix linting 2025-04-28 16:41:33 +02:00
Renovate Bot
eb188cf83f Lock file maintenance (forgejo) (#7696)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

🔧 This Pull Request updates lock files to use the latest dependency versions.

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNTIuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI1Mi4wIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7696
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-28 07:17:50 +00:00
Renovate Bot
61b9535039 Update renovate to v39.261.4 (forgejo) (#7695)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-28 06:57:08 +00:00
Ellen Emilia Anna Zscheile
a0cc05ba92 fix various typos (#7690)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7690
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: floss4good <floss4good@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
2025-04-28 06:46:29 +00:00
Renovate Bot
9e70ff57b4 Update module github.com/yuin/goldmark to v1.7.11 (forgejo) (#7689)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/yuin/goldmark](https://github.com/yuin/goldmark) | require | patch | `v1.7.8` -> `v1.7.11` |

---

### Release Notes

<details>
<summary>yuin/goldmark (github.com/yuin/goldmark)</summary>

### [`v1.7.11`](https://github.com/yuin/goldmark/releases/tag/v1.7.11): release

[Compare Source](https://github.com/yuin/goldmark/compare/v1.7.10...v1.7.11)

### [`v1.7.10`](https://github.com/yuin/goldmark/releases/tag/v1.7.10): release

[Compare Source](https://github.com/yuin/goldmark/compare/v1.7.9...v1.7.10)

### [`v1.7.9`](https://github.com/yuin/goldmark/releases/tag/v1.7.9): release

[Compare Source](https://github.com/yuin/goldmark/compare/v1.7.8...v1.7.9)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNTIuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI1Mi4wIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7689
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-28 06:43:38 +00:00
christopher-besch
95ad7d6201 better comments and variable names for ActionRunNowDone (#7697)
Document a bit more clearly what the difference between the parameters to `sendActionRunNowDoneNotificationIfNeeded` and `ActionRunNowDone` are: `priorState`, `run`, `lastRun`, `updatedRun`.
The new variable names should be more explicit and consistent.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7697
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: christopher-besch <mail@chris-besch.com>
Co-committed-by: christopher-besch <mail@chris-besch.com>
2025-04-28 06:37:08 +00:00
Gusted
31cd8c6d38 fix: use linguist-generated for language stats (#7685)
- Adds code comment to explain behavior of the `linguist-generated` gitattribute.
- Adjusts the code to ignore the file if `linguist-generated` is true.
- Resolves forgejo/forgejo#7677
- Adds unit testing.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7685
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-27 23:29:21 +00:00
Earl Warren
055fc6e0c3 chore: tune down remote user promotion debug message shown as error (#7687)
It is not an error for a remote user to not be promoted: this is the case for all users created via OAuth. Displaying an error is confusing to the admin when seen in the logs.

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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7687
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-27 20:50:48 +00:00
Gusted
2ce7affc9a fix: set default restricted for OAuth2 user (#7683)
- The OAuthCallback code that is responsible for creating a new user, if one does not exist yet, did not use `[service].ALLOW_ONLY_EXTERNAL_REGISTRATION` as default value for the restricted field of a user.
- Resolves forgejo/forgejo#7681
- Add integration test.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7683
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-27 19:51:09 +00:00
Gusted
00761a15d1 chore: simplify GetDiff (#7682)
- Split `GetDiff` into two functions, `GetDiffSimple` and `GetDiffFull`. The former will do the bare minimum and really only get a Git diff while the latter does some extra stuff that's relevant for the frontend to show extra relevant.
- Use `GetDiffSimple` for API related calls, as they do not benefit nor are returning the extra information that `GetDiffFull` provides, this should show a measurable performance increase for API calls that returns commits and `/repos/{owner}/{repo}/pulls/{index}/files`.
- `GetDiffSimple` contains extra code comments about its interesting way to determine the before commit.
- Add unit tests to demonstrates that the logic for determining the before commit didn't change and the function still yields correct information.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7682
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-27 19:49:59 +00:00
Lucas Schwiderski
afcb7262ea Use available screen width for Actions logs (#7128)
Closes #7119.

![image](/attachments/a34e95c5-0301-465f-a616-9889dbf1f42d)

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7128
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Lucas Schwiderski <lucas@lschwiderski.de>
Co-committed-by: Lucas Schwiderski <lucas@lschwiderski.de>
2025-04-27 12:13:13 +00:00
Matt Latusek
9289e293fd feat: Makefile & BSDmakefile changes (#7455)
This set of commits fixes multiple issues with both make scripts. It started with #7358 and digging into it I found more problems.

@Gusted [commented](https://codeberg.org/forgejo/forgejo/issues/7358#issuecomment-3145145):
>  I do think the place where verify-version gets called should likely be backend instead and the error should likely include extra details on how to fix the error, but that can be discussed in the PR.

I think it should be closest to where `$(FORGEJO_VERSION)` is used and that's part of `$(LDFLAGS)`, so I added it where the latter is used.

When it comes to wording feel free to make suggestions.

**I haven't tested docker builds.**

I believe the most optimal way to do it is to create POSIX-compliant shell script where all those conditionals and variable expansion may be placed, and then that script should generate POSIX-compliant Makefile.

# Testing

## BSDMakefile

Should be launched from a BSD OS. You need to add `-f BSDMakefile` on OpenBSD.

* `make show-version-major show-version-minor`
Should display two lines with version numbers.
* `make TAGS=bindata`
Should launch the building process once.

## Makefile

* `make TAGS=bindata`
Should do the same as `make build`.
* `make `*target*
Should build given target like it used to.
* Copy everything except *.git* and *VERSION* to a separate directory.
`make TAGS=bindata`
Should fail with error “Could not determine FORGEJO_VERSION...”
* Copy everything except *.git* and *VERSION* to a separate directory.
`make clean`
Should execute correctly.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7455
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Matt Latusek <matlib@matlibhax.com>
Co-committed-by: Matt Latusek <matlib@matlibhax.com>
2025-04-27 10:04:32 +00:00
aec
224cb07907 i18n(en): fix typo in archive notice (#7667)
Fixed minor typo in the archive notice.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7667
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: aec <aec@noreply.codeberg.org>
Co-committed-by: aec <aec@noreply.codeberg.org>
2025-04-26 15:39:25 +00:00
Renovate Bot
cbcb04cf53 Update dependency @stoplight/spectral-cli to v6.15.0 (forgejo) (#7664)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-26 08:40:28 +00:00
Renovate Bot
b8d7303828 Update module github.com/PuerkitoBio/goquery to v1.10.3 (forgejo) (#7662)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-26 08:40:26 +00:00
Renovate Bot
025689312b Update linters (forgejo) (#7665)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-26 06:46:48 +00:00
Renovate Bot
7284cb5685 Update dependency @playwright/test to v1.52.0 (forgejo) (#7663)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-26 06:42:58 +00:00
Renovate Bot
f48c6d3c04 Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.1.5 (forgejo) (#7661)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-26 06:34:41 +00:00
Renovate Bot
c5a0825587 Update dependency webpack to v5.99.7 (forgejo) (#7659)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7659
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-26 00:35:58 +00:00
Earl Warren
a0115cf10f fix: display the list of tasks in the runner edit page (#7650)
A regression was introduced in Forgejo v11.0 that caused the edit page of a runner (e.g. https://example.org/admin/actions/runners/434) to no longer display the tasks associated with the runner.

Fixes https://codeberg.org/forgejo/forgejo/issues/7643

---

When the fix is absent, the tests fail like so:

```
--- FAIL: TestRunnerDetails (0.03s)
    --- FAIL: TestRunnerDetails/first_page (0.00s)
        runners_test.go:36:
            	Error Trace:	/home/earl-warren/software/forgejo/routers/web/shared/actions/runners_test.go:36
            	Error:      	"[]" should have 30 item(s), but has 0
            	Test:       	TestRunnerDetails/first_page
    --- FAIL: TestRunnerDetails/second_and_last_page (0.00s)
        runners_test.go:43:
            	Error Trace:	/home/earl-warren/software/forgejo/routers/web/shared/actions/runners_test.go:43
            	Error:      	"[]" should have 10 item(s), but has 0
            	Test:       	TestRunnerDetails/second_and_last_page
FAIL
FAIL	forgejo.org/routers/web/shared/actions	0.170s
```

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7650): <!--number 7650 --><!--line 0 --><!--description ZGlzcGxheSB0aGUgbGlzdCBvZiB0YXNrcyBpbiB0aGUgcnVubmVyIGVkaXQgcGFnZQ==-->display the list of tasks in the runner edit page<!--description-->
<!--end release-notes-assistant-->

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7650): <!--number 7650 --><!--line 0 --><!--description ZGlzcGxheSB0aGUgbGlzdCBvZiB0YXNrcyBpbiB0aGUgcnVubmVyIGVkaXQgcGFnZQ==-->display the list of tasks in the runner edit page<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7650
Reviewed-by: cobak78 <cobak78@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-25 11:59:54 +00:00
Earl Warren
7e489eed25 chore: merge tests.AddFixtures and unittest.OverrideFixtures (#7648)
The only parameter that is ever used is a single directory, make it that only instead of a more complex option structure.

Remove tests.AddFixtures that was the simpler form because it is now redundant.

---

Backporting to v11.0 will help with automated backporting of bug fixes in need of custom made fixtures.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7648
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-25 09:14:33 +00:00
Otto
580b7e2671 fix(ui): make pagination labels always visible to screenreader (#7616)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7616
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Otto <otto@codeberg.org>
2025-04-24 22:37:10 +00:00
christopher-besch
05273fa8d2 Actions Done Notification (#7491)
This PR depends on https://codeberg.org/forgejo/forgejo/pulls/7510

This PR renames UpdateRunJob to UpdateRunJobWithoutNotification and UpdateRun to  UpdateRunWithoutNotification and implements wrapper functions that also call the new ActionRunNowDone notification when needed.

This PR can be reviewed commit-by-commit.

# Things to Test
- [x] GetRunBefore
- [ ] integration test for sendActionRunNowDoneNotificationIfNeeded, UpdateRun and UpdateRunJob

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Co-authored-by: nobody <nobody@example.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7491
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: christopher-besch <mail@chris-besch.com>
Co-committed-by: christopher-besch <mail@chris-besch.com>
2025-04-24 15:15:24 +00:00
Earl Warren
0f6176470f i18n: update of translations from Codeberg Translate (#7572)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7572
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-04-24 07:39:51 +00:00
Codeberg Translate
8958dee86e
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <fjuro@noreply.codeberg.org>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Kita Ikuyo <kitakita@disroot.org>
Co-authored-by: Miguel P.L <miguel_pl@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: alperen <alperen@noreply.codeberg.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@noreply.codeberg.org>
Co-authored-by: mengzhuo <mengzhuo@noreply.codeberg.org>
Co-authored-by: neighborsbear <neighborsbear@noreply.codeberg.org>
Co-authored-by: otf31 <otf31@noreply.codeberg.org>
Co-authored-by: pboguslawski <pboguslawski@noreply.codeberg.org>
Co-authored-by: whytf <whytf@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: yurtpage <yurtpage@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ko/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/sk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ko/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/sk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/tr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hant/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-04-24 06:35:00 +00:00
Gusted
b6072496d4
fix(ui): make pagination labels always visible to screenreader
- The pagination labels 'First', 'Previous', 'Next' and 'Last' are
hidden away when the screen width becomes smaller. However this also
hides them from the screen reader. Instead of using `display: none`, use
some well-known tricks to still make them visible to the screen reader.
- Add E2E test.
- Resolves Codeberg/Community#1858
2025-04-23 23:58:03 +02:00
Renovate Bot
02c5ce77db Lock file maintenance (forgejo) (#7588)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7588
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-23 21:02:05 +00:00
Renovate Bot
7c6d5aaa56 Update dependency @vitest/eslint-plugin to v1.1.43 (forgejo) (#7610)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-23 16:59:52 +00:00
0ko
8e49c07187 feat(ui): make fork related banners more consistent (#7577)
Followup to https://codeberg.org/forgejo/forgejo/pulls/2364

Minor changes to templates.

Preview:
https://codeberg.org/attachments/993ca087-d163-46c4-a1a3-f023ba0a5a4f
https://codeberg.org/attachments/bafb1655-7d64-488b-916a-0198101cea17

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7577
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-23 16:48:26 +00:00
Renovate Bot
f463f97f24 Update vitest monorepo to v3.1.2 (forgejo) (#7611)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-23 15:43:35 +00:00
Renovate Bot
2ca2a73311 Update linters (forgejo) (#7612)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-23 15:43:26 +00:00
Renovate Bot
06c38cd613 Update module mvdan.cc/gofumpt to v0.8.0 (forgejo) (#7613)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-23 15:41:47 +00:00
Renovate Bot
ed18a8fb46 Update module github.com/alecthomas/chroma/v2 to v2.17.0 (forgejo) (#7607)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7607
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-23 13:44:28 +00:00
Renovate Bot
58389fd357 Update module github.com/minio/minio-go/v7 to v7.0.91 (forgejo) (#7606)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) | require | patch | `v7.0.90` -> `v7.0.91` |

---

### Release Notes

<details>
<summary>minio/minio-go (github.com/minio/minio-go/v7)</summary>

### [`v7.0.91`](https://github.com/minio/minio-go/compare/v7.0.90...v7.0.91)

[Compare Source](https://github.com/minio/minio-go/compare/v7.0.90...v7.0.91)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNTIuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI1Mi4wIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7606
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-23 07:56:42 +00:00
0ko
bbb7f6ec6f feat(ui): enlarge metadata line gaps in issue list and refactor (#7580)
The metadata line can contain many things and can get very busy.

The main change this PR does is addition of `gap:0.5rem` to it's items, so they're better separated.

And there are some harmless refactors, too.

Preview:
https://codeberg.org/attachments/5854ee85-79b3-448a-aafd-4120f34e84e1 - before
https://codeberg.org/attachments/b546efe4-06b7-4cd5-84bf-0afb9e84b9d6 - after

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7580
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-22 14:58:32 +00:00
Eric Hawicz
dec91bd9ed Add "--fullname" arg to gitea admin user create (#34241)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 166ec1b4c3971b7e14c4b6456d29b38f93a4e915)
2025-04-22 10:30:20 +02:00
wxiaoguang
eb67c4c109 Fix some trivial problems (#34237)
1. Using existing "content" variable in `swift.go`
2. Do not report 500 server error in `GetPullDiffStats` middleware,
otherwise a PR missing ref won't be able to view.
3. Fix the abused "label button" when listing commits, there was too
much padding space, see the screenshot below.

(cherry picked from commit ba0deab6167236db89c975123570089452776599)
2025-04-22 10:20:23 +02:00
Gusted
358863999e fix: delay-write trace.dat for forgejo diagnosis (#7597)
- Delay the writing of `trace.dat` to the forgejo diagnosis zip file. It's not possible to write `cpu-profile.dat` and `trace.dat` at the same time. This caused the implemention to prematurely close `cpu-profile.dat` and leave it as an empty file.
- Regression of forgejo/forgejo#6470

## Testing
1. Go to `/admin/monitor`
2. Click on "Download diagnosis report"
3. Open the zip file and check that all files are non-empty.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7597
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-22 08:14:41 +00:00
Wolfgang Reithmeier
875534e50a Swift files can be passed either as file or as form value (#34068)
Fix #33990

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 2683adfcb4f7c5ee6ff56b3311ac657cb95c03a9)
2025-04-22 10:13:17 +02:00
badhezi
d0b7a2cccf Fix project board links to related Pull Requests (#34213)
Resolves https://github.com/go-gitea/gitea/issues/34181

(cherry picked from commit a4f22a3e8068d05e76aa0171718b88e57a93050a)
2025-04-22 10:11:43 +02:00
Kerwin Bryant
01eee60fdc Fix two missed null value checks on the wiki page. (#34205)
before:

![image](https://github.com/user-attachments/assets/83e5513f-a4fa-406d-a010-8ec8cd873203)

after:

![image](https://github.com/user-attachments/assets/6bca76c7-0445-429a-92b1-1a9f96d6daca)

(cherry picked from commit 3a651cfd02321e5271f69093a6c6cb556db16fdc)
2025-04-22 10:04:41 +02:00
bytedream
64555d6efb Restore form inputs on organization create error (#34201)
Keeps the entered inputs when the "organization create" request
returns an error.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 18a673bad1d036502baca4491a16679692c42320)
2025-04-22 09:54:18 +02:00
0ko
603d655ec4 fix(i18n): prevent incorrect logging on strings missing in JSON locales (#7594)
Fixes https://codeberg.org/forgejo/forgejo/issues/7591
Followup to https://codeberg.org/forgejo/forgejo/pulls/6203

When the test runs without an actual fix included, an error message appears in the logs:
[E] Missing translation "incorrect_root_url"

With it, it does not.

Reported-by: Paweł Bogusławski <pboguslawski@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7594
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-22 03:49:37 +00:00
0ko
8e0b86a5dc fix(ui): overflow tabular menu CSS fixes (#7578)
Change 1

Followup to https://codeberg.org/forgejo/forgejo/pulls/7314
and https://codeberg.org/forgejo/forgejo/pulls/7356

Replace baseline with center, because baseline alignment is broken with Asian scripts.

Preview:
https://codeberg.org/attachments/f612ca9b-5033-44f1-8bea-b71170c1f595 - bug
https://codeberg.org/attachments/69e021eb-96dc-40b1-8c65-9fb4a378e051 - with fix applied

Change 2

Followup to https://codeberg.org/forgejo/forgejo/pulls/7108
and https://codeberg.org/forgejo/forgejo/issues/4169

Rescope `.ui.tabular.menu .item { height: 100%;}` to overflow menu, because it was only meant for overflow menu based on PR context, but started to negatively impact the other "bookmark" style menus: they've got an extra bottom line under active tabs.

Preview:
https://codeberg.org/attachments/b535e437-16fd-4af2-ae8c-221618ec6b8c - bug
https://codeberg.org/attachments/10a3086d-8fe7-4317-bd66-71e8139b2cc7 - bug in another area
https://codeberg.org/attachments/6a6b8994-c982-48d0-98fe-68e70ba709c2 - with fix applied
https://codeberg.org/attachments/8fd8a332-a9ec-4b28-948e-a4e986e301da - intended fix still applies

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7578
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-21 07:25:17 +00:00
Renovate Bot
424606c8a4 Update renovate to v39.252.0 (forgejo) (#7587)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-21 06:39:22 +00:00
0ko
507280b073 fix(ui): use gap in switch items (#7581)
Followup to PRs where the old switches were converted to this one.

The main change here is to the switch with counter. It was missing a gap.

Additionally, it removes tailwind helpers the other switches retained from before switch refactors, because they are now using gap.

Preview:
https://codeberg.org/attachments/6191f55e-0b61-49fa-ba8f-cd9c93ca7bd4
https://codeberg.org/attachments/a03fb681-45b7-40f5-929e-55154abeb20d
No visual change to the ones with icons.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7581
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-21 04:25:08 +00:00
0ko
acf6c13fd9 fix(ui/pr): use eye icon for reviews (#7584)
Followup to https://codeberg.org/forgejo/forgejo/pulls/6523
Reverts icon change introduced in https://codeberg.org/forgejo/forgejo/pulls/5695

It went unnoticed since v10 and was likely caused by bad copy paste and I don't think it's really worth a test.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7584
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-04-20 13:41:51 +00:00
0ko
fda68ddf20 i18n(en): add positional hints to sync_fork placeholders (#7579)
Followup to https://codeberg.org/forgejo/forgejo/pulls/2364.

It's only possible to use them without hints in the correct order in the string, because our i18n is not smart enough to figure out types in such strings on it's own.

In some languages translators preferred to first specify branch name and then amount of commits without hints and got broken strings.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7579
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-04-20 07:06:03 +00:00
0ko
a0c9e81611 feat(ui): redesign migration selection screen (#6795)
Ref https://codeberg.org/forgejo/design/issues/9.

Changes:
* Updated SVGs which had inconsistent paddings making them look off
* Better usability on mobile
* Better space efficiency on desktop, up to 4 columns
* Nice responsive design
* Less bland look on desktop. The borders were already here but invisible in Forgejo dark theme

Preview:
* https://codeberg.org/attachments/3c9e10ae-3315-46e5-b8bb-8021f6fd8936
* https://codeberg.org/attachments/8196ad89-5ab6-443a-98ce-a70dcc75bca9
* https://codeberg.org/attachments/24f52a14-2ac4-4949-8108-55c34bd3c650

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6795
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Otto <otto@codeberg.org>
2025-04-19 13:51:35 +00:00
Gusted
78e56ee2f7 [gitea] week 2025-15 cherry pick (gitea/main -> forgejo) (#7538)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7538
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-19 12:59:09 +00:00
Beowulf
9a4ded7d80 fix(ui): use correct branch name in branch tag selector (#7575)
Regression from: https://codeberg.org/forgejo/forgejo/pulls/7571

Needed for: https://codeberg.org/forgejo/forgejo/pulls/7574

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7575
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-04-19 07:00:50 +00:00
Beowulf
3f673ce4d4 fix(ui): show commit icon in branch dropdown button when viewing a commit (#7571)
Closes https://codeberg.org/forgejo/forgejo/issues/7570

Fixed never running repo-home e2e test for language switcher

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7571
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-04-19 04:33:07 +00:00
Renovate Bot
6d7b1f87e4 Update dependency webpack to v5.99.6 (forgejo) (#7573)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7573
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-19 00:32:36 +00:00
Stefan
f3882d4553 fix: allow user with actions write permission to run a workflow from the web UI (#7245)
Users with permissions actions write can reschedule a workflow or start a new one over the API. But if the user try to use workflow dispatch on the web GUI it fails with 404 error.

Debug log says
```
router: completed POST /<owner>/<repo>/actions/manual for <client ip>, 404 Not Found in 21.6ms @ context/permission.go:17(web.registerRoutes.RequireRepoAdmin)
```

I think this is not correct, users with permissons action write should also be able to run a new workflow over the GUI. This can be fixed with this little change.

## Testing

- Create a repository in an organization with [a manual workflow](https://forgejo.org/docs/next/user/actions/#onworkflow_dispatch)
- Create a user and assign it action write permissions for this repository in a team
- Login as the user and verify they are allowed to run the workflow via the web UI

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7245): <!--number 7245 --><!--line 0 --><!--description YWxsb3cgdXNlciB3aXRoIGFjdGlvbnMgd3JpdGUgcGVybWlzc2lvbiB0byBydW4gYSB3b3JrZmxvdyBmcm9tIHRoZSB3ZWIgVUk=-->allow user with actions write permission to run a workflow from the web UI<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7245
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Stefan <stku@noreply.codeberg.org>
Co-committed-by: Stefan <stku@noreply.codeberg.org>
2025-04-18 19:17:03 +00:00
Paul-Emmanuel Raoul
58653d3700 feat(ui): improve description in packages settings (#7531)
- Improve the description of the 'Cargo registry index' and 'Chef registry'.
  - Move 'For more information' to be the first senctence.
  - Better explain what Chef's keypair button does.
- Resolves https://codeberg.org/forgejo/forgejo/issues/7140

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7531
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-authored-by: Paul-Emmanuel Raoul <skyper@skyplabs.net>
Co-committed-by: Paul-Emmanuel Raoul <skyper@skyplabs.net>
2025-04-18 12:36:59 +00:00
Gusted
23cc1fdbbe feat(api): add last_commit_when to contents response (#7418)
- Add a new field `last_commit_when` to the `ContentResponse` type, which is populated with the last commit's commiter date. This can be used to determine when the last edit of the content was.
- This field is compatible with what Gitea will likely add, https://github.com/go-gitea/gitea/pull/32921. There's no field for this information in the Github API, so no way to be compatible with that (this API endpoint is otherwise fully compatible with Github's API).
- Ref: gitnex/GitNex#1225
- Integration test adjusted. The API tests cannot test the actual output, as `testify` tries to 'deep equal' the `time.Time` structs which will differ due how the `time.Time` struct is created. Unit tests still verify the output.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7418
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-18 09:31:40 +00:00
David Davies-Payne
813eabc340 fix: grammar in a release API error message (#7565)
This is small bug fix to correct the API's response description.

Currently returns "Release is has no Tag"
I think would read better as "Release has no Tag"

I have not added a test as it's a trivial change, however it's possible that consumers might be looking for that particular string.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7565
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: David Davies-Payne <d2p@me.com>
Co-committed-by: David Davies-Payne <d2p@me.com>
2025-04-18 07:04:40 +00:00
Earl Warren
9720418bb5 i18n: update of translations from Codeberg Translate (#7507)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7507
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-04-17 15:10:54 +00:00
Codeberg Translate
4fe172e4b2
i18n: update of translations from Codeberg Translate
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Miguel P.L <miguel_pl@noreply.codeberg.org>
Co-authored-by: PeterDaveHello <peterdavehello@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: antaanimosity <antaanimosity@noreply.codeberg.org>
Co-authored-by: artnay <artnay@noreply.codeberg.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@noreply.codeberg.org>
Co-authored-by: lucasmz.dev <git@lucasmz.dev>
Co-authored-by: oscarotero <oscarotero@noreply.codeberg.org>
Co-authored-by: otf31 <otf31@noreply.codeberg.org>
Co-authored-by: themandalorian <themandalorian@noreply.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: zerica <zerica@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/gl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hant/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-04-17 14:36:28 +00:00
Renovate Bot
4ce232bcfe Update module github.com/mattn/go-sqlite3 to v1.14.28 (forgejo) (#7560)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7560
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-17 10:40:44 +00:00
Renovate Bot
aa9d89c846 Update module github.com/caddyserver/certmagic to v0.23.0 (forgejo) (#7561)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/caddyserver/certmagic](https://github.com/caddyserver/certmagic) | require | minor | `v0.22.2` -> `v0.23.0` |

---

### Release Notes

<details>
<summary>caddyserver/certmagic (github.com/caddyserver/certmagic)</summary>

### [`v0.23.0`](https://github.com/caddyserver/certmagic/compare/v0.22.2...v0.23.0)

[Compare Source](https://github.com/caddyserver/certmagic/compare/v0.22.2...v0.23.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNDAuMSIsInVwZGF0ZWRJblZlciI6IjM5LjI0MC4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7561
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-17 05:03:23 +00:00
Remo Senekowitsch
a13414341b feat: inline public ssh key in verification command (#7516)
This makes it easier for people to verify their SSH key with various
setups. People with a key stored in a file won't have to manually
substitute the correct file path anymore. People who store their SSH
key in a password manager and access it via an ssh-agent won't have
to copy the private key to a temporary file or figure out the process
substitution thing anymore.

A slight disadvantage is that the fish shell doesn't have the same
syntax for process substitution as POSIX shells. For that reason, a
default-collapsed box with a custom command for fish users is provided,
just like for the Windows shells.

The Windows shells do not have an equivalent to process substitution, so
those commands remain unchanged.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] ~in their respective `*_test.go` for unit tests.~
  - [ ] ~in the `tests/integration` directory if it involves interactions with a live Forgejo server.~
- I added test coverage for JavaScript changes...
  - [ ] ~in `web_src/js/*.test.js` if it can be unit tested.~
  - [ ] ~in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).~

### Documentation

- [ ] ~I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.~
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

## [](#testing)Testing

* `pr=7516 ; git fetch forgejo +refs/pull/$pr/head:refs/heads/wip-pr-$pr`

* `git checkout wip-pr-$pr`

* `make TAGS='sqlite sqlite_unlock_notify' watch`

* login

* visit /user/settings/keys and add an ssh key

* click verify

* see a CLI sample is displayed
      ![image](attachments/8edf43f4-9ae9-48dc-b275-0c466e9a161d)

* run CLI sample, copy paste the output and submit it

* check that the verification is successful
      ![image](attachments/20074f32-e06f-42fd-9732-32171016c47e)

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7516): <!--number 7516 --><!--line 0 --><!--description aW5saW5lIHB1YmxpYyBzc2gga2V5IGluIHZlcmlmaWNhdGlvbiBjb21tYW5k-->inline public ssh key in verification command<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7516
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Remo Senekowitsch <remo@buenzli.dev>
Co-committed-by: Remo Senekowitsch <remo@buenzli.dev>
2025-04-17 05:00:21 +00:00
forgejo-release-manager
0f35e87290 chore(release-notes): Forgejo v11.0.0 (#7469)
https://codeberg.org/forgejo/forgejo/milestone/9323
Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7469
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
Co-committed-by: forgejo-release-manager <contact-forgejo-release-manager@forgejo.org>
2025-04-16 19:10:03 +00:00
Gusted
5c1c514361 fix(ui): make tag dropdown clickable again (#7558)
- forgejo/forgejo#7187 removed the usage of `reference column` class names, however some javascript code depended on it. Adjust this code to instead use the new class `branch-tag-item`.
- Ref: forgejo/forgejo#7187

## Testing

- visit a compare tag page
- see it is possible search for a tag
   ![image](/attachments/8006fc35-96d0-49ad-94d4-078030cb2323)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7558
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-16 12:28:39 +00:00
Renovate Bot
1b0e3c717f Update dependency python to v3.13.3 (forgejo) (#7557)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7557
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-16 10:37:41 +00:00
Earl Warren
c35550f324 chore(release): v10.0 is EOL (#7555)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7555
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-16 10:06:26 +00:00
zam
f6a5b783d2 add port and schema to federation host (#7203)
## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [ ] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7203
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: zam <mirco.zachmann@meissa.de>
Co-committed-by: zam <mirco.zachmann@meissa.de>
2025-04-16 08:07:51 +00:00
Michael Kriese
23360ad415 chore(renovate): fix package name matching for go majors [skip ci] (#7554)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7554
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2025-04-16 07:47:47 +00:00
Renovate Bot
f711aaceb8 Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.1.2 (forgejo) (#7552)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [github.com/golangci/golangci-lint/v2/cmd/golangci-lint](https://github.com/golangci/golangci-lint) | patch | `v2.1.1` -> `v2.1.2` |

---

### Release Notes

<details>
<summary>golangci/golangci-lint (github.com/golangci/golangci-lint/v2/cmd/golangci-lint)</summary>

### [`v2.1.2`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v212)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.1...v2.1.2)

1.  Linters bug fixes
    -   `exptostd`: from 0.4.2 to 0.4.3
    -   `gofumpt`: from 0.7.0 to 0.8.0
    -   `protogetter`: from 0.3.13 to 0.3.15
    -   `usetesting`: from 0.4.2 to 0.4.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNDAuMSIsInVwZGF0ZWRJblZlciI6IjM5LjI0MC4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7552
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-16 05:42:20 +00:00
Renovate Bot
f28dbe4306 Update dependency chart.js to v4.4.9 (forgejo) (#7550)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7550
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-16 00:39:48 +00:00
Renovate Bot
2accf24f72 Update https://data.forgejo.org/actions/git-backporting action to v4.8.5 (forgejo) (#7551)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7551
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-16 00:39:07 +00:00
Renovate Bot
2570be93a6 Update Node.js to v22 (forgejo) (#7545)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [node](https://nodejs.org) ([source](https://github.com/nodejs/node)) | major | `20` -> `22` |

---

### Release Notes

<details>
<summary>nodejs/node (node)</summary>

### [`v22.14.0`](https://github.com/nodejs/node/releases/tag/v22.14.0): 2025-02-11, Version 22.14.0 &#x27;Jod&#x27; (LTS), @&#8203;aduh95

[Compare Source](https://github.com/nodejs/node/compare/v22.13.1...v22.14.0)

##### Notable Changes

-   \[[`82a9000e9e`](82a9000e9e)] - **crypto**: update root certificates to NSS 3.107 (Node.js GitHub Bot) [#&#8203;56566](https://github.com/nodejs/node/pull/56566)
-   \[[`b7fe54fc88`](b7fe54fc88)] - **(SEMVER-MINOR)** **fs**: allow `exclude` option in globs to accept glob patterns (Daeyeon Jeong) [#&#8203;56489](https://github.com/nodejs/node/pull/56489)
-   \[[`3ac92ef607`](3ac92ef607)] - **(SEMVER-MINOR)** **lib**: add typescript support to STDIN eval (Marco Ippolito) [#&#8203;56359](https://github.com/nodejs/node/pull/56359)
-   \[[`1614e8e7bc`](1614e8e7bc)] - **(SEMVER-MINOR)** **module**: add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX (Marco Ippolito) [#&#8203;56610](https://github.com/nodejs/node/pull/56610)
-   \[[`6d6cffa9cc`](6d6cffa9cc)] - **(SEMVER-MINOR)** **module**: add `findPackageJSON` util (Jacob Smith) [#&#8203;55412](https://github.com/nodejs/node/pull/55412)
-   \[[`d35333ae18`](d35333ae18)] - **(SEMVER-MINOR)** **process**: add process.ref() and process.unref() methods (James M Snell) [#&#8203;56400](https://github.com/nodejs/node/pull/56400)
-   \[[`07ff3ddcb5`](07ff3ddcb5)] - **(SEMVER-MINOR)** **sqlite**: support TypedArray and DataView in `StatementSync` (Alex Yang) [#&#8203;56385](https://github.com/nodejs/node/pull/56385)
-   \[[`94d3fe1b62`](94d3fe1b62)] - **(SEMVER-MINOR)** **src**: add --disable-sigusr1 to prevent signal i/o thread (Rafael Gonzaga) [#&#8203;56441](https://github.com/nodejs/node/pull/56441)
-   \[[`5afffb4415`](5afffb4415)] - **(SEMVER-MINOR)** **src,worker**: add isInternalWorker (Carlos Espa) [#&#8203;56469](https://github.com/nodejs/node/pull/56469)
-   \[[`697a851fb3`](697a851fb3)] - **(SEMVER-MINOR)** **test_runner**: add TestContext.prototype.waitFor() (Colin Ihrig) [#&#8203;56595](https://github.com/nodejs/node/pull/56595)
-   \[[`047537b48c`](047537b48c)] - **(SEMVER-MINOR)** **test_runner**: add t.assert.fileSnapshot() (Colin Ihrig) [#&#8203;56459](https://github.com/nodejs/node/pull/56459)
-   \[[`926cf84e95`](926cf84e95)] - **(SEMVER-MINOR)** **test_runner**: add assert.register() API (Colin Ihrig) [#&#8203;56434](https://github.com/nodejs/node/pull/56434)
-   \[[`c658a8afdf`](c658a8afdf)] - **(SEMVER-MINOR)** **worker**: add eval ts input (Marco Ippolito) [#&#8203;56394](https://github.com/nodejs/node/pull/56394)

##### Commits

-   \[[`bad1ad8650`](bad1ad8650)] - **assert**: make myers_diff function more performant (Giovanni Bucci) [#&#8203;56303](https://github.com/nodejs/node/pull/56303)
-   \[[`e222e36f3b`](e222e36f3b)] - **assert**: make partialDeepStrictEqual work with urls and File prototypes (Giovanni Bucci) [#&#8203;56231](https://github.com/nodejs/node/pull/56231)
-   \[[`e232789fe2`](e232789fe2)] - **assert**: show diff when doing partial comparisons (Giovanni Bucci) [#&#8203;56211](https://github.com/nodejs/node/pull/56211)
-   \[[`c99de1fdcf`](c99de1fdcf)] - **assert**: make partialDeepStrictEqual throw when comparing \[0] with \[-0] (Giovanni) [#&#8203;56237](https://github.com/nodejs/node/pull/56237)
-   \[[`2386fd5840`](2386fd5840)] - **benchmark**: add validateStream to styleText bench (Rafael Gonzaga) [#&#8203;56556](https://github.com/nodejs/node/pull/56556)
-   \[[`b197dfa7ec`](b197dfa7ec)] - **build**: fix GN build for ngtcp2 (Cheng) [#&#8203;56300](https://github.com/nodejs/node/pull/56300)
-   \[[`2a3cdd34ff`](2a3cdd34ff)] - **build**: test macos-13 on GitHub actions (Michaël Zasso) [#&#8203;56307](https://github.com/nodejs/node/pull/56307)
-   \[[`12f716be0a`](12f716be0a)] - **build**: build v8 with -fvisibility=hidden on macOS (Joyee Cheung) [#&#8203;56275](https://github.com/nodejs/node/pull/56275)
-   \[[`c5ca15bd34`](c5ca15bd34)] - **child_process**: fix parsing messages with splitted length field (Maksim Gorkov) [#&#8203;56106](https://github.com/nodejs/node/pull/56106)
-   \[[`8346b8fc2c`](8346b8fc2c)] - **crypto**: add missing return value check (Michael Dawson) [#&#8203;56615](https://github.com/nodejs/node/pull/56615)
-   \[[`82a9000e9e`](82a9000e9e)] - **crypto**: update root certificates to NSS 3.107 (Node.js GitHub Bot) [#&#8203;56566](https://github.com/nodejs/node/pull/56566)
-   \[[`890eef20a1`](890eef20a1)] - **crypto**: fix checkPrime crash with large buffers (Santiago Gimeno) [#&#8203;56559](https://github.com/nodejs/node/pull/56559)
-   \[[`5edb7b5e87`](5edb7b5e87)] - **crypto**: fix warning of ignoring return value (Cheng) [#&#8203;56527](https://github.com/nodejs/node/pull/56527)
-   \[[`b89f123a0b`](b89f123a0b)] - **crypto**: make generatePrime/checkPrime interruptible (James M Snell) [#&#8203;56460](https://github.com/nodejs/node/pull/56460)
-   \[[`63c1859e01`](63c1859e01)] - **deps**: update corepack to 0.31.0 (Node.js GitHub Bot) [#&#8203;56795](https://github.com/nodejs/node/pull/56795)
-   \[[`a48430d4d3`](a48430d4d3)] - **deps**: move inspector_protocol to deps (Chengzhong Wu) [#&#8203;56649](https://github.com/nodejs/node/pull/56649)
-   \[[`74cccc824f`](74cccc824f)] - **deps**: macro ENODATA is deprecated in libc++ (Cheng) [#&#8203;56698](https://github.com/nodejs/node/pull/56698)
-   \[[`fa869ea0f2`](fa869ea0f2)] - **deps**: fixup some minor coverity warnings (James M Snell) [#&#8203;56612](https://github.com/nodejs/node/pull/56612)
-   \[[`1a4fa2b015`](1a4fa2b015)] - **deps**: update amaro to 0.3.0 (Node.js GitHub Bot) [#&#8203;56568](https://github.com/nodejs/node/pull/56568)
-   \[[`b47076fd82`](b47076fd82)] - **deps**: update amaro to 0.2.2 (Node.js GitHub Bot) [#&#8203;56568](https://github.com/nodejs/node/pull/56568)
-   \[[`46bd4b8731`](46bd4b8731)] - **deps**: update simdutf to 6.0.3 (Node.js GitHub Bot) [#&#8203;56567](https://github.com/nodejs/node/pull/56567)
-   \[[`8ead9c693b`](8ead9c693b)] - **deps**: update simdutf to 5.7.2 (Node.js GitHub Bot) [#&#8203;56388](https://github.com/nodejs/node/pull/56388)
-   \[[`18d4b502af`](18d4b502af)] - **deps**: update amaro to 0.2.1 (Node.js GitHub Bot) [#&#8203;56390](https://github.com/nodejs/node/pull/56390)
-   \[[`d938d7cc86`](d938d7cc86)] - **deps**: update googletest to [`7d76a23`](7d76a23) (Node.js GitHub Bot) [#&#8203;56387](https://github.com/nodejs/node/pull/56387)
-   \[[`9761e7dccb`](9761e7dccb)] - **deps**: update googletest to [`e54519b`](e54519b) (Node.js GitHub Bot) [#&#8203;56370](https://github.com/nodejs/node/pull/56370)
-   \[[`8319dc6bc5`](8319dc6bc5)] - **deps**: update ngtcp2 to 1.10.0 (Node.js GitHub Bot) [#&#8203;56334](https://github.com/nodejs/node/pull/56334)
-   \[[`6eacd19d6a`](6eacd19d6a)] - **deps**: update simdutf to 5.7.0 (Node.js GitHub Bot) [#&#8203;56332](https://github.com/nodejs/node/pull/56332)
-   \[[`28bec2dda3`](28bec2dda3)] - **diagnostics_channel**: capture console messages (Stephen Belanger) [#&#8203;56292](https://github.com/nodejs/node/pull/56292)
-   \[[`d519d33502`](d519d33502)] - **doc**: update macOS and Xcode versions for releases (Michaël Zasso) [#&#8203;56337](https://github.com/nodejs/node/pull/56337)
-   \[[`fcfe650507`](fcfe650507)] - **doc**: add note for features using `InternalWorker` with permission model (Antoine du Hamel) [#&#8203;56706](https://github.com/nodejs/node/pull/56706)
-   \[[`efbba182b5`](efbba182b5)] - **doc**: add entry to changelog about SQLite Session Extension (Bart Louwers) [#&#8203;56318](https://github.com/nodejs/node/pull/56318)
-   \[[`31bf9c7dd9`](31bf9c7dd9)] - **doc**: move anatoli to emeritus (Michael Dawson) [#&#8203;56592](https://github.com/nodejs/node/pull/56592)
-   \[[`6096e38c7c`](6096e38c7c)] - **doc**: fix styles of the expandable TOC (Antoine du Hamel) [#&#8203;56755](https://github.com/nodejs/node/pull/56755)
-   \[[`d423638281`](d423638281)] - **doc**: add "Skip to content" button (Antoine du Hamel) [#&#8203;56750](https://github.com/nodejs/node/pull/56750)
-   \[[`edeb157d75`](edeb157d75)] - **doc**: improve accessibility of expandable lists (Antoine du Hamel) [#&#8203;56749](https://github.com/nodejs/node/pull/56749)
-   \[[`1a79e87687`](1a79e87687)] - **doc**: add note regarding commit message trailers (Dario Piotrowicz) [#&#8203;56736](https://github.com/nodejs/node/pull/56736)
-   \[[`927c7e47e4`](927c7e47e4)] - **doc**: fix typo in example code for util.styleText (Robin Mehner) [#&#8203;56720](https://github.com/nodejs/node/pull/56720)
-   \[[`fade522538`](fade522538)] - **doc**: fix inconsistencies in `WeakSet` and `WeakMap` comparison details (Shreyans Pathak) [#&#8203;56683](https://github.com/nodejs/node/pull/56683)
-   \[[`55533bf147`](55533bf147)] - **doc**: add RafaelGSS as latest sec release stewards (Rafael Gonzaga) [#&#8203;56682](https://github.com/nodejs/node/pull/56682)
-   \[[`8e978bdee1`](8e978bdee1)] - **doc**: clarify cjs/esm diff in `queueMicrotask()` vs `process.nextTick()` (Dario Piotrowicz) [#&#8203;56659](https://github.com/nodejs/node/pull/56659)
-   \[[`ae360c30dc`](ae360c30dc)] - **doc**: `WeakSet` and `WeakMap` comparison details (Shreyans Pathak) [#&#8203;56648](https://github.com/nodejs/node/pull/56648)
-   \[[`acd2a2fda5`](acd2a2fda5)] - **doc**: mention prepare --security (Rafael Gonzaga) [#&#8203;56617](https://github.com/nodejs/node/pull/56617)
-   \[[`d3c0a2831d`](d3c0a2831d)] - **doc**: tweak info on reposts in ambassador program (Michael Dawson) [#&#8203;56589](https://github.com/nodejs/node/pull/56589)
-   \[[`3299505b49`](3299505b49)] - **doc**: add type stripping to ambassadors program (Marco Ippolito) [#&#8203;56598](https://github.com/nodejs/node/pull/56598)
-   \[[`b1a6ffa4e4`](b1a6ffa4e4)] - **doc**: improve internal documentation on built-in snapshot (Joyee Cheung) [#&#8203;56505](https://github.com/nodejs/node/pull/56505)
-   \[[`1641a28930`](1641a28930)] - **doc**: document CLI way to open the nodejs/bluesky PR (Antoine du Hamel) [#&#8203;56506](https://github.com/nodejs/node/pull/56506)
-   \[[`2042628fda`](2042628fda)] - **doc**: add section about using npx with permission model (Rafael Gonzaga) [#&#8203;56539](https://github.com/nodejs/node/pull/56539)
-   \[[`ace19a0263`](ace19a0263)] - **doc**: update gcc-version for ubuntu-lts (Kunal Kumar) [#&#8203;56553](https://github.com/nodejs/node/pull/56553)
-   \[[`4aa57b50f8`](4aa57b50f8)] - **doc**: fix parentheses in options (Tobias Nießen) [#&#8203;56563](https://github.com/nodejs/node/pull/56563)
-   \[[`b40b01b4d3`](b40b01b4d3)] - **doc**: include CVE to EOL lines as sec release process (Rafael Gonzaga) [#&#8203;56520](https://github.com/nodejs/node/pull/56520)
-   \[[`6701360113`](6701360113)] - **doc**: add esm examples to node:trace_events (Alfredo González) [#&#8203;56514](https://github.com/nodejs/node/pull/56514)
-   \[[`d3207cca3e`](d3207cca3e)] - **doc**: add message for Ambassadors to promote (Michael Dawson) [#&#8203;56235](https://github.com/nodejs/node/pull/56235)
-   \[[`97ece4ae06`](97ece4ae06)] - **doc**: allow request for TSC reviews via the GitHub UI (Antoine du Hamel) [#&#8203;56493](https://github.com/nodejs/node/pull/56493)
-   \[[`03f25055ab`](03f25055ab)] - **doc**: add example for piping ReadableStream (Gabriel Schulhof) [#&#8203;56415](https://github.com/nodejs/node/pull/56415)
-   \[[`516d07482c`](516d07482c)] - **doc**: expand description of `parseArg`'s `default` (Kevin Gibbons) [#&#8203;54431](https://github.com/nodejs/node/pull/54431)
-   \[[`a6491effcb`](a6491effcb)] - **doc**: use `<ul>` instead of `<ol>` in `SECURITY.md` (Antoine du Hamel) [#&#8203;56346](https://github.com/nodejs/node/pull/56346)
-   \[[`e4ec134b21`](e4ec134b21)] - **doc**: clarify that WASM is trusted (Matteo Collina) [#&#8203;56345](https://github.com/nodejs/node/pull/56345)
-   \[[`0f7aed8a59`](0f7aed8a59)] - **doc**: fix the `crc32` documentation (Kevin Toshihiro Uehara) [#&#8203;55898](https://github.com/nodejs/node/pull/55898)
-   \[[`721104a296`](721104a296)] - **doc**: fix links in `module.md` (Antoine du Hamel) [#&#8203;56283](https://github.com/nodejs/node/pull/56283)
-   \[[`928540d792`](928540d792)] - **doc**: fix typos (Nathan Baulch) [#&#8203;55066](https://github.com/nodejs/node/pull/55066)
-   \[[`e69d35f03b`](e69d35f03b)] - **doc**: add history info for Permission Model (Antoine du Hamel) [#&#8203;56707](https://github.com/nodejs/node/pull/56707)
-   \[[`c6fd867ab5`](c6fd867ab5)] - **esm**: fix jsdoc type refs to `ModuleJobBase` in esm/loader (Jacob Smith) [#&#8203;56499](https://github.com/nodejs/node/pull/56499)
-   \[[`9cf9046bd7`](9cf9046bd7)] - ***Revert*** "**events**: add hasEventListener util for validate" (origranot) [#&#8203;56282](https://github.com/nodejs/node/pull/56282)
-   \[[`b7fe54fc88`](b7fe54fc88)] - **(SEMVER-MINOR)** **fs**: allow `exclude` option in globs to accept glob patterns (Daeyeon Jeong) [#&#8203;56489](https://github.com/nodejs/node/pull/56489)
-   \[[`6ca27c2a59`](6ca27c2a59)] - **http2**: omit server name when HTTP2 host is IP address (islandryu) [#&#8203;56530](https://github.com/nodejs/node/pull/56530)
-   \[[`9f1fa199bf`](9f1fa199bf)] - **inspector**: roll inspector_protocol (Chengzhong Wu) [#&#8203;56649](https://github.com/nodejs/node/pull/56649)
-   \[[`0dae4bb3ab`](0dae4bb3ab)] - **inspector**: add undici http tracking support (Chengzhong Wu) [#&#8203;56488](https://github.com/nodejs/node/pull/56488)
-   \[[`2c6124cec4`](2c6124cec4)] - **inspector**: report loadingFinished until the response data is consumed (Chengzhong Wu) [#&#8203;56372](https://github.com/nodejs/node/pull/56372)
-   \[[`96ec862ce2`](96ec862ce2)] - **lib**: refactor execution.js (Marco Ippolito) [#&#8203;56358](https://github.com/nodejs/node/pull/56358)
-   \[[`3ac92ef607`](3ac92ef607)] - **(SEMVER-MINOR)** **lib**: add typescript support to STDIN eval (Marco Ippolito) [#&#8203;56359](https://github.com/nodejs/node/pull/56359)
-   \[[`d5bf3db0cf`](d5bf3db0cf)] - **lib**: allow skipping source maps in node_modules (Chengzhong Wu) [#&#8203;56639](https://github.com/nodejs/node/pull/56639)
-   \[[`d33eaf2bcb`](d33eaf2bcb)] - **lib**: ensure FORCE_COLOR forces color output in non-TTY environments (Pietro Marchini) [#&#8203;55404](https://github.com/nodejs/node/pull/55404)
-   \[[`dc003218a8`](dc003218a8)] - **lib**: optimize `prepareStackTrace` on builtin frames (Chengzhong Wu) [#&#8203;56299](https://github.com/nodejs/node/pull/56299)
-   \[[`df06524863`](df06524863)] - **lib**: suppress source map lookup exceptions (Chengzhong Wu) [#&#8203;56299](https://github.com/nodejs/node/pull/56299)
-   \[[`35335a5a66`](35335a5a66)] - **meta**: move one or more collaborators to emeritus (Node.js GitHub Bot) [#&#8203;56580](https://github.com/nodejs/node/pull/56580)
-   \[[`1faabdb150`](1faabdb150)] - **meta**: add codeowners of security release document (Rafael Gonzaga) [#&#8203;56521](https://github.com/nodejs/node/pull/56521)
-   \[[`b4ece22ef5`](b4ece22ef5)] - **meta**: move one or more collaborators to emeritus (Node.js GitHub Bot) [#&#8203;56342](https://github.com/nodejs/node/pull/56342)
-   \[[`9ec67e7ce0`](9ec67e7ce0)] - **meta**: move MoLow to TSC regular member (Moshe Atlow) [#&#8203;56276](https://github.com/nodejs/node/pull/56276)
-   \[[`bae4b2e20a`](bae4b2e20a)] - **module**: use more defensive code when handling SWC errors (Antoine du Hamel) [#&#8203;56646](https://github.com/nodejs/node/pull/56646)
-   \[[`1614e8e7bc`](1614e8e7bc)] - **(SEMVER-MINOR)** **module**: add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX (Marco Ippolito) [#&#8203;56610](https://github.com/nodejs/node/pull/56610)
-   \[[`174d88eab1`](174d88eab1)] - **module**: support eval with ts syntax detection (Marco Ippolito) [#&#8203;56285](https://github.com/nodejs/node/pull/56285)
-   \[[`299d6fa829`](299d6fa829)] - **module**: fix jsdoc for `format` parameter in cjs/loader (pacexy) [#&#8203;56501](https://github.com/nodejs/node/pull/56501)
-   \[[`0307e4dd59`](0307e4dd59)] - **module**: unify TypeScript and .mjs handling in CommonJS (Joyee Cheung) [#&#8203;55590](https://github.com/nodejs/node/pull/55590)
-   \[[`1f4f9be93d`](1f4f9be93d)] - **module**: fix async resolution error within the sync `findPackageJSON` (Jacob Smith) [#&#8203;56382](https://github.com/nodejs/node/pull/56382)
-   \[[`bbedffa0f0`](bbedffa0f0)] - **module**: simplify `findPackageJSON` implementation (Antoine du Hamel) [#&#8203;55543](https://github.com/nodejs/node/pull/55543)
-   \[[`6d6cffa9cc`](6d6cffa9cc)] - **(SEMVER-MINOR)** **module**: add `findPackageJSON` util (Jacob Smith) [#&#8203;55412](https://github.com/nodejs/node/pull/55412)
-   \[[`cd7ce18233`](cd7ce18233)] - **module**: fix bad `require.resolve` with option paths for `.` and `..` (Dario Piotrowicz) [#&#8203;56735](https://github.com/nodejs/node/pull/56735)
-   \[[`152df4da21`](152df4da21)] - **module**: rethrow amaro error message (Marco Ippolito) [#&#8203;56568](https://github.com/nodejs/node/pull/56568)
-   \[[`acba5dc87e`](acba5dc87e)] - **module**: use buffer.toString base64 (Chengzhong Wu) [#&#8203;56315](https://github.com/nodejs/node/pull/56315)
-   \[[`01e69be8ff`](01e69be8ff)] - **node-api**: define version 10 (Gabriel Schulhof) [#&#8203;55676](https://github.com/nodejs/node/pull/55676)
-   \[[`724524528e`](724524528e)] - **node-api**: remove deprecated attribute from napi_module_register (Vladimir Morozov) [#&#8203;56162](https://github.com/nodejs/node/pull/56162)
-   \[[`c78e11064f`](c78e11064f)] - **process**: remove support for undocumented symbol (Antoine du Hamel) [#&#8203;56552](https://github.com/nodejs/node/pull/56552)
-   \[[`3f69b18a23`](3f69b18a23)] - **process**: fix symbol key and mark experimental new `node:process` methods (Antoine du Hamel) [#&#8203;56517](https://github.com/nodejs/node/pull/56517)
-   \[[`d35333ae18`](d35333ae18)] - **(SEMVER-MINOR)** **process**: add process.ref() and process.unref() methods (James M Snell) [#&#8203;56400](https://github.com/nodejs/node/pull/56400)
-   \[[`fa49f0f7d5`](fa49f0f7d5)] - **punycode**: limit deprecation warning (Colin Ihrig) [#&#8203;56632](https://github.com/nodejs/node/pull/56632)
-   \[[`d77c7073b7`](d77c7073b7)] - **sqlite**: disable memstatus APIs at build time (Colin Ihrig) [#&#8203;56541](https://github.com/nodejs/node/pull/56541)
-   \[[`07ff3ddcb5`](07ff3ddcb5)] - **(SEMVER-MINOR)** **sqlite**: support TypedArray and DataView in `StatementSync` (Alex Yang) [#&#8203;56385](https://github.com/nodejs/node/pull/56385)
-   \[[`b6c2e91365`](b6c2e91365)] - **sqlite**: enable SQL math functions (Colin Ihrig) [#&#8203;56447](https://github.com/nodejs/node/pull/56447)
-   \[[`3462263e8b`](3462263e8b)] - **sqlite**: pass conflict type to conflict resolution handler (Bart Louwers) [#&#8203;56352](https://github.com/nodejs/node/pull/56352)
-   \[[`89ba3af743`](89ba3af743)] - **src**: add nullptr handling from X509\_STORE_new() (Burkov Egor) [#&#8203;56700](https://github.com/nodejs/node/pull/56700)
-   \[[`89a7c82e0c`](89a7c82e0c)] - **src**: add default value for RSACipherConfig mode field (Burkov Egor) [#&#8203;56701](https://github.com/nodejs/node/pull/56701)
-   \[[`7bae51e62e`](7bae51e62e)] - **src**: fix build with GCC 15 (tjuhaszrh) [#&#8203;56740](https://github.com/nodejs/node/pull/56740)
-   \[[`432a4b8bd6`](432a4b8bd6)] - **src**: fix to generate path from wchar_t via wstring (yamachu) [#&#8203;56696](https://github.com/nodejs/node/pull/56696)
-   \[[`8c9eaf82f0`](8c9eaf82f0)] - **src**: initialize FSReqWrapSync in path that uses it (Michaël Zasso) [#&#8203;56613](https://github.com/nodejs/node/pull/56613)
-   \[[`bcdb42d40b`](bcdb42d40b)] - **src**: handle duplicate paths granted (Rafael Gonzaga) [#&#8203;56591](https://github.com/nodejs/node/pull/56591)
-   \[[`d6a7acc207`](d6a7acc207)] - **src**: update ECKeyPointer in ncrypto (James M Snell) [#&#8203;56526](https://github.com/nodejs/node/pull/56526)
-   \[[`01922f8b1f`](01922f8b1f)] - **src**: update ECPointPointer in ncrypto (James M Snell) [#&#8203;56526](https://github.com/nodejs/node/pull/56526)
-   \[[`2a3a36eceb`](2a3a36eceb)] - **src**: update ECGroupPointer in ncrypto (James M Snell) [#&#8203;56526](https://github.com/nodejs/node/pull/56526)
-   \[[`67c10cdacb`](67c10cdacb)] - **src**: update ECDASSigPointer implementation in ncrypto (James M Snell) [#&#8203;56526](https://github.com/nodejs/node/pull/56526)
-   \[[`17f931c68b`](17f931c68b)] - **src**: cleaning up more crypto internals for ncrypto (James M Snell) [#&#8203;56526](https://github.com/nodejs/node/pull/56526)
-   \[[`94d3fe1b62`](94d3fe1b62)] - **(SEMVER-MINOR)** **src**: add --disable-sigusr1 to prevent signal i/o thread (Rafael Gonzaga) [#&#8203;56441](https://github.com/nodejs/node/pull/56441)
-   \[[`6594ee8dff`](6594ee8dff)] - **src**: fix undefined script name in error source (Chengzhong Wu) [#&#8203;56502](https://github.com/nodejs/node/pull/56502)
-   \[[`b46bad3e91`](b46bad3e91)] - **src**: refactor --trace-env to reuse option selection and handling (Joyee Cheung) [#&#8203;56293](https://github.com/nodejs/node/pull/56293)
-   \[[`76921b822b`](76921b822b)] - **src**: minor cleanups on OneByteString usage (James M Snell) [#&#8203;56482](https://github.com/nodejs/node/pull/56482)
-   \[[`3f0d1dd4fe`](3f0d1dd4fe)] - **src**: move more crypto impl detail to ncrypto dep (James M Snell) [#&#8203;56421](https://github.com/nodejs/node/pull/56421)
-   \[[`04f623b283`](04f623b283)] - **src**: fixup more ToLocalChecked uses in node_file (James M Snell) [#&#8203;56484](https://github.com/nodejs/node/pull/56484)
-   \[[`5aa436f5a1`](5aa436f5a1)] - **src**: make some minor ToLocalChecked cleanups (James M Snell) [#&#8203;56483](https://github.com/nodejs/node/pull/56483)
-   \[[`6eec5e7ec2`](6eec5e7ec2)] - **src**: lock the thread properly in snapshot builder (Joyee Cheung) [#&#8203;56327](https://github.com/nodejs/node/pull/56327)
-   \[[`5614993968`](5614993968)] - **src**: drain platform tasks before creating startup snapshot (Chengzhong Wu) [#&#8203;56403](https://github.com/nodejs/node/pull/56403)
-   \[[`48493e9fd5`](48493e9fd5)] - **src**: use LocalVector in more places (James M Snell) [#&#8203;56457](https://github.com/nodejs/node/pull/56457)
-   \[[`7e5ea0681e`](7e5ea0681e)] - **src**: use v8::LocalVector consistently with other minor cleanups (James M Snell) [#&#8203;56417](https://github.com/nodejs/node/pull/56417)
-   \[[`ad3d857f2b`](ad3d857f2b)] - **src**: use starts_with in fs_permission.cc (ishabi) [#&#8203;55811](https://github.com/nodejs/node/pull/55811)
-   \[[`5afffb4415`](5afffb4415)] - **(SEMVER-MINOR)** **src,worker**: add isInternalWorker (Carlos Espa) [#&#8203;56469](https://github.com/nodejs/node/pull/56469)
-   \[[`7d1676e72e`](7d1676e72e)] - **stream**: fix typo in ReadableStreamBYOBReader.readIntoRequests (Mattias Buelens) [#&#8203;56560](https://github.com/nodejs/node/pull/56560)
-   \[[`e658ea6b26`](e658ea6b26)] - **stream**: validate undefined sizeAlgorithm in WritableStream (Jason Zhang) [#&#8203;56067](https://github.com/nodejs/node/pull/56067)
-   \[[`e4f133c20c`](e4f133c20c)] - **test**: add ts eval snapshots (Marco Ippolito) [#&#8203;56358](https://github.com/nodejs/node/pull/56358)
-   \[[`f041742400`](f041742400)] - **test**: remove empty lines from snapshots (Marco Ippolito) [#&#8203;56358](https://github.com/nodejs/node/pull/56358)
-   \[[`801cde91f6`](801cde91f6)] - **test**: reduce number of written chunks (Luigi Pinca) [#&#8203;56757](https://github.com/nodejs/node/pull/56757)
-   \[[`6fdf1879ab`](6fdf1879ab)] - **test**: fix invalid common.mustSucceed() usage (Luigi Pinca) [#&#8203;56756](https://github.com/nodejs/node/pull/56756)
-   \[[`d2bfbfa364`](d2bfbfa364)] - **test**: use strict mode in global setters test (Rich Trott) [#&#8203;56742](https://github.com/nodejs/node/pull/56742)
-   \[[`5c030da42f`](5c030da42f)] - **test**: cleanup and simplify test-crypto-aes-wrap (James M Snell) [#&#8203;56748](https://github.com/nodejs/node/pull/56748)
-   \[[`f1442d6eaf`](f1442d6eaf)] - **test**: do not use common.isMainThread (Luigi Pinca) [#&#8203;56768](https://github.com/nodejs/node/pull/56768)
-   \[[`49405bd9e7`](49405bd9e7)] - **test**: make some requires lazy in common/index (James M Snell) [#&#8203;56715](https://github.com/nodejs/node/pull/56715)
-   \[[`52ef376788`](52ef376788)] - **test**: add test that uses multibyte for path and resolves modules (yamachu) [#&#8203;56696](https://github.com/nodejs/node/pull/56696)
-   \[[`b811dea85a`](b811dea85a)] - **test**: replace more uses of `global` with `globalThis` (James M Snell) [#&#8203;56712](https://github.com/nodejs/node/pull/56712)
-   \[[`eb97076199`](eb97076199)] - **test**: make common/index slightly less node.js specific (James M Snell) [#&#8203;56712](https://github.com/nodejs/node/pull/56712)
-   \[[`1795202d19`](1795202d19)] - **test**: rely less on duplicative common test harness utilities (James M Snell) [#&#8203;56712](https://github.com/nodejs/node/pull/56712)
-   \[[`5be29a274e`](5be29a274e)] - **test**: simplify common/index.js (James M Snell) [#&#8203;56712](https://github.com/nodejs/node/pull/56712)
-   \[[`92e99780f0`](92e99780f0)] - **test**: move hasMultiLocalhost to common/net (James M Snell) [#&#8203;56716](https://github.com/nodejs/node/pull/56716)
-   \[[`1c3204a4cc`](1c3204a4cc)] - **test**: move crypto related common utilities in common/crypto (James M Snell) [#&#8203;56714](https://github.com/nodejs/node/pull/56714)
-   \[[`fe79d63be0`](fe79d63be0)] - **test**: add missing test for env file (Jonas) [#&#8203;56642](https://github.com/nodejs/node/pull/56642)
-   \[[`e08af61537`](e08af61537)] - **test**: enforce strict mode in test-zlib-const (Rich Trott) [#&#8203;56689](https://github.com/nodejs/node/pull/56689)
-   \[[`c96792d7f8`](c96792d7f8)] - **test**: fix localization data for ICU 74.2 (Antoine du Hamel) [#&#8203;56661](https://github.com/nodejs/node/pull/56661)
-   \[[`48b72f1195`](48b72f1195)] - **test**: use --permission instead of --experimental-permission (Rafael Gonzaga) [#&#8203;56685](https://github.com/nodejs/node/pull/56685)
-   \[[`de81d90fce`](de81d90fce)] - **test**: test-stream-compose.js doesn't need internals (Meghan Denny) [#&#8203;56619](https://github.com/nodejs/node/pull/56619)
-   \[[`f5b8499ad0`](f5b8499ad0)] - **test**: add maxCount and gcOptions to gcUntil() (Joyee Cheung) [#&#8203;56522](https://github.com/nodejs/node/pull/56522)
-   \[[`d9e5a81041`](d9e5a81041)] - **test**: add line break at end of file (Rafael Gonzaga) [#&#8203;56588](https://github.com/nodejs/node/pull/56588)
-   \[[`59be346fbf`](59be346fbf)] - **test**: mark test-worker-prof as flaky on smartos (Joyee Cheung) [#&#8203;56583](https://github.com/nodejs/node/pull/56583)
-   \[[`12a2cae9e5`](12a2cae9e5)] - **test**: update test-child-process-bad-stdio to use node:test (Colin Ihrig) [#&#8203;56562](https://github.com/nodejs/node/pull/56562)
-   \[[`2dc4a30e19`](2dc4a30e19)] - **test**: disable openssl 3.4.0 incompatible tests (Jelle van der Waa) [#&#8203;56160](https://github.com/nodejs/node/pull/56160)
-   \[[`1950fbf51d`](1950fbf51d)] - **test**: make test-crypto-hash compatible with OpenSSL > 3.4.0 (Jelle van der Waa) [#&#8203;56160](https://github.com/nodejs/node/pull/56160)
-   \[[`a533420a91`](a533420a91)] - **test**: clarify fork inherit permission flags (Rafael Gonzaga) [#&#8203;56523](https://github.com/nodejs/node/pull/56523)
-   \[[`697e799dc1`](697e799dc1)] - **test**: add error only reporter for node:test (Carlos Espa) [#&#8203;56438](https://github.com/nodejs/node/pull/56438)
-   \[[`4844fa212d`](4844fa212d)] - **test**: mark test-http-server-request-timeouts-mixed as flaky (Joyee Cheung) [#&#8203;56503](https://github.com/nodejs/node/pull/56503)
-   \[[`843c2389b9`](843c2389b9)] - **test**: update error code in tls-psk-circuit for for OpenSSL 3.4 (sebastianas) [#&#8203;56420](https://github.com/nodejs/node/pull/56420)
-   \[[`ccb2ddbd83`](ccb2ddbd83)] - **test**: update compiled sqlite tests to match other tests (Colin Ihrig) [#&#8203;56446](https://github.com/nodejs/node/pull/56446)
-   \[[`b40f50324d`](b40f50324d)] - **test**: add initial test426 coverage (Chengzhong Wu) [#&#8203;56436](https://github.com/nodejs/node/pull/56436)
-   \[[`059f81e4fd`](059f81e4fd)] - **test**: update test-set-http-max-http-headers to use node:test (Colin Ihrig) [#&#8203;56439](https://github.com/nodejs/node/pull/56439)
-   \[[`ec2940b418`](ec2940b418)] - **test**: update test-child-process-windows-hide to use node:test (Colin Ihrig) [#&#8203;56437](https://github.com/nodejs/node/pull/56437)
-   \[[`0362924880`](0362924880)] - **test**: use unusual chars in the path to ensure our tests are robust (Antoine du Hamel) [#&#8203;48409](https://github.com/nodejs/node/pull/48409)
-   \[[`b6c3869910`](b6c3869910)] - **test**: improve abort signal dropping test (Edy Silva) [#&#8203;56339](https://github.com/nodejs/node/pull/56339)
-   \[[`cc648ef923`](cc648ef923)] - **test**: enable ts test on win arm64 (Marco Ippolito) [#&#8203;56349](https://github.com/nodejs/node/pull/56349)
-   \[[`68819b4997`](68819b4997)] - **test**: deflake test-watch-file-shared-dependency (Luigi Pinca) [#&#8203;56344](https://github.com/nodejs/node/pull/56344)
-   \[[`ca6ed2190c`](ca6ed2190c)] - **test**: skip `test-sqlite-extensions` when SQLite is not built by us (Antoine du Hamel) [#&#8203;56341](https://github.com/nodejs/node/pull/56341)
-   \[[`8ffeb8b58c`](8ffeb8b58c)] - **test**: increase spin for eventloop test on s390 (Michael Dawson) [#&#8203;56228](https://github.com/nodejs/node/pull/56228)
-   \[[`6ae9950f08`](6ae9950f08)] - **test**: migrate message eval tests from Python to JS (Yiyun Lei) [#&#8203;50482](https://github.com/nodejs/node/pull/50482)
-   \[[`4352bf69e9`](4352bf69e9)] - **test**: check typescript loader (Marco Ippolito) [#&#8203;54657](https://github.com/nodejs/node/pull/54657)
-   \[[`406e7db9c3`](406e7db9c3)] - **test**: remove async-hooks/test-writewrap flaky designation (Luigi Pinca) [#&#8203;56048](https://github.com/nodejs/node/pull/56048)
-   \[[`fa56ab2bba`](fa56ab2bba)] - **test**: deflake test-esm-loader-hooks-inspect-brk (Luigi Pinca) [#&#8203;56050](https://github.com/nodejs/node/pull/56050)
-   \[[`8e149aac99`](8e149aac99)] - **test**: add test case for listeners (origranot) [#&#8203;56282](https://github.com/nodejs/node/pull/56282)
-   \[[`a3f5ef22cd`](a3f5ef22cd)] - **test**: make `test-permission-sqlite-load-extension` more robust (Antoine du Hamel) [#&#8203;56295](https://github.com/nodejs/node/pull/56295)
-   \[[`8cbb7cc838`](8cbb7cc838)] - **test_runner**: print failing assertion only once with spec reporter (Pietro Marchini) [#&#8203;56662](https://github.com/nodejs/node/pull/56662)
-   \[[`1f426bad9a`](1f426bad9a)] - **test_runner**: remove unused errors (Pietro Marchini) [#&#8203;56607](https://github.com/nodejs/node/pull/56607)
-   \[[`697a851fb3`](697a851fb3)] - **(SEMVER-MINOR)** **test_runner**: add TestContext.prototype.waitFor() (Colin Ihrig) [#&#8203;56595](https://github.com/nodejs/node/pull/56595)
-   \[[`047537b48c`](047537b48c)] - **(SEMVER-MINOR)** **test_runner**: add t.assert.fileSnapshot() (Colin Ihrig) [#&#8203;56459](https://github.com/nodejs/node/pull/56459)
-   \[[`19b4aa4b14`](19b4aa4b14)] - **test_runner**: run single test file benchmark (Pietro Marchini) [#&#8203;56479](https://github.com/nodejs/node/pull/56479)
-   \[[`926cf84e95`](926cf84e95)] - **(SEMVER-MINOR)** **test_runner**: add assert.register() API (Colin Ihrig) [#&#8203;56434](https://github.com/nodejs/node/pull/56434)
-   \[[`fb4661a4cf`](fb4661a4cf)] - **test_runner**: finish marking snapshot testing as stable (Colin Ihrig) [#&#8203;56425](https://github.com/nodejs/node/pull/56425)
-   \[[`900c6c3940`](900c6c3940)] - **tls**: fix error stack conversion in cryptoErrorListToException() (Joyee Cheung) [#&#8203;56554](https://github.com/nodejs/node/pull/56554)
-   \[[`e9f185b658`](e9f185b658)] - **tools**: update doc to new version (Node.js GitHub Bot) [#&#8203;56259](https://github.com/nodejs/node/pull/56259)
-   \[[`7644c7e619`](7644c7e619)] - **tools**: update inspector_protocol roller (Chengzhong Wu) [#&#8203;56649](https://github.com/nodejs/node/pull/56649)
-   \[[`362272b0a4`](362272b0a4)] - **tools**: do not throw on missing `create-release-proposal.sh` (Antoine du Hamel) [#&#8203;56704](https://github.com/nodejs/node/pull/56704)
-   \[[`df8b835953`](df8b835953)] - **tools**: fix tools-deps-update (Daniel Lemire) [#&#8203;56684](https://github.com/nodejs/node/pull/56684)
-   \[[`feba5d3274`](feba5d3274)] - **tools**: do not throw on missing `create-release-proposal.sh` (Antoine du Hamel) [#&#8203;56695](https://github.com/nodejs/node/pull/56695)
-   \[[`9827f7d395`](9827f7d395)] - **tools**: fix permissions in `lint-release-proposal` workflow (Antoine du Hamel) [#&#8203;56614](https://github.com/nodejs/node/pull/56614)
-   \[[`14c562c0dc`](14c562c0dc)] - **tools**: remove github reporter (Carlos Espa) [#&#8203;56468](https://github.com/nodejs/node/pull/56468)
-   \[[`ed1785d0ae`](ed1785d0ae)] - **tools**: edit `create-release-proposal` workflow (Antoine du Hamel) [#&#8203;56540](https://github.com/nodejs/node/pull/56540)
-   \[[`294e4c42f5`](294e4c42f5)] - **tools**: validate commit list as part of `lint-release-commit` (Antoine du Hamel) [#&#8203;56291](https://github.com/nodejs/node/pull/56291)
-   \[[`98d3474267`](98d3474267)] - **tools**: fix loong64 build failed (Xiao-Tao) [#&#8203;56466](https://github.com/nodejs/node/pull/56466)
-   \[[`3e729ceec8`](3e729ceec8)] - **tools**: disable unneeded rule ignoring in Python linting (Rich Trott) [#&#8203;56429](https://github.com/nodejs/node/pull/56429)
-   \[[`d5c05328e2`](d5c05328e2)] - **tools**: use a configurable value for number of open dependabot PRs (Antoine du Hamel) [#&#8203;56427](https://github.com/nodejs/node/pull/56427)
-   \[[`1705cbe002`](1705cbe002)] - **tools**: bump the eslint group in /tools/eslint with 4 updates (dependabot\[bot]) [#&#8203;56426](https://github.com/nodejs/node/pull/56426)
-   \[[`53b29b0469`](53b29b0469)] - **tools**: fix `require-common-first` lint rule from subfolder (Antoine du Hamel) [#&#8203;56325](https://github.com/nodejs/node/pull/56325)
-   \[[`105c4ed4fb`](105c4ed4fb)] - **tools**: add release line label when opening release proposal (Antoine du Hamel) [#&#8203;56317](https://github.com/nodejs/node/pull/56317)
-   \[[`30f61f4aa5`](30f61f4aa5)] - **url**: use resolved path to convert UNC paths to URL (Antoine du Hamel) [#&#8203;56302](https://github.com/nodejs/node/pull/56302)
-   \[[`a0aef4dfb6`](a0aef4dfb6)] - **util**: inspect: do not crash on an Error stack that contains a Symbol (Jordan Harband) [#&#8203;56573](https://github.com/nodejs/node/pull/56573)
-   \[[`a8a060341f`](a8a060341f)] - **util**: inspect: do not crash on an Error with a regex `name` (Jordan Harband) [#&#8203;56574](https://github.com/nodejs/node/pull/56574)
-   \[[`ea66bf3553`](ea66bf3553)] - **util**: rename CallSite.column to columnNumber (Chengzhong Wu) [#&#8203;56584](https://github.com/nodejs/node/pull/56584)
-   \[[`9cdc3b373c`](9cdc3b373c)] - **util**: do not crash on inspecting function with `Symbol` name (Jordan Harband) [#&#8203;56572](https://github.com/nodejs/node/pull/56572)
-   \[[`0bfbb68569`](0bfbb68569)] - **util**: expose CallSite.scriptId (Chengzhong Wu) [#&#8203;56551](https://github.com/nodejs/node/pull/56551)
-   \[[`5dd7116e09`](5dd7116e09)] - **watch**: reload env file for --env-file-if-exists (Jonas) [#&#8203;56643](https://github.com/nodejs/node/pull/56643)
-   \[[`c658a8afdf`](c658a8afdf)] - **(SEMVER-MINOR)** **worker**: add eval ts input (Marco Ippolito) [#&#8203;56394](https://github.com/nodejs/node/pull/56394)
-   \[[`2e5d038f48`](2e5d038f48)] - **worker**: refactor stdio to improve performance (Matteo Collina) [#&#8203;56630](https://github.com/nodejs/node/pull/56630)
-   \[[`f959805d01`](f959805d01)] - **worker**: flush stdout and stderr on exit (Matteo Collina) [#&#8203;56428](https://github.com/nodejs/node/pull/56428)

### [`v22.13.1`](https://github.com/nodejs/node/releases/tag/v22.13.1): 2025-01-21, Version 22.13.1 &#x27;Jod&#x27; (LTS), @&#8203;RafaelGSS

[Compare Source](https://github.com/nodejs/node/compare/v22.13.0...v22.13.1)

This is a security release.

##### Notable Changes

-   CVE-2025-23083 - src,loader,permission: throw on InternalWorker use when permission model is enabled (High)
-   CVE-2025-23085 - src: fix HTTP2 mem leak on premature close and ERR_PROTO (Medium)
-   CVE-2025-23084 - path: fix path traversal in normalize() on Windows (Medium)

Dependency update:

-   CVE-2025-22150 - Use of Insufficiently Random Values in undici fetch() (Medium)

##### Commits

-   \[[`520da342e0`](520da342e0)] - **(CVE-2025-22150)** **deps**: update undici to v6.21.1 (Matteo Collina) [nodejs-private/node-private#662](https://github.com/nodejs-private/node-private/pull/662)
-   \[[`99f217369f`](99f217369f)] - **(CVE-2025-23084)** **path**: fix path traversal in normalize() on Windows (Tobias Nießen) [nodejs-private/node-private#555](https://github.com/nodejs-private/node-private/pull/555)
-   \[[`984f735e35`](984f735e35)] - **(CVE-2025-23085)** **src**: fix HTTP2 mem leak on premature close and ERR_PROTO (RafaelGSS) [nodejs-private/node-private#650](https://github.com/nodejs-private/node-private/pull/650)
-   \[[`2446870618`](2446870618)] - **(CVE-2025-23083)** **src,loader,permission**: throw on InternalWorker use (RafaelGSS) [nodejs-private/node-private#651](https://github.com/nodejs-private/node-private/pull/651)

### [`v22.13.0`](https://github.com/nodejs/node/releases/tag/v22.13.0): 2025-01-07, Version 22.13.0 &#x27;Jod&#x27; (LTS), @&#8203;ruyadorno

[Compare Source](https://github.com/nodejs/node/compare/v22.12.0...v22.13.0)

##### Notable Changes

##### Stabilize Permission Model

Upgrades the Permission Model status from Active Development to Stable.

Contributed by Rafael Gonzaga [#&#8203;56201](https://github.com/nodejs/node/pull/56201)

##### Graduate WebCryptoAPI [`Ed25519`](https://github.com/nodejs/node/commit/Ed25519) and X25519 algorithms as stable

Following the merge of Curve25519 into the [Web Cryptography API Editor's Draft](https://w3c.github.io/webcrypto/) the `Ed25519` and `X25519` algorithm identifiers are now stable and will no longer emit an ExperimentalWarning upon use.

Contributed by (Filip Skokan) [#&#8203;56142](https://github.com/nodejs/node/pull/56142)

##### Other Notable Changes

-   \[[`05d6227a88`](05d6227a88)] - **(SEMVER-MINOR)** **assert**: add partialDeepStrictEqual (Giovanni Bucci) [#&#8203;54630](https://github.com/nodejs/node/pull/54630)
-   \[[`a933103499`](a933103499)] - **(SEMVER-MINOR)** **cli**: implement --trace-env and --trace-env-\[js|native]-stack (Joyee Cheung) [#&#8203;55604](https://github.com/nodejs/node/pull/55604)
-   \[[`ba9d5397de`](ba9d5397de)] - **(SEMVER-MINOR)** **dgram**: support blocklist in udp (theanarkh) [#&#8203;56087](https://github.com/nodejs/node/pull/56087)
-   \[[`f6d0c01303`](f6d0c01303)] - **doc**: stabilize util.styleText (Rafael Gonzaga) [#&#8203;56265](https://github.com/nodejs/node/pull/56265)
-   \[[`34c68827af`](34c68827af)] - **doc**: move typescript support to active development (Marco Ippolito) [#&#8203;55536](https://github.com/nodejs/node/pull/55536)
-   \[[`dd14b80350`](dd14b80350)] - **doc**: add LJHarb to collaborators (Jordan Harband) [#&#8203;56132](https://github.com/nodejs/node/pull/56132)
-   \[[`5263086169`](5263086169)] - **(SEMVER-MINOR)** **doc**: add report version and history section (Chengzhong Wu) [#&#8203;56130](https://github.com/nodejs/node/pull/56130)
-   \[[`8cb3c2018d`](8cb3c2018d)] - **(SEMVER-MINOR)** **doc**: sort --report-exclude alphabetically (Rafael Gonzaga) [#&#8203;55788](https://github.com/nodejs/node/pull/55788)
-   \[[`55239a48b6`](55239a48b6)] - **(SEMVER-MINOR)** **doc,lib,src,test**: unflag sqlite module (Colin Ihrig) [#&#8203;55890](https://github.com/nodejs/node/pull/55890)
-   \[[`7cbe3de1d8`](7cbe3de1d8)] - **(SEMVER-MINOR)** **module**: only emit require(esm) warning under --trace-require-module (Joyee Cheung) [#&#8203;56194](https://github.com/nodejs/node/pull/56194)
-   \[[`6575b76042`](6575b76042)] - **(SEMVER-MINOR)** **module**: add module.stripTypeScriptTypes (Marco Ippolito) [#&#8203;55282](https://github.com/nodejs/node/pull/55282)
-   \[[`bacfe6d5c9`](bacfe6d5c9)] - **(SEMVER-MINOR)** **net**: support blocklist in net.connect (theanarkh) [#&#8203;56075](https://github.com/nodejs/node/pull/56075)
-   \[[`b47888d390`](b47888d390)] - **(SEMVER-MINOR)** **net**: support blocklist for net.Server (theanarkh) [#&#8203;56079](https://github.com/nodejs/node/pull/56079)
-   \[[`566f0a1d25`](566f0a1d25)] - **(SEMVER-MINOR)** **net**: add SocketAddress.parse (James M Snell) [#&#8203;56076](https://github.com/nodejs/node/pull/56076)
-   \[[`ed7eab1421`](ed7eab1421)] - **(SEMVER-MINOR)** **net**: add net.BlockList.isBlockList(value) (James M Snell) [#&#8203;56078](https://github.com/nodejs/node/pull/56078)
-   \[[`ea4891856d`](ea4891856d)] - **(SEMVER-MINOR)** **process**: deprecate `features.{ipv6,uv}` and `features.tls_*` (René) [#&#8203;55545](https://github.com/nodejs/node/pull/55545)
-   \[[`01eb308f26`](01eb308f26)] - **(SEMVER-MINOR)** **report**: fix typos in report keys and bump the version (Yuan-Ming Hsu) [#&#8203;56068](https://github.com/nodejs/node/pull/56068)
-   \[[`97c38352d0`](97c38352d0)] - **(SEMVER-MINOR)** **sqlite**: aggregate constants in a single property (Edigleysson Silva (Edy)) [#&#8203;56213](https://github.com/nodejs/node/pull/56213)
-   \[[`b4041e554a`](b4041e554a)] - **(SEMVER-MINOR)** **sqlite**: add `StatementSync.prototype.iterate` method (tpoisseau) [#&#8203;54213](https://github.com/nodejs/node/pull/54213)
-   \[[`2e3ca1bbdd`](2e3ca1bbdd)] - **(SEMVER-MINOR)** **src**: add cli option to preserve env vars on diagnostic reports (Rafael Gonzaga) [#&#8203;55697](https://github.com/nodejs/node/pull/55697)
-   \[[`bcfe9c80fc`](bcfe9c80fc)] - **(SEMVER-MINOR)** **util**: add sourcemap support to getCallSites (Marco Ippolito) [#&#8203;55589](https://github.com/nodejs/node/pull/55589)

##### Commits

-   \[[`e9024779c0`](e9024779c0)] - **assert**: make Maps be partially compared in partialDeepStrictEqual (Giovanni Bucci) [#&#8203;56195](https://github.com/nodejs/node/pull/56195)
-   \[[`4c13d8e587`](4c13d8e587)] - **assert**: make partialDeepStrictEqual work with ArrayBuffers (Giovanni Bucci) [#&#8203;56098](https://github.com/nodejs/node/pull/56098)
-   \[[`a4fa31a86e`](a4fa31a86e)] - **assert**: optimize partial comparison of two `Set`s (Antoine du Hamel) [#&#8203;55970](https://github.com/nodejs/node/pull/55970)
-   \[[`05d6227a88`](05d6227a88)] - **(SEMVER-MINOR)** **assert**: add partialDeepStrictEqual (Giovanni Bucci) [#&#8203;54630](https://github.com/nodejs/node/pull/54630)
-   \[[`5e1321abd7`](5e1321abd7)] - **buffer**: document concat zero-fill (Duncan) [#&#8203;55562](https://github.com/nodejs/node/pull/55562)
-   \[[`be5ba7c648`](be5ba7c648)] - **build**: set DESTCPU correctly for 'make binary' on loongarch64 (吴小白) [#&#8203;56271](https://github.com/nodejs/node/pull/56271)
-   \[[`38cf37ee2d`](38cf37ee2d)] - **build**: fix missing fp16 dependency in d8 builds (Joyee Cheung) [#&#8203;56266](https://github.com/nodejs/node/pull/56266)
-   \[[`dbb7557455`](dbb7557455)] - **build**: add major release action (Rafael Gonzaga) [#&#8203;56199](https://github.com/nodejs/node/pull/56199)
-   \[[`27cc90f3be`](27cc90f3be)] - **build**: fix C string encoding for `PRODUCT_DIR_ABS` (Anna Henningsen) [#&#8203;56111](https://github.com/nodejs/node/pull/56111)
-   \[[`376561c2b4`](376561c2b4)] - **build**: use variable for simdutf path (Shelley Vohr) [#&#8203;56196](https://github.com/nodejs/node/pull/56196)
-   \[[`126ae15000`](126ae15000)] - **build**: allow overriding clang usage (Shelley Vohr) [#&#8203;56016](https://github.com/nodejs/node/pull/56016)
-   \[[`97bb8f7c76`](97bb8f7c76)] - **build**: remove defaults for create-release-proposal (Rafael Gonzaga) [#&#8203;56042](https://github.com/nodejs/node/pull/56042)
-   \[[`a8fb1a06f3`](a8fb1a06f3)] - **build**: set node_arch to target_cpu in GN (Shelley Vohr) [#&#8203;55967](https://github.com/nodejs/node/pull/55967)
-   \[[`9f48ca27f1`](9f48ca27f1)] - **build**: use variable for crypto dep path (Shelley Vohr) [#&#8203;55928](https://github.com/nodejs/node/pull/55928)
-   \[[`e47ccd2287`](e47ccd2287)] - **build**: fix GN build for sqlite (Cheng) [#&#8203;55912](https://github.com/nodejs/node/pull/55912)
-   \[[`8d70b99a5a`](8d70b99a5a)] - **build**: compile bundled simdutf conditionally (Jakub Jirutka) [#&#8203;55886](https://github.com/nodejs/node/pull/55886)
-   \[[`826fd35242`](826fd35242)] - **build**: compile bundled simdjson conditionally (Jakub Jirutka) [#&#8203;55886](https://github.com/nodejs/node/pull/55886)
-   \[[`1015b22085`](1015b22085)] - **build**: compile bundled ada conditionally (Jakub Jirutka) [#&#8203;55886](https://github.com/nodejs/node/pull/55886)
-   \[[`77e2869ca6`](77e2869ca6)] - **build**: use glob for dependencies of out/Makefile (Richard Lau) [#&#8203;55789](https://github.com/nodejs/node/pull/55789)
-   \[[`a933103499`](a933103499)] - **(SEMVER-MINOR)** **cli**: implement --trace-env and --trace-env-\[js|native]-stack (Joyee Cheung) [#&#8203;55604](https://github.com/nodejs/node/pull/55604)
-   \[[`72e8e0684e`](72e8e0684e)] - **crypto**: graduate WebCryptoAPI [`Ed25519`](https://github.com/nodejs/node/commit/Ed25519) and X25519 algorithms as stable (Filip Skokan) [#&#8203;56142](https://github.com/nodejs/node/pull/56142)
-   \[[`fe2b344ddb`](fe2b344ddb)] - **crypto**: ensure CryptoKey usages and algorithm are cached objects (Filip Skokan) [#&#8203;56108](https://github.com/nodejs/node/pull/56108)
-   \[[`9ee9f524a7`](9ee9f524a7)] - **crypto**: allow non-multiple of 8 in SubtleCrypto.deriveBits (Filip Skokan) [#&#8203;55296](https://github.com/nodejs/node/pull/55296)
-   \[[`76f242d993`](76f242d993)] - **deps**: update nghttp3 to 1.6.0 (Node.js GitHub Bot) [#&#8203;56258](https://github.com/nodejs/node/pull/56258)
-   \[[`c7ff2ea6b5`](c7ff2ea6b5)] - **deps**: update simdutf to 5.6.4 (Node.js GitHub Bot) [#&#8203;56255](https://github.com/nodejs/node/pull/56255)
-   \[[`04230be1ef`](04230be1ef)] - **deps**: update libuv to 1.49.2 (Luigi Pinca) [#&#8203;56224](https://github.com/nodejs/node/pull/56224)
-   \[[`88589b85b7`](88589b85b7)] - **deps**: update c-ares to v1.34.4 (Node.js GitHub Bot) [#&#8203;56256](https://github.com/nodejs/node/pull/56256)
-   \[[`5c2e0618f3`](5c2e0618f3)] - **deps**: define V8\_PRESERVE_MOST as no-op on Windows (Stefan Stojanovic) [#&#8203;56238](https://github.com/nodejs/node/pull/56238)
-   \[[`9f8f3c9658`](9f8f3c9658)] - **deps**: update sqlite to 3.47.2 (Node.js GitHub Bot) [#&#8203;56178](https://github.com/nodejs/node/pull/56178)
-   \[[`17b6931d3b`](17b6931d3b)] - **deps**: update ngtcp2 to 1.9.1 (Node.js GitHub Bot) [#&#8203;56095](https://github.com/nodejs/node/pull/56095)
-   \[[`22b453b619`](22b453b619)] - **deps**: upgrade npm to 10.9.2 (npm team) [#&#8203;56135](https://github.com/nodejs/node/pull/56135)
-   \[[`d7eb41b382`](d7eb41b382)] - **deps**: update sqlite to 3.47.1 (Node.js GitHub Bot) [#&#8203;56094](https://github.com/nodejs/node/pull/56094)
-   \[[`669c722aa9`](669c722aa9)] - **deps**: update zlib to 1.3.0.1-motley-82a5fec (Node.js GitHub Bot) [#&#8203;55980](https://github.com/nodejs/node/pull/55980)
-   \[[`f61a0454d2`](f61a0454d2)] - **deps**: update corepack to 0.30.0 (Node.js GitHub Bot) [#&#8203;55977](https://github.com/nodejs/node/pull/55977)
-   \[[`d98bf0b891`](d98bf0b891)] - **deps**: update ngtcp2 to 1.9.0 (Node.js GitHub Bot) [#&#8203;55975](https://github.com/nodejs/node/pull/55975)
-   \[[`fc362624bf`](fc362624bf)] - **deps**: update simdutf to 5.6.3 (Node.js GitHub Bot) [#&#8203;55973](https://github.com/nodejs/node/pull/55973)
-   \[[`f61dcc4df4`](f61dcc4df4)] - **deps**: upgrade npm to 10.9.1 (npm team) [#&#8203;55951](https://github.com/nodejs/node/pull/55951)
-   \[[`bfe7982491`](bfe7982491)] - **deps**: update zlib to 1.3.0.1-motley-7e2e4d7 (Node.js GitHub Bot) [#&#8203;54432](https://github.com/nodejs/node/pull/54432)
-   \[[`d714367ef8`](d714367ef8)] - **deps**: update simdjson to 3.10.1 (Node.js GitHub Bot) [#&#8203;54678](https://github.com/nodejs/node/pull/54678)
-   \[[`ccc9b105ec`](ccc9b105ec)] - **deps**: update simdutf to 5.6.2 (Node.js GitHub Bot) [#&#8203;55889](https://github.com/nodejs/node/pull/55889)
-   \[[`ba9d5397de`](ba9d5397de)] - **(SEMVER-MINOR)** **dgram**: support blocklist in udp (theanarkh) [#&#8203;56087](https://github.com/nodejs/node/pull/56087)
-   \[[`7ddbf94849`](7ddbf94849)] - **dgram**: check udp buffer size to avoid fd leak (theanarkh) [#&#8203;56084](https://github.com/nodejs/node/pull/56084)
-   \[[`360d68de0f`](360d68de0f)] - **doc**: fix color contrast issue in light mode (Rich Trott) [#&#8203;56272](https://github.com/nodejs/node/pull/56272)
-   \[[`f6d0c01303`](f6d0c01303)] - **doc**: stabilize util.styleText (Rafael Gonzaga) [#&#8203;56265](https://github.com/nodejs/node/pull/56265)
-   \[[`9436c3c949`](9436c3c949)] - **doc**: clarify util.aborted resource usage (Kunal Kumar) [#&#8203;55780](https://github.com/nodejs/node/pull/55780)
-   \[[`b1cec2cef9`](b1cec2cef9)] - **doc**: add esm examples to node:repl (Alfredo González) [#&#8203;55432](https://github.com/nodejs/node/pull/55432)
-   \[[`d6a84cf781`](d6a84cf781)] - **doc**: add esm examples to node:readline (Alfredo González) [#&#8203;55335](https://github.com/nodejs/node/pull/55335)
-   \[[`a11ac1c0f2`](a11ac1c0f2)] - **doc**: fix 'which' to 'that' and add commas (Selveter Senitro) [#&#8203;56216](https://github.com/nodejs/node/pull/56216)
-   \[[`5331df7911`](5331df7911)] - **doc**: fix winget config path (Alex Yang) [#&#8203;56233](https://github.com/nodejs/node/pull/56233)
-   \[[`7a8071b43c`](7a8071b43c)] - **doc**: add esm examples to node:tls (Alfredo González) [#&#8203;56229](https://github.com/nodejs/node/pull/56229)
-   \[[`7d8c1e72d5`](7d8c1e72d5)] - **doc**: add esm examples to node:perf_hooks (Alfredo González) [#&#8203;55257](https://github.com/nodejs/node/pull/55257)
-   \[[`ea53c4b1ae`](ea53c4b1ae)] - **doc**: `sea.getRawAsset(key)` always returns an ArrayBuffer (沈鸿飞) [#&#8203;56206](https://github.com/nodejs/node/pull/56206)
-   \[[`7a94100a3e`](7a94100a3e)] - **doc**: update announce documentation for releases (Rafael Gonzaga) [#&#8203;56200](https://github.com/nodejs/node/pull/56200)
-   \[[`44c4e57e32`](44c4e57e32)] - **doc**: update blog link to /vulnerability (Rafael Gonzaga) [#&#8203;56198](https://github.com/nodejs/node/pull/56198)
-   \[[`5e5b4b0cbd`](5e5b4b0cbd)] - **doc**: call out import.meta is only supported in ES modules (Anton Kastritskii) [#&#8203;56186](https://github.com/nodejs/node/pull/56186)
-   \[[`a83de32d35`](a83de32d35)] - **doc**: add ambassador message - benefits of Node.js (Michael Dawson) [#&#8203;56085](https://github.com/nodejs/node/pull/56085)
-   \[[`bb880dd21a`](bb880dd21a)] - **doc**: fix incorrect link to style guide (Yuan-Ming Hsu) [#&#8203;56181](https://github.com/nodejs/node/pull/56181)
-   \[[`39ce902e58`](39ce902e58)] - **doc**: fix c++ addon hello world sample (Edigleysson Silva (Edy)) [#&#8203;56172](https://github.com/nodejs/node/pull/56172)
-   \[[`19c72c4acc`](19c72c4acc)] - **doc**: update blog release-post link (Ruy Adorno) [#&#8203;56123](https://github.com/nodejs/node/pull/56123)
-   \[[`b667cc4669`](b667cc4669)] - **doc**: fix module.md headings (Chengzhong Wu) [#&#8203;56131](https://github.com/nodejs/node/pull/56131)
-   \[[`34c68827af`](34c68827af)] - **doc**: move typescript support to active development (Marco Ippolito) [#&#8203;55536](https://github.com/nodejs/node/pull/55536)
-   \[[`c4a97d810b`](c4a97d810b)] - **doc**: mention `-a` flag for the release script (Ruy Adorno) [#&#8203;56124](https://github.com/nodejs/node/pull/56124)
-   \[[`dd14b80350`](dd14b80350)] - **doc**: add LJHarb to collaborators (Jordan Harband) [#&#8203;56132](https://github.com/nodejs/node/pull/56132)
-   \[[`2feb0781ed`](2feb0781ed)] - **doc**: add create-release-action to process (Rafael Gonzaga) [#&#8203;55993](https://github.com/nodejs/node/pull/55993)
-   \[[`71f6263942`](71f6263942)] - **doc**: rename file to advocacy-ambassador-program.md (Tobias Nießen) [#&#8203;56046](https://github.com/nodejs/node/pull/56046)
-   \[[`8efa240500`](8efa240500)] - **doc**: remove unused import from sample code (Blended Bram) [#&#8203;55570](https://github.com/nodejs/node/pull/55570)
-   \[[`e64cef8bf4`](e64cef8bf4)] - **doc**: add FAQ to releases section (Rafael Gonzaga) [#&#8203;55992](https://github.com/nodejs/node/pull/55992)
-   \[[`4bb0f30f92`](4bb0f30f92)] - **doc**: move history entry to class description (Luigi Pinca) [#&#8203;55991](https://github.com/nodejs/node/pull/55991)
-   \[[`6d02bd6873`](6d02bd6873)] - **doc**: add history entry for textEncoder.encodeInto() (Luigi Pinca) [#&#8203;55990](https://github.com/nodejs/node/pull/55990)
-   \[[`e239382ed8`](e239382ed8)] - **doc**: improve GN build documentation a bit (Shelley Vohr) [#&#8203;55968](https://github.com/nodejs/node/pull/55968)
-   \[[`78b6aef6bc`](htt

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7545
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-15 08:36:10 +00:00
Earl Warren
1b11ca6f36 fix: match PackageBlob.HashBlake2b definition and migration (#7543)
If not a migration will show a warning:

`[W] Table public.package_blob column hash_blake2b db type is VARCHAR(255), struct type is CHAR(128)`

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7543
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-15 07:05:21 +00:00
tacaly
6d703bb6e3 fix(UI): i18n: improve naming (#7539)
## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).
  - [x] I will test the UI with a screenshot. And attach it in a comment when test has passed.

### Documentation

- [x] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
https://codeberg.org/forgejo/docs/pulls/1145

- [ ] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

### Reason for the PR?

The reason is to correct the naming of the lang in the UI. It was discussed in the matrix chat and requested by @0ko.
https://matrix.to/#/!UJgSZwuZLRYXEOyjPb:matrix.org/$TbMlNm9L1P9gHFwJYZ3vTIPBKtUHyaoQVEDdzfTQIxI?via=matrix.org&via=envs.net&via=mozilla.org

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7539
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-committed-by: tacaly <frederick@tacaly.com>
2025-04-15 05:48:19 +00:00
TheFox0x7
504bb09319 fix github migration error when using multiple tokens (#34144)
Git authorization was not taking into account multiple token feature,
leading to auth failures

Closes: https://github.com/go-gitea/gitea/issues/34141

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 8a6df00c532becd4d10efb70827ccf80b2bf74e2)
2025-04-14 16:21:28 +02:00
hiifong
82dd00873d fix webhook url (#34186)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit aada0370e7d72a591d58788f6db76bdbc3dddbb7)
2025-04-14 16:10:20 +02:00
Kerwin Bryant
9144726e4f Update milestones.tmpl (#34184)
(cherry picked from commit 5015992db578659a47b9a0949f1773ebac2b2b4b)
2025-04-14 16:03:04 +02:00
ManInDark
23b713464c bugfix check for alternate ssh host certificate location (#34146)
fixes #34145

Edited all locations to actually be correct.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit fac6b87dd24be5021d9c656edc2072397cfd6bed)
2025-04-14 15:53:35 +02:00
wxiaoguang
89e4144855 Set MERMAID_MAX_SOURCE_CHARACTERS to 50000 (#34152)
Fix #32015

(cherry picked from commit f8edc29f5dd1a99e3be1a2ff764d1d7315862345)
2025-04-14 15:47:37 +02:00
Renovate Bot
8665bbc085 Update renovate to v39.240.1 (forgejo) (#7532)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [data.forgejo.org/renovate/renovate](https://renovatebot.com) ([source](https://github.com/renovatebot/renovate)) | container | minor | `39.233.5` -> `39.240.1` |
| [renovate](https://renovatebot.com) ([source](https://github.com/renovatebot/renovate)) |  | minor | `39.233.5` -> `39.240.1` |

---

### Release Notes

<details>
<summary>renovatebot/renovate (data.forgejo.org/renovate/renovate)</summary>

### [`v39.240.1`](https://github.com/renovatebot/renovate/releases/tag/39.240.1)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.240.0...39.240.1)

##### Build System

-   **deps:** update dependency cronstrue to v2.58.0 (main) ([#&#8203;35346](https://github.com/renovatebot/renovate/issues/35346)) ([7da63b4](7da63b485a))

### [`v39.240.0`](https://github.com/renovatebot/renovate/releases/tag/39.240.0)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.238.2...39.240.0)

##### Features

-   **datasource/azure-pipelines-tasks:** add built-in tasks changelog url ([#&#8203;35325](https://github.com/renovatebot/renovate/issues/35325)) ([5091b14](5091b14184))

##### Miscellaneous Chores

-   **deps:** update dependency [@&#8203;types/better-sqlite3](https://github.com/types/better-sqlite3) to v7.6.13 (main) ([#&#8203;35333](https://github.com/renovatebot/renovate/issues/35333)) ([05b3fc0](05b3fc0e25))
-   **deps:** update dependency renovatebot/github-action to v41.0.19 (main) ([#&#8203;35337](https://github.com/renovatebot/renovate/issues/35337)) ([479886f](479886f676))
-   **deps:** update dependency typescript to v5.8.3 (main) ([#&#8203;35336](https://github.com/renovatebot/renovate/issues/35336)) ([abe1f18](abe1f185cb))
-   **deps:** update dependency vitest-mock-extended to v3.1.0 (main) ([#&#8203;35334](https://github.com/renovatebot/renovate/issues/35334)) ([680e161](680e161030))

### [`v39.238.2`](https://github.com/renovatebot/renovate/releases/tag/39.238.2)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.238.1...39.238.2)

##### Bug Fixes

-   **workers/auto-replace:** correctly handle prefix replacements ([#&#8203;35265](https://github.com/renovatebot/renovate/issues/35265)) ([afd6415](afd6415ad8))

##### Miscellaneous Chores

-   **deps:** update dependency [@&#8203;types/luxon](https://github.com/types/luxon) to v3.6.1 (main) ([#&#8203;35313](https://github.com/renovatebot/renovate/issues/35313)) ([05ebbf3](05ebbf3b79))
-   **deps:** update dependency [@&#8203;types/luxon](https://github.com/types/luxon) to v3.6.2 (main) ([#&#8203;35319](https://github.com/renovatebot/renovate/issues/35319)) ([790d0ea](790d0ea50d))
-   **deps:** update dependency [@&#8203;types/node](https://github.com/types/node) to v22.14.0 (main) ([#&#8203;35295](https://github.com/renovatebot/renovate/issues/35295)) ([2188ebb](2188ebb98f))
-   **deps:** update dependency [@&#8203;vitest/eslint-plugin](https://github.com/vitest/eslint-plugin) to v1.1.39 (main) ([#&#8203;35293](https://github.com/renovatebot/renovate/issues/35293)) ([043d665](043d665677))
-   **deps:** update dependency type-fest to v4.39.1 (main) ([#&#8203;35302](https://github.com/renovatebot/renovate/issues/35302)) ([21e1e6f](21e1e6f9cd))

##### Code Refactoring

-   **gerrit:** remove deprecated source branch as hashtags support ([#&#8203;33329](https://github.com/renovatebot/renovate/issues/33329)) ([e64ca6b](e64ca6b852))

### [`v39.238.1`](https://github.com/renovatebot/renovate/releases/tag/39.238.1)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.238.0...39.238.1)

##### Bug Fixes

-   **deps:** update ghcr.io/containerbase/sidecar docker tag to v13.8.13 (main) ([#&#8203;35289](https://github.com/renovatebot/renovate/issues/35289)) ([25eafdb](25eafdb379))

##### Miscellaneous Chores

-   **deps:** update ghcr.io/containerbase/devcontainer docker tag to v13.8.13 (main) ([#&#8203;35288](https://github.com/renovatebot/renovate/issues/35288)) ([e0b85f3](e0b85f3b38))

### [`v39.238.0`](https://github.com/renovatebot/renovate/releases/tag/39.238.0)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.237.0...39.238.0)

##### Features

-   **datasource/github-runners:** mark Windows Server 2025 as stable ([#&#8203;35284](https://github.com/renovatebot/renovate/issues/35284)) ([ad5c45f](ad5c45f437))

### [`v39.237.0`](https://github.com/renovatebot/renovate/releases/tag/39.237.0)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.236.2...39.237.0)

##### Features

-   **bitbucket-server:** add support for changelogs ([#&#8203;34569](https://github.com/renovatebot/renovate/issues/34569)) ([68a66a0](68a66a05a9))

### [`v39.236.2`](https://github.com/renovatebot/renovate/releases/tag/39.236.2)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.236.1...39.236.2)

##### Bug Fixes

-   **deps:** update ghcr.io/containerbase/sidecar docker tag to v13.8.12 (main) ([#&#8203;35279](https://github.com/renovatebot/renovate/issues/35279)) ([702f18f](702f18f6a5))

### [`v39.236.1`](https://github.com/renovatebot/renovate/releases/tag/39.236.1)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.236.0...39.236.1)

##### Bug Fixes

-   **tool/pixi:** remove `v` prefix from raw version ([#&#8203;35277](https://github.com/renovatebot/renovate/issues/35277)) ([e938454](e938454903))

##### Miscellaneous Chores

-   **deps:** update dependency pdm to v2.23.1 (main) ([#&#8203;35275](https://github.com/renovatebot/renovate/issues/35275)) ([78ecd13](78ecd13a8c))
-   **deps:** update ghcr.io/containerbase/devcontainer docker tag to v13.8.12 (main) ([#&#8203;35278](https://github.com/renovatebot/renovate/issues/35278)) ([84454cf](84454cfd62))

### [`v39.236.0`](https://github.com/renovatebot/renovate/releases/tag/39.236.0)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.235.4...39.236.0)

##### Features

-   **conan:** Add support for lockfile maintenance ([#&#8203;28174](https://github.com/renovatebot/renovate/issues/28174)) ([564ee83](564ee83fb7))

### [`v39.235.4`](https://github.com/renovatebot/renovate/releases/tag/39.235.4)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.235.3...39.235.4)

##### Bug Fixes

-   **changelogs:** support massaging self-hosted gitlab URLs ([#&#8203;35258](https://github.com/renovatebot/renovate/issues/35258)) ([8a93407](8a93407a78))

##### Miscellaneous Chores

-   **deps:** update dependency [@&#8203;types/node](https://github.com/types/node) to v22.13.17 (main) ([#&#8203;35263](https://github.com/renovatebot/renovate/issues/35263)) ([12ea7e1](12ea7e1474))

### [`v39.235.3`](https://github.com/renovatebot/renovate/releases/tag/39.235.3)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.235.2...39.235.3)

##### Bug Fixes

-   **deps:** update ghcr.io/containerbase/sidecar docker tag to v13.8.11 (main) ([#&#8203;35260](https://github.com/renovatebot/renovate/issues/35260)) ([e4eefde](e4eefde273))

##### Miscellaneous Chores

-   **deps:** update dependency [@&#8203;types/luxon](https://github.com/types/luxon) to v3.6.0 (main) ([#&#8203;35236](https://github.com/renovatebot/renovate/issues/35236)) ([3619702](361970298b))
-   **deps:** update dependency [@&#8203;types/node](https://github.com/types/node) to v22.13.15 (main) ([#&#8203;35237](https://github.com/renovatebot/renovate/issues/35237)) ([6fbcdb3](6fbcdb3c09))
-   **deps:** update dependency [@&#8203;types/node](https://github.com/types/node) to v22.13.16 (main) ([#&#8203;35246](https://github.com/renovatebot/renovate/issues/35246)) ([781a9cf](781a9cf331))
-   **deps:** update dependency pnpm to v10.7.1 (main) ([#&#8203;35249](https://github.com/renovatebot/renovate/issues/35249)) ([b88a306](b88a3068a3))
-   **deps:** update dependency type-fest to v4.39.0 (main) ([#&#8203;35250](https://github.com/renovatebot/renovate/issues/35250)) ([d4da4a1](d4da4a1055))
-   **deps:** update ghcr.io/containerbase/devcontainer docker tag to v13.8.11 (main) ([#&#8203;35259](https://github.com/renovatebot/renovate/issues/35259)) ([f6f5f4e](f6f5f4e912))
-   **deps:** update github/codeql-action action to v3.28.15 (main) ([#&#8203;35235](https://github.com/renovatebot/renovate/issues/35235)) ([1de6ec9](1de6ec9a39))
-   **deps:** update python:3.13 docker digest to [`18ecbd0`](18ecbd0) (main) ([#&#8203;35243](https://github.com/renovatebot/renovate/issues/35243)) ([1b6f9df](1b6f9dfa5a))
-   **deps:** update python:3.13 docker digest to [`aaf6d3c`](aaf6d3c) (main) ([#&#8203;35247](https://github.com/renovatebot/renovate/issues/35247)) ([e9ba9fc](e9ba9fc2e3))
-   **deps:** update vitest monorepo to v3.1.1 (main) ([#&#8203;35221](https://github.com/renovatebot/renovate/issues/35221)) ([558809f](558809f1aa))

##### Code Refactoring

-   **circleci:** Simplify CircleCI extraction ([#&#8203;35233](https://github.com/renovatebot/renovate/issues/35233)) ([8c00b15](8c00b15ffc))

### [`v39.235.2`](https://github.com/renovatebot/renovate/releases/tag/39.235.2)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.235.1...39.235.2)

##### Build System

-   **deps:** update dependency [@&#8203;renovatebot/osv-offline](https://github.com/renovatebot/osv-offline) to v1.6.5 (main) ([#&#8203;35232](https://github.com/renovatebot/renovate/issues/35232)) ([fcc9b47](fcc9b47101))

### [`v39.235.1`](https://github.com/renovatebot/renovate/releases/tag/39.235.1)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.235.0...39.235.1)

##### Build System

-   **deps:** update dependency luxon to v3.6.1 (main) ([#&#8203;35230](https://github.com/renovatebot/renovate/issues/35230)) ([c91c875](c91c87594b))

### [`v39.235.0`](https://github.com/renovatebot/renovate/releases/tag/39.235.0)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.234.0...39.235.0)

##### Features

-   **schema:** Add utility for detecting circular data ([#&#8203;35223](https://github.com/renovatebot/renovate/issues/35223)) ([5ad8030](5ad8030a8e))

##### Miscellaneous Chores

-   **deps:** update github/codeql-action action to v3.28.14 (main) ([#&#8203;35220](https://github.com/renovatebot/renovate/issues/35220)) ([a13f5da](a13f5daca9))
-   **label-actions:** capitalize Renovate brandname ([#&#8203;35222](https://github.com/renovatebot/renovate/issues/35222)) ([b53f2a9](b53f2a9ffe))

### [`v39.234.0`](https://github.com/renovatebot/renovate/releases/tag/39.234.0)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.233.6...39.234.0)

##### Features

-   add Azure Pipelines preset ([#&#8203;35207](https://github.com/renovatebot/renovate/issues/35207)) ([4cb2bb2](4cb2bb2d77))
-   **manager/nuget:** extract msbuild sdk from `Import` ([#&#8203;35206](https://github.com/renovatebot/renovate/issues/35206)) ([727792a](727792a3ce))

##### Documentation

-   **upgrade best practices:** update preset code plus small rewrite ([#&#8203;34837](https://github.com/renovatebot/renovate/issues/34837)) ([0be280b](0be280ba8a))

### [`v39.233.6`](https://github.com/renovatebot/renovate/releases/tag/39.233.6)

[Compare Source](https://github.com/renovatebot/renovate/compare/39.233.5...39.233.6)

##### Bug Fixes

-   **circleci:** Ignore non-image alias items ([#&#8203;35212](https://github.com/renovatebot/renovate/issues/35212)) ([e746331](e7463311b8))

##### Documentation

-   update references to renovate/renovate (main) ([#&#8203;35213](https://github.com/renovatebot/renovate/issues/35213)) ([73c9fac](73c9faca22))

##### Miscellaneous Chores

-   **deps:** lock file maintenance (main) ([#&#8203;35214](https://github.com/renovatebot/renovate/issues/35214)) ([3598dfb](3598dfb8f9))
-   **deps:** lock file maintenance (main) ([#&#8203;35217](https://github.com/renovatebot/renovate/issues/35217)) ([57972f6](57972f613a))
-   **deps:** update containerbase/internal-tools action to v3.10.19 (main) ([#&#8203;35215](https://github.com/renovatebot/renovate/issues/35215)) ([60ef7bf](60ef7bfcf1))
-   **deps:** update containerbase/internal-tools action to v3.10.20 (main) ([#&#8203;35218](https://github.com/renovatebot/renovate/issues/35218)) ([7cc1fb2](7cc1fb2d68))
-   **deps:** update dependency esbuild to v0.25.2 (main) ([#&#8203;35210](https://github.com/renovatebot/renovate/issues/35210)) ([1107833](1107833bcd))

##### Tests

-   **yaml:** Fix code block indents ([#&#8203;35211](https://github.com/renovatebot/renovate/issues/35211)) ([5d48319](5d4831961b))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * 1" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMzMuNSIsInVwZGF0ZWRJblZlciI6IjM5LjIzMy41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJmb3JnZWpvL2NpIiwidGVzdC9ub3QtbmVlZGVkIl19-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7532
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-14 10:39:25 +00:00
Renovate Bot
bc02a82338 Lock file maintenance (forgejo) (#7534)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7534
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-14 08:53:00 +00:00
Gusted
442958df1d [gitea] week 2025-14 cherry pick (gitea/main -> forgejo) (#7486)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7486
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-04-13 12:00:15 +00:00
Renovate Bot
7861d2ffcf Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.1.1 (forgejo) (#7528)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [github.com/golangci/golangci-lint/v2/cmd/golangci-lint](https://github.com/golangci/golangci-lint) | minor | `v2.0.2` -> `v2.1.1` |

---

### Release Notes

<details>
<summary>golangci/golangci-lint (github.com/golangci/golangci-lint/v2/cmd/golangci-lint)</summary>

### [`v2.1.1`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v211)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.0...v2.1.1)

The release process of v2.1.0 failed due to a regression inside goreleaser.

The binaries of v2.1.0 have been published, but not the other artifacts (AUR, Docker, etc.).

### [`v2.1.0`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v210)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.0.2...v2.1.0)

1.  Enhancements
    -   Add an option to display absolute paths (`--path-mode=abs`)
    -   Add configuration path placeholder (`${config-path}`)
    -   Add `warn-unused` option for `fmt` command
    -   Colored diff for `fmt` command (`golangci-lint fmt --diff-colored`)
2.  New linters
    -   Add `funcorder` linter https://github.com/manuelarte/funcorder
3.  Linters new features or changes
    -   `go-errorlint`: from 1.7.1 to 1.8.0 (automatic error comparison and type assertion fixes)
    -   ⚠️ `goconst`: `ignore-strings` is deprecated and replaced by `ignore-string-values`
    -   `goconst`: from 1.7.1 to 1.8.1 (new options: `find-duplicates`, `eval-const-expressions`)
    -   `govet`: add `httpmux` analyzer
    -   `nilnesserr`: from 0.1.2 to 0.2.0 (detect more cases)
    -   `paralleltest`: from 1.0.10 to 1.0.14 (checks only `_test.go` files)
    -   `revive`: from 1.7.0 to 1.9.0 (support kebab case for setting names)
    -   `sloglint`: from 0.9.0 to 0.11.0 (autofix, new option `msg-style`, suggest `slog.DiscardHandler`)
    -   `wrapcheck`: from 2.10.0 to 2.11.0 (new option `report-internal-errors`)
    -   `wsl`: from 4.6.0 to 4.7.0 (cgo files are always excluded)
4.  Linters bug fixes
    -   `fatcontext`: from 0.7.1 to 0.7.2
    -   `gocritic`: fix `importshadow` checker
    -   `gosec`: from 2.22.2 to 2.22.3
    -   `ireturn`: from 0.3.1 to 0.4.0
    -   `loggercheck`: from 0.10.1 to 0.11.0
    -   `nakedret`: from 2.0.5 to 2.0.6
    -   `nonamedreturns`: from 1.0.5 to 1.0.6
    -   `protogetter`: from 0.3.12 to 0.3.13
    -   `testifylint`: from 1.6.0 to 1.6.1
    -   `unconvert`: update to HEAD
5.  Misc.
    -   Fixes memory leaks when using go1.(N) with golangci-lint built with go1.(N-X)
    -   Adds `golangci-lint-fmt` pre-commit hook
6.  Documentation
    -   Improvements
    -   Updates section about vscode integration

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMzMuNSIsInVwZGF0ZWRJblZlciI6IjM5LjIzMy41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7528
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-13 07:47:07 +00:00
Gusted
b86aefc038 chore: use sharp to generate images (#7512)
- `tools/generate-images.js` is used to convert SVGs to resized optimized SVGs and resized optimized PNG. Although it would be best to drop generating images from SVG, the usage of these images do not accept a SVG.
- The script relied on two dependencies being installed on-the-fly, this is suboptimal as it means its integrity was not saved in package-lock.json and no specific version was specified which makes reproducible builds harder. `imagemin-zopfli` was not updated in 4 years and seems to use dependency that generate funny message about memory leaks and using no longer maintained dependencies.
- Use [`sharp`](https://sharp.pixelplumbing.com/) to do the image conversion, this installs two binaries on Linux (glibc/musl) and are responsible for 5% of the `node_modules` directory size. Add this to package.json as a dev dependencies to ensure the integrity can be verified and help reproducible builds.
- Drop the `gitea` conversion, I cannot find this being used within Forgejo (my best guess is that e20cd83bc5 dropped the usage of it).
- Resolves forgejo/forgejo#7232

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7512
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-11 15:12:50 +00:00
Gusted
b55c72828e feat(sec): Add SSH signing support for instances (#6897)
- Add support to set `gpg.format` in the Git config, via the new `[repository.signing].FORMAT` option. This is to tell Git that the instance would like to use SSH instead of OpenPGP to sign its commits. This is guarded behind a Git version check for v2.34.0 and a check that a `ssh-keygen` binary is present.
- Add support to recognize the public SSH key that is given to `[repository.signing].SIGNING_KEY` as the signing key by the instance.
- Thus this allows the instance to use SSH commit signing for commits that the instance creates (e.g. initial and squash commits) instead of using PGP.
- Technically (although I have no clue how as this is not documented) you can have a different PGP signing key for different repositories; this is not implemented for SSH signing.
- Add unit and integration testing.
  - `TestInstanceSigning` was reworked from `TestGPGGit`, now also includes testing for SHA256 repositories. Is the main integration test that actually signs commits and checks that they are marked as verified by Forgejo.
  - `TestParseCommitWithSSHSignature` is a unit test that makes sure that if a SSH instnace signing key is set, that it is used to possibly verify instance SSH signed commits.
  - `TestSyncConfigGPGFormat` is a unit test that makes sure the correct git config is set according to the signing format setting. Also checks that the guarded git version check and ssh-keygen binary presence check is done correctly.
  - `TestSSHInstanceKey` is a unit test that makes sure the parsing of a SSH signing key is done correctly.
  - `TestAPISSHSigningKey` is a integration test that makes sure the newly added API route `/api/v1/signing-key.ssh` responds correctly.

Documentation PR: forgejo/docs#1122

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6897
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-11 13:25:35 +00:00
Earl Warren
eb85681b41 fix: package_blob.has_blake2b may be null (#7520)
- When looking for an existing blob, has_blake2b will be null when it was created prior to v26 migration in v11, when the field was introduced.
- Add unit test and minimal refactoring to load fixtures. The AddFixture function should not be where it currently is because it cannot be used by some packages (circular import). But that's a refactor that needs to be elsewhere for backporting purposes.

Fixes https://codeberg.org/forgejo/forgejo/issues/7519
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-04-11 12:28:03 +00:00
Michael Jerger
2a1759ba3b use base.TruncateString instead of TruncateRune 2025-04-10 13:49:18 +02:00
0ko
eb3feaad45 chore(i18n): update contributing documentation with JSON format (#7499)
Things have changed and the readme file in `locale` became significantly less relevant, suggesting things like
> When you work on Forgejo features, you should only modify `locale_en-US.ini`.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7499
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-04-10 10:30:22 +00:00
Earl Warren
a783a72d6b chore: refactor for Actions Done Notification (#7510)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7510
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-04-10 09:51:57 +00:00
christopher-besch
cdb4682bca feat: move UpdateTaskByState to services
This function is also can't be in models in order to enable calling
the action run state change notification channel.
2025-04-10 08:38:28 +02:00
christopher-besch
81b5c7ca6f feat: move StopTask, CancelPreviousJobs and CleanRepoScheduleTasks to services/actions
This enables all action run state changes (from a not done to a done
state) to also send a notification.

Moved these:

- models/actions/task.go|423 col 6| func StopTask(ctx context.Context, taskID int64, status Status) error {
- models/actions/run.go|190 col 6| func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) error {
- models/actions/schedule.go|122 col 6| func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository, cancelPreviousJobs bool) error {
2025-04-10 08:38:27 +02:00
Renovate Bot
1c2a29807b Update dependency katex to v0.16.22 (forgejo) (#7503)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [katex](https://katex.org) ([source](https://github.com/KaTeX/KaTeX)) | dependencies | patch | [`0.16.21` -> `0.16.22`](https://renovatebot.com/diffs/npm/katex/0.16.21/0.16.22) |

---

### Release Notes

<details>
<summary>KaTeX/KaTeX (katex)</summary>

### [`v0.16.22`](https://github.com/KaTeX/KaTeX/blob/HEAD/CHANGELOG.md#01622-2025-04-09)

[Compare Source](https://github.com/KaTeX/KaTeX/compare/v0.16.21...v0.16.22)

##### Bug Fixes

-   \relax in base or exponent of super/subscript ([#&#8203;4045](https://github.com/KaTeX/KaTeX/issues/4045)) ([1f43c84](1f43c84a17))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMzMuNSIsInVwZGF0ZWRJblZlciI6IjM5LjIzMy41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7503
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-10 05:58:44 +00:00
Earl Warren
7d9d48819a i18n: update of translations from Codeberg Translate (#7438)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7438
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-04-10 05:55:43 +00:00
Codeberg Translate
0bfb3751fb
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: Fjuro <fjuro@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Kita Ikuyo <kitakita@disroot.org>
Co-authored-by: Miguel P.L <miguel_pl@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: Porrumentzio <porrumentzio@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: artnay <artnay@noreply.codeberg.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: nekoedges <nekoedges@noreply.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: xtex <xtexchooser@duck.com>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-04-10 05:25:01 +00:00
Renovate Bot
911806879f Update module golang.org/x/tools/cmd/deadcode to v0.32.0 (forgejo) (#7505)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-10 02:36:29 +00:00
Renovate Bot
c31be003d1 Update module golang.org/x/net to v0.39.0 (forgejo) (#7504)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7504
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-10 01:41:48 +00:00
0ko
282125e90f fix(ui): ensure consistent switch position in markdown editor (#7492)
Followup to https://codeberg.org/forgejo/forgejo/pulls/7481.

Fix a bug reported by @Gusted where the switch would jump ~1px up when switched to preview mode.

It was because the switch is always center-aligning to the largest element in the toolbar. With toolbar buttons disappearing, the largest element was the switch itself. By placing it in a box with same height as the buttons we can ensure it can always stay in the same position.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7492
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-04-09 17:37:46 +00:00
Renovate Bot
eca57cc3e9 Update dependency webpack to v5.99.5 (forgejo) (#7494)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7494
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-09 09:51:31 +00:00
Renovate Bot
3be290457f Update module golang.org/x/image to v0.26.0 (forgejo) (#7497)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [golang.org/x/image](https://pkg.go.dev/golang.org/x/image) | require | minor | [`v0.25.0` -> `v0.26.0`](https://cs.opensource.google/go/x/image/+/refs/tags/v0.25.0...refs/tags/v0.26.0) |

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMzMuNSIsInVwZGF0ZWRJblZlciI6IjM5LjIzMy41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7497
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-09 06:11:23 +00:00
Renovate Bot
bca6ae7862 Update module github.com/minio/minio-go/v7 to v7.0.90 (forgejo) (#7495)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) | require | patch | `v7.0.88` -> `v7.0.90` |

---

### Release Notes

<details>
<summary>minio/minio-go (github.com/minio/minio-go/v7)</summary>

### [`v7.0.90`](https://github.com/minio/minio-go/releases/tag/v7.0.90): Bugfix v7.0.90

[Compare Source](https://github.com/minio/minio-go/compare/v7.0.89...v7.0.90)

#### What's Changed

-   Add anonymous chunked encoding with trailing headers by [@&#8203;klauspost](https://github.com/klauspost) in https://github.com/minio/minio-go/pull/2084
-   Implement AppendObject() API by [@&#8203;harshavardhana](https://github.com/harshavardhana) in https://github.com/minio/minio-go/pull/2082
-   Update x/net version by [@&#8203;BorjaOuterelo](https://github.com/BorjaOuterelo) in https://github.com/minio/minio-go/pull/2085
-   Rety iterators by [@&#8203;tlyons-cs](https://github.com/tlyons-cs) in https://github.com/minio/minio-go/pull/2087
-   Add function for getting creds of remote client by [@&#8203;shtripat](https://github.com/shtripat) in https://github.com/minio/minio-go/pull/2089

#### New Contributors

-   [@&#8203;BorjaOuterelo](https://github.com/BorjaOuterelo) made their first contribution in https://github.com/minio/minio-go/pull/2085
-   [@&#8203;tlyons-cs](https://github.com/tlyons-cs) made their first contribution in https://github.com/minio/minio-go/pull/2087

**Full Changelog**: https://github.com/minio/minio-go/compare/v7.0.89...v7.0.90

### [`v7.0.89`](https://github.com/minio/minio-go/releases/tag/v7.0.89): Bugfix Release

[Compare Source](https://github.com/minio/minio-go/compare/v7.0.88...v7.0.89)

#### What's Changed

-   add PurgeOnDelete to versioning config by [@&#8203;poornas](https://github.com/poornas) in https://github.com/minio/minio-go/pull/2074
-   Adds `TokenRevokeType` field to credential providers. by [@&#8203;taran-p](https://github.com/taran-p) in https://github.com/minio/minio-go/pull/2075
-   make downtime info as map to denote per target info by [@&#8203;Praveenrajmani](https://github.com/Praveenrajmani) in https://github.com/minio/minio-go/pull/2079
-   update deps and move CI/CD to go1.23, go1.24 by [@&#8203;harshavardhana](https://github.com/harshavardhana) in https://github.com/minio/minio-go/pull/2080
-   update golint version by [@&#8203;harshavardhana](https://github.com/harshavardhana) in https://github.com/minio/minio-go/pull/2083

#### New Contributors

-   [@&#8203;taran-p](https://github.com/taran-p) made their first contribution in https://github.com/minio/minio-go/pull/2075

**Full Changelog**: https://github.com/minio/minio-go/compare/v7.0.88...v7.0.89

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMzMuNSIsInVwZGF0ZWRJblZlciI6IjM5LjIzMy41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7495
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-09 06:05:01 +00:00
Renovate Bot
5b6cbd8195 Update module go.uber.org/mock to v0.5.1 (forgejo) (#7488)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [go.uber.org/mock](https://github.com/uber/mock) | require | patch | `v0.5.0` -> `v0.5.1` |

---

### Release Notes

<details>
<summary>uber/mock (go.uber.org/mock)</summary>

### [`v0.5.1`](https://github.com/uber-go/mock/releases/tag/v0.5.1)

[Compare Source](https://github.com/uber/mock/compare/v0.5.0...v0.5.1)

#### 0.5.1 (7 Apr 2025)

##### Fixed

-   [#&#8203;220][]: Package mode will now generate code that uses aliases of types
    when they are used in the source.
-   [#&#8203;219][]: Fixed a collision between function argument names and package names
    in generated code.
-   [#&#8203;165][]: Fixed an issue where aliases specified by `-imports` were not being
    respected in generated code.

[#&#8203;220]: https://github.com/uber-go/mock/pull/220

[#&#8203;219]: https://github.com/uber-go/mock/pull/219

[#&#8203;165]: https://github.com/uber-go/mock/pull/165

Thanks to [@&#8203;mtoader](https://github.com/mtoader) and [@&#8203;bstncartwright](https://github.com/bstncartwright) for their contributions to this release.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMzMuNSIsInVwZGF0ZWRJblZlciI6IjM5LjIzMy41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7488
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-08 11:11:21 +00:00
Renovate Bot
b54d210eb3 Update dependency webpack to v5.99.1 (forgejo) (#7490)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7490
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-08 05:19:29 +00:00
Mopcho
64cc883ac1 Fix discord webhook 400 status code when description limit is exceeded (#34084)
Fixes [#34027](https://github.com/go-gitea/gitea/issues/34027)

Discord does not allow for description bigger than 2048 bytes. If the
description is bigger than that it will throw 400 and the event won't
appear in discord. To fix that, in the createPayload method we now slice
the description to ensure it doesn’t exceed the limit.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 013b2686fe6d306c4fb800147207b099866683b9)
2025-04-07 18:27:08 +02:00
KN4CK3R
3e3a109dd2 Fix invalid version in RPM package path (#34112)
(cherry picked from commit 8fed70afdc0f63636cdd6f5ea3fdf88061ad8dc2)
2025-04-07 18:05:29 +02:00
ManInDark
51990751a6 also check default ssh-cert location for host (#34099) (#34100)
(cherry picked from commit f8d549436ea70142514557b6a1d23d578d6aef42)
2025-04-07 18:03:33 +02:00
Kemal Zebari
f7b19964a7 Add new CLI flags to set name and scopes when creating a user with access token (#34080)
Resolves #33474.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 55a69ae4c63ee8551eadb161cb901ba0a2a2e194)
2025-04-07 17:26:34 +02:00
Lunny Xiao
02d9c7cd27 Return default avatar url when user id is zero rather than updating database (#34094)
(cherry picked from commit 88352e0b252e9186a5633d39124a8a65ab89f831)
2025-04-07 16:48:15 +02:00
0ko
afffbe2982 ui: use switch for markdown editor modes (#7481)
Replaces https://codeberg.org/forgejo/forgejo/pulls/5478
Closes https://codeberg.org/forgejo/forgejo/issues/244

Use switch for preview mode switching instead of tabs. It is placed in line with the toolbar buttons.

Preview:
* https://codeberg.org/attachments/38910747-c14c-41d1-9935-c35f3e17033b
* https://codeberg.org/attachments/ff8ea47a-f157-424f-8b7f-af1008d5e8b5

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7481
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
2025-04-07 13:47:13 +00:00
Kerwin Bryant
39341df8cb Fix markup content overflow (#34072)
Fix #34069: use `overflow-wrap: anywhere` to correctly wrap overflowed
content.

(cherry picked from commit 0fd5392087d35ebe2268f32de422342020e573b9)
2025-04-07 14:54:45 +02:00
JakobDev
8296a23d79 feat: sync forks (#2364)
This allows syncing a branch of a fork with a branch of the base repo. It looks like this:
![grafik](/attachments/4508920c-7d0b-4330-9083-e3048733e38d)
This is only possible, if the fork don't have commits that are not in the main repo.

The feature is already working, but it is missing Finetuning, a better API, translations and tests, so this is currently WIP. It is also not tested with go-git.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/2364): <!--number 2364 --><!--line 0 --><!--description c3luYyBmb3Jrcw==-->sync forks<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2364
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-committed-by: JakobDev <jakobdev@gmx.de>
2025-04-07 07:00:38 +00:00
Renovate Bot
3272e3588a Update module golang.org/x/crypto to v0.37.0 (forgejo) (#7485)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [golang.org/x/crypto](https://pkg.go.dev/golang.org/x/crypto) | require | minor | [`v0.36.0` -> `v0.37.0`](https://cs.opensource.google/go/x/crypto/+/refs/tags/v0.36.0...refs/tags/v0.37.0) |

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIyMi4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7485
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-07 06:31:07 +00:00
Renovate Bot
beddf442b1 Update renovate to v39.233.5 (forgejo) (#7484)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-07 06:28:32 +00:00
Gwendolyn
08b2ec2300 fix acme renewal (#7409)
## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7409
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Gwendolyn <me@gwendolyn.dev>
Co-committed-by: Gwendolyn <me@gwendolyn.dev>
2025-04-06 15:26:47 +00:00
Renovate Bot
9d984fedf3 Update dependency clippie to v4.1.6 (forgejo) (#7472)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7472
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-06 12:30:25 +00:00
Gusted
e6c17f31be fix(ui): only run auth_name code on new and edit page (#7470)
- Only run the dynamic `auth_name` update code when its on the new or edit page. `.admin.authentication` also matches the main authentication screen which lead to a javascript error.
- Regression of forgejo/forgejo#7408

# Testing
1. Login as a admin.
2. Go to `/admin/auths`.
3. Notice no errors.
4. Go to `admin/auths/new`.
6. Select 'OAuth2' as authentication type.
5. Type some input into the 'Authentication name'.
6. Notice the the callback URL in the 'Tips' section including the authentication name.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7470
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-06 12:25:29 +00:00
Renovate Bot
b04bb28ed1 Update module github.com/blevesearch/bleve/v2 to v2.5.0 (forgejo) (#7468)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/blevesearch/bleve/v2](https://github.com/blevesearch/bleve) | require | minor | `v2.4.4` -> `v2.5.0` |

---

### Release Notes

<details>
<summary>blevesearch/bleve (github.com/blevesearch/bleve/v2)</summary>

### [`v2.5.0`](https://github.com/blevesearch/bleve/releases/tag/v2.5.0)

[Compare Source](https://github.com/blevesearch/bleve/compare/v2.4.4...v2.5.0)

##### Bug Fixes

-   Exact hits to score higher than fuzzy hits, with https://github.com/blevesearch/bleve/pull/2056
-   Fix boosting during hybrid search that involves text + nearest neighbor, with https://github.com/blevesearch/bleve/pull/2127
-   Addressed bug in IP field handling while highlighting, with https://github.com/blevesearch/bleve/pull/2142
-   Graceful error handling within registry, with https://github.com/blevesearch/bleve/pull/2151
-   `http/` package (meant for demo purposes) removed from repository to remove vulnerability - [CVE-2022-31022](https://github.com/blevesearch/bleve/security/advisories/GHSA-9w9f-6mg8-jp7w), relocated to within https://github.com/blevesearch/bleve-explorer
-   Geo radius queries will now advertise distances (within sort values) in readable format, with https://github.com/blevesearch/bleve/pull/2137

##### Improvements

-   Vector search requires `faiss` dynamic library to be built from [blevesearch/faiss@352484e](352484e0fc) which is a modified version of [v1.10.0](https://github.com/facebookresearch/faiss/releases/tag/v1.10.0)
-   Support for **BM25 scoring**, see: [scoring.md](https://github.com/blevesearch/bleve/blob/v2.5.0/docs/scoring.md#bm25)
-   Support for **synonyms' search**, see: [synonyms.md](https://github.com/blevesearch/bleve/blob/v2.5.0/docs/synonyms.md)
-   **Significant performance improvements in pre-filtered vector search**, with https://github.com/blevesearch/bleve/pull/2169 + dependent changes
-   `auto` fuzziness detection with https://github.com/blevesearch/bleve/pull/2060
-   Ability to affect ingestion/drain rate by tuning persister workers with https://github.com/blevesearch/bleve/pull/2100
-   Additional config in merge policy for improved merger behavior, with https://github.com/blevesearch/bleve/pull/2134
-   Geo improvements: footprint reduction for polygons, better validation and graceful error handling, with https://github.com/blevesearch/bleve/pull/2162 + https://github.com/blevesearch/bleve/pull/2158 + https://github.com/blevesearch/bleve/pull/2165
-   Upgrade to RoaringBitmap/roaring@v2.4.5, etcd.io/bbolt@v1.4.0
-   More metrics

##### Milestone

-   [v2.5.0](https://github.com/blevesearch/bleve/milestone/24)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIyMi4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7468
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-06 08:41:38 +00:00
voltagex
cb4ef4495a Minor grammatical fix to runner deletion message (#7479)
WIP until someone else tells me whether the whole message should be changed or whether `s/mark/marked/` is enough.
I am honestly not sure what "It may break building workflow." means in this context either but it doesn't sound correct to me.

## Checklist
*snipped* - this is really minor, please let me know if there's a better checklist to use for changes like this

### Release notes

- [x] I do not want this change to show in the release notes.  [Change is too minor]

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7479
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: voltagex <git@voltagex.org>
Co-committed-by: voltagex <git@voltagex.org>
2025-04-06 08:40:54 +00:00
Renovate Bot
d46cf46f6e Update module golang.org/x/oauth2 to v0.29.0 (forgejo) (#7475)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) | require | minor | [`v0.28.0` -> `v0.29.0`](https://cs.opensource.google/go/x/oauth2/+/refs/tags/v0.28.0...refs/tags/v0.29.0) |

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIyMi4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7475
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-06 08:31:01 +00:00
Renovate Bot
577a694df6 Update module github.com/fsnotify/fsnotify to v1.9.0 (forgejo) (#7473)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) | require | minor | `v1.8.0` -> `v1.9.0` |

---

### Release Notes

<details>
<summary>fsnotify/fsnotify (github.com/fsnotify/fsnotify)</summary>

### [`v1.9.0`](https://github.com/fsnotify/fsnotify/releases/tag/v1.9.0)

[Compare Source](https://github.com/fsnotify/fsnotify/compare/v1.8.0...v1.9.0)

##### Changes and fixes

-   all: make BufferedWatcher buffered again ([#&#8203;657])

-   inotify: fix race when adding/removing watches while a watched path is being deleted ([#&#8203;678], [#&#8203;686])

-   inotify: don't send empty event if a watched path is unmounted ([#&#8203;655])

-   inotify: don't register duplicate watches when watching both a symlink and its target; previously that would get "half-added" and removing the second would panic ([#&#8203;679])

-   kqueue: fix watching relative symlinks ([#&#8203;681])

-   kqueue: correctly mark pre-existing entries when watching a link to a dir on kqueue ([#&#8203;682])

-   illumos: don't send error if changed file is deleted while processing the event ([#&#8203;678])

[#&#8203;657]: https://github.com/fsnotify/fsnotify/pull/657

[#&#8203;678]: https://github.com/fsnotify/fsnotify/pull/678

[#&#8203;686]: https://github.com/fsnotify/fsnotify/pull/686

[#&#8203;655]: https://github.com/fsnotify/fsnotify/pull/655

[#&#8203;681]: https://github.com/fsnotify/fsnotify/pull/681

[#&#8203;679]: https://github.com/fsnotify/fsnotify/pull/679

[#&#8203;682]: https://github.com/fsnotify/fsnotify/pull/682

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIyMi4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7473
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-06 08:22:49 +00:00
Gusted
6fa5705d4b fix(ui): ensure dimmer always covers whole page (#7471)
- Ensure that the dimmer always covers the whole page and that the modal is centered.
- Ensure that `body` hides overflow so you cannot scroll on the page after the modal is opened.
- The adjusted CSS 'behavior' originates from the original dimmer module.
- Regression of https://codeberg.org/forgejo/forgejo/pulls/7416.
- E2E test added.

Screenshots

Before:
https://codeberg.org/attachments/fb8c84b3-94ba-4597-b468-4bf344f356ed

After:
https://codeberg.org/attachments/a6583eb9-1ec7-4e40-960a-4986f6e17535

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7471
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-06 04:23:03 +00:00
Gusted
56cc841b65 chore: always enable webpack progress (#7463)
- Webpack is currently quite slow while compiling the whole frontend, even for a very fast machine this can take 30s, but for normal machines this can take over a minute. In the development mode (`make watch`) a handy status is shown that tells what webpack is doing and an approximate progress.
- Enable this progress always, this means that this is now also shown when you run `make build` and should hopefully give a good indication how long the webpack step should take.
- Configure the progress to also show the module its currently 'working on'. This is more interesting than the amount of modules webpack still needs to work on (which steadily increase as webpack seems to incrementally resolves to more modules).

## Screenshot

![image](/attachments/96b1176a-6a6b-4a44-a8f3-fb56ce7b0fc6)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7463
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-05 12:49:14 +00:00
Renovate Bot
2e6f624d2f Update dependency typescript to v5.8.3 (forgejo) (#7467)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7467
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-05 06:02:14 +00:00
Renovate Bot
0766cb4776 Update dependency ansi_up to v6.0.5 (forgejo) (#7465)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7465
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-05 01:24:46 +00:00
0ko
7145665cbf chore(i18n): add a meta line to the base json translation (#7462)
Ref https://codeberg.org/forgejo/discussions/issues/326

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7462
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: floss4good <floss4good@noreply.codeberg.org>
2025-04-04 16:27:16 +00:00
Mathieu Fenniak
6ad706aa88 feat(ui): Automatically refresh workflows in the "Actions" list (#7361)
- Make the "Actions" list (for example, https://codeberg.org/forgejo/forgejo/actions) dynamically refresh using htmx and partial page reloading. This addresses a pet peeve of mine, I find it common to end up on this page and have workflows in-progress, but not be able to monitor the workflows to success or failure from the page as it currently doesn't do any data refreshing.
- There are a few major risks involves with this change.
  - Increased server-side load & network utilization.  In order to mitigate this risk, I have configured the refresh to occur every 30 seconds **only** when the Page Visibility API indicates that the web page is currently visible to the end-user. It is still reasonable to assume this change will increase server-side load though.
  - UI interactions on the page, such as the "Actor" and "Status" dropdown and the workflow dispatch form, would be replaced from the server with non-expanded UI during the refresh. This problem is prevented by stopping the refresh while these UIs are in their expanded states.
- E2E tests added.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7361
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-04-04 14:38:54 +00:00
Renovate Bot
c977585e4c Update dependency ansi_up to v6.0.3 (forgejo) (#7456)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7456
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-04 04:04:58 +00:00
Renovate Bot
a0df27c929 Update module github.com/alecthomas/chroma/v2 to v2.16.0 (forgejo) (#7459)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/alecthomas/chroma/v2](https://github.com/alecthomas/chroma) | require | minor | `v2.15.0` -> `v2.16.0` |

---

### Release Notes

<details>
<summary>alecthomas/chroma (github.com/alecthomas/chroma/v2)</summary>

### [`v2.16.0`](https://github.com/alecthomas/chroma/releases/tag/v2.16.0)

[Compare Source](https://github.com/alecthomas/chroma/compare/v2.15.0...v2.16.0)

#### Changelog

-   [`ad6f149`](ad6f149) chore: clean up Makefile
-   [`9909f65`](9909f65) fix: switch to jsdelivr as unpkg was throwing CORS errors
-   [`34bf362`](34bf362) chore(deps): update all non-major dependencies ([#&#8203;1066](https://github.com/alecthomas/chroma/issues/1066))
-   [`88084b6`](88084b6) fix: Dot in a string breaks the highlighting in Terraform. Fixes [#&#8203;988](https://github.com/alecthomas/chroma/issues/988) ([#&#8203;1065](https://github.com/alecthomas/chroma/issues/1065))
-   [`62197e9`](62197e9) Add lexers.Aliases() method to display only lexers' aliases ([#&#8203;1057](https://github.com/alecthomas/chroma/issues/1057))
-   [`7feb358`](7feb358) chore(deps): update dependency svu to v3 ([#&#8203;1053](https://github.com/alecthomas/chroma/issues/1053))
-   [`30e0bc6`](30e0bc6) chore(deps): update all non-major dependencies ([#&#8203;1061](https://github.com/alecthomas/chroma/issues/1061))
-   [`e0c7747`](e0c7747)  Fix IP address as name detection in nginx conf ([#&#8203;1060](https://github.com/alecthomas/chroma/issues/1060))
-   [`0bf0e9f`](0bf0e9f) Add luau file extension and alias to lua lexer ([#&#8203;1056](https://github.com/alecthomas/chroma/issues/1056))
-   [`0e0e282`](0e0e282) chore(deps): update all non-major dependencies ([#&#8203;1049](https://github.com/alecthomas/chroma/issues/1049))
-   [`4b0882a`](4b0882a) add Janet lexer ([#&#8203;1045](https://github.com/alecthomas/chroma/issues/1045))
-   [`81fecd5`](81fecd5) chore(deps): update all non-major dependencies ([#&#8203;1041](https://github.com/alecthomas/chroma/issues/1041))
-   [`dc982d2`](dc982d2) Add Mojo lexer ([#&#8203;1044](https://github.com/alecthomas/chroma/issues/1044))
-   [`79621af`](79621af) Fix solidity lexer's handling of inline assembly ([#&#8203;1040](https://github.com/alecthomas/chroma/issues/1040))
-   [`9da461e`](9da461e) chore(deps): update module github.com/mattn/go-colorable to v0.1.14 ([#&#8203;1039](https://github.com/alecthomas/chroma/issues/1039))
-   [`f0d460e`](f0d460e) Update Odin lexer for new build tag feature ([#&#8203;1038](https://github.com/alecthomas/chroma/issues/1038))
-   [`0bd7c68`](0bd7c68) chore: bump go.mod to Go 1.22 + add Iterator.Stdlib()
-   [`d829579`](d829579) fix(ocaml): support multistring ([#&#8203;1035](https://github.com/alecthomas/chroma/issues/1035))
-   [`e79c813`](e79c813) chore(deps): update all non-major dependencies ([#&#8203;1029](https://github.com/alecthomas/chroma/issues/1029))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIyMi4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7459
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-04 03:52:13 +00:00
Renovate Bot
d688ca4515 Update module code.gitea.io/sdk/gitea to v0.21.0 (forgejo) (#7458)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| code.gitea.io/sdk/gitea | require | minor | `v0.20.0` -> `v0.21.0` |

---

### Configuration

📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIyMi4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7458
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-04 03:49:54 +00:00
Gusted
53df0bf9a4 chore(sec): unify usage of crypto/rand.Read (#7453)
- Unify the usage of [`crypto/rand.Read`](https://pkg.go.dev/crypto/rand#Read) to `util.CryptoRandomBytes`.
- Refactor `util.CryptoRandomBytes` to never return an error. It is documented by Go, https://go.dev/issue/66821, to always succeed. So if we still receive a error or if the returned bytes read is not equal to the expected bytes to be read we panic (just to be on the safe side).
- This simplifies a lot of code to no longer care about error handling.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7453
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-04 03:31:37 +00:00
Gusted
99fc04b763 fix: make installing Forgejo work again (#7452)
- The default engine is no longer guaranteed to be of the type `*xorm.Engine`, so instead return the interface `db.Engine`.
- Regression of forgejo/forgejo#7212

# Testing

1. Install a Forgejo instance via the setup screen.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7452
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-04 03:30:19 +00:00
Gusted
afea42d517 chore: add empty action_variable fixture (#7419)
- Ensures that this table gets emptied between integration tests and does not have any leftovers.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7419
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-03 23:42:37 +00:00
Gusted
1ec672694a chore(i18n): cleanup settings.adopt string (#7451)
The translation of `settings.adopt` is not actually used, it is set as the title for a POST handler that does not actually render any template. It does render the the 'Internal server error' template, however for safety reasons it does not use the set context data.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7451
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-03 16:50:39 +00:00
Gnarwhal
d28a64e538 fix: handle viewing a submodule entry (#7261)
- When trying to view a submodule directory via the normal `/src/branch/` path, generate a redirect link to the submodule location.
- Resolves forgejo/forgejo#5267

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7261
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Gnarwhal <git.aspect893@passmail.net>
Co-committed-by: Gnarwhal <git.aspect893@passmail.net>
2025-04-03 15:32:55 +00:00
famfo
77b0275572 feat(activitiypub): enable HTTP signatures on all ActivityPub endpoints (#7035)
- Set the right keyID and use the right signing keys for outgoing requests.
- Verify the HTTP signature of all incoming requests, except for the server actor.
- Caches keys of incoming requests for users and servers actors.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7035
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: famfo <famfo@famfo.xyz>
Co-committed-by: famfo <famfo@famfo.xyz>
2025-04-03 15:24:15 +00:00
Gusted
ba5b157f7e feat(build): uniform ini parsing (#7429)
- Use the existing ini parser for the `lint-locale` and `lint-locale-usage` tooling.
- This discovered that the previous ini parser was not correctly parsing certain types of string, specifically those with `;` as it's seen as a comment. It now properly 'unescapes' that and is not seen as a comment break.
- Discovered-by: @fogti

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7429
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-03 08:27:02 +00:00
Earl Warren
4ab40ed6af i18n: update of translations from Codeberg Translate (#7363)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7363
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-04-03 07:53:45 +00:00
Codeberg Translate
275d8250ea
i18n: update of translations from Codeberg Translate
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Adolfo Jayme Barrientos <fito@noreply.codeberg.org>
Co-authored-by: Atalanttore <atalanttore@noreply.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Dirk <dirk@noreply.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@noreply.codeberg.org>
Co-authored-by: EkaterinePapava <ekaterinepapava@noreply.codeberg.org>
Co-authored-by: Fjuro <fjuro@noreply.codeberg.org>
Co-authored-by: GewoonLeon <gewoonleon@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Juno Takano <jutty@noreply.codeberg.org>
Co-authored-by: Kita Ikuyo <kitakita@disroot.org>
Co-authored-by: Miguel P.L <miguel_pl@noreply.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: SomeTr <sometr@noreply.codeberg.org>
Co-authored-by: Zughy <zughy@noreply.codeberg.org>
Co-authored-by: darkswordreams <darkswordreams@noreply.codeberg.org>
Co-authored-by: earl-warren <earl-warren@noreply.codeberg.org>
Co-authored-by: justbispo <justbispo@noreply.codeberg.org>
Co-authored-by: kwoot <kwoot@noreply.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: xtex <xtexchooser@duck.com>
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/it/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo-next/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/cs/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/da/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/de/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/el/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/es/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fil/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/hi/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/it/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ja/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ka/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/lv/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/nds/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/nl/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_BR/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/pt_PT/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ru/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/tr/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/uk/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hans/
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/zh_Hant/
Translation: Forgejo/forgejo
Translation: Forgejo/forgejo-next
2025-04-03 07:02:09 +00:00
Gusted
5e79b39654 fix(migrations): transfer PR flow information (#7421)
- When migrating a pull requests from a Gitea or Forgejo instance, check if the pull request was created via the AGit flow and transfer that bit of information to the migrated pull request.
- Expose this bit of information as the `flow` field for the pull request.
- We have to do a horrible Go hack with Gitea's [go-sdk](gitea.com/gitea/go-sdk) to list all pull requests while being able to decode it to a struct that contains the new `Flow` field. The library does not allow you to do this out of the box, so we have to use `go:linkname` to access the private method that allows us to do this. This in turn means we have to do some boilerplate code that the library otherwise would do for us. The better option would be forking, but that would be a hassle of keeping the library in sync.
- Resolves forgejo/forgejo#5848
- Unit test added.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7421
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-03 06:47:37 +00:00
Renovate Bot
738f721f3a Update module github.com/mattn/go-sqlite3 to v1.14.27 (forgejo) (#7434)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7434
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-03 00:49:26 +00:00
Ellen Emilia Anna Zscheile
49709bb270 feat(build): run lint-locale-usage w/o --allow-missing-msgids (#7433)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7433
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
2025-04-02 23:52:10 +00:00
Gusted
ee5b102142 fix: make repo clone https/ssh listener conditional (#7431)
- It's possible that either the SSH or HTTPS element does not exist. Thus make adding the event listener conditional.
- Ref: forgejo/forgejo#7408
- Reported-by: @0ko

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7431
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-02 18:53:01 +00:00
Gusted
5706a2452e fix(ui): display user-friendly message for range error (#7420)
- Instead of displaying 'RangeError: Range' display 'x must be a number between $MIN and $MAX' when the validation fails for a range error check.
- Resolves forgejo/forgejo#3510
- Added integration testing.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7420
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-02 15:48:09 +00:00
Ellen Emilia Anna Zscheile
15a2338ff2 feat(build): teach lint-locale-usage about trPluralString (#7425)
This requires using the more complicated parsing from localestore.go

In order to avoid future code drift and code duplication,
localestore.go was refactored to call IterateMessagesContent instead of
essentially duplicating the code of RecursivelyAddTranslationsFromJSON
with small adjustments.

locale/utils.go was moved to translation/localeiter/utils.go
in order to avoid spreading translation-related routines among completely
different places.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7425
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
2025-04-02 14:57:45 +00:00
Gusted
bd9366e7fc fix(i18n): fix several usages of i18n (#7422)
- Add new translations, if an existing one couldn't be used.
- Use existing translations, if one existed and fit the purpose.
- Spotted by the lint-locale-usage tooling by @fogti.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7422
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-02 14:50:02 +00:00
Gusted
f691f03741 chore(ui): remove fomantic's dimmer module (#7416)
- Fomantic's dimmer module is responsible for dimming the page and make some element the primary focus on the page (e.g. modal). This module is only used by Fomantic's modal module.
- Remove it and replace the javascript with our own `Dimmer` class that is able to provide Fomantic's modal module with everything it needs.
- Replace the CSS with our own bare minimum CSS.
- No functionality or visual is affected by this replacement.
- E2E test added.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7416
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-02 12:54:54 +00:00
Renovate Bot
d656978818 Update module github.com/go-webauthn/webauthn to v0.12.3 (forgejo) (#7423)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7423
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-02 10:43:36 +00:00
Renovate Bot
18c38ed1f3 Update module github.com/mattn/go-sqlite3 to v1.14.25 (forgejo) (#7424)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7424
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-02 00:44:39 +00:00
Renovate Bot
61885a0eaa Update dependency go to v1.24.2 (forgejo) (#7417)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7417
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-01 18:34:02 +00:00
0ko
6ad625b0c1 feat(ui): make JS asset load error message translatable (#7388)
- The 'Failed to load asset files from [...]' is now an translatable string.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7388
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-04-01 16:14:38 +00:00
Gusted
c497ef9e81 chore: enable several no-jquery rules (#7408)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7408
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2025-04-01 16:08:51 +00:00
0ko
da62c2cac6 chore(ui): remove ineffective class small in inline code preview (#7414)
Followup to https://codeberg.org/forgejo/forgejo/pulls/2669
Ref https://codeberg.org/forgejo/forgejo/issues/5067

Since Forgejo v9 this class is overridden here by other CSS and is ineffective. But it looks ok and gives good visibility. If it needs to be re-implemed, it can be done via CSS, like:
```css
.file-preview-box .header span {font-size:0.8rem;}
```

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7414
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-04-01 15:55:56 +00:00
Gusted
979cc5cd93 [gitea] week 2025-13 cherry pick (gitea/main -> forgejo) (#7397)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7397
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-04-01 13:35:02 +00:00
Renovate Bot
c9c8fb6501 Update vitest monorepo to v3.1.1 (forgejo) (#7407)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-01 02:52:46 +00:00
Gusted
d9892e57bd
chore: enable no-jquery/no-map-collection
No linter errors reported.
2025-04-01 04:44:44 +02:00
Gusted
9420d3d0a5
chore: enable no-jquery/no-trigger
- A lot of substitution to `.requestSubmit()`.
- Where possible, rewrite some other jquery to vanilla javascript to
ease the linter fix.
2025-04-01 04:43:06 +02:00
Gusted
c124014115
chore: enable no-jquery/no-each-util
- No longer allow `$.each`. This can easily be done with vanilla javascript.
2025-04-01 03:59:12 +02:00
Gusted
9eb67ba8ed
chore: enable no-jquery/no-sizzle
Don't rely on Jquery's CSS selector engine.
2025-04-01 03:58:09 +02:00
Gusted
dde7c4a770
chore: add new no-jquery rules
Were added in version v3.1.0.
2025-04-01 03:55:34 +02:00
Renovate Bot
8fdcde5f22 Update linters to v8.29.0 (forgejo) (#7406)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-04-01 00:44:50 +00:00
Lunny Xiao
b296354873
Hide activity contributors, recent commits and code frequrency left tabs if there is no code permission (#34053)
When a team have no code unit permission of a repository, the member of
the team should not view activity contributors, recent commits and code
frequrency.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 49899070cd600e7b7bd31a750f4d49de1722db23)
2025-04-01 02:28:02 +02:00
Royce Remer
adc2a215c1
Fail mirroring more gracefully (#34002)
* reuse recoverable error checks across mirror_pull
* add new cases for 'cannot lock ref/not our ref' (race condition in
fetch) and 'Unable to create/lock"
* move lfs sync right after commit graph write, and before other
maintenance which may fail
* try a prune for 'broken reference' as well as 'not our ref'
* always sync LFS right after commit graph write, and before other
maintenance which may fail

This handles a few cases where our very large and very active
repositories could serve mirrored git refs, but be missing lfs files:

## Case 1 (multiple variants): Race condition in git fetch
There was already a check for 'unable to resolve reference' on a failed
git fetch, after which a git prune and then subsequent fetch are
performed. This is to work around a race condition where the git remote
tells Gitea about a ref for some HEAD of a branch, then fails a few
seconds later because the remote branch was deleted, or the ref was
updated (force push).

There are two more variants to the error message you can get, but for
the same kind of race condition. These *may* be related to the git
binary version Gitea has access to (in my case, it was 2.48.1).

## Case 2: githttp.go can serve updated git refs before it's synced lfs
oids

There is probably a more aggressive refactor we could do here to have
the cat-file loop use FETCH_HEAD instead of relying on the commit graphs
to be committed locally (and thus serveable to clients of Gitea), but a
simple reduction in the occurrences of this for me was to move the lfs
sync block immediately after the commit-graph write and before any other
time-consuming (or potentially erroring/exiting) blocks.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit e0ad72e2233f885669c26d9063a91abd594fb9f6)
2025-04-01 02:28:02 +02:00
silverwind
6d5fc19464
Enable color output in govulncheck (#34012)
Make `govulncheck` show color, which by default it doesn't for some
reason.

(cherry picked from commit 2089401653cb4d351aa6e0bb6a86d987d115acb8)
2025-04-01 02:28:02 +02:00
Lunny Xiao
50f8563c67
Git client will follow 301 but 307 (#34005)
Fix #28460

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 356b707dde00f61f806c8a27879830a1d9b5b895)
2025-04-01 02:28:02 +02:00
Lunny Xiao
f68d49cb9e
Move ParseBool to optional (#33979)
(cherry picked from commit 25b6f388651c893ecafce918f27bef7e4ae9a967)
2025-04-01 02:28:02 +02:00
silverwind
9018e5bc19
Cover go.mod and go.sum in .editorconfig (#33960)
These files were previously set to use spaces for indendation but they
are supposed to use tabs, so set this in editorconfig.

(cherry picked from commit d1a755e5b7c676750f3dfad2254e047e2d23c4ac)
2025-04-01 02:28:02 +02:00
charles
9d8624f341
Fix file name could not be searched if the file was not a text file when using the Bleve indexer (#33959)
Close #33828

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit b956cee06f462c4f34a7911351b7c878ce890725)
2025-04-01 02:28:02 +02:00
wxiaoguang
839739fb71
Defer captcha script loading (#33919)
Fix #33899

(cherry picked from commit fdaf1cca65e118562b3cc2eb9e7c077b28f77213)
2025-04-01 02:28:02 +02:00
ChristopherHX
4ba5c957e0
Fix cannot delete runners via the modal dialog (#33895)
delete-button and show-modal class are conflicting

Closes #33894

(cherry picked from commit 7e8168f555b0a463866afcc10e9fddc34d363811)
2025-04-01 02:28:02 +02:00
Panagiotis "Ivory" Vasilopoulos
dbeab2a0c3 chore: introduce gitNeeded bool in setup (#7348)
There are various commands of the Forgejo CLI that do not actually need Git, because i.e. they only issue network requests. Matter of fact, most occurrences do not actually require Git.

By removing the Git initialization, operations by e.g. the manager will not fail in the absence of a Git binary. This is mostly relevant for an in-the-works Landlock implementation, which aims to minimize access to paths depending on the situation. Although we should expect that Git will be installed on the same system that the user is running Forgejo from, it somewhat slows things down, whereas the same edge cases that we are trying to protect the user from _could_ be achieved by keeping the `setting.RepoRootPath` check.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7348
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-committed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
2025-03-31 16:35:20 +00:00
Panagiotis "Ivory" Vasilopoulos
10c8ca62d2 refactor(cli): improve dump's temporary file handling (#7350)
- Create temporary directory inside of a temporary directory (useful for a work-in-progress Landlock implementation, as we will not want to "whitelist" the entirety of the /tmp directory in our case, i.e. /tmp/forgejo-dump-133552095).
- The database is always removed after dump is complete.
- The temporary directory is removed if no temporary directory has been explicitly set (as in, created by Forgejo in /tmp or equivalent).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7350
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-committed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
2025-03-31 16:33:47 +00:00
Renovate Bot
a9faf1ff7b Update renovate to v39.222.0 (forgejo) (#7399)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-31 06:49:32 +00:00
Gusted
4b56c05e65 fix: validate input for default_{merge,update}_style (#7395)
- Add `binding:"In(...)"` to the `default_merge_style` and `default_update_style` fields to only accept recognized merge and update styles.
- Resolves https://codeberg.org/forgejo/forgejo/issues/7389
- Added integration test for the API (`binding` works in the exact same way for the API and web routes).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7395
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-31 03:33:18 +00:00
Renovate Bot
114cd6d4b6 Lock file maintenance (forgejo) (#7400)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7400
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-31 00:40:07 +00:00
Ellen Emilia Anna Zscheile
b0dd490ae1 feat(repo,locale): merge PR/issues cases for some repo/issue strings (#7092)
- Merge `archive.nocomment` and `comment.blocked_by_user`'s variants for issue and pull request to a unified string and no longer have a issue and pull request variant.
- Fixes #6443

Signed-off-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7092
Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
2025-03-30 21:58:34 +00:00
Gusted
3769259c93 chore: use dynamic id (#7396)
- Follow up forgejo/forgejo#7378
- See https://codeberg.org/forgejo/forgejo/pulls/7378#issuecomment-3167157

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7396
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-30 21:41:33 +00:00
Gusted
5275fbd4ea fix(ui): clarify repo init instruction for sha256 (#7394)
- When the repository is initalized with a different objectformat than sha1, ensure that the empty repository instructions reflects that the `git init` command also needs to be initialized with that objectformat.
- Resolves https://codeberg.org/codeberg/community/issues/1837
- Added integration test.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7394
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-30 18:08:05 +00:00
Andreas Shimokawa
86039a89fc fix(a11y): unreadable image captcha with dark themes (#7390)
- When the user has a dark theme selected, image captchas are sometimes unreadable.
- Make sure the image captcha always has a white background color.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7390
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Andreas Shimokawa <shimokawa@fsfe.org>
Co-committed-by: Andreas Shimokawa <shimokawa@fsfe.org>
2025-03-30 14:51:37 +00:00
Renovate Bot
2348955af5 Lock file maintenance (forgejo) (#7392)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7392
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-30 14:49:48 +00:00
Gusted
7baf9994bd chore: improve repo migrate e2e test (#7378)
- Generate a repository name for each run, such that retries will use a new repository and not have any leftover.
- Make the test actually pass by ensuring the unauthenticated page didn't reuse storage state that contained authenticated cookies.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7378
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-30 14:48:52 +00:00
Renovate Bot
facc2bb28e Update github.com/google/pprof digest to a4b03ec (forgejo) (#7391)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7391
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-30 14:33:38 +00:00
Lucas Grzegorczyk
ba1e3405d6 feat(ui): Suggest git switch instead of git checkout (#7385)
- A minor change that replaces the usages of `git checkout` to `git switch` in the UI. `git switch` is preferred over `git checkout` by git.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7385
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Lucas Grzegorczyk <furai@thd.vg>
Co-committed-by: Lucas Grzegorczyk <furai@thd.vg>
2025-03-30 11:37:15 +00:00
pat-s
63a80bf2b9 feat: use XORM EngineGroup instead of single Engine connection (#7212)
Resolves #7207

Add new configuration to make XORM work with a main and replicas database instances. The follow configuration parameters were added:

- `HOST_PRIMARY`
- `HOST_REPLICAS`
- `LOAD_BALANCE_POLICY`. Options:
    - `"WeightRandom"` -> `xorm.WeightRandomPolicy`
    - `"WeightRoundRobin`  -> `WeightRoundRobinPolicy`
    - `"LeastCon"` -> `LeastConnPolicy`
    - `"RoundRobin"` -> `xorm.RoundRobinPolicy()`
    - default: `xorm.RandomPolicy()`
- `LOAD_BALANCE_WEIGHTS`

Co-authored-by: pat-s <patrick.schratz@gmail.com@>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7212
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2025-03-30 11:34:02 +00:00
0ko
a23d0453a3 feat(ui/migrations): clarify desired autocompletion type for clone_addr (#7377)
* Firefox thinks that this is a login form and that `clone_addr` is it's username field
* It would have been an easy fix with with `autocomplete="off"`, but there's an issue with that approach:  Firefox plays a cat-mouse game with web developers and intentionally ignores `autocomplete="off"` "for users' security".
* Set it to the `url` autocompletion type, Firefox and maybe other browsers give actually somewhat relevant completion entries. They will not be always relevant, but they may be when a migration has to be re-done with different settings.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7377
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-03-30 11:31:42 +00:00
Gusted
bb4e1f426f feat: include a default robots.txt to reduce the impact of crawlers (#7387)
- Add a strong strict default robots.txt, if one is not provided by the instance administrators.
- Remove code for the legacy public asset path, the error has been logged for a few releases already (existed since v1.21).
- Resolves forgejo/forgejo#923

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7387
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-30 11:28:19 +00:00
Gusted
51caba694a fix(ui): prepend AppSubURL to visibility hint URLs (#7379)
- If configured, add `AppSubUrl` to the visibility hint URLs shown to the user on the profile activity page.
- Resolves https://codeberg.org/forgejo/forgejo/issues/7327
- Integration testing adjusted.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7379
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-30 05:04:36 +00:00
Renovate Bot
d59495a4db Update vitest monorepo to v3.0.9 (forgejo) (#7382)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-30 00:32:48 +00:00
Renovate Bot
32005ad2ab Update linters (forgejo) (#7384)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-29 23:08:52 +00:00
Renovate Bot
50798d0a63 Update dependency yamllint to v1.37.0 (forgejo) (#7383)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-29 23:02:53 +00:00
Renovate Bot
aecf60f233 Update dependency @vitest/eslint-plugin to v1.1.38 (forgejo) (#7381)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-29 22:50:26 +00:00
YuviPanda
c9853e9e3a fix: ignore trailing slash for autogenerated name (#7307)
- During the migration process, if a valid GitHub clone URL was pasted, https://github.com/yuvipanda/notebooksharing.space/, the form automatically generates an invalid Forgejo repository name that included the trailing slash.
- Change the regex used to generate the name to ignore the trailing slash.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7307
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: YuviPanda <yuvipanda@gmail.com>
Co-committed-by: YuviPanda <yuvipanda@gmail.com>
2025-03-29 19:35:01 +00:00
Mat
8df8381f51 feat(ui/migrations): add placeholder to clarify empty description behavior (#7373)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7373
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Mat <m.falkowski@dotmat.de>
Co-committed-by: Mat <m.falkowski@dotmat.de>
2025-03-29 10:21:07 +00:00
0ko
bf8bdf12df chore(tests): refactor migration form test (#7374)
Ref https://codeberg.org/forgejo/forgejo/pulls/7373.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7374
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-03-29 09:06:03 +00:00
0ko
49ea851da9 chore(tests): fix testing failure caused by dep update (#7376)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7376
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-03-29 08:17:44 +00:00
Renovate Bot
fed2d81c44 Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-28 22:22:21 +00:00
0ko
51ff4970ec ui: improve error pages (#7274)
* add testing
* make each page accessible via `/devtest/error`
* allow translating the `Page not found` part of the title
* code: improve consistency, remove unused
* devtest: put index page in a container to fix alignment
* 500: make navbar more like the real one, remove fake menu button
* deadcode: remove unused `func NotFound`: it was added in bdd32f152d and the only usage was removed in 1bfb0a24d8

Preview:
https://codeberg.org/attachments/1b75afb3-e898-410f-be02-f036a5400143

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7274
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
2025-03-28 19:50:43 +00:00
Renovate Bot
683eb5bf78 Update https://data.forgejo.org/tj-actions/changed-files action to v46 (forgejo) (#7366)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7366
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-28 14:25:27 +00:00
Renovate Bot
cdf254816b Update module golang.org/x/net to v0.38.0 (forgejo) (#7362)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7362
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-28 14:12:05 +00:00
Renovate Bot
adce8fa7dd Update dependency eslint-plugin-unicorn to v58 (forgejo) (#7372)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-28 13:23:33 +00:00
Gusted
5380f23dab chore: use correct import (#7371)
- follow up for forgejo/forgejo#7355. It was merged before being rebased
on the forgejo branch

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7371
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-28 12:06:07 +00:00
ThomasBoom89
6cac7702e9 fix(api): encode empty requested reviewers as an empty array (#7355)
- Always initialize `RequestedReviewers` and `RequestedReviewersTeams`, this avoids the JSON encoder from encoding it to the zero value `null` and instead return a empty array.
- Resolves #4108
- Integration test added.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7355
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: ThomasBoom89 <thomasboom89@noreply.codeberg.org>
Co-committed-by: ThomasBoom89 <thomasboom89@noreply.codeberg.org>
2025-03-28 11:50:05 +00:00
Simon Ochsenreither
85ae9d710c fix(ui): improve vertical alignment of icons with text in the overflow menu (#7356)
- Follow up for #7314. Turns out this impacted the positioning of icons in tabs negatively, like the "Conversation"/"Commits"/"Files changed".
- Limit the change to the `overflow-menu` element.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7356
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Simon Ochsenreither <simon@ochsenreither.de>
Co-committed-by: Simon Ochsenreither <simon@ochsenreither.de>
2025-03-28 11:47:58 +00:00
Simon Ochsenreither
da8aa01466 fix(ui): improve vertical alignment of icons with text in the overflow menu (#7314)
- Add `vertical-align: baseline` to the svg class.
- Improves the vertical alignment of the icons that contain text in the overflow menu, and possibly in other places.
Co-authored-by: Simon Ochsenreither <simon@ochsenreither.de>
Co-committed-by: Simon Ochsenreither <simon@ochsenreither.de>
2025-03-27 21:07:59 +00:00
0ko
7990bcf333 feat(ui): improve button gap consistency, make it variable, larger on touchscreens (#7271)
* home buttons: use `button-sequence` for consistency of gaps with other ui
* folder-actions: use `button-sequence` for better overflowing and so gap actually works instead of relying on whitespace, because currently it doesn't due to lack of flex
* introduce variable `--button-spacing` for `button-row` and `button-sequence`
    * it's `0.33rem` on desktop for more pleasant hovering over button rows
    * it's `0.5rem` on touchscreens for worrying less about misstapping

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7271
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>
2025-03-27 21:01:29 +00:00
Gusted
2457f5ff22 chore: branding import path (#7337)
- Massive replacement of changing `code.gitea.io/gitea` to `forgejo.org`.
- Resolves forgejo/discussions#258

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7337
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-27 19:40:14 +00:00
Codeberg Translate
372a3dad83 i18n: update of translations from Codeberg Translate (#7275)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7275
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-committed-by: Codeberg Translate <translate@codeberg.org>
2025-03-27 07:35:27 +00:00
Ellen Emilia Anna Zscheile
d0a5531ebc feat(build): lint-locale-usage should detect more Tr functions (#7278)
Followup to https://codeberg.org/forgejo/forgejo/pulls/7109

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7278
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
2025-03-26 14:06:44 +00:00
Gusted
e84d3a0f53 fix(ui): Do not check for vertical-align (#7344)
- This makes the `repo-settings` e2e testing happy.
- There's no point into checking `vertical-align`; it has no effect when `position: absolute` is set, which is is currently set unconditionally for checkboxes and radios on forms.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7344
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-03-26 13:08:03 +00:00
Renovate Bot
6d7b4c8000 Update dependency mermaid to v11.6.0 (forgejo) (#7339)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7339
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2025-03-26 12:47:35 +00:00
2539 changed files with 32966 additions and 23845 deletions

View file

@ -1,7 +1,7 @@
code.gitea.io/gitea/cmd
forgejo.org/cmd
NoMainListener
code.gitea.io/gitea/cmd/forgejo
forgejo.org/cmd/forgejo
ContextSetNoInit
ContextSetNoExit
ContextSetStderr
@ -9,48 +9,48 @@ code.gitea.io/gitea/cmd/forgejo
ContextSetStdout
ContextSetStdin
code.gitea.io/gitea/models
forgejo.org/models
IsErrSHANotFound
IsErrMergeDivergingFastForwardOnly
code.gitea.io/gitea/models/auth
forgejo.org/models/auth
WebAuthnCredentials
code.gitea.io/gitea/models/db
forgejo.org/models/db
TruncateBeans
InTransaction
DumpTables
code.gitea.io/gitea/models/dbfs
forgejo.org/models/dbfs
file.renameTo
Create
Rename
code.gitea.io/gitea/models/forgefed
forgejo.org/models/forgefed
GetFederationHost
code.gitea.io/gitea/models/forgejo/semver
forgejo.org/models/forgejo/semver
GetVersion
SetVersionString
SetVersion
code.gitea.io/gitea/models/git
forgejo.org/models/git
RemoveDeletedBranchByID
code.gitea.io/gitea/models/issues
forgejo.org/models/issues
IsErrUnknownDependencyType
IsErrIssueWasClosed
code.gitea.io/gitea/models/organization
forgejo.org/models/organization
SearchMembersOptions.ToConds
code.gitea.io/gitea/models/perm/access
forgejo.org/models/perm/access
GetRepoWriters
code.gitea.io/gitea/models/repo
forgejo.org/models/repo
WatchRepoMode
code.gitea.io/gitea/models/user
forgejo.org/models/user
IsErrExternalLoginUserAlreadyExist
IsErrExternalLoginUserNotExist
NewFederatedUser
@ -58,35 +58,35 @@ code.gitea.io/gitea/models/user
GetUserAllSettings
DeleteUserSetting
code.gitea.io/gitea/modules/activitypub
forgejo.org/modules/activitypub
NewContext
Context.APClientFactory
code.gitea.io/gitea/modules/assetfs
forgejo.org/modules/assetfs
Bindata
code.gitea.io/gitea/modules/auth/password/hash
forgejo.org/modules/auth/password/hash
DummyHasher.HashWithSaltBytes
NewDummyHasher
code.gitea.io/gitea/modules/auth/password/pwn
forgejo.org/modules/auth/password/pwn
WithHTTP
code.gitea.io/gitea/modules/base
forgejo.org/modules/base
SetupGiteaRoot
code.gitea.io/gitea/modules/cache
forgejo.org/modules/cache
GetInt
WithNoCacheContext
RemoveContextData
code.gitea.io/gitea/modules/emoji
forgejo.org/modules/emoji
ReplaceCodes
code.gitea.io/gitea/modules/eventsource
forgejo.org/modules/eventsource
Event.String
code.gitea.io/gitea/modules/forgefed
forgejo.org/modules/forgefed
NewForgeUndoLike
ForgeUndoLike.UnmarshalJSON
ForgeUndoLike.Validate
@ -96,7 +96,7 @@ code.gitea.io/gitea/modules/forgefed
ToRepository
OnRepository
code.gitea.io/gitea/modules/git
forgejo.org/modules/git
AllowLFSFiltersArgs
AddChanges
AddChangesWithArgs
@ -106,55 +106,55 @@ code.gitea.io/gitea/modules/git
openRepositoryWithDefaultContext
ToEntryMode
code.gitea.io/gitea/modules/gitrepo
forgejo.org/modules/gitrepo
GetBranchCommitID
GetWikiDefaultBranch
code.gitea.io/gitea/modules/graceful
forgejo.org/modules/graceful
Manager.TerminateContext
Manager.Err
Manager.Value
Manager.Deadline
code.gitea.io/gitea/modules/hcaptcha
forgejo.org/modules/hcaptcha
WithHTTP
code.gitea.io/gitea/modules/hostmatcher
forgejo.org/modules/hostmatcher
HostMatchList.AppendPattern
code.gitea.io/gitea/modules/json
forgejo.org/modules/json
StdJSON.Marshal
StdJSON.Unmarshal
StdJSON.NewEncoder
StdJSON.NewDecoder
StdJSON.Indent
code.gitea.io/gitea/modules/log
forgejo.org/modules/log
NewEventWriterBuffer
code.gitea.io/gitea/modules/markup
forgejo.org/modules/markup
GetRendererByType
RenderString
IsMarkupFile
code.gitea.io/gitea/modules/markup/console
forgejo.org/modules/markup/console
Render
RenderString
code.gitea.io/gitea/modules/markup/markdown
forgejo.org/modules/markup/markdown
RenderRawString
code.gitea.io/gitea/modules/markup/mdstripper
forgejo.org/modules/markup/mdstripper
stripRenderer.AddOptions
StripMarkdown
code.gitea.io/gitea/modules/markup/orgmode
forgejo.org/modules/markup/orgmode
RenderString
code.gitea.io/gitea/modules/process
forgejo.org/modules/process
Manager.ExecTimeout
code.gitea.io/gitea/modules/queue
forgejo.org/modules/queue
newBaseChannelSimple
newBaseChannelUnique
newBaseRedisSimple
@ -163,71 +163,72 @@ code.gitea.io/gitea/modules/queue
testStateRecorder.Reset
newWorkerPoolQueueForTest
code.gitea.io/gitea/modules/queue/lqinternal
forgejo.org/modules/queue/lqinternal
QueueItemIDBytes
QueueItemKeyBytes
ListLevelQueueKeys
code.gitea.io/gitea/modules/setting
forgejo.org/modules/setting
NewConfigProviderFromData
GitConfigType.GetOption
InitLoggersForTest
code.gitea.io/gitea/modules/sync
forgejo.org/modules/sync
StatusTable.Start
StatusTable.IsRunning
code.gitea.io/gitea/modules/timeutil
forgejo.org/modules/timeutil
GetExecutableModTime
MockSet
MockUnset
code.gitea.io/gitea/modules/translation
forgejo.org/modules/translation
MockLocale.Language
MockLocale.TrString
MockLocale.Tr
MockLocale.TrN
MockLocale.TrPluralString
MockLocale.TrPluralStringAllForms
MockLocale.TrSize
MockLocale.HasKey
MockLocale.PrettyNumber
code.gitea.io/gitea/modules/util
forgejo.org/modules/translation/localeiter
IterateMessagesContent
forgejo.org/modules/util
OptionalArg
code.gitea.io/gitea/modules/util/filebuffer
forgejo.org/modules/util/filebuffer
CreateFromReader
code.gitea.io/gitea/modules/validation
forgejo.org/modules/validation
IsErrNotValid
code.gitea.io/gitea/modules/web
forgejo.org/modules/web
RouteMock
RouteMockReset
code.gitea.io/gitea/modules/zstd
forgejo.org/modules/zstd
NewWriter
Writer.Write
Writer.Close
code.gitea.io/gitea/routers/web
NotFound
code.gitea.io/gitea/routers/web/org
forgejo.org/routers/web/org
MustEnableProjects
code.gitea.io/gitea/services/context
forgejo.org/services/context
GetPrivateContext
code.gitea.io/gitea/services/repository
forgejo.org/services/repository
IsErrForkAlreadyExist
code.gitea.io/gitea/services/repository/files
forgejo.org/services/repository/files
ContentType.String
code.gitea.io/gitea/services/repository/gitgraph
forgejo.org/services/repository/gitgraph
Parser.Reset
code.gitea.io/gitea/services/webhook
forgejo.org/services/webhook
NewNotifier

View file

@ -4,13 +4,9 @@
"features": {
// installs nodejs into container
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
"version": "22"
},
"ghcr.io/devcontainers/features/git-lfs:1.2.3": {},
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
},
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {}
},
"customizations": {

View file

@ -12,6 +12,9 @@ insert_final_newline = true
[{*.{go,tmpl,html},Makefile,go.mod}]
indent_style = tab
[go.*]
indent_style = tab
[templates/custom/*.tmpl]
insert_final_newline = false

View file

@ -1,3 +1,3 @@
module code.gitea.io/gitea
module forgejo.org
go 1.23.3

View file

@ -47,7 +47,7 @@ jobs:
cat <<'EOF'
${{ toJSON(github) }}
EOF
- uses: https://data.forgejo.org/actions/git-backporting@v4.8.4
- uses: https://data.forgejo.org/actions/git-backporting@v4.8.5
with:
target-branch-pattern: "^backport/(?<target>(v.*))$"
strategy: ort

View file

@ -31,7 +31,7 @@ jobs:
|| contains(toJSON(github.event.pull_request.labels), 'test/manual')
)
run: |
echo "Test label must be set to either 'present', 'not-needed' or 'manual'."
echo "A team member must set the label to either 'present', 'not-needed' or 'manual'."
exit 1
- name: Missing manual test instructions
if: >

View file

@ -2,6 +2,8 @@
#
# See also https://forgejo.org/docs/next/contributor/release/#stable-release-process
#
# TOKEN_NEXT_DIGEST is a token with write repository access to https://invisible.forgejo.org/infrastructure/next-digest issued by https://invisible.forgejo.org/forgejo-next-digest
#
# https://codeberg.org/forgejo-experimental/forgejo
#
# Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental
@ -14,7 +16,7 @@
# vars.DOER: forgejo-experimental-ci
# secrets.TOKEN: <generated from codeberg.org/forgejo-experimental-ci>
#
# http://private.forgejo.org/forgejo/forgejo
# http://invisible.forgejo.org/forgejo/forgejo
#
# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo
#
@ -80,7 +82,7 @@ jobs:
- name: upgrade v*.next.forgejo.org
uses: https://data.forgejo.org/infrastructure/next-digest@v1.1.0
with:
url: https://placeholder:${{ secrets.TOKEN_NEXT_DIGEST }}@code.forgejo.org/infrastructure/next-digest
url: https://placeholder:${{ secrets.TOKEN_NEXT_DIGEST }}@invisible.forgejo.org/infrastructure/next-digest
ref_name: '${{ github.ref_name }}'
image: 'codeberg.org/forgejo-experimental/forgejo'
tag_suffix: '-rootless'

View file

@ -4,6 +4,9 @@ on:
schedule:
- cron: '@daily'
env:
RNA_VERSION: v1.2.5 # renovate: datasource=gitea-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org
jobs:
release-notes:
if: vars.ROLE == 'forgejo-coding'
@ -29,5 +32,5 @@ jobs:
set -x
curl -sS $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/milestones?state=open | jq -r '.[] | .title' | while read forgejo version ; do
milestone="$forgejo $version"
go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.1 --config .release-notes-assistant.yaml --storage milestone --storage-location "$milestone" --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} release $version
go run code.forgejo.org/forgejo/release-notes-assistant@$RNA_VERSION --config .release-notes-assistant.yaml --storage milestone --storage-location "$milestone" --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} release $version
done

View file

@ -7,6 +7,9 @@ on:
- synchronize
- labeled
env:
RNA_VERSION: v1.2.5 # renovate: datasource=gitea-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org
jobs:
release-notes:
if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note')
@ -38,4 +41,4 @@ jobs:
- name: release-notes-assistant preview
run: |
go run code.forgejo.org/forgejo/release-notes-assistant@v1.1.1 --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }}
go run code.forgejo.org/forgejo/release-notes-assistant@$RNA_VERSION --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }}

View file

@ -20,7 +20,7 @@ env:
RENOVATE_REPOSITORIES: ${{ github.repository }}
# fix because 10.0.0-58-7e1df53+gitea-1.22.0 < 10.0.0 for semver
# and codeberg api returns such versions from `git describe --tags`
RENOVATE_X_PLATFORM_VERSION: 10.0.0+gitea-1.22.0
# RENOVATE_X_PLATFORM_VERSION: 10.0.0+gitea-1.22.0 currently not needed
jobs:
renovate:
@ -28,7 +28,7 @@ jobs:
runs-on: docker
container:
image: data.forgejo.org/renovate/renovate:39.212.0
image: data.forgejo.org/renovate/renovate:40.31.0
steps:
- name: Load renovate repo cache

View file

@ -116,7 +116,7 @@ jobs:
- uses: ./.forgejo/workflows-composite/build-backend
- name: Get changed files
id: changed-files
uses: https://data.forgejo.org/tj-actions/changed-files@v45
uses: https://data.forgejo.org/tj-actions/changed-files@v46
with:
separator: '\n'
- run: |

1
.gitignore vendored
View file

@ -57,6 +57,7 @@ cpu.out
/gitea-vet
/debug
/integrations.test
/forgejo
/bin
/dist

View file

@ -1,7 +1,9 @@
version: "2"
output:
sort-order:
- file
linters:
enable-all: false
disable-all: true
fast: false
default: none
enable:
- bidichk
- depguard
@ -9,37 +11,37 @@ linters:
- errcheck
- forbidigo
- gocritic
- gofmt
- gofumpt
- gosimple
- govet
- ineffassign
- nakedret
- nolintlint
- revive
- staticcheck
- stylecheck
- testifylint
- typecheck
- unconvert
- unused
- unparam
- unused
- usetesting
- wastedassign
run:
timeout: 10m
output:
sort-results: true
sort-order: [file]
show-stats: true
linters-settings:
stylecheck:
checks: ["all", "-ST1005", "-ST1003"]
nakedret:
max-func-lines: 0
settings:
depguard:
rules:
main:
deny:
- pkg: encoding/json
desc: use gitea's modules/json instead of encoding/json
- pkg: github.com/unknwon/com
desc: use gitea's util and replacements
- pkg: io/ioutil
desc: use os or io instead
- pkg: golang.org/x/exp
desc: it's experimental and unreliable
- pkg: forgejo.org/modules/git/internal
desc: do not use the internal package, use AddXxx function instead
- pkg: gopkg.in/ini.v1
desc: do not use the ini package, use gitea's config system instead
- pkg: github.com/minio/sha256-simd
desc: use crypto/sha256 instead, see https://codeberg.org/forgejo/forgejo/pulls/1528
gocritic:
disabled-checks:
- ifElseChain
@ -79,72 +81,85 @@ linters-settings:
- name: var-naming
- name: redefines-builtin-id
disabled: true
gofumpt:
extra-rules: true
depguard:
rules:
main:
deny:
- pkg: encoding/json
desc: use gitea's modules/json instead of encoding/json
- pkg: github.com/unknwon/com
desc: use gitea's util and replacements
- pkg: io/ioutil
desc: use os or io instead
- pkg: golang.org/x/exp
desc: it's experimental and unreliable
- pkg: code.gitea.io/gitea/modules/git/internal
desc: do not use the internal package, use AddXxx function instead
- pkg: gopkg.in/ini.v1
desc: do not use the ini package, use gitea's config system instead
- pkg: github.com/minio/sha256-simd
desc: use crypto/sha256 instead, see https://codeberg.org/forgejo/forgejo/pulls/1528
staticcheck:
checks:
- all
testifylint:
disable:
- go-require
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- nolintlint
path: models/db/sql_postgres_with_schema.go
- linters:
- dupl
- errcheck
- gocyclo
- gosec
- staticcheck
- unparam
path: _test\.go
- linters:
- dupl
- errcheck
- gocyclo
- gosec
path: models/migrations/v
- linters:
- forbidigo
path: cmd
- linters:
- dupl
text: (?i)webhook
- linters:
- gocritic
text: (?i)`ID' should not be capitalized
- linters:
- deadcode
- unused
text: (?i)swagger
- linters:
- staticcheck
text: (?i)argument x is overwritten before first use
- linters:
- gocritic
text: '(?i)commentFormatting: put a space between `//` and comment text'
- linters:
- gocritic
text: '(?i)exitAfterDefer:'
- linters:
- staticcheck
text: "(ST1005|ST1003|QF1001):"
paths:
- node_modules
- public
- web_src
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-dirs: [node_modules, public, web_src]
exclude-case-sensitive: true
exclude-rules:
- path: models/db/sql_postgres_with_schema.go
linters:
- nolintlint
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- unparam
- staticcheck
- path: models/migrations/v
linters:
- gocyclo
- errcheck
- dupl
- gosec
- path: cmd
linters:
- forbidigo
- text: "webhook"
linters:
- dupl
- text: "`ID' should not be capitalized"
linters:
- gocritic
- text: "swagger"
linters:
- unused
- deadcode
- text: "argument x is overwritten before first use"
linters:
- staticcheck
- text: "commentFormatting: put a space between `//` and comment text"
linters:
- gocritic
- text: "exitAfterDefer:"
linters:
- gocritic
formatters:
enable:
- gofmt
- gofumpt
settings:
gofumpt:
extra-rules: true
exclusions:
generated: lax
paths:
- node_modules
- public
- web_src
- third_party$
- builtin$
- examples$

View file

@ -36,10 +36,6 @@ GARGS = "--no-print-directory"
JARG = -j$(.MAKE.JOBS)
.endif
# bmake prefers out-of-source builds and tries to cd into ./obj (among others)
# where possible. GNU Make doesn't, so override that value.
.OBJDIR: ./
# The GNU convention is to use the lowercased `prefix` variable/macro to
# specify the installation directory. Humor them.
GPREFIX =
@ -48,11 +44,12 @@ GPREFIX =
.endif
.BEGIN: .SILENT
which $(GMAKE) || (printf "Error: GNU Make is required!\n\n" 1>&2 && false)
which $(GMAKE) >/dev/null || (printf "Error: GNU Make is required!\n\n" 1>&2 && false)
.PHONY: FRC
$(.TARGETS): FRC
$(GMAKE) $(GPREFIX) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG)
.PHONY: EMPTY
EMPTY: .SILENT
$(GMAKE) $(GPREFIX) $(GARGS) $(JARG)
.DONE .DEFAULT: .SILENT
$(GMAKE) $(GPREFIX) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG)
.PHONY: $(.TARGETS)
$(.TARGETS): .SILENT
$(GMAKE) $(GPREFIX) $(GARGS) $(JARG) $@

View file

@ -9,10 +9,10 @@
# Files related to frontend development.
# Javascript and CSS code.
web_src/.* @caesar @crystal @gusted
web_src/.* @beowulf @gusted
# HTML templates used by the backend.
templates/.* @caesar @crystal @gusted
templates/.* @beowulf @gusted
## the issue sidebar was touched by fnetx
templates/repo/issue/view_content/sidebar.* @fnetx

View file

@ -3,7 +3,7 @@ FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.24-alpine3.21 AS build-env
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-direct}
ENV GOPROXY=${GOPROXY:-https://proxy.golang.org,direct}
ARG RELEASE_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
@ -30,8 +30,8 @@ RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
RUN apk --no-cache add build-base git nodejs npm
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
COPY . ${GOPATH}/src/forgejo.org
WORKDIR ${GOPATH}/src/forgejo.org
RUN make clean
RUN make frontend
@ -47,9 +47,9 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \
/tmp/local/etc/s6/gitea/* \
/tmp/local/etc/s6/openssh/* \
/tmp/local/etc/s6/.s6-svscan/* \
/go/src/code.gitea.io/gitea/gitea \
/go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
/go/src/forgejo.org/gitea \
/go/src/forgejo.org/environment-to-ini
RUN chmod 644 /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete
FROM data.forgejo.org/oci/alpine:3.21
ARG RELEASE_VERSION
@ -102,7 +102,7 @@ CMD ["/usr/bin/s6-svscan", "/etc/s6"]
COPY --from=build-env /tmp/local /
RUN cd /usr/local/bin ; ln -s gitea forgejo
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
COPY --from=build-env /go/src/forgejo.org/gitea /app/gitea/gitea
RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
COPY --from=build-env /go/src/forgejo.org/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh

View file

@ -3,7 +3,7 @@ FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.24-alpine3.21 AS build-env
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-direct}
ENV GOPROXY=${GOPROXY:-https://proxy.golang.org,direct}
ARG RELEASE_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
@ -30,8 +30,8 @@ RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
RUN apk --no-cache add build-base git nodejs npm
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
COPY . ${GOPATH}/src/forgejo.org
WORKDIR ${GOPATH}/src/forgejo.org
RUN make clean
RUN make frontend
@ -45,9 +45,9 @@ COPY docker/rootless /tmp/local
RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
/tmp/local/usr/local/bin/docker-setup.sh \
/tmp/local/usr/local/bin/gitea \
/go/src/code.gitea.io/gitea/gitea \
/go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
/go/src/forgejo.org/gitea \
/go/src/forgejo.org/environment-to-ini
RUN chmod 644 /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete
FROM data.forgejo.org/oci/alpine:3.21
ARG RELEASE_VERSION
@ -91,10 +91,10 @@ RUN chown git:git /var/lib/gitea /etc/gitea
COPY --from=build-env /tmp/local /
RUN cd /usr/local/bin ; ln -s gitea forgejo
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
COPY --from=build-env --chown=root:root /go/src/forgejo.org/gitea /app/gitea/gitea
RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
COPY --from=build-env --chown=root:root /go/src/forgejo.org/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
#git:git
USER 1000:1000

164
Makefile
View file

@ -16,7 +16,7 @@ else
DIST := dist
DIST_DIRS := $(DIST)/binaries $(DIST)/release
IMPORT := code.gitea.io/gitea
IMPORT := forgejo.org
GO ?= $(shell go env GOROOT)/bin/go
SHASUM ?= shasum -a 256
@ -38,18 +38,18 @@ XGO_VERSION := go-1.21.x
AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.2.1 # renovate: datasource=go
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.7.0 # renovate: datasource=go
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.7 # renovate: datasource=go
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.8.0 # renovate: datasource=go
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 # renovate: datasource=go
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # renovate: datasource=go
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.6.0 # renovate: datasource=go
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # renovate: datasource=go
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0 # renovate: datasource=go
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 # renovate: datasource=go
DEADCODE_PACKAGE ?= golang.org/x/tools/cmd/deadcode@v0.31.0 # renovate: datasource=go
GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.4.0 # renovate: datasource=go
DEADCODE_PACKAGE ?= golang.org/x/tools/cmd/deadcode@v0.32.0 # renovate: datasource=go
GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.5.1 # renovate: datasource=go
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.18.1 # renovate: datasource=go
RENOVATE_NPM_PACKAGE ?= renovate@39.212.0 # renovate: datasource=docker packageName=data.forgejo.org/renovate/renovate
RENOVATE_NPM_PACKAGE ?= renovate@40.31.0 # renovate: datasource=docker packageName=data.forgejo.org/renovate/renovate
# https://github.com/disposable-email-domains/disposable-email-domains/commits/main/
DISPOSABLE_EMAILS_SHA ?= 0c27e671231d27cf66370034d7f6818037416989 # renovate: ...
@ -92,29 +92,22 @@ else
FORGEJO_VERSION_API ?= $(GITEA_VERSION)+${GITEA_COMPATIBILITY}
else
# drop the "g" prefix prepended by git describe to the commit hash
FORGEJO_VERSION ?= $(shell git describe --exclude '*-test' --tags --always | sed 's/^v//' | sed 's/\-g/-/')+${GITEA_COMPATIBILITY}
FORGEJO_VERSION ?= $(shell git describe --exclude '*-test' --tags --always 2>/dev/null | sed 's/^v//' | sed 's/\-g/-/')
ifneq ($(FORGEJO_VERSION),)
ifeq ($(findstring $(GITEA_COMPATIBILITY),$(FORGEJO_VERSION)),)
FORGEJO_VERSION := $(FORGEJO_VERSION)+$(GITEA_COMPATIBILITY)
endif
endif
endif
endif
FORGEJO_VERSION_MAJOR=$(shell echo $(FORGEJO_VERSION) | sed -e 's/\..*//')
FORGEJO_VERSION_MINOR=$(shell echo $(FORGEJO_VERSION) | sed -E -e 's/^([0-9]+\.[0-9]+).*/\1/')
show-version-full:
@echo ${FORGEJO_VERSION}
show-version-major:
@echo ${FORGEJO_VERSION_MAJOR}
show-version-minor:
@echo ${FORGEJO_VERSION_MINOR}
RELEASE_VERSION ?= ${FORGEJO_VERSION}
VERSION ?= ${RELEASE_VERSION}
FORGEJO_VERSION_API ?= ${FORGEJO_VERSION}
show-version-api:
@echo ${FORGEJO_VERSION_API}
# Strip binaries by default to reduce size, allow overriding for debugging
STRIP ?= 1
ifeq ($(STRIP),1)
@ -125,10 +118,10 @@ LDFLAGS := $(LDFLAGS) -X "main.ReleaseVersion=$(RELEASE_VERSION)" -X "main.MakeV
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
ifeq ($(HAS_GO), yes)
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) $(shell $(GO) list code.gitea.io/gitea/models/forgejo_migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./...))
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list forgejo.org/models/migrations/...) $(shell $(GO) list forgejo.org/models/forgejo_migrations/...) forgejo.org/tests/integration/migration-test forgejo.org/tests forgejo.org/tests/integration forgejo.org/tests/e2e,$(shell $(GO) list ./...))
endif
REMOTE_CACHER_MODULES ?= cache nosql session queue
GO_TEST_REMOTE_CACHER_PACKAGES ?= $(addprefix code.gitea.io/gitea/modules/,$(REMOTE_CACHER_MODULES))
GO_TEST_REMOTE_CACHER_PACKAGES ?= $(addprefix forgejo.org/modules/,$(REMOTE_CACHER_MODULES))
FOMANTIC_WORK_DIR := web_src/fomantic
@ -169,7 +162,7 @@ GO_SOURCES += $(GENERATED_GO_DEST)
GO_SOURCES_NO_BINDATA := $(GO_SOURCES)
ifeq ($(HAS_GO), yes)
MIGRATION_PACKAGES := $(shell $(GO) list code.gitea.io/gitea/models/migrations/... code.gitea.io/gitea/models/forgejo_migrations/...)
MIGRATION_PACKAGES := $(shell $(GO) list forgejo.org/models/migrations/... forgejo.org/models/forgejo_migrations/...)
endif
ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
@ -221,16 +214,12 @@ help:
@echo " - deps-frontend install frontend dependencies"
@echo " - deps-backend install backend dependencies"
@echo " - deps-tools install tool dependencies"
@echo " - deps-py install python dependencies"
@echo " - lint lint everything"
@echo " - lint-fix lint everything and fix issues"
@echo " - lint-frontend lint frontend files"
@echo " - lint-frontend-fix lint frontend files and fix issues"
@echo " - lint-backend lint backend files"
@echo " - lint-backend-fix lint backend files and fix issues"
@echo " - lint-codespell lint typos"
@echo " - lint-codespell-fix lint typos and fix them automatically"
@echo " - lint-codespell-fix-i lint typos and fix them interactively"
@echo " - lint-go lint go files"
@echo " - lint-go-fix lint go files and fix issues"
@echo " - lint-go-vet lint go files with vet"
@ -241,11 +230,7 @@ help:
@echo " - lint-css-fix lint css files and fix issues"
@echo " - lint-md lint markdown files"
@echo " - lint-swagger lint swagger files"
@echo " - lint-templates lint template files"
@echo " - lint-renovate lint renovate files"
@echo " - lint-yaml lint yaml files"
@echo " - lint-spell lint spelling"
@echo " - lint-spell-fix lint spelling and fix issues"
@echo " - checks run various consistency checks"
@echo " - checks-frontend check frontend files"
@echo " - checks-backend check backend files"
@ -276,6 +261,30 @@ help:
@echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
@echo " - reproduce-build\#version build a reproducible binary for the specified release version"
.PHONY: verify-version
verify-version:
ifeq ($(FORGEJO_VERSION),)
@echo "Error: Could not determine FORGEJO_VERSION; version file $(STORED_VERSION_FILE) not present and no suitable git tag found"
@echo 'In most cases this likely means you forgot to fetch git tags, you can fix this by executing `git fetch --tags`. If this is not possible and this is part of a custom build process, then you can set a specific version by writing it to $(STORED_VERSION_FILE) (This must be a semver compatible version).'
@false
endif
.PHONY: show-version-full
show-version-full: verify-version
@echo ${FORGEJO_VERSION}
.PHONY: show-version-major
show-version-major: verify-version
@echo ${FORGEJO_VERSION_MAJOR}
.PHONY: show-version-minor
show-version-minor: verify-version
@echo ${FORGEJO_VERSION_MINOR}
.PHONY: show-version-api
show-version-api: verify-version
@echo ${FORGEJO_VERSION_API}
###
# Check system and environment requirements
###
@ -401,10 +410,10 @@ checks-frontend: lockfile-check svg-check
checks-backend: tidy-check swagger-check fmt-check swagger-validate security-check
.PHONY: lint
lint: lint-frontend lint-backend lint-spell
lint: lint-frontend lint-backend
.PHONY: lint-fix
lint-fix: lint-frontend-fix lint-backend-fix lint-spell-fix
lint-fix: lint-frontend-fix lint-backend-fix
.PHONY: lint-frontend
lint-frontend: lint-js lint-css
@ -418,18 +427,6 @@ lint-backend: lint-go lint-go-vet lint-editorconfig lint-renovate lint-locale li
.PHONY: lint-backend-fix
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig lint-disposable-emails-fix
.PHONY: lint-codespell
lint-codespell: deps-py
@poetry run codespell
.PHONY: lint-codespell-fix
lint-codespell-fix: deps-py
@poetry run codespell -w
.PHONY: lint-codespell-fix-i
lint-codespell-fix-i: deps-py
@poetry run codespell -w -i 3 -C 2
.PHONY: lint-js
lint-js: node_modules
npx eslint --color --max-warnings=0
@ -452,8 +449,8 @@ lint-swagger: node_modules
.PHONY: lint-renovate
lint-renovate: node_modules
npx --yes --package $(RENOVATE_NPM_PACKAGE) -- renovate-config-validator --strict > .lint-renovate 2>&1 || true
@if grep --quiet --extended-regexp -e '^( WARN:|ERROR:)' .lint-renovate ; then cat .lint-renovate ; rm .lint-renovate ; exit 1 ; fi
npx --yes --package $(RENOVATE_NPM_PACKAGE) -- renovate-config-validator > .lint-renovate 2>&1 || true
@if grep --quiet --extended-regexp -e '^( ERROR:)' .lint-renovate ; then cat .lint-renovate ; rm .lint-renovate ; exit 1 ; fi
@rm .lint-renovate
.PHONY: lint-locale
@ -462,21 +459,13 @@ lint-locale:
.PHONY: lint-locale-usage
lint-locale-usage:
$(GO) run build/lint-locale-usage/lint-locale-usage.go --allow-missing-msgids
$(GO) run build/lint-locale-usage/lint-locale-usage.go
.PHONY: lint-md
lint-md: node_modules
npx markdownlint docs *.md
.PHONY: lint-spell
lint-spell: lint-codespell
@go run $(MISSPELL_PACKAGE) -error $(SPELLCHECK_FILES)
.PHONY: lint-spell-fix
lint-spell-fix: lint-codespell-fix
@go run $(MISSPELL_PACKAGE) -w $(SPELLCHECK_FILES)
RUN_DEADCODE = $(GO) run $(DEADCODE_PACKAGE) -generated=false -f='{{println .Path}}{{range .Funcs}}{{printf "\t%s\n" .Name}}{{end}}{{println}}' -test code.gitea.io/gitea
RUN_DEADCODE = $(GO) run $(DEADCODE_PACKAGE) -generated=false -f='{{println .Path}}{{range .Funcs}}{{printf "\t%s\n" .Name}}{{end}}{{println}}' -test forgejo.org
.PHONY: lint-go
lint-go:
@ -512,18 +501,9 @@ lint-disposable-emails:
lint-disposable-emails-fix:
$(GO) run build/generate-disposable-email.go -r $(DISPOSABLE_EMAILS_SHA)
.PHONY: lint-templates
lint-templates: .venv node_modules
@node tools/lint-templates-svg.js
@poetry run djlint $(shell find templates -type f -iname '*.tmpl')
.PHONY: lint-yaml
lint-yaml: .venv
@poetry run yamllint -s .
.PHONY: security-check
security-check:
go run $(GOVULNCHECK_PACKAGE) ./...
go run $(GOVULNCHECK_PACKAGE) -show color ./...
###
# Development and testing targets
@ -610,7 +590,7 @@ tidy-check: tidy
go-licenses: $(GO_LICENSE_FILE)
$(GO_LICENSE_FILE): go.mod go.sum
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --ignore code.gitea.io/gitea --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --ignore forgejo.org --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
$(GO) run build/generate-go-licenses.go $(GO_LICENSE_TMP_DIR) $(GO_LICENSE_FILE)
@rm -rf $(GO_LICENSE_TMP_DIR)
@ -740,33 +720,33 @@ integration-test-coverage-sqlite: integrations.cover.sqlite.test generate-ini-sq
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.cover.sqlite.test -test.coverprofile=integration.coverage.out
integrations.mysql.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.mysql.test
integrations.pgsql.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.pgsql.test
integrations.sqlite.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)'
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)'
integrations.cover.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test
integrations.cover.sqlite.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
.PHONY: migrations.mysql.test
migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.mysql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.mysql.test $(GOTESTCOMPILEDRUNSUFFIX)
.PHONY: migrations.pgsql.test
migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.pgsql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX)
.PHONY: migrations.sqlite.test
migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX)
.PHONY: migrations.individual.mysql.test
@ -777,7 +757,7 @@ migrations.individual.mysql.test: $(GO_SOURCES)
.PHONY: migrations.individual.sqlite.test\#%
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
.PHONY: migrations.individual.pgsql.test
migrations.individual.pgsql.test: $(GO_SOURCES)
@ -787,7 +767,7 @@ migrations.individual.pgsql.test: $(GO_SOURCES)
.PHONY: migrations.individual.pgsql.test\#%
migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
.PHONY: migrations.individual.sqlite.test
migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
@ -797,16 +777,16 @@ migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
.PHONY: migrations.individual.sqlite.test\#%
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$*
e2e.mysql.test: $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.mysql.test
e2e.pgsql.test: $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.pgsql.test
e2e.sqlite.test: $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)'
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)'
.PHONY: check
check: test
@ -816,7 +796,7 @@ check: test
###
.PHONY: install $(TAGS_PREREQ)
install: $(wildcard *.go)
install: $(wildcard *.go) | verify-version
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)'
.PHONY: build
@ -844,13 +824,13 @@ generate-go: $(TAGS_PREREQ)
merge-locales:
@echo "NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY"
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ) | verify-version
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@
forgejo: $(EXECUTABLE)
ln -f $(EXECUTABLE) forgejo
static-executable: $(GO_SOURCES) $(TAGS_PREREQ)
static-executable: $(GO_SOURCES) $(TAGS_PREREQ) | verify-version
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE)
.PHONY: release
@ -863,18 +843,18 @@ $(DIST_DIRS):
mkdir -p $(DIST_DIRS)
.PHONY: release-linux
release-linux: | $(DIST_DIRS)
release-linux: | $(DIST_DIRS) verify-version
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out forgejo-$(VERSION) .
ifeq ($(CI),true)
cp /build/* $(DIST)/binaries
endif
.PHONY: release-darwin
release-darwin: | $(DIST_DIRS)
release-darwin: | $(DIST_DIRS) verify-version
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin-10.12/amd64,darwin-10.12/arm64' -out gitea-$(VERSION) .
.PHONY: release-freebsd
release-freebsd: | $(DIST_DIRS)
release-freebsd: | $(DIST_DIRS) verify-version
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'freebsd/amd64' -out gitea-$(VERSION) .
.PHONY: release-copy
@ -928,10 +908,7 @@ reproduce-build\#%:
###
.PHONY: deps
deps: deps-frontend deps-backend deps-tools deps-py
.PHONY: deps-py
deps-py: .venv
deps: deps-frontend deps-backend deps-tools
.PHONY: deps-frontend
deps-frontend: node_modules
@ -1013,12 +990,11 @@ generate-gitignore:
.PHONY: generate-gomock
generate-gomock:
$(GO) run $(GOMOCK_PACKAGE) -package mock -destination ./modules/queue/mock/redisuniversalclient.go code.gitea.io/gitea/modules/nosql RedisClient
$(GO) run $(GOMOCK_PACKAGE) -package mock -destination ./modules/queue/mock/redisuniversalclient.go forgejo.org/modules/nosql RedisClient
.PHONY: generate-images
generate-images: | node_modules
npm install --no-save fabric@6 imagemin-zopfli@7
node tools/generate-images.js $(TAGS)
node tools/generate-images.js
.PHONY: generate-manpage
generate-manpage:

File diff suppressed because one or more lines are too long

View file

@ -12,8 +12,8 @@ import (
"path/filepath"
"strings"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/container"
"forgejo.org/modules/setting"
)
func main() {

View file

@ -15,7 +15,7 @@ import (
"strconv"
"strings"
"code.gitea.io/gitea/build/codeformat"
"forgejo.org/build/codeformat"
)
// Windows has a limitation for command line arguments, the size can not exceed 32KB.

View file

@ -14,7 +14,7 @@ import (
var importPackageGroupOrders = map[string]int{
"": 1, // internal
"code.gitea.io/gitea/": 2,
"forgejo.org/": 2,
}
var errInvalidCommentBetweenImports = errors.New("comments between imported packages are invalid, please move comments to the end of the package line")

View file

@ -58,8 +58,8 @@ import (
"code.gitea.io/other/package"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"forgejo.org/modules/setting"
"forgejo.org/modules/util"
"xorm.io/the/package"
@ -82,8 +82,8 @@ import (
_ "image/jpeg" // for processing jpeg images
_ "image/png" // for processing png images
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"forgejo.org/modules/setting"
"forgejo.org/modules/util"
"code.gitea.io/other/package"
"github.com/issue9/identicon"

View file

@ -20,7 +20,7 @@ import (
"strings"
"unicode/utf8"
"code.gitea.io/gitea/modules/json"
"forgejo.org/modules/json"
)
const (

View file

@ -15,7 +15,7 @@ import (
"path/filepath"
"strings"
"code.gitea.io/gitea/modules/util"
"forgejo.org/modules/util"
)
func main() {

View file

@ -16,7 +16,7 @@ import (
"sort"
"strings"
"code.gitea.io/gitea/modules/container"
"forgejo.org/modules/container"
)
// regexp is based on go-license, excluding README and NOTICE
@ -102,9 +102,9 @@ func main() {
pkgName := path.Dir(pkgPath)
// There might be a bug somewhere in go-licenses that sometimes interprets the
// root package as "." and sometimes as "code.gitea.io/gitea". Workaround by
// root package as "." and sometimes as "forgejo.org". Workaround by
// removing both of them for the sake of stable output.
if pkgName == "." || pkgName == "code.gitea.io/gitea" {
if pkgName == "." || pkgName == "forgejo.org" {
continue
}

View file

@ -15,7 +15,7 @@ import (
"path/filepath"
"strings"
"code.gitea.io/gitea/modules/util"
"forgejo.org/modules/util"
)
func main() {

View file

@ -17,17 +17,15 @@ import (
"text/template"
tmplParser "text/template/parse"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/locale"
fjTemplates "code.gitea.io/gitea/modules/templates"
"code.gitea.io/gitea/modules/util"
"forgejo.org/modules/container"
fjTemplates "forgejo.org/modules/templates"
"forgejo.org/modules/translation/localeiter"
"forgejo.org/modules/util"
)
// this works by first gathering all valid source string IDs from `en-US` reference files
// and then checking if all used source strings are actually defined
type OnMsgidHandler func(fset *token.FileSet, pos token.Pos, msgid string)
type LocatedError struct {
Location string
Kind string
@ -49,8 +47,24 @@ func (e LocatedError) Error() string {
return sb.String()
}
func isLocaleTrFunction(funcname string) bool {
return funcname == "Tr" || funcname == "TrN"
func InitLocaleTrFunctions() map[string][]uint {
ret := make(map[string][]uint)
f0 := []uint{0}
ret["Tr"] = f0
ret["TrString"] = f0
ret["TrHTML"] = f0
ret["TrPluralString"] = []uint{1}
ret["TrN"] = []uint{1, 2}
return ret
}
type Handler struct {
OnMsgid func(fset *token.FileSet, pos token.Pos, msgid string)
OnUnexpectedInvoke func(fset *token.FileSet, pos token.Pos, funcname string, argc int)
LocaleTrFunctions map[string][]uint
}
// the `Handle*File` functions follow the following calling convention:
@ -58,7 +72,7 @@ func isLocaleTrFunction(funcname string) bool {
// * `src` is either `nil` (then the function invokes `ReadFile` to read the file)
// or the contents of the file as {`[]byte`, or a `string`}
func (omh OnMsgidHandler) HandleGoFile(fname string, src any) error {
func (handler Handler) HandleGoFile(fname string, src any) error {
fset := token.NewFileSet()
node, err := goParser.ParseFile(fset, fname, src, goParser.SkipObjectResolution)
if err != nil {
@ -70,31 +84,47 @@ func (omh OnMsgidHandler) HandleGoFile(fname string, src any) error {
}
ast.Inspect(node, func(n ast.Node) bool {
// search for function calls of the form `anything.Tr(any-string-lit)`
// search for function calls of the form `anything.Tr(any-string-lit, ...)`
call, ok := n.(*ast.CallExpr)
if !ok || len(call.Args) != 1 {
if !ok || len(call.Args) < 1 {
return true
}
funSel, ok := call.Fun.(*ast.SelectorExpr)
if (!ok) || !isLocaleTrFunction(funSel.Sel.Name) {
if !ok {
return true
}
argLit, ok := call.Args[0].(*ast.BasicLit)
if (!ok) || argLit.Kind != token.STRING {
ltf, ok := handler.LocaleTrFunctions[funSel.Sel.Name]
if !ok {
return true
}
var gotUnexpectedInvoke *int
for _, argNum := range ltf {
if len(call.Args) >= int(argNum+1) {
argLit, ok := call.Args[int(argNum)].(*ast.BasicLit)
if !ok || argLit.Kind != token.STRING {
continue
}
// extract string content
arg, err := strconv.Unquote(argLit.Value)
if err != nil {
return true
if err == nil {
// found interesting strings
handler.OnMsgid(fset, argLit.ValuePos, arg)
}
} else {
argc := len(call.Args)
gotUnexpectedInvoke = &argc
}
}
// found interesting string
omh(fset, argLit.ValuePos, arg)
if gotUnexpectedInvoke != nil {
handler.OnUnexpectedInvoke(fset, funSel.Sel.NamePos, funSel.Sel.Name, *gotUnexpectedInvoke)
}
return true
})
@ -103,33 +133,33 @@ func (omh OnMsgidHandler) HandleGoFile(fname string, src any) error {
}
// derived from source: modules/templates/scopedtmpl/scopedtmpl.go, L169-L213
func (omh OnMsgidHandler) handleTemplateNode(fset *token.FileSet, node tmplParser.Node) {
func (handler Handler) handleTemplateNode(fset *token.FileSet, node tmplParser.Node) {
switch node.Type() {
case tmplParser.NodeAction:
omh.handleTemplatePipeNode(fset, node.(*tmplParser.ActionNode).Pipe)
handler.handleTemplatePipeNode(fset, node.(*tmplParser.ActionNode).Pipe)
case tmplParser.NodeList:
nodeList := node.(*tmplParser.ListNode)
omh.handleTemplateFileNodes(fset, nodeList.Nodes)
handler.handleTemplateFileNodes(fset, nodeList.Nodes)
case tmplParser.NodePipe:
omh.handleTemplatePipeNode(fset, node.(*tmplParser.PipeNode))
handler.handleTemplatePipeNode(fset, node.(*tmplParser.PipeNode))
case tmplParser.NodeTemplate:
omh.handleTemplatePipeNode(fset, node.(*tmplParser.TemplateNode).Pipe)
handler.handleTemplatePipeNode(fset, node.(*tmplParser.TemplateNode).Pipe)
case tmplParser.NodeIf:
nodeIf := node.(*tmplParser.IfNode)
omh.handleTemplateBranchNode(fset, nodeIf.BranchNode)
handler.handleTemplateBranchNode(fset, nodeIf.BranchNode)
case tmplParser.NodeRange:
nodeRange := node.(*tmplParser.RangeNode)
omh.handleTemplateBranchNode(fset, nodeRange.BranchNode)
handler.handleTemplateBranchNode(fset, nodeRange.BranchNode)
case tmplParser.NodeWith:
nodeWith := node.(*tmplParser.WithNode)
omh.handleTemplateBranchNode(fset, nodeWith.BranchNode)
handler.handleTemplateBranchNode(fset, nodeWith.BranchNode)
case tmplParser.NodeCommand:
nodeCommand := node.(*tmplParser.CommandNode)
omh.handleTemplateFileNodes(fset, nodeCommand.Args)
handler.handleTemplateFileNodes(fset, nodeCommand.Args)
if len(nodeCommand.Args) != 2 {
if len(nodeCommand.Args) < 2 {
return
}
@ -138,54 +168,66 @@ func (omh OnMsgidHandler) handleTemplateNode(fset *token.FileSet, node tmplParse
return
}
nodeString, ok := nodeCommand.Args[1].(*tmplParser.StringNode)
nodeIdent, ok := nodeChain.Node.(*tmplParser.IdentifierNode)
if !ok || nodeIdent.Ident != "ctx" || len(nodeChain.Field) != 2 || nodeChain.Field[0] != "Locale" {
return
}
ltf, ok := handler.LocaleTrFunctions[nodeChain.Field[1]]
if !ok {
return
}
nodeIdent, ok := nodeChain.Node.(*tmplParser.IdentifierNode)
if !ok || nodeIdent.Ident != "ctx" {
return
}
var gotUnexpectedInvoke *int
if len(nodeChain.Field) != 2 || nodeChain.Field[0] != "Locale" || !isLocaleTrFunction(nodeChain.Field[1]) {
return
}
// found interesting string
for _, argNum := range ltf {
if len(nodeCommand.Args) >= int(argNum+2) {
nodeString, ok := nodeCommand.Args[int(argNum+1)].(*tmplParser.StringNode)
if ok {
// found interesting strings
// the column numbers are a bit "off", but much better than nothing
omh(fset, token.Pos(nodeString.Pos), nodeString.Text)
handler.OnMsgid(fset, token.Pos(nodeString.Pos), nodeString.Text)
}
} else {
argc := len(nodeCommand.Args) - 1
gotUnexpectedInvoke = &argc
}
}
if gotUnexpectedInvoke != nil {
handler.OnUnexpectedInvoke(fset, token.Pos(nodeChain.Pos), nodeChain.Field[1], *gotUnexpectedInvoke)
}
default:
}
}
func (omh OnMsgidHandler) handleTemplatePipeNode(fset *token.FileSet, pipeNode *tmplParser.PipeNode) {
func (handler Handler) handleTemplatePipeNode(fset *token.FileSet, pipeNode *tmplParser.PipeNode) {
if pipeNode == nil {
return
}
// NOTE: we can't pass `pipeNode.Cmds` to handleTemplateFileNodes due to incompatible argument types
for _, node := range pipeNode.Cmds {
omh.handleTemplateNode(fset, node)
handler.handleTemplateNode(fset, node)
}
}
func (omh OnMsgidHandler) handleTemplateBranchNode(fset *token.FileSet, branchNode tmplParser.BranchNode) {
omh.handleTemplatePipeNode(fset, branchNode.Pipe)
omh.handleTemplateFileNodes(fset, branchNode.List.Nodes)
func (handler Handler) handleTemplateBranchNode(fset *token.FileSet, branchNode tmplParser.BranchNode) {
handler.handleTemplatePipeNode(fset, branchNode.Pipe)
handler.handleTemplateFileNodes(fset, branchNode.List.Nodes)
if branchNode.ElseList != nil {
omh.handleTemplateFileNodes(fset, branchNode.ElseList.Nodes)
handler.handleTemplateFileNodes(fset, branchNode.ElseList.Nodes)
}
}
func (omh OnMsgidHandler) handleTemplateFileNodes(fset *token.FileSet, nodes []tmplParser.Node) {
func (handler Handler) handleTemplateFileNodes(fset *token.FileSet, nodes []tmplParser.Node) {
for _, node := range nodes {
omh.handleTemplateNode(fset, node)
handler.handleTemplateNode(fset, node)
}
}
func (omh OnMsgidHandler) HandleTemplateFile(fname string, src any) error {
func (handler Handler) HandleTemplateFile(fname string, src any) error {
var tmplContent []byte
switch src2 := src.(type) {
case nil:
@ -222,7 +264,7 @@ func (omh OnMsgidHandler) HandleTemplateFile(fname string, src any) error {
Err: err,
}
}
omh.handleTemplateFileNodes(fset, tmplParsed.Tree.Root.Nodes)
handler.handleTemplateFileNodes(fset, tmplParsed.Root.Nodes)
return nil
}
@ -258,10 +300,6 @@ func main() {
}
msgids := make(container.Set[string])
onMsgid := func(trKey, trValue string) error {
msgids[trKey] = struct{}{}
return nil
}
localeFile := filepath.Join(filepath.Join("options", "locale"), "locale_en-US.ini")
localeContent, err := os.ReadFile(localeFile)
@ -270,7 +308,10 @@ func main() {
os.Exit(2)
}
if err = locale.IterateMessagesContent(localeContent, onMsgid); err != nil {
if err = localeiter.IterateMessagesContent(localeContent, func(trKey, trValue string) error {
msgids[trKey] = struct{}{}
return nil
}); err != nil {
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
os.Exit(2)
}
@ -282,19 +323,30 @@ func main() {
os.Exit(2)
}
if err := locale.IterateMessagesNextContent(localeContent, onMsgid); err != nil {
if err := localeiter.IterateMessagesNextContent(localeContent, func(trKey, pluralForm, trValue string) error {
// ignore plural form
msgids[trKey] = struct{}{}
return nil
}); err != nil {
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
os.Exit(2)
}
gotAnyMsgidError := false
omh := OnMsgidHandler(func(fset *token.FileSet, pos token.Pos, msgid string) {
handler := Handler{
OnMsgid: func(fset *token.FileSet, pos token.Pos, msgid string) {
if !msgids.Contains(msgid) {
gotAnyMsgidError = true
fmt.Printf("%s:\tmissing msgid: %s\n", fset.Position(pos).String(), msgid)
}
})
},
OnUnexpectedInvoke: func(fset *token.FileSet, pos token.Pos, funcname string, argc int) {
gotAnyMsgidError = true
fmt.Printf("%s:\tunexpected invocation of %s with %d arguments\n", fset.Position(pos).String(), funcname, argc)
},
LocaleTrFunctions: InitLocaleTrFunctions(),
}
if err := filepath.WalkDir(".", func(fpath string, d fs.DirEntry, err error) error {
if err != nil {
@ -308,15 +360,15 @@ func main() {
if name == "docker" || name == ".git" || name == "node_modules" {
return fs.SkipDir
}
} else if name == "bindata.go" {
} else if name == "bindata.go" || fpath == "modules/translation/i18n/i18n_test.go" {
// skip false positives
} else if strings.HasSuffix(name, ".go") {
onError(omh.HandleGoFile(fpath, nil))
onError(handler.HandleGoFile(fpath, nil))
} else if strings.HasSuffix(name, ".tmpl") {
if strings.HasPrefix(fpath, "tests") && strings.HasSuffix(name, ".ini.tmpl") {
// skip false positives
} else {
onError(omh.HandleTemplateFile(fpath, nil))
onError(handler.HandleTemplateFile(fpath, nil))
}
}
return nil

View file

@ -11,33 +11,39 @@ import (
"github.com/stretchr/testify/require"
)
func buildHandler(ret *[]string) Handler {
return Handler{
OnMsgid: func(fset *token.FileSet, pos token.Pos, msgid string) {
*ret = append(*ret, msgid)
},
OnUnexpectedInvoke: func(fset *token.FileSet, pos token.Pos, funcname string, argc int) {},
LocaleTrFunctions: InitLocaleTrFunctions(),
}
}
func HandleGoFileWrapped(t *testing.T, fname, src string) []string {
var ret []string
omh := OnMsgidHandler(func(fset *token.FileSet, pos token.Pos, msgid string) {
ret = append(ret, msgid)
})
require.NoError(t, omh.HandleGoFile(fname, src))
handler := buildHandler(&ret)
require.NoError(t, handler.HandleGoFile(fname, src))
return ret
}
func HandleTemplateFileWrapped(t *testing.T, fname, src string) []string {
var ret []string
omh := OnMsgidHandler(func(fset *token.FileSet, pos token.Pos, msgid string) {
ret = append(ret, msgid)
})
require.NoError(t, omh.HandleTemplateFile(fname, src))
handler := buildHandler(&ret)
require.NoError(t, handler.HandleTemplateFile(fname, src))
return ret
}
func TestUsagesParser(t *testing.T) {
t.Run("go, simple", func(t *testing.T) {
assert.EqualValues(t,
assert.Equal(t,
[]string{"what.an.example"},
HandleGoFileWrapped(t, "<g1>", "package main\nfunc Render(ctx *context.Context) string { return ctx.Tr(\"what.an.example\"); }\n"))
})
t.Run("template, simple", func(t *testing.T) {
assert.EqualValues(t,
assert.Equal(t,
[]string{"what.an.example"},
HandleTemplateFileWrapped(t, "<t1>", "{{ ctx.Locale.Tr \"what.an.example\" }}\n"))
})

View file

@ -14,7 +14,7 @@ import (
"slices"
"strings"
"code.gitea.io/gitea/modules/locale"
"forgejo.org/modules/translation/localeiter"
"github.com/microcosm-cc/bluemonday"
"github.com/sergi/go-diff/diffmatchpatch"
@ -52,7 +52,7 @@ func initBlueMondayPolicy() {
policy.AllowAttrs("id").Matching(positionalPlaceholderRe).OnElements("code")
// Allowed elements with no attributes. Must be a recognized tagname.
policy.AllowElements("strong", "br", "b", "strike", "code", "i")
policy.AllowElements("strong", "br", "b", "strike", "code", "i", "kbd")
// TODO: Remove <c> in `actions.workflow.dispatch.trigger_found`.
policy.AllowNoAttrs().OnElements("c")
@ -100,7 +100,7 @@ func checkValue(trKey, value string) []string {
func checkLocaleContent(localeContent []byte) []string {
errors := []string{}
if err := locale.IterateMessagesContent(localeContent, func(trKey, trValue string) error {
if err := localeiter.IterateMessagesContent(localeContent, func(trKey, trValue string) error {
errors = append(errors, checkValue(trKey, trValue)...)
return nil
}); err != nil {
@ -113,8 +113,12 @@ func checkLocaleContent(localeContent []byte) []string {
func checkLocaleNextContent(localeContent []byte) []string {
errors := []string{}
if err := locale.IterateMessagesNextContent(localeContent, func(trKey, trValue string) error {
errors = append(errors, checkValue(trKey, trValue)...)
if err := localeiter.IterateMessagesNextContent(localeContent, func(trKey, pluralForm, trValue string) error {
fullKey := trKey
if pluralForm != "" {
fullKey = trKey + "." + pluralForm
}
errors = append(errors, checkValue(fullKey, trValue)...)
return nil
}); err != nil {
panic(err)

View file

@ -15,9 +15,9 @@ func TestLocalizationPolicy(t *testing.T) {
t.Run("Remove tags", func(t *testing.T) {
assert.Empty(t, checkLocaleContent([]byte(`hidden_comment_types_description = Comment types checked here will not be shown inside issue pages. Checking "Label" for example removes all "<user> added/removed <label>" comments.`)))
assert.EqualValues(t, []string{"key: \x1b[31m<not-an-allowed-key>\x1b[0m REPLACED-TAG"}, checkLocaleContent([]byte(`key = "<not-an-allowed-key> <label>"`)))
assert.EqualValues(t, []string{"key: \x1b[31m<user@example.com>\x1b[0m REPLACED-TAG"}, checkLocaleContent([]byte(`key = "<user@example.com> <email@example.com>"`)))
assert.EqualValues(t, []string{"key: \x1b[31m<tag>\x1b[0m REPLACED-TAG \x1b[31m</tag>\x1b[0m"}, checkLocaleContent([]byte(`key = "<tag> <email@example.com> </tag>"`)))
assert.Equal(t, []string{"key: \x1b[31m<not-an-allowed-key>\x1b[0m REPLACED-TAG"}, checkLocaleContent([]byte(`key = "<not-an-allowed-key> <label>"`)))
assert.Equal(t, []string{"key: \x1b[31m<user@example.com>\x1b[0m REPLACED-TAG"}, checkLocaleContent([]byte(`key = "<user@example.com> <email@example.com>"`)))
assert.Equal(t, []string{"key: \x1b[31m<tag>\x1b[0m REPLACED-TAG \x1b[31m</tag>\x1b[0m"}, checkLocaleContent([]byte(`key = "<tag> <email@example.com> </tag>"`)))
})
t.Run("Specific exception", func(t *testing.T) {
@ -25,11 +25,11 @@ func TestLocalizationPolicy(t *testing.T) {
assert.Empty(t, checkLocaleContent([]byte(`pulls.title_desc_one = wants to merge %[1]d commit from <code>%[2]s</code> into <code id="%[4]s">%[3]s</code>`)))
assert.Empty(t, checkLocaleContent([]byte(`editor.commit_directly_to_this_branch = Commit directly to the <strong class="%[2]s">%[1]s</strong> branch.`)))
assert.EqualValues(t, []string{"workflow.dispatch.trigger_found: This workflow has a \x1b[31m<d>\x1b[0mworkflow_dispatch\x1b[31m</d>\x1b[0m event trigger."}, checkLocaleContent([]byte(`workflow.dispatch.trigger_found = This workflow has a <d>workflow_dispatch</d> event trigger.`)))
assert.EqualValues(t, []string{"key: <code\x1b[31m id=\"branch_targe\"\x1b[0m>%[3]s</code>"}, checkLocaleContent([]byte(`key = <code id="branch_targe">%[3]s</code>`)))
assert.EqualValues(t, []string{"key: <a\x1b[31m class=\"ui sh\"\x1b[0m href=\"https://TO-BE-REPLACED.COM\">"}, checkLocaleContent([]byte(`key = <a class="ui sh" href="%[3]s">`)))
assert.EqualValues(t, []string{"key: <a\x1b[31m class=\"js-click-me\"\x1b[0m href=\"https://TO-BE-REPLACED.COM\">"}, checkLocaleContent([]byte(`key = <a class="js-click-me" href="%[3]s">`)))
assert.EqualValues(t, []string{"key: <strong\x1b[31m class=\"branch-target\"\x1b[0m>%[1]s</strong>"}, checkLocaleContent([]byte(`key = <strong class="branch-target">%[1]s</strong>`)))
assert.Equal(t, []string{"workflow.dispatch.trigger_found: This workflow has a \x1b[31m<d>\x1b[0mworkflow_dispatch\x1b[31m</d>\x1b[0m event trigger."}, checkLocaleContent([]byte(`workflow.dispatch.trigger_found = This workflow has a <d>workflow_dispatch</d> event trigger.`)))
assert.Equal(t, []string{"key: <code\x1b[31m id=\"branch_targe\"\x1b[0m>%[3]s</code>"}, checkLocaleContent([]byte(`key = <code id="branch_targe">%[3]s</code>`)))
assert.Equal(t, []string{"key: <a\x1b[31m class=\"ui sh\"\x1b[0m href=\"https://TO-BE-REPLACED.COM\">"}, checkLocaleContent([]byte(`key = <a class="ui sh" href="%[3]s">`)))
assert.Equal(t, []string{"key: <a\x1b[31m class=\"js-click-me\"\x1b[0m href=\"https://TO-BE-REPLACED.COM\">"}, checkLocaleContent([]byte(`key = <a class="js-click-me" href="%[3]s">`)))
assert.Equal(t, []string{"key: <strong\x1b[31m class=\"branch-target\"\x1b[0m>%[1]s</strong>"}, checkLocaleContent([]byte(`key = <strong class="branch-target">%[1]s</strong>`)))
})
t.Run("General safe tags", func(t *testing.T) {
@ -38,7 +38,7 @@ func TestLocalizationPolicy(t *testing.T) {
assert.Empty(t, checkLocaleContent([]byte("sqlite_helper = File path for the SQLite3 database.<br>Enter an absolute path if you run Forgejo as a service.")))
assert.Empty(t, checkLocaleContent([]byte("hi_user_x = Hi <b>%s</b>,")))
assert.EqualValues(t, []string{"error404: The page you are trying to reach either <strong\x1b[31m title='aaa'\x1b[0m>does not exist</strong> or <strong>you are not authorized</strong> to view it."}, checkLocaleContent([]byte("error404 = The page you are trying to reach either <strong title='aaa'>does not exist</strong> or <strong>you are not authorized</strong> to view it.")))
assert.Equal(t, []string{"error404: The page you are trying to reach either <strong\x1b[31m title='aaa'\x1b[0m>does not exist</strong> or <strong>you are not authorized</strong> to view it."}, checkLocaleContent([]byte("error404 = The page you are trying to reach either <strong title='aaa'>does not exist</strong> or <strong>you are not authorized</strong> to view it.")))
})
t.Run("<a>", func(t *testing.T) {
@ -47,20 +47,20 @@ func TestLocalizationPolicy(t *testing.T) {
assert.Empty(t, checkLocaleContent([]byte(`webauthn_desc = Security keys are hardware devices containing cryptographic keys. They can be used for two-factor authentication. Security keys must support the <a rel="noreferrer" target="_blank" href="%s">WebAuthn Authenticator</a> standard.`)))
assert.Empty(t, checkLocaleContent([]byte("issues.closed_at = `closed this issue <a id=\"%[1]s\" href=\"#%[1]s\">%[2]s</a>`")))
assert.EqualValues(t, []string{"key: \x1b[31m<a href=\"https://example.com\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="https://example.com">`)))
assert.EqualValues(t, []string{"key: \x1b[31m<a href=\"javascript:alert('1')\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="javascript:alert('1')">`)))
assert.EqualValues(t, []string{"key: <a href=\"https://TO-BE-REPLACED.COM\"\x1b[31m download\x1b[0m>"}, checkLocaleContent([]byte(`key = <a href="%s" download>`)))
assert.EqualValues(t, []string{"key: <a href=\"https://TO-BE-REPLACED.COM\"\x1b[31m target=\"_self\"\x1b[0m>"}, checkLocaleContent([]byte(`key = <a href="%s" target="_self">`)))
assert.EqualValues(t, []string{"key: \x1b[31m<a href=\"https://example.com/%s\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="https://example.com/%s">`)))
assert.EqualValues(t, []string{"key: \x1b[31m<a href=\"https://example.com/?q=%s\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="https://example.com/?q=%s">`)))
assert.EqualValues(t, []string{"key: \x1b[31m<a href=\"%s/open-redirect\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="%s/open-redirect">`)))
assert.EqualValues(t, []string{"key: \x1b[31m<a href=\"%s?q=open-redirect\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="%s?q=open-redirect">`)))
assert.Equal(t, []string{"key: \x1b[31m<a href=\"https://example.com\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="https://example.com">`)))
assert.Equal(t, []string{"key: \x1b[31m<a href=\"javascript:alert('1')\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="javascript:alert('1')">`)))
assert.Equal(t, []string{"key: <a href=\"https://TO-BE-REPLACED.COM\"\x1b[31m download\x1b[0m>"}, checkLocaleContent([]byte(`key = <a href="%s" download>`)))
assert.Equal(t, []string{"key: <a href=\"https://TO-BE-REPLACED.COM\"\x1b[31m target=\"_self\"\x1b[0m>"}, checkLocaleContent([]byte(`key = <a href="%s" target="_self">`)))
assert.Equal(t, []string{"key: \x1b[31m<a href=\"https://example.com/%s\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="https://example.com/%s">`)))
assert.Equal(t, []string{"key: \x1b[31m<a href=\"https://example.com/?q=%s\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="https://example.com/?q=%s">`)))
assert.Equal(t, []string{"key: \x1b[31m<a href=\"%s/open-redirect\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="%s/open-redirect">`)))
assert.Equal(t, []string{"key: \x1b[31m<a href=\"%s?q=open-redirect\">\x1b[0m"}, checkLocaleContent([]byte(`key = <a href="%s?q=open-redirect">`)))
})
t.Run("Escaped HTML characters", func(t *testing.T) {
assert.Empty(t, checkLocaleContent([]byte("activity.git_stats_push_to_branch = `إلى %s و\"`")))
assert.EqualValues(t, []string{"key: و\x1b[31m&nbsp\x1b[0m\x1b[32m\u00a0\x1b[0m"}, checkLocaleContent([]byte(`key = و&nbsp;`)))
assert.Equal(t, []string{"key: و\x1b[31m&nbsp;\x1b[0m\x1b[32m\u00a0\x1b[0m"}, checkLocaleContent([]byte(`key = و&nbsp;`)))
})
}
@ -75,7 +75,7 @@ func TestNextLocalizationPolicy(t *testing.T) {
}
}`)))
assert.EqualValues(t, []string{"settings.hidden_comment_types_description: \"\x1b[31m<not-an-allowed-key>\x1b[0m REPLACED-TAG\""}, checkLocaleNextContent([]byte(`{
assert.Equal(t, []string{"settings.hidden_comment_types_description: \"\x1b[31m<not-an-allowed-key>\x1b[0m REPLACED-TAG\""}, checkLocaleNextContent([]byte(`{
"settings": {
"hidden_comment_types_description": "\"<not-an-allowed-key> <label>\""
}
@ -87,8 +87,20 @@ func TestNextLocalizationPolicy(t *testing.T) {
"settings.hidden_comment_types_description": "Comment types checked here will not be shown inside issue pages. Checking \"Label\" for example removes all \"<user> added/removed <label>\" comments."
}`)))
assert.EqualValues(t, []string{"settings.hidden_comment_types_description: \"\x1b[31m<not-an-allowed-key>\x1b[0m REPLACED-TAG\""}, checkLocaleNextContent([]byte(`{
assert.Equal(t, []string{"settings.hidden_comment_types_description: \"\x1b[31m<not-an-allowed-key>\x1b[0m REPLACED-TAG\""}, checkLocaleNextContent([]byte(`{
"settings.hidden_comment_types_description": "\"<not-an-allowed-key> <label>\""
}`)))
})
t.Run("Plural form", func(t *testing.T) {
assert.Equal(t, []string{"repo.pulls.title_desc: key = \x1b[31m<a href=\"https://example.com\">\x1b[0m"}, checkLocaleNextContent([]byte(`{"repo.pulls.title_desc": {
"few": "key = <a href=\"%s\">",
"other": "key = <a href=\"https://example.com\">"
}}`)))
assert.Equal(t, []string{"repo.pulls.title_desc.few: key = \x1b[31m<a href=\"https://example.com\">\x1b[0m"}, checkLocaleNextContent([]byte(`{"repo.pulls.title_desc": {
"few": "key = <a href=\"https://example.com\">",
"other": "key = <a href=\"%s\">"
}}`)))
})
}

View file

@ -1,52 +0,0 @@
#!/bin/sh
# this script runs in alpine image which only has `sh` shell
set +e
if sed --version 2>/dev/null | grep -q GNU; then
SED_INPLACE="sed -i"
else
SED_INPLACE="sed -i ''"
fi
set -e
if [ ! -f ./options/locale/locale_en-US.ini ]; then
echo "please run this script in the root directory of the project"
exit 1
fi
mv ./options/locale/locale_en-US.ini ./options/
# the "ini" library for locale has many quirks, its behavior is different from Crowdin.
# see i18n_test.go for more details
# this script helps to unquote the Crowdin outputs for the quirky ini library
# * find all `key="...\"..."` lines
# * remove the leading quote
# * remove the trailing quote
# * unescape the quotes
# * eg: key="...\"..." => key=..."...
$SED_INPLACE -r -e '/^[-.A-Za-z0-9_]+[ ]*=[ ]*".*"$/ {
s/^([-.A-Za-z0-9_]+)[ ]*=[ ]*"/\1=/
s/"$//
s/\\"/"/g
}' ./options/locale/*.ini
# * if the escaped line is incomplete like `key="...` or `key=..."`, quote it with backticks
# * eg: key="... => key=`"...`
# * eg: key=..." => key=`..."`
$SED_INPLACE -r -e 's/^([-.A-Za-z0-9_]+)[ ]*=[ ]*(".*[^"])$/\1=`\2`/' ./options/locale/*.ini
$SED_INPLACE -r -e 's/^([-.A-Za-z0-9_]+)[ ]*=[ ]*([^"].*")$/\1=`\2`/' ./options/locale/*.ini
# Remove translation under 25% of en_us
baselines=$(wc -l "./options/locale_en-US.ini" | cut -d" " -f1)
baselines=$((baselines / 4))
for filename in ./options/locale/*.ini; do
lines=$(wc -l "$filename" | cut -d" " -f1)
if [ $lines -lt $baselines ]; then
echo "Removing $filename: $lines/$baselines"
rm "$filename"
fi
done
mv ./options/locale_en-US.ini ./options/locale/

View file

@ -6,8 +6,8 @@ package cmd
import (
"fmt"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/private"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)

View file

@ -8,12 +8,12 @@ import (
"context"
"fmt"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/gitrepo"
"code.gitea.io/gitea/modules/log"
repo_module "code.gitea.io/gitea/modules/repository"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
"forgejo.org/modules/git"
"forgejo.org/modules/gitrepo"
"forgejo.org/modules/log"
repo_module "forgejo.org/modules/repository"
"github.com/urfave/cli/v2"
)

View file

@ -9,9 +9,9 @@ import (
"os"
"text/tabwriter"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
auth_service "code.gitea.io/gitea/services/auth"
auth_model "forgejo.org/models/auth"
"forgejo.org/models/db"
auth_service "forgejo.org/services/auth"
"github.com/urfave/cli/v2"
)

View file

@ -8,8 +8,8 @@ import (
"fmt"
"strings"
"code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/services/auth/source/ldap"
"forgejo.org/models/auth"
"forgejo.org/services/auth/source/ldap"
"github.com/urfave/cli/v2"
)

View file

@ -7,8 +7,9 @@ import (
"context"
"testing"
"code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/services/auth/source/ldap"
"forgejo.org/models/auth"
"forgejo.org/modules/test"
"forgejo.org/services/auth/source/ldap"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -17,9 +18,7 @@ import (
func TestAddLdapBindDn(t *testing.T) {
// Mock cli functions to do not exit on error
osExiter := cli.OsExiter
defer func() { cli.OsExiter = osExiter }()
cli.OsExiter = func(code int) {}
defer test.MockVariableValue(&cli.OsExiter, func(code int) {})()
// Test cases
cases := []struct {
@ -216,11 +215,11 @@ func TestAddLdapBindDn(t *testing.T) {
return nil
},
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
assert.FailNow(t, "case %d: should not call updateAuthSource", n)
assert.FailNow(t, "should not call updateAuthSource", "case: %d", n)
return nil
},
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
assert.FailNow(t, "case %d: should not call getAuthSourceByID", n)
assert.FailNow(t, "should not call getAuthSourceByID", "case: %d", n)
return nil, nil
},
}
@ -243,9 +242,7 @@ func TestAddLdapBindDn(t *testing.T) {
func TestAddLdapSimpleAuth(t *testing.T) {
// Mock cli functions to do not exit on error
osExiter := cli.OsExiter
defer func() { cli.OsExiter = osExiter }()
cli.OsExiter = func(code int) {}
defer test.MockVariableValue(&cli.OsExiter, func(code int) {})()
// Test cases
cases := []struct {
@ -447,11 +444,11 @@ func TestAddLdapSimpleAuth(t *testing.T) {
return nil
},
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
assert.FailNow(t, "case %d: should not call updateAuthSource", n)
assert.FailNow(t, "should not call updateAuthSource", "case: %d", n)
return nil
},
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
assert.FailNow(t, "case %d: should not call getAuthSourceByID", n)
assert.FailNow(t, "should not call getAuthSourceByID", "case: %d", n)
return nil, nil
},
}
@ -474,9 +471,7 @@ func TestAddLdapSimpleAuth(t *testing.T) {
func TestUpdateLdapBindDn(t *testing.T) {
// Mock cli functions to do not exit on error
osExiter := cli.OsExiter
defer func() { cli.OsExiter = osExiter }()
cli.OsExiter = func(code int) {}
defer test.MockVariableValue(&cli.OsExiter, func(code int) {})()
// Test cases
cases := []struct {
@ -898,7 +893,7 @@ func TestUpdateLdapBindDn(t *testing.T) {
return nil
},
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
assert.FailNow(t, "case %d: should not call createAuthSource", n)
assert.FailNow(t, "should not call createAuthSource", "case: %d", n)
return nil
},
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
@ -937,9 +932,7 @@ func TestUpdateLdapBindDn(t *testing.T) {
func TestUpdateLdapSimpleAuth(t *testing.T) {
// Mock cli functions to do not exit on error
osExiter := cli.OsExiter
defer func() { cli.OsExiter = osExiter }()
cli.OsExiter = func(code int) {}
defer test.MockVariableValue(&cli.OsExiter, func(code int) {})()
// Test cases
cases := []struct {
@ -1288,7 +1281,7 @@ func TestUpdateLdapSimpleAuth(t *testing.T) {
return nil
},
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
assert.FailNow(t, "case %d: should not call createAuthSource", n)
assert.FailNow(t, "should not call createAuthSource", "case: %d", n)
return nil
},
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {

View file

@ -8,8 +8,8 @@ import (
"fmt"
"net/url"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/services/auth/source/oauth2"
auth_model "forgejo.org/models/auth"
"forgejo.org/services/auth/source/oauth2"
"github.com/urfave/cli/v2"
)

View file

@ -7,9 +7,9 @@ import (
"errors"
"strings"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/auth/source/smtp"
auth_model "forgejo.org/models/auth"
"forgejo.org/modules/util"
"forgejo.org/services/auth/source/smtp"
"github.com/urfave/cli/v2"
)

View file

@ -4,9 +4,9 @@
package cmd
import (
asymkey_model "code.gitea.io/gitea/models/asymkey"
"code.gitea.io/gitea/modules/graceful"
repo_service "code.gitea.io/gitea/services/repository"
asymkey_model "forgejo.org/models/asymkey"
"forgejo.org/modules/graceful"
repo_service "forgejo.org/services/repository"
"github.com/urfave/cli/v2"
)

View file

@ -7,11 +7,11 @@ import (
"errors"
"fmt"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/auth/password"
"code.gitea.io/gitea/modules/optional"
"code.gitea.io/gitea/modules/setting"
user_service "code.gitea.io/gitea/services/user"
user_model "forgejo.org/models/user"
"forgejo.org/modules/auth/password"
"forgejo.org/modules/optional"
"forgejo.org/modules/setting"
user_service "forgejo.org/services/user"
"github.com/urfave/cli/v2"
)

View file

@ -6,13 +6,14 @@ package cmd
import (
"errors"
"fmt"
"strings"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
pwd "code.gitea.io/gitea/modules/auth/password"
"code.gitea.io/gitea/modules/optional"
"code.gitea.io/gitea/modules/setting"
auth_model "forgejo.org/models/auth"
"forgejo.org/models/db"
user_model "forgejo.org/models/user"
pwd "forgejo.org/modules/auth/password"
"forgejo.org/modules/optional"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)
@ -61,10 +62,24 @@ var microcmdUserCreate = &cli.Command{
Name: "access-token",
Usage: "Generate access token for the user",
},
&cli.StringFlag{
Name: "access-token-name",
Usage: `Name of the generated access token`,
Value: "gitea-admin",
},
&cli.StringFlag{
Name: "access-token-scopes",
Usage: `Scopes of the generated access token, comma separated. Examples: "all", "public-only,read:issue", "write:repository,write:user"`,
Value: "all",
},
&cli.BoolFlag{
Name: "restricted",
Usage: "Make a restricted user account",
},
&cli.StringFlag{
Name: "fullname",
Usage: `The full, human-readable name of the user`,
},
},
}
@ -150,6 +165,7 @@ func runCreateUser(c *cli.Context) error {
IsAdmin: isAdmin,
MustChangePassword: mustChangePassword,
Visibility: visibility,
FullName: c.String("fullname"),
}
overwriteDefault := &user_model.CreateUserOverwriteOptions{
@ -157,23 +173,40 @@ func runCreateUser(c *cli.Context) error {
IsRestricted: restricted,
}
var accessTokenName string
var accessTokenScope auth_model.AccessTokenScope
if c.IsSet("access-token") {
accessTokenName = strings.TrimSpace(c.String("access-token-name"))
if accessTokenName == "" {
return errors.New("access-token-name cannot be empty")
}
var err error
accessTokenScope, err = auth_model.AccessTokenScope(c.String("access-token-scopes")).Normalize()
if err != nil {
return fmt.Errorf("invalid access token scope provided: %w", err)
}
if !accessTokenScope.HasPermissionScope() {
return errors.New("access token does not have any permission")
}
} else if c.IsSet("access-token-name") || c.IsSet("access-token-scopes") {
return errors.New("access-token-name and access-token-scopes flags are only valid when access-token flag is set")
}
// arguments should be prepared before creating the user & access token, in case there is anything wrong
// create the user
if err := user_model.CreateUser(ctx, u, overwriteDefault); err != nil {
return fmt.Errorf("CreateUser: %w", err)
}
fmt.Printf("New user '%s' has been successfully created!\n", username)
if c.Bool("access-token") {
t := &auth_model.AccessToken{
Name: "gitea-admin",
UID: u.ID,
}
// create the access token
if accessTokenScope != "" {
t := &auth_model.AccessToken{Name: accessTokenName, UID: u.ID, Scope: accessTokenScope}
if err := auth_model.NewAccessToken(ctx, t); err != nil {
return err
}
fmt.Printf("Access token was successfully created... %s\n", t.Token)
}
fmt.Printf("New user '%s' has been successfully created!\n", username)
return nil
}

View file

@ -8,9 +8,9 @@ import (
"fmt"
"strings"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/storage"
user_service "code.gitea.io/gitea/services/user"
user_model "forgejo.org/models/user"
"forgejo.org/modules/storage"
user_service "forgejo.org/services/user"
"github.com/urfave/cli/v2"
)

View file

@ -7,8 +7,8 @@ import (
"errors"
"fmt"
auth_model "code.gitea.io/gitea/models/auth"
user_model "code.gitea.io/gitea/models/user"
auth_model "forgejo.org/models/auth"
user_model "forgejo.org/models/user"
"github.com/urfave/cli/v2"
)
@ -34,8 +34,8 @@ var microcmdUserGenerateAccessToken = &cli.Command{
},
&cli.StringFlag{
Name: "scopes",
Value: "",
Usage: "Comma separated list of scopes to apply to access token",
Value: "all",
Usage: `Comma separated list of scopes to apply to access token, examples: "all", "public-only,read:issue", "write:repository,write:user"`,
},
},
Action: runGenerateAccessToken,
@ -43,7 +43,7 @@ var microcmdUserGenerateAccessToken = &cli.Command{
func runGenerateAccessToken(c *cli.Context) error {
if !c.IsSet("username") {
return errors.New("You must provide a username to generate a token for")
return errors.New("you must provide a username to generate a token for")
}
ctx, cancel := installSignals()
@ -77,6 +77,9 @@ func runGenerateAccessToken(c *cli.Context) error {
if err != nil {
return fmt.Errorf("invalid access token scope provided: %w", err)
}
if !accessTokenScope.HasPermissionScope() {
return errors.New("access token does not have any permission")
}
t.Scope = accessTokenScope
// create the token

View file

@ -8,7 +8,7 @@ import (
"os"
"text/tabwriter"
user_model "code.gitea.io/gitea/models/user"
user_model "forgejo.org/models/user"
"github.com/urfave/cli/v2"
)

View file

@ -7,7 +7,7 @@ import (
"errors"
"fmt"
user_model "code.gitea.io/gitea/models/user"
user_model "forgejo.org/models/user"
"github.com/urfave/cli/v2"
)

View file

@ -15,10 +15,10 @@ import (
"strings"
"syscall"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"forgejo.org/models/db"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"forgejo.org/modules/util"
"github.com/urfave/cli/v2"
)

View file

@ -11,16 +11,15 @@ import (
"strings"
"text/tabwriter"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/migrations"
migrate_base "code.gitea.io/gitea/models/migrations/base"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/services/doctor"
"forgejo.org/models/db"
"forgejo.org/models/migrations"
migrate_base "forgejo.org/models/migrations/base"
"forgejo.org/modules/container"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"forgejo.org/services/doctor"
"github.com/urfave/cli/v2"
"xorm.io/xorm"
)
// CmdDoctor represents the available doctor sub-command.
@ -120,7 +119,7 @@ func runRecreateTable(ctx *cli.Context) error {
args := ctx.Args()
names := make([]string, 0, ctx.NArg())
for i := 0; i < ctx.NArg(); i++ {
for i := range ctx.NArg() {
names = append(names, args.Get(i))
}
@ -130,11 +129,17 @@ func runRecreateTable(ctx *cli.Context) error {
}
recreateTables := migrate_base.RecreateTables(beans...)
return db.InitEngineWithMigration(stdCtx, func(x *xorm.Engine) error {
if err := migrations.EnsureUpToDate(x); err != nil {
return db.InitEngineWithMigration(stdCtx, func(x db.Engine) error {
engine, err := db.GetMasterEngine(x)
if err != nil {
return err
}
return recreateTables(x)
if err := migrations.EnsureUpToDate(engine); err != nil {
return err
}
return recreateTables(engine)
})
}
@ -143,11 +148,12 @@ func setupDoctorDefaultLogger(ctx *cli.Context, colorize bool) {
setupConsoleLogger(log.FATAL, log.CanColorStderr, os.Stderr)
logFile := ctx.String("log-file")
if logFile == "" {
switch logFile {
case "":
return // if no doctor log-file is set, do not show any log from default logger
} else if logFile == "-" {
case "-":
setupConsoleLogger(log.TRACE, colorize, os.Stdout)
} else {
default:
logFile, _ = filepath.Abs(logFile)
writeMode := log.WriterMode{Level: log.TRACE, WriterOption: log.WriterFileOption{FileName: logFile}}
writer, err := log.NewEventWriter("console-to-file", "file", writeMode)

View file

@ -6,9 +6,9 @@ package cmd
import (
"fmt"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/models/db"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)

View file

@ -7,8 +7,8 @@ import (
"context"
"testing"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/services/doctor"
"forgejo.org/modules/log"
"forgejo.org/services/doctor"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"

View file

@ -13,12 +13,12 @@ import (
"strings"
"time"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/modules/util"
"forgejo.org/models/db"
"forgejo.org/modules/json"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"forgejo.org/modules/storage"
"forgejo.org/modules/util"
"code.forgejo.org/go-chi/session"
"github.com/mholt/archiver/v3"
@ -122,7 +122,6 @@ It can be used for backup and capture Forgejo server image to send to maintainer
&cli.StringFlag{
Name: "tempdir",
Aliases: []string{"t"},
Value: os.TempDir(),
Usage: "Temporary dir path",
},
&cli.StringFlag{
@ -288,18 +287,31 @@ func runDump(ctx *cli.Context) error {
}
tmpDir := ctx.String("tempdir")
if tmpDir == "" {
tmpDir, err = os.MkdirTemp("", "forgejo-dump-*")
if err != nil {
fatal("Failed to create temporary directory: %v", err)
}
defer func() {
if err := util.Remove(tmpDir); err != nil {
log.Warn("Failed to remove temporary directory: %s: Error: %v", tmpDir, err)
}
}()
}
if _, err := os.Stat(tmpDir); os.IsNotExist(err) {
fatal("Path does not exist: %s", tmpDir)
}
dbDump, err := os.CreateTemp(tmpDir, "forgejo-db.sql")
if err != nil {
fatal("Failed to create tmp file: %v", err)
fatal("Failed to create temporary file: %v", err)
}
defer func() {
_ = dbDump.Close()
if err := util.Remove(dbDump.Name()); err != nil {
log.Warn("Failed to remove temporary file: %s: Error: %v", dbDump.Name(), err)
log.Warn("Failed to remove temporary database file: %s: Error: %v", dbDump.Name(), err)
}
}()

View file

@ -10,14 +10,14 @@ import (
"os"
"strings"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
base "code.gitea.io/gitea/modules/migration"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/convert"
"code.gitea.io/gitea/services/migrations"
"forgejo.org/modules/git"
"forgejo.org/modules/log"
base "forgejo.org/modules/migration"
"forgejo.org/modules/setting"
"forgejo.org/modules/structs"
"forgejo.org/modules/util"
"forgejo.org/services/convert"
"forgejo.org/services/migrations"
"github.com/urfave/cli/v2"
)

View file

@ -10,13 +10,13 @@ import (
"path/filepath"
"strings"
"code.gitea.io/gitea/modules/assetfs"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/options"
"code.gitea.io/gitea/modules/public"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/templates"
"code.gitea.io/gitea/modules/util"
"forgejo.org/modules/assetfs"
"forgejo.org/modules/log"
"forgejo.org/modules/options"
"forgejo.org/modules/public"
"forgejo.org/modules/setting"
"forgejo.org/modules/templates"
"forgejo.org/modules/util"
"github.com/gobwas/glob"
"github.com/urfave/cli/v2"

View file

@ -11,10 +11,10 @@ import (
"os"
"strings"
actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
private_routers "code.gitea.io/gitea/routers/private"
actions_model "forgejo.org/models/actions"
"forgejo.org/modules/private"
"forgejo.org/modules/setting"
private_routers "forgejo.org/routers/private"
"github.com/urfave/cli/v2"
)

View file

@ -7,7 +7,7 @@ import (
"fmt"
"testing"
"code.gitea.io/gitea/services/context"
"forgejo.org/services/context"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

View file

@ -8,14 +8,14 @@ import (
"context"
"errors"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/services/f3/util"
"forgejo.org/models"
"forgejo.org/modules/git"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"forgejo.org/modules/storage"
"forgejo.org/services/f3/util"
_ "code.gitea.io/gitea/services/f3/driver" // register the driver
_ "forgejo.org/services/f3/driver" // register the driver
f3_cmd "code.forgejo.org/f3/gof3/v3/cmd"
f3_logger "code.forgejo.org/f3/gof3/v3/logger"

View file

@ -11,10 +11,10 @@ import (
"os/signal"
"syscall"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/models/db"
"forgejo.org/modules/log"
"forgejo.org/modules/private"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)

View file

@ -8,7 +8,7 @@ import (
"fmt"
"os"
"code.gitea.io/gitea/modules/generate"
"forgejo.org/modules/generate"
"github.com/mattn/go-isatty"
"github.com/urfave/cli/v2"
@ -70,10 +70,7 @@ func runGenerateInternalToken(c *cli.Context) error {
}
func runGenerateLfsJwtSecret(c *cli.Context) error {
_, jwtSecretBase64, err := generate.NewJwtSecret()
if err != nil {
return err
}
_, jwtSecretBase64 := generate.NewJwtSecret()
fmt.Printf("%s", jwtSecretBase64)

View file

@ -14,12 +14,12 @@ import (
"strings"
"time"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/git/pushoptions"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/git"
"forgejo.org/modules/git/pushoptions"
"forgejo.org/modules/log"
"forgejo.org/modules/private"
repo_module "forgejo.org/modules/repository"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)
@ -168,7 +168,7 @@ func runHookPreReceive(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), true)
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
@ -220,10 +220,7 @@ Forgejo or set your environment appropriately.`, "")
}
}
supportProcReceive := false
if git.CheckGitVersionAtLeast("2.29") == nil {
supportProcReceive = true
}
supportProcReceive := git.CheckGitVersionAtLeast("2.29") == nil
for scanner.Scan() {
// TODO: support news feeds for wiki
@ -330,7 +327,7 @@ func runHookPostReceive(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), true)
// First of all run update-server-info no matter what
if _, _, err := git.NewCommand(ctx, "update-server-info").RunStdString(nil); err != nil {
@ -494,7 +491,7 @@ func runHookProcReceive(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), true)
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
if setting.OnlyAllowPushIfGiteaEnvironmentSet {

View file

@ -14,8 +14,8 @@ import (
"testing"
"time"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/test"
"forgejo.org/modules/setting"
"forgejo.org/modules/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

View file

@ -8,8 +8,8 @@ import (
"fmt"
"strings"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"forgejo.org/modules/log"
"forgejo.org/modules/private"
"github.com/urfave/cli/v2"
)
@ -71,7 +71,7 @@ func runKeys(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), true)
authorizedString, extra := private.AuthorizedPublicKeyByContent(ctx, content)
// do not use handleCliResponseExtra or cli.NewExitError, if it exists immediately, it breaks some tests like Test_CmdKeys

View file

@ -6,8 +6,8 @@ package cmd
import (
"fmt"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/private"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)

View file

@ -10,9 +10,9 @@ import (
"path/filepath"
"strings"
"code.gitea.io/gitea/cmd/forgejo"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/cmd/forgejo"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)
@ -122,9 +122,9 @@ func NewMainApp(version, versionExtra string) *cli.App {
}
executable := filepath.Base(path)
var subCmdsStandalone []*cli.Command = make([]*cli.Command, 0, 10)
var subCmdWithConfig []*cli.Command = make([]*cli.Command, 0, 10)
var globalFlags []cli.Flag = make([]cli.Flag, 0, 10)
subCmdsStandalone := make([]*cli.Command, 0, 10)
subCmdWithConfig := make([]*cli.Command, 0, 10)
globalFlags := make([]cli.Flag, 0, 10)
//
// If the executable is forgejo-cli, provide a Forgejo specific CLI

View file

@ -10,9 +10,9 @@ import (
"strings"
"testing"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/test"
"forgejo.org/models/unittest"
"forgejo.org/modules/setting"
"forgejo.org/modules/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -132,14 +132,14 @@ func TestCliCmdError(t *testing.T) {
r, err := runTestApp(app, "./gitea", "test-cmd")
require.Error(t, err)
assert.Equal(t, 1, r.ExitCode)
assert.Equal(t, "", r.Stdout)
assert.Empty(t, r.Stdout)
assert.Equal(t, "Command error: normal error\n", r.Stderr)
app = newTestApp(func(ctx *cli.Context) error { return cli.Exit("exit error", 2) })
r, err = runTestApp(app, "./gitea", "test-cmd")
require.Error(t, err)
assert.Equal(t, 2, r.ExitCode)
assert.Equal(t, "", r.Stdout)
assert.Empty(t, r.Stdout)
assert.Equal(t, "exit error\n", r.Stderr)
app = newTestApp(func(ctx *cli.Context) error { return nil })
@ -147,12 +147,12 @@ func TestCliCmdError(t *testing.T) {
require.Error(t, err)
assert.Equal(t, 1, r.ExitCode)
assert.Equal(t, "Incorrect Usage: flag provided but not defined: -no-such\n\n", r.Stdout)
assert.Equal(t, "", r.Stderr) // the cli package's strange behavior, the error message is not in stderr ....
assert.Empty(t, r.Stderr) // the cli package's strange behavior, the error message is not in stderr ....
app = newTestApp(func(ctx *cli.Context) error { return nil })
r, err = runTestApp(app, "./gitea", "test-cmd")
require.NoError(t, err)
assert.Equal(t, -1, r.ExitCode) // the cli.OsExiter is not called
assert.Equal(t, "", r.Stdout)
assert.Equal(t, "", r.Stderr)
assert.Empty(t, r.Stdout)
assert.Empty(t, r.Stderr)
}

View file

@ -7,7 +7,7 @@ import (
"os"
"time"
"code.gitea.io/gitea/modules/private"
"forgejo.org/modules/private"
"github.com/urfave/cli/v2"
)
@ -112,7 +112,7 @@ func runShutdown(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
extra := private.Shutdown(ctx)
return handleCliResponseExtra(extra)
}
@ -121,7 +121,7 @@ func runRestart(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
extra := private.Restart(ctx)
return handleCliResponseExtra(extra)
}
@ -130,7 +130,7 @@ func runReloadTemplates(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
extra := private.ReloadTemplates(ctx)
return handleCliResponseExtra(extra)
}
@ -139,7 +139,7 @@ func runFlushQueues(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
extra := private.FlushQueues(ctx, c.Duration("timeout"), c.Bool("non-blocking"))
return handleCliResponseExtra(extra)
}
@ -148,7 +148,7 @@ func runProcesses(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
extra := private.Processes(ctx, os.Stdout, c.Bool("flat"), c.Bool("no-system"), c.Bool("stacktraces"), c.Bool("json"), c.String("cancel"))
return handleCliResponseExtra(extra)
}

View file

@ -8,8 +8,8 @@ import (
"fmt"
"os"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"forgejo.org/modules/log"
"forgejo.org/modules/private"
"github.com/urfave/cli/v2"
)
@ -199,7 +199,7 @@ func runRemoveLogger(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
logger := c.String("logger")
if len(logger) == 0 {
logger = log.DEFAULT
@ -214,7 +214,7 @@ func runAddConnLogger(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
vals := map[string]any{}
mode := "conn"
vals["net"] = "tcp"
@ -244,7 +244,7 @@ func runAddFileLogger(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
vals := map[string]any{}
mode := "file"
if c.IsSet("filename") {
@ -311,7 +311,7 @@ func runPauseLogging(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
userMsg := private.PauseLogging(ctx)
_, _ = fmt.Fprintln(os.Stdout, userMsg)
return nil
@ -321,7 +321,7 @@ func runResumeLogging(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
userMsg := private.ResumeLogging(ctx)
_, _ = fmt.Fprintln(os.Stdout, userMsg)
return nil
@ -331,7 +331,7 @@ func runReleaseReopenLogging(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
userMsg := private.ReleaseReopenLogging(ctx)
_, _ = fmt.Fprintln(os.Stdout, userMsg)
return nil
@ -340,7 +340,7 @@ func runReleaseReopenLogging(c *cli.Context) error {
func runSetLogSQL(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), false)
extra := private.SetLogSQL(ctx, !c.Bool("off"))
return handleCliResponseExtra(extra)

View file

@ -6,10 +6,10 @@ package cmd
import (
"context"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/models/db"
"forgejo.org/models/migrations"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)
@ -36,7 +36,13 @@ func runMigrate(ctx *cli.Context) error {
log.Info("Log path: %s", setting.Log.RootPath)
log.Info("Configuration file: %s", setting.CustomConf)
if err := db.InitEngineWithMigration(context.Background(), migrations.Migrate); err != nil {
if err := db.InitEngineWithMigration(context.Background(), func(dbEngine db.Engine) error {
masterEngine, err := db.GetMasterEngine(dbEngine)
if err != nil {
return err
}
return migrations.Migrate(masterEngine)
}); err != nil {
log.Fatal("Failed to initialize ORM engine: %v", err)
return err
}

View file

@ -10,19 +10,20 @@ import (
"io/fs"
"strings"
actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/db"
git_model "code.gitea.io/gitea/models/git"
"code.gitea.io/gitea/models/migrations"
packages_model "code.gitea.io/gitea/models/packages"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
packages_module "code.gitea.io/gitea/modules/packages"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
actions_model "forgejo.org/models/actions"
"forgejo.org/models/db"
git_model "forgejo.org/models/git"
"forgejo.org/models/migrations"
packages_model "forgejo.org/models/packages"
repo_model "forgejo.org/models/repo"
user_model "forgejo.org/models/user"
"forgejo.org/modules/log"
packages_module "forgejo.org/modules/packages"
"forgejo.org/modules/setting"
"forgejo.org/modules/storage"
"github.com/urfave/cli/v2"
"xorm.io/xorm"
)
// CmdMigrateStorage represents the available migrate storage sub-command.
@ -195,7 +196,9 @@ func runMigrateStorage(ctx *cli.Context) error {
log.Info("Log path: %s", setting.Log.RootPath)
log.Info("Configuration file: %s", setting.CustomConf)
if err := db.InitEngineWithMigration(context.Background(), migrations.Migrate); err != nil {
if err := db.InitEngineWithMigration(context.Background(), func(e db.Engine) error {
return migrations.Migrate(e.(*xorm.Engine))
}); err != nil {
log.Fatal("Failed to initialize ORM engine: %v", err)
return err
}

View file

@ -9,16 +9,16 @@ import (
"strings"
"testing"
"code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/packages"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
packages_module "code.gitea.io/gitea/modules/packages"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/modules/test"
packages_service "code.gitea.io/gitea/services/packages"
"forgejo.org/models/actions"
"forgejo.org/models/db"
"forgejo.org/models/packages"
"forgejo.org/models/unittest"
user_model "forgejo.org/models/user"
packages_module "forgejo.org/modules/packages"
"forgejo.org/modules/setting"
"forgejo.org/modules/storage"
"forgejo.org/modules/test"
packages_service "forgejo.org/services/packages"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -81,8 +81,8 @@ func TestMigratePackages(t *testing.T) {
entries, err := os.ReadDir(p)
require.NoError(t, err)
assert.Len(t, entries, 2)
assert.EqualValues(t, "01", entries[0].Name())
assert.EqualValues(t, "tmp", entries[1].Name())
assert.Equal(t, "01", entries[0].Name())
assert.Equal(t, "tmp", entries[1].Name())
}
func TestMigrateActionsArtifacts(t *testing.T) {

View file

@ -6,8 +6,8 @@ package cmd
import (
"strings"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/private"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)

View file

@ -18,18 +18,18 @@ import (
"time"
"unicode"
asymkey_model "code.gitea.io/gitea/models/asymkey"
git_model "code.gitea.io/gitea/models/git"
"code.gitea.io/gitea/models/perm"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/pprof"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/process"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/services/lfs"
asymkey_model "forgejo.org/models/asymkey"
git_model "forgejo.org/models/git"
"forgejo.org/models/perm"
"forgejo.org/modules/git"
"forgejo.org/modules/json"
"forgejo.org/modules/log"
"forgejo.org/modules/pprof"
"forgejo.org/modules/private"
"forgejo.org/modules/process"
repo_module "forgejo.org/modules/repository"
"forgejo.org/modules/setting"
"forgejo.org/services/lfs"
"github.com/golang-jwt/jwt/v5"
"github.com/kballard/go-shellquote"
@ -57,20 +57,23 @@ var CmdServ = &cli.Command{
},
}
func setup(ctx context.Context, debug bool) {
func setup(ctx context.Context, debug, gitNeeded bool) {
if debug {
setupConsoleLogger(log.TRACE, false, os.Stderr)
} else {
setupConsoleLogger(log.FATAL, false, os.Stderr)
}
setting.MustInstalled()
// Sanity check to ensure path is not relative, see: https://github.com/go-gitea/gitea/pull/19317
if _, err := os.Stat(setting.RepoRootPath); err != nil {
_ = fail(ctx, "Unable to access repository path", "Unable to access repository path %q, err: %v", setting.RepoRootPath, err)
return
}
if gitNeeded {
if err := git.InitSimple(context.Background()); err != nil {
_ = fail(ctx, "Failed to init git", "Failed to init git, err: %v", err)
}
}
}
var (
@ -133,7 +136,7 @@ func runServ(c *cli.Context) error {
defer cancel()
// FIXME: This needs to internationalised
setup(ctx, c.Bool("debug"))
setup(ctx, c.Bool("debug"), true)
if setting.SSH.Disabled {
fmt.Println("Forgejo: SSH has been disabled")
@ -253,11 +256,12 @@ func runServ(c *cli.Context) error {
}
if verb == lfsAuthenticateVerb {
if lfsVerb == "upload" {
switch lfsVerb {
case "upload":
requestedMode = perm.AccessModeWrite
} else if lfsVerb == "download" {
case "download":
requestedMode = perm.AccessModeRead
} else {
default:
return fail(ctx, "Unknown LFS verb", "Unknown lfs verb %s", lfsVerb)
}
}

View file

@ -16,14 +16,14 @@ import (
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/public"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/routers"
"code.gitea.io/gitea/routers/install"
"forgejo.org/modules/container"
"forgejo.org/modules/graceful"
"forgejo.org/modules/log"
"forgejo.org/modules/process"
"forgejo.org/modules/public"
"forgejo.org/modules/setting"
"forgejo.org/routers"
"forgejo.org/routers/install"
"github.com/felixge/fgprof"
"github.com/urfave/cli/v2"
@ -198,9 +198,6 @@ func serveInstalled(ctx *cli.Context) error {
for fn := range publicFilesSet.Seq() {
log.Error("Found legacy public asset %q in CustomPath. Please move it to %s/public/assets/%s", fn, setting.CustomPath, fn)
}
if _, err := os.Stat(filepath.Join(setting.CustomPath, "robots.txt")); err == nil {
log.Error(`Found legacy public asset "robots.txt" in CustomPath. Please move it to %s/public/robots.txt`, setting.CustomPath)
}
routers.InitWebInstalled(graceful.GetManager().HammerContext())

View file

@ -12,10 +12,10 @@ import (
"strconv"
"strings"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/graceful"
"forgejo.org/modules/log"
"forgejo.org/modules/process"
"forgejo.org/modules/setting"
"github.com/caddyserver/certmagic"
)
@ -54,8 +54,8 @@ func runACME(listenAddr string, m http.Handler) error {
altTLSALPNPort = p
}
magic := certmagic.NewDefault()
magic.Storage = &certmagic.FileStorage{Path: setting.AcmeLiveDirectory}
certmagic.Default.Storage = &certmagic.FileStorage{Path: setting.AcmeLiveDirectory}
// Try to use private CA root if provided, otherwise defaults to system's trust
var certPool *x509.CertPool
if setting.AcmeCARoot != "" {
@ -65,7 +65,8 @@ func runACME(listenAddr string, m http.Handler) error {
log.Warn("Failed to parse CA Root certificate, using default CA trust: %v", err)
}
}
myACME := certmagic.NewACMEIssuer(magic, certmagic.ACMEIssuer{
certmagic.DefaultACME = certmagic.ACMEIssuer{
CA: setting.AcmeURL,
TrustedRoots: certPool,
Email: setting.AcmeEmail,
@ -75,7 +76,11 @@ func runACME(listenAddr string, m http.Handler) error {
ListenHost: setting.HTTPAddr,
AltTLSALPNPort: altTLSALPNPort,
AltHTTPPort: altHTTPPort,
})
}
magic := certmagic.NewDefault()
myACME := certmagic.NewACMEIssuer(magic, certmagic.DefaultACME)
magic.Issuers = []certmagic.Issuer{myACME}

View file

@ -9,9 +9,9 @@ import (
"net/http/fcgi"
"strings"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/graceful"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
)
func runHTTP(network, listenAddr, name string, m http.Handler, useProxyProtocol bool) error {

View file

@ -9,9 +9,9 @@ import (
"os"
"strings"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/graceful"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"github.com/klauspost/cpuid/v2"
)

View file

@ -1,41 +0,0 @@
`backport`
==========
`backport` is a command to help create backports of PRs. It backports a
provided PR from main on to a released version.
It will create a backport branch, cherry-pick the PR's merge commit, adjust
the commit message and then push this back up to your fork's remote.
The default version will read from `docs/config.yml`. You can override this
using the option `--version`.
The upstream branches will be fetched, using the remote `origin`. This can
be overridden using `--upstream`, and fetching can be avoided using
`--no-fetch`.
By default the branch created will be called `backport-$PR-$VERSION`. You
can override this using the option `--backport-branch`. This branch will
be created from `--release-branch` which is `release/$(VERSION)`
by default and will be pulled from `$(UPSTREAM)`.
The merge-commit as determined by the github API will be used as the SHA to
cherry-pick. You can override this using `--cherry-pick`.
The commit message will be amended to add the `Backport` header.
`--no-amend-message` can be set to stop this from happening.
If cherry-pick is successful the backported branch will be pushed up to your
fork using your remote. These will be determined using `git remote -v`. You
can set your fork name using `--fork-user` and your remote name using
`--remote`. You can avoid pushing using `--no-push`.
If the push is successful, `xdg-open` will be called to open a backport url.
You can stop this using `--no-xdg-open`.
Installation
============
```bash
go install contrib/backport/backport.go
```

View file

@ -1,474 +0,0 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
//nolint:forbidigo
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/exec"
"os/signal"
"path"
"strconv"
"strings"
"syscall"
"github.com/google/go-github/v64/github"
"github.com/urfave/cli/v2"
"gopkg.in/yaml.v3"
)
const defaultVersion = "v1.18" // to backport to
func main() {
app := cli.NewApp()
app.Name = "backport"
app.Usage = "Backport provided PR-number on to the current or previous released version"
app.Description = `Backport will look-up the PR in Gitea's git log and attempt to cherry-pick it on the current version`
app.ArgsUsage = "<PR-to-backport>"
app.Flags = []cli.Flag{
&cli.StringFlag{
Name: "version",
Usage: "Version branch to backport on to",
},
&cli.StringFlag{
Name: "upstream",
Value: "origin",
Usage: "Upstream remote for the Gitea upstream",
},
&cli.StringFlag{
Name: "release-branch",
Value: "",
Usage: "Release branch to backport on. Will default to release/<version>",
},
&cli.StringFlag{
Name: "cherry-pick",
Usage: "SHA to cherry-pick as backport",
},
&cli.StringFlag{
Name: "backport-branch",
Usage: "Backport branch to backport on to (default: backport-<pr>-<version>",
},
&cli.StringFlag{
Name: "remote",
Value: "",
Usage: "Remote for your fork of the Gitea upstream",
},
&cli.StringFlag{
Name: "fork-user",
Value: "",
Usage: "Forked user name on Github",
},
&cli.BoolFlag{
Name: "no-fetch",
Usage: "Set this flag to prevent fetch of remote branches",
},
&cli.BoolFlag{
Name: "no-amend-message",
Usage: "Set this flag to prevent automatic amendment of the commit message",
},
&cli.BoolFlag{
Name: "no-push",
Usage: "Set this flag to prevent pushing the backport up to your fork",
},
&cli.BoolFlag{
Name: "no-xdg-open",
Usage: "Set this flag to not use xdg-open to open the PR URL",
},
&cli.BoolFlag{
Name: "continue",
Usage: "Set this flag to continue from a git cherry-pick that has broken",
},
}
cli.AppHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.HelpName}} {{if .VisibleFlags}}[options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}
{{if len .Authors}}
AUTHOR:
{{range .Authors}}{{ . }}{{end}}
{{end}}{{if .Commands}}
OPTIONS:
{{range .VisibleFlags}}{{.}}
{{end}}{{end}}
`
app.Action = runBackport
if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "Unable to backport: %v\n", err)
}
}
func runBackport(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
continuing := c.Bool("continue")
var pr string
version := c.String("version")
if version == "" && continuing {
// determine version from current branch name
var err error
pr, version, err = readCurrentBranch(ctx)
if err != nil {
return err
}
}
if version == "" {
version = readVersion()
}
if version == "" {
version = defaultVersion
}
upstream := c.String("upstream")
if upstream == "" {
upstream = "origin"
}
forkUser := c.String("fork-user")
remote := c.String("remote")
if remote == "" && !c.Bool("--no-push") {
var err error
remote, forkUser, err = determineRemote(ctx, forkUser)
if err != nil {
return err
}
}
upstreamReleaseBranch := c.String("release-branch")
if upstreamReleaseBranch == "" {
upstreamReleaseBranch = path.Join("release", version)
}
localReleaseBranch := path.Join(upstream, upstreamReleaseBranch)
args := c.Args().Slice()
if len(args) == 0 && pr == "" {
return fmt.Errorf("no PR number provided\nProvide a PR number to backport")
} else if len(args) != 1 && pr == "" {
return fmt.Errorf("multiple PRs provided %v\nOnly a single PR can be backported at a time", args)
}
if pr == "" {
pr = args[0]
}
backportBranch := c.String("backport-branch")
if backportBranch == "" {
backportBranch = "backport-" + pr + "-" + version
}
fmt.Printf("* Backporting %s to %s as %s\n", pr, localReleaseBranch, backportBranch)
sha := c.String("cherry-pick")
if sha == "" {
var err error
sha, err = determineSHAforPR(ctx, pr)
if err != nil {
return err
}
}
if sha == "" {
return fmt.Errorf("unable to determine sha for cherry-pick of %s", pr)
}
if !c.Bool("no-fetch") {
if err := fetchRemoteAndMain(ctx, upstream, upstreamReleaseBranch); err != nil {
return err
}
}
if !continuing {
if err := checkoutBackportBranch(ctx, backportBranch, localReleaseBranch); err != nil {
return err
}
}
if err := cherrypick(ctx, sha); err != nil {
return err
}
if !c.Bool("no-amend-message") {
if err := amendCommit(ctx, pr); err != nil {
return err
}
}
if !c.Bool("no-push") {
url := "https://github.com/go-gitea/gitea/compare/" + upstreamReleaseBranch + "..." + forkUser + ":" + backportBranch
if err := gitPushUp(ctx, remote, backportBranch); err != nil {
return err
}
if !c.Bool("no-xdg-open") {
if err := xdgOpen(ctx, url); err != nil {
return err
}
} else {
fmt.Printf("* Navigate to %s to open PR\n", url)
}
}
return nil
}
func xdgOpen(ctx context.Context, url string) error {
fmt.Printf("* `xdg-open %s`\n", url)
out, err := exec.CommandContext(ctx, "xdg-open", url).Output()
if err != nil {
fmt.Fprintf(os.Stderr, "%s", string(out))
return fmt.Errorf("unable to xdg-open to %s: %w", url, err)
}
return nil
}
func gitPushUp(ctx context.Context, remote, backportBranch string) error {
fmt.Printf("* `git push -u %s %s`\n", remote, backportBranch)
out, err := exec.CommandContext(ctx, "git", "push", "-u", remote, backportBranch).Output()
if err != nil {
fmt.Fprintf(os.Stderr, "%s", string(out))
return fmt.Errorf("unable to push up to %s: %w", remote, err)
}
return nil
}
func amendCommit(ctx context.Context, pr string) error {
fmt.Printf("* Amending commit to prepend `Backport #%s` to body\n", pr)
out, err := exec.CommandContext(ctx, "git", "log", "-1", "--pretty=format:%B").Output()
if err != nil {
fmt.Fprintf(os.Stderr, "%s", string(out))
return fmt.Errorf("unable to get last log message: %w", err)
}
parts := strings.SplitN(string(out), "\n", 2)
if len(parts) != 2 {
return fmt.Errorf("unable to interpret log message:\n%s", string(out))
}
subject, body := parts[0], parts[1]
if !strings.HasSuffix(subject, " (#"+pr+")") {
subject = subject + " (#" + pr + ")"
}
out, err = exec.CommandContext(ctx, "git", "commit", "--amend", "-m", subject+"\n\nBackport #"+pr+"\n"+body).Output()
if err != nil {
fmt.Fprintf(os.Stderr, "%s", string(out))
return fmt.Errorf("unable to amend last log message: %w", err)
}
return nil
}
func cherrypick(ctx context.Context, sha string) error {
// Check if a CHERRY_PICK_HEAD exists
if _, err := os.Stat(".git/CHERRY_PICK_HEAD"); err == nil {
// Assume that we are in the middle of cherry-pick - continue it
fmt.Println("* Attempting git cherry-pick --continue")
out, err := exec.CommandContext(ctx, "git", "cherry-pick", "--continue").Output()
if err != nil {
fmt.Fprintf(os.Stderr, "git cherry-pick --continue failed:\n%s\n", string(out))
return fmt.Errorf("unable to continue cherry-pick: %w", err)
}
return nil
}
fmt.Printf("* Attempting git cherry-pick %s\n", sha)
out, err := exec.CommandContext(ctx, "git", "cherry-pick", sha).Output()
if err != nil {
fmt.Fprintf(os.Stderr, "git cherry-pick %s failed:\n%s\n", sha, string(out))
return fmt.Errorf("git cherry-pick %s failed: %w", sha, err)
}
return nil
}
func checkoutBackportBranch(ctx context.Context, backportBranch, releaseBranch string) error {
out, err := exec.CommandContext(ctx, "git", "branch", "--show-current").Output()
if err != nil {
return fmt.Errorf("unable to check current branch %w", err)
}
currentBranch := strings.TrimSpace(string(out))
fmt.Printf("* Current branch is %s\n", currentBranch)
if currentBranch == backportBranch {
fmt.Printf("* Current branch is %s - not checking out\n", currentBranch)
return nil
}
if _, err := exec.CommandContext(ctx, "git", "rev-list", "-1", backportBranch).Output(); err == nil {
fmt.Printf("* Branch %s already exists. Checking it out...\n", backportBranch)
return exec.CommandContext(ctx, "git", "checkout", "-f", backportBranch).Run()
}
fmt.Printf("* `git checkout -b %s %s`\n", backportBranch, releaseBranch)
return exec.CommandContext(ctx, "git", "checkout", "-b", backportBranch, releaseBranch).Run()
}
func fetchRemoteAndMain(ctx context.Context, remote, releaseBranch string) error {
fmt.Printf("* `git fetch %s main`\n", remote)
out, err := exec.CommandContext(ctx, "git", "fetch", remote, "main").Output()
if err != nil {
fmt.Println(string(out))
return fmt.Errorf("unable to fetch %s from %s: %w", "main", remote, err)
}
fmt.Println(string(out))
fmt.Printf("* `git fetch %s %s`\n", remote, releaseBranch)
out, err = exec.CommandContext(ctx, "git", "fetch", remote, releaseBranch).Output()
if err != nil {
fmt.Println(string(out))
return fmt.Errorf("unable to fetch %s from %s: %w", releaseBranch, remote, err)
}
fmt.Println(string(out))
return nil
}
func determineRemote(ctx context.Context, forkUser string) (string, string, error) {
out, err := exec.CommandContext(ctx, "git", "remote", "-v").Output()
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to list git remotes:\n%s\n", string(out))
return "", "", fmt.Errorf("unable to determine forked remote: %w", err)
}
lines := strings.Split(string(out), "\n")
for _, line := range lines {
fields := strings.Split(line, "\t")
name, remote := fields[0], fields[1]
// only look at pushers
if !strings.HasSuffix(remote, " (push)") {
continue
}
// only look at github.com pushes
if !strings.Contains(remote, "github.com") {
continue
}
// ignore go-gitea/gitea
if strings.Contains(remote, "go-gitea/gitea") {
continue
}
if !strings.Contains(remote, forkUser) {
continue
}
if strings.HasPrefix(remote, "git@github.com:") {
forkUser = strings.TrimPrefix(remote, "git@github.com:")
} else if strings.HasPrefix(remote, "https://github.com/") {
forkUser = strings.TrimPrefix(remote, "https://github.com/")
} else if strings.HasPrefix(remote, "https://www.github.com/") {
forkUser = strings.TrimPrefix(remote, "https://www.github.com/")
} else if forkUser == "" {
return "", "", fmt.Errorf("unable to extract forkUser from remote %s: %s", name, remote)
}
idx := strings.Index(forkUser, "/")
if idx >= 0 {
forkUser = forkUser[:idx]
}
return name, forkUser, nil
}
return "", "", fmt.Errorf("unable to find appropriate remote in:\n%s", string(out))
}
func readCurrentBranch(ctx context.Context) (pr, version string, err error) {
out, err := exec.CommandContext(ctx, "git", "branch", "--show-current").Output()
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to read current git branch:\n%s\n", string(out))
return "", "", fmt.Errorf("unable to read current git branch: %w", err)
}
parts := strings.Split(strings.TrimSpace(string(out)), "-")
if len(parts) != 3 || parts[0] != "backport" {
fmt.Fprintf(os.Stderr, "Unable to continue from git branch:\n%s\n", string(out))
return "", "", fmt.Errorf("unable to continue from git branch:\n%s", string(out))
}
return parts[1], parts[2], nil
}
func readVersion() string {
bs, err := os.ReadFile("docs/config.yaml")
if err != nil {
if err == os.ErrNotExist {
log.Println("`docs/config.yaml` not present")
return ""
}
fmt.Fprintf(os.Stderr, "Unable to read `docs/config.yaml`: %v\n", err)
return ""
}
type params struct {
Version string
}
type docConfig struct {
Params params
}
dc := &docConfig{}
if err := yaml.Unmarshal(bs, dc); err != nil {
fmt.Fprintf(os.Stderr, "Unable to read `docs/config.yaml`: %v\n", err)
return ""
}
if dc.Params.Version == "" {
fmt.Fprintf(os.Stderr, "No version in `docs/config.yaml`")
return ""
}
version := dc.Params.Version
if version[0] != 'v' {
version = "v" + version
}
split := strings.SplitN(version, ".", 3)
return strings.Join(split[:2], ".")
}
func determineSHAforPR(ctx context.Context, prStr string) (string, error) {
prNum, err := strconv.Atoi(prStr)
if err != nil {
return "", err
}
client := github.NewClient(http.DefaultClient)
pr, _, err := client.PullRequests.Get(ctx, "go-gitea", "gitea", prNum)
if err != nil {
return "", err
}
if pr.Merged == nil || !*pr.Merged {
return "", fmt.Errorf("PR #%d is not yet merged - cannot determine sha to backport", prNum)
}
if pr.MergeCommitSHA != nil {
return *pr.MergeCommitSHA, nil
}
return "", nil
}
func installSignals() (context.Context, context.CancelFunc) {
ctx, cancel := context.WithCancel(context.Background())
go func() {
// install notify
signalChannel := make(chan os.Signal, 1)
signal.Notify(
signalChannel,
syscall.SIGINT,
syscall.SIGTERM,
)
select {
case <-signalChannel:
case <-ctx.Done():
}
cancel()
signal.Reset()
}()
return ctx, cancel
}

View file

@ -6,8 +6,8 @@ package main
import (
"os"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
"github.com/urfave/cli/v2"
)

View file

@ -1131,9 +1131,6 @@ LEVEL = Info
;; Add co-authored-by and co-committed-by trailers if committer does not match author
;ADD_CO_COMMITTER_TRAILERS = true
;;
;; In addition to testing patches using the three-way merge method, re-test conflicting patches with git apply
;TEST_CONFLICTING_PATCHES_WITH_GIT_APPLY = false
;;
;; Retarget child pull requests to the parent pull request branch target on merge of parent pull request. It only works on merged PRs where the head and base branch target the same repo.
;RETARGET_CHILDREN_ON_MERGE = true
@ -1163,9 +1160,13 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Signing format that Forgejo should use, openpgp uses GPG and ssh uses OpenSSH.
;FORMAT = openpgp
;;
;; GPG key to use to sign commits, Defaults to the default - that is the value of git config --get user.signingkey
;; run in the context of the RUN_USER
;; Switch to none to stop signing completely
;; Switch to none to stop signing completely.
;; If `FORMAT` is set to **ssh** this should be set to an absolute path to an public OpenSSH key.
;SIGNING_KEY = default
;;
;; If a SIGNING_KEY ID is provided and is not set to default, use the provided Name and Email address as the signer.
@ -1571,6 +1572,15 @@ LEVEL = Info
;; - manage_gpg_keys: a user cannot configure gpg keys
;;EXTERNAL_USER_DISABLE_FEATURES =
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[moderation]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; When true enables moderation capabilities; default is false.
;; If enabled it will be possible for users to report abusive content (new actions are added in the UI and /report_abuse route will be enabled) and a new Moderation section will be added to Admin settings where the reports can be reviewed.
;ENABLED = false
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[openid]
@ -2408,7 +2418,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The first locale will be used as the default if user browser's language doesn't match any locale in the list.
;LANGS = en-US,zh-CN,zh-HK,zh-TW,da,de-DE,nds,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg,it-IT,fi-FI,fil,eo,tr-TR,cs-CZ,sl,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID
;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Danish,Deutsch,Plattdüütsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Filipino,Esperanto,Türkçe,Čeština,Slovenščina,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia
;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Dansk,Deutsch,Plattdüütsch,Français,Nederlands,Latviešu,Русский,Українська,日本語,Español,Português do Brasil,Português de Portugal,Polski,Български,Italiano,Suomi,Filipino,Esperanto,Türkçe,Čeština,Slovenščina,Svenska,한국어,Ελληνικά,فارسی,Magyar nyelv,Bahasa Indonesia
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -2440,7 +2450,7 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set the maximum number of characters in a mermaid source. (Set to -1 to disable limits)
;MERMAID_MAX_SOURCE_CHARACTERS = 5000
;MERMAID_MAX_SOURCE_CHARACTERS = 50000
;; Set the maximum number of lines allowed for a filepreview. (Set to -1 to disable limits; set to 0 to disable the feature)
;FILEPREVIEW_MAX_LINES = 50

View file

@ -31,6 +31,21 @@ if [ -e /data/ssh/ssh_host_ecdsa_cert ]; then
SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa_cert"}
fi
# In case someone wants to sign the `{keyname}.pub` key by `ssh-keygen -s ca -I identity ...` to
# make use of the ssh-key certificate authority feature (see ssh-keygen CERTIFICATES section),
# the generated key file name is `{keyname}-cert.pub`
if [ -e /data/ssh/ssh_host_ed25519_key-cert.pub ]; then
SSH_ED25519_CERT=${SSH_ED25519_CERT:-"/data/ssh/ssh_host_ed25519_key-cert.pub"}
fi
if [ -e /data/ssh/ssh_host_rsa_key-cert.pub ]; then
SSH_RSA_CERT=${SSH_RSA_CERT:-"/data/ssh/ssh_host_rsa_key-cert.pub"}
fi
if [ -e /data/ssh/ssh_host_ecdsa_key-cert.pub ]; then
SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa_key-cert.pub"}
fi
if [ -d /etc/ssh ]; then
SSH_PORT=${SSH_PORT:-"22"} \
SSH_LISTEN_PORT=${SSH_LISTEN_PORT:-"${SSH_PORT}"} \

View file

@ -318,8 +318,9 @@ export default tseslint.config(
'no-jquery/no-data': [0],
'no-jquery/no-deferred': [2],
'no-jquery/no-delegate': [2],
'no-jquery/no-done-fail': [2],
'no-jquery/no-each-collection': [0],
'no-jquery/no-each-util': [0],
'no-jquery/no-each-util': [2],
'no-jquery/no-each': [0],
'no-jquery/no-error-shorthand': [2],
'no-jquery/no-error': [2],
@ -331,6 +332,7 @@ export default tseslint.config(
'no-jquery/no-find-collection': [0],
'no-jquery/no-find-util': [2],
'no-jquery/no-find': [0],
'no-jquery/no-fx': [2],
'no-jquery/no-fx-interval': [2],
'no-jquery/no-global-eval': [2],
'no-jquery/no-global-selector': [0],
@ -350,7 +352,7 @@ export default tseslint.config(
'no-jquery/no-live': [2],
'no-jquery/no-load-shorthand': [2],
'no-jquery/no-load': [2],
'no-jquery/no-map-collection': [0],
'no-jquery/no-map-collection': [2],
'no-jquery/no-map-util': [2],
'no-jquery/no-map': [2],
'no-jquery/no-merge': [2],
@ -374,12 +376,12 @@ export default tseslint.config(
'no-jquery/no-selector-prop': [2],
'no-jquery/no-serialize': [2],
'no-jquery/no-size': [2],
'no-jquery/no-sizzle': [0],
'no-jquery/no-sizzle': [2],
'no-jquery/no-slide': [2],
'no-jquery/no-sub': [2],
'no-jquery/no-support': [2],
'no-jquery/no-text': [0],
'no-jquery/no-trigger': [0],
'no-jquery/no-trigger': [2],
'no-jquery/no-trim': [2],
'no-jquery/no-type': [2],
'no-jquery/no-unique': [2],
@ -744,7 +746,6 @@ export default tseslint.config(
'unicorn/no-array-callback-reference': [0],
'unicorn/no-array-for-each': [2],
'unicorn/no-array-method-this-argument': [2],
'unicorn/no-array-push-push': [2],
'unicorn/no-array-reduce': [2],
'unicorn/no-await-expression-member': [0],
'unicorn/no-await-in-promise-methods': [2],
@ -757,7 +758,6 @@ export default tseslint.config(
'unicorn/no-invalid-fetch-options': [2],
'unicorn/no-invalid-remove-event-listener': [2],
'unicorn/no-keyword-prefix': [0],
'unicorn/no-length-as-slice-end': [2],
'unicorn/no-lonely-if': [2],
'unicorn/no-magic-array-flat-depth': [0],
'unicorn/no-named-default': [2],
@ -774,8 +774,11 @@ export default tseslint.config(
'unicorn/no-thenable': [2],
'unicorn/no-this-assignment': [2],
'unicorn/no-typeof-undefined': [2],
'unicorn/no-unnecessary-array-flat-depth': [2],
'unicorn/no-unnecessary-array-splice-count': [2],
'unicorn/no-unnecessary-await': [2],
'unicorn/no-unnecessary-polyfills': [2],
'unicorn/no-unnecessary-slice-end': [2],
'unicorn/no-unreadable-array-destructuring': [0],
'unicorn/no-unreadable-iife': [2],
'unicorn/no-unused-properties': [2],
@ -806,6 +809,7 @@ export default tseslint.config(
'unicorn/prefer-event-target': [2],
'unicorn/prefer-export-from': [0],
'unicorn/prefer-global-this': [0],
'unicorn/prefer-import-meta-properties': [2],
'unicorn/prefer-includes': [2],
'unicorn/prefer-json-parse-buffer': [0],
'unicorn/prefer-keyboard-event-key': [2],
@ -828,6 +832,7 @@ export default tseslint.config(
'unicorn/prefer-regexp-test': [2],
'unicorn/prefer-set-has': [0],
'unicorn/prefer-set-size': [2],
'unicorn/prefer-single-call': [2],
'unicorn/prefer-spread': [0],
'unicorn/prefer-string-raw': [0],
'unicorn/prefer-string-replace-all': [0],

View file

@ -25,10 +25,6 @@
# frontend
nodejs_20
# linting
python312
poetry
# backend
gofumpt
sqlite

167
go.mod
View file

@ -1,33 +1,34 @@
module code.gitea.io/gitea
module forgejo.org
go 1.24
toolchain go1.24.1
toolchain go1.24.3
require (
code.forgejo.org/f3/gof3/v3 v3.10.6
code.forgejo.org/forgejo-contrib/go-libravatar v0.0.0-20191008002943-06d1c002b251
code.forgejo.org/forgejo/go-rpmutils v1.0.0
code.forgejo.org/forgejo/levelqueue v1.0.0
code.forgejo.org/forgejo/reply v1.0.2
code.forgejo.org/go-chi/binding v1.0.0
code.forgejo.org/go-chi/cache v1.0.0
code.forgejo.org/go-chi/captcha v1.0.1
code.forgejo.org/go-chi/session v1.0.1
code.forgejo.org/go-chi/binding v1.0.1
code.forgejo.org/go-chi/cache v1.0.1
code.forgejo.org/go-chi/captcha v1.0.2
code.forgejo.org/go-chi/session v1.0.2
code.gitea.io/actions-proto-go v0.4.0
code.gitea.io/sdk/gitea v0.20.0
code.gitea.io/sdk/gitea v0.21.0
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
connectrpc.com/connect v1.17.0
github.com/42wim/httpsig v1.2.2
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121
github.com/42wim/httpsig v1.2.3
github.com/42wim/sshsig v0.0.0-20250502153856-5100632e8920
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
github.com/ProtonMail/go-crypto v1.1.6
github.com/PuerkitoBio/goquery v1.10.2
github.com/ProtonMail/go-crypto v1.3.0
github.com/PuerkitoBio/goquery v1.10.3
github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.7.2
github.com/alecthomas/chroma/v2 v2.15.0
github.com/alecthomas/chroma/v2 v2.18.0
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
github.com/blevesearch/bleve/v2 v2.4.4
github.com/blevesearch/bleve/v2 v2.5.1
github.com/buildkite/terminal-to-html/v3 v3.16.8
github.com/caddyserver/certmagic v0.22.2
github.com/caddyserver/certmagic v0.23.0
github.com/chi-middleware/proxy v1.1.1
github.com/djherbis/buffer v1.2.0
github.com/djherbis/nio/v3 v3.0.1
@ -36,27 +37,26 @@ require (
github.com/editorconfig/editorconfig-core-go/v2 v2.6.3
github.com/emersion/go-imap v1.2.1
github.com/felixge/fgprof v0.9.5
github.com/fsnotify/fsnotify v1.8.0
github.com/fsnotify/fsnotify v1.9.0
github.com/gliderlabs/ssh v0.3.8
github.com/go-ap/activitypub v0.0.0-20231114162308-e219254dc5c9
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
github.com/go-chi/chi/v5 v5.2.0
github.com/go-chi/chi/v5 v5.2.1
github.com/go-chi/cors v1.2.1
github.com/go-co-op/gocron v1.37.0
github.com/go-enry/go-enry/v2 v2.9.2
github.com/go-git/go-git/v5 v5.13.2
github.com/go-ldap/ldap/v3 v3.4.6
github.com/go-openapi/spec v0.20.14
github.com/go-sql-driver/mysql v1.9.1
github.com/go-testfixtures/testfixtures/v3 v3.14.0
github.com/go-webauthn/webauthn v0.12.2
github.com/go-openapi/spec v0.21.0
github.com/go-sql-driver/mysql v1.9.2
github.com/go-webauthn/webauthn v0.13.0
github.com/gobwas/glob v0.2.3
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/google/go-github/v64 v64.0.0
github.com/google/pprof v0.0.0-20241017200806-017d972448fc
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e
github.com/google/uuid v1.6.0
github.com/gorilla/feeds v1.2.0
github.com/gorilla/sessions v1.4.0
@ -67,28 +67,27 @@ require (
github.com/jhillyerd/enmime/v2 v2.1.0
github.com/json-iterator/go v1.1.12
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/klauspost/compress v1.17.11
github.com/klauspost/compress v1.18.0
github.com/klauspost/cpuid/v2 v2.2.10
github.com/lib/pq v1.10.9
github.com/markbates/goth v1.80.0
github.com/mattn/go-isatty v0.0.20
github.com/mattn/go-sqlite3 v1.14.24
github.com/mattn/go-sqlite3 v1.14.28
github.com/meilisearch/meilisearch-go v0.31.0
github.com/mholt/archiver/v3 v3.5.1
github.com/microcosm-cc/bluemonday v1.0.27
github.com/minio/minio-go/v7 v7.0.88
github.com/msteinert/pam/v2 v2.0.0
github.com/minio/minio-go/v7 v7.0.91
github.com/msteinert/pam/v2 v2.1.0
github.com/nektos/act v0.2.52
github.com/niklasfasching/go-org v1.7.0
github.com/niklasfasching/go-org v1.8.0
github.com/olivere/elastic/v7 v7.0.32
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1
github.com/pquerna/otp v1.4.0
github.com/prometheus/client_golang v1.21.1
github.com/redis/go-redis/v9 v9.7.3
github.com/redis/go-redis/v9 v9.8.0
github.com/robfig/cron/v3 v3.0.1
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1
github.com/sassoftware/go-rpmutils v0.4.0
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3
github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92
github.com/stretchr/testify v1.10.0
@ -97,17 +96,17 @@ require (
github.com/urfave/cli/v2 v2.27.6
github.com/valyala/fastjson v1.6.4
github.com/yohcop/openid-go v1.0.1
github.com/yuin/goldmark v1.7.8
github.com/yuin/goldmark v1.7.12
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
gitlab.com/gitlab-org/api/client-go v0.126.0
go.uber.org/mock v0.5.0
golang.org/x/crypto v0.36.0
golang.org/x/image v0.25.0
golang.org/x/net v0.37.0
golang.org/x/oauth2 v0.28.0
golang.org/x/sync v0.12.0
golang.org/x/sys v0.31.0
golang.org/x/text v0.23.0
go.uber.org/mock v0.5.1
golang.org/x/crypto v0.38.0
golang.org/x/image v0.27.0
golang.org/x/net v0.40.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sync v0.14.0
golang.org/x/sys v0.33.0
golang.org/x/text v0.25.0
google.golang.org/protobuf v1.36.4
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/ini.v1 v1.67.0
@ -118,66 +117,51 @@ require (
)
require (
cel.dev/expr v0.19.1 // indirect
cloud.google.com/go v0.116.0 // indirect
cloud.google.com/go/auth v0.9.9 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.6.0 // indirect
cloud.google.com/go/iam v1.2.1 // indirect
cloud.google.com/go/longrunning v0.6.1 // indirect
cloud.google.com/go/monitoring v1.21.1 // indirect
cloud.google.com/go/spanner v1.73.0 // indirect
dario.cat/mergo v1.0.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/RoaringBitmap/roaring v1.9.3 // indirect
github.com/RoaringBitmap/roaring/v2 v2.4.5 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/andybalholm/cascadia v1.3.3 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/blevesearch/bleve_index_api v1.1.12 // indirect
github.com/blevesearch/geo v0.1.20 // indirect
github.com/blevesearch/go-faiss v1.0.24 // indirect
github.com/bits-and-blooms/bitset v1.22.0 // indirect
github.com/blevesearch/bleve_index_api v1.2.8 // indirect
github.com/blevesearch/geo v0.2.3 // indirect
github.com/blevesearch/go-faiss v1.0.25 // indirect
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
github.com/blevesearch/gtreap v0.1.1 // indirect
github.com/blevesearch/mmap-go v1.0.4 // indirect
github.com/blevesearch/scorch_segment_api/v2 v2.2.16 // indirect
github.com/blevesearch/scorch_segment_api/v2 v2.3.10 // indirect
github.com/blevesearch/segment v0.9.1 // indirect
github.com/blevesearch/snowballstem v0.9.0 // indirect
github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
github.com/blevesearch/vellum v1.0.10 // indirect
github.com/blevesearch/zapx/v11 v11.3.10 // indirect
github.com/blevesearch/zapx/v12 v12.3.10 // indirect
github.com/blevesearch/zapx/v13 v13.3.10 // indirect
github.com/blevesearch/zapx/v14 v14.3.10 // indirect
github.com/blevesearch/zapx/v15 v15.3.16 // indirect
github.com/blevesearch/zapx/v16 v16.1.9-0.20241217210638-a0519e7caf3b // indirect
github.com/blevesearch/vellum v1.1.0 // indirect
github.com/blevesearch/zapx/v11 v11.4.2 // indirect
github.com/blevesearch/zapx/v12 v12.4.2 // indirect
github.com/blevesearch/zapx/v13 v13.4.2 // indirect
github.com/blevesearch/zapx/v14 v14.4.2 // indirect
github.com/blevesearch/zapx/v15 v15.4.2 // indirect
github.com/blevesearch/zapx/v16 v16.2.3 // indirect
github.com/boombuler/barcode v1.0.1 // indirect
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 // indirect
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf // indirect
github.com/caddyserver/zerossl v0.1.3 // indirect
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.3.8 // indirect
github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/davidmz/go-pageant v1.0.2 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/dlclark/regexp2 v1.11.5 // indirect
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
github.com/go-ap/errors v0.0.0-20231003111023-183eef4b31b7 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/go-enry/go-oniguruma v1.2.1 // indirect
@ -185,26 +169,19 @@ require (
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.7 // indirect
github.com/go-webauthn/x v0.1.19 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/go-webauthn/x v0.1.21 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/go-tpm v0.9.3 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/googleapis/go-sql-spanner v1.7.4 // indirect
github.com/google/go-tpm v0.9.5 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
@ -214,12 +191,12 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/libdns/libdns v0.2.3 // indirect
github.com/libdns/libdns v1.0.0-beta.1 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/markbates/going v1.0.3 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mholt/acmez/v3 v3.1.1 // indirect
github.com/mholt/acmez/v3 v3.1.2 // indirect
github.com/miekg/dns v1.1.63 // indirect
github.com/minio/crc64nvme v1.0.1 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
@ -235,13 +212,13 @@ require (
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rhysd/actionlint v1.6.27 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
@ -252,18 +229,9 @@ require (
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/zeebo/assert v1.3.0 // indirect
github.com/zeebo/blake3 v0.2.4 // indirect
go.etcd.io/bbolt v1.3.9 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.etcd.io/bbolt v1.4.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
@ -271,11 +239,6 @@ require (
golang.org/x/mod v0.24.0 // indirect
golang.org/x/time v0.10.0 // indirect
golang.org/x/tools v0.31.0 // indirect
google.golang.org/api v0.203.0 // indirect
google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/grpc v1.71.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
@ -284,7 +247,7 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
replace github.com/nektos/act => code.forgejo.org/forgejo/act v1.25.1
replace github.com/nektos/act => code.forgejo.org/forgejo/act v1.26.0
replace github.com/mholt/archiver/v3 => code.forgejo.org/forgejo/archiver/v3 v3.5.1

1775
go.sum

File diff suppressed because it is too large Load diff

16
main.go
View file

@ -10,16 +10,16 @@ import (
"strings"
"time"
"code.gitea.io/gitea/cmd"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"forgejo.org/cmd"
"forgejo.org/modules/log"
"forgejo.org/modules/setting"
// register supported doc types
_ "code.gitea.io/gitea/modules/markup/asciicast"
_ "code.gitea.io/gitea/modules/markup/console"
_ "code.gitea.io/gitea/modules/markup/csv"
_ "code.gitea.io/gitea/modules/markup/markdown"
_ "code.gitea.io/gitea/modules/markup/orgmode"
_ "forgejo.org/modules/markup/asciicast"
_ "forgejo.org/modules/markup/console"
_ "forgejo.org/modules/markup/csv"
_ "forgejo.org/modules/markup/markdown"
_ "forgejo.org/modules/markup/orgmode"
"github.com/urfave/cli/v2"
)

View file

@ -11,9 +11,9 @@ import (
"errors"
"time"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
"forgejo.org/models/db"
"forgejo.org/modules/timeutil"
"forgejo.org/modules/util"
"xorm.io/builder"
)

View file

@ -7,9 +7,9 @@ import (
"crypto/subtle"
"fmt"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/util"
auth_model "forgejo.org/models/auth"
"forgejo.org/models/db"
"forgejo.org/modules/util"
gouuid "github.com/google/uuid"
)

View file

@ -6,9 +6,9 @@ import (
"crypto/subtle"
"testing"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
auth_model "forgejo.org/models/auth"
"forgejo.org/models/db"
"forgejo.org/models/unittest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -24,9 +24,9 @@ func TestActions_RegisterRunner_Token(t *testing.T) {
version := "v1.2.3"
runner, err := RegisterRunner(db.DefaultContext, ownerID, repoID, token, &labels, name, version)
require.NoError(t, err)
assert.EqualValues(t, name, runner.Name)
assert.Equal(t, name, runner.Name)
assert.EqualValues(t, 1, subtle.ConstantTimeCompare([]byte(runner.TokenHash), []byte(auth_model.HashToken(token, runner.TokenSalt))), "the token cannot be verified with the same method as routers/api/actions/runner/interceptor.go as of 8228751c55d6a4263f0fec2932ca16181c09c97d")
assert.Equal(t, 1, subtle.ConstantTimeCompare([]byte(runner.TokenHash), []byte(auth_model.HashToken(token, runner.TokenSalt))), "the token cannot be verified with the same method as routers/api/actions/runner/interceptor.go as of 8228751c55d6a4263f0fec2932ca16181c09c97d")
}
// TestActions_RegisterRunner_TokenUpdate tests that a token's secret is updated
@ -73,19 +73,19 @@ func TestActions_RegisterRunner_CreateWithLabels(t *testing.T) {
require.NoError(t, err)
// Check that the returned record has been updated, except for the labels
assert.EqualValues(t, ownerID, runner.OwnerID)
assert.EqualValues(t, repoID, runner.RepoID)
assert.EqualValues(t, name, runner.Name)
assert.EqualValues(t, version, runner.Version)
assert.EqualValues(t, labelsCopy, runner.AgentLabels)
assert.Equal(t, ownerID, runner.OwnerID)
assert.Equal(t, repoID, runner.RepoID)
assert.Equal(t, name, runner.Name)
assert.Equal(t, version, runner.Version)
assert.Equal(t, labelsCopy, runner.AgentLabels)
// Check that whatever is in the DB has been updated, except for the labels
after := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: runner.ID})
assert.EqualValues(t, ownerID, after.OwnerID)
assert.EqualValues(t, repoID, after.RepoID)
assert.EqualValues(t, name, after.Name)
assert.EqualValues(t, version, after.Version)
assert.EqualValues(t, labelsCopy, after.AgentLabels)
assert.Equal(t, ownerID, after.OwnerID)
assert.Equal(t, repoID, after.RepoID)
assert.Equal(t, name, after.Name)
assert.Equal(t, version, after.Version)
assert.Equal(t, labelsCopy, after.AgentLabels)
}
func TestActions_RegisterRunner_CreateWithoutLabels(t *testing.T) {
@ -100,19 +100,19 @@ func TestActions_RegisterRunner_CreateWithoutLabels(t *testing.T) {
require.NoError(t, err)
// Check that the returned record has been updated, except for the labels
assert.EqualValues(t, ownerID, runner.OwnerID)
assert.EqualValues(t, repoID, runner.RepoID)
assert.EqualValues(t, name, runner.Name)
assert.EqualValues(t, version, runner.Version)
assert.EqualValues(t, []string{}, runner.AgentLabels)
assert.Equal(t, ownerID, runner.OwnerID)
assert.Equal(t, repoID, runner.RepoID)
assert.Equal(t, name, runner.Name)
assert.Equal(t, version, runner.Version)
assert.Equal(t, []string{}, runner.AgentLabels)
// Check that whatever is in the DB has been updated, except for the labels
after := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: runner.ID})
assert.EqualValues(t, ownerID, after.OwnerID)
assert.EqualValues(t, repoID, after.RepoID)
assert.EqualValues(t, name, after.Name)
assert.EqualValues(t, version, after.Version)
assert.EqualValues(t, []string{}, after.AgentLabels)
assert.Equal(t, ownerID, after.OwnerID)
assert.Equal(t, repoID, after.RepoID)
assert.Equal(t, name, after.Name)
assert.Equal(t, version, after.Version)
assert.Equal(t, []string{}, after.AgentLabels)
}
func TestActions_RegisterRunner_UpdateWithLabels(t *testing.T) {
@ -132,19 +132,19 @@ func TestActions_RegisterRunner_UpdateWithLabels(t *testing.T) {
require.NoError(t, err)
// Check that the returned record has been updated
assert.EqualValues(t, newOwnerID, runner.OwnerID)
assert.EqualValues(t, newRepoID, runner.RepoID)
assert.EqualValues(t, newName, runner.Name)
assert.EqualValues(t, newVersion, runner.Version)
assert.EqualValues(t, labelsCopy, runner.AgentLabels)
assert.Equal(t, newOwnerID, runner.OwnerID)
assert.Equal(t, newRepoID, runner.RepoID)
assert.Equal(t, newName, runner.Name)
assert.Equal(t, newVersion, runner.Version)
assert.Equal(t, labelsCopy, runner.AgentLabels)
// Check that whatever is in the DB has been updated
after := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: recordID})
assert.EqualValues(t, newOwnerID, after.OwnerID)
assert.EqualValues(t, newRepoID, after.RepoID)
assert.EqualValues(t, newName, after.Name)
assert.EqualValues(t, newVersion, after.Version)
assert.EqualValues(t, labelsCopy, after.AgentLabels)
assert.Equal(t, newOwnerID, after.OwnerID)
assert.Equal(t, newRepoID, after.RepoID)
assert.Equal(t, newName, after.Name)
assert.Equal(t, newVersion, after.Version)
assert.Equal(t, labelsCopy, after.AgentLabels)
}
func TestActions_RegisterRunner_UpdateWithoutLabels(t *testing.T) {
@ -162,17 +162,17 @@ func TestActions_RegisterRunner_UpdateWithoutLabels(t *testing.T) {
require.NoError(t, err)
// Check that the returned record has been updated, except for the labels
assert.EqualValues(t, newOwnerID, runner.OwnerID)
assert.EqualValues(t, newRepoID, runner.RepoID)
assert.EqualValues(t, newName, runner.Name)
assert.EqualValues(t, newVersion, runner.Version)
assert.EqualValues(t, before.AgentLabels, runner.AgentLabels)
assert.Equal(t, newOwnerID, runner.OwnerID)
assert.Equal(t, newRepoID, runner.RepoID)
assert.Equal(t, newName, runner.Name)
assert.Equal(t, newVersion, runner.Version)
assert.Equal(t, before.AgentLabels, runner.AgentLabels)
// Check that whatever is in the DB has been updated, except for the labels
after := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: recordID})
assert.EqualValues(t, newOwnerID, after.OwnerID)
assert.EqualValues(t, newRepoID, after.RepoID)
assert.EqualValues(t, newName, after.Name)
assert.EqualValues(t, newVersion, after.Version)
assert.EqualValues(t, before.AgentLabels, after.AgentLabels)
assert.Equal(t, newOwnerID, after.OwnerID)
assert.Equal(t, newRepoID, after.RepoID)
assert.Equal(t, newName, after.Name)
assert.Equal(t, newVersion, after.Version)
assert.Equal(t, before.AgentLabels, after.AgentLabels)
}

View file

@ -6,13 +6,14 @@ package actions
import (
"testing"
"code.gitea.io/gitea/models/unittest"
"forgejo.org/models/unittest"
)
func TestMain(m *testing.M) {
unittest.MainTest(m, &unittest.TestOptions{
FixtureFiles: []string{
"action_runner.yml",
"repository.yml",
"action_runner_token.yml",
},
})

View file

@ -10,15 +10,15 @@ import (
"strings"
"time"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/json"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
webhook_module "code.gitea.io/gitea/modules/webhook"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
user_model "forgejo.org/models/user"
"forgejo.org/modules/git"
"forgejo.org/modules/json"
api "forgejo.org/modules/structs"
"forgejo.org/modules/timeutil"
"forgejo.org/modules/util"
webhook_module "forgejo.org/modules/webhook"
"github.com/nektos/act/pkg/jobparser"
"xorm.io/builder"
@ -185,77 +185,9 @@ func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) err
return err
}
// CancelPreviousJobs cancels all previous jobs of the same repository, reference, workflow, and event.
// It's useful when a new run is triggered, and all previous runs needn't be continued anymore.
func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) error {
// Find all runs in the specified repository, reference, and workflow with non-final status
runs, total, err := db.FindAndCount[ActionRun](ctx, FindRunOptions{
RepoID: repoID,
Ref: ref,
WorkflowID: workflowID,
TriggerEvent: event,
Status: []Status{StatusRunning, StatusWaiting, StatusBlocked},
})
if err != nil {
return err
}
// If there are no runs found, there's no need to proceed with cancellation, so return nil.
if total == 0 {
return nil
}
// Iterate over each found run and cancel its associated jobs.
for _, run := range runs {
// Find all jobs associated with the current run.
jobs, err := db.Find[ActionRunJob](ctx, FindRunJobOptions{
RunID: run.ID,
})
if err != nil {
return err
}
// Iterate over each job and attempt to cancel it.
for _, job := range jobs {
// Skip jobs that are already in a terminal state (completed, cancelled, etc.).
status := job.Status
if status.IsDone() {
continue
}
// If the job has no associated task (probably an error), set its status to 'Cancelled' and stop it.
if job.TaskID == 0 {
job.Status = StatusCancelled
job.Stopped = timeutil.TimeStampNow()
// Update the job's status and stopped time in the database.
n, err := UpdateRunJob(ctx, job, builder.Eq{"task_id": 0}, "status", "stopped")
if err != nil {
return err
}
// If the update affected 0 rows, it means the job has changed in the meantime, so we need to try again.
if n == 0 {
return fmt.Errorf("job has changed, try again")
}
// Continue with the next job.
continue
}
// If the job has an associated task, try to stop the task, effectively cancelling the job.
if err := StopTask(ctx, job.TaskID, StatusCancelled); err != nil {
return err
}
}
}
// Return nil to indicate successful cancellation of all running and waiting jobs.
return nil
}
// InsertRun inserts a run
// The title will be cut off at 255 characters if it's longer than 255 characters.
// We don't have to send the ActionRunNowDone notification here because there are no runs that start in a not done status.
func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWorkflow) error {
ctx, commiter, err := db.TxContext(ctx)
if err != nil {
@ -290,29 +222,38 @@ func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWork
var hasWaiting bool
for _, v := range jobs {
id, job := v.Job()
needs := job.Needs()
status := StatusFailure
payload := []byte{}
needs := []string{}
name := run.Title
runsOn := []string{}
if job != nil {
needs = job.Needs()
if err := v.SetJob(id, job.EraseNeeds()); err != nil {
return err
}
payload, _ := v.Marshal()
status := StatusWaiting
payload, _ = v.Marshal()
if len(needs) > 0 || run.NeedApproval {
status = StatusBlocked
} else {
status = StatusWaiting
hasWaiting = true
}
job.Name, _ = util.SplitStringAtByteN(job.Name, 255)
name, _ = util.SplitStringAtByteN(job.Name, 255)
runsOn = job.RunsOn()
}
runJobs = append(runJobs, &ActionRunJob{
RunID: run.ID,
RepoID: run.RepoID,
OwnerID: run.OwnerID,
CommitSHA: run.CommitSHA,
IsForkPullRequest: run.IsForkPullRequest,
Name: job.Name,
Name: name,
WorkflowPayload: payload,
JobID: id,
Needs: needs,
RunsOn: job.RunsOn(),
RunsOn: runsOn,
Status: status,
})
}
@ -341,6 +282,18 @@ func GetLatestRun(ctx context.Context, repoID int64) (*ActionRun, error) {
return &run, nil
}
// GetRunBefore returns the last run that completed a given timestamp (not inclusive).
func GetRunBefore(ctx context.Context, repoID int64, timestamp timeutil.TimeStamp) (*ActionRun, error) {
var run ActionRun
has, err := db.GetEngine(ctx).Where("repo_id=? AND stopped IS NOT NULL AND stopped<?", repoID, timestamp).OrderBy("stopped DESC").Limit(1).Get(&run)
if err != nil {
return nil, err
} else if !has {
return nil, fmt.Errorf("run before: %w", util.ErrNotExist)
}
return &run, nil
}
func GetLatestRunForBranchAndWorkflow(ctx context.Context, repoID int64, branch, workflowFile, event string) (*ActionRun, error) {
var run ActionRun
q := db.GetEngine(ctx).Where("repo_id=?", repoID).And("workflow_id=?", workflowFile)
@ -389,7 +342,9 @@ func GetRunByIndex(ctx context.Context, repoID, index int64) (*ActionRun, error)
// UpdateRun updates a run.
// It requires the inputted run has Version set.
// It will return error if the version is not matched (it means the run has been changed after loaded).
func UpdateRun(ctx context.Context, run *ActionRun, cols ...string) error {
// All calls to UpdateRunWithoutNotification that change run.Status from a not done status to a done status must call the ActionRunNowDone notification channel.
// Use the wrapper function UpdateRun instead.
func UpdateRunWithoutNotification(ctx context.Context, run *ActionRun, cols ...string) error {
sess := db.GetEngine(ctx).ID(run.ID)
if len(cols) > 0 {
sess.Cols(cols...)

View file

@ -9,10 +9,10 @@ import (
"slices"
"time"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
"forgejo.org/models/db"
"forgejo.org/modules/container"
"forgejo.org/modules/timeutil"
"forgejo.org/modules/util"
"xorm.io/builder"
)
@ -101,7 +101,9 @@ func GetRunJobsByRunID(ctx context.Context, runID int64) ([]*ActionRunJob, error
return jobs, nil
}
func UpdateRunJob(ctx context.Context, job *ActionRunJob, cond builder.Cond, cols ...string) (int64, error) {
// All calls to UpdateRunJobWithoutNotification that change run.Status for any run from a not done status to a done status must call the ActionRunNowDone notification channel.
// Use the wrapper function UpdateRunJob instead.
func UpdateRunJobWithoutNotification(ctx context.Context, job *ActionRunJob, cond builder.Cond, cols ...string) (int64, error) {
e := db.GetEngine(ctx)
sess := e.ID(job.ID)
@ -154,7 +156,8 @@ func UpdateRunJob(ctx context.Context, job *ActionRunJob, cond builder.Cond, col
if run.Stopped.IsZero() && run.Status.IsDone() {
run.Stopped = timeutil.TimeStampNow()
}
if err := UpdateRun(ctx, run, "status", "started", "stopped"); err != nil {
// As the caller has to ensure the ActionRunNowDone notification is sent we can ignore doing so here.
if err := UpdateRunWithoutNotification(ctx, run, "status", "started", "stopped"); err != nil {
return 0, fmt.Errorf("update run %d: %w", run.ID, err)
}
}

View file

@ -6,9 +6,9 @@ package actions
import (
"context"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/timeutil"
"forgejo.org/models/db"
"forgejo.org/modules/container"
"forgejo.org/modules/timeutil"
"xorm.io/builder"
)

View file

@ -6,12 +6,12 @@ package actions
import (
"context"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/translation"
webhook_module "code.gitea.io/gitea/modules/webhook"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
user_model "forgejo.org/models/user"
"forgejo.org/modules/container"
"forgejo.org/modules/translation"
webhook_module "forgejo.org/modules/webhook"
"xorm.io/builder"
)

View file

@ -0,0 +1,96 @@
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package actions
import (
"testing"
"time"
"forgejo.org/models/db"
"forgejo.org/models/unittest"
"forgejo.org/modules/timeutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestGetRunBefore(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
// this repo is part of the test database requiring loading "repository.yml" in main_test.go
var repoID int64 = 1
workflowID := "test_workflow"
// third completed run
time1, err := time.Parse(time.RFC3339, "2024-07-31T15:47:55+08:00")
require.NoError(t, err)
timeutil.MockSet(time1)
run1 := ActionRun{
ID: 1,
Index: 1,
RepoID: repoID,
Stopped: timeutil.TimeStampNow(),
WorkflowID: workflowID,
}
// fourth completed run
time2, err := time.Parse(time.RFC3339, "2024-08-31T15:47:55+08:00")
require.NoError(t, err)
timeutil.MockSet(time2)
run2 := ActionRun{
ID: 2,
Index: 2,
RepoID: repoID,
Stopped: timeutil.TimeStampNow(),
WorkflowID: workflowID,
}
// second completed run
time3, err := time.Parse(time.RFC3339, "2024-07-31T15:47:54+08:00")
require.NoError(t, err)
timeutil.MockSet(time3)
run3 := ActionRun{
ID: 3,
Index: 3,
RepoID: repoID,
Stopped: timeutil.TimeStampNow(),
WorkflowID: workflowID,
}
// first completed run
time4, err := time.Parse(time.RFC3339, "2024-06-30T15:47:54+08:00")
require.NoError(t, err)
timeutil.MockSet(time4)
run4 := ActionRun{
ID: 4,
Index: 4,
RepoID: repoID,
Stopped: timeutil.TimeStampNow(),
WorkflowID: workflowID,
}
require.NoError(t, db.Insert(db.DefaultContext, &run1))
runBefore, err := GetRunBefore(db.DefaultContext, repoID, run1.Stopped)
// there is no run before run1
require.Error(t, err)
require.Nil(t, runBefore)
// now there is only run3 before run1
require.NoError(t, db.Insert(db.DefaultContext, &run3))
runBefore, err = GetRunBefore(db.DefaultContext, repoID, run1.Stopped)
require.NoError(t, err)
assert.Equal(t, run3.ID, runBefore.ID)
// there still is only run3 before run1
require.NoError(t, db.Insert(db.DefaultContext, &run2))
runBefore, err = GetRunBefore(db.DefaultContext, repoID, run1.Stopped)
require.NoError(t, err)
assert.Equal(t, run3.ID, runBefore.ID)
// run4 is further away from run1
require.NoError(t, db.Insert(db.DefaultContext, &run4))
runBefore, err = GetRunBefore(db.DefaultContext, repoID, run1.Stopped)
require.NoError(t, err)
assert.Equal(t, run3.ID, runBefore.ID)
}

View file

@ -11,15 +11,15 @@ import (
"strings"
"time"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/shared/types"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/optional"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/translation"
"code.gitea.io/gitea/modules/util"
auth_model "forgejo.org/models/auth"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
"forgejo.org/models/shared/types"
user_model "forgejo.org/models/user"
"forgejo.org/modules/optional"
"forgejo.org/modules/timeutil"
"forgejo.org/modules/translation"
"forgejo.org/modules/util"
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
"xorm.io/builder"
@ -87,9 +87,10 @@ func (r *ActionRunner) BelongsToOwnerType() types.OwnerType {
return types.OwnerTypeRepository
}
if r.OwnerID != 0 {
if r.Owner.Type == user_model.UserTypeOrganization {
switch r.Owner.Type {
case user_model.UserTypeOrganization:
return types.OwnerTypeOrganization
} else if r.Owner.Type == user_model.UserTypeIndividual {
case user_model.UserTypeIndividual:
return types.OwnerTypeIndividual
}
}
@ -167,12 +168,7 @@ func (r *ActionRunner) GenerateToken() (err error) {
// UpdateSecret updates the hash based on the specified token. It does not
// ensure that the runner's UUID matches the first 16 bytes of the token.
func (r *ActionRunner) UpdateSecret(token string) error {
saltBytes, err := util.CryptoRandomBytes(16)
if err != nil {
return fmt.Errorf("CryptoRandomBytes %v", err)
}
salt := hex.EncodeToString(saltBytes)
salt := hex.EncodeToString(util.CryptoRandomBytes(16))
r.Token = token
r.TokenSalt = salt

View file

@ -6,10 +6,10 @@ package actions
import (
"context"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/container"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
user_model "forgejo.org/models/user"
"forgejo.org/modules/container"
)
type RunnerList []*ActionRunner

View file

@ -7,9 +7,9 @@ import (
"fmt"
"testing"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
auth_model "forgejo.org/models/auth"
"forgejo.org/models/db"
"forgejo.org/models/unittest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

View file

@ -7,11 +7,11 @@ import (
"context"
"fmt"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
user_model "forgejo.org/models/user"
"forgejo.org/modules/timeutil"
"forgejo.org/modules/util"
)
// ActionRunnerToken represents runner tokens

View file

@ -6,8 +6,8 @@ package actions
import (
"testing"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
"forgejo.org/models/db"
"forgejo.org/models/unittest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -18,7 +18,7 @@ func TestGetLatestRunnerToken(t *testing.T) {
token := unittest.AssertExistsAndLoadBean(t, &ActionRunnerToken{ID: 3})
expectedToken, err := GetLatestRunnerToken(db.DefaultContext, 1, 0)
require.NoError(t, err)
assert.EqualValues(t, expectedToken, token)
assert.Equal(t, expectedToken, token)
}
func TestNewRunnerToken(t *testing.T) {
@ -27,7 +27,7 @@ func TestNewRunnerToken(t *testing.T) {
require.NoError(t, err)
expectedToken, err := GetLatestRunnerToken(db.DefaultContext, 1, 0)
require.NoError(t, err)
assert.EqualValues(t, expectedToken, token)
assert.Equal(t, expectedToken, token)
}
func TestUpdateRunnerToken(t *testing.T) {
@ -37,5 +37,5 @@ func TestUpdateRunnerToken(t *testing.T) {
require.NoError(t, UpdateRunnerToken(db.DefaultContext, token))
expectedToken, err := GetLatestRunnerToken(db.DefaultContext, 1, 0)
require.NoError(t, err)
assert.EqualValues(t, expectedToken, token)
assert.Equal(t, expectedToken, token)
}

View file

@ -5,15 +5,14 @@ package actions
import (
"context"
"fmt"
"time"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
webhook_module "code.gitea.io/gitea/modules/webhook"
"forgejo.org/models/db"
repo_model "forgejo.org/models/repo"
user_model "forgejo.org/models/user"
"forgejo.org/modules/timeutil"
"forgejo.org/modules/util"
webhook_module "forgejo.org/modules/webhook"
"xorm.io/builder"
)
@ -119,27 +118,6 @@ func DeleteScheduleTaskByRepo(ctx context.Context, id int64) error {
return committer.Commit()
}
func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository, cancelPreviousJobs bool) error {
// If actions disabled when there is schedule task, this will remove the outdated schedule tasks
// There is no other place we can do this because the app.ini will be changed manually
if err := DeleteScheduleTaskByRepo(ctx, repo.ID); err != nil {
return fmt.Errorf("DeleteCronTaskByRepo: %v", err)
}
if cancelPreviousJobs {
// cancel running cron jobs of this repository and delete old schedules
if err := CancelPreviousJobs(
ctx,
repo.ID,
repo.DefaultBranch,
"",
webhook_module.HookEventSchedule,
); err != nil {
return fmt.Errorf("CancelPreviousJobs: %v", err)
}
}
return nil
}
type FindScheduleOptions struct {
db.ListOptions
RepoID int64

Some files were not shown because too many files have changed in this diff Show more