Compare commits

..

150 commits

Author SHA1 Message Date
Matthias Riße
6c61f80d21 feat: copy annexed files on pull request merge (#62)
Some checks failed
/ build-oci-image (rootful) (push) Has been cancelled
/ build-oci-image (rootless) (push) Has been cancelled
/ release (push) Has been cancelled
testing / backend-checks (push) Has been cancelled
testing / frontend-checks (push) Has been cancelled
testing / test-unit (push) Has been cancelled
testing / test-e2e (push) Has been cancelled
testing / test-remote-cacher (redis) (push) Has been cancelled
testing / test-remote-cacher (valkey) (push) Has been cancelled
testing / test-remote-cacher (garnet) (push) Has been cancelled
testing / test-remote-cacher (redict) (push) Has been cancelled
testing / test-mysql (push) Has been cancelled
testing / test-pgsql (push) Has been cancelled
testing / test-sqlite (push) Has been cancelled
testing / security-check (push) Has been cancelled
This changes the PR merge process such that annexed files contained in the to-be-merged commits are copied from the head repository to the base repository as part of the merge, similar to how it is done for LFS files.

Fixes #11.

## 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.
- [ ] 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-aneksajo/forgejo-aneksajo/pulls/62
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-21 21:31:48 +00:00
Matthias Riße
1298a315bd fix: improve git-annex UUID cache update times (#65)
Some checks are pending
/ build-oci-image (rootful) (push) Waiting to run
/ build-oci-image (rootless) (push) Waiting to run
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Globbing for the config files is marginally faster than walking the
directory and checking for config files. Replacing the expensive calls
to `git config` for each repository with reading the repository's config
as an ini file is two orders of magnitude faster.

All in all this reduces the required time initializing the cache for
approx. 3000 repositories from approx. 5s to 50ms.

The server startup now also logs how long the cache update took and the
cache update is only done if p2phttp support is not disabled, because
p2phttp support is currently the only feature that requires the UUID
cache.

Fixes #63, fixes #64.

## 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-aneksajo/forgejo-aneksajo/pulls/65
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-21 13:59:06 +00:00
Matthias Riße
c5b3812553 Use annexed content for comparison in diffs (#57)
Some checks failed
/ build-oci-image (rootful) (push) Has been cancelled
/ build-oci-image (rootless) (push) Has been cancelled
Integration tests for the release process / release-simulation (push) Has been cancelled
/ release (push) Has been cancelled
testing / backend-checks (push) Has been cancelled
testing / frontend-checks (push) Has been cancelled
testing / test-unit (push) Has been cancelled
testing / test-e2e (push) Has been cancelled
testing / test-remote-cacher (redis) (push) Has been cancelled
testing / test-remote-cacher (valkey) (push) Has been cancelled
testing / test-remote-cacher (garnet) (push) Has been cancelled
testing / test-remote-cacher (redict) (push) Has been cancelled
testing / test-mysql (push) Has been cancelled
testing / test-pgsql (push) Has been cancelled
testing / test-sqlite (push) Has been cancelled
testing / security-check (push) Has been cancelled
This makes it such that annexed files are treated like plain git files
in comparisons (e.g. the diff of a commit).

It also changes the image diff viewer to show a more reasonable error
message when one of the annexed files under comparison is missing.

Fixes #56.

Reviewed-on: https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo/pulls/57
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:15 +01:00
Matthias Riße
0ee62840ff Invalidate outdated annex UUID cache entries (#60)
The previous implementation could lead to errors e.g. when a repository
was removed and a new one with a new UUID was created under the same
name. This now checks the validity of the retrieved cache entry every
time and invalidates the cache if necessary.

Reviewed-on: https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo/pulls/60
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:15 +01:00
Matthias Riße
efe77599e6 Pre-populate the git-annex UUID cache at startup (#59)
This eliminates the wait time for the first p2phttp connection since
server startup at the cost of adding that time to the startup itself.

Reviewed-on: https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo/pulls/59
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:15 +01:00
Matthias Riße
22855c6238 Cache git-annex UUID to repository path mappings (#54)
Always walking the filesystem and searching for UUIDs slowed p2phttp
operations down significantly on a production server with more than a
handful of repositories. This caching strategy ensures that only the
first call is rather slow, and subsequent ones should be much faster.

This should better be implemented as a background job, but for now this
is a simple solution to the problem.

Fixes #53.

Reviewed-on: https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo/pulls/54
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:15 +01:00
Matthias Riße
aa683cb1e2 Explicitly set http(s) default ports in annex.url (#55)
Otherwise, git-annex tries to use its own default port (9417) and fails.

Fixes #52.

Reviewed-on: https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo/pulls/55
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:15 +01:00
Matthias Riße
99d2de8956 Fix Forgejo version in published OCI images (#51)
The Forgejo version is derived from the git history, so the image build
needs to happen in the context of a full repository clone.

Also, the post-processing of the version string needs to remove the
second occurrence of "-g", as the first one is now part of the added
"-git-annex" part.

Reviewed-on: https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo/pulls/51
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:15 +01:00
Matthias Riße
4b75d40853 Add an OCI image build and publish workflow (#50)
Fixes #49.

Reviewed-on: https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo/pulls/50
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:15 +01:00
Matthias Riße
aa6674de6e Simplify git blob to annex key lookup (#43)
Fixes #27.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/43
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:15 +01:00
Matthias Riße
971f6f7bab Add git-annex p2phttp support (#42)
This adds a new endpoint under `/git-annex-p2phttp` which acts as an
authenticating proxy to git-annex' p2phttp server. This makes it
possible to set `annex+<server-url>/git-annex-p2phttp` as
`remote.<name>.annexurl` and use git-annex fully over http(s) with the
normal credentials and access tokens provided by Forgejo.

Fixes #25.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/42
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Matthias Riße
1dd3a341a7 Add tests for git annex drop (#47)
This adds some rudimentary tests that drop files in a repository's clone
as well as from a repository on Forgejo.

Fixes #4.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/47
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Matthias Riße
592b23f5cd Add git-annex' testremote to the test suite (#48)
The `git annex testremote` command runs a built-in set of tests against
a remote. It cannot hurt to check our implementation of a git-annex
remote against it too.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/48
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Matthias Riße
4d65d593ad Only upload to annex in doAnnexUploadTest (#46)
The previous implementation both uploaded to the annex and pushed to the
git repository. This meant that the tests checking that uploads without
permission fail actually could pass when the git push failed but the
git-annex upload didn't. The tests didn't catch the situation where
unauthorized users could modify the annex.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/46
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Matthias Riße
3cf2111dbf Use PATH when looking for git commands (#44)
This fixes some issues when using a git-annex that is installed in a
different location than where git is installed, e.g. when using the
git-annex-standalone release or one installed with nix.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/44
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Matthias Riße
cdc80b9fe6 Allow anonymous HEAD requests to annex/objects (#41)
Git-annex emits HEAD requests for keys while trying to drop them from a
repository that was cloned via http. Forgejo asked for authentication
for these HEAD requests. This meant that cloning and getting files was
possible without authentication, but dropping was not.

Since the response to a HEAD request is a subset of the response to a
GET request it is safe to make those unauthenticated as well. That is
what this change does, although limited to the
:username/:reponame/annex/objects endpoint.

Fixes #40.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/41
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Michael Hanke
8065657151 Elevate external markup renderer interface for annexed file content (#36)
Previously, an external renderer that matched on an annexed file would
only see its content streamed via `STDIN`, or a temporary file with a copy
of its content would be generated and passed-by-filepath (with
`IS_INPUT_FILE=true`). Whether that happens, is also subject to
`MAX_DISPLAY_FILE_SIZE` (which defaults to 8MB).

This was problematic, because annexed files tend to be large. Moreover,
if present, they already exist as write-protected files on the
file-system. Creating a copy is both expensive and serves no particular
purpose.

This commit changes how external renderers are called.

1) With `IS_INPUT_FILE=true`, the renderer is passed the true location
   of an annex key, if present, and an empty path, if not.
2) The original, repository-relative path of the rendering target is
   made available to the renderer via the `GITEA_RELATIVE_PATH`
   environment variable.

To achieve a lean implementation, the `Blob` of the rendering target
is passed on to the `RenderContext` (because the implementation of
the annex-related functionality is centered on this dtype.

This change makes it less costly to increase `MAX_DISPLAY_FILE_SIZE`,
in order to make large, annexed files eligible for markup rendering,
because no content copies will be made any longer.

External renderers can now use the original file path, with the full
original filename, including extensions, for decision making. For
example, to detect particular compression formats based in a file name
extension, or to alter the rendering based on contextual information
encoded in the file path (e.g., a multi-file data structure with a
particular organization pattern).

Apart from the additional environment variable, there is no change to
the handling of renderers that take their input via `STDIN` (i.e.,
`IS_INPUT_FILE=false`).

Fixes #35.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/36
Reviewed-by: matrss <matrss@noreply.codeberg.org>
Co-authored-by: Michael Hanke <michael.hanke@gmail.com>
Co-committed-by: Michael Hanke <michael.hanke@gmail.com>
2025-02-08 16:52:14 +01:00
Matthias Riße
78ff09f63d Change the icon for annexed files to file-binary (#29)
Fixes #26.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/29
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Matthias Riße
4c60dfb6f0 Improve views for annexed but missing files (#28)
Previously, trying to view files that were annexed, but missing, just
led to an uninformative error 500. This was rather confusing.

With these changes it now shows the pointer target instead of the
(missing) content of the file, and also indicates this situation in the
"stored with git-annex" message. For semantic correctness views for
missing files return a 404 instead of a 200, as they would with the
content present.

Fixes #7, fixes #13.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/28
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Michael Hanke
5b2ae61a12 Add git-annex also to the rootless container (#24)
Same as 89f8aa0bf5, but for the rootless container.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/24
Reviewed-by: matrss <matrss@noreply.codeberg.org>
Co-authored-by: Michael Hanke <michael.hanke@gmail.com>
Co-committed-by: Michael Hanke <michael.hanke@gmail.com>
2025-02-08 16:52:14 +01:00
Matthias Riße
e83f575da5 Git-annex web uploads (#21)
This implements support for uploading files into the annex using the web
interface.

If a repository is a git-annex-enabled repository all files will be
added to it using git annex add. This means that the repository's
configuration for what to put into the annex (annex.largefiles in
gitattributes) will be respected.

Plain git repositories without git-annex will work as before, directly
uploading to git.

Fixes #5.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/21
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Matthias Riße
246131cc69 Error if git-annex is enabled but missing (#16)
Copied from https://github.com/neuropoly/gitea/pull/47

This adds a check so that if `setting.Annex.Enabled` is true and git-annex is not in the PATH Forgejo will abort on startup with a reasonable error message.

Fixes #15.

Reviewed-on: https://codeberg.org/matrss/forgejo-aneksajo/pulls/16
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
Co-committed-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:14 +01:00
Matthias Riße
e97e20427d Add git-annex to docker image 2025-02-08 16:52:14 +01:00
Matthias Riße
5ff7951560 Adapt patch to upstream changes
Test with different objectFormats.
2025-02-08 16:52:14 +01:00
Nick
56a9ea1fc3 git-annex: views for annex files
This updates the repo index/file view endpoints so annex files match the way
LFS files are rendered, making annexed files accessible via the web instead of
being black boxes only accessible by git clone.

This mostly just duplicates the existing LFS logic. It doesn't try to combine itself
with the existing logic, to make merging with upstream easier. If upstream ever
decides to accept, I would like to try to merge the redundant logic.

The one bit that doesn't directly copy LFS is my choice to hide annex-symlinks.
LFS files are always _pointer files_ and therefore always render with the "file"
icon and no special label, but annex files come in two flavours: symlinks or
pointer files. I've conflated both kinds to try to give a consistent experience.

The tests in here ensure the correct download link (/media, from the last PR)
renders in both the toolbar and, if a binary file (like most annexed files will be),
in the main pane, but it also adds quite a bit of code to make sure text files
that happen to be annexed are dug out and rendered inline like LFS files are.
2025-02-08 16:52:14 +01:00
Matthias Riße
82c9a86e83 Adapt patch to upstream changes
Use tests.FileCmp instead of util.FileCmp.
2025-02-08 16:52:14 +01:00
Matthias Riße
2845a75cbe Adapt patch to upstream changes
Test with different objectFormats.
2025-02-08 16:52:14 +01:00
Nick
2c0cb04776 git-annex: make /media/ download annexed content
Previously, Gitea's LFS support allowed direct-downloads of LFS content,
via http://$HOSTNAME:$PORT/$USER/$REPO/media/branch/$BRANCH/$FILE
Expand that grace to git-annex too. Now /media should provide the
relevant *content* from the .git/annex/objects/ folder.

This adds tests too. And expands the tests to try symlink-based annexing,
since /media implicitly supports both that and pointer-file-based annexing.
2025-02-08 16:52:14 +01:00
Matthias Riße
635770f8a4 Adapt patch to upstream changes
The git repository must be closed after using it. Without this change
some tests started to fail due to the lingering repository running into
a timeout.
2025-02-08 16:52:14 +01:00
Nick
0831aeccd1 git-annex: create modules/annex
This moves the `annexObjectPath()` helper out of the tests and into a
dedicated sub-package as `annex.ContentLocation()`, and expands it with
`.Pointer()` (which validates using `git annex examinekey`),
`.IsAnnexed()` and `.Content()` to make it a more useful module.

The tests retain their own wrapper version of `ContentLocation()`
because I tried to follow close to the API modules/lfs uses, which in
terms of abstract `git.Blob` and `git.TreeEntry` objects, not in terms
of `repoPath string`s which are more convenient for the tests.
2025-02-08 16:52:14 +01:00
Matthias Riße
0c81519d4e Adapt patch to upstream changes
The "context_service" import was changed to use the default name of just
"context". The patch set had to be adapted for that.
2025-02-08 16:52:14 +01:00
Matthias Riße
3c11eb1e26 Adapt patch to upstream changes
Usage of `path` was replaced by `path/filepath` in upstream forgejo, and
it made sense to use that as well where `path` was previously used. The
`setHeaderCacheForever` function and the `sendFile` method had their
signature changed.
2025-02-08 16:52:14 +01:00
Matthias Riße
24264cb45f Fix exit code check for git command
The err.IsExitCode method was changed to a function IsErrorExitCode
taking err as its first argument in
1e7a6483b8.
2025-02-08 16:52:14 +01:00
Matthias Riße
f0da2f268a Replace m.GetOptions with m.Methods
This applies the same changes that were done in
265cd70bdb to the git-annex specific
routes as well.
2025-02-08 16:52:13 +01:00
Nick
d8bf745749 git-annex: support downloading over HTTP
This makes HTTP symmetric with SSH clone URLs.

This gives us the fancy feature of _anonymous_ downloads,
so people can access datasets without having to set up an
account or manage ssh keys.

Previously, to access "open access" data shared this way,
users would need to:

  1. Create an account on gitea.example.com
  2. Create ssh keys
  3. Upload ssh keys (and make sure to find and upload the correct file)
  4. `git clone git@gitea.example.com:user/dataset.git`
  5. `cd dataset`
  6. `git annex get`

This cuts that down to just the last three steps:

  1. `git clone https://gitea.example.com/user/dataset.git`
  2. `cd dataset`
  3. `git annex get`

This is significantly simpler for downstream users, especially for those
unfamiliar with the command line.

Unfortunately there's no uploading. While git-annex supports uploading
over HTTP to S3 and some other special remotes, it seems to fail on a
_plain_ HTTP remote. See https://github.com/neuropoly/gitea/issues/7
and https://git-annex.branchable.com/forum/HTTP_uploads/#comment-ce28adc128fdefe4c4c49628174d9b92.

This is not a major loss since no one wants uploading to be anonymous anyway.

To support private repos, I had to hunt down and patch a secret extra security
corner that Gitea only applies to HTTP for some reason (services/auth/basic.go).

This was guided by https://git-annex.branchable.com/tips/setup_a_public_repository_on_a_web_site/

Fixes https://github.com/neuropoly/gitea/issues/3

Co-authored-by: Mathieu Guay-Paquet <mathieu.guaypaquet@polymtl.ca>
2025-02-08 16:52:13 +01:00
Nick
f42432a9e4 git-annex: add configuration setting [annex].ENABLED
Fixes https://github.com/neuropoly/gitea/issues/8

Co-authored-by: Mathieu Guay-Paquet <mathieu.guaypaquet@gmail.com>
2025-02-08 16:52:13 +01:00
Matthias Riße
cc193ec4ef Fix failing tests
Multiple tests that worked fine on v1.20.4-1 started to fail after the
rebase onto v1.20.5-1. These tests are:
- TestGitAnnexPermissions/Private/Owner/HTTP/Init
- TestGitAnnexPermissions/Private/Owner/HTTP/Download
- TestGitAnnexPermissions/Private/Writer/HTTP/Init
- TestGitAnnexPermissions/Private/Writer/HTTP/Download
- TestGitAnnexPermissions/Private/Reader/HTTP/Init
- TestGitAnnexPermissions/Private/Reader/HTTP/Download

What these tests have in common is that they all operate on a private
repository via http with authentication.

They broke at some point between v1.20.4-1 and v1.20.5-1, so I did a
bisect between these two points running the offending tests. This
brought me to the conclusion that
ee48c0d5ea introduced the issue.

The thing is, this commit does not change any code, it only changes the
test environment. Among other things that didn't look as suspicious, it
changes the container image from a bespoke test_env image based on
debian bullseye to a node image based on debian bookworm. Obviously,
this means that there are many version differences between the two.

The first one I looked at was git. The previous bullseye image used a
manually installed git version 2.40.0, while the bookworm image has
2.39.2 installed. Updating git in the new image did not fix the issue,
however.

The next thing I looked at was the git-annex version. Bullseye had
8.20210223 installed and worked, while bookworm used 10.20230126 when
the tests broke. So I tried my luck upgrading to a more recent version
via neurodebian (10.20240227-1~ndall+1). This still worked fine on
bullseye and now also works fine on bookworm.

I have no idea why this specific version of git-annex broke the tests,
but at least there was a commit to pinpoint this to, which isn't always
the case with docker images silently changing beneath you...

Below are the versions as they are reported by git and git-annex:

bullseye (works):

    git version 2.30.2
    git-annex version: 8.20210223
    build flags: Assistant Webapp Pairing Inotify DBus DesktopNotify TorrentParser MagicMime Feeds Testsuite S3 WebDAV
    dependency versions: aws-0.22 bloomfilter-2.0.1.0 cryptonite-0.26 DAV-1.3.4 feed-1.3.0.1 ghc-8.8.4 http-client-0.6.4.1 persistent-sqlite-2.10.6.2 torrent-10000.1.1 uuid-1.3.13 yesod-1.6.1.0
    key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 BLAKE2B256E BLAKE2B256 BLAKE2B512E BLAKE2B512 BLAKE2B160E BLAKE2B160 BLAKE2B224E BLAKE2B224 BLAKE2B384E BLAKE2B384 BLAKE2BP512E BLAKE2BP512 BLAKE2S256E BLAKE2S256 BLAKE2S160E BLAKE2S160 BLAKE2S224E BLAKE2S224 BLAKE2SP256E BLAKE2SP256 BLAKE2SP224E BLAKE2SP224 SHA1E SHA1 MD5E MD5 WORM URL X*
    remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav adb tahoe glacier ddar git-lfs httpalso borg hook external
    operating system: linux x86_64
    supported repository versions: 8
    upgrade supported from repository versions: 0 1 2 3 4 5 6 7

bullseye + git-annex from neurodebian (works):

    git version 2.30.2
    git-annex version: 10.20240227-1~ndall+1
    build flags: Assistant Webapp Pairing Inotify DBus DesktopNotify TorrentParser MagicMime Benchmark Feeds Testsuite S3 WebDAV
    dependency versions: aws-0.22.1 bloomfilter-2.0.1.0 cryptonite-0.29 DAV-1.3.4 feed-1.3.2.1 ghc-9.0.2 http-client-0.7.13.1 persistent-sqlite-2.13.1.0 torrent-10000.1.1 uuid-1.3.15 yesod-1.6.2.1
    key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 BLAKE2B256E BLAKE2B256 BLAKE2B512E BLAKE2B512 BLAKE2B160E BLAKE2B160 BLAKE2B224E BLAKE2B224 BLAKE2B384E BLAKE2B384 BLAKE2BP512E BLAKE2BP512 BLAKE2S256E BLAKE2S256 BLAKE2S160E BLAKE2S160 BLAKE2S224E BLAKE2S224 BLAKE2SP256E BLAKE2SP256 BLAKE2SP224E BLAKE2SP224 SHA1E SHA1 MD5E MD5 WORM URL X*
    remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav adb tahoe glacier ddar git-lfs httpalso borg hook external
    operating system: linux x86_64
    supported repository versions: 8 9 10
    upgrade supported from repository versions: 0 1 2 3 4 5 6 7 8 9 10

bookworm (fails):

    git version 2.39.2
    git-annex version: 10.20230126
    build flags: Assistant Webapp Pairing Inotify DBus DesktopNotify TorrentParser MagicMime Benchmark Feeds Testsuite S3 WebDAV
    dependency versions: aws-0.22.1 bloomfilter-2.0.1.0 cryptonite-0.29 DAV-1.3.4 feed-1.3.2.1 ghc-9.0.2 http-client-0.7.13.1 persistent-sqlite-2.13.1.0 torrent-10000.1.1 uuid-1.3.15 yesod-1.6.2.1
    key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 BLAKE2B256E BLAKE2B256 BLAKE2B512E BLAKE2B512 BLAKE2B160E BLAKE2B160 BLAKE2B224E BLAKE2B224 BLAKE2B384E BLAKE2B384 BLAKE2BP512E BLAKE2BP512 BLAKE2S256E BLAKE2S256 BLAKE2S160E BLAKE2S160 BLAKE2S224E BLAKE2S224 BLAKE2SP256E BLAKE2SP256 BLAKE2SP224E BLAKE2SP224 SHA1E SHA1 MD5E MD5 WORM URL X*
    remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav adb tahoe glacier ddar git-lfs httpalso borg hook external
    operating system: linux x86_64
    supported repository versions: 8 9 10
    upgrade supported from repository versions: 0 1 2 3 4 5 6 7 8 9 10

bookworm + git-annex from neurodebian (works):

    git version 2.39.2
    git-annex version: 10.20240227-1~ndall+1
    build flags: Assistant Webapp Pairing Inotify DBus DesktopNotify TorrentParser MagicMime Benchmark Feeds Testsuite S3 WebDAV
    dependency versions: aws-0.22.1 bloomfilter-2.0.1.0 cryptonite-0.29 DAV-1.3.4 feed-1.3.2.1 ghc-9.0.2 http-client-0.7.13.1 persistent-sqlite-2.13.1.0 torrent-10000.1.1 uuid-1.3.15 yesod-1.6.2.1
    key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 BLAKE2B256E BLAKE2B256 BLAKE2B512E BLAKE2B512 BLAKE2B160E BLAKE2B160 BLAKE2B224E BLAKE2B224 BLAKE2B384E BLAKE2B384 BLAKE2BP512E BLAKE2BP512 BLAKE2S256E BLAKE2S256 BLAKE2S160E BLAKE2S160 BLAKE2S224E BLAKE2S224 BLAKE2SP256E BLAKE2SP256 BLAKE2SP224E BLAKE2SP224 SHA1E SHA1 MD5E MD5 WORM URL X*
    remote types: git gcrypt p2p S3 bup directory rsync web bittorrent webdav adb tahoe glacier ddar git-lfs httpalso borg hook external
    operating system: linux x86_64
    supported repository versions: 8 9 10
    upgrade supported from repository versions: 0 1 2 3 4 5 6 7 8 9 10
2025-02-08 16:52:13 +01:00
Matthias Riße
3d7458b8cc Install git-annex in the testing workflow 2025-02-08 16:52:13 +01:00
Matthias Riße
37a8fa9b5c Adapt patch to upstream changes 2025-02-08 16:52:13 +01:00
Matthias Riße
d13faeccaa Adapt patch to upstream changes
A dead code check started to complain because FileCmp was only used in
tests. Moved the function to test_utils.
2025-02-08 16:52:13 +01:00
Matthias Riße
57de00e5b9 Adapt patch to upstream changes
Repository creation now expects an objectFormat to be specified for git.
2025-02-08 16:52:13 +01:00
Nick
52485edf64 git-annex tests
Fixes https://github.com/neuropoly/gitea/issues/11

Tests:

* `git annex init`
* `git annex copy --from origin`
* `git annex copy --to origin`

over:

* ssh

for:

* the owner
* a collaborator
* a read-only collaborator
* a stranger

in a

* public repo
* private repo

And then confirms:

* Deletion of the remote repo (to ensure lockdown isn't messing with us: https://git-annex.branchable.com/internals/lockdown/#comment-0cc5225dc5abe8eddeb843bfd2fdc382)

------

To support all this:

* Add util.FileCmp()
* Patch withKeyFile() so it can be nested in other copies of itself

-------

Many thanks to Mathieu for giving style tips and catching several bugs,
including a subtle one in util.filecmp() which neutered it.

Co-authored-by: Mathieu Guay-Paquet <mathieu.guay-paquet@polymtl.ca>
Co-authored-by: Matthias Riße <m.risse@fz-juelich.de>
2025-02-08 16:52:13 +01:00
Nick Guenther
1d01b58227 git-annex support
[git-annex](https://git-annex.branchable.com/) is a more complicated cousin to
git-lfs, storing large files in an optional-download side content.  Unlike lfs,
it allows mixing and matching storage remotes, so the content remote(s) doesn't
need to be on the same server as the git remote, making it feasible to scatter
a collection across cloud storage, old harddrives, or anywhere else storage can
be scavenged.  Since this can get complicated, fast, it has a content-tracking
database (`git annex whereis`) to help find everything later.

The use-case we imagine for including it in Gitea is just the simple case, where
we're primarily emulating git-lfs: each repo has its large content at the same URL.

Our motivation is so we can self-host https://www.datalad.org/ datasets, which
currently are only hostable by fragilely scrounging together cloud storage --
and having to manage all the credentials associated with all the pieces -- or at
https://openneuro.org which is fragile in its own ways.

Supporting git-annex also allows multiple Gitea instance to be annex remotes for
each other, mirroring the content or otherwise collaborating the split up the
hosting costs.

Enabling
--------

TODO

HTTP
----

TODO

Permission Checking
-------------------

This tweaks the API in routers/private/serv.go to expose the calling user's
computed permission, instead of just returning HTTP 403.

This doesn't fit in super well. It's the opposite from how the git-lfs support is
done, where there's a complete list of possible subcommands and their matching
permission levels, and then the API compares the requested with the actual level
and returns HTTP 403 if the check fails.

But it's necessary. The main git-annex verbs, 'git-annex-shell configlist' and
'git-annex-shell p2pstdio' are both either read-only or read-write operations,
depending on the state on disk on either end of the connection and what the user
asked it to ask for, with no way to know before git-annex examines the situation.
So tell the level via GIT_ANNEX_READONLY and trust it to handle itself.

In the older Gogs version, the permission was directly read in cmd/serv.go:

```
mode, err = db.UserAccessMode(user.ID, repo)
```
- 966e925cf3/internal/cmd/serv.go (L334)

but in Gitea permission enforcement has been centralized in the API layer.
(perhaps so the cmd layer can avoid making direct DB connections?)

Deletion
--------

git-annex has this "lockdown" feature where it tries
really quite very hard to prevent you deleting its
data, to the point that even an rm -rf won't do it:
each file in annex/objects/ is nested inside a
folder with read-only permissions.

The recommended workaround is to run chmod -R +w when
you're sure you actually want to delete a repo. See
https://git-annex.branchable.com/internals/lockdown

So we edit util.RemoveAll() to do just that, so now
it's `chmod -R +w && rm -rf` instead of just `rm -rf`.
2025-02-08 16:52:13 +01:00
Matthias Riße
2771c2e591 Fix name in package-lock.json
The frontend-checks job started failing because the declared name does
not match the repository name.
2025-02-08 16:52:13 +01:00
Matthias Riße
3c7f598230 Run testing workflow unconditionally 2025-02-08 16:52:13 +01:00
Earl Warren
6ef900899e fix(sec): Forgejo Actions web routes (#6839)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6839
2025-02-08 06:21:18 +00:00
Earl Warren
a9f0bb9f68 fix(sec): permission check for project issue (#6838)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6838
2025-02-08 06:20:29 +00:00
Gusted
3b4f1b3469
fix(sec): add tests for private issues on projects
- Add integration and unit tests to ensure that private issues on
projects are not shown in any way, shape or form when the doer has no
access to it.

(cherry picked from commit 55dcc1d06cb12ddb750a0289fbb6e212f93957a8)
2025-02-08 06:06:06 +00:00
Gusted
77fc232e5b
fix(sec): permission check for project issue
- Do an access check when loading issues for a project column, currently
this is not done and exposes the title, labels and existence of a
private issue that the viewer of the project board may not have access
to.
- The number of issues cannot be calculated in a efficient manner
and stored in the database because their number may vary depending on
the visibility of the repositories participating in the project. The
previous implementation used the pre-calculated numbers stored in each
project, which did not reflect that potential variation.
- The code is derived from https://github.com/go-gitea/gitea/pull/22865

(cherry picked from commit 2193afaeb9954a5778f5a47aafd0e6fbbf48d000)
2025-02-08 06:06:03 +00:00
Gusted
5a7d70658d
fix(sec): web route test edit and delete variable
Exhaustively test each combination of deleting and updating a action
action variable via the web route.
2025-02-08 06:04:14 +00:00
Gusted
5046a10aec
fix(sec): add tests for web route delete runner
Exhaustively test each combination of deleting and updating a action
runner via the web route. Although updating an action runner was not
impacted, its good to have a test nonetheless.
2025-02-08 06:04:14 +00:00
Gusted
77db7655e0
fix(sec): web route update and delete runner variables
The web route to update and delete variables of runners did not check if
the ID that was given belonged to the context it was requested in, this
made it possible to update and delete every existing runner variable of
a instance for any authenticated user.

The code has been reworked to always take into account the context of
the request (owner and repository ID).
2025-02-08 06:04:14 +00:00
Gusted
c324910c31
fix(sec): web route delete runner
The web route to delete action runners did not check if the ID that was
given belonged to the context it was requested in, this made it possible
to delete every existing runner of a instance by a authenticated user.

The code was reworked to ensure that the caller of the delete
runner function retrieved the runner by ID and then checks if it belongs
to the context it was requested in, although this is not an optimal
solution it is consistent with the context checking of other code for
runners.
2025-02-08 06:04:14 +00:00
0ko
57ad0b868d [v10.0/forgejo] i18n: update of translations from Codeberg Translate (#6834)
Backport: https://codeberg.org/forgejo/forgejo/pulls/6745

Feel free to leave merge to me. My strategy is to use squash-merge, but copy the description of the actual commit into squash description, so attribution is preserved.

https://codeberg.org/forgejo/forgejo/pulls/6745 was quite large, so I decided it will be ok to backport just one PR before a new release.

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Localization
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/6834): <!--number 6834 --><!--line 0 --><!--description aTE4bjogdXBkYXRlIG9mIHRyYW5zbGF0aW9ucyBmcm9tIENvZGViZXJnIFRyYW5zbGF0ZQ==-->i18n: update of translations from Codeberg Translate<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6834
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-02-08 00:01:24 +00:00
forgejo-backport-action
34d2a8531c [v10.0/forgejo] fix(ui): display verified icon for default gpg key (#6833)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6803

## Description
Thank you for this amazing project!

I recently noticed that the icon next to the GPG key reference appears to be incorrect for commits signed by the default GPG key:

| Default GPG Key  | User GPG Key  |
|---------|---------|
| ![image](/attachments/ff27597a-d38c-48fc-8284-e16d4fd3ea2d) | ![image](/attachments/3c8c5540-dd29-45c9-a9f0-dc3b69677ef3) |

Looking into the commit history of the template file, I noticed that Forgejo-signed commits originally had a distinct icon:
[gitea-unlock-cog](b918609acc) --> [octicon-shield-lock](12ddc48c5c) --> octicon-unverified (current)

Since `octicon-unverified` is also used when a commit cannot be verified (.Verification.Warning), I find it misleading for successfully signed commits. This PR changes the icon to the verified variant for better clarity.

### Tests

1. Set up automatic commit signing by Forgejo ([guide](https://forgejo.org/docs/latest/admin/signing/#automatic-signing))
2. Trigger automatic commit signing in any of the following scenarios:
    - Repository Initialisation (should be the easiest)
    - Wiki Changes
    - CRUD actions using the editor or the API
    - Merges from Pull Requests
3. Open the commit signed by Forgejo
4. Verify that the icon next to the GPG key id is `octicon-verified`:
![image](/attachments/7b4eb81c-d33c-4daf-84dd-9f99ebb0b99d)

### Documentation

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

### Release notes

- [x] I want the title to show in the release notes with a link to this pull request.

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- User Interface bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/6803): <!--number 6803 --><!--line 0 --><!--description Zml4KHVpKTogZGlzcGxheSB2ZXJpZmllZCBpY29uIGZvciBkZWZhdWx0IGdwZyBrZXk=-->fix(ui): display verified icon for default gpg key<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: shgew <shgew@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6833
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-02-07 13:16:23 +00:00
forgejo-backport-action
d260013a51 [v10.0/forgejo] fix: avoid y-axis clipping for branch name (#6832)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6817

- `gt-ellipsis` is set on elements to avoid overflowing its text contents and in the case of overflowing it would show an ellipsis. To force it to not overflow `overflow: hidden` is set, however this also hides the overflow on the y-axis, `overflow-x: hidden` has the same behavior.
- To avoid avoid the branch name from being clipped, add a very small amount of padding on the y-axis. This is a workaround and not a proper solution. There does not seem a good cross-platform solution available to fix this in a proper way.
- Resolves forgejo/forgejo#6811

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6832
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-02-07 10:46:08 +00:00
forgejo-backport-action
3168330425 [v10.0/forgejo] chore(i18n): lint errors (#6809)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6808

settings.hidden_comment_types_description: Rodzaje komentarzy zaznaczone tutaj nie będą wyświetlały się na stronach zgłoszeń. Zaznaczenie "Etykieta" na przykład usunie wszystkie komentarze "<użytkownik> dodał/usunął <etykieta>".
repo.settings.add_web_hook_desc: Zintegruj <a target="_black" rel="noreferrer" href="https://TO-BE-REPLACED.COM">%s</a> ze swoim repozytorium.

Add user & label in Polish.

Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6809
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-02-06 12:37:53 +00:00
forgejo-backport-action
2491bbfa69 [v10.0/forgejo] ci: fix go version check (#6810)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6646

Allow ci go version to be higher than the tool chain. This will fix the current build issues on forgejo branch

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6810
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-02-06 08:15:36 +00:00
forgejo-backport-action
ac01c7a384 [v10.0/forgejo] fix: make author search case insenstive (#6783)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6782

- Make the author search in the issues and pull request list case
insenstive.
- Background: Forgejo mandates that all columns are case senstive and
only SQLite ignores this for ASCII characters with the `LIKE` operator
any other database will indeed do case senstive searching. Codeberg
recently made all columns case senstive, hence why this issue now surfaces.
- Added integration test.
- Resolves forgejo/forgejo#6744

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6783
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-02-04 17:06:20 +00:00
forgejo-backport-action
b615d41457 [v10.0/forgejo] fix(ui): add triangle down octicon to code search options dropdown (#6770)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6620

This adds the triangle down oction to the code search options dropdown to match the other search option dropdowns (issue, pull).

Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6770
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-02-03 08:35:41 +00:00
0ko
184bdef340 [v10.0/forgejo] i18n: backport of translation updates 6565 and 6665 (#6764)
Translation updates that are applicable to v10 strings were picked from these commits:
* dac7d5e73b
* 7678386138

Changes to strings that are only present in the v11 branch were not picked.

Below is a list of co-authors of the ported commits. It may contain co-authors who's changes were not picked due to being v11-only.

Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: artnay <artnay@users.noreply.translate.codeberg.org>
Co-authored-by: Atul_Eterno <atul_eterno@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <dirk@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Fjuro <fjuro@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Ikuyo Mita <searinminecraft@outlook.ph>
Co-authored-by: jedik <jedik@users.noreply.translate.codeberg.org>
Co-authored-by: Juno Takano <jutty@users.noreply.translate.codeberg.org>
Co-authored-by: justbispo <justbispo@users.noreply.translate.codeberg.org>
Co-authored-by: killawabbit <killawabbit@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: mahlzahn <mahlzahn@posteo.de>
Co-authored-by: Miguel P.L <miguel_pl@users.noreply.translate.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@users.noreply.translate.codeberg.org>
Co-authored-by: Ricky-Tigg <ricky-tigg@users.noreply.translate.codeberg.org>
Co-authored-by: SomeTr <sometr@users.noreply.translate.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: xtex <xtexchooser@duck.com>

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6764
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-02-02 18:38:07 +00:00
forgejo-backport-action
27276ff26e [v10.0/forgejo] fix: set explore pages to configurable default sort (#6749)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6708

- Currently, the explore/organizations page always defaults to using "newest" as its sort. Instead, use the pre-existing config option (`setting.UI.ExploreDefaultSort`) so server administrators can change the default sort order.

## 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

(Sorry, not sure how to add a test for this change)

- 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 don't mind either way.

- [ ] 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.

Co-authored-by: John Moon <john.moon@vts-i.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6749
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-31 11:12:01 +00:00
forgejo-backport-action
1b00bf2d26 [v10.0/forgejo] fix: Remove autofocus on the dashboard repository search box (#6748)
- No longer autofocus on the searchbox for the repository list that is on the dashboard. There is no justification for doing so.
- Fixes #6653
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-31 10:40:23 +00:00
forgejo-backport-action
69bc17ea35 [v10.0/forgejo] fix inline file preview for files with encoded URL, fix #5069 (#6739)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6525

### Screenshot
#### Before
See #5069.
#### After
![image](/attachments/d57c2ff8-d29e-41b8-9280-c884ac43f12e)
### 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)).
- Manual testing: see https://codeberg.org/forgejo/forgejo/pulls/6525#issuecomment-2578814. Thanks @earl-warren.

### 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: Robert Wolff <mahlzahn@posteo.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6739
Reviewed-by: Robert Wolff <mahlzahn@posteo.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-30 11:49:16 +00:00
forgejo-backport-action
0db9a24a4b [v10.0/forgejo] fix: check for webauthn in 2fa user search (#6730)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6726

- Check for webauthn credentials in the user search when the two factor
filter is enabled.
- Resolves forgejo/forgejo#6524

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6730
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-29 19:28:12 +00:00
forgejo-backport-action
4016f2890d [v10.0/forgejo] fix: disallow blame on directories (#6720)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6716

- Don't allow the blame operation on directories.
- Added integration test.
- Resolves forgejo/forgejo#6533

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6720
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-29 09:34:03 +00:00
forgejo-backport-action
c198cb6e65 [v10.0/forgejo] fix(i18n): add forgotten translatable string (#6718)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6701

- Regression of 75ce1e2ac1

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6718
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-29 08:28:25 +00:00
forgejo-backport-action
114d8975b5 [v10.0/forgejo] fix: render issue titles consistently (#6717)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6715

- Render the issue titles in dashboard feed in consistent manner, by using the existing `RenderIssueTitle`.
- Added integration tests (not exhaustive for all comment types, but exhaustive enough for the current code where some comment types are grouped together).
- Resolves forgejo/forgejo#6705

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6717
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-29 08:24:37 +00:00
Michael Kriese
7ee19b4c6c chore: consistent docker image and action references (#6704)
backport of #6703
- replace `code.forgejo.org` ->`data.forgejo.org` on docker images
- add `https://data.forgejo.org/` to actions where missing

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6704
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-01-28 15:46:07 +00:00
Renovate Bot
faa263d54a Update dependency katex to v0.16.21 [SECURITY] (v10.0/forgejo) (#6694)
This PR contains the following updates:

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

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### KaTeX \htmlData does not validate attribute names
[CVE-2025-23207](https://nvd.nist.gov/vuln/detail/CVE-2025-23207) / [GHSA-cg87-wmx4-v546](https://github.com/advisories/GHSA-cg87-wmx4-v546)

<details>
<summary>More information</summary>

#### Details
##### Impact
KaTeX users who render untrusted mathematical expressions with `renderToString` could encounter malicious input using `\htmlData` that runs arbitrary JavaScript, or generate invalid HTML.

##### Patches
Upgrade to KaTeX v0.16.21 to remove this vulnerability.

##### Workarounds
- Avoid use of or turn off the `trust` option, or set it to forbid `\htmlData` commands.
- Forbid inputs containing the substring `"\\htmlData"`.
- Sanitize HTML output from KaTeX.

##### Details
`\htmlData` did not validate its attribute name argument, allowing it to generate invalid or malicious HTML that runs scripts.

##### For more information
If you have any questions or comments about this advisory:

- Open an issue or security advisory in the [KaTeX repository](https://github.com/KaTeX/KaTeX/)
- Email us at [katex-security@mit.edu](mailto:katex-security@mit.edu)

#### Severity
- CVSS Score: 6.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L`

#### References
- [https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cg87-wmx4-v546](https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cg87-wmx4-v546)
- [https://nvd.nist.gov/vuln/detail/CVE-2025-23207](https://nvd.nist.gov/vuln/detail/CVE-2025-23207)
- [ff289955e8)
- [https://github.com/KaTeX/KaTeX](https://github.com/KaTeX/KaTeX)

This data is provided by [OSV](https://osv.dev/vulnerability/GHSA-cg87-wmx4-v546) and the [GitHub Advisory Database](https://github.com/github/advisory-database) ([CC-BY 4.0](https://github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Release Notes

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

### [`v0.16.21`](https://github.com/KaTeX/KaTeX/blob/HEAD/CHANGELOG.md#01621-2025-01-17)

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

##### Bug Fixes

-   escape \htmlData attribute name ([57914ad](57914ad91e))

### [`v0.16.20`](https://github.com/KaTeX/KaTeX/blob/HEAD/CHANGELOG.md#01620-2025-01-12)

[Compare Source](https://github.com/KaTeX/KaTeX/compare/v0.16.19...v0.16.20)

##### Bug Fixes

-   \providecommand does not overwrite existing macro ([#&#8203;4000](https://github.com/KaTeX/KaTeX/issues/4000)) ([6d30fe4](6d30fe47b0)), closes [#&#8203;3928](https://github.com/KaTeX/KaTeX/issues/3928)

### [`v0.16.19`](https://github.com/KaTeX/KaTeX/blob/HEAD/CHANGELOG.md#01619-2024-12-29)

[Compare Source](https://github.com/KaTeX/KaTeX/compare/v0.16.18...v0.16.19)

##### Bug Fixes

-   **types:** improve `strict` function type ([#&#8203;4009](https://github.com/KaTeX/KaTeX/issues/4009)) ([4228b4e](4228b4eb52))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "" (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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMzYuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEzNi4xIiwidGFyZ2V0QnJhbmNoIjoidjEwLjAvZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6694
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-01-28 11:34:32 +00:00
forgejo-backport-action
0ecf28f37f [v10.0/forgejo] Fix inline file preview for rendered files (#6685)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6572

### What?

This fixes the inline file preview for rendered files (e.g., markdown). [Here, a live issue in v11](https://v11.next.forgejo.org/mahlzahn/test-inline-file-preview/issues/1) and [the same in v7 (with even more bugs)](https://v7.next.forgejo.org/mahlzahn/test-inline-file-preview/issues/1).

It fixes
1. the inline preview for possibly rendered files, when the link is specified with `?display=source`. This happens, e.g., if you are watching a (e.g., markdown) file in source and then want to link some of its lines.
2. the link to the source file inside the inline preview for possible rendered files (currently it links to the rendered version and then the `#L…` cannot point to the correct lines). This is done by always adding `?display=source` to the link.

### Screenshots
<details><summary>

#### Before

</summary>

![image](/attachments/898f82d5-d116-465a-89e2-ed83da189762)

</details>
<details><summary>

#### After

</summary>

![image](/attachments/41058620-47f3-4f6a-b427-66ef33c1a07f)

</details>

### 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)).

I think that this minor edit does not need special tests. Some backend tests have been updated to reflect the addition of URL parameters.

#### Manual testing
- create a repository with a file that can be rendered with couple of lines inside, e.g., a markdown README.md
- go to the source of this file (e.g., `…/src/branch/main/README.md`)
- click on the `<> View Source` button (or add `?display=source` to the URL)
- click on one of the lines, then on the three dots, then on ”Reference in a new issue“
- continue creating the issue

### 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: Robert Wolff <mahlzahn@posteo.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6685
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-25 11:38:02 +00:00
forgejo-backport-action
d10034f4d8 [v10.0/forgejo] fix: add non allowed domain translation (#6684)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6677

- Was added in 2559c80bec and accidentally removed in 5a16c9d9c0.
- Reworded for clarity.
- Resolves #6661

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6684
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-25 01:15:27 +00:00
forgejo-backport-action
553fc3cc42 [v10.0/forgejo] fix: load settings for valid user and email check (#6678)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6674

- The doctor commands to check the validity of existing usernames and
email addresses depend on functionality that have configurable behavior
depending on the values of the `[service]` settings, so load them when
running the doctor command.
- Resolves #6664
- No unit test due to the architecture of doctor commands.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6678
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-24 12:25:00 +00:00
Earl Warren
6d7bf7369d [v10.0/forgejo] chore(security): update security.txt with new expiration date (#6668)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6668
2025-01-23 17:28:46 +00:00
Earl Warren
eb83b05430 chore(security): update security.txt with new expiration date
Same as https://forgejo.org/.well-known/security.txt

(cherry picked from commit 955f99b6a4)
2025-01-23 16:20:44 +00:00
forgejo-backport-action
61e345cd36 [v10.0/forgejo] fix: teach the doctor about orphaned two_factor rows (#6651)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6639

If a row in the two_factor table references a non existent user, it may contain a secret that has an invalid format. Such an orphaned row is never used and should be removed.

Improve the error message to suggest using the doctor to remove it.

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

## Testing

- make TAGS='sqlite sqlite_unlock_notify' watch
- make TAGS='sqlite  sqlite_unlock_notify' forgejo
- sqlite3 data/gitea.db 'INSERT INTO two_factor VALUES( 0, 500, "", "", "", "", 0, 0)'
- ./forgejo doctor check --run check-db-consistency
  ```
   [1] Check consistency of database
    - [W] Found 1 Orphaned TwoFactor without existing User
   OK

   All done (checks: 1).
   ```
-  ./forgejo doctor check --run check-db-consistency --fix
   ```
   [1] Check consistency of database
    - [I] Deleted 1 Orphaned TwoFactor without existing User
   OK

   All done (checks: 1).
   ```

## 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.

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/6651): <!--number 6651 --><!--line 0 --><!--description Zml4OiB0ZWFjaCB0aGUgZG9jdG9yIGFib3V0IG9ycGhhbmVkIHR3b19mYWN0b3Igcm93cw==-->fix: teach the doctor about orphaned two_factor rows<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6651
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-22 07:47:34 +00:00
forgejo-backport-action
5c5e1c87ba [v10.0/forgejo] fix: listing tokens must not require basic auth (#6643)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6633

When the change is reverted, the test fails as follows:

```sh
=== TestAPIGetTokens (tests/integration/api_token_test.go:34)
--- FAIL: TestAPIGetTokens (0.17s)
    testlogger.go:405: 2025/01/20 14:05:22 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /home/earl-warren/software/forgejo/tests/gitea-lfs-meta
    testlogger.go:405: 2025/01/20 14:05:22 ...eb/routing/logger.go:102:func1() [I] router: completed GET /api/v1/users/user2/tokens for test-mock:12345, 200 OK in 2.5ms @ user/app.go:24(user.ListAccessTokens)
    testlogger.go:405: 2025/01/20 14:05:22 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/v1/users/user1/tokens for test-mock:12345, 201 Created in 4.7ms @ user/app.go:75(user.CreateAccessToken)
    testlogger.go:405: 2025/01/20 14:05:22 ...eb/routing/logger.go:102:func1() [I] router: completed GET /api/v1/users/user2/tokens for test-mock:12345, 401 Unauthorized in 4.9ms @ v1/api.go:413(v1.Routes.func2.5.1.reqBasicOrRevProxyAuth.6)
    api_token_test.go:46:
        	Error Trace:	/home/earl-warren/software/forgejo/tests/integration/integration_test.go:556
        	            				/home/earl-warren/software/forgejo/tests/integration/api_token_test.go:46
        	Error:      	Not equal:
        	            	expected: 200
        	            	actual  : 401
        	Test:       	TestAPIGetTokens
        	Messages:   	Request: GET /api/v1/users/user2/tokens
    api_token_test.go:46: Response:  {"message":"auth required","url":"http://localhost:3003/api/swagger"}

    testlogger.go:405: 2025/01/20 14:05:22 ...eb/routing/logger.go:102:func1() [I] router: completed DELETE /api/v1/users/user1/tokens/94 for test-mock:12345, 204 No Content in 1.4ms @ user/app.go:145(user.DeleteAccessToken)
```

## 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

- [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.

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/6633): <!--number 6633 --><!--line 0 --><!--description bGlzdGluZyB0b2tlbnMgbXVzdCBub3QgcmVxdWlyZSBiYXNpYyBhdXRo-->listing tokens must not require basic auth<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6643
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-21 10:40:00 +00:00
Renovate Bot
7546c4acf3 Update dependency go to v1.23.5 (v10.0/forgejo) (#6644)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [go](https://go.dev/) ([source](https://github.com/golang/go)) | toolchain | patch | `1.23.4` -> `1.23.5` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), 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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDYuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNi4wIiwidGFyZ2V0QnJhbmNoIjoidjEwLjAvZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6644
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-01-21 09:32:40 +00:00
Otto
25e81d05f0 [v10.0/forgejo] Fix mention and emoji expansion & Improve leaving list completion (#6632)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6632
Reviewed-by: Beowulf <beowulf@beocode.eu>
2025-01-20 20:34:31 +00:00
forgejo-backport-action
054537989f [v10.0/forgejo] fix(ui): prevent overflow of branch selector in commit graph (#6636)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6617

Fix that the branch selector in the commit graph can overflow

| Previous | Now |
| :----: | :----: |
| ![grafik](/attachments/ab303490-2abc-46d8-8715-0750886fd111) | ![grafik](/attachments/63f919a9-bcc2-4969-8c8c-d265c1917e07) |
| ![grafik](/attachments/c0e6636f-52eb-4bf0-bf07-0139ec407e33) | ![grafik](/attachments/752aef87-9250-4bf6-b74a-5a1813394dbe) |
| ![grafik](/attachments/e61842dd-29c1-4517-86db-f068de9ff6e8) | ![grafik](/attachments/bf251b43-80fa-4e1a-9fbe-fd27e5f8d195) |

Fixes #6615

Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6636
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-20 20:28:39 +00:00
Beowulf
348e0e1fac Leave list/quote expanison with double enter
When editing a list or similar syntax elements, pressing enter starts a
new line with the line introducer (e.g. `- ` for a plain list).
But currently it's uncomfortable when someone wants to leave the list.
Pressing enter again simply adds more and more lines with the prefix.

With this change the list is terminated if enter is pressed on a line
which contains the introducer but nothing else. This behavior is known
from other markdown editors like the on used by GitLab or GitHub.

Additionally I changed the regex for detecting a prefix.
- Why: With the change you can add a single whitespace at the end if you
  want to keep an "empty" line. So if you want to write:
  ```
  - First
  -
  - Third
  ```
  You just need to add a whitespace in the second line to prevent that
  the prefix will be removed.
- Changes in detail:
  - ordered bullet list prefix detection:
    nothing changed
  - todo list and unordered list prefix detection:
    have been split up:
    - todo list: Changed that only 1 to 4 whitespaces can be between the
      list char (`-`,`*`,`+`) and the checkbox (`[ ]`,`[x]`) - Why? If
      more then 4 spaces are between the list char and the checkbox,
      this is no longer detected as a prefix for a todo item based on
      the markdown standard. Due to the amount of spaces it is instead
      parsed as code.
    - unordered list: The prefix now needs to have exactly one space
      after the list char (`-`,`*`,`+`). More spaces will not be taken
      into account for detecting the prefix.
  - quote prefix detection:
    nothing changed

The current e2e-tests where simplified and duplicated tests where
removed. Test cases for the new functionality where added.

(cherry picked from commit 7ea62c5ce4)
2025-01-20 12:52:20 +00:00
Beowulf
627634a76e Prevent prefix continuation if currently a text expander popup is open
This fixes that mentions and emoji autocompletion was broken in e.g. a
list, because the list handling take presidency over the text expansion.

(cherry picked from commit 276ef10dd5)
2025-01-20 12:52:20 +00:00
forgejo-backport-action
28db11f2e7 [v10.0/forgejo] fix(ui): hide git note add button for commit if commit already has a note (#6614)
Backport: https://codeberg.org/forgejo/forgejo/pulls/6613

Regression from f5c0570533

Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6614
Reviewed-by: Beowulf <beowulf@beocode.eu>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-18 19:43:08 +00:00
forgejo-backport-action
6d0bf55f05 [v10.0/forgejo] fix: Reset content of comment edit field on cancel (#6601)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6595

Currently, the content of the text field is not reset when you cancel editing. This change resets the content of the text field when editing is canceled.

If this is not done and you click on cancel and then on edit again, you can no longer return to the initial content without completely reloading the page.

Co-authored-by: Beowulf <beowulf@beocode.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6601
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-17 20:48:35 +00:00
forgejo-backport-action
2d1e163913 [v10.0/forgejo] fix: reduce noise for the v303 migration (#6594)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6591

Using SELECT `%s` FROM `%s` WHERE 0 = 1 to assert the existence of a column is simple but noisy: it shows errors in the migrations that are confusing for Forgejo admins because they are not actual errors.

Use introspection instead, which is more complicated but leads to the same result.

Add a test that ensures it works as expected, for all database types. Although the migration is run for all database types, it does not account for various scenarios and is never tested in the case a column does not exist.

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

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6594
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-17 08:15:16 +00:00
forgejo-backport-action
26b7c6b86a [v10.0/forgejo] tests(e2e): Various fixes to visual testing (#6587)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6569

Co-authored-by: Otto Richter <git@otto.splvs.net>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6587
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-17 01:07:22 +00:00
forgejo-backport-action
05056b8aa2 [v10.0/forgejo] Refactor e2e tests to simplify authentication setup (#6585)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6400

Replaced manual login and context loading across tests with Playwright's `test.use` configuration for user authentication. This simplifies test setup, improves readability, and reduces repetition.

#6362 first part

## 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

- [x] 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

- [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.

Co-authored-by: Julian Schlarb <julian.schlarb@denktmit.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6585
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-16 13:37:06 +00:00
forgejo-backport-action
39843ee2b3 [v10.0/forgejo] fix: avoid Gitea migration warnings (take 2) (#6578)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6577

274bc480b4 introduced a regression in https://codeberg.org/forgejo/forgejo/pulls/6343

Trying to remove fields that have already been removed by

dd1523c72e/models/forgejo_migrations/v14.go

Is a noop for SQLite and went undetected by the upgrade tests.

Fixes: https://codeberg.org/forgejo/forgejo/issues/6575
Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6578
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-15 22:48:56 +00:00
Earl Warren
3b7ed0cda2 [v10.0/forgejo] chore(ci): upgrade forgejo-build-publish/build@v5.3.1 (#6574)
**Backport**: https://codeberg.org/forgejo/forgejo/pulls/6573

So that it does not use docker.io

(cherry picked from commit 69ce414f7e39559a804c9fd23b25146f7b281250)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6574
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-01-15 21:36:53 +00:00
Renovate Bot
2b1e74a76f Update module github.com/alecthomas/chroma/v2 to v2.15.0 (v10.0/forgejo) (#6553)
This PR contains the following updates:

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

---

### Release Notes

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

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

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

#### What's Changed

-   AQL: Add builtin functions introduced in v3.12 by [@&#8203;Simran-B](https://github.com/Simran-B) in https://github.com/alecthomas/chroma/pull/968
-   chore(styles): add evergarden inspired style by [@&#8203;comfysage](https://github.com/comfysage) in https://github.com/alecthomas/chroma/pull/970
-   chore(deps): update dependency svu to v2 by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/971
-   chore(deps): update dependency watchexec to v2 by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/962
-   chore(deps): update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/955
-   styles: Fix Gleam alias by [@&#8203;jmooring](https://github.com/jmooring) in https://github.com/alecthomas/chroma/pull/973
-   chore(deps): update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/974
-   chore(deps): update dependency python3 to v3.12.3 by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/976
-   added the nordic theme via chroma/styles/nordic.xml by [@&#8203;avih7531](https://github.com/avih7531) in https://github.com/alecthomas/chroma/pull/977
-   Update the Materialize lexer by [@&#8203;arusahni](https://github.com/arusahni) in https://github.com/alecthomas/chroma/pull/978
-   feat(lexers/hare): add done keyword by [@&#8203;wackbyte](https://github.com/wackbyte) in https://github.com/alecthomas/chroma/pull/979
-   pygments2chroma: escape regex.words by [@&#8203;oliverpool](https://github.com/oliverpool) in https://github.com/alecthomas/chroma/pull/982
-   chore(deps): update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/981
-   Add JSONata Lexer by [@&#8203;DevDimov](https://github.com/DevDimov) in https://github.com/alecthomas/chroma/pull/983
-   Go lexer: single line comment without consuming endline, disable EnsureNL by [@&#8203;msorc](https://github.com/msorc) in https://github.com/alecthomas/chroma/pull/984
-   Update the Materialize lexer by [@&#8203;arusahni](https://github.com/arusahni) in https://github.com/alecthomas/chroma/pull/987
-   chore(deps): update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/985
-   Add Gleam to README by [@&#8203;Nicd](https://github.com/Nicd) in https://github.com/alecthomas/chroma/pull/990
-   Port Minecraft lexers from Pygments by [@&#8203;kofuk](https://github.com/kofuk) in https://github.com/alecthomas/chroma/pull/992
-   Don't output extra whitespace in YAML multiline by [@&#8203;Gusted](https://github.com/Gusted) in https://github.com/alecthomas/chroma/pull/993
-   chore(deps): update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/991
-   add beef syntax and tests by [@&#8203;Booklordofthedings](https://github.com/Booklordofthedings) in https://github.com/alecthomas/chroma/pull/995
-   Update GitHub light color palette by [@&#8203;konradreiche](https://github.com/konradreiche) in https://github.com/alecthomas/chroma/pull/998
-   chore(deps): update module github.com/alecthomas/kong to v1 by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/999
-   Update the Materialize lexer by [@&#8203;arusahni](https://github.com/arusahni) in https://github.com/alecthomas/chroma/pull/1001
-   Update TypeScript lexer to allow nested generics by [@&#8203;fredrare](https://github.com/fredrare) in https://github.com/alecthomas/chroma/pull/1002
-   Pager friendly terminal formatting by [@&#8203;walles](https://github.com/walles) in https://github.com/alecthomas/chroma/pull/1006
-   chore(deps): update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/997
-   Add Typst Lexer by [@&#8203;oliverpool](https://github.com/oliverpool) in https://github.com/alecthomas/chroma/pull/1007
-   Add Jsonnet Lexer by [@&#8203;jolheiser](https://github.com/jolheiser) in https://github.com/alecthomas/chroma/pull/1011
-   fix: add underscore parsing in numbers for haskell by [@&#8203;Gusted](https://github.com/Gusted) in https://github.com/alecthomas/chroma/pull/1020
-   Add CSV lexer by [@&#8203;walles](https://github.com/walles) in https://github.com/alecthomas/chroma/pull/1005
-   fix(typescript): highlight string literal type parameters by [@&#8203;SKalt](https://github.com/SKalt) in https://github.com/alecthomas/chroma/pull/1010
-   add any as a builtin type for go by [@&#8203;quartercastle](https://github.com/quartercastle) in https://github.com/alecthomas/chroma/pull/1021
-   chore(deps): update all non-major dependencies by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/1013
-   Remove whitespace tokenizing rule in markdown lexer by [@&#8203;cloudchamb3r](https://github.com/cloudchamb3r) in https://github.com/alecthomas/chroma/pull/1008
-   feat(JSON): support `.jsonc` extension by [@&#8203;CarterLi](https://github.com/CarterLi) in https://github.com/alecthomas/chroma/pull/1022
-   Add Eclipse ATL language (https://eclipse.dev/atl/) by [@&#8203;dwagelaar](https://github.com/dwagelaar) in https://github.com/alecthomas/chroma/pull/1024
-   Import NSIS Lexer from Pygments by [@&#8203;JakobDev](https://github.com/JakobDev) in https://github.com/alecthomas/chroma/pull/1026
-   chore(deps): update module github.com/alecthomas/kong to v1.5.1 by [@&#8203;renovate](https://github.com/renovate) in https://github.com/alecthomas/chroma/pull/1025
-   fix(nix): nix lexor missing '=' operator by [@&#8203;FlyingStitchman](https://github.com/FlyingStitchman) in https://github.com/alecthomas/chroma/pull/1031
-   Add WebVTT lexer ([#&#8203;707](https://github.com/alecthomas/chroma/issues/707)) by [@&#8203;dschuessler](https://github.com/dschuessler) in https://github.com/alecthomas/chroma/pull/1032

#### New Contributors

-   [@&#8203;comfysage](https://github.com/comfysage) made their first contribution in https://github.com/alecthomas/chroma/pull/970
-   [@&#8203;avih7531](https://github.com/avih7531) made their first contribution in https://github.com/alecthomas/chroma/pull/977
-   [@&#8203;wackbyte](https://github.com/wackbyte) made their first contribution in https://github.com/alecthomas/chroma/pull/979
-   [@&#8203;oliverpool](https://github.com/oliverpool) made their first contribution in https://github.com/alecthomas/chroma/pull/982
-   [@&#8203;DevDimov](https://github.com/DevDimov) made their first contribution in https://github.com/alecthomas/chroma/pull/983
-   [@&#8203;msorc](https://github.com/msorc) made their first contribution in https://github.com/alecthomas/chroma/pull/984
-   [@&#8203;Nicd](https://github.com/Nicd) made their first contribution in https://github.com/alecthomas/chroma/pull/990
-   [@&#8203;Booklordofthedings](https://github.com/Booklordofthedings) made their first contribution in https://github.com/alecthomas/chroma/pull/995
-   [@&#8203;konradreiche](https://github.com/konradreiche) made their first contribution in https://github.com/alecthomas/chroma/pull/998
-   [@&#8203;fredrare](https://github.com/fredrare) made their first contribution in https://github.com/alecthomas/chroma/pull/1002
-   [@&#8203;SKalt](https://github.com/SKalt) made their first contribution in https://github.com/alecthomas/chroma/pull/1010
-   [@&#8203;quartercastle](https://github.com/quartercastle) made their first contribution in https://github.com/alecthomas/chroma/pull/1021
-   [@&#8203;cloudchamb3r](https://github.com/cloudchamb3r) made their first contribution in https://github.com/alecthomas/chroma/pull/1008
-   [@&#8203;CarterLi](https://github.com/CarterLi) made their first contribution in https://github.com/alecthomas/chroma/pull/1022
-   [@&#8203;dwagelaar](https://github.com/dwagelaar) made their first contribution in https://github.com/alecthomas/chroma/pull/1024
-   [@&#8203;FlyingStitchman](https://github.com/FlyingStitchman) made their first contribution in https://github.com/alecthomas/chroma/pull/1031
-   [@&#8203;dschuessler](https://github.com/dschuessler) made their first contribution in https://github.com/alecthomas/chroma/pull/1032

**Full Changelog**: https://github.com/alecthomas/chroma/compare/v2.14.0...v2.15.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), 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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDYuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNi4wIiwidGFyZ2V0QnJhbmNoIjoidjEwLjAvZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Co-authored-by: viceice <michael.kriese@gmx.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6553
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-01-14 21:40:06 +00:00
0ko
c439e26c33 i18n: update of translations from Codeberg Translate (#6566)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6566
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-01-14 07:48:07 +00:00
0ko
317559fdd9 i18n: update of translations from Codeberg Translate
Backport: https://codeberg.org/forgejo/forgejo/issues/6515

Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@users.noreply.translate.codeberg.org>
Co-authored-by: div72 <div72@users.noreply.translate.codeberg.org>
Co-authored-by: tkbremnes <tkbremnes@users.noreply.translate.codeberg.org>
Co-authored-by: artnay <artnay@users.noreply.translate.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@users.noreply.translate.codeberg.org>
Co-authored-by: Protestant <protestant@users.noreply.translate.codeberg.org>
Co-authored-by: micash <micash@users.noreply.translate.codeberg.org>
Co-authored-by: Ikuyo Mita <ikuyo@users.noreply.translate.codeberg.org>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: burakozaydin <burakozaydin@users.noreply.translate.codeberg.org>
Co-authored-by: kdh8219 <kdh8219@monamo.dev>
Co-authored-by: Juno Takano <jutty@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: justbispo <justbispo@users.noreply.translate.codeberg.org>

(semi-automatically picked from commit d717c78ea0)
2025-01-14 11:57:02 +05:00
forgejo-backport-action
b88cd0c111 [v10.0/forgejo] port(gitea#31954): Add lock for parallel maven upload (#6517)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6513

Backport #31851
Fix #30171

---

Fixes https://github.com/go-gitea/gitea/issues/30171, this is also a
issue in Forgejo. Backport the implementation that uses the existing
sync module which does not work for multiple instances which is
perfectly fine for Forgejo for now.

(cherry picked from commit 9c990ac043a0167dc59f1c822988ed2316f7c1df)

Co-authored-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6517
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-09 18:10:54 +00:00
0ko
5326183693 [v10.0/forgejo] i18n: update of translations from Codeberg Translate (#6514)
Backport: https://codeberg.org/forgejo/forgejo/pulls/6451

Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: div72 <div72@users.noreply.translate.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: revi <yewon@revi.email>
Co-authored-by: lordwektabyte <lordwektabyte@users.noreply.translate.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: artnay <artnay@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Juno Takano <jutty@users.noreply.translate.codeberg.org>
Co-authored-by: justbispo <justbispo@users.noreply.translate.codeberg.org>
Co-authored-by: Atalanttore <atalanttore@users.noreply.translate.codeberg.org>
Co-authored-by: SomeTr <sometr@users.noreply.translate.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: banaanihillo <banaanihillo@users.noreply.translate.codeberg.org>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Co-authored-by: Marti <marti@users.noreply.translate.codeberg.org>
Co-authored-by: mahlzahn <mahlzahn@posteo.de>

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6514
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-01-09 08:57:11 +00:00
Earl Warren
5b6e0ca99c [v10.0/forgejo] fix: upgrade gof3 package and driver (#6493)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6493
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-01-07 21:31:55 +00:00
Earl Warren
90730e83ba fix: upgrade gof3 version
(cherry picked from commit 7189da15f2)
2025-01-07 20:52:48 +00:00
limiting-factor
775770ad81 fix: f3: label color must start with #
(cherry picked from commit 604c21ffd7)
2025-01-07 20:52:48 +00:00
limiting-factor
4eb7e0fe08 fix: f3: update milestone is_closed & deadline_unix
(cherry picked from commit 63204e8edf)
2025-01-07 20:52:48 +00:00
limiting-factor
597d806753 fix: f3: update issue is_locked
(cherry picked from commit 946b77115e)
2025-01-07 20:52:48 +00:00
limiting-factor
2b6a4137d5 fix: f3: update issue labels
(cherry picked from commit 168c1d806b)
2025-01-07 20:52:48 +00:00
limiting-factor
35266133d8 fix: f3: update issue assignees
The ID must be obtained from the repository ID and the index,
otherwise it is zero and the assignees are not updated.

(cherry picked from commit d8f71b513c)
2025-01-07 20:52:48 +00:00
limiting-factor
dab3121c65 fix: f3: support modify milestone
(cherry picked from commit 16564fd9e8)
2025-01-07 20:52:48 +00:00
Renovate Bot
3ce1a6562d Update module github.com/go-git/go-git/v5 to v5.13.1 (v10.0/forgejo) (#6496)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) | require | minor | `v5.11.0` -> `v5.13.1` |

---

### Release Notes

<details>
<summary>go-git/go-git (github.com/go-git/go-git/v5)</summary>

### [`v5.13.1`](https://github.com/go-git/go-git/releases/tag/v5.13.1)

[Compare Source](https://github.com/go-git/go-git/compare/v5.13.0...v5.13.1)

#### What's Changed

-   build: bump github.com/go-git/go-billy/v5 from 5.6.0 to 5.6.1 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1327
-   build: bump github.com/elazarl/goproxy from 1.2.1 to 1.2.2 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1329
-   build: bump github.com/elazarl/goproxy from 1.2.2 to 1.2.3 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1340
-   Revert "plumbing: transport/ssh, Add support for SSH [@&#8203;cert-authority](https://github.com/cert-authority)." by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;1346](https://github.com/go-git/go-git/issues/1346)

**Full Changelog**: https://github.com/go-git/go-git/compare/v5.13.0...v5.13.1

### [`v5.13.0`](https://github.com/go-git/go-git/releases/tag/v5.13.0)

[Compare Source](https://github.com/go-git/go-git/compare/v5.12.0...v5.13.0)

#### What's Changed

-   build: bump github.com/go-git/go-git/v5 from 5.11.0 to 5.12.0 in /cli/go-git by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1065
-   build: bump golang.org/x/net from 0.22.0 to 0.23.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1068
-   build: bump golang.org/x/net from 0.23.0 to 0.24.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1071
-   Properly support skipping of non-mandatory extensions  by [@&#8203;codablock](https://github.com/codablock) in https://github.com/go-git/go-git/pull/1066
-   git: Refine some codes in test and non-test. by [@&#8203;onee-only](https://github.com/onee-only) in https://github.com/go-git/go-git/pull/1077
-   plumbing: protocol/packp, client-side filter capability support by [@&#8203;edigaryev](https://github.com/edigaryev) in https://github.com/go-git/go-git/pull/1000
-   build: bump golang.org/x/net from 0.22.0 to 0.23.0 in /cli/go-git by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1078
-   plumbing: fix sideband demux on flush by [@&#8203;aymanbagabas](https://github.com/aymanbagabas) in https://github.com/go-git/go-git/pull/1084
-   storage: dotgit, head reference usually comes first by [@&#8203;aymanbagabas](https://github.com/aymanbagabas) in https://github.com/go-git/go-git/pull/1085
-   build: bump golang.org/x/text from 0.14.0 to 0.15.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1091
-   build: bump golang.org/x/crypto from 0.22.0 to 0.23.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1094
-   build: bump golang.org/x/net from 0.24.0 to 0.25.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1093
-   git: Added an example for Repository.Branches by [@&#8203;johnmatthiggins](https://github.com/johnmatthiggins) in https://github.com/go-git/go-git/pull/1088
-   git: worktree_commit, Modify checking empty commit. Fixes [#&#8203;723](https://github.com/go-git/go-git/issues/723) by [@&#8203;onee-only](https://github.com/onee-only) in https://github.com/go-git/go-git/pull/1050
-   plumbing: transport/http, Wrap http errors to return reason. Fixes [#&#8203;1097](https://github.com/go-git/go-git/issues/1097) by [@&#8203;ggambetti](https://github.com/ggambetti) in https://github.com/go-git/go-git/pull/1100
-   build: bump golang.org/x/sys from 0.20.0 to 0.21.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1106
-   build: bump golang.org/x/text from 0.15.0 to 0.16.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1107
-   Bumps Go versions and go-billy by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1056
-   \_examples: Fixed a dead link COMPATIBILITY.md by [@&#8203;gecko655](https://github.com/gecko655) in https://github.com/go-git/go-git/pull/1109
-   build: bump github.com/jessevdk/go-flags from 1.5.0 to 1.6.1 in /cli/go-git by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1115
-   build: bump github.com/elazarl/goproxy from v0.0.0-20230808193330-2592e75ae04a to v0.0.0-20240618083138-03be62527ccb by [@&#8203;hbelmiro](https://github.com/hbelmiro) in https://github.com/go-git/go-git/pull/1124
-   build: bump golang.org/x/net from 0.25.0 to 0.26.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1104
-   Add option approximating `git clean -x` flag. by [@&#8203;msuozzo](https://github.com/msuozzo) in https://github.com/go-git/go-git/pull/995
-   Revert "Add option approximating `git clean -x` flag." by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1129
-   Fix reference updated concurrently error for the filesystem storer by [@&#8203;Javier-varez](https://github.com/Javier-varez) in https://github.com/go-git/go-git/pull/1116
-   build: bump golang.org/x/net from 0.26.0 to 0.27.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1134
-   utils: merkletrie, Align error message with upstream by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1142
-   plumbing: transport/file, Change paths to absolute by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1141
-   plumbing: gitignore, Fix loading of ignored .gitignore files. by [@&#8203;Achilleshiel](https://github.com/Achilleshiel) in https://github.com/go-git/go-git/pull/1114
-   build: bump github.com/skeema/knownhosts from 1.2.2 to 1.3.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1147
-   plumbing: transport/ssh, Add support for SSH [@&#8203;cert-authority](https://github.com/cert-authority). by [@&#8203;Javier-varez](https://github.com/Javier-varez) in https://github.com/go-git/go-git/pull/1157
-   build: run example tests during CI workflow by [@&#8203;crazybolillo](https://github.com/crazybolillo) in https://github.com/go-git/go-git/pull/1030
-   storage: filesystem, Fix object cache not working due to uninitialised objects being put into cache by [@&#8203;SatelliteMind](https://github.com/SatelliteMind) in https://github.com/go-git/go-git/pull/1138
-   git: Fix fetching missing commits by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in https://github.com/go-git/go-git/pull/1032
-   plumbing: format/packfile, remove duplicate checks in findMatch() by [@&#8203;edigaryev](https://github.com/edigaryev) in https://github.com/go-git/go-git/pull/1152
-   git: worktree, Fix file reported as `Untracked` while it is committed by [@&#8203;rodrigocam](https://github.com/rodrigocam) in https://github.com/go-git/go-git/pull/1023
-   build: bump golang.org/x/sys from 0.22.0 to 0.23.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1160
-   plumbing: filemode, Remove check for setting size of .git/index file  by [@&#8203;nicholasSUSE](https://github.com/nicholasSUSE) in https://github.com/go-git/go-git/pull/1159
-   build: bump golang.org/x/net from 0.27.0 to 0.28.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1163
-   Fix some lint warning and increase stalebot to 180 days by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1128
-   adjust path extracted from file: url on Windows by [@&#8203;tomqwpl](https://github.com/tomqwpl) in https://github.com/go-git/go-git/pull/416
-   build: bump golang.org/x/sys from 0.23.0 to 0.24.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1164
-   Add RestoreStaged to Worktree that mimics the behaviour of git restore --staged <file>... by [@&#8203;ben-tbotlabs](https://github.com/ben-tbotlabs) in https://github.com/go-git/go-git/pull/493
-   plumbing: signature, support the same x509 signature formats as git by [@&#8203;yoavamit](https://github.com/yoavamit) in https://github.com/go-git/go-git/pull/1169
-   fix: allow discovery of non bare repos in fsLoader by [@&#8203;jakobmoellerdev](https://github.com/jakobmoellerdev) in https://github.com/go-git/go-git/pull/1170
-   build: bump golang.org/x/sys from 0.24.0 to 0.25.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1178
-   build: bump golang.org/x/text from 0.17.0 to 0.18.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1179
-   build: bump golang.org/x/net from 0.28.0 to 0.29.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1184
-   Consume push URLs when they are provided by [@&#8203;mcepl](https://github.com/mcepl) in https://github.com/go-git/go-git/pull/1191
-   \*: use gocheck's MkDir instead of TempDir for tests. Fixes [#&#8203;807](https://github.com/go-git/go-git/issues/807) by [@&#8203;uragirii](https://github.com/uragirii) in https://github.com/go-git/go-git/pull/1194
-   build: bump golang.org/x/net from 0.29.0 to 0.30.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1200
-   worktree: .git/index not correctly generated when running on Windows by [@&#8203;BeChris](https://github.com/BeChris) in https://github.com/go-git/go-git/pull/1198
-   git: worktree, Fix sparse reset. Fixes [#&#8203;90](https://github.com/go-git/go-git/issues/90) by [@&#8203;onee-only](https://github.com/onee-only) in https://github.com/go-git/go-git/pull/1101
-   git: worktree, Pass context on updateSubmodules. Fixes [#&#8203;1098](https://github.com/go-git/go-git/issues/1098) by [@&#8203;onee-only](https://github.com/onee-only) in https://github.com/go-git/go-git/pull/1154
-   build: bump github.com/go-git/go-billy/v5 from 5.5.1-0.20240427054813-8453aa90c6ec to 5.6.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1211
-   Update contributing guidelines by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1217
-   build: bump github.com/ProtonMail/go-crypto from 1.0.0 to 1.1.1 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1222
-   build: bump golang.org/x/sys from 0.26.0 to 0.27.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1223
-   build: bump golang.org/x/crypto from 0.28.0 to 0.29.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1221
-   build: bump github.com/ProtonMail/go-crypto from 1.1.1 to 1.1.2 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1226
-   build: bump github.com/stretchr/testify from 1.9.0 to 1.10.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1232
-   build: bump github.com/ProtonMail/go-crypto from 1.1.2 to 1.1.3 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1231
-   build: General improvements around fuzzing by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1229
-   build: bump golang.org/x/net from 0.30.0 to 0.32.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1241
-   build: group dependabot updates for golang.org by [@&#8203;AriehSchneier](https://github.com/AriehSchneier) in https://github.com/go-git/go-git/pull/1243
-   build: bump github/codeql-action from 2.22.11 to 3.27.6 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1244
-   build: bump golang.org/x/crypto from 0.21.0 to 0.31.0 in /cli/go-git by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1246
-   build: bump golang.org/x/crypto from 0.30.0 to 0.31.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1247
-   build: bump github.com/gliderlabs/ssh from 0.3.7 to 0.3.8 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1248
-   add comment preventing people from creating invalid trees by [@&#8203;petar](https://github.com/petar) in https://github.com/go-git/go-git/pull/732
-   build: bump github/codeql-action from 3.27.6 to 3.27.9 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1250
-   plumbing: Properly encode index version 4 by [@&#8203;BeChris](https://github.com/BeChris) in https://github.com/go-git/go-git/pull/1251
-   Fix typos by [@&#8203;deining](https://github.com/deining) in https://github.com/go-git/go-git/pull/1148
-   Fix reset files in subfolders by [@&#8203;linglo](https://github.com/linglo) in https://github.com/go-git/go-git/pull/1177
-   git: update switch cases by [@&#8203;hezhizhen](https://github.com/hezhizhen) in https://github.com/go-git/go-git/pull/1182
-   build: bump golang.org/x/net from 0.32.0 to 0.33.0 in the golang-org group by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1256
-   fix(1212): Fix invalid reference name error while cloning branches containing /- by [@&#8203;varmakarthik12](https://github.com/varmakarthik12) in https://github.com/go-git/go-git/pull/1257
-   pktline : accept upercase hexadecimal value as pktline length information by [@&#8203;BeChris](https://github.com/BeChris) in https://github.com/go-git/go-git/pull/1220
-   build: bump github/codeql-action from 3.27.9 to 3.28.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1260
-   build: bump github.com/elazarl/goproxy from 0.0.0-20240618083138-03be62527ccb to 1.2.1 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/go-git/go-git/pull/1262
-   git: worktree_commit, sanitize author and commiter name and email before creating the commit object. Fixes [#&#8203;680](https://github.com/go-git/go-git/issues/680) by [@&#8203;BeChris](https://github.com/BeChris) in https://github.com/go-git/go-git/pull/1261

#### New Contributors

-   [@&#8203;johnmatthiggins](https://github.com/johnmatthiggins) made their first contribution in https://github.com/go-git/go-git/pull/1088
-   [@&#8203;ggambetti](https://github.com/ggambetti) made their first contribution in https://github.com/go-git/go-git/pull/1100
-   [@&#8203;gecko655](https://github.com/gecko655) made their first contribution in https://github.com/go-git/go-git/pull/1109
-   [@&#8203;hbelmiro](https://github.com/hbelmiro) made their first contribution in https://github.com/go-git/go-git/pull/1124
-   [@&#8203;msuozzo](https://github.com/msuozzo) made their first contribution in https://github.com/go-git/go-git/pull/995
-   [@&#8203;Javier-varez](https://github.com/Javier-varez) made their first contribution in https://github.com/go-git/go-git/pull/1116
-   [@&#8203;Achilleshiel](https://github.com/Achilleshiel) made their first contribution in https://github.com/go-git/go-git/pull/1114
-   [@&#8203;crazybolillo](https://github.com/crazybolillo) made their first contribution in https://github.com/go-git/go-git/pull/1030
-   [@&#8203;SatelliteMind](https://github.com/SatelliteMind) made their first contribution in https://github.com/go-git/go-git/pull/1138
-   [@&#8203;rodrigocam](https://github.com/rodrigocam) made their first contribution in https://github.com/go-git/go-git/pull/1023
-   [@&#8203;nicholasSUSE](https://github.com/nicholasSUSE) made their first contribution in https://github.com/go-git/go-git/pull/1159
-   [@&#8203;tomqwpl](https://github.com/tomqwpl) made their first contribution in https://github.com/go-git/go-git/pull/416
-   [@&#8203;ben-tbotlabs](https://github.com/ben-tbotlabs) made their first contribution in https://github.com/go-git/go-git/pull/493
-   [@&#8203;yoavamit](https://github.com/yoavamit) made their first contribution in https://github.com/go-git/go-git/pull/1169
-   [@&#8203;uragirii](https://github.com/uragirii) made their first contribution in https://github.com/go-git/go-git/pull/1194
-   [@&#8203;petar](https://github.com/petar) made their first contribution in https://github.com/go-git/go-git/pull/732
-   [@&#8203;deining](https://github.com/deining) made their first contribution in https://github.com/go-git/go-git/pull/1148
-   [@&#8203;linglo](https://github.com/linglo) made their first contribution in https://github.com/go-git/go-git/pull/1177
-   [@&#8203;varmakarthik12](https://github.com/varmakarthik12) made their first contribution in https://github.com/go-git/go-git/pull/1257

**Full Changelog**: https://github.com/go-git/go-git/compare/v5.12.0...v5.13.0

### [`v5.12.0`](https://github.com/go-git/go-git/releases/tag/v5.12.0)

[Compare Source](https://github.com/go-git/go-git/compare/v5.11.0...v5.12.0)

#### What's Changed

-   git: Worktree.AddWithOptions: add skipStatus option when providing a specific path by [@&#8203;moranCohen26](https://github.com/moranCohen26) in https://github.com/go-git/go-git/pull/994
-   git: Signer: fix usage of crypto.Signer interface by [@&#8203;wlynch](https://github.com/wlynch) in https://github.com/go-git/go-git/pull/1029
-   git: Remote, fetch, adds the prune option. by [@&#8203;juliens](https://github.com/juliens) in https://github.com/go-git/go-git/pull/366
-   git: Add crypto.Signer option to CommitOptions. by [@&#8203;wlynch](https://github.com/wlynch) in https://github.com/go-git/go-git/pull/996
-   git: Worktree checkout tag hash id ([#&#8203;959](https://github.com/go-git/go-git/issues/959)) by [@&#8203;aymanbagabas](https://github.com/aymanbagabas) in https://github.com/go-git/go-git/pull/966
-   git: Worktree, Don't panic on empty or root path when checking if it is valid by [@&#8203;tim775](https://github.com/tim775) in https://github.com/go-git/go-git/pull/1042
-   git: Add commit validation for Reset by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1048
-   git: worktree_commit, Fix amend commit to apply changes. Fixes [#&#8203;1024](https://github.com/go-git/go-git/issues/1024) by [@&#8203;onee-only](https://github.com/onee-only) in https://github.com/go-git/go-git/pull/1045
-   git: Implement Merge function with initial `FastForwardMerge` support by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/1044
-   plumbing: object, Make first commit visible on logs filtered with filename. Fixes [#&#8203;191](https://github.com/go-git/go-git/issues/191) by [@&#8203;onee-only](https://github.com/onee-only) in https://github.com/go-git/go-git/pull/1036
-   plumbing: no panic in printStats function. Fixes [#&#8203;177](https://github.com/go-git/go-git/issues/177) by [@&#8203;nodivbyzero](https://github.com/nodivbyzero) in https://github.com/go-git/go-git/pull/971
-   plumbing: object, Optimize logging with file. by [@&#8203;onee-only](https://github.com/onee-only) in https://github.com/go-git/go-git/pull/1046
-   plumbing: object, check legitimacy in (\*Tree).Encode by [@&#8203;niukuo](https://github.com/niukuo) in https://github.com/go-git/go-git/pull/967
-   plumbing: format/gitattributes, close file in ReadAttributesFile by [@&#8203;prskr](https://github.com/prskr) in https://github.com/go-git/go-git/pull/1018
-   plumbing: check setAuth error. Fixes [#&#8203;185](https://github.com/go-git/go-git/issues/185) by [@&#8203;nodivbyzero](https://github.com/nodivbyzero) in https://github.com/go-git/go-git/pull/969
-   plumbing: object, fix variable  defaultUtf8CommitMessageEncoding name spell error by [@&#8203;Jerry-yz](https://github.com/Jerry-yz) in https://github.com/go-git/go-git/pull/987
-   utils: merkletrie, calculate filesystem node's hash lazily. by [@&#8203;candid82](https://github.com/candid82) in https://github.com/go-git/go-git/pull/825
-   utils: update comment in node.go's Hash() by [@&#8203;codablock](https://github.com/codablock) in https://github.com/go-git/go-git/pull/992
-   \_example: fix 404 link and added ssh-agent clone link by [@&#8203;grinish21](https://github.com/grinish21) in https://github.com/go-git/go-git/pull/1022
-   \_example: checkout-branch example by [@&#8203;dlambda](https://github.com/dlambda) in https://github.com/go-git/go-git/pull/446
-   \_example: example for git clone using ssh-agent by [@&#8203;pjbgf](https://github.com/pjbgf) in https://github.com/go-git/go-git/pull/998

#### New Contributors

-   [@&#8203;candid82](https://github.com/candid82) made their first contribution in https://github.com/go-git/go-git/pull/825
-   [@&#8203;codablock](https://github.com/codablock) made their first contribution in https://github.com/go-git/go-git/pull/992
-   [@&#8203;Jerry-yz](https://github.com/Jerry-yz) made their first contribution in https://github.com/go-git/go-git/pull/987
-   [@&#8203;wlynch](https://github.com/wlynch) made their first contribution in https://github.com/go-git/go-git/pull/996
-   [@&#8203;moranCohen26](https://github.com/moranCohen26) made their first contribution in https://github.com/go-git/go-git/pull/994
-   [@&#8203;grinish21](https://github.com/grinish21) made their first contribution in https://github.com/go-git/go-git/pull/1022
-   [@&#8203;prskr](https://github.com/prskr) made their first contribution in https://github.com/go-git/go-git/pull/1018
-   [@&#8203;dlambda](https://github.com/dlambda) made their first contribution in https://github.com/go-git/go-git/pull/446
-   [@&#8203;juliens](https://github.com/juliens) made their first contribution in https://github.com/go-git/go-git/pull/366
-   [@&#8203;onee-only](https://github.com/onee-only) made their first contribution in https://github.com/go-git/go-git/pull/1036
-   [@&#8203;tim775](https://github.com/tim775) made their first contribution in https://github.com/go-git/go-git/pull/1042
-   [@&#8203;niukuo](https://github.com/niukuo) made their first contribution in https://github.com/go-git/go-git/pull/967
-   [@&#8203;avoidalone](https://github.com/avoidalone) made their first contribution in https://github.com/go-git/go-git/pull/1047

**Full Changelog**: https://github.com/go-git/go-git/compare/v5.11.0...v5.12.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), 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:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6InYxMC4wL2Zvcmdlam8iLCJsYWJlbHMiOlsiZGVwZW5kZW5jeS11cGdyYWRlIiwidGVzdC9ub3QtbmVlZGVkIl19-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6496
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-01-07 20:51:15 +00:00
forgejo-backport-action
3b5f162fe6 [v10.0/forgejo] chore: remove illegal git usage (#6492)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6488

This is no longer possible in future go-git versions, so lets hardcode it

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6492
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-07 19:01:32 +00:00
forgejo-backport-action
f63e5a1cff [v10.0/forgejo] fix(ui): show oauth divider on signup page (#6465)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6463

Fix a minor UI bug introduced in https://codeberg.org/forgejo/forgejo/pulls/6112.

The condition `if .EnableInternalSignIn` was added to display of the divider, but it is only available when `oauth_container.tmpl` is called from signIn page, it is not relevant to signUp page.

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6465
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-01-04 10:35:37 +00:00
Earl Warren
25640f201e Merge pull request '[v10.0/forgejo] i18n: update of translations from Codeberg Translate' (#6450) from bp-v10.0/forgejo-a33fe60 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6450
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2025-01-02 08:24:15 +00:00
Codeberg Translate
ef205915cc i18n: update of translations from Codeberg Translate (#6378)
Co-authored-by: tacaly <frederick@tacaly.com>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: artnay <artnay@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Edgarsons <edgarsons@users.noreply.translate.codeberg.org>
Co-authored-by: Benedikt Straub <benedikt-straub@web.de>
Co-authored-by: Atalanttore <atalanttore@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: Juno Takano <jutty@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <dirk@users.noreply.translate.codeberg.org>
Co-authored-by: thodorisl <thodorisl@users.noreply.translate.codeberg.org>
Co-authored-by: jasonb <jasonb@users.noreply.translate.codeberg.org>
Co-authored-by: SomeTr <sometr@users.noreply.translate.codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@users.noreply.translate.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: s-light <s-light@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6378
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
(cherry picked from commit a33fe60bbe)
2025-01-02 07:47:56 +00:00
Gusted
81d351ce5f Merge pull request '[v10.0/forgejo] feat: Add summary card for repos and releases' (#6448) from JakobDev/forgejo:cardback into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6448
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-01-02 05:44:05 +00:00
Gusted
cd08097bbb Merge pull request '[v10.0/forgejo] Fix editing pr review' (#6444) from bp-v10.0/forgejo-13b6caa into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6444
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2025-01-02 00:55:10 +00:00
JakobDev
13496203bc
[v10.0/forgejo] feat: Add summary card for repos and releases 2025-01-01 22:00:26 +01:00
JakobDev
8f47560bf7 Fix editing pr review
(cherry picked from commit 13b6caa608)
2025-01-01 17:54:01 +00:00
0ko
9e6c3f226c Merge pull request '[v10.0/forgejo] fix(code search): empty mode dropdown when keyword is empty' (#6442) from bp-v10.0/forgejo-c53d219 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6442
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2025-01-01 13:36:24 +00:00
Shiny Nematoda
c7c7f69f82 fix(code search): empty mode dropdown when keyword is empty
(cherry picked from commit c53d21965a)
2025-01-01 13:04:56 +00:00
Gusted
86a09562fd Merge pull request '[v10.0/forgejo] fix(ui): use primary color for button in table modal' (#6430) from bp-v10.0/forgejo-a302506 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6430
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-12-31 15:18:37 +00:00
0ko
ce5c3e32c1 fix(ui): use primary color for button in table modal (#6427)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6427
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
(cherry picked from commit a302506095)
2024-12-31 09:39:52 +00:00
Earl Warren
fa9f6e0cdd Merge pull request '[v10.0/forgejo] Fix edit cancel button' (#6426) from bp-v10.0/forgejo-29c59c9 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6426
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-31 07:30:26 +00:00
JakobDev
172a48be8a Fix edit cancel button
(cherry picked from commit 29c59c96bd)
2024-12-31 02:11:08 +00:00
Earl Warren
4a25a3e154 Merge pull request '[v10.0/forgejo] Rework user profile settings' (#6423) from bp-v10.0/forgejo-2885ea8 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6423
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-30 21:20:51 +00:00
Earl Warren
6266715486 Merge pull request '[v10.0/forgejo] Fix issue/comment menus' (#6424) from bp-v10.0/forgejo-c67d63d into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6424
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-30 21:19:38 +00:00
Otto Richter
3496c819da Fix issue/comment menus
Closes https://codeberg.org/forgejo/forgejo/issues/1120

- Adds labels to reaction and context menu.
- Fixes taborder in markdown combobox buttons. They are now only one
  "tab" stop and can be navigated with arrow buttons and in the right
order (previously, it would skip the table button).
- Generates more verbose output for the reactio selectors to provide
  content for users who cannot identify the meaning of these buttons
visually. Explicit aria-labels are now preferred over auto-generated
ones.

(cherry picked from commit c67d63d88a)
2024-12-30 20:29:28 +00:00
Otto Richter
4f8d96a6de Rework user profile settings
Accessibility:

- improved semantic layout
- Fixes unlabelled input for custom pronouns. CC @hazy
- Adds labels to dropdowns.
- Shortens certain texts for less verbose screen reader outputs and
  people with slow reading speed.
- Turned optional username rename helper text with low contrast into
  "normal" help text.

UI/UX:

- Removes section about primary email which is no longer managed in the
  profile section.
- Fixes section about primary email not displaying in user settings when notifications are
  not available.
- Removes primary email display, because it is not actually a form
  element here. (Alternatively, we could display it and link to the
account settings for managing the email)

(cherry picked from commit 2885ea8da2)
2024-12-30 20:29:15 +00:00
Earl Warren
8d353ad258 Merge pull request '[v10.0/forgejo] chore(branding): strip metadata information from the footer' (#6420) from bp-v10.0/forgejo-2c81893 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6420
2024-12-30 16:43:10 +00:00
Earl Warren
865d4f538b chore(branding): strip metadata information from the footer
When the Forgejo version is displayed in the footer, the metadata
should not be displayed. It was once an indication that Forgejo
includes all of Gitea. But since the hard fork the codebase diverged
and this is no longer accurate.

The metadata is still displayed in the API, admin panels or headers
for the sake of backward compatibility.

Refs: https://codeberg.org/forgejo/discussions/issues/244
(cherry picked from commit 2c81893c76)
2024-12-30 15:30:02 +00:00
Gusted
ecbbaabfc8 Merge pull request '[v10.0/forgejo] fix: use DateUtils for blocked users list' (#6418) from bp-v10.0/forgejo-57f7253 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6418
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-12-30 12:55:05 +00:00
Gusted
38f058a5f0 fix: use DateUtils for blocked users list
- Should've been fixed with #5796 but seems I've overlooked.

(cherry picked from commit 57f7253610)
2024-12-30 10:54:38 +00:00
Earl Warren
1a64ae1dc4 Merge pull request '[v10.0/forgejo] [gitea] week 2024-53 cherry pick (gitea/main -> forgejo)' (#6416) from bp-v10.0/forgejo-0efd713-2ffa9a5-92ac337-b18dcd6-37f0561 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6416
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-30 08:59:18 +00:00
Earl Warren
a8cc73fe87 Improve Actions test (#32883) (followup)
(cherry picked from commit 37f05617a5)
2024-12-30 08:26:54 +00:00
Zettat123
7a84081755 Improve Actions test (#32883)
This PR adds a mock runner to test more actions features.

(cherry picked from commit df98452c0de9d01338f00aa5d85757623523b1fc)
(cherry picked from commit b18dcd69f2)
2024-12-30 08:26:54 +00:00
Zettat123
2ac9b16297 Support org labels when adding labels by label names (#32988)
Fix #32891

(cherry picked from commit 44b4fb21a4e99f327303f66cc7e48f7ca7ba09e1)
(cherry picked from commit 92ac337263)
2024-12-30 08:26:54 +00:00
Lunny Xiao
2bcbfbc5d4 demilestone should not include milestone (#32923)
Fix #32887

(cherry picked from commit f44712f22bc7bfce049c64c27f60453ff1e41a5c)

Conflicts:
	services/issue/milestone_test.go
  trivial conflicts (require vs assert)
(cherry picked from commit 2ffa9a5e6e)
2024-12-30 08:26:54 +00:00
katsu
4999de50c3 fix trailing comma not matched in the case of alphanumeric issue (#32945)
Fix #32428.

Patch the regex to match `,`besides `.` `"` `'` `:` and space.

(cherry picked from commit fb75151fb14e866cab8d893c588f5673902b278b)
(cherry picked from commit 0efd7130f0)
2024-12-30 08:26:54 +00:00
Earl Warren
eb00a80efc Merge pull request '[v10.0/forgejo] Rework new repo dialog' (#6399) from bp-v10.0/forgejo-471e5b1-8159915-4cde569-8d32ca3-8d829a9 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6399
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-12-29 20:49:03 +00:00
Earl Warren
c7c22aae8c Merge pull request '[v10.0/forgejo] fix: xorm needs to be lowercase otherwise it is ignored' (#6406) from bp-v10.0/forgejo-b03ecf5 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6406
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-12-29 20:09:11 +00:00
Gusted
0eab84d02e Merge pull request '[v10.0/forgejo] feat: When comparing in repos, mention that pull request creation requires sign-in' (#6398) from bp-v10.0/forgejo-dd4a110 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6398
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-12-29 18:40:10 +00:00
Earl Warren
e71fd7d28d fix: xorm needs to be lowercase otherwise it is ignored
Fixes: https://codeberg.org/forgejo/forgejo/issues/6389
(cherry picked from commit b03ecf584c)
2024-12-29 18:27:08 +00:00
Gusted
055348430e Merge pull request '[v10.0/forgejo] Cosmetic changes and fixes around repo homepage' (#6402) from bp-v10.0/forgejo-02c34f9 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6402
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-12-29 18:27:01 +00:00
0ko
440be42baf ui: cosmetic changes and fixes around repo homepage
(cherry picked from commit 02c34f9908)
2024-12-29 14:47:11 +00:00
Otto Richter
f1b98d16c7 tests(e2e): Test new repo dialog and behaviour
- screenshots and basic accessibility scan of collapsed and expanded sections
  - the dropdowns do not pass the accessibility checks, but I haven't found an easy fix
  - I manually confirmed the dropdown behaviour via orca and firefox, though

(cherry picked from commit 8d829a97b2)
2024-12-29 13:23:30 +00:00
Otto Richter
662b385596 New repo: Rework initialization
- only show settings when ticked
- only offer README selection when there are multiple options

(cherry picked from commit 8d32ca32c2)
2024-12-29 13:23:30 +00:00
Otto Richter
023aaef2b9 New repo: Rework advanced and template sections
- make sections collapsible
- only offer object format selection when there is an actual choice

(cherry picked from commit 4cde56906e)
2024-12-29 13:23:30 +00:00
Otto Richter
cb745a771a New repo: Rework basic settings
- separate template
- ensure correct labelling of elements
- drop additional required indicators for field that already have
  browser semantics (the icon has colour contrast issues anyway),
especially as the first dropdown cannot be left empty

(cherry picked from commit 81599155e8)
2024-12-29 13:23:30 +00:00
Otto Richter
38d2933cc1 New repo: Clean up and improve CSS
- drop custom layout rules for this page
- move form-related content to form.css
- extend new form CSS to add gap between labels and input fields

(cherry picked from commit 471e5b1975)
2024-12-29 13:23:30 +00:00
Litchi Pi
5a0c79e6b4 template: repo: compare: display a warning if the user is not logged in
Signed-off-by: Litchi Pi <litchi.pi@proton.me>
(cherry picked from commit dd4a1107ed)
2024-12-29 12:52:49 +00:00
Earl Warren
424f85304e Merge pull request '[v10.0/forgejo] Fix overflow in git notes' (#6392) from bp-v10.0/forgejo-dcdeb23 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6392
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-28 21:17:42 +00:00
JakobDev
382db9e8de Fix overflow in git notes
(cherry picked from commit dcdeb23cc3)
2024-12-28 20:44:10 +00:00
Earl Warren
0ff66fa3bb Merge pull request 'Revert "Update dependency idiomorph to v0.4.0"' (#6382) from gusted/forgejo-idiomorph-rever-v10 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6382
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-27 06:43:17 +00:00
Gusted
d5c5724f44
Revert "Update dependency idiomorph to v0.4.0"
This reverts commit f9aaefd107.

I've not not yet been able to determine what commit caused it, but 0.4.0
is broken for Forgejo's usecase it's not morphing and instead
replacing (it seems) elements when there's no need to.

(cherry picked from commit 64deec434a)
2024-12-27 03:04:25 +01:00
forgejo-backport-action
1da56f0eb8 [v10.0/forgejo] i18n: update of translations from Codeberg Translate (#6377)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6331

Translations update from [Codeberg Translate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

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

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

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Localization
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/6331): <!--number 6331 --><!--line 0 --><!--description aTE4bjogdXBkYXRlIG9mIHRyYW5zbGF0aW9ucyBmcm9tIENvZGViZXJnIFRyYW5zbGF0ZQ==-->i18n: update of translations from Codeberg Translate<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6377
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2024-12-26 09:57:35 +00:00
Earl Warren
6a78a71172 Merge pull request '[v10.0/forgejo] chore(i18n): user/label translations in danish/latvian' (#6376) from bp-v10.0/forgejo-5eb0877 into v10.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6376
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-12-26 09:14:28 +00:00
Earl Warren
f6c442c2fe chore(i18n): user/label translations in danish/latvian
Refs: https://codeberg.org/forgejo/forgejo/pulls/6331
(cherry picked from commit 5eb0877381)
2024-12-26 08:58:09 +00:00
2573 changed files with 24733 additions and 42936 deletions

View file

@ -1,7 +1,7 @@
forgejo.org/cmd code.gitea.io/gitea/cmd
NoMainListener NoMainListener
forgejo.org/cmd/forgejo code.gitea.io/gitea/cmd/forgejo
ContextSetNoInit ContextSetNoInit
ContextSetNoExit ContextSetNoExit
ContextSetStderr ContextSetStderr
@ -9,94 +9,128 @@ forgejo.org/cmd/forgejo
ContextSetStdout ContextSetStdout
ContextSetStdin ContextSetStdin
forgejo.org/models code.gitea.io/gitea/models
IsErrUpdateTaskNotExist
ErrUpdateTaskNotExist.Error
ErrUpdateTaskNotExist.Unwrap
IsErrSHANotFound IsErrSHANotFound
IsErrMergeDivergingFastForwardOnly IsErrMergeDivergingFastForwardOnly
forgejo.org/models/auth code.gitea.io/gitea/models/actions
ScheduleList.GetUserIDs
ScheduleList.GetRepoIDs
ScheduleList.LoadTriggerUser
ScheduleList.LoadRepos
code.gitea.io/gitea/models/asymkey
ErrGPGKeyAccessDenied.Error
ErrGPGKeyAccessDenied.Unwrap
HasDeployKey
code.gitea.io/gitea/models/auth
GetSourceByName
WebAuthnCredentials WebAuthnCredentials
forgejo.org/models/db code.gitea.io/gitea/models/db
TruncateBeans TruncateBeans
InTransaction InTransaction
DumpTables DumpTables
forgejo.org/models/dbfs code.gitea.io/gitea/models/dbfs
file.renameTo file.renameTo
Create Create
Rename Rename
forgejo.org/models/forgefed code.gitea.io/gitea/models/forgefed
GetFederationHost GetFederationHost
forgejo.org/models/forgejo/semver code.gitea.io/gitea/models/forgejo/semver
GetVersion GetVersion
SetVersionString SetVersionString
SetVersion SetVersion
forgejo.org/models/git code.gitea.io/gitea/models/git
RemoveDeletedBranchByID RemoveDeletedBranchByID
forgejo.org/models/issues code.gitea.io/gitea/models/issues
IsErrUnknownDependencyType IsErrUnknownDependencyType
ErrNewIssueInsert.Error
IsErrIssueWasClosed IsErrIssueWasClosed
ChangeMilestoneStatus
forgejo.org/models/organization code.gitea.io/gitea/models/organization
GetTeamNamesByID
UpdateTeamUnits
SearchMembersOptions.ToConds SearchMembersOptions.ToConds
UsersInTeamsCount
forgejo.org/models/perm/access code.gitea.io/gitea/models/perm/access
GetRepoWriters GetRepoWriters
forgejo.org/models/repo code.gitea.io/gitea/models/project
UpdateColumnSorting
ChangeProjectStatus
code.gitea.io/gitea/models/repo
DeleteAttachmentsByIssue
FindReposMapByIDs
IsErrTopicNotExist
ErrTopicNotExist.Error
ErrTopicNotExist.Unwrap
GetTopicByName
WatchRepoMode WatchRepoMode
forgejo.org/models/user code.gitea.io/gitea/models/user
ErrUserInactive.Error
ErrUserInactive.Unwrap
IsErrExternalLoginUserAlreadyExist IsErrExternalLoginUserAlreadyExist
IsErrExternalLoginUserNotExist IsErrExternalLoginUserNotExist
NewFederatedUser NewFederatedUser
IsErrUserSettingIsNotExist IsErrUserSettingIsNotExist
GetUserAllSettings GetUserAllSettings
DeleteUserSetting DeleteUserSetting
GetUserEmailsByNames
GetUserNamesByIDs
forgejo.org/modules/activitypub code.gitea.io/gitea/modules/activitypub
NewContext NewContext
Context.APClientFactory Context.APClientFactory
forgejo.org/modules/assetfs code.gitea.io/gitea/modules/assetfs
Bindata Bindata
forgejo.org/modules/auth/password/hash code.gitea.io/gitea/modules/auth/password/hash
DummyHasher.HashWithSaltBytes DummyHasher.HashWithSaltBytes
NewDummyHasher NewDummyHasher
forgejo.org/modules/auth/password/pwn code.gitea.io/gitea/modules/auth/password/pwn
WithHTTP WithHTTP
forgejo.org/modules/base code.gitea.io/gitea/modules/base
SetupGiteaRoot SetupGiteaRoot
forgejo.org/modules/cache code.gitea.io/gitea/modules/cache
GetInt GetInt
WithNoCacheContext WithNoCacheContext
RemoveContextData RemoveContextData
forgejo.org/modules/emoji code.gitea.io/gitea/modules/charset
BreakWriter.Write
code.gitea.io/gitea/modules/emoji
ReplaceCodes ReplaceCodes
forgejo.org/modules/eventsource code.gitea.io/gitea/modules/eventsource
Event.String Event.String
forgejo.org/modules/forgefed code.gitea.io/gitea/modules/forgefed
NewForgeUndoLike
ForgeUndoLike.UnmarshalJSON
ForgeUndoLike.Validate
GetItemByType GetItemByType
JSONUnmarshalerFn JSONUnmarshalerFn
NotEmpty NotEmpty
ToRepository ToRepository
OnRepository OnRepository
forgejo.org/modules/git code.gitea.io/gitea/modules/git
AllowLFSFiltersArgs AllowLFSFiltersArgs
AddChanges AddChanges
AddChangesWithArgs AddChangesWithArgs
@ -104,57 +138,71 @@ forgejo.org/modules/git
CommitChangesWithArgs CommitChangesWithArgs
SetUpdateHook SetUpdateHook
openRepositoryWithDefaultContext openRepositoryWithDefaultContext
IsTagExist
ToEntryMode ToEntryMode
LimitedReaderCloser.Read
LimitedReaderCloser.Close
forgejo.org/modules/gitrepo code.gitea.io/gitea/modules/gitgraph
Parser.Reset
code.gitea.io/gitea/modules/gitrepo
GetBranchCommitID GetBranchCommitID
GetWikiDefaultBranch GetWikiDefaultBranch
forgejo.org/modules/graceful code.gitea.io/gitea/modules/graceful
Manager.TerminateContext Manager.TerminateContext
Manager.Err Manager.Err
Manager.Value Manager.Value
Manager.Deadline Manager.Deadline
forgejo.org/modules/hcaptcha code.gitea.io/gitea/modules/hcaptcha
WithHTTP WithHTTP
forgejo.org/modules/hostmatcher code.gitea.io/gitea/modules/hostmatcher
HostMatchList.AppendPattern HostMatchList.AppendPattern
forgejo.org/modules/json code.gitea.io/gitea/modules/json
StdJSON.Marshal StdJSON.Marshal
StdJSON.Unmarshal StdJSON.Unmarshal
StdJSON.NewEncoder StdJSON.NewEncoder
StdJSON.NewDecoder StdJSON.NewDecoder
StdJSON.Indent StdJSON.Indent
forgejo.org/modules/log code.gitea.io/gitea/modules/markup
NewEventWriterBuffer
forgejo.org/modules/markup
GetRendererByType GetRendererByType
RenderString RenderString
IsMarkupFile IsMarkupFile
forgejo.org/modules/markup/console code.gitea.io/gitea/modules/markup/console
Render Render
RenderString RenderString
forgejo.org/modules/markup/markdown code.gitea.io/gitea/modules/markup/markdown
IsDetails
IsSummary
IsTaskCheckBoxListItem
IsIcon
RenderRawString RenderRawString
forgejo.org/modules/markup/mdstripper code.gitea.io/gitea/modules/markup/markdown/math
WithInlineDollarParser
WithBlockDollarParser
code.gitea.io/gitea/modules/markup/mdstripper
stripRenderer.AddOptions stripRenderer.AddOptions
StripMarkdown StripMarkdown
forgejo.org/modules/markup/orgmode code.gitea.io/gitea/modules/markup/orgmode
RenderString RenderString
forgejo.org/modules/process code.gitea.io/gitea/modules/private
ActionsRunnerRegister
code.gitea.io/gitea/modules/process
Manager.ExecTimeout Manager.ExecTimeout
forgejo.org/modules/queue code.gitea.io/gitea/modules/queue
newBaseChannelSimple newBaseChannelSimple
newBaseChannelUnique newBaseChannelUnique
newBaseRedisSimple newBaseRedisSimple
@ -163,71 +211,89 @@ forgejo.org/modules/queue
testStateRecorder.Reset testStateRecorder.Reset
newWorkerPoolQueueForTest newWorkerPoolQueueForTest
forgejo.org/modules/queue/lqinternal code.gitea.io/gitea/modules/queue/lqinternal
QueueItemIDBytes QueueItemIDBytes
QueueItemKeyBytes QueueItemKeyBytes
ListLevelQueueKeys ListLevelQueueKeys
forgejo.org/modules/setting code.gitea.io/gitea/modules/setting
NewConfigProviderFromData NewConfigProviderFromData
GitConfigType.GetOption GitConfigType.GetOption
InitLoggersForTest InitLoggersForTest
forgejo.org/modules/sync code.gitea.io/gitea/modules/storage
ErrInvalidConfiguration.Error
IsErrInvalidConfiguration
code.gitea.io/gitea/modules/structs
ParseCreateHook
ParsePushHook
code.gitea.io/gitea/modules/sync
StatusTable.Start StatusTable.Start
StatusTable.IsRunning StatusTable.IsRunning
forgejo.org/modules/timeutil code.gitea.io/gitea/modules/timeutil
GetExecutableModTime GetExecutableModTime
MockSet MockSet
MockUnset MockUnset
forgejo.org/modules/translation code.gitea.io/gitea/modules/translation
MockLocale.Language MockLocale.Language
MockLocale.TrString MockLocale.TrString
MockLocale.Tr MockLocale.Tr
MockLocale.TrN MockLocale.TrN
MockLocale.TrPluralString
MockLocale.TrSize MockLocale.TrSize
MockLocale.HasKey
MockLocale.PrettyNumber MockLocale.PrettyNumber
forgejo.org/modules/util code.gitea.io/gitea/modules/util
OptionalArg OptionalArg
forgejo.org/modules/util/filebuffer code.gitea.io/gitea/modules/util/filebuffer
CreateFromReader CreateFromReader
forgejo.org/modules/validation code.gitea.io/gitea/modules/validation
IsErrNotValid IsErrNotValid
forgejo.org/modules/web code.gitea.io/gitea/modules/web
RouteMock RouteMock
RouteMockReset RouteMockReset
forgejo.org/modules/zstd code.gitea.io/gitea/modules/web/middleware
DeleteLocaleCookie
code.gitea.io/gitea/modules/zstd
NewWriter NewWriter
Writer.Write Writer.Write
Writer.Close Writer.Close
forgejo.org/routers/web code.gitea.io/gitea/routers/web
NotFound NotFound
forgejo.org/routers/web/org code.gitea.io/gitea/routers/web/org
MustEnableProjects MustEnableProjects
forgejo.org/services/context code.gitea.io/gitea/services/context
GetPrivateContext GetPrivateContext
forgejo.org/services/repository code.gitea.io/gitea/services/convert
ToSecret
code.gitea.io/gitea/services/forms
DeadlineForm.Validate
code.gitea.io/gitea/services/pull
IsCommitStatusContextSuccess
code.gitea.io/gitea/services/repository
IsErrForkAlreadyExist IsErrForkAlreadyExist
forgejo.org/services/repository/files code.gitea.io/gitea/services/repository/files
ContentType.String ContentType.String
GetFileResponseFromCommit
TemporaryUploadRepository.GetLastCommit
TemporaryUploadRepository.GetLastCommitByRef
forgejo.org/services/repository/gitgraph code.gitea.io/gitea/services/webhook
Parser.Reset
forgejo.org/services/webhook
NewNotifier NewNotifier

View file

@ -1,6 +1,6 @@
{ {
"name": "Gitea DevContainer", "name": "Gitea DevContainer",
"image": "mcr.microsoft.com/devcontainers/go:1.24-bullseye", "image": "mcr.microsoft.com/devcontainers/go:1.23-bullseye",
"features": { "features": {
// installs nodejs into container // installs nodejs into container
"ghcr.io/devcontainers/features/node:1": { "ghcr.io/devcontainers/features/node:1": {

View file

@ -34,7 +34,6 @@ _testmain.go
*coverage.out *coverage.out
coverage.all coverage.all
coverage/
cpu.out cpu.out
/modules/migration/bindata.go /modules/migration/bindata.go

View file

@ -26,8 +26,3 @@ insert_final_newline = false
[options/locale/locale_*.ini] [options/locale/locale_*.ini]
insert_final_newline = false insert_final_newline = false
# Weblate JSON output defaults to four spaces
[options/locale_next/locale_*.json]
indent_style = space
indent_size = 4

View file

@ -1,4 +1,4 @@
FROM data.forgejo.org/oci/alpine:3.21 FROM data.forgejo.org/oci/alpine:3.20
ARG RELEASE_VERSION=unkown ARG RELEASE_VERSION=unkown
LABEL maintainer="contact@forgejo.org" \ LABEL maintainer="contact@forgejo.org" \
org.opencontainers.image.version="${RELEASE_VERSION}" org.opencontainers.image.version="${RELEASE_VERSION}"

View file

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

View file

@ -27,10 +27,8 @@ runs:
- name: "Get go environment information" - name: "Get go environment information"
id: go-environment id: go-environment
run: | run: |
chmod 755 $HOME # ensure ${RUN_AS_USER} has permission when go is located in $HOME echo "modcache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT"
export GOROOT="$(go env GOROOT)" echo "cache=$(su ${RUN_AS_USER} -c '/opt/hostedtoolcache/go/${GO_VERSION}/x64/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT"
echo "modcache=$(su ${RUN_AS_USER} -c '${GOROOT}/bin/go env GOMODCACHE')" >> "$GITHUB_OUTPUT"
echo "cache=$(su ${RUN_AS_USER} -c '${GOROOT}/bin/go env GOCACHE')" >> "$GITHUB_OUTPUT"
env: env:
RUN_AS_USER: ${{ inputs.username }} RUN_AS_USER: ${{ inputs.username }}
GO_VERSION: ${{ steps.go-version.outputs.go-version }} GO_VERSION: ${{ steps.go-version.outputs.go-version }}

View file

@ -40,7 +40,7 @@ jobs:
) )
runs-on: docker runs-on: docker
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
steps: steps:
- name: event info - name: event info
run: | run: |

View file

@ -45,7 +45,7 @@ jobs:
- uses: https://data.forgejo.org/actions/setup-node@v4 - uses: https://data.forgejo.org/actions/setup-node@v4
with: with:
node-version: 22 node-version: 20
- uses: https://data.forgejo.org/actions/setup-go@v5 - uses: https://data.forgejo.org/actions/setup-go@v5
with: with:
@ -164,7 +164,7 @@ jobs:
- name: build container & release - name: build container & release
if: ${{ secrets.TOKEN != '' }} if: ${{ secrets.TOKEN != '' }}
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.4 uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.1
with: with:
forgejo: "${{ env.GITHUB_SERVER_URL }}" forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}" owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
@ -183,7 +183,7 @@ jobs:
- name: build rootless container - name: build rootless container
if: ${{ secrets.TOKEN != '' }} if: ${{ secrets.TOKEN != '' }}
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.4 uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.3.1
with: with:
forgejo: "${{ env.GITHUB_SERVER_URL }}" forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}" owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"

View file

@ -35,7 +35,7 @@ jobs:
) )
runs-on: docker runs-on: docker
container: container:
image: data.forgejo.org/oci/node:22-bookworm image: data.forgejo.org/oci/node:20-bookworm
steps: steps:
- uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/checkout@v4
with: with:

View file

@ -9,7 +9,7 @@ jobs:
if: vars.ROLE == 'forgejo-integration' if: vars.ROLE == 'forgejo-integration'
runs-on: docker runs-on: docker
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
steps: steps:
- name: apt install curl jq - name: apt install curl jq

View file

@ -16,7 +16,7 @@ jobs:
if: vars.ROLE == 'forgejo-coding' if: vars.ROLE == 'forgejo-coding'
runs-on: docker runs-on: docker
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
steps: steps:
- name: Debug output - name: Debug output
run: | run: |

View file

@ -11,7 +11,7 @@ jobs:
if: ${{ secrets.MIRROR_TOKEN != '' }} if: ${{ secrets.MIRROR_TOKEN != '' }}
runs-on: docker runs-on: docker
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
steps: steps:
- name: git push {v*/,}forgejo - name: git push {v*/,}forgejo
run: | run: |

View file

@ -2,8 +2,6 @@
# #
# See also https://forgejo.org/docs/next/contributor/release/#stable-release-process # 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 # https://codeberg.org/forgejo-experimental/forgejo
# #
# Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental # Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental
@ -16,7 +14,7 @@
# vars.DOER: forgejo-experimental-ci # vars.DOER: forgejo-experimental-ci
# secrets.TOKEN: <generated from codeberg.org/forgejo-experimental-ci> # secrets.TOKEN: <generated from codeberg.org/forgejo-experimental-ci>
# #
# http://invisible.forgejo.org/forgejo/forgejo # http://private.forgejo.org/forgejo/forgejo
# #
# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo # Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo
# #
@ -44,7 +42,7 @@ jobs:
- uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/checkout@v4
- name: copy & sign - name: copy & sign
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/publish@v5.3.4 uses: https://data.forgejo.org/forgejo/forgejo-build-publish/publish@v5.3.1
with: with:
from-forgejo: ${{ vars.FORGEJO }} from-forgejo: ${{ vars.FORGEJO }}
to-forgejo: ${{ vars.FORGEJO }} to-forgejo: ${{ vars.FORGEJO }}
@ -63,14 +61,14 @@ jobs:
- name: get trigger mirror issue - name: get trigger mirror issue
id: mirror id: mirror
uses: https://data.forgejo.org/infrastructure/issue-action/get@v1.3.0 uses: https://data.forgejo.org/infrastructure/issue-action/get@v1.1.0
with: with:
forgejo: https://code.forgejo.org forgejo: https://code.forgejo.org
repository: forgejo/forgejo repository: forgejo/forgejo
labels: mirror-trigger labels: mirror-trigger
- name: trigger the mirror - name: trigger the mirror
uses: https://data.forgejo.org/infrastructure/issue-action/set@v1.3.0 uses: https://data.forgejo.org/infrastructure/issue-action/set@v1.1.0
with: with:
forgejo: https://code.forgejo.org forgejo: https://code.forgejo.org
repository: forgejo/forgejo repository: forgejo/forgejo
@ -82,7 +80,7 @@ jobs:
- name: upgrade v*.next.forgejo.org - name: upgrade v*.next.forgejo.org
uses: https://data.forgejo.org/infrastructure/next-digest@v1.1.0 uses: https://data.forgejo.org/infrastructure/next-digest@v1.1.0
with: with:
url: https://placeholder:${{ secrets.TOKEN_NEXT_DIGEST }}@invisible.forgejo.org/infrastructure/next-digest url: https://placeholder:${{ secrets.TOKEN_NEXT_DIGEST }}@code.forgejo.org/infrastructure/next-digest
ref_name: '${{ github.ref_name }}' ref_name: '${{ github.ref_name }}'
image: 'codeberg.org/forgejo-experimental/forgejo' image: 'codeberg.org/forgejo-experimental/forgejo'
tag_suffix: '-rootless' tag_suffix: '-rootless'

View file

@ -9,7 +9,7 @@ jobs:
if: vars.ROLE == 'forgejo-coding' if: vars.ROLE == 'forgejo-coding'
runs-on: docker runs-on: docker
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
steps: steps:
- uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/checkout@v4

View file

@ -12,7 +12,7 @@ jobs:
if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note') if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note')
runs-on: docker runs-on: docker
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
steps: steps:
- uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/checkout@v4

View file

@ -18,9 +18,6 @@ on:
env: env:
RENOVATE_DRY_RUN: ${{ (github.event_name != 'schedule' && github.ref_name != github.event.repository.default_branch) && 'full' || '' }} RENOVATE_DRY_RUN: ${{ (github.event_name != 'schedule' && github.ref_name != github.event.repository.default_branch) && 'full' || '' }}
RENOVATE_REPOSITORIES: ${{ github.repository }} 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
jobs: jobs:
renovate: renovate:
@ -28,7 +25,7 @@ jobs:
runs-on: docker runs-on: docker
container: container:
image: data.forgejo.org/renovate/renovate:39.212.0 image: data.forgejo.org/forgejo-contrib/renovate:39.69.2
steps: steps:
- name: Load renovate repo cache - name: Load renovate repo cache

View file

@ -12,7 +12,7 @@ jobs:
backend-checks: backend-checks:
runs-on: docker runs-on: docker
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
options: --tmpfs /tmp:exec,noatime options: --tmpfs /tmp:exec,noatime
steps: steps:
- name: event info - name: event info
@ -23,12 +23,12 @@ jobs:
- uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/checkout@v4
- uses: ./.forgejo/workflows-composite/setup-env - uses: ./.forgejo/workflows-composite/setup-env
- run: su forgejo -c 'make deps-backend deps-tools' - run: su forgejo -c 'make deps-backend deps-tools'
- run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check lint-swagger fmt-check swagger-validate' # ensure the "go-licenses" make target runs - run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check fmt-check swagger-validate' # ensure the "go-licenses" make target runs
- uses: ./.forgejo/workflows-composite/build-backend - uses: ./.forgejo/workflows-composite/build-backend
frontend-checks: frontend-checks:
runs-on: docker runs-on: docker
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
options: --tmpfs /tmp:exec,noatime options: --tmpfs /tmp:exec,noatime
steps: steps:
- uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/checkout@v4
@ -53,7 +53,7 @@ jobs:
runs-on: docker runs-on: docker
needs: [backend-checks, frontend-checks] needs: [backend-checks, frontend-checks]
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
options: --tmpfs /tmp:exec,noatime options: --tmpfs /tmp:exec,noatime
services: services:
elasticsearch: elasticsearch:
@ -136,7 +136,7 @@ jobs:
runs-on: docker runs-on: docker
needs: [backend-checks, frontend-checks, test-unit] needs: [backend-checks, frontend-checks, test-unit]
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
options: --tmpfs /tmp:exec,noatime options: --tmpfs /tmp:exec,noatime
name: ${{ format('test-remote-cacher ({0})', matrix.cacher.name) }} name: ${{ format('test-remote-cacher ({0})', matrix.cacher.name) }}
strategy: strategy:
@ -177,7 +177,7 @@ jobs:
runs-on: docker runs-on: docker
needs: [backend-checks, frontend-checks] needs: [backend-checks, frontend-checks]
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
options: --tmpfs /tmp:exec,noatime options: --tmpfs /tmp:exec,noatime
services: services:
mysql: mysql:
@ -206,7 +206,7 @@ jobs:
runs-on: docker runs-on: docker
needs: [backend-checks, frontend-checks] needs: [backend-checks, frontend-checks]
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
options: --tmpfs /tmp:exec,noatime options: --tmpfs /tmp:exec,noatime
services: services:
minio: minio:
@ -218,7 +218,7 @@ jobs:
ldap: ldap:
image: data.forgejo.org/oci/test-openldap:latest image: data.forgejo.org/oci/test-openldap:latest
pgsql: pgsql:
image: data.forgejo.org/oci/bitnami/postgresql:16 image: data.forgejo.org/oci/bitnami/postgresql:15
env: env:
POSTGRESQL_DATABASE: test POSTGRESQL_DATABASE: test
POSTGRESQL_PASSWORD: postgres POSTGRESQL_PASSWORD: postgres
@ -243,7 +243,7 @@ jobs:
runs-on: docker runs-on: docker
needs: [backend-checks, frontend-checks] needs: [backend-checks, frontend-checks]
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
options: --tmpfs /tmp:exec,noatime options: --tmpfs /tmp:exec,noatime
steps: steps:
- uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/checkout@v4
@ -267,7 +267,7 @@ jobs:
- test-pgsql - test-pgsql
- test-mysql - test-mysql
container: container:
image: 'data.forgejo.org/oci/node:22-bookworm' image: 'data.forgejo.org/oci/node:20-bookworm'
options: --tmpfs /tmp:exec,noatime options: --tmpfs /tmp:exec,noatime
steps: steps:
- uses: https://data.forgejo.org/actions/checkout@v4 - uses: https://data.forgejo.org/actions/checkout@v4

2
.gitignore vendored
View file

@ -37,7 +37,6 @@ _testmain.go
*coverage.out *coverage.out
coverage.all coverage.all
coverage/
cpu.out cpu.out
/modules/migration/bindata.go /modules/migration/bindata.go
@ -57,7 +56,6 @@ cpu.out
/gitea-vet /gitea-vet
/debug /debug
/integrations.test /integrations.test
/forgejo
/bin /bin
/dist /dist

View file

@ -19,12 +19,12 @@ linters:
- revive - revive
- staticcheck - staticcheck
- stylecheck - stylecheck
- tenv
- testifylint - testifylint
- typecheck - typecheck
- unconvert - unconvert
- unused - unused
- unparam - unparam
- usetesting
- wastedassign - wastedassign
run: run:
@ -93,7 +93,7 @@ linters-settings:
desc: use os or io instead desc: use os or io instead
- pkg: golang.org/x/exp - pkg: golang.org/x/exp
desc: it's experimental and unreliable desc: it's experimental and unreliable
- pkg: forgejo.org/modules/git/internal - pkg: code.gitea.io/gitea/modules/git/internal
desc: do not use the internal package, use AddXxx function instead desc: do not use the internal package, use AddXxx function instead
- pkg: gopkg.in/ini.v1 - pkg: gopkg.in/ini.v1
desc: do not use the ini package, use gitea's config system instead desc: do not use the ini package, use gitea's config system instead

View file

@ -33,9 +33,8 @@ models/.* @gusted
# for code that lives in here. # for code that lives in here.
routers/.* @gusted routers/.* @gusted
# Let locale changes be checked by the translation team. # Let new strings be checked by the translation team.
options/locale/.* @0ko options/locale/locale_en-US.ini @0ko
options/locale_next/.* @0ko
# Personal interest # Personal interest
.*/webhook.* @oliverpool .*/webhook.* @oliverpool

View file

@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx 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 FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.23-alpine3.20 as build-env
ARG GOPROXY ARG GOPROXY
ENV GOPROXY=${GOPROXY:-direct} ENV GOPROXY=${GOPROXY:-direct}
@ -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 RUN apk --no-cache add build-base git nodejs npm
COPY . ${GOPATH}/src/forgejo.org COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/forgejo.org WORKDIR ${GOPATH}/src/code.gitea.io/gitea
RUN make clean RUN make clean
RUN make frontend RUN make frontend
@ -47,11 +47,11 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \
/tmp/local/etc/s6/gitea/* \ /tmp/local/etc/s6/gitea/* \
/tmp/local/etc/s6/openssh/* \ /tmp/local/etc/s6/openssh/* \
/tmp/local/etc/s6/.s6-svscan/* \ /tmp/local/etc/s6/.s6-svscan/* \
/go/src/forgejo.org/gitea \ /go/src/code.gitea.io/gitea/gitea \
/go/src/forgejo.org/environment-to-ini /go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
FROM data.forgejo.org/oci/alpine:3.21 FROM data.forgejo.org/oci/alpine:3.20
ARG RELEASE_VERSION ARG RELEASE_VERSION
LABEL maintainer="contact@forgejo.org" \ LABEL maintainer="contact@forgejo.org" \
org.opencontainers.image.authors="Forgejo" \ org.opencontainers.image.authors="Forgejo" \
@ -99,11 +99,11 @@ ENV GITEA_CUSTOM=/data/gitea
VOLUME ["/data"] VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"] ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/usr/bin/s6-svscan", "/etc/s6"] CMD ["/bin/s6-svscan", "/etc/s6"]
COPY --from=build-env /tmp/local / COPY --from=build-env /tmp/local /
RUN cd /usr/local/bin ; ln -s gitea forgejo RUN cd /usr/local/bin ; ln -s gitea forgejo
COPY --from=build-env /go/src/forgejo.org/gitea /app/gitea/gitea COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli
COPY --from=build-env /go/src/forgejo.org/environment-to-ini /usr/local/bin/environment-to-ini 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/forgejo.org/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh

View file

@ -1,6 +1,6 @@
FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx 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 FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.23-alpine3.20 as build-env
ARG GOPROXY ARG GOPROXY
ENV GOPROXY=${GOPROXY:-direct} ENV GOPROXY=${GOPROXY:-direct}
@ -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 RUN apk --no-cache add build-base git nodejs npm
COPY . ${GOPATH}/src/forgejo.org COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/forgejo.org WORKDIR ${GOPATH}/src/code.gitea.io/gitea
RUN make clean RUN make clean
RUN make frontend RUN make frontend
@ -45,12 +45,11 @@ COPY docker/rootless /tmp/local
RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \ RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
/tmp/local/usr/local/bin/docker-setup.sh \ /tmp/local/usr/local/bin/docker-setup.sh \
/tmp/local/usr/local/bin/gitea \ /tmp/local/usr/local/bin/gitea \
/go/src/forgejo.org/gitea \ /go/src/code.gitea.io/gitea/gitea \
/go/src/forgejo.org/environment-to-ini /go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/forgejo.org/contrib/autocompletion/bash_autocomplete RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
FROM data.forgejo.org/oci/alpine:3.21 FROM data.forgejo.org/oci/alpine:3.20
ARG RELEASE_VERSION
LABEL maintainer="contact@forgejo.org" \ LABEL maintainer="contact@forgejo.org" \
org.opencontainers.image.authors="Forgejo" \ org.opencontainers.image.authors="Forgejo" \
org.opencontainers.image.url="https://forgejo.org" \ org.opencontainers.image.url="https://forgejo.org" \
@ -72,7 +71,6 @@ RUN apk --no-cache add \
git \ git \
curl \ curl \
gnupg \ gnupg \
openssh-client \
git-annex \ git-annex \
&& rm -rf /var/cache/apk/* && rm -rf /var/cache/apk/*
@ -92,10 +90,10 @@ RUN chown git:git /var/lib/gitea /etc/gitea
COPY --from=build-env /tmp/local / COPY --from=build-env /tmp/local /
RUN cd /usr/local/bin ; ln -s gitea forgejo RUN cd /usr/local/bin ; ln -s gitea forgejo
COPY --from=build-env --chown=root:root /go/src/forgejo.org/gitea /app/gitea/gitea COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli RUN ln -s /app/gitea/gitea /app/gitea/forgejo-cli
COPY --from=build-env --chown=root:root /go/src/forgejo.org/environment-to-ini /usr/local/bin/environment-to-ini 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/forgejo.org/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
#git:git #git:git
USER 1000:1000 USER 1000:1000

114
Makefile
View file

@ -16,7 +16,7 @@ else
DIST := dist DIST := dist
DIST_DIRS := $(DIST)/binaries $(DIST)/release DIST_DIRS := $(DIST)/binaries $(DIST)/release
IMPORT := forgejo.org IMPORT := code.gitea.io/gitea
GO ?= $(shell go env GOROOT)/bin/go GO ?= $(shell go env GOROOT)/bin/go
SHASUM ?= shasum -a 256 SHASUM ?= shasum -a 256
@ -37,19 +37,19 @@ endif
XGO_VERSION := go-1.21.x XGO_VERSION := go-1.21.x
AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go 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 EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.0.3 # renovate: datasource=go
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.7.0 # 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 GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2 # renovate: datasource=go
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # 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 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 SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # renovate: datasource=go
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0 # renovate: datasource=go 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 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 DEADCODE_PACKAGE ?= golang.org/x/tools/cmd/deadcode@v0.28.0 # renovate: datasource=go
GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.4.0 # renovate: datasource=go GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.4.0 # renovate: datasource=go
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.18.1 # renovate: datasource=go GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.17.0 # renovate: datasource=go
RENOVATE_NPM_PACKAGE ?= renovate@39.212.0 # renovate: datasource=docker packageName=data.forgejo.org/renovate/renovate RENOVATE_NPM_PACKAGE ?= renovate@39.82.1 # renovate: datasource=docker packageName=code.forgejo.org/forgejo-contrib/renovate
# https://github.com/disposable-email-domains/disposable-email-domains/commits/main/ # https://github.com/disposable-email-domains/disposable-email-domains/commits/main/
DISPOSABLE_EMAILS_SHA ?= 0c27e671231d27cf66370034d7f6818037416989 # renovate: ... DISPOSABLE_EMAILS_SHA ?= 0c27e671231d27cf66370034d7f6818037416989 # renovate: ...
@ -59,8 +59,20 @@ ifeq ($(HAS_GO), yes)
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS) CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
endif endif
GOFLAGS := -v ifeq ($(GOOS),windows)
EXECUTABLE ?= gitea IS_WINDOWS := yes
else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
ifeq ($(GOOS),)
IS_WINDOWS := yes
endif
endif
ifeq ($(IS_WINDOWS),yes)
GOFLAGS := -v -buildmode=exe
EXECUTABLE ?= gitea.exe
else
GOFLAGS := -v
EXECUTABLE ?= gitea
endif
ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu) ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu)
SED_INPLACE := sed -i SED_INPLACE := sed -i
@ -115,20 +127,15 @@ FORGEJO_VERSION_API ?= ${FORGEJO_VERSION}
show-version-api: show-version-api:
@echo ${FORGEJO_VERSION_API} @echo ${FORGEJO_VERSION_API}
# Strip binaries by default to reduce size, allow overriding for debugging
STRIP ?= 1
ifeq ($(STRIP),1)
LDFLAGS := $(LDFLAGS) -s -w
endif
LDFLAGS := $(LDFLAGS) -X "main.ReleaseVersion=$(RELEASE_VERSION)" -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(FORGEJO_VERSION)" -X "main.Tags=$(TAGS)" -X "main.ForgejoVersion=$(FORGEJO_VERSION_API)" LDFLAGS := $(LDFLAGS) -X "main.ReleaseVersion=$(RELEASE_VERSION)" -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(FORGEJO_VERSION)" -X "main.Tags=$(TAGS)" -X "main.ForgejoVersion=$(FORGEJO_VERSION_API)"
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64 LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
ifeq ($(HAS_GO), yes) ifeq ($(HAS_GO), yes)
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 ./...)) 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 ./...))
endif endif
REMOTE_CACHER_MODULES ?= cache nosql session queue REMOTE_CACHER_MODULES ?= cache nosql session queue
GO_TEST_REMOTE_CACHER_PACKAGES ?= $(addprefix forgejo.org/modules/,$(REMOTE_CACHER_MODULES)) GO_TEST_REMOTE_CACHER_PACKAGES ?= $(addprefix code.gitea.io/gitea/modules/,$(REMOTE_CACHER_MODULES))
FOMANTIC_WORK_DIR := web_src/fomantic FOMANTIC_WORK_DIR := web_src/fomantic
@ -161,7 +168,7 @@ GO_DIRS := build cmd models modules routers services tests
WEB_DIRS := web_src/js web_src/css WEB_DIRS := web_src/js web_src/css
STYLELINT_FILES := web_src/css web_src/js/components/*.vue STYLELINT_FILES := web_src/css web_src/js/components/*.vue
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(wildcard *.go *.js *.ts *.vue *.md *.yml *.yaml) SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(wildcard *.go *.js *.ts *.vue *.md *.yml *.yaml *.toml)
GO_SOURCES := $(wildcard *.go) GO_SOURCES := $(wildcard *.go)
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go) GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go)
@ -169,7 +176,7 @@ GO_SOURCES += $(GENERATED_GO_DEST)
GO_SOURCES_NO_BINDATA := $(GO_SOURCES) GO_SOURCES_NO_BINDATA := $(GO_SOURCES)
ifeq ($(HAS_GO), yes) ifeq ($(HAS_GO), yes)
MIGRATION_PACKAGES := $(shell $(GO) list forgejo.org/models/migrations/... forgejo.org/models/forgejo_migrations/...) MIGRATION_PACKAGES := $(shell $(GO) list code.gitea.io/gitea/models/migrations/... code.gitea.io/gitea/models/forgejo_migrations/...)
endif endif
ifeq ($(filter $(TAGS_SPLIT),bindata),bindata) ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
@ -413,22 +420,22 @@ lint-frontend: lint-js lint-css
lint-frontend-fix: lint-js-fix lint-css-fix lint-frontend-fix: lint-js-fix lint-css-fix
.PHONY: lint-backend .PHONY: lint-backend
lint-backend: lint-go lint-go-vet lint-editorconfig lint-renovate lint-locale lint-locale-usage lint-disposable-emails lint-backend: lint-go lint-go-vet lint-editorconfig lint-renovate lint-locale lint-disposable-emails
.PHONY: lint-backend-fix .PHONY: lint-backend-fix
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig lint-disposable-emails-fix lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig lint-disposable-emails-fix
.PHONY: lint-codespell .PHONY: lint-codespell
lint-codespell: deps-py lint-codespell:
@poetry run codespell codespell
.PHONY: lint-codespell-fix .PHONY: lint-codespell-fix
lint-codespell-fix: deps-py lint-codespell-fix:
@poetry run codespell -w codespell -w
.PHONY: lint-codespell-fix-i .PHONY: lint-codespell-fix-i
lint-codespell-fix-i: deps-py lint-codespell-fix-i:
@poetry run codespell -w -i 3 -C 2 codespell -w -i 3 -C 2
.PHONY: lint-js .PHONY: lint-js
lint-js: node_modules lint-js: node_modules
@ -458,11 +465,7 @@ lint-renovate: node_modules
.PHONY: lint-locale .PHONY: lint-locale
lint-locale: lint-locale:
$(GO) run build/lint-locale/lint-locale.go $(GO) run build/lint-locale.go
.PHONY: lint-locale-usage
lint-locale-usage:
$(GO) run build/lint-locale-usage/lint-locale-usage.go --allow-missing-msgids
.PHONY: lint-md .PHONY: lint-md
lint-md: node_modules lint-md: node_modules
@ -476,7 +479,7 @@ lint-spell: lint-codespell
lint-spell-fix: lint-codespell-fix lint-spell-fix: lint-codespell-fix
@go run $(MISSPELL_PACKAGE) -w $(SPELLCHECK_FILES) @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 forgejo.org 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
.PHONY: lint-go .PHONY: lint-go
lint-go: lint-go:
@ -490,6 +493,13 @@ lint-go-fix:
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix $(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix
$(RUN_DEADCODE) > .deadcode-out $(RUN_DEADCODE) > .deadcode-out
# workaround step for the lint-go-windows CI task because 'go run' can not
# have distinct GOOS/GOARCH for its build and run steps
.PHONY: lint-go-windows
lint-go-windows:
@GOOS= GOARCH= $(GO) install $(GOLANGCI_LINT_PACKAGE)
golangci-lint run
.PHONY: lint-go-vet .PHONY: lint-go-vet
lint-go-vet: lint-go-vet:
@echo "Running go vet..." @echo "Running go vet..."
@ -519,7 +529,7 @@ lint-templates: .venv node_modules
.PHONY: lint-yaml .PHONY: lint-yaml
lint-yaml: .venv lint-yaml: .venv
@poetry run yamllint -s . @poetry run yamllint .
.PHONY: security-check .PHONY: security-check
security-check: security-check:
@ -610,7 +620,7 @@ tidy-check: tidy
go-licenses: $(GO_LICENSE_FILE) go-licenses: $(GO_LICENSE_FILE)
$(GO_LICENSE_FILE): go.mod go.sum $(GO_LICENSE_FILE): go.mod go.sum
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --ignore forgejo.org --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null -$(GO) run $(GO_LICENSES_PACKAGE) save . --force --ignore code.gitea.io/gitea --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
$(GO) run build/generate-go-licenses.go $(GO_LICENSE_TMP_DIR) $(GO_LICENSE_FILE) $(GO) run build/generate-go-licenses.go $(GO_LICENSE_TMP_DIR) $(GO_LICENSE_FILE)
@rm -rf $(GO_LICENSE_TMP_DIR) @rm -rf $(GO_LICENSE_TMP_DIR)
@ -740,33 +750,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 GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.cover.sqlite.test -test.coverprofile=integration.coverage.out
integrations.mysql.test: git-check $(GO_SOURCES) integrations.mysql.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.mysql.test $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test
integrations.pgsql.test: git-check $(GO_SOURCES) integrations.pgsql.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.pgsql.test $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test
integrations.sqlite.test: git-check $(GO_SOURCES) integrations.sqlite.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)' $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)'
integrations.cover.test: git-check $(GO_SOURCES) integrations.cover.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test
integrations.cover.sqlite.test: git-check $(GO_SOURCES) integrations.cover.sqlite.test: git-check $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)' $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
.PHONY: migrations.mysql.test .PHONY: migrations.mysql.test
migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.mysql.test $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.mysql.test $(GOTESTCOMPILEDRUNSUFFIX) GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.mysql.test $(GOTESTCOMPILEDRUNSUFFIX)
.PHONY: migrations.pgsql.test .PHONY: migrations.pgsql.test
migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.pgsql.test $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX) GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX)
.PHONY: migrations.sqlite.test .PHONY: migrations.sqlite.test
migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)' $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX) GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX)
.PHONY: migrations.individual.mysql.test .PHONY: migrations.individual.mysql.test
@ -777,7 +787,7 @@ migrations.individual.mysql.test: $(GO_SOURCES)
.PHONY: migrations.individual.sqlite.test\#% .PHONY: migrations.individual.sqlite.test\#%
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$* GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
.PHONY: migrations.individual.pgsql.test .PHONY: migrations.individual.pgsql.test
migrations.individual.pgsql.test: $(GO_SOURCES) migrations.individual.pgsql.test: $(GO_SOURCES)
@ -787,7 +797,7 @@ migrations.individual.pgsql.test: $(GO_SOURCES)
.PHONY: migrations.individual.pgsql.test\#% .PHONY: migrations.individual.pgsql.test\#%
migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$* GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
.PHONY: migrations.individual.sqlite.test .PHONY: migrations.individual.sqlite.test
migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
@ -797,16 +807,16 @@ migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
.PHONY: migrations.individual.sqlite.test\#% .PHONY: migrations.individual.sqlite.test\#%
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' forgejo.org/models/migrations/$* GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
e2e.mysql.test: $(GO_SOURCES) e2e.mysql.test: $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.mysql.test $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test
e2e.pgsql.test: $(GO_SOURCES) e2e.pgsql.test: $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.pgsql.test $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test
e2e.sqlite.test: $(GO_SOURCES) e2e.sqlite.test: $(GO_SOURCES)
$(GOTEST) $(GOTESTFLAGS) -c forgejo.org/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)' $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)'
.PHONY: check .PHONY: check
check: test check: test
@ -817,7 +827,7 @@ check: test
.PHONY: install $(TAGS_PREREQ) .PHONY: install $(TAGS_PREREQ)
install: $(wildcard *.go) install: $(wildcard *.go)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
.PHONY: build .PHONY: build
build: frontend backend build: frontend backend
@ -845,13 +855,13 @@ merge-locales:
@echo "NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY" @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)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
forgejo: $(EXECUTABLE) forgejo: $(EXECUTABLE)
ln -f $(EXECUTABLE) forgejo ln -f $(EXECUTABLE) forgejo
static-executable: $(GO_SOURCES) $(TAGS_PREREQ) static-executable: $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE) CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE)
.PHONY: release .PHONY: release
release: frontend generate release-linux release-copy release-compress vendor release-sources release-check release: frontend generate release-linux release-copy release-compress vendor release-sources release-check
@ -862,6 +872,10 @@ sources-tarbal: frontend generate vendor release-sources release-check
$(DIST_DIRS): $(DIST_DIRS):
mkdir -p $(DIST_DIRS) mkdir -p $(DIST_DIRS)
.PHONY: release-windows
release-windows: | $(DIST_DIRS)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
.PHONY: release-linux .PHONY: release-linux
release-linux: | $(DIST_DIRS) release-linux: | $(DIST_DIRS)
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) . 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) .
@ -1013,7 +1027,7 @@ generate-gitignore:
.PHONY: generate-gomock .PHONY: generate-gomock
generate-gomock: generate-gomock:
$(GO) run $(GOMOCK_PACKAGE) -package mock -destination ./modules/queue/mock/redisuniversalclient.go forgejo.org/modules/nosql RedisClient $(GO) run $(GOMOCK_PACKAGE) -package mock -destination ./modules/queue/mock/redisuniversalclient.go code.gitea.io/gitea/modules/nosql RedisClient
.PHONY: generate-images .PHONY: generate-images
generate-images: | node_modules generate-images: | node_modules

View file

@ -1590,7 +1590,7 @@ this situation, [follow the instructions in the companion blog post](https://for
The most prominent ones are described here, others can be found in the list of commits included in the release as described above. The most prominent ones are described here, others can be found in the list of commits included in the release as described above.
* [Fix links to pull request reviews sent via mail](https://codeberg.org/forgejo/forgejo/commit/88e179d5ef8ee41f71d068195685ff098b38ca31). The pull request link was correct but it did not go the review and stayed at the beginning of the page * [Fix links to pull request reviews sent via mail](https://codeberg.org/forgejo/forgejo/commit/88e179d5ef8ee41f71d068195685ff098b38ca31). The pull request link was correct but it did not go the the review and stayed at the beginning of the page
* [Recognize OGG as an audio format](https://codeberg.org/forgejo/forgejo/commit/622ec5c79f299c32ac2667a1aa7b4bf5d7c2d6cf) * [Recognize OGG as an audio format](https://codeberg.org/forgejo/forgejo/commit/622ec5c79f299c32ac2667a1aa7b4bf5d7c2d6cf)
* [Consistently show the last time a cron job was run in the admin panel](https://codeberg.org/forgejo/forgejo/commit/5f769ef20) * [Consistently show the last time a cron job was run in the admin panel](https://codeberg.org/forgejo/forgejo/commit/5f769ef20)
* [Fix NuGet registry v2 & v3 API search endpoints](https://codeberg.org/forgejo/forgejo/commit/471138829b0c24fe8c621dbb866ae8bb45ebc674) * [Fix NuGet registry v2 & v3 API search endpoints](https://codeberg.org/forgejo/forgejo/commit/471138829b0c24fe8c621dbb866ae8bb45ebc674)
@ -1609,7 +1609,7 @@ this situation, [follow the instructions in the companion blog post](https://for
* [Fix pull request check list when there are more than 30](https://codeberg.org/forgejo/forgejo/commit/e226b9646) * [Fix pull request check list when there are more than 30](https://codeberg.org/forgejo/forgejo/commit/e226b9646)
* [Fix attachment clipboard copy on insecure origin](https://codeberg.org/forgejo/forgejo/commit/12ac84c26) * [Fix attachment clipboard copy on insecure origin](https://codeberg.org/forgejo/forgejo/commit/12ac84c26)
* [Fix the profile README rendering](https://codeberg.org/forgejo/forgejo/commit/84c3b60a4) that [was inconsistent with other markdown files renderings](https://codeberg.org/forgejo/forgejo/issues/833) * [Fix the profile README rendering](https://codeberg.org/forgejo/forgejo/commit/84c3b60a4) that [was inconsistent with other markdown files renderings](https://codeberg.org/forgejo/forgejo/issues/833)
* [Fix API leaking the user email when the caller is not authenticated](https://codeberg.org/forgejo/forgejo/commit/d89003cc1) * [Fix API leaking the user email when the caller is not authentified](https://codeberg.org/forgejo/forgejo/commit/d89003cc1)
## 1.20.2-0 ## 1.20.2-0
@ -1667,7 +1667,7 @@ $ git -C forgejo log --oneline --no-merges origin/v1.19/forgejo..origin/v1.20/fo
The semantic version was updated to `5.0.0+0-gitea-1.20.1` because it contains breaking changes. The semantic version was updated to `5.0.0+0-gitea-1.20.1` because it contains breaking changes.
- **Breaking:** - **Breaking:**
- [Scoped access tokens](https://codeberg.org/forgejo/forgejo/commit/18de83b2a3fc120922096b7348d6375094ae1532) or (Personal Access Tokens), were refactored and although existing tokens are still valid, they may have a different scope than before. To ensure that no tokens have a larger scope than expected they must be removed and recreated. - [Scoped access tokens](https://codeberg.org/forgejo/forgejo/commit/18de83b2a3fc120922096b7348d6375094ae1532) or (Personal Access Tokens), were refactored and although existing tokens are still valid, they may have a different scope than before. To ensure that no tokens have a larger scope than expected they must be removed and recreated.
- If your `app.ini` has one of the following `[indexer].ISSUE_INDEXER_QUEUE_TYPE`, `[indexer].ISSUE_INDEXER_QUEUE_BATCH_NUMBER`, `[indexer].`, `[indexer].ISSUE_INDEXER_QUEUE_DIR`, `[indexer].ISSUE_INDEXER_QUEUE_CONN_STR`, `[indexer].UPDATE_BUFFER_LEN`, `[mailer].SEND_BUFFER_LEN`, `[repository].PULL_REQUEST_QUEUE_LENGTH` or `[repository].MIRROR_QUEUE_LENGTH`, Forgejo will abort immediately. Unless you know exactly what you're doing, you must comment them out so the default values are used. - If your `app.ini` has one of the the following `[indexer].ISSUE_INDEXER_QUEUE_TYPE`, `[indexer].ISSUE_INDEXER_QUEUE_BATCH_NUMBER`, `[indexer].`, `[indexer].ISSUE_INDEXER_QUEUE_DIR`, `[indexer].ISSUE_INDEXER_QUEUE_CONN_STR`, `[indexer].UPDATE_BUFFER_LEN`, `[mailer].SEND_BUFFER_LEN`, `[repository].PULL_REQUEST_QUEUE_LENGTH` or `[repository].MIRROR_QUEUE_LENGTH`, Forgejo will abort immediately. Unless you know exactly what you're doing, you must comment them out so the default values are used.
- The `-p` option of `environment-to-ini` is [no longer supported](https://codeberg.org/forgejo/forgejo/commit/fa0b5b14c2faa6a5f76bb2e7bc9241a5e4354189) - The `-p` option of `environment-to-ini` is [no longer supported](https://codeberg.org/forgejo/forgejo/commit/fa0b5b14c2faa6a5f76bb2e7bc9241a5e4354189)
- The ".png" suffix for [user and organizations is now reserved](https://codeberg.org/forgejo/forgejo/commit/2b91841cd3e1213ff3e4ed4209d6a4be89c2fa79) - The ".png" suffix for [user and organizations is now reserved](https://codeberg.org/forgejo/forgejo/commit/2b91841cd3e1213ff3e4ed4209d6a4be89c2fa79)
- The section `[git.reflog]` is [now obsolete and its keys have been moved](https://codeberg.org/forgejo/forgejo/commit/2f149c5c9db97f20fbbc65e32d1f3133048b11a2) to the following replacements: - The section `[git.reflog]` is [now obsolete and its keys have been moved](https://codeberg.org/forgejo/forgejo/commit/2f149c5c9db97f20fbbc65e32d1f3133048b11a2) to the following replacements:
@ -1761,7 +1761,7 @@ $ git -C forgejo log --oneline --no-merges origin/v1.19/forgejo..origin/v1.20/fo
- [The repository migration can be canceled](https://codeberg.org/forgejo/forgejo/commit/f6e029e6c7849d4361abf7f1d749b5d528364ac4) - [The repository migration can be canceled](https://codeberg.org/forgejo/forgejo/commit/f6e029e6c7849d4361abf7f1d749b5d528364ac4)
- [Add button on the diff header to copy the file name](https://codeberg.org/forgejo/forgejo/commit/c5ede35124c8d5280219c24049bb0ad7da9f02ed) - [Add button on the diff header to copy the file name](https://codeberg.org/forgejo/forgejo/commit/c5ede35124c8d5280219c24049bb0ad7da9f02ed)
- [Add --quiet option to the dump CLI](https://codeberg.org/forgejo/forgejo/commit/cb1536471bcef4d78a3fe5cbd738b9f60fabbcc2) - [Add --quiet option to the dump CLI](https://codeberg.org/forgejo/forgejo/commit/cb1536471bcef4d78a3fe5cbd738b9f60fabbcc2)
- [Support searching for an issue with its number in the list of issues](https://codeberg.org/forgejo/forgejo/commit/1144b1d129de530b2c07dfdfaf55de383cd82212) - [Support searching for an issue with its number in the the list of issues](https://codeberg.org/forgejo/forgejo/commit/1144b1d129de530b2c07dfdfaf55de383cd82212)
- [Improve the list of notifications](https://codeberg.org/forgejo/forgejo/commit/f7ede92f82f7f3ec7bb31a1249f9524e5b728f34) - [Improve the list of notifications](https://codeberg.org/forgejo/forgejo/commit/f7ede92f82f7f3ec7bb31a1249f9524e5b728f34)
- [When editing a file in the web UI, allow for a preview whenever possible](https://codeberg.org/forgejo/forgejo/commit/ac64c8297444ade63a2a364c4afb7e6c1de5a75f) - [When editing a file in the web UI, allow for a preview whenever possible](https://codeberg.org/forgejo/forgejo/commit/ac64c8297444ade63a2a364c4afb7e6c1de5a75f)
- [Make release download URLs human readable](https://codeberg.org/forgejo/forgejo/commit/42919ccb7cd32ab67d0878baf2bac6cd007899a8) - [Make release download URLs human readable](https://codeberg.org/forgejo/forgejo/commit/42919ccb7cd32ab67d0878baf2bac6cd007899a8)
@ -1798,7 +1798,7 @@ $ git -C forgejo log --oneline --no-merges origin/v1.19/forgejo..origin/v1.20/fo
- [Add API for gitignore templates](https://codeberg.org/forgejo/forgejo/commit/36a5d4c2f3b5670e5e921034cd5d25817534a6d4) - [Add API for gitignore templates](https://codeberg.org/forgejo/forgejo/commit/36a5d4c2f3b5670e5e921034cd5d25817534a6d4)
- [Add API to upuload a file to an empty repository](https://codeberg.org/forgejo/forgejo/commit/cf465b472166ccf6d3e001e3043e4bf43e16e6b3) - [Add API to upuload a file to an empty repository](https://codeberg.org/forgejo/forgejo/commit/cf465b472166ccf6d3e001e3043e4bf43e16e6b3)
- [Allow for --not when listing the commits of a repo](https://codeberg.org/forgejo/forgejo/commit/f766b002938b5c81e343c81fda3c0669fa09809f) - [Allow for --not when listing the commits of a repo](https://codeberg.org/forgejo/forgejo/commit/f766b002938b5c81e343c81fda3c0669fa09809f)
- [Add `files` and `verification` parameters to improve performances when listing the commits of a repo](https://codeberg.org/forgejo/forgejo/commit/1dd83dbb917d55bd253001646d6743f247a4d98b) - [Add `files` and `verification` parameters to improve performances when listing the commits of a a repo](https://codeberg.org/forgejo/forgejo/commit/1dd83dbb917d55bd253001646d6743f247a4d98b)
- [Allow for listing a single commit in a repository](https://codeberg.org/forgejo/forgejo/commit/5930ab5fdf7a970fcca3cd50b44cf1cacb615a54) - [Allow for listing a single commit in a repository](https://codeberg.org/forgejo/forgejo/commit/5930ab5fdf7a970fcca3cd50b44cf1cacb615a54)
- [Create a branch directly from commit on the create branch API](https://codeberg.org/forgejo/forgejo/commit/cd9a13ebb47d32f46b38439a524e3b2e0c619490) - [Create a branch directly from commit on the create branch API](https://codeberg.org/forgejo/forgejo/commit/cd9a13ebb47d32f46b38439a524e3b2e0c619490)
- [Add API for Label templates](https://codeberg.org/forgejo/forgejo/commit/25dc1556cd70b567a4920beb002a0addfbfd6ef2) - [Add API for Label templates](https://codeberg.org/forgejo/forgejo/commit/25dc1556cd70b567a4920beb002a0addfbfd6ef2)

View file

@ -1,33 +1,27 @@
<!-- <svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
This logo was created by Michael Hanke <mih@ngln.eu> from <style type="text/css">
the original Forgejo logo by Caesar Schinas and the git-annex circle {
logo by Henrik Nyh <http://henrik.nyh.se/>, Joey Hess <id@joeyh.name>, fill: none;
John Lawrence, and Yann Büchau <nobodyinperson at posteo de>. stroke: #000;
stroke-width: 15;
It is licensed under the Creative Commons Attribution-ShareAlike 4.0 }
International (CC BY-SA 4.0) license. path {
--> fill: none;
<svg xmlns="http://www.w3.org/2000/svg" width="212" height="212" stroke: #000;
viewBox="0 0 56.092 56.092" xmlns:v="https://vecta.io/nano"> stroke-width: 25;
<g transform="matrix(1.003855 0 0 1.003855 -155.52693 -24.929635)" }
fill="none"> .orange {
<g stroke-width="6.615"> stroke:#ff6600;
<path d="M168.804 70.908V44.979a13.229 13.229 0 0 1 13.229-13.229h5.292" }
stroke="#f60" /> .red {
<path d="M168.804 70.908v-7.937a13.229 13.229 0 0 1 13.229-13.229h5.292" stroke:#d40000;
stroke="#d40000" /> }
</g> </style>
<g stroke-width="3.969"> <g transform="translate(6,6)">
<circle cx="191.029" cy="31.75" r="4.762" stroke="#f60" /> <path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
<g stroke="#d40000"> <path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
<circle cx="191.029" cy="49.742" r="4.762" /> <circle cx="142" cy="20" r="18" class="orange" />
<circle cx="168.804" cy="74.083" r="4.762" /> <circle cx="142" cy="88" r="18" class="red" />
</g> <circle cx="58" cy="180" r="18" class="red" />
</g>
</g>
<g fill="#777">
<path d="M34.648 56.182c-2.089-.269-4.238-2.244-4.538-4.561-.288-1.937.128-4.198 1.729-5.476.702-.479 1.658-1.015 2.5-.951v2.757c-1.003.112-1.975 1.252-1.954 2.296.025 1.359.626 2.607 1.933 3.014 1.446.487 3.102.348 4.44-.461 1.106-.862 1.208-2.466.63-3.687-.26-.672-.821-1.165-1.582-1.163v2.392H35.66v-5.149h6.5v1.852l-1.78.016c1.661.947 1.832 2.991 1.747 4.409.06 2.436-2.347 4.422-4.734 4.688-.864.065-1.594.068-2.743.023zm-4.644-12.011l-.014-2.702h12.185l-.001 2.715-12.17-.013zm4.645-3.651v-2.892h-4.724v-2.516h4.724v-3.245h2.826v3.245h4.702v2.516h-4.702l-.047 2.886-2.779.006z" />
<path d="M22.23 24.801l-2.819 3.94h1.565a9.01 9.01 0 0 0 .103 1.283l2.488-.377c-.044-.296-.071-.599-.075-.906h1.556zm1.531 5.732l-2.405.724a8.9 8.9 0 0 0 .447 1.18l2.281-1.055a6.36 6.36 0 0 1-.323-.848zm.753 1.622L22.4 33.518a8.99 8.99 0 0 0 3.949 3.365l1.006-2.305a6.45 6.45 0 0 1-2.839-2.421zm3.675 2.715l-.679 2.425a8.94 8.94 0 0 0 1.18.244l.348-2.492a6.52 6.52 0 0 1-.848-.178zm21.673-10.069l-2.819 3.94h1.565c-.003.308-.03.61-.075.906l2.488.377a9.01 9.01 0 0 0 .103-1.283h1.556zm-1.523 5.732a6.36 6.36 0 0 1-.323.848l2.281 1.055c.176-.379.325-.774.447-1.18zm-.753 1.622a6.45 6.45 0 0 1-2.839 2.421l1.006 2.305a8.99 8.99 0 0 0 3.949-3.365zm-3.675 2.715a6.52 6.52 0 0 1-.848.178l.348 2.492a8.94 8.94 0 0 0 1.18-.244z"
fill-rule="evenodd" />
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 677 B

Before After
Before After

File diff suppressed because one or more lines are too long

View file

@ -1,33 +1,27 @@
<!-- <svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
This logo was created by Michael Hanke <mih@ngln.eu> from <style type="text/css">
the original Forgejo logo by Caesar Schinas and the git-annex circle {
logo by Henrik Nyh <http://henrik.nyh.se/>, Joey Hess <id@joeyh.name>, fill: none;
John Lawrence, and Yann Büchau <nobodyinperson at posteo de>. stroke: #000;
stroke-width: 15;
It is licensed under the Creative Commons Attribution-ShareAlike 4.0 }
International (CC BY-SA 4.0) license. path {
--> fill: none;
<svg xmlns="http://www.w3.org/2000/svg" width="212" height="212" stroke: #000;
viewBox="0 0 56.092 56.092" xmlns:v="https://vecta.io/nano"> stroke-width: 25;
<g transform="matrix(1.003855 0 0 1.003855 -155.52693 -24.929635)" }
fill="none"> .orange {
<g stroke-width="6.615"> stroke:#ff6600;
<path d="M168.804 70.908V44.979a13.229 13.229 0 0 1 13.229-13.229h5.292" }
stroke="#f60" /> .red {
<path d="M168.804 70.908v-7.937a13.229 13.229 0 0 1 13.229-13.229h5.292" stroke:#d40000;
stroke="#d40000" /> }
</g> </style>
<g stroke-width="3.969"> <g transform="translate(6,6)">
<circle cx="191.029" cy="31.75" r="4.762" stroke="#f60" /> <path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
<g stroke="#d40000"> <path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
<circle cx="191.029" cy="49.742" r="4.762" /> <circle cx="142" cy="20" r="18" class="orange" />
<circle cx="168.804" cy="74.083" r="4.762" /> <circle cx="142" cy="88" r="18" class="red" />
</g> <circle cx="58" cy="180" r="18" class="red" />
</g>
</g>
<g fill="#777">
<path d="M34.648 56.182c-2.089-.269-4.238-2.244-4.538-4.561-.288-1.937.128-4.198 1.729-5.476.702-.479 1.658-1.015 2.5-.951v2.757c-1.003.112-1.975 1.252-1.954 2.296.025 1.359.626 2.607 1.933 3.014 1.446.487 3.102.348 4.44-.461 1.106-.862 1.208-2.466.63-3.687-.26-.672-.821-1.165-1.582-1.163v2.392H35.66v-5.149h6.5v1.852l-1.78.016c1.661.947 1.832 2.991 1.747 4.409.06 2.436-2.347 4.422-4.734 4.688-.864.065-1.594.068-2.743.023zm-4.644-12.011l-.014-2.702h12.185l-.001 2.715-12.17-.013zm4.645-3.651v-2.892h-4.724v-2.516h4.724v-3.245h2.826v3.245h4.702v2.516h-4.702l-.047 2.886-2.779.006z" />
<path d="M22.23 24.801l-2.819 3.94h1.565a9.01 9.01 0 0 0 .103 1.283l2.488-.377c-.044-.296-.071-.599-.075-.906h1.556zm1.531 5.732l-2.405.724a8.9 8.9 0 0 0 .447 1.18l2.281-1.055a6.36 6.36 0 0 1-.323-.848zm.753 1.622L22.4 33.518a8.99 8.99 0 0 0 3.949 3.365l1.006-2.305a6.45 6.45 0 0 1-2.839-2.421zm3.675 2.715l-.679 2.425a8.94 8.94 0 0 0 1.18.244l.348-2.492a6.52 6.52 0 0 1-.848-.178zm21.673-10.069l-2.819 3.94h1.565c-.003.308-.03.61-.075.906l2.488.377a9.01 9.01 0 0 0 .103-1.283h1.556zm-1.523 5.732a6.36 6.36 0 0 1-.323.848l2.281 1.055c.176-.379.325-.774.447-1.18zm-.753 1.622a6.45 6.45 0 0 1-2.839 2.421l1.006 2.305a8.99 8.99 0 0 0 3.949-3.365zm-3.675 2.715a6.52 6.52 0 0 1-.848.178l.348 2.492a8.94 8.94 0 0 0 1.18-.244z"
fill-rule="evenodd" />
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 677 B

Before After
Before After

View file

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

View file

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

View file

@ -13,8 +13,8 @@ import (
) )
var importPackageGroupOrders = map[string]int{ var importPackageGroupOrders = map[string]int{
"": 1, // internal "": 1, // internal
"forgejo.org/": 2, "code.gitea.io/gitea/": 2,
} }
var errInvalidCommentBetweenImports = errors.New("comments between imported packages are invalid, please move comments to the end of the package line") 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/other/package"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
"xorm.io/the/package" "xorm.io/the/package"
@ -82,8 +82,8 @@ import (
_ "image/jpeg" // for processing jpeg images _ "image/jpeg" // for processing jpeg images
_ "image/png" // for processing png images _ "image/png" // for processing png images
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
"code.gitea.io/other/package" "code.gitea.io/other/package"
"github.com/issue9/identicon" "github.com/issue9/identicon"

View file

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

View file

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

View file

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

View file

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

View file

@ -1,331 +0,0 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package main
import (
"fmt"
"go/ast"
goParser "go/parser"
"go/token"
"io/fs"
"os"
"path/filepath"
"strconv"
"strings"
"text/template"
tmplParser "text/template/parse"
"forgejo.org/modules/container"
"forgejo.org/modules/locale"
fjTemplates "forgejo.org/modules/templates"
"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
Err error
}
func (e LocatedError) Error() string {
var sb strings.Builder
sb.WriteString(e.Location)
sb.WriteString(":\t")
if e.Kind != "" {
sb.WriteString(e.Kind)
sb.WriteString(": ")
}
sb.WriteString("ERROR: ")
sb.WriteString(e.Err.Error())
return sb.String()
}
func isLocaleTrFunction(funcname string) bool {
return funcname == "Tr" || funcname == "TrN"
}
// the `Handle*File` functions follow the following calling convention:
// * `fname` is the name of the input file
// * `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 {
fset := token.NewFileSet()
node, err := goParser.ParseFile(fset, fname, src, goParser.SkipObjectResolution)
if err != nil {
return LocatedError{
Location: fname,
Kind: "Go parser",
Err: err,
}
}
ast.Inspect(node, func(n ast.Node) bool {
// search for function calls of the form `anything.Tr(any-string-lit)`
call, ok := n.(*ast.CallExpr)
if !ok || len(call.Args) != 1 {
return true
}
funSel, ok := call.Fun.(*ast.SelectorExpr)
if (!ok) || !isLocaleTrFunction(funSel.Sel.Name) {
return true
}
argLit, ok := call.Args[0].(*ast.BasicLit)
if (!ok) || argLit.Kind != token.STRING {
return true
}
// extract string content
arg, err := strconv.Unquote(argLit.Value)
if err != nil {
return true
}
// found interesting string
omh(fset, argLit.ValuePos, arg)
return true
})
return nil
}
// derived from source: modules/templates/scopedtmpl/scopedtmpl.go, L169-L213
func (omh OnMsgidHandler) handleTemplateNode(fset *token.FileSet, node tmplParser.Node) {
switch node.Type() {
case tmplParser.NodeAction:
omh.handleTemplatePipeNode(fset, node.(*tmplParser.ActionNode).Pipe)
case tmplParser.NodeList:
nodeList := node.(*tmplParser.ListNode)
omh.handleTemplateFileNodes(fset, nodeList.Nodes)
case tmplParser.NodePipe:
omh.handleTemplatePipeNode(fset, node.(*tmplParser.PipeNode))
case tmplParser.NodeTemplate:
omh.handleTemplatePipeNode(fset, node.(*tmplParser.TemplateNode).Pipe)
case tmplParser.NodeIf:
nodeIf := node.(*tmplParser.IfNode)
omh.handleTemplateBranchNode(fset, nodeIf.BranchNode)
case tmplParser.NodeRange:
nodeRange := node.(*tmplParser.RangeNode)
omh.handleTemplateBranchNode(fset, nodeRange.BranchNode)
case tmplParser.NodeWith:
nodeWith := node.(*tmplParser.WithNode)
omh.handleTemplateBranchNode(fset, nodeWith.BranchNode)
case tmplParser.NodeCommand:
nodeCommand := node.(*tmplParser.CommandNode)
omh.handleTemplateFileNodes(fset, nodeCommand.Args)
if len(nodeCommand.Args) != 2 {
return
}
nodeChain, ok := nodeCommand.Args[0].(*tmplParser.ChainNode)
if !ok {
return
}
nodeString, ok := nodeCommand.Args[1].(*tmplParser.StringNode)
if !ok {
return
}
nodeIdent, ok := nodeChain.Node.(*tmplParser.IdentifierNode)
if !ok || nodeIdent.Ident != "ctx" {
return
}
if len(nodeChain.Field) != 2 || nodeChain.Field[0] != "Locale" || !isLocaleTrFunction(nodeChain.Field[1]) {
return
}
// found interesting string
// the column numbers are a bit "off", but much better than nothing
omh(fset, token.Pos(nodeString.Pos), nodeString.Text)
default:
}
}
func (omh OnMsgidHandler) 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)
}
}
func (omh OnMsgidHandler) handleTemplateBranchNode(fset *token.FileSet, branchNode tmplParser.BranchNode) {
omh.handleTemplatePipeNode(fset, branchNode.Pipe)
omh.handleTemplateFileNodes(fset, branchNode.List.Nodes)
if branchNode.ElseList != nil {
omh.handleTemplateFileNodes(fset, branchNode.ElseList.Nodes)
}
}
func (omh OnMsgidHandler) handleTemplateFileNodes(fset *token.FileSet, nodes []tmplParser.Node) {
for _, node := range nodes {
omh.handleTemplateNode(fset, node)
}
}
func (omh OnMsgidHandler) HandleTemplateFile(fname string, src any) error {
var tmplContent []byte
switch src2 := src.(type) {
case nil:
var err error
tmplContent, err = os.ReadFile(fname)
if err != nil {
return LocatedError{
Location: fname,
Kind: "ReadFile",
Err: err,
}
}
case []byte:
tmplContent = src2
case string:
// SAFETY: we do not modify tmplContent below
tmplContent = util.UnsafeStringToBytes(src2)
default:
panic("invalid type for 'src'")
}
fset := token.NewFileSet()
fset.AddFile(fname, 1, len(tmplContent)).SetLinesForContent(tmplContent)
// SAFETY: we do not modify tmplContent2 below
tmplContent2 := util.UnsafeBytesToString(tmplContent)
tmpl := template.New(fname)
tmpl.Funcs(fjTemplates.NewFuncMap())
tmplParsed, err := tmpl.Parse(tmplContent2)
if err != nil {
return LocatedError{
Location: fname,
Kind: "Template parser",
Err: err,
}
}
omh.handleTemplateFileNodes(fset, tmplParsed.Tree.Root.Nodes)
return nil
}
// This command assumes that we get started from the project root directory
//
// Possible command line flags:
//
// --allow-missing-msgids don't return an error code if missing message IDs are found
//
// EXIT CODES:
//
// 0 success, no issues found
// 1 unable to walk directory tree
// 2 unable to parse locale ini/json files
// 3 unable to parse go or text/template files
// 4 found missing message IDs
//
//nolint:forbidigo
func main() {
allowMissingMsgids := false
for _, arg := range os.Args[1:] {
if arg == "--allow-missing-msgids" {
allowMissingMsgids = true
}
}
onError := func(err error) {
if err == nil {
return
}
fmt.Println(err.Error())
os.Exit(3)
}
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)
if err != nil {
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
os.Exit(2)
}
if err = locale.IterateMessagesContent(localeContent, onMsgid); err != nil {
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
os.Exit(2)
}
localeFile = filepath.Join(filepath.Join("options", "locale_next"), "locale_en-US.json")
localeContent, err = os.ReadFile(localeFile)
if err != nil {
fmt.Printf("%s:\tERROR: %s\n", localeFile, err.Error())
os.Exit(2)
}
if err := locale.IterateMessagesNextContent(localeContent, onMsgid); 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) {
if !msgids.Contains(msgid) {
gotAnyMsgidError = true
fmt.Printf("%s:\tmissing msgid: %s\n", fset.Position(pos).String(), msgid)
}
})
if err := filepath.WalkDir(".", func(fpath string, d fs.DirEntry, err error) error {
if err != nil {
if os.IsNotExist(err) {
return nil
}
return err
}
name := d.Name()
if d.IsDir() {
if name == "docker" || name == ".git" || name == "node_modules" {
return fs.SkipDir
}
} else if name == "bindata.go" {
// skip false positives
} else if strings.HasSuffix(name, ".go") {
onError(omh.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))
}
}
return nil
}); err != nil {
fmt.Printf("walkdir ERROR: %s\n", err.Error())
os.Exit(1)
}
if !allowMissingMsgids && gotAnyMsgidError {
os.Exit(4)
}
}

View file

@ -1,44 +0,0 @@
// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package main
import (
"go/token"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
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))
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))
return ret
}
func TestUsagesParser(t *testing.T) {
t.Run("go, simple", func(t *testing.T) {
assert.EqualValues(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,
[]string{"what.an.example"},
HandleTemplateFileWrapped(t, "<t1>", "{{ ctx.Locale.Tr \"what.an.example\" }}\n"))
})
}

View file

@ -14,10 +14,9 @@ import (
"slices" "slices"
"strings" "strings"
"forgejo.org/modules/locale"
"github.com/microcosm-cc/bluemonday" "github.com/microcosm-cc/bluemonday"
"github.com/sergi/go-diff/diffmatchpatch" "github.com/sergi/go-diff/diffmatchpatch"
"gopkg.in/ini.v1" //nolint:depguard
) )
var ( var (
@ -27,8 +26,6 @@ var (
// Matches href="", href="#", href="%s", href="#%s", href="%[1]s" and href="#%[1]s". // Matches href="", href="#", href="%s", href="#%s", href="%[1]s" and href="#%[1]s".
placeHolderRegex = regexp.MustCompile(`href="#?(%s|%\[\d\]s)?"`) placeHolderRegex = regexp.MustCompile(`href="#?(%s|%\[\d\]s)?"`)
dmp = diffmatchpatch.New()
) )
func initBlueMondayPolicy() { func initBlueMondayPolicy() {
@ -82,44 +79,41 @@ func preprocessTranslationValue(value string) string {
return value return value
} }
func checkValue(trKey, value string) []string {
keyValue := preprocessTranslationValue(value)
if html.UnescapeString(policy.Sanitize(keyValue)) == keyValue {
return nil
}
// Create a nice diff of the difference.
diffs := dmp.DiffMain(keyValue, html.UnescapeString(policy.Sanitize(keyValue)), false)
diffs = dmp.DiffCleanupSemantic(diffs)
diffs = dmp.DiffCleanupEfficiency(diffs)
return []string{trKey + ": " + dmp.DiffPrettyText(diffs)}
}
func checkLocaleContent(localeContent []byte) []string { func checkLocaleContent(localeContent []byte) []string {
errors := []string{} // Same configuration as Forgejo uses.
cfg := ini.Empty(ini.LoadOptions{
IgnoreContinuation: true,
})
cfg.NameMapper = ini.SnackCase
if err := locale.IterateMessagesContent(localeContent, func(trKey, trValue string) error { if err := cfg.Append(localeContent); err != nil {
errors = append(errors, checkValue(trKey, trValue)...)
return nil
}); err != nil {
panic(err) panic(err)
} }
return errors dmp := diffmatchpatch.New()
}
func checkLocaleNextContent(localeContent []byte) []string {
errors := []string{} errors := []string{}
if err := locale.IterateMessagesNextContent(localeContent, func(trKey, trValue string) error { for _, section := range cfg.Sections() {
errors = append(errors, checkValue(trKey, trValue)...) for _, key := range section.Keys() {
return nil var trKey string
}); err != nil { if section.Name() == "" || section.Name() == "DEFAULT" || section.Name() == "common" {
panic(err) trKey = key.Name()
} } else {
trKey = section.Name() + "." + key.Name()
}
keyValue := preprocessTranslationValue(key.Value())
if html.UnescapeString(policy.Sanitize(keyValue)) != keyValue {
// Create a nice diff of the difference.
diffs := dmp.DiffMain(keyValue, html.UnescapeString(policy.Sanitize(keyValue)), false)
diffs = dmp.DiffCleanupSemantic(diffs)
diffs = dmp.DiffCleanupEfficiency(diffs)
errors = append(errors, trKey+": "+dmp.DiffPrettyText(diffs))
}
}
}
return errors return errors
} }
@ -133,7 +127,6 @@ func main() {
panic(err) panic(err)
} }
// Safety check that we are not reading the wrong directory.
if !slices.ContainsFunc(localeFiles, func(e fs.DirEntry) bool { return strings.HasSuffix(e.Name(), ".ini") }) { if !slices.ContainsFunc(localeFiles, func(e fs.DirEntry) bool { return strings.HasSuffix(e.Name(), ".ini") }) {
fmt.Println("No locale files found") fmt.Println("No locale files found")
os.Exit(1) os.Exit(1)
@ -147,7 +140,6 @@ func main() {
localeContent, err := os.ReadFile(filepath.Join(localeDir, localeFile.Name())) localeContent, err := os.ReadFile(filepath.Join(localeDir, localeFile.Name()))
if err != nil { if err != nil {
fmt.Println(localeFile.Name())
panic(err) panic(err)
} }
@ -159,33 +151,5 @@ func main() {
} }
} }
// Check the locale next.
localeDir = filepath.Join("options", "locale_next")
localeFiles, err = os.ReadDir(localeDir)
if err != nil {
panic(err)
}
// Safety check that we are not reading the wrong directory.
if !slices.ContainsFunc(localeFiles, func(e fs.DirEntry) bool { return strings.HasSuffix(e.Name(), ".json") }) {
fmt.Println("No locale_next files found")
os.Exit(1)
}
for _, localeFile := range localeFiles {
localeContent, err := os.ReadFile(filepath.Join(localeDir, localeFile.Name()))
if err != nil {
fmt.Println(localeFile.Name())
panic(err)
}
if err := checkLocaleNextContent(localeContent); len(err) > 0 {
fmt.Println(localeFile.Name())
fmt.Println(strings.Join(err, "\n"))
fmt.Println()
exitCode = 1
}
}
os.Exit(exitCode) os.Exit(exitCode)
} }

View file

@ -63,32 +63,3 @@ func TestLocalizationPolicy(t *testing.T) {
assert.EqualValues(t, []string{"key: و\x1b[31m&nbsp\x1b[0m\x1b[32m\u00a0\x1b[0m"}, checkLocaleContent([]byte(`key = و&nbsp;`))) assert.EqualValues(t, []string{"key: و\x1b[31m&nbsp\x1b[0m\x1b[32m\u00a0\x1b[0m"}, checkLocaleContent([]byte(`key = و&nbsp;`)))
}) })
} }
func TestNextLocalizationPolicy(t *testing.T) {
initBlueMondayPolicy()
initRemoveTags()
t.Run("Nested locales", func(t *testing.T) {
assert.Empty(t, checkLocaleNextContent([]byte(`{
"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(`{
"settings": {
"hidden_comment_types_description": "\"<not-an-allowed-key> <label>\""
}
}`)))
})
t.Run("Flat locales", func(t *testing.T) {
assert.Empty(t, checkLocaleNextContent([]byte(`{
"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(`{
"settings.hidden_comment_types_description": "\"<not-an-allowed-key> <label>\""
}`)))
})
}

View file

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

View file

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

View file

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

View file

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

View file

@ -7,8 +7,8 @@ import (
"context" "context"
"testing" "testing"
"forgejo.org/models/auth" "code.gitea.io/gitea/models/auth"
"forgejo.org/services/auth/source/ldap" "code.gitea.io/gitea/services/auth/source/ldap"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"

View file

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

View file

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

View file

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

View file

@ -7,11 +7,11 @@ import (
"errors" "errors"
"fmt" "fmt"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"forgejo.org/modules/auth/password" "code.gitea.io/gitea/modules/auth/password"
"forgejo.org/modules/optional" "code.gitea.io/gitea/modules/optional"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
user_service "forgejo.org/services/user" user_service "code.gitea.io/gitea/services/user"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -7,12 +7,12 @@ import (
"errors" "errors"
"fmt" "fmt"
auth_model "forgejo.org/models/auth" auth_model "code.gitea.io/gitea/models/auth"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
pwd "forgejo.org/modules/auth/password" pwd "code.gitea.io/gitea/modules/auth/password"
"forgejo.org/modules/optional" "code.gitea.io/gitea/modules/optional"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@ -69,10 +69,6 @@ var microcmdUserCreate = &cli.Command{
} }
func runCreateUser(c *cli.Context) error { func runCreateUser(c *cli.Context) error {
// this command highly depends on the many setting options (create org, visibility, etc.), so it must have a full setting load first
// duplicate setting loading should be safe at the moment, but it should be refactored & improved in the future.
setting.LoadSettings()
if err := argsSet(c, "email"); err != nil { if err := argsSet(c, "email"); err != nil {
return err return err
} }

View file

@ -8,9 +8,9 @@ import (
"fmt" "fmt"
"strings" "strings"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"forgejo.org/modules/storage" "code.gitea.io/gitea/modules/storage"
user_service "forgejo.org/services/user" user_service "code.gitea.io/gitea/services/user"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -7,8 +7,8 @@ import (
"errors" "errors"
"fmt" "fmt"
auth_model "forgejo.org/models/auth" auth_model "code.gitea.io/gitea/models/auth"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -8,7 +8,7 @@ import (
"os" "os"
"text/tabwriter" "text/tabwriter"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -7,7 +7,7 @@ import (
"errors" "errors"
"fmt" "fmt"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -15,10 +15,10 @@ import (
"strings" "strings"
"syscall" "syscall"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -11,13 +11,13 @@ import (
"strings" "strings"
"text/tabwriter" "text/tabwriter"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/models/migrations" "code.gitea.io/gitea/models/migrations"
migrate_base "forgejo.org/models/migrations/base" migrate_base "code.gitea.io/gitea/models/migrations/base"
"forgejo.org/modules/container" "code.gitea.io/gitea/modules/container"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/services/doctor" "code.gitea.io/gitea/services/doctor"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
"xorm.io/xorm" "xorm.io/xorm"

View file

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

View file

@ -7,8 +7,8 @@ import (
"context" "context"
"testing" "testing"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/services/doctor" "code.gitea.io/gitea/services/doctor"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"

View file

@ -13,12 +13,12 @@ import (
"strings" "strings"
"time" "time"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/modules/json" "code.gitea.io/gitea/modules/json"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/storage" "code.gitea.io/gitea/modules/storage"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
"code.forgejo.org/go-chi/session" "code.forgejo.org/go-chi/session"
"github.com/mholt/archiver/v3" "github.com/mholt/archiver/v3"
@ -133,12 +133,12 @@ It can be used for backup and capture Forgejo server image to send to maintainer
&cli.BoolFlag{ &cli.BoolFlag{
Name: "skip-repository", Name: "skip-repository",
Aliases: []string{"R"}, Aliases: []string{"R"},
Usage: "Skip repositories", Usage: "Skip the repository dumping",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "skip-log", Name: "skip-log",
Aliases: []string{"L"}, Aliases: []string{"L"},
Usage: "Skip logs", Usage: "Skip the log dumping",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "skip-custom-dir", Name: "skip-custom-dir",
@ -160,10 +160,6 @@ It can be used for backup and capture Forgejo server image to send to maintainer
Name: "skip-index", Name: "skip-index",
Usage: "Skip bleve index data", Usage: "Skip bleve index data",
}, },
&cli.BoolFlag{
Name: "skip-repo-archives",
Usage: "Skip repository archives",
},
&cli.GenericFlag{ &cli.GenericFlag{
Name: "type", Name: "type",
Value: outputTypeEnum, Value: outputTypeEnum,
@ -237,7 +233,7 @@ func runDump(ctx *cli.Context) error {
if file == nil { if file == nil {
file, err = os.Create(fileName) file, err = os.Create(fileName)
if err != nil { if err != nil {
fatal("Failed to open %s: %v", fileName, err) fatal("Unable to open %s: %v", fileName, err)
} }
} }
defer file.Close() defer file.Close()
@ -254,7 +250,7 @@ func runDump(ctx *cli.Context) error {
iface, err = archiver.ByExtension(fileName) iface, err = archiver.ByExtension(fileName)
} }
if err != nil { if err != nil {
fatal("Failed to get archiver for extension: %v", err) fatal("Unable to get archiver for extension: %v", err)
} }
w, _ := iface.(archiver.Writer) w, _ := iface.(archiver.Writer)
@ -264,7 +260,7 @@ func runDump(ctx *cli.Context) error {
defer w.Close() defer w.Close()
if ctx.IsSet("skip-repository") && ctx.Bool("skip-repository") { if ctx.IsSet("skip-repository") && ctx.Bool("skip-repository") {
log.Info("Skipping local repositories") log.Info("Skip dumping local repositories")
} else { } else {
log.Info("Dumping local repositories... %s", setting.RepoRootPath) log.Info("Dumping local repositories... %s", setting.RepoRootPath)
if err := addRecursiveExclude(w, "repos", setting.RepoRootPath, []string{absFileName}, verbose); err != nil { if err := addRecursiveExclude(w, "repos", setting.RepoRootPath, []string{absFileName}, verbose); err != nil {
@ -272,9 +268,9 @@ func runDump(ctx *cli.Context) error {
} }
if ctx.IsSet("skip-lfs-data") && ctx.Bool("skip-lfs-data") { if ctx.IsSet("skip-lfs-data") && ctx.Bool("skip-lfs-data") {
log.Info("Skipping LFS data") log.Info("Skip dumping LFS data")
} else if !setting.LFS.StartServer { } else if !setting.LFS.StartServer {
log.Info("LFS not enabled - skipping") log.Info("LFS isn't enabled. Skip dumping LFS data")
} else if err := storage.LFS.IterateObjects("", func(objPath string, object storage.Object) error { } else if err := storage.LFS.IterateObjects("", func(objPath string, object storage.Object) error {
info, err := object.Stat() info, err := object.Stat()
if err != nil { if err != nil {
@ -299,7 +295,7 @@ func runDump(ctx *cli.Context) error {
defer func() { defer func() {
_ = dbDump.Close() _ = dbDump.Close()
if err := util.Remove(dbDump.Name()); err != nil { if err := util.Remove(dbDump.Name()); err != nil {
log.Warn("Failed to remove temporary file: %s: Error: %v", dbDump.Name(), err) log.Warn("Unable to remove temporary file: %s: Error: %v", dbDump.Name(), err)
} }
}() }()
@ -335,16 +331,16 @@ func runDump(ctx *cli.Context) error {
fatal("Failed to include custom: %v", err) fatal("Failed to include custom: %v", err)
} }
} else { } else {
log.Info("Custom dir %s is inside data dir %s, skipping", setting.CustomPath, setting.AppDataPath) log.Info("Custom dir %s is inside data dir %s, skipped", setting.CustomPath, setting.AppDataPath)
} }
} else { } else {
log.Info("Custom dir %s does not exist, skipping", setting.CustomPath) log.Info("Custom dir %s doesn't exist, skipped", setting.CustomPath)
} }
} }
isExist, err := util.IsExist(setting.AppDataPath) isExist, err := util.IsExist(setting.AppDataPath)
if err != nil { if err != nil {
log.Error("Failed to check if %s exists: %v", setting.AppDataPath, err) log.Error("Unable to check if %s exists. Error: %v", setting.AppDataPath, err)
} }
if isExist { if isExist {
log.Info("Packing data directory...%s", setting.AppDataPath) log.Info("Packing data directory...%s", setting.AppDataPath)
@ -359,16 +355,10 @@ func runDump(ctx *cli.Context) error {
} }
if ctx.IsSet("skip-index") && ctx.Bool("skip-index") { if ctx.IsSet("skip-index") && ctx.Bool("skip-index") {
log.Info("Skipping bleve index data")
excludes = append(excludes, setting.Indexer.RepoPath) excludes = append(excludes, setting.Indexer.RepoPath)
excludes = append(excludes, setting.Indexer.IssuePath) excludes = append(excludes, setting.Indexer.IssuePath)
} }
if ctx.IsSet("skip-repo-archives") && ctx.Bool("skip-repo-archives") {
log.Info("Skipping repository archives data")
excludes = append(excludes, setting.RepoArchive.Storage.Path)
}
excludes = append(excludes, setting.RepoRootPath) excludes = append(excludes, setting.RepoRootPath)
excludes = append(excludes, setting.LFS.Storage.Path) excludes = append(excludes, setting.LFS.Storage.Path)
excludes = append(excludes, setting.Attachment.Storage.Path) excludes = append(excludes, setting.Attachment.Storage.Path)
@ -381,7 +371,7 @@ func runDump(ctx *cli.Context) error {
} }
if ctx.IsSet("skip-attachment-data") && ctx.Bool("skip-attachment-data") { if ctx.IsSet("skip-attachment-data") && ctx.Bool("skip-attachment-data") {
log.Info("Skipping attachment data") log.Info("Skip dumping attachment data")
} else if err := storage.Attachments.IterateObjects("", func(objPath string, object storage.Object) error { } else if err := storage.Attachments.IterateObjects("", func(objPath string, object storage.Object) error {
info, err := object.Stat() info, err := object.Stat()
if err != nil { if err != nil {
@ -394,9 +384,9 @@ func runDump(ctx *cli.Context) error {
} }
if ctx.IsSet("skip-package-data") && ctx.Bool("skip-package-data") { if ctx.IsSet("skip-package-data") && ctx.Bool("skip-package-data") {
log.Info("Skipping package data") log.Info("Skip dumping package data")
} else if !setting.Packages.Enabled { } else if !setting.Packages.Enabled {
log.Info("Package registry not enabled - skipping") log.Info("Packages isn't enabled. Skip dumping package data")
} else if err := storage.Packages.IterateObjects("", func(objPath string, object storage.Object) error { } else if err := storage.Packages.IterateObjects("", func(objPath string, object storage.Object) error {
info, err := object.Stat() info, err := object.Stat()
if err != nil { if err != nil {
@ -412,11 +402,11 @@ func runDump(ctx *cli.Context) error {
// ensuring that it's clear the dump is skipped whether the directory's initialized // ensuring that it's clear the dump is skipped whether the directory's initialized
// yet or not. // yet or not.
if ctx.IsSet("skip-log") && ctx.Bool("skip-log") { if ctx.IsSet("skip-log") && ctx.Bool("skip-log") {
log.Info("Skipping log files") log.Info("Skip dumping log files")
} else { } else {
isExist, err := util.IsExist(setting.Log.RootPath) isExist, err := util.IsExist(setting.Log.RootPath)
if err != nil { if err != nil {
log.Error("Failed to check if %s exists: %v", setting.Log.RootPath, err) log.Error("Unable to check if %s exists. Error: %v", setting.Log.RootPath, err)
} }
if isExist { if isExist {
if err := addRecursiveExclude(w, "log", setting.Log.RootPath, []string{absFileName}, verbose); err != nil { if err := addRecursiveExclude(w, "log", setting.Log.RootPath, []string{absFileName}, verbose); err != nil {
@ -466,7 +456,7 @@ func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeA
currentInsidePath := path.Join(insidePath, file.Name()) currentInsidePath := path.Join(insidePath, file.Name())
if util.SliceContainsString(excludeAbsPath, currentAbsPath) { if util.SliceContainsString(excludeAbsPath, currentAbsPath) {
log.Debug("Skipping %q (matched an excluded path)", currentAbsPath) log.Debug("Skipping %q because matched an excluded path.", currentAbsPath)
continue continue
} }

View file

@ -10,14 +10,14 @@ import (
"os" "os"
"strings" "strings"
"forgejo.org/modules/git" "code.gitea.io/gitea/modules/git"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
base "forgejo.org/modules/migration" base "code.gitea.io/gitea/modules/migration"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/structs" "code.gitea.io/gitea/modules/structs"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
"forgejo.org/services/convert" "code.gitea.io/gitea/services/convert"
"forgejo.org/services/migrations" "code.gitea.io/gitea/services/migrations"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -10,13 +10,13 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"forgejo.org/modules/assetfs" "code.gitea.io/gitea/modules/assetfs"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/options" "code.gitea.io/gitea/modules/options"
"forgejo.org/modules/public" "code.gitea.io/gitea/modules/public"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/templates" "code.gitea.io/gitea/modules/templates"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
"github.com/gobwas/glob" "github.com/gobwas/glob"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"

View file

@ -11,10 +11,10 @@ import (
"os" "os"
"strings" "strings"
actions_model "forgejo.org/models/actions" actions_model "code.gitea.io/gitea/models/actions"
"forgejo.org/modules/private" "code.gitea.io/gitea/modules/private"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
private_routers "forgejo.org/routers/private" private_routers "code.gitea.io/gitea/routers/private"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -7,7 +7,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"forgejo.org/services/context" "code.gitea.io/gitea/services/context"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"

View file

@ -8,14 +8,14 @@ import (
"context" "context"
"errors" "errors"
"forgejo.org/models" "code.gitea.io/gitea/models"
"forgejo.org/modules/git" "code.gitea.io/gitea/modules/git"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/storage" "code.gitea.io/gitea/modules/storage"
"forgejo.org/services/f3/util" "code.gitea.io/gitea/services/f3/util"
_ "forgejo.org/services/f3/driver" // register the driver _ "code.gitea.io/gitea/services/f3/driver" // register the driver
f3_cmd "code.forgejo.org/f3/gof3/v3/cmd" f3_cmd "code.forgejo.org/f3/gof3/v3/cmd"
f3_logger "code.forgejo.org/f3/gof3/v3/logger" f3_logger "code.forgejo.org/f3/gof3/v3/logger"

View file

@ -11,10 +11,10 @@ import (
"os/signal" "os/signal"
"syscall" "syscall"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/private" "code.gitea.io/gitea/modules/private"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"os" "os"
"forgejo.org/modules/generate" "code.gitea.io/gitea/modules/generate"
"github.com/mattn/go-isatty" "github.com/mattn/go-isatty"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"

View file

@ -14,12 +14,12 @@ import (
"strings" "strings"
"time" "time"
"forgejo.org/modules/git" "code.gitea.io/gitea/modules/git"
"forgejo.org/modules/git/pushoptions" "code.gitea.io/gitea/modules/git/pushoptions"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/private" "code.gitea.io/gitea/modules/private"
repo_module "forgejo.org/modules/repository" repo_module "code.gitea.io/gitea/modules/repository"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -6,6 +6,7 @@ package cmd
import ( import (
"bufio" "bufio"
"bytes" "bytes"
"context"
"io" "io"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
@ -14,8 +15,8 @@ import (
"testing" "testing"
"time" "time"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/test" "code.gitea.io/gitea/modules/test"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
@ -41,7 +42,7 @@ func captureOutput(t *testing.T, stdFD *os.File) (finish func() (output string))
} }
func TestPktLine(t *testing.T) { func TestPktLine(t *testing.T) {
ctx := t.Context() ctx := context.Background()
t.Run("Read", func(t *testing.T) { t.Run("Read", func(t *testing.T) {
s := strings.NewReader("0000") s := strings.NewReader("0000")

View file

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

View file

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

View file

@ -10,9 +10,9 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"forgejo.org/cmd/forgejo" "code.gitea.io/gitea/cmd/forgejo"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@ -206,7 +206,6 @@ func innerNewMainApp(version, versionExtra string, subCmdsStandaloneArgs, subCmd
app.Commands = append(app.Commands, subCmdWithConfig...) app.Commands = append(app.Commands, subCmdWithConfig...)
app.Commands = append(app.Commands, subCmdStandalone...) app.Commands = append(app.Commands, subCmdStandalone...)
setting.InitGiteaEnvVars()
return app return app
} }

View file

@ -6,13 +6,14 @@ package cmd
import ( import (
"fmt" "fmt"
"io" "io"
"os"
"path/filepath" "path/filepath"
"strings" "strings"
"testing" "testing"
"forgejo.org/models/unittest" "code.gitea.io/gitea/models/unittest"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/test" "code.gitea.io/gitea/modules/test"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
@ -113,17 +114,37 @@ func TestCliCmd(t *testing.T) {
_, _ = fmt.Fprint(ctx.App.Writer, makePathOutput(setting.AppWorkPath, setting.CustomPath, setting.CustomConf)) _, _ = fmt.Fprint(ctx.App.Writer, makePathOutput(setting.AppWorkPath, setting.CustomPath, setting.CustomConf))
return nil return nil
}) })
for _, c := range cases { var envBackup []string
t.Run(c.cmd, func(t *testing.T) { for _, s := range os.Environ() {
for k, v := range c.env { if strings.HasPrefix(s, "GITEA_") && strings.Contains(s, "=") {
t.Setenv(k, v) envBackup = append(envBackup, s)
}
}
clearGiteaEnv := func() {
for _, s := range os.Environ() {
if strings.HasPrefix(s, "GITEA_") {
_ = os.Unsetenv(s)
} }
args := strings.Split(c.cmd, " ") // for test only, "split" is good enough }
r, err := runTestApp(app, args...) }
require.NoError(t, err, c.cmd) defer func() {
assert.NotEmpty(t, c.exp, c.cmd) clearGiteaEnv()
assert.Contains(t, r.Stdout, c.exp, c.cmd) for _, s := range envBackup {
}) k, v, _ := strings.Cut(s, "=")
_ = os.Setenv(k, v)
}
}()
for _, c := range cases {
clearGiteaEnv()
for k, v := range c.env {
_ = os.Setenv(k, v)
}
args := strings.Split(c.cmd, " ") // for test only, "split" is good enough
r, err := runTestApp(app, args...)
require.NoError(t, err, c.cmd)
assert.NotEmpty(t, c.exp, c.cmd)
assert.Contains(t, r.Stdout, c.exp, c.cmd)
} }
} }

View file

@ -7,7 +7,7 @@ import (
"os" "os"
"time" "time"
"forgejo.org/modules/private" "code.gitea.io/gitea/modules/private"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

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

View file

@ -6,10 +6,10 @@ package cmd
import ( import (
"context" "context"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/models/migrations" "code.gitea.io/gitea/models/migrations"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -10,17 +10,17 @@ import (
"io/fs" "io/fs"
"strings" "strings"
actions_model "forgejo.org/models/actions" actions_model "code.gitea.io/gitea/models/actions"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
git_model "forgejo.org/models/git" git_model "code.gitea.io/gitea/models/git"
"forgejo.org/models/migrations" "code.gitea.io/gitea/models/migrations"
packages_model "forgejo.org/models/packages" packages_model "code.gitea.io/gitea/models/packages"
repo_model "forgejo.org/models/repo" repo_model "code.gitea.io/gitea/models/repo"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
packages_module "forgejo.org/modules/packages" packages_module "code.gitea.io/gitea/modules/packages"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/storage" "code.gitea.io/gitea/modules/storage"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -4,21 +4,22 @@
package cmd package cmd
import ( import (
"context"
"io" "io"
"os" "os"
"strings" "strings"
"testing" "testing"
"forgejo.org/models/actions" "code.gitea.io/gitea/models/actions"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/models/packages" "code.gitea.io/gitea/models/packages"
"forgejo.org/models/unittest" "code.gitea.io/gitea/models/unittest"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
packages_module "forgejo.org/modules/packages" packages_module "code.gitea.io/gitea/modules/packages"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/modules/storage" "code.gitea.io/gitea/modules/storage"
"forgejo.org/modules/test" "code.gitea.io/gitea/modules/test"
packages_service "forgejo.org/services/packages" packages_service "code.gitea.io/gitea/services/packages"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
@ -30,7 +31,7 @@ func createLocalStorage(t *testing.T) (storage.ObjectStorage, string) {
p := t.TempDir() p := t.TempDir()
storage, err := storage.NewLocalStorage( storage, err := storage.NewLocalStorage(
t.Context(), context.Background(),
&setting.Storage{ &setting.Storage{
Path: p, Path: p,
}) })
@ -71,7 +72,7 @@ func TestMigratePackages(t *testing.T) {
assert.NotNil(t, v) assert.NotNil(t, v)
assert.NotNil(t, f) assert.NotNil(t, f)
ctx := t.Context() ctx := context.Background()
dstStorage, p := createLocalStorage(t) dstStorage, p := createLocalStorage(t)

View file

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

View file

@ -18,18 +18,18 @@ import (
"time" "time"
"unicode" "unicode"
asymkey_model "forgejo.org/models/asymkey" asymkey_model "code.gitea.io/gitea/models/asymkey"
git_model "forgejo.org/models/git" git_model "code.gitea.io/gitea/models/git"
"forgejo.org/models/perm" "code.gitea.io/gitea/models/perm"
"forgejo.org/modules/git" "code.gitea.io/gitea/modules/git"
"forgejo.org/modules/json" "code.gitea.io/gitea/modules/json"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/pprof" "code.gitea.io/gitea/modules/pprof"
"forgejo.org/modules/private" "code.gitea.io/gitea/modules/private"
"forgejo.org/modules/process" "code.gitea.io/gitea/modules/process"
repo_module "forgejo.org/modules/repository" repo_module "code.gitea.io/gitea/modules/repository"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/services/lfs" "code.gitea.io/gitea/services/lfs"
"github.com/golang-jwt/jwt/v5" "github.com/golang-jwt/jwt/v5"
"github.com/kballard/go-shellquote" "github.com/kballard/go-shellquote"
@ -80,7 +80,7 @@ var (
"git-upload-archive": perm.AccessModeRead, "git-upload-archive": perm.AccessModeRead,
"git-receive-pack": perm.AccessModeWrite, "git-receive-pack": perm.AccessModeWrite,
lfsAuthenticateVerb: perm.AccessModeNone, lfsAuthenticateVerb: perm.AccessModeNone,
gitAnnexShellVerb: perm.AccessModeRead, // annex permissions are enforced by GIT_ANNEX_SHELL_READONLY, rather than the Gitea API, but read permissions are required at a minimum gitAnnexShellVerb: perm.AccessModeNone, // annex permissions are enforced by GIT_ANNEX_SHELL_READONLY, rather than the Gitea API
} }
alphaDashDotPattern = regexp.MustCompile(`[^\w-\.]`) alphaDashDotPattern = regexp.MustCompile(`[^\w-\.]`)
) )

View file

@ -13,18 +13,17 @@ import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"time"
_ "net/http/pprof" // Used for debugging if enabled and a web server is running _ "net/http/pprof" // Used for debugging if enabled and a web server is running
"forgejo.org/modules/container" "code.gitea.io/gitea/modules/container"
"forgejo.org/modules/graceful" "code.gitea.io/gitea/modules/graceful"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/process" "code.gitea.io/gitea/modules/process"
"forgejo.org/modules/public" "code.gitea.io/gitea/modules/public"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"forgejo.org/routers" "code.gitea.io/gitea/routers"
"forgejo.org/routers/install" "code.gitea.io/gitea/routers/install"
"github.com/felixge/fgprof" "github.com/felixge/fgprof"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
@ -117,16 +116,6 @@ func showWebStartupMessage(msg string) {
log.Info("* CustomPath: %s", setting.CustomPath) log.Info("* CustomPath: %s", setting.CustomPath)
log.Info("* ConfigFile: %s", setting.CustomConf) log.Info("* ConfigFile: %s", setting.CustomConf)
log.Info("%s", msg) // show startup message log.Info("%s", msg) // show startup message
if setting.CORSConfig.Enabled {
log.Info("CORS Service Enabled")
}
if setting.DefaultUILocation != time.Local {
log.Info("Default UI Location is %v", setting.DefaultUILocation.String())
}
if setting.MailService != nil {
log.Info("Mail Service Enabled: RegisterEmailConfirm=%v, Service.EnableNotifyMail=%v", setting.Service.RegisterEmailConfirm, setting.Service.EnableNotifyMail)
}
} }
func serveInstall(ctx *cli.Context) error { func serveInstall(ctx *cli.Context) error {
@ -196,7 +185,7 @@ func serveInstalled(ctx *cli.Context) error {
publicFilesSet.Remove(".well-known") publicFilesSet.Remove(".well-known")
publicFilesSet.Remove("assets") publicFilesSet.Remove("assets")
publicFilesSet.Remove("robots.txt") publicFilesSet.Remove("robots.txt")
for fn := range publicFilesSet.Seq() { for _, fn := range publicFilesSet.Values() {
log.Error("Found legacy public asset %q in CustomPath. Please move it to %s/public/assets/%s", fn, setting.CustomPath, fn) 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 { if _, err := os.Stat(filepath.Join(setting.CustomPath, "robots.txt")); err == nil {

View file

@ -12,10 +12,10 @@ import (
"strconv" "strconv"
"strings" "strings"
"forgejo.org/modules/graceful" "code.gitea.io/gitea/modules/graceful"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/process" "code.gitea.io/gitea/modules/process"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"github.com/caddyserver/certmagic" "github.com/caddyserver/certmagic"
) )

View file

@ -9,9 +9,9 @@ import (
"net/http/fcgi" "net/http/fcgi"
"strings" "strings"
"forgejo.org/modules/graceful" "code.gitea.io/gitea/modules/graceful"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
) )
func runHTTP(network, listenAddr, name string, m http.Handler, useProxyProtocol bool) error { func runHTTP(network, listenAddr, name string, m http.Handler, useProxyProtocol bool) error {

View file

@ -9,9 +9,9 @@ import (
"os" "os"
"strings" "strings"
"forgejo.org/modules/graceful" "code.gitea.io/gitea/modules/graceful"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
"github.com/klauspost/cpuid/v2" "github.com/klauspost/cpuid/v2"
) )

View file

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

View file

@ -1941,7 +1941,7 @@ LEVEL = Info
;ENABLED = true ;ENABLED = true
;; ;;
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types. ;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
;ALLOWED_TYPES = .avif,.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.webp,.xls,.xlsx,.zip ;ALLOWED_TYPES = .avif,.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
;; ;;
;; Max size of each file. Defaults to 2048MB ;; Max size of each file. Defaults to 2048MB
;MAX_SIZE = 2048 ;MAX_SIZE = 2048
@ -2407,8 +2407,8 @@ LEVEL = Info
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The first locale will be used as the default if user browser's language doesn't match any locale in the list. ;; 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 ;LANGS = en-US,zh-CN,zh-HK,zh-TW,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,简体中文,繁體中文(香港),繁體中文(台灣),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 ;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -37,5 +37,5 @@ done
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
exec "$@" exec "$@"
else else
exec /usr/bin/s6-svscan /etc/s6 exec /bin/s6-svscan /etc/s6
fi fi

View file

@ -14,7 +14,6 @@ import wc from 'eslint-plugin-wc';
import globals from 'globals'; import globals from 'globals';
import vue from 'eslint-plugin-vue'; import vue from 'eslint-plugin-vue';
import vueScopedCss from 'eslint-plugin-vue-scoped-css'; import vueScopedCss from 'eslint-plugin-vue-scoped-css';
import toml from 'eslint-plugin-toml';
import tseslint from 'typescript-eslint'; import tseslint from 'typescript-eslint';
export default tseslint.config( export default tseslint.config(
@ -29,13 +28,13 @@ export default tseslint.config(
'@stylistic/js': stylisticEslintPluginJs, '@stylistic/js': stylisticEslintPluginJs,
'@vitest': vitest, '@vitest': vitest,
'array-func': arrayFunc, 'array-func': arrayFunc,
'import-x': eslintPluginImportX,
'no-jquery': noJquery, 'no-jquery': noJquery,
'no-use-extend-native': noUseExtendNative, 'no-use-extend-native': noUseExtendNative,
regexp, regexp,
sonarjs, sonarjs,
unicorn, unicorn,
playwright, playwright,
toml,
'vitest-globals': vitestGlobals, 'vitest-globals': vitestGlobals,
vue, vue,
'vue-scoped-css': vueScopedCss, 'vue-scoped-css': vueScopedCss,
@ -722,8 +721,6 @@ export default tseslint.config(
'unicode-bom': [2, 'never'], 'unicode-bom': [2, 'never'],
'unicorn/better-regex': [0], 'unicorn/better-regex': [0],
'unicorn/catch-error-name': [0], 'unicorn/catch-error-name': [0],
'unicorn/consistent-assert': [0],
'unicorn/consistent-date-clone': [2],
'unicorn/consistent-destructuring': [2], 'unicorn/consistent-destructuring': [2],
'unicorn/consistent-empty-array-spread': [2], 'unicorn/consistent-empty-array-spread': [2],
'unicorn/consistent-existence-index-check': [2], 'unicorn/consistent-existence-index-check': [2],
@ -738,7 +735,6 @@ export default tseslint.config(
'unicorn/import-index': [0], 'unicorn/import-index': [0],
'unicorn/import-style': [0], 'unicorn/import-style': [0],
'unicorn/new-for-builtins': [2], 'unicorn/new-for-builtins': [2],
'unicorn/no-accessor-recursion': [2],
'unicorn/no-abusive-eslint-disable': [0], 'unicorn/no-abusive-eslint-disable': [0],
'unicorn/no-anonymous-default-export': [0], 'unicorn/no-anonymous-default-export': [0],
'unicorn/no-array-callback-reference': [0], 'unicorn/no-array-callback-reference': [0],
@ -753,14 +749,13 @@ export default tseslint.config(
'unicorn/no-empty-file': [2], 'unicorn/no-empty-file': [2],
'unicorn/no-for-loop': [0], 'unicorn/no-for-loop': [0],
'unicorn/no-hex-escape': [0], 'unicorn/no-hex-escape': [0],
'unicorn/no-instanceof-builtins': [0], 'unicorn/no-instanceof-array': [0],
'unicorn/no-invalid-fetch-options': [2], 'unicorn/no-invalid-fetch-options': [2],
'unicorn/no-invalid-remove-event-listener': [2], 'unicorn/no-invalid-remove-event-listener': [2],
'unicorn/no-keyword-prefix': [0], 'unicorn/no-keyword-prefix': [0],
'unicorn/no-length-as-slice-end': [2], 'unicorn/no-length-as-slice-end': [2],
'unicorn/no-lonely-if': [2], 'unicorn/no-lonely-if': [2],
'unicorn/no-magic-array-flat-depth': [0], 'unicorn/no-magic-array-flat-depth': [0],
'unicorn/no-named-default': [2],
'unicorn/no-negated-condition': [0], 'unicorn/no-negated-condition': [0],
'unicorn/no-negation-in-equality-check': [2], 'unicorn/no-negation-in-equality-check': [2],
'unicorn/no-nested-ternary': [0], 'unicorn/no-nested-ternary': [0],
@ -837,6 +832,7 @@ export default tseslint.config(
'unicorn/prefer-structured-clone': [2], 'unicorn/prefer-structured-clone': [2],
'unicorn/prefer-switch': [0], 'unicorn/prefer-switch': [0],
'unicorn/prefer-ternary': [0], 'unicorn/prefer-ternary': [0],
'unicorn/prefer-text-content': [2],
'unicorn/prefer-top-level-await': [0], 'unicorn/prefer-top-level-await': [0],
'unicorn/prefer-type-error': [0], 'unicorn/prefer-type-error': [0],
'unicorn/prevent-abbreviations': [0], 'unicorn/prevent-abbreviations': [0],
@ -1170,5 +1166,5 @@ export default tseslint.config(
'vue-scoped-css/enforce-style-type': [0], 'vue-scoped-css/enforce-style-type': [0],
}, },
}, },
...toml.configs['flat/recommended'],
); );

195
go.mod
View file

@ -1,39 +1,38 @@
module forgejo.org module code.gitea.io/gitea
go 1.24 go 1.23
toolchain go1.24.3 toolchain go1.23.5
require ( require (
code.forgejo.org/f3/gof3/v3 v3.10.6 code.forgejo.org/f3/gof3/v3 v3.10.2
code.forgejo.org/forgejo-contrib/go-libravatar v0.0.0-20191008002943-06d1c002b251 code.forgejo.org/forgejo-contrib/go-libravatar v0.0.0-20191008002943-06d1c002b251
code.forgejo.org/forgejo/levelqueue v1.0.0
code.forgejo.org/forgejo/reply v1.0.2 code.forgejo.org/forgejo/reply v1.0.2
code.forgejo.org/go-chi/binding v1.0.0 code.forgejo.org/go-chi/binding v1.0.0
code.forgejo.org/go-chi/cache 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/captcha v1.0.1
code.forgejo.org/go-chi/session v1.0.1 code.forgejo.org/go-chi/session v1.0.1
code.gitea.io/actions-proto-go v0.4.0 code.gitea.io/actions-proto-go v0.4.0
code.gitea.io/sdk/gitea v0.20.0 code.gitea.io/sdk/gitea v0.17.1
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570 codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
connectrpc.com/connect v1.17.0 connectrpc.com/connect v1.17.0
github.com/42wim/httpsig v1.2.2 gitea.com/lunny/levelqueue v0.4.2-0.20230414023320-3c0159fe0fe4
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121 github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
github.com/ProtonMail/go-crypto v1.1.6 github.com/ProtonMail/go-crypto v1.1.3
github.com/PuerkitoBio/goquery v1.10.2 github.com/PuerkitoBio/goquery v1.10.0
github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.7.2 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.15.0
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
github.com/blevesearch/bleve/v2 v2.5.2 github.com/blevesearch/bleve/v2 v2.4.4
github.com/buildkite/terminal-to-html/v3 v3.16.8 github.com/buildkite/terminal-to-html/v3 v3.16.4
github.com/caddyserver/certmagic v0.22.2 github.com/caddyserver/certmagic v0.21.4
github.com/chi-middleware/proxy v1.1.1 github.com/chi-middleware/proxy v1.1.1
github.com/djherbis/buffer v1.2.0 github.com/djherbis/buffer v1.2.0
github.com/djherbis/nio/v3 v3.0.1 github.com/djherbis/nio/v3 v3.0.1
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
github.com/dustin/go-humanize v1.0.1 github.com/dustin/go-humanize v1.0.1
github.com/editorconfig/editorconfig-core-go/v2 v2.6.3 github.com/editorconfig/editorconfig-core-go/v2 v2.6.2
github.com/emersion/go-imap v1.2.1 github.com/emersion/go-imap v1.2.1
github.com/felixge/fgprof v0.9.5 github.com/felixge/fgprof v0.9.5
github.com/fsnotify/fsnotify v1.8.0 github.com/fsnotify/fsnotify v1.8.0
@ -43,48 +42,50 @@ require (
github.com/go-chi/chi/v5 v5.2.0 github.com/go-chi/chi/v5 v5.2.0
github.com/go-chi/cors v1.2.1 github.com/go-chi/cors v1.2.1
github.com/go-co-op/gocron v1.37.0 github.com/go-co-op/gocron v1.37.0
github.com/go-enry/go-enry/v2 v2.9.2 github.com/go-enry/go-enry/v2 v2.9.1
github.com/go-git/go-git/v5 v5.13.2 github.com/go-fed/httpsig v1.1.1-0.20201223112313-55836744818e
github.com/go-git/go-git/v5 v5.13.1
github.com/go-ldap/ldap/v3 v3.4.6 github.com/go-ldap/ldap/v3 v3.4.6
github.com/go-openapi/spec v0.20.14 github.com/go-openapi/spec v0.20.14
github.com/go-sql-driver/mysql v1.9.1 github.com/go-sql-driver/mysql v1.8.1
github.com/go-webauthn/webauthn v0.12.2 github.com/go-testfixtures/testfixtures/v3 v3.14.0
github.com/go-webauthn/webauthn v0.11.2
github.com/gobwas/glob v0.2.3 github.com/gobwas/glob v0.2.3
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85 github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
github.com/golang-jwt/jwt/v5 v5.2.2 github.com/golang-jwt/jwt/v5 v5.2.1
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/google/go-github/v64 v64.0.0 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-20241017200806-017d972448fc
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
github.com/gorilla/feeds v1.2.0 github.com/gorilla/feeds v1.2.0
github.com/gorilla/sessions v1.4.0 github.com/gorilla/sessions v1.4.0
github.com/hashicorp/go-version v1.7.0 github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/huandu/xstrings v1.5.0 github.com/huandu/xstrings v1.5.0
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
github.com/jhillyerd/enmime/v2 v2.1.0 github.com/jhillyerd/enmime/v2 v2.0.0
github.com/json-iterator/go v1.1.12 github.com/json-iterator/go v1.1.12
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/klauspost/compress v1.17.11 github.com/klauspost/compress v1.17.11
github.com/klauspost/cpuid/v2 v2.2.10 github.com/klauspost/cpuid/v2 v2.2.8
github.com/lib/pq v1.10.9 github.com/lib/pq v1.10.9
github.com/markbates/goth v1.80.0 github.com/markbates/goth v1.80.0
github.com/mattn/go-isatty v0.0.20 github.com/mattn/go-isatty v0.0.20
github.com/mattn/go-sqlite3 v1.14.28 github.com/mattn/go-sqlite3 v1.14.24
github.com/meilisearch/meilisearch-go v0.31.0 github.com/meilisearch/meilisearch-go v0.29.0
github.com/mholt/archiver/v3 v3.5.1 github.com/mholt/archiver/v3 v3.5.1
github.com/microcosm-cc/bluemonday v1.0.27 github.com/microcosm-cc/bluemonday v1.0.27
github.com/minio/minio-go/v7 v7.0.88 github.com/minio/minio-go/v7 v7.0.78
github.com/msteinert/pam/v2 v2.1.0 github.com/msteinert/pam v1.2.0
github.com/nektos/act v0.2.52 github.com/nektos/act v0.2.52
github.com/niklasfasching/go-org v1.7.0 github.com/niklasfasching/go-org v1.7.0
github.com/olivere/elastic/v7 v7.0.32 github.com/olivere/elastic/v7 v7.0.32
github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1 github.com/opencontainers/image-spec v1.1.0
github.com/pquerna/otp v1.4.0 github.com/pquerna/otp v1.4.0
github.com/prometheus/client_golang v1.21.1 github.com/prometheus/client_golang v1.20.5
github.com/redis/go-redis/v9 v9.7.3 github.com/redis/go-redis/v9 v9.7.0
github.com/robfig/cron/v3 v3.0.1 github.com/robfig/cron/v3 v3.0.1
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 github.com/santhosh-tekuri/jsonschema/v6 v6.0.1
github.com/sassoftware/go-rpmutils v0.4.0 github.com/sassoftware/go-rpmutils v0.4.0
@ -93,21 +94,22 @@ require (
github.com/stretchr/testify v1.10.0 github.com/stretchr/testify v1.10.0
github.com/syndtr/goleveldb v1.0.0 github.com/syndtr/goleveldb v1.0.0
github.com/ulikunitz/xz v0.5.12 github.com/ulikunitz/xz v0.5.12
github.com/urfave/cli/v2 v2.27.6 github.com/urfave/cli/v2 v2.27.5
github.com/valyala/fastjson v1.6.4 github.com/valyala/fastjson v1.6.4
github.com/xanzy/go-gitlab v0.109.0
github.com/yohcop/openid-go v1.0.1 github.com/yohcop/openid-go v1.0.1
github.com/yuin/goldmark v1.7.8 github.com/yuin/goldmark v1.7.8
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc 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.4.0
go.uber.org/mock v0.5.0 golang.org/x/crypto v0.31.0
golang.org/x/crypto v0.36.0 golang.org/x/image v0.23.0
golang.org/x/image v0.25.0 golang.org/x/net v0.33.0
golang.org/x/net v0.38.0 golang.org/x/oauth2 v0.23.0
golang.org/x/oauth2 v0.28.0 golang.org/x/sync v0.10.0
golang.org/x/sync v0.12.0 golang.org/x/sys v0.28.0
golang.org/x/sys v0.31.0 golang.org/x/text v0.21.0
golang.org/x/text v0.23.0 google.golang.org/grpc v1.69.2
google.golang.org/protobuf v1.36.4 google.golang.org/protobuf v1.36.1
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gopkg.in/ini.v1 v1.67.0 gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
@ -117,42 +119,55 @@ require (
) )
require ( require (
cloud.google.com/go/compute/metadata v0.6.0 // indirect cel.dev/expr v0.16.2 // 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.5.2 // 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 dario.cat/mergo v1.0.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
github.com/42wim/httpsig v1.2.2 // indirect
github.com/DataDog/zstd v1.5.5 // 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.24.2 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/RoaringBitmap/roaring/v2 v2.4.5 // indirect github.com/RoaringBitmap/roaring v1.9.3 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect github.com/andybalholm/brotli v1.1.1 // indirect
github.com/andybalholm/cascadia v1.3.3 // indirect github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/aymerick/douceur v0.2.0 // indirect github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.22.0 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/blevesearch/bleve_index_api v1.2.8 // indirect github.com/blevesearch/bleve_index_api v1.1.12 // indirect
github.com/blevesearch/geo v0.2.3 // indirect github.com/blevesearch/geo v0.1.20 // indirect
github.com/blevesearch/go-faiss v1.0.25 // indirect github.com/blevesearch/go-faiss v1.0.24 // indirect
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
github.com/blevesearch/gtreap v0.1.1 // indirect github.com/blevesearch/gtreap v0.1.1 // indirect
github.com/blevesearch/mmap-go v1.0.4 // indirect github.com/blevesearch/mmap-go v1.0.4 // indirect
github.com/blevesearch/scorch_segment_api/v2 v2.3.10 // indirect github.com/blevesearch/scorch_segment_api/v2 v2.2.16 // indirect
github.com/blevesearch/segment v0.9.1 // indirect github.com/blevesearch/segment v0.9.1 // indirect
github.com/blevesearch/snowballstem v0.9.0 // indirect github.com/blevesearch/snowballstem v0.9.0 // indirect
github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect github.com/blevesearch/upsidedown_store_api v1.0.2 // indirect
github.com/blevesearch/vellum v1.1.0 // indirect github.com/blevesearch/vellum v1.0.10 // indirect
github.com/blevesearch/zapx/v11 v11.4.2 // indirect github.com/blevesearch/zapx/v11 v11.3.10 // indirect
github.com/blevesearch/zapx/v12 v12.4.2 // indirect github.com/blevesearch/zapx/v12 v12.3.10 // indirect
github.com/blevesearch/zapx/v13 v13.4.2 // indirect github.com/blevesearch/zapx/v13 v13.3.10 // indirect
github.com/blevesearch/zapx/v14 v14.4.2 // indirect github.com/blevesearch/zapx/v14 v14.3.10 // indirect
github.com/blevesearch/zapx/v15 v15.4.2 // indirect github.com/blevesearch/zapx/v15 v15.3.16 // indirect
github.com/blevesearch/zapx/v16 v16.2.4 // indirect github.com/blevesearch/zapx/v16 v16.1.9-0.20241217210638-a0519e7caf3b // indirect
github.com/boombuler/barcode v1.0.1 // 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-20230905024940-24af94b03874 // indirect
github.com/caddyserver/zerossl v0.1.3 // indirect github.com/caddyserver/zerossl v0.1.3 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.6.1 // indirect github.com/cloudflare/circl v1.3.8 // indirect
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // indirect github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
@ -161,28 +176,37 @@ require (
github.com/dlclark/regexp2 v1.11.4 // indirect github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 // indirect github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 // indirect
github.com/emirpasic/gods v1.18.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect
github.com/envoyproxy/go-control-plane v0.13.1 // indirect
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
github.com/fatih/color v1.16.0 // indirect github.com/fatih/color v1.16.0 // indirect
github.com/fxamacker/cbor/v2 v2.8.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-ap/errors v0.0.0-20231003111023-183eef4b31b7 // 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-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/go-enry/go-oniguruma v1.2.1 // indirect github.com/go-enry/go-oniguruma v1.2.1 // indirect
github.com/go-fed/httpsig v1.1.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect 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-git/go-billy/v5 v5.6.1 // indirect
github.com/go-ini/ini v1.67.0 // 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/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.7 // indirect github.com/go-openapi/swag v0.22.7 // indirect
github.com/go-webauthn/x v0.1.20 // indirect github.com/go-webauthn/x v0.1.14 // indirect
github.com/goccy/go-json v0.10.5 // indirect github.com/goccy/go-json v0.10.3 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.7.0 // indirect github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect github.com/google/go-querystring v1.1.0 // indirect
github.com/google/go-tpm v0.9.3 // indirect github.com/google/go-tpm v0.9.1 // 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/gorilla/css v1.0.1 // indirect github.com/gorilla/css v1.0.1 // indirect
github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect github.com/gorilla/securecookie v1.1.2 // indirect
@ -192,14 +216,13 @@ require (
github.com/josharian/intern v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect github.com/klauspost/pgzip v1.2.6 // indirect
github.com/libdns/libdns v0.2.3 // indirect github.com/libdns/libdns v0.2.2 // indirect
github.com/mailru/easyjson v0.9.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect
github.com/markbates/going v1.0.3 // indirect github.com/markbates/going v1.0.3 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mholt/acmez/v3 v3.1.1 // indirect github.com/mholt/acmez/v2 v2.0.3 // indirect
github.com/miekg/dns v1.1.63 // indirect github.com/miekg/dns v1.1.62 // indirect
github.com/minio/crc64nvme v1.0.1 // indirect
github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/md5-simd v1.1.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
@ -211,15 +234,15 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/ginkgo v1.16.5 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // 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/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect
github.com/rhysd/actionlint v1.6.27 // indirect github.com/rhysd/actionlint v1.6.27 // indirect
github.com/rivo/uniseg v0.4.7 // 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/rs/xid v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
@ -230,16 +253,28 @@ require (
github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // 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 github.com/zeebo/blake3 v0.2.4 // indirect
go.etcd.io/bbolt v1.4.0 // indirect gitlab.com/gitlab-org/api/client-go v0.116.0 // indirect
go.etcd.io/bbolt v1.3.9 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.31.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.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.uber.org/atomic v1.11.0 // indirect go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect go.uber.org/zap v1.27.0 // indirect
go.uber.org/zap/exp v0.3.0 // indirect golang.org/x/mod v0.22.0 // indirect
golang.org/x/mod v0.24.0 // indirect golang.org/x/time v0.7.0 // indirect
golang.org/x/time v0.10.0 // indirect golang.org/x/tools v0.28.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-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect
) )
@ -248,10 +283,10 @@ 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/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.22.0
replace github.com/mholt/archiver/v3 => code.forgejo.org/forgejo/archiver/v3 v3.5.1 replace github.com/mholt/archiver/v3 => code.forgejo.org/forgejo/archiver/v3 v3.5.1
replace github.com/gliderlabs/ssh => code.forgejo.org/forgejo/ssh v0.0.0-20241211213324-5fc306ca0616 replace github.com/goccy/go-json => github.com/grafana/go-json v0.0.0-20241210211703-a119ee5a0a3b
replace git.sr.ht/~mariusor/go-xsd-duration => code.forgejo.org/forgejo/go-xsd-duration v0.0.0-20220703122237-02e73435a078 replace github.com/gliderlabs/ssh => code.forgejo.org/forgejo/ssh v0.0.0-20241211213324-5fc306ca0616

1833
go.sum

File diff suppressed because it is too large Load diff

16
main.go
View file

@ -10,16 +10,16 @@ import (
"strings" "strings"
"time" "time"
"forgejo.org/cmd" "code.gitea.io/gitea/cmd"
"forgejo.org/modules/log" "code.gitea.io/gitea/modules/log"
"forgejo.org/modules/setting" "code.gitea.io/gitea/modules/setting"
// register supported doc types // register supported doc types
_ "forgejo.org/modules/markup/asciicast" _ "code.gitea.io/gitea/modules/markup/asciicast"
_ "forgejo.org/modules/markup/console" _ "code.gitea.io/gitea/modules/markup/console"
_ "forgejo.org/modules/markup/csv" _ "code.gitea.io/gitea/modules/markup/csv"
_ "forgejo.org/modules/markup/markdown" _ "code.gitea.io/gitea/modules/markup/markdown"
_ "forgejo.org/modules/markup/orgmode" _ "code.gitea.io/gitea/modules/markup/orgmode"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View file

@ -11,9 +11,9 @@ import (
"errors" "errors"
"time" "time"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
"xorm.io/builder" "xorm.io/builder"
) )

View file

@ -7,9 +7,9 @@ import (
"crypto/subtle" "crypto/subtle"
"fmt" "fmt"
auth_model "forgejo.org/models/auth" auth_model "code.gitea.io/gitea/models/auth"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
gouuid "github.com/google/uuid" gouuid "github.com/google/uuid"
) )

View file

@ -6,9 +6,9 @@ import (
"crypto/subtle" "crypto/subtle"
"testing" "testing"
auth_model "forgejo.org/models/auth" auth_model "code.gitea.io/gitea/models/auth"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/models/unittest" "code.gitea.io/gitea/models/unittest"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"

View file

@ -6,7 +6,7 @@ package actions
import ( import (
"testing" "testing"
"forgejo.org/models/unittest" "code.gitea.io/gitea/models/unittest"
) )
func TestMain(m *testing.M) { func TestMain(m *testing.M) {

View file

@ -10,15 +10,15 @@ import (
"strings" "strings"
"time" "time"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
repo_model "forgejo.org/models/repo" repo_model "code.gitea.io/gitea/models/repo"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"forgejo.org/modules/git" "code.gitea.io/gitea/modules/git"
"forgejo.org/modules/json" "code.gitea.io/gitea/modules/json"
api "forgejo.org/modules/structs" api "code.gitea.io/gitea/modules/structs"
"forgejo.org/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
webhook_module "forgejo.org/modules/webhook" webhook_module "code.gitea.io/gitea/modules/webhook"
"github.com/nektos/act/pkg/jobparser" "github.com/nektos/act/pkg/jobparser"
"xorm.io/builder" "xorm.io/builder"

View file

@ -9,10 +9,9 @@ import (
"slices" "slices"
"time" "time"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/modules/container" "code.gitea.io/gitea/modules/timeutil"
"forgejo.org/modules/timeutil" "code.gitea.io/gitea/modules/util"
"forgejo.org/modules/util"
"xorm.io/builder" "xorm.io/builder"
) )
@ -72,15 +71,6 @@ func (job *ActionRunJob) LoadAttributes(ctx context.Context) error {
return job.Run.LoadAttributes(ctx) return job.Run.LoadAttributes(ctx)
} }
func (job *ActionRunJob) ItRunsOn(labels []string) bool {
if len(labels) == 0 || len(job.RunsOn) == 0 {
return false
}
labelSet := make(container.Set[string])
labelSet.AddMultiple(labels...)
return labelSet.IsSubset(job.RunsOn)
}
func GetRunJobByID(ctx context.Context, id int64) (*ActionRunJob, error) { func GetRunJobByID(ctx context.Context, id int64) (*ActionRunJob, error) {
var job ActionRunJob var job ActionRunJob
has, err := db.GetEngine(ctx).Where("id=?", id).Get(&job) has, err := db.GetEngine(ctx).Where("id=?", id).Get(&job)

View file

@ -6,9 +6,9 @@ package actions
import ( import (
"context" "context"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
"forgejo.org/modules/container" "code.gitea.io/gitea/modules/container"
"forgejo.org/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"
"xorm.io/builder" "xorm.io/builder"
) )

View file

@ -1,29 +0,0 @@
// SPDX-License-Identifier: MIT
package actions
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestActionRunJob_ItRunsOn(t *testing.T) {
actionJob := ActionRunJob{RunsOn: []string{"ubuntu"}}
agentLabels := []string{"ubuntu", "node-20"}
assert.True(t, actionJob.ItRunsOn(agentLabels))
assert.False(t, actionJob.ItRunsOn([]string{}))
actionJob.RunsOn = append(actionJob.RunsOn, "node-20")
assert.True(t, actionJob.ItRunsOn(agentLabels))
agentLabels = []string{"ubuntu"}
assert.False(t, actionJob.ItRunsOn(agentLabels))
actionJob.RunsOn = []string{}
assert.False(t, actionJob.ItRunsOn(agentLabels))
}

View file

@ -6,12 +6,11 @@ package actions
import ( import (
"context" "context"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
repo_model "forgejo.org/models/repo" repo_model "code.gitea.io/gitea/models/repo"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"forgejo.org/modules/container" "code.gitea.io/gitea/modules/container"
"forgejo.org/modules/translation" webhook_module "code.gitea.io/gitea/modules/webhook"
webhook_module "forgejo.org/modules/webhook"
"xorm.io/builder" "xorm.io/builder"
) )
@ -113,14 +112,14 @@ type StatusInfo struct {
} }
// GetStatusInfoList returns a slice of StatusInfo // GetStatusInfoList returns a slice of StatusInfo
func GetStatusInfoList(ctx context.Context, lang translation.Locale) []StatusInfo { func GetStatusInfoList(ctx context.Context) []StatusInfo {
// same as those in aggregateJobStatus // same as those in aggregateJobStatus
allStatus := []Status{StatusSuccess, StatusFailure, StatusWaiting, StatusRunning} allStatus := []Status{StatusSuccess, StatusFailure, StatusWaiting, StatusRunning}
statusInfoList := make([]StatusInfo, 0, 4) statusInfoList := make([]StatusInfo, 0, 4)
for _, s := range allStatus { for _, s := range allStatus {
statusInfoList = append(statusInfoList, StatusInfo{ statusInfoList = append(statusInfoList, StatusInfo{
Status: int(s), Status: int(s),
DisplayedStatus: s.LocaleString(lang), DisplayedStatus: s.String(),
}) })
} }
return statusInfoList return statusInfoList

View file

@ -11,15 +11,15 @@ import (
"strings" "strings"
"time" "time"
auth_model "forgejo.org/models/auth" auth_model "code.gitea.io/gitea/models/auth"
"forgejo.org/models/db" "code.gitea.io/gitea/models/db"
repo_model "forgejo.org/models/repo" repo_model "code.gitea.io/gitea/models/repo"
"forgejo.org/models/shared/types" "code.gitea.io/gitea/models/shared/types"
user_model "forgejo.org/models/user" user_model "code.gitea.io/gitea/models/user"
"forgejo.org/modules/optional" "code.gitea.io/gitea/modules/optional"
"forgejo.org/modules/timeutil" "code.gitea.io/gitea/modules/timeutil"
"forgejo.org/modules/translation" "code.gitea.io/gitea/modules/translation"
"forgejo.org/modules/util" "code.gitea.io/gitea/modules/util"
runnerv1 "code.gitea.io/actions-proto-go/runner/v1" runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
"xorm.io/builder" "xorm.io/builder"

Some files were not shown because too many files have changed in this diff Show more