Commit Graph

2720 Commits

Author SHA1 Message Date
12cb1d2998 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>
2024-07-05 18:21:56 +00:00
9c00dda33a 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>
2024-07-05 20:10:09 +03:00
3bd87fb170 [skip ci] Updated translations via Crowdin 2024-07-01 00:30:50 +00:00
91745ae46f 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>
2024-06-29 22:50:03 +00:00
35ce7a5e0e [skip ci] Updated translations via Crowdin 2024-06-26 00:26:17 +00:00
24f4ebb8a9 [skip ci] Updated translations via Crowdin 2024-06-25 00:26:08 +00:00
b3ed1e0e62 [skip ci] Updated translations via Crowdin 2024-06-22 00:25:47 +00:00
7adf8d7727 [skip ci] Updated translations via Crowdin 2024-06-19 00:26:25 +00:00
363c123598 Add cache test for admins (#31265)
Add a test to probe the cache similar to the email test func.


![image](https://github.com/go-gitea/gitea/assets/24977596/700e2733-586d-4091-900f-f5f71e6e94bf)


![image](https://github.com/go-gitea/gitea/assets/24977596/2a953802-18fc-4e81-a37d-24ebe1297365)


![image](https://github.com/go-gitea/gitea/assets/24977596/e00d62ad-bb60-41cc-9138-09993daee156)

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
2024-06-17 21:22:39 +02:00
129206da45 [skip ci] Updated licenses and gitignores 2024-06-17 00:27:39 +00:00
c70d4f03c9 [skip ci] Updated translations via Crowdin 2024-06-16 00:28:50 +00:00
23147494a7 [skip ci] Updated translations via Crowdin 2024-06-15 00:26:00 +00:00
5b56d13e0d [skip ci] Updated translations via Crowdin 2024-06-14 00:27:38 +00:00
47ca61d8ba Improve detecting empty files (#31332)
Co-authored-by: silverwind <me@silverwind.io>
2024-06-13 01:06:46 +00:00
1844dc6c1d [skip ci] Updated translations via Crowdin 2024-06-11 00:26:13 +00:00
4f7d6feab7 [skip ci] Updated translations via Crowdin 2024-06-10 00:27:20 +00:00
c6854202be [skip ci] Updated licenses and gitignores 2024-06-03 00:27:17 +00:00
ce751761ce [skip ci] Updated translations via Crowdin 2024-05-30 00:26:20 +00:00
31011f5cde Swap word order in Comment and Close (#31148)
Reduce accident closing of tickets only to re-open them right away. This
aligns the text on these buttons with what GitHub has.

Commit is authored by @LazyDodo, and was committed to the Blender fork
by @brechtvl

Background details:
https://projects.blender.org/infrastructure/gitea-custom/pulls/7

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
2024-05-29 15:54:17 +00:00
207c0c6c92 [skip ci] Updated translations via Crowdin 2024-05-29 00:26:43 +00:00
0222f19f19 [skip ci] Updated translations via Crowdin 2024-05-28 00:26:53 +00:00
aa92b13164 Prevent simultaneous editing of comments and issues (#31053)
fixes #22907 

Tested:
- [x] issue content edit
- [x] issue content change tasklist
- [x] pull request content edit
- [x] pull request change tasklist

![issue-content-edit](https://github.com/go-gitea/gitea/assets/29250154/a0828889-fb96-4bc4-8600-da92e3205812)
2024-05-27 15:34:18 +00:00
98751108b1 Rename project board -> column to make the UI less confusing (#30170)
This PR split the `Board` into two parts. One is the struct has been
renamed to `Column` and the second we have a `Template Type`.

But to make it easier to review, this PR will not change the database
schemas, they are just renames. The database schema changes could be in
future PRs.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: yp05327 <576951401@qq.com>
2024-05-27 08:59:54 +00:00
e695ba4755 Fix possible ui 500 if workflow's job is nil (#31092)
Fix #31087
2024-05-27 05:21:00 +00:00
e625813aa9 [skip ci] Updated licenses and gitignores 2024-05-27 00:26:27 +00:00
ec771fdfcd [skip ci] Updated translations via Crowdin 2024-05-24 00:25:44 +00:00
6d119aafd1 [skip ci] Updated translations via Crowdin 2024-05-23 00:25:10 +00:00
3066114c24 [skip ci] Updated translations via Crowdin 2024-05-22 00:25:10 +00:00
ba83d27ab0 [skip ci] Updated translations via Crowdin 2024-05-21 00:26:00 +00:00
de9bcd1d23 Avoid 500 panic error when uploading invalid maven package file (#31014)
PackageDescriptor.Metadata might be nil (and maybe not only for maven).
This is only a quick fix.

The new `if` block is written intentionally to avoid unnecessary
indenting to the existing code.
2024-05-20 06:44:16 +00:00
82a0c36332 [skip ci] Updated licenses and gitignores 2024-05-20 00:25:39 +00:00
68d5c18953 [skip ci] Updated translations via Crowdin 2024-05-17 00:25:42 +00:00
db578431ea [skip ci] Updated translations via Crowdin 2024-05-15 00:25:44 +00:00
5b6f80989f Remove unnecessary double quotes on language file (#30977)
The double quotes and the prefix/suffix space are unnecessary.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-05-15 01:06:12 +02:00
9a577c62e4 [skip ci] Updated translations via Crowdin 2024-05-14 00:25:02 +00:00
2442ead680 [skip ci] Updated licenses and gitignores 2024-05-13 00:26:15 +00:00
f80b403dc9 [skip ci] Updated translations via Crowdin 2024-05-12 00:27:35 +00:00
7424f27cf3 Check if reverse proxy is correctly configured (#30890)
Follow #27011
Follow #30885

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-05-10 20:07:01 +08:00
f1b0729078 [skip ci] Updated translations via Crowdin 2024-05-08 00:21:06 +00:00
d8d46d1c48 [skip ci] Updated translations via Crowdin 2024-05-01 00:26:38 +00:00
ad4e902d5a Add support for npm bundleDependencies (#30751) 2024-04-29 16:19:06 +08:00
e67141756d [skip ci] Updated licenses and gitignores 2024-04-29 00:25:01 +00:00
27861d711b [skip ci] Updated translations via Crowdin 2024-04-27 00:24:31 +00:00
935330b1b9 [skip ci] Updated translations via Crowdin 2024-04-26 00:26:00 +00:00
bffbbf5470 Improve oauth2 client "preferred username field" logic and the error handling (#30622)
Follow #30454
And fix #24957

When using "preferred_username", if no such field,
`extractUserNameFromOAuth2` (old `getUserName`) shouldn't return an
error. All other USERNAME options do not return such error.

And fine tune some logic and error messages, make code more stable and
more friendly to end users.
2024-04-25 11:22:32 +00:00
4ff54933f8 [skip ci] Updated translations via Crowdin 2024-04-25 00:26:13 +00:00
b79e3db264 Initial support for colorblindness-friendly themes (#30625)
Initial support for #25680

This PR only adds some simple styles from GitHub, it is big enough and
it focuses on adding the necessary framework-level supports. More styles
could be fine-tuned later.
2024-04-24 00:18:41 +08:00
7d5a03fda2 [skip ci] Updated translations via Crowdin 2024-04-23 00:24:55 +00:00
31386dc2bb [skip ci] Updated licenses and gitignores 2024-04-22 00:25:56 +00:00
f4a1cf7eab Fix repo home UI when there is no repo description (#30552)
Fix #30502 by a new approach.


![image](https://github.com/go-gitea/gitea/assets/2114189/22f48bca-82d1-45cc-b1b7-ee2344b81a76)
2024-04-21 23:47:31 +00:00