]> source.dussan.org Git - gitea.git/log
gitea.git
2 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 5 Aug 2024 00:28:44 +0000 (00:28 +0000)]
[skip ci] Updated licenses and gitignores

2 months agoRename head branch of pull requests when renaming a branch (#31759)
Lunny Xiao [Sun, 4 Aug 2024 03:21:42 +0000 (11:21 +0800)]
Rename head branch of pull requests when renaming a branch (#31759)

Fix #31716

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 4 Aug 2024 00:30:13 +0000 (00:30 +0000)]
[skip ci] Updated translations via Crowdin

2 months agoFix wiki revision pagination (#31760)
Lunny Xiao [Sat, 3 Aug 2024 18:35:55 +0000 (02:35 +0800)]
Fix wiki revision pagination (#31760)

Fix #31755

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 3 Aug 2024 00:27:17 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

2 months agoUpdate JS dependencies (#31766)
silverwind [Fri, 2 Aug 2024 21:28:12 +0000 (23:28 +0200)]
Update JS dependencies (#31766)

2 months agoUpgrade bleve to 2.4.2 (#31762)
Lunny Xiao [Fri, 2 Aug 2024 19:32:31 +0000 (03:32 +0800)]
Upgrade bleve to 2.4.2 (#31762)

2 months agoRemove unused code from models/repos/release.go (#31756)
Kemal Zebari [Fri, 2 Aug 2024 14:23:49 +0000 (07:23 -0700)]
Remove unused code from models/repos/release.go (#31756)

These blocks aren't used anywhere else when doing a grep search.

2 months agoClear up old Actions logs (#31735)
Jason Song [Fri, 2 Aug 2024 00:42:08 +0000 (08:42 +0800)]
Clear up old Actions logs (#31735)

Part of #24256.

Clear up old action logs to free up storage space.

Users will see a message indicating that the log has been cleared if
they view old tasks.

<img width="1361" alt="image"
src="https://github.com/user-attachments/assets/9f0f3a3a-bc5a-402f-90ca-49282d196c22">

Docs: https://gitea.com/gitea/docs/pulls/40

---------

Co-authored-by: silverwind <me@silverwind.io>
2 months agoFix createElementFromAttrs bug (#31751)
wxiaoguang [Thu, 1 Aug 2024 19:06:03 +0000 (03:06 +0800)]
Fix createElementFromAttrs bug (#31751)

The "false" value was not handled correctly, it would cause bugs in the
future (fortunately, this behavior is not used in code yet).

2 months agobump vue-bar-graph (#31705)
techknowlogick [Thu, 1 Aug 2024 17:42:51 +0000 (13:42 -0400)]
bump vue-bar-graph (#31705)

2 months agoUse UTC as default timezone when schedule Actions cron tasks (#31742)
Jason Song [Thu, 1 Aug 2024 10:02:46 +0000 (18:02 +0800)]
Use UTC as default timezone when schedule Actions cron tasks (#31742)

Fix #31657.

According to the
[doc](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onschedule)
of GitHub Actions, The timezone for cron should be UTC, not the local
timezone. And Gitea Actions doesn't have any reasons to change this, so
I think it's a bug.

However, Gitea Actions has extended the syntax, as it supports
descriptors like `@weekly` and `@every 5m`, and supports specifying the
timezone like `TZ=UTC 0 10 * * *`. So we can make it use UTC only when
the timezone is not specified, to be compatible with GitHub Actions, and
also respect the user's specified.

It does break the feature because the times to run tasks would be
changed, and it may confuse users. So I don't think we should backport
this.

## ⚠️ BREAKING ⚠️

If the server's local time zone is not UTC, a scheduled task would run
at a different time after upgrading Gitea to this version.

2 months agoAdd permission description for API to add repo collaborator (#31744)
Jason Song [Thu, 1 Aug 2024 09:33:40 +0000 (17:33 +0800)]
Add permission description for API to add repo collaborator (#31744)

Fix #31552.

2 months agoClarify Actions resources ownership (#31724)
Jason Song [Thu, 1 Aug 2024 09:04:04 +0000 (17:04 +0800)]
Clarify Actions resources ownership (#31724)

Fix #31707.

Also related to #31715.

Some Actions resources could has different types of ownership. It could
be:

- global: all repos and orgs/users can use it.
- org/user level: only the org/user can use it.
- repo level: only the repo can use it.

There are two ways to distinguish org/user level from repo level:
1. `{owner_id: 1, repo_id: 2}` for repo level, and `{owner_id: 1,
repo_id: 0}` for org level.
2. `{owner_id: 0, repo_id: 2}` for repo level, and `{owner_id: 1,
repo_id: 0}` for org level.

The first way seems more reasonable, but it may not be true. The point
is that although a resource, like a runner, belongs to a repo (it can be
used by the repo), the runner doesn't belong to the repo's org (other
repos in the same org cannot use the runner). So, the second method
makes more sense.

And the first way is not user-friendly to query, we must set the repo id
to zero to avoid wrong results.

So, #31715 should be right. And the most simple way to fix #31707 is
just:

```diff
- shared.GetRegistrationToken(ctx, ctx.Repo.Repository.OwnerID, ctx.Repo.Repository.ID)
+ shared.GetRegistrationToken(ctx, 0, ctx.Repo.Repository.ID)
```

However, it is quite intuitive to set both owner id and repo id since
the repo belongs to the owner. So I prefer to be compatible with it. If
we get both owner id and repo id not zero when creating or finding, it's
very clear that the caller want one with repo level, but set owner id
accidentally. So it's OK to accept it but fix the owner id to zero.

2 months agoExclude protected branches from recently pushed (#31748)
Jason Song [Thu, 1 Aug 2024 07:21:28 +0000 (15:21 +0800)]
Exclude protected branches from recently pushed (#31748)

Resolve #31566.

Updates to protected branches often come from PR merges, and they are
unlikely to be used to create new PRs.

<img width="1346" alt="image"
src="https://github.com/user-attachments/assets/9ed72bd6-0303-435d-856c-184784104c6a">
<img width="1347" alt="image"
src="https://github.com/user-attachments/assets/c1a1df4b-1c16-4116-aea3-d452242119e0">
<img width="1336" alt="image"
src="https://github.com/user-attachments/assets/706034ad-d3c3-4853-a6b8-cbaf87c70ba0">

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 1 Aug 2024 00:31:07 +0000 (00:31 +0000)]
[skip ci] Updated translations via Crowdin

2 months agoDistinguish LFS object errors to ignore missing objects during migration (#31702)
Jason Song [Wed, 31 Jul 2024 10:29:48 +0000 (18:29 +0800)]
Distinguish LFS object errors to ignore missing objects during migration (#31702)

Fix #31137.

Replace #31623 #31697.

When migrating LFS objects, if there's any object that failed (like some
objects are losted, which is not really critical), Gitea will stop
migrating LFS immediately but treat the migration as successful.

This PR checks the error according to the [LFS api
doc](https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#successful-responses).

> LFS object error codes should match HTTP status codes where possible:
>
> - 404 - The object does not exist on the server.
> - 409 - The specified hash algorithm disagrees with the server's
acceptable options.
> - 410 - The object was removed by the owner.
> - 422 - Validation error.

If the error is `404`, it's safe to ignore it and continue migration.
Otherwise, stop the migration and mark it as failed to ensure data
integrity of LFS objects.

And maybe we should also ignore others errors (maybe `410`? I'm not sure
what's the difference between "does not exist" and "removed by the
owner".), we can add it later when some users report that they have
failed to migrate LFS because of an error which should be ignored.

2 months agoImprove names of cron jobs for Actions (#31736)
Jason Song [Wed, 31 Jul 2024 03:03:30 +0000 (11:03 +0800)]
Improve names of cron jobs for Actions (#31736)

Before:

<img width="1641" alt="image"
src="https://github.com/user-attachments/assets/60fa3f3e-cf19-4903-b080-616aef28057b">

After:

<img width="1674" alt="image"
src="https://github.com/user-attachments/assets/b04fd01e-838d-45c3-9655-cb39a2f7d1f2">

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 31 Jul 2024 00:23:19 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

2 months agoFix the display of project type for deleted projects (#31732)
yp05327 [Tue, 30 Jul 2024 04:37:43 +0000 (13:37 +0900)]
Fix the display of project type for deleted projects (#31732)

Fix: #31727
After:

![image](https://github.com/user-attachments/assets/1dfb4b31-3bd6-47f7-b126-650f33f453e2)

2 months agoFix Null Pointer error for CommitStatusesHideActionsURL (#31731)
yp05327 [Tue, 30 Jul 2024 02:56:25 +0000 (11:56 +0900)]
Fix Null Pointer error for CommitStatusesHideActionsURL (#31731)

Fix https://github.com/go-gitea/gitea/pull/30156#discussion_r1695247028

Forgot fixing it in #31719

2 months agoMove `registerActionsCleanup` to `initActionsTasks` (#31721)
Jason Song [Tue, 30 Jul 2024 02:27:28 +0000 (10:27 +0800)]
Move `registerActionsCleanup` to `initActionsTasks` (#31721)

There's already `initActionsTasks`; it will avoid additional check for
if Actions enabled to move `registerActionsCleanup` into it.

And we don't really need `OlderThanConfig`.

2 months agoSet owner id to zero when GetRegistrationToken for repo (#31725)
Jason Song [Mon, 29 Jul 2024 18:46:45 +0000 (02:46 +0800)]
Set owner id to zero when GetRegistrationToken for repo (#31725)

Fix #31707.

It's split from #31724.

Although #31724 could also fix #31707, it has change a lot so it's not a
good idea to backport it.

2 months agofix(api): owner ID should be zero when created repo secret (#31715)
Bo-Yi Wu [Mon, 29 Jul 2024 17:15:02 +0000 (01:15 +0800)]
fix(api): owner ID should be zero when created repo secret (#31715)

- Change condition to include `RepoID` equal to 0 for organization
secrets

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2 months agoFix API endpoint for registration-token (#31722)
Jason Song [Mon, 29 Jul 2024 16:45:24 +0000 (00:45 +0800)]
Fix API endpoint for registration-token (#31722)

Partially fix #31707. Related to #30656

2 months agoFix loadRepository error when access user dashboard (#31719)
yp05327 [Mon, 29 Jul 2024 06:51:02 +0000 (15:51 +0900)]
Fix loadRepository error when access user dashboard (#31719)

2 months agoAdd permission check when creating PR (#31033)
yp05327 [Mon, 29 Jul 2024 02:21:22 +0000 (11:21 +0900)]
Add permission check when creating PR (#31033)

user should be a collaborator of the base repo to create a PR

2 months agoMake GetRepositoryByName more safer (#31712)
Lunny Xiao [Mon, 29 Jul 2024 01:32:54 +0000 (09:32 +0800)]
Make GetRepositoryByName more safer (#31712)

Fix #31708

2 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 29 Jul 2024 00:28:39 +0000 (00:28 +0000)]
[skip ci] Updated licenses and gitignores

2 months agoRun `go-install` in `deps-tools` in parallel (#31711)
silverwind [Sun, 28 Jul 2024 17:27:24 +0000 (19:27 +0200)]
Run `go-install` in `deps-tools` in parallel (#31711)

`go install` is far too conservative in regards to parallel HTTP
requests, so we can run the commands in parallel to achieve a speedup.

2 months agoHide the "Details" link of commit status when the user cannot access actions (#30156)
Zettat123 [Sun, 28 Jul 2024 15:11:40 +0000 (23:11 +0800)]
Hide the "Details" link of commit status when the user cannot access actions (#30156)

Fix #26685

If a commit status comes from Gitea Actions and the user cannot access
the repo's actions unit (the user does not have the permission or the
actions unit is disabled), a 404 page will occur after clicking the
"Details" link. We should hide the "Details" link in this case.

<img
src="https://github.com/go-gitea/gitea/assets/15528715/68361714-b784-4bb5-baab-efde4221f466"
width="400px" />

2 months agoEnable `no-jquery/no-parse-html-literal` and fix violation (#31684)
silverwind [Sat, 27 Jul 2024 14:44:41 +0000 (16:44 +0200)]
Enable `no-jquery/no-parse-html-literal` and fix violation (#31684)

Tested it, path segment creation works just like before.

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 27 Jul 2024 00:27:00 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

2 months agoOIDC: case-insensitive comparison for auth scheme `Basic` (#31706)
Shivaram Lingamneni [Fri, 26 Jul 2024 19:51:45 +0000 (21:51 +0200)]
OIDC: case-insensitive comparison for auth scheme `Basic` (#31706)

@kylef pointed out on https://github.com/go-gitea/gitea/pull/31632 that
[RFC7617](https://www.rfc-editor.org/rfc/rfc7617.html#section-2)
mandates case-insensitive comparison of the scheme field `Basic`. #31632
copied a case-sensitive comparison from
https://github.com/go-gitea/gitea/pull/6293. This PR fixes both
comparisons.

The issue only affects OIDC, since the implementation for normal Gitea
endpoints is already correct:

https://github.com/go-gitea/gitea/blob/930ca92d7ce80e8b0bdaf92e495026baf2a1d419/services/auth/basic.go#L55-L58

2 months agoSupport `pull_request_target` event for commit status (#31703)
Zettat123 [Fri, 26 Jul 2024 10:00:07 +0000 (18:00 +0800)]
Support `pull_request_target` event for commit status (#31703)

Fix [act_runner #573](https://gitea.com/gitea/act_runner/issues/573)

Before:

![image](https://github.com/user-attachments/assets/3944bf7f-7a60-4801-bcb3-5e158a180fda)

After:

![image](https://github.com/user-attachments/assets/cadac944-40bd-4537-a9d9-e702b8bc1ece)

2 months agoAdd types to fetch,toast,bootstrap,svg (#31627)
silverwind [Thu, 25 Jul 2024 23:31:24 +0000 (01:31 +0200)]
Add types to fetch,toast,bootstrap,svg (#31627)

Reduce `tsc` error count by 53. None of the changes has any runtime
effect.

2 months agoRun `detectWebAuthnSupport` only if necessary (#31691)
Jason Song [Thu, 25 Jul 2024 23:26:41 +0000 (07:26 +0800)]
Run `detectWebAuthnSupport` only if necessary (#31691)

Follow #31676, which is not correct, see
https://github.com/go-gitea/gitea/pull/31676#issuecomment-2246658217

Fix #31675, regression of #31504.

2 months agoadd `username` to OIDC introspection response (#31688)
Shivaram Lingamneni [Thu, 25 Jul 2024 12:36:05 +0000 (14:36 +0200)]
add `username` to OIDC introspection response (#31688)

This field is specified as optional here:
https://datatracker.ietf.org/doc/html/rfc7662#section-2.2

It's used by some OIDC integrations, e.g.
https://emersion.fr/blog/2022/irc-and-oauth2/

Co-authored-by: Giteabot <teabot@gitea.io>
2 months agoAdd return type to GetRawFileOrLFS and GetRawFile (#31680)
Adam Majer [Thu, 25 Jul 2024 12:06:19 +0000 (14:06 +0200)]
Add return type to GetRawFileOrLFS and GetRawFile (#31680)

Document return type for the endpoints that fetch specific files from a
repository. This allows the swagger generated code to read the returned
data.

Co-authored-by: Giteabot <teabot@gitea.io>
2 months agoSupport delete user email in admin panel (#31690)
yp05327 [Thu, 25 Jul 2024 10:11:04 +0000 (19:11 +0900)]
Support delete user email in admin panel (#31690)

![QQ_1721784609320](https://github.com/user-attachments/assets/23f08bf3-93f4-44d7-963d-10380ef8c1f1)

![QQ_1721784616403](https://github.com/user-attachments/assets/667cbd1e-5e21-4489-8d18-2a7be85190db)

![QQ_1721784626722](https://github.com/user-attachments/assets/495beb94-dfa2-481c-aa60-d5115cad1ae1)

---------

Co-authored-by: Jason Song <i@wolfogre.com>
2 months agoUse GetDisplayName() instead of DisplayName() to generate rss feeds (#31687)
Stanislas Dolcini [Thu, 25 Jul 2024 09:33:02 +0000 (11:33 +0200)]
Use GetDisplayName() instead of DisplayName() to generate rss feeds (#31687)

Fixes #31491 The RSS feed converted ignored the setting used in the
application.

2 months agoFix "Filter by commit" Dropdown (#31695)
wxiaoguang [Thu, 25 Jul 2024 01:48:51 +0000 (09:48 +0800)]
Fix "Filter by commit" Dropdown (#31695)

Regression of #31281
Fix #31673

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 25 Jul 2024 00:27:15 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

2 months agouse nolyfill to remove some polyfills (#31468)
techknowlogick [Wed, 24 Jul 2024 00:42:21 +0000 (20:42 -0400)]
use nolyfill to remove some polyfills (#31468)

We don't need to have polyfills down to Node v4. Some of our deps have
polyfills, and don't utilize the built-in implementation if available.
While this does decrease our package graph, I haven't been able to
notice any decrease/increase in page load times, although that could
likely be just because it's already pretty fast.

Nolyfill is https://github.com/SukkaW/nolyfill

updates to files generated with:

```shell
npx nolyfill install
npm update
```

Before this is/isn't merged, I'd be appreciative/thankful for other's
insights.

Edit: This isn't due to a specific individual. I am generally supportive
of them and their dedication to backward compatibility. This PR is due
to not needing those imports for our minimum requirements. Please don't
take this PR as commentary on anyone's character.

---------

Co-authored-by: silverwind <me@silverwind.io>
2 months agoProperly filter issue list given no assignees filter (#31522)
Kemal Zebari [Tue, 23 Jul 2024 18:36:32 +0000 (11:36 -0700)]
Properly filter issue list given no assignees filter (#31522)

Quick fix #31520. This issue is related to #31337.

2 months agoRun `detectWebAuthnSupport` only on sign-in page (#31676)
Jason Song [Tue, 23 Jul 2024 17:52:40 +0000 (01:52 +0800)]
Run `detectWebAuthnSupport` only on sign-in page (#31676)

Fix #31675, regression of #31504.

2 months agofix OIDC introspection authentication (#31632)
Shivaram Lingamneni [Tue, 23 Jul 2024 12:43:03 +0000 (14:43 +0200)]
fix OIDC introspection authentication (#31632)

See discussion on #31561 for some background.

The introspect endpoint was using the OIDC token itself for
authentication. This fixes it to use basic authentication with the
client ID and secret instead:

* Applications with a valid client ID and secret should be able to
  successfully introspect an invalid token, receiving a 200 response
  with JSON data that indicates the token is invalid
* Requests with an invalid client ID and secret should not be able
  to introspect, even if the token itself is valid

Unlike #31561 (which just future-proofed the current behavior against
future changes to `DISABLE_QUERY_AUTH_TOKEN`), this is a potential
compatibility break (some introspection requests without valid client
IDs that would previously succeed will now fail). Affected deployments
must begin sending a valid HTTP basic authentication header with their
introspection requests, with the username set to a valid client ID and
the password set to the corresponding client secret.

2 months agoEnable direnv (#31672)
techknowlogick [Tue, 23 Jul 2024 12:07:41 +0000 (08:07 -0400)]
Enable direnv (#31672)

This lets developers who have direnv enabled to load our nix flake
automatically when entering it

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 23 Jul 2024 00:27:23 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 21 Jul 2024 00:30:14 +0000 (00:30 +0000)]
[skip ci] Updated translations via Crowdin

2 months agofix redis dep (#31662)
techknowlogick [Fri, 19 Jul 2024 20:10:31 +0000 (16:10 -0400)]
fix redis dep (#31662)

fix https://github.com/go-gitea/gitea/issues/31658

2 months agoadd skip secondary authorization option for public oauth2 clients (#31454)
Denys Konovalov [Fri, 19 Jul 2024 18:28:30 +0000 (14:28 -0400)]
add skip secondary authorization option for public oauth2 clients (#31454)

2 months agoFix a branch divergence cache bug (#31659)
Zettat123 [Fri, 19 Jul 2024 15:52:49 +0000 (23:52 +0800)]
Fix a branch divergence cache bug (#31659)

Fix #31599

A branch divergence is counted based on the default branch. If the
default branch is updated, all divergence caches of the repo need to be
deleted.

2 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 18 Jul 2024 00:27:07 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

2 months agoRemove unneccessary uses of `word-break: break-all` (#31637)
silverwind [Wed, 17 Jul 2024 10:04:28 +0000 (12:04 +0200)]
Remove unneccessary uses of `word-break: break-all` (#31637)

Fixes: https://github.com/go-gitea/gitea/issues/31636
1. Issue sidebar topic is disussed in
https://github.com/go-gitea/gitea/issues/31636
2. Org description already has `overflow-wrap: anywhere` to ensure no
overflow.

Co-authored-by: Giteabot <teabot@gitea.io>
3 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 17 Jul 2024 00:27:54 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

3 months agoAllow searching issues by ID (#31479)
Carsten Klein [Tue, 16 Jul 2024 22:49:05 +0000 (00:49 +0200)]
Allow searching issues by ID (#31479)

When you are entering a number in the issue search, you likely want the
issue with the given ID (code internal concept: issue index).
As such, when a number is detected, the issue with the corresponding ID
will now be added to the results.

Fixes #4479

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 months agoallow synchronizing user status from OAuth2 login providers (#31572)
Rowan Bohde [Tue, 16 Jul 2024 18:33:16 +0000 (13:33 -0500)]
allow synchronizing user status from OAuth2 login providers (#31572)

This leverages the existing `sync_external_users` cron job to
synchronize the `IsActive` flag on users who use an OAuth2 provider set
to synchronize. This synchronization is done by checking for expired
access tokens, and using the stored refresh token to request a new
access token. If the response back from the OAuth2 provider is the
`invalid_grant` error code, the user is marked as inactive. However, the
user is able to reactivate their account by logging in the web browser
through their OAuth2 flow.

Also changed to support this is that a linked `ExternalLoginUser` is
always created upon a login or signup via OAuth2.

### Notes on updating permissions
Ideally, we would also refresh permissions from the configured OAuth
provider (e.g., admin, restricted and group mappings) to match the
implementation of LDAP. However, the OAuth library used for this `goth`,
doesn't seem to support issuing a session via refresh tokens. The
interface provides a [`RefreshToken`
method](https://github.com/markbates/goth/blob/master/provider.go#L20),
but the returned `oauth.Token` doesn't implement the `goth.Session` we
would need to call `FetchUser`. Due to specific implementations, we
would need to build a compatibility function for every provider, since
they cast to concrete types (e.g.
[Azure](https://github.com/markbates/goth/blob/master/providers/azureadv2/azureadv2.go#L132))

---------

Co-authored-by: Kyle D <kdumontnu@gmail.com>
3 months agoEnable `no-jquery/no-class-state` (#31639)
silverwind [Tue, 16 Jul 2024 10:14:27 +0000 (12:14 +0200)]
Enable `no-jquery/no-class-state` (#31639)

Just 4 validations and I specifically tested this by
selecting/unselecting issue labels.

Co-authored-by: Giteabot <teabot@gitea.io>
3 months agoAdded default sorting milestones by name (#27084)
Bartlomiej Komendarczuk [Tue, 16 Jul 2024 08:08:54 +0000 (10:08 +0200)]
Added default sorting milestones by name (#27084)

#26996
Added default sorting for milestones by name.
Additional, name for sorting closestduedate and furthestduedate was
broken, so I fixed it.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 months agoCode editor theme enhancements (#31629)
silverwind [Sun, 14 Jul 2024 23:22:48 +0000 (01:22 +0200)]
Code editor theme enhancements (#31629)

1. Fixed border-radius
2. Monaco ignores the alpha channel on the shadow color, introduce
`color-shadow-opaque`
3. Remove scrollbar color which follows
https://github.com/go-gitea/gitea/pull/29800

Before:

<img width="34" alt="Screenshot 2024-07-13 at 15 38 18"
src="https://github.com/user-attachments/assets/042d9bde-6db9-4467-a2a4-8f61ecc773eb">
<img width="35" alt="Screenshot 2024-07-13 at 15 38 31"
src="https://github.com/user-attachments/assets/04146ee0-551c-4ff2-9636-bd119b33595a">

After:

<img width="45" alt="Screenshot 2024-07-13 at 15 38 06"
src="https://github.com/user-attachments/assets/1f58fa5a-1289-4e45-83c9-18ca82a5e266">
<img width="39" alt="Screenshot 2024-07-13 at 21 16 56"
src="https://github.com/user-attachments/assets/e12ebe22-b29b-4798-9f0d-4c100f311562">

3 months agoAdd option to change mail from user display name (#31528)
6543 [Sun, 14 Jul 2024 21:27:00 +0000 (14:27 -0700)]
Add option to change mail from user display name (#31528)

Make it posible to let mails show e.g.:

`Max Musternam (via gitea.kithara.com) <gitea@kithara.com>`

Docs: https://gitea.com/gitea/docs/pulls/23

---
*Sponsored by Kithara Software GmbH*

3 months agoUpgrade xorm to v1.3.9 and improve some migrations Sync (#29899)
Lunny Xiao [Sun, 14 Jul 2024 21:15:59 +0000 (05:15 +0800)]
Upgrade xorm to v1.3.9 and improve some migrations Sync (#29899)

Co-authored-by: 6543 <6543@obermui.de>
3 months agoIssue Templates: add option to have dropdown printed list (#31577)
6543 [Sun, 14 Jul 2024 14:38:45 +0000 (07:38 -0700)]
Issue Templates: add option to have dropdown printed list (#31577)

Issue template dropdown can have many entries, and it could be better to
have them rendered as list later on if multi-select is enabled.

so this adds an option to the issue template engine to do so.

DOCS: https://gitea.com/gitea/docs/pulls/19

---

## demo:

```yaml
name: Name
title: Title
about: About
labels: ["label1", "label2"]
ref: Ref
body:
  - type: dropdown
    id: id6
    attributes:
      label: Label of dropdown (list)
      description: Description of dropdown
      multiple: true
      list: true
      options:
        - Option 1 of dropdown
        - Option 2 of dropdown
        - Option 3 of dropdown
        - Option 4 of dropdown
        - Option 5 of dropdown
        - Option 6 of dropdown
        - Option 7 of dropdown
        - Option 8 of dropdown
        - Option 9 of dropdown
```

![image](https://github.com/user-attachments/assets/102ed0f4-89da-420b-ab2a-1788b59676f9)

![image](https://github.com/user-attachments/assets/a2bdb14e-43ff-4cc6-9bbe-20244830453c)

---
*Sponsored by Kithara Software GmbH*

3 months agoFix update flake (#31626)
6543 [Fri, 12 Jul 2024 16:25:54 +0000 (09:25 -0700)]
Fix update flake (#31626)

3 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 12 Jul 2024 00:27:07 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

3 months agoDisplay app name in the registration email title (#31562)
Sunny Wan [Thu, 11 Jul 2024 23:23:31 +0000 (19:23 -0400)]
Display app name in the registration email title (#31562)

I changed the title of the registation email from "Welcome to Gitea" to
"Welcome to (appname)". I did this by substituting 'Gitea' in
register_notify to %s and formating the registration title in mail.go. I
changed this for all the languages I could, but I struggled to changed
the translation file for Farsi. I have attached the screenshots of
before and after and the related issue below.

Related issue:
https://github.com/go-gitea/gitea/issues/31108

Before change:
![Screenshot from 2024-07-04
22-32-17](https://github.com/go-gitea/gitea/assets/94445569/4178b51c-1acc-45f4-9750-dff41564a709)

After:
![Screenshot from 2024-07-04
22-32-01](https://github.com/go-gitea/gitea/assets/94445569/9cd7a58d-c0f5-4a3c-a66c-805c55411eaa)

---------

Signed-off-by: Sunny Wan <Sunnywan2020@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 months agotypo on date in security document (#31617)
techknowlogick [Thu, 11 Jul 2024 21:51:08 +0000 (17:51 -0400)]
typo on date in security document (#31617)

3 months agoUpdate JS dependencies (#31616)
silverwind [Thu, 11 Jul 2024 18:36:02 +0000 (20:36 +0200)]
Update JS dependencies (#31616)

Result of `make update-js`. Tested all dependencies. Lockfile diff is
because of https://github.com/npm/cli/pull/7475.

3 months agoAdd types for js globals (#31586)
silverwind [Thu, 11 Jul 2024 10:20:51 +0000 (12:20 +0200)]
Add types for js globals (#31586)

Adds types for `window.config` and jQuery/htmx globals, eliminating 48
`tsc` errors.

3 months agoUpgrade security public key (#31594)
Lunny Xiao [Wed, 10 Jul 2024 16:28:22 +0000 (00:28 +0800)]
Upgrade security public key (#31594)

Fix #31591

3 months agoFix wrong merge on removing docs (#31605)
Lunny Xiao [Wed, 10 Jul 2024 15:47:32 +0000 (23:47 +0800)]
Fix wrong merge on removing docs (#31605)

3 months agoRefactor webhook (#31587)
wxiaoguang [Wed, 10 Jul 2024 11:37:16 +0000 (19:37 +0800)]
Refactor webhook (#31587)

A more complete fix for #31588

1. Make "generic" code more readable
2. Clarify HTML or Markdown for the payload content

3 months agoFix: Allow org team names of length 255 in create team form (#31564)
Tobias Balle-Petersen [Wed, 10 Jul 2024 02:15:17 +0000 (04:15 +0200)]
Fix: Allow org team names of length 255 in create team form (#31564)

Gitea 1.22.1 was supposed to allow for team names of length 255 (up from
30) after the following PR was merged in:
https://github.com/go-gitea/gitea/pull/31410. However, the length of
team names was still limited to 30 as described in this issue:
https://github.com/go-gitea/gitea/issues/31554.

One more change to _gitea_ needs to be made to allow for the longer team
names, as there is a 30 character limit here:
https://github.com/go-gitea/gitea/blob/2c92c7c5226e29636a1d47a277130f477fa2037b/services/forms/org.go#L65

This PR changes that value to 255.

3 months agoRemove docs sub folder since docs has been moved to https://gitea.com/gitea/docs...
Lunny Xiao [Wed, 10 Jul 2024 01:46:08 +0000 (09:46 +0800)]
Remove docs sub folder since docs has been moved to https://gitea.com/gitea/docs (#31536)

3 months agoAdd bohde as maintainer (#31601)
Kyle D [Wed, 10 Jul 2024 00:18:35 +0000 (20:18 -0400)]
Add bohde as maintainer (#31601)

[4 merged
PRs](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3Abohde+is%3Aclosed)


3 months agoAdd `YEAR`, `MONTH`, `MONTH_ENGLISH`, `DAY` variables for template repos (#31584)
delvh [Tue, 9 Jul 2024 18:05:12 +0000 (20:05 +0200)]
Add `YEAR`, `MONTH`, `MONTH_ENGLISH`, `DAY` variables for template repos (#31584)

Fixes #31583

3 months agoAllow disabling authentication related user features (#31535)
Rowan Bohde [Tue, 9 Jul 2024 17:36:31 +0000 (12:36 -0500)]
Allow disabling authentication related user features (#31535)

We have some instances that only allow using an external authentication
source for authentication. In this case, users changing their email,
password, or linked OpenID connections will not have any effect, and
we'd like to prevent showing that to them to prevent confusion.

Included in this are several changes to support this:
* A new setting to disable user managed authentication credentials
(email, password & OpenID connections)
* A new setting to disable user managed MFA (2FA codes & WebAuthn)
* Fix an issue where some templates had separate logic for determining
if a feature was disabled since it didn't check the globally disabled
features
* Hide more user setting pages in the navbar when their settings aren't
enabled

---------

Co-authored-by: Kyle D <kdumontnu@gmail.com>
3 months agoAdd back esbuild-loader for .js files (#31585)
silverwind [Tue, 9 Jul 2024 09:28:43 +0000 (11:28 +0200)]
Add back esbuild-loader for .js files (#31585)

The build currently seems to work fine without this, but in theory it
should fail because Fomantic is JavaScript. I feel more comfortable
having this loader declared.

Note: I did try using the [combined loader
config](https://github.com/privatenumber/esbuild-loader#-quick-setup)
but when I did that, vue files could not load, so I think this is the
best option.

3 months agoUse FullName in Emails to address the recipient if possible (#31527)
6543 [Mon, 8 Jul 2024 08:38:45 +0000 (01:38 -0700)]
Use FullName in Emails to address the recipient if possible (#31527)

Before we had just the plain mail address as recipient. But now we
provide additional Information for the Mail clients.

---
*Sponsored by Kithara Software GmbH*

3 months agoDon't show hidden labels when filling out an issue template (#31576)
6543 [Mon, 8 Jul 2024 04:31:12 +0000 (21:31 -0700)]
Don't show hidden labels when filling out an issue template (#31576)

Related to #31574

---
*Sponsored by Kithara Software GmbH*

3 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 8 Jul 2024 00:28:11 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

3 months agoConvert frontend code to typescript (#31559)
silverwind [Sun, 7 Jul 2024 15:32:30 +0000 (17:32 +0200)]
Convert frontend code to typescript (#31559)

None of the frontend js/ts files was touched besides these two commands
(edit: no longer true, I touched one file in
https://github.com/go-gitea/gitea/pull/31559/commits/61105d0618e285d97e95044bfb64415f364a4526
because of a deprecation that was not showing before the rename).

`tsc` currently reports 778 errors, so I have disabled it in CI as
planned.

Everything appears to work fine.

3 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 7 Jul 2024 00:29:37 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

3 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 6 Jul 2024 00:26:24 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

3 months agoAllow force push to protected branches (#28086)
Henry Goodman [Fri, 5 Jul 2024 18:21:56 +0000 (04:21 +1000)]
Allow force push to protected branches (#28086)

Fixes #22722

### Problem
Currently, it is not possible to force push to a branch with branch
protection rules in place. There are often times where this is necessary
(CI workflows/administrative tasks etc).

The current workaround is to rename/remove the branch protection,
perform the force push, and then reinstate the protections.

### Solution
Provide an additional section in the branch protection rules to allow
users to specify which users with push access can also force push to the
branch. The default value of the rule will be set to `Disabled`, and the
UI is intuitive and very similar to the `Push` section.

It is worth noting in this implementation that allowing force push does
not override regular push access, and both will need to be enabled for a
user to force push.

This applies to manual force push to a remote, and also in Gitea UI
updating a PR by rebase (which requires force push)

This modifies the `BranchProtection` API structs to add:
- `enable_force_push bool`
- `enable_force_push_whitelist bool`
- `force_push_whitelist_usernames string[]`
- `force_push_whitelist_teams string[]`
- `force_push_whitelist_deploy_keys bool`

### Updated Branch Protection UI:

<img width="943" alt="image"
src="https://github.com/go-gitea/gitea/assets/79623665/7491899c-d816-45d5-be84-8512abd156bf">

### Pull Request `Update branch by Rebase` option enabled with source
branch `test` being a protected branch:

![image](https://github.com/go-gitea/gitea/assets/79623665/e018e6e9-b7b2-4bd3-808e-4947d7da35cc)
<img width="1038" alt="image"
src="https://github.com/go-gitea/gitea/assets/79623665/57ead13e-9006-459f-b83c-7079e6f4c654">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 months agoRefactor login page (#31530)
Anbraten [Fri, 5 Jul 2024 17:10:09 +0000 (19:10 +0200)]
Refactor login page (#31530)

As requested in
https://github.com/go-gitea/gitea/pull/31504#issuecomment-2196196646.
This PR refactor the login page:

![Screenshot from 2024-07-04
19-23-10](https://github.com/go-gitea/gitea/assets/6918444/c45700f4-6747-473c-bdee-2156718a7953)

![Screenshot from 2024-07-04
19-23-21](https://github.com/go-gitea/gitea/assets/6918444/b1bf71cf-85f9-4517-a409-cc6d72e6af8f)

![Screenshot from 2024-06-30
09-35-20](https://github.com/go-gitea/gitea/assets/6918444/728cc37e-0cca-4883-afec-a43663d2c666)

# Changes
- [x] use separate box for passkey login and go to registration
- [x] move forgot passoword next to password label
- [x] fix password required label `*` and padding
- [x] remove tabs from login page

---------

Co-authored-by: silverwind <me@silverwind.io>
3 months agoFix slow patch checking with commits that add or remove many files (#31548)
Brecht Van Lommel [Thu, 4 Jul 2024 18:57:11 +0000 (20:57 +0200)]
Fix slow patch checking with commits that add or remove many files (#31548)

Running git update-index for every individual file is slow, so add and
remove everything with a single git command.

When such a big commit lands in the default branch, it could cause PR
creation and patch checking for all open PRs to be slow, or time out
entirely. For example, a commit that removes 1383 files was measured to
take more than 60 seconds and timed out. With this change checking took
about a second.

This is related to #27967, though this will not help with commits that
change many lines in few files.

3 months agoAdd typescript guideline and typescript-specific eslint plugins and fix issues (...
silverwind [Wed, 3 Jul 2024 15:48:14 +0000 (17:48 +0200)]
Add typescript guideline and typescript-specific eslint plugins and fix issues (#31521)

1. Add some general guidelines how to write our typescript code
2. Add `@typescript-eslint/eslint-plugin`, general typescript rules
3. Add `eslint-plugin-deprecation` to detect deprecated code
4. Fix all new lint issues that came up

3 months agoUpdate `golang.org/x/image` to v0.18.0 (#31541)
silverwind [Tue, 2 Jul 2024 19:41:14 +0000 (21:41 +0200)]
Update `golang.org/x/image` to v0.18.0 (#31541)

Result of `go get -u  golang.org/x/image && make tidy`

Fixes: https://github.com/go-gitea/gitea/security/dependabot/67
3 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 1 Jul 2024 00:30:50 +0000 (00:30 +0000)]
[skip ci] Updated translations via Crowdin

3 months agoFix markdown preview $$ support (#31514)
charles [Sat, 29 Jun 2024 23:23:47 +0000 (07:23 +0800)]
Fix markdown preview $$ support (#31514)

close #31481

currently `$$A + B$$ test` will ignore text after $$ block

test text

![圖片](https://github.com/go-gitea/gitea/assets/30816317/39b2974b-c0b6-48a0-87d0-5f4a13615eed)

before fix

![圖片](https://github.com/go-gitea/gitea/assets/30816317/15469e4c-474d-4128-b46f-d6cadaafbd68)

after fix

![圖片](https://github.com/go-gitea/gitea/assets/30816317/c1025eef-177f-4ade-988f-510e7039f3f9)

github display

![圖片](https://github.com/go-gitea/gitea/assets/30816317/97cd1e10-ac94-4899-86d8-8e359ef1d694)

3 months agoAdd Passkey login support (#31504)
Anbraten [Sat, 29 Jun 2024 22:50:03 +0000 (00:50 +0200)]
Add Passkey login support (#31504)

closes #22015

After adding a passkey, you can now simply login with it directly by
clicking `Sign in with a passkey`.

![Screenshot from 2024-06-26
12-18-17](https://github.com/go-gitea/gitea/assets/6918444/079013c0-ed70-481c-8497-4427344bcdfc)

Note for testing. You need to run gitea using `https` to get the full
passkeys experience.

---------

Co-authored-by: silverwind <me@silverwind.io>
3 months agoUse stable version of fabric (#31526)
silverwind [Sat, 29 Jun 2024 15:37:18 +0000 (17:37 +0200)]
Use stable version of fabric (#31526)

Fabric 6 is [now
stable](https://github.com/fabricjs/fabric.js/releases/tag/v6.0.0-rc5),
use it.

3 months agoAlways use HTML attributes for avatar size (#31509)
silverwind [Fri, 28 Jun 2024 21:29:15 +0000 (23:29 +0200)]
Always use HTML attributes for avatar size (#31509)

Many avatars were rendered in HTML with certain width/height but then
resized again in CSS. This was pointless so I removed all these cases
and made the HTML size match the previous render size.

Also did a few CSS cleanups in the tribute rendering:

<img width="648" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/cb2fafb3-5e20-46e9-814f-07df20038beb">

3 months agoAdd initial typescript config and use it for eslint,vitest,playwright (#31186)
silverwind [Fri, 28 Jun 2024 16:15:51 +0000 (18:15 +0200)]
Add initial typescript config and use it for eslint,vitest,playwright (#31186)

This enables eslint to use the typescript parser and resolver which
brings some benefits that eslint rules now have type information
available and a tsconfig.json is required for the upcoming typescript
migration as well. Notable changes done:

- Add typescript parser and resolver
- Move the vue-specific config into the root file
- Enable `vue-scoped-css/enforce-style-type` rule, there was only one
violation and I added a inline disable there.
- Fix new lint errors that were detected because of the parser change
- Update `i/no-unresolved` to remove now-unnecessary workaround for the
resolver
- Disable `i/no-named-as-default` as it seems to raise bogus issues in
the webpack config
- Change vitest config to typescript
- Change playwright config to typescript
- Add `eslint-plugin-playwright` and fix issues
- Add `tsc` linting to `make lint-js`

3 months agoSupport legacy _links LFS batch responses (#31513)
Royce Remer [Fri, 28 Jun 2024 08:42:57 +0000 (01:42 -0700)]
Support legacy _links LFS batch responses (#31513)

Support legacy _links LFS batch response.

Fixes #31512.

This is backwards-compatible change to the LFS client so that, upon
mirroring from an upstream which has a batch api, it can download
objects whether the responses contain the `_links` field or its
successor the `actions` field. When Gitea must fallback to the legacy
`_links` field a logline is emitted at INFO level which looks like this:
```
...s/lfs/http_client.go:188:performOperation() [I] <LFSPointer ee95d0a27ccdfc7c12516d4f80dcf144a5eaf10d0461d282a7206390635cdbee:160> is using a deprecated batch schema response!
```

I've only run `test-backend` with this code, but added a new test to
cover this case. Additionally I have a fork with this change deployed
which I've confirmed syncs LFS from Gitea<-Artifactory (which has legacy
`_links`) as well as from Gitea<-Gitea (which has the modern `actions`).

Signed-off-by: Royce Remer <royceremer@gmail.com>
3 months agoFix JS error with disabled attachment and easymde (#31511)
silverwind [Fri, 28 Jun 2024 05:59:22 +0000 (07:59 +0200)]
Fix JS error with disabled attachment and easymde (#31511)

Not sure if this is a regression from
https://github.com/go-gitea/gitea/pull/30513, but when attachments are
disabled, `this.dropzone` is null and the code had failed in
`initEasyMDEPaste` trying to access `dropzoneEl.dropzone`.

3 months agoFix avatar radius problem on the new issue page (#31506)
charles [Thu, 27 Jun 2024 14:04:05 +0000 (22:04 +0800)]
Fix avatar radius problem on the new issue page (#31506)

Close #31502

Related to #31419.

In this PR, the avatar width is set to 3em, but the height is not set,
so the image is not squared.

When object-fit is set to contain, it can't maintain the radius of the
image.

Result:

![圖片](https://github.com/go-gitea/gitea/assets/30816317/bceb98aa-b0f7-4753-bc8b-3b9c41dfd55a)

3 months agoMake toast support preventDuplicates (#31501)
wxiaoguang [Thu, 27 Jun 2024 13:58:38 +0000 (21:58 +0800)]
Make toast support preventDuplicates (#31501)

make preventDuplicates default to true, users get a clear UI feedback
and know that "a new message appears".

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

Co-authored-by: silverwind <me@silverwind.io>