]> source.dussan.org Git - gitea.git/log
gitea.git
16 months agoDocs about how to generate config for act runner with docker and setup it with docker...
Zisu Zhang [Fri, 16 Jun 2023 03:46:59 +0000 (11:46 +0800)]
Docs about how to generate config for act runner with docker and setup it with docker-compose (#25256)

In this pull request, the following changes are addressed:

- State user should create `config.yaml` before start container to avoid
errors.
- Provided instructions to deploy runners using docker compose.

16 months agoFix some UI alignments (#25277)
wxiaoguang [Thu, 15 Jun 2023 15:12:08 +0000 (23:12 +0800)]
Fix some UI alignments (#25277)

Fixes: https://github.com/go-gitea/gitea/issues/25282
Fix the problems:

1. The `repo-button-row` had various patches before, this PR makes it
consistent
2. The "Add File" has wrong CSS class "icon", remove it
3. The "Add File" padding was overridden by "!important", fix it by
`.repo-button-row .button.dropdown` with comment
4. The selector `.ui.segments ~ .ui.top.attached.header` is incorrect,
it should use `+`

16 months agoRemove fomantic inverted variations (#25286)
silverwind [Thu, 15 Jun 2023 14:40:34 +0000 (16:40 +0200)]
Remove fomantic inverted variations (#25286)

Remove all Fomantic `inverted` variations, we are no using any of them.
This reduces the index CSS bundle by 98kB.

16 months agoFix issue and commit status popup padding (#25254)
wxiaoguang [Thu, 15 Jun 2023 08:09:16 +0000 (16:09 +0800)]
Fix issue and commit status popup padding (#25254)

Close #25249

Use "dialog" for the role

![image](https://github.com/go-gitea/gitea/assets/2114189/2b5b7552-48bc-4ecf-947b-34917232cff9)

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoShow OAuth2 errors to end users (#25261)
wxiaoguang [Thu, 15 Jun 2023 01:12:50 +0000 (09:12 +0800)]
Show OAuth2 errors to end users (#25261)

Partially fix #23936

![image](https://github.com/go-gitea/gitea/assets/2114189/8aa7f3ad-a5f0-42ce-a478-289a03bd08a3)

![image](https://github.com/go-gitea/gitea/assets/2114189/bb901e7d-485a-47a5-b68d-9ebe7013a6b2)

![image](https://github.com/go-gitea/gitea/assets/2114189/9a1ce0f3-f011-4baf-8e2f-cc6304bc9703)

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 15 Jun 2023 00:26:55 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoFix index generation parallelly failure (#25235)
Lunny Xiao [Thu, 15 Jun 2023 00:14:43 +0000 (08:14 +0800)]
Fix index generation parallelly failure (#25235)

Fix #22109

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix variable in template (#25267)
silverwind [Wed, 14 Jun 2023 20:42:52 +0000 (22:42 +0200)]
Fix variable in template (#25267)

Fix regression from https://github.com/go-gitea/gitea/pull/25212.

16 months agoAdd template linting via djlint (#25212)
silverwind [Wed, 14 Jun 2023 18:17:58 +0000 (20:17 +0200)]
Add template linting via djlint (#25212)

So I found this [linter](https://github.com/Riverside-Healthcare/djlint)
which features a mode for go templates, so I gave it a try and it did
find a number of valid issue, like unbalanced tags etc. It also has a
number of bugs, I had to disable/workaround many issues.

Given that this linter is written in python, this does add a dependency
on `python` >= 3.8 and `poetry` to the development environment to be
able to run this linter locally.

- `e.g.` prefixes on placeholders are removed because the linter had a
false-positive on `placeholder="e.g. cn=Search"` for the `attr=value`
syntax and it's not ideal anyways to write `e.g.` into a placeholder
because a placeholder is meant to hold a sample value.
- In `templates/repo/settings/options.tmpl` I simplified the logic to
not conditionally create opening tags without closing tags because this
stuff confuses the linter (and possibly the reader as well).

16 months agoFix edit OAuth application width (#25262)
Denys Konovalov [Wed, 14 Jun 2023 17:45:13 +0000 (19:45 +0200)]
Fix edit OAuth application width (#25262)

The `<div class="ui container">` broke the width of this section - fix
by removing it.

16 months agoUse flex to align SVG and text (#25163)
wxiaoguang [Wed, 14 Jun 2023 16:40:15 +0000 (00:40 +0800)]
Use flex to align SVG and text (#25163)

The code can be as simple as:

```html
<div class="flex-text-block">{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)</div>
<div><div class="flex-text-inline">{{svg "octicon-alert"}} {{svg "octicon-x"}} text</div> (inline)</div>
<div><button class="ui red button">{{svg "octicon-alert" 24}} {{svg "octicon-x" 24}} text</button></div>
```

![image](https://github.com/go-gitea/gitea/assets/2114189/1d3c10f1-0bc7-4c26-b236-bad537d5c465)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoGitHub Actions enhancements for frontend (#25150)
silverwind [Wed, 14 Jun 2023 15:30:37 +0000 (17:30 +0200)]
GitHub Actions enhancements for frontend (#25150)

- Don't run DB tests for frontend-only changes
- Build frontend as part of frontend step
- Build everything when actions change

16 months agoAdd missing `v` in migrations.go (#25252)
yp05327 [Wed, 14 Jun 2023 12:35:35 +0000 (21:35 +0900)]
Add missing `v` in migrations.go (#25252)

16 months agoChange form actions to fetch for submit review box (#25219)
HesterG [Wed, 14 Jun 2023 08:01:37 +0000 (16:01 +0800)]
Change form actions to fetch for submit review box (#25219)

Co-author: @wxiaoguang

Close #25096

The way to fix it in this PR is to change form submit to fetch using
formData, and add flags to avoid post repeatedly.
Should be able to apply to more forms that have the same issue after
this PR.

In the demo below, 'approve' is clicked several times, and then
'comment' is clicked several time after 'request changes' clicked.

After:

https://github.com/go-gitea/gitea/assets/17645053/beabeb1d-fe66-4b76-b048-4f022b4e83a0

Update: screenshots from /devtest

>
![image](https://user-images.githubusercontent.com/2114189/245680011-ee4231e0-a53d-4c2a-a9c2-71ccd98005cc.png)
>
>
![image](https://user-images.githubusercontent.com/2114189/245680057-9215d348-63d8-406d-8828-17e171163aaa.png)
>
>
![image](https://user-images.githubusercontent.com/2114189/245680148-89d7b3d1-d7b6-442f-b69e-eadaee112482.png)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoFix panic when migrating a repo from GitHub with issues (#25246)
Jason Song [Wed, 14 Jun 2023 06:12:39 +0000 (14:12 +0800)]
Fix panic when migrating a repo from GitHub with issues (#25246)

Fix #25245. Regression of #23946.

16 months agoFix description of drop custom_labels migration (#25243)
sillyguodong [Wed, 14 Jun 2023 04:46:55 +0000 (12:46 +0800)]
Fix description of drop custom_labels migration (#25243)

Follow: #24806

16 months agoFix all possible setting error related storages and added some tests (#23911)
Lunny Xiao [Wed, 14 Jun 2023 03:42:38 +0000 (11:42 +0800)]
Fix all possible setting error related storages and added some tests (#23911)

Follow up #22405

Fix #20703

This PR rewrites storage configuration read sequences with some breaks
and tests. It becomes more strict than before and also fixed some
inherit problems.

- Move storage's MinioConfig struct into setting, so after the
configuration loading, the values will be stored into the struct but not
still on some section.
- All storages configurations should be stored on one section,
configuration items cannot be overrided by multiple sections. The
prioioty of configuration is `[attachment]` > `[storage.attachments]` |
`[storage.customized]` > `[storage]` > `default`
- For extra override configuration items, currently are `SERVE_DIRECT`,
`MINIO_BASE_PATH`, `MINIO_BUCKET`, which could be configured in another
section. The prioioty of the override configuration is `[attachment]` >
`[storage.attachments]` > `default`.
- Add more tests for storages configurations.
- Update the storage documentations.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Jun 2023 00:26:25 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoRevert overflow: overlay (revert #21850) (#25231)
wxiaoguang [Tue, 13 Jun 2023 19:17:14 +0000 (03:17 +0800)]
Revert overflow: overlay (revert #21850) (#25231)

It causes not only one issue like #25221 (the footer width was also
affected by that change and was fixed some time ago)

The problem of "overflow: overlay" (#21850) is:

* It's not widely supported and is non-standard
https://caniuse.com/css-overflow-overlay
* It's not widely tested in Gitea (some standard layout like `ui
container + ui grid` may break it).
* The benefit seems smaller than the problems it brings.

So, I think it is good to revert it.

----

Let's leave enough time for testing and reviewing.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoSupport changing labels of Actions runner without re-registration (#24806)
sillyguodong [Tue, 13 Jun 2023 14:28:31 +0000 (22:28 +0800)]
Support changing labels of Actions runner without re-registration (#24806)

close #24540

related:
- Protocol: https://gitea.com/gitea/actions-proto-def/pulls/9
- Runner side: https://gitea.com/gitea/act_runner/pulls/201

changes:
- Add column of `labels` to table `action_runner`, and combine the value
of `agent_labels` and `custom_labels` column to `labels` column.
- Store `labels` when registering `act_runner`.
- Update `labels` when `act_runner` starting and calling `Declare`.
- Users cannot modify the `custom labels` in edit page any more.

other changes:
- Store `version` when registering `act_runner`.
- If runner is latest version, parse version from `Declare`. But older
version runner still parse version from request header.

16 months agoImprove AJAX link and modal confirm dialog (#25210)
wxiaoguang [Tue, 13 Jun 2023 12:10:10 +0000 (20:10 +0800)]
Improve AJAX link and modal confirm dialog (#25210)

Clarify the "link-action" behavior:

>  // A "link-action" can post AJAX request to its "data-url"
> // Then the browser is redirect to: the "redirect" in response, or
"data-redirect" attribute, or current URL by reloading.

And enhance the "link-action" to support showing a modal dialog for
confirm. A similar general approach could also help PRs like
https://github.com/go-gitea/gitea/pull/22344#discussion_r1062883436

> // If the "link-action" has "data-modal-confirm(-html)" attribute, a
confirm modal dialog will be shown before taking action.

And a lot of duplicate code can be removed now. A good framework design
can help to avoid code copying&pasting.

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoUse inline SVG for built-in OAuth providers (#25171)
silverwind [Tue, 13 Jun 2023 10:51:02 +0000 (12:51 +0200)]
Use inline SVG for built-in OAuth providers (#25171)

The plan is that all built-in auth providers use inline SVG for more
flexibility in styling and to get the GitHub icon to follow
`currentcolor`. This only removes the `public/img/auth` directory and
adds the missing svgs to our svg build.

It should map the built-in providers to these SVGs and render them. If
the user has set a Icon URL, it should render that as an `img` tag
instead.

```
gitea-azure-ad
gitea-bitbucket
gitea-discord
gitea-dropbox
gitea-facebook
gitea-gitea
gitea-gitlab
gitea-google
gitea-mastodon
gitea-microsoftonline
gitea-nextcloud
gitea-twitter
gitea-yandex
octicon-mark-github
```

GitHub logo is now white again on dark theme:

<img width="431" alt="Screenshot 2023-06-12 at 21 45 34"
src="https://github.com/go-gitea/gitea/assets/115237/27a43504-d60a-4132-a502-336b25883e4d">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoDisable `Create column` button while the column name is empty (#25192)
Punit Inani [Tue, 13 Jun 2023 09:57:03 +0000 (15:27 +0530)]
Disable `Create column` button while the column name is empty  (#25192)

![Jun-10-2023
18-43-04](https://github.com/go-gitea/gitea/assets/80308335/4796c9be-d161-43a0-a3e3-d9cd6a19cda4)

Fixes #25116

16 months agoFix profile render when the README.md size is larger than 1024 bytes (#25131)
yp05327 [Tue, 13 Jun 2023 09:02:25 +0000 (18:02 +0900)]
Fix profile render when the README.md size is larger than 1024 bytes (#25131)

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

`GetBlobContent` will only get the first 1024 bytes, if the README.md
size is larger than 1024 bytes,
We can not render the rest of them.
After this fix, we should provide the limited size to read when call
`GetBlobContent`.

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/22a42936-4cf8-40b4-a5c7-e384082beb0d)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoChange access token UI to select dropdowns (#25109)
Jonathan Tran [Tue, 13 Jun 2023 07:55:48 +0000 (03:55 -0400)]
Change access token UI to select dropdowns (#25109)

The current UI to create API access tokens uses checkboxes that have a
complicated relationship where some need to be checked and/or disabled
in certain states. It also requires that a user interact with it to
understand what their options really are.

This branch changes to use `<select>`s. It better fits the available
options, and it's closer to [GitHub's
UI](https://github.com/settings/personal-access-tokens/new), which is
good, in my opinion. It's more mobile friendly since the tap-areas are
larger. If we ever add more permissions, like Maintainer, there's a
natural place that doesn't take up more screen real-estate.

This branch also fixes a few minor issues:

- Hide the error about selecting at least one permission after second
submission
- Fix help description to call it "authorization" since that's what
permissions are about (not authentication)

Related: #24767.

<img width="883" alt="Screenshot 2023-06-07 at 5 07 34 PM"
src="https://github.com/go-gitea/gitea/assets/10803/6b63d807-c9be-4a4b-8e53-ecab6cbb8f76">

---

When it's open:

<img width="881" alt="Screenshot 2023-06-07 at 5 07 59 PM"
src="https://github.com/go-gitea/gitea/assets/10803/2432c6d0-39c2-4ca4-820e-c878ffdbfb69">

16 months agoFix task list checkbox toggle to work with YAML front matter (#25184)
Jonathan Tran [Tue, 13 Jun 2023 06:44:47 +0000 (02:44 -0400)]
Fix task list checkbox toggle to work with YAML front matter (#25184)

Fixes #25160.

`data-source-position` of checkboxes in a task list was incorrect
whenever there was YAML front matter. This would result in issue content
or PR descriptions getting corrupted with random `x` or space characters
when a user checked or unchecked a task.

16 months agoFix compatible for webhook ref type (#25195)
Lunny Xiao [Tue, 13 Jun 2023 06:05:28 +0000 (14:05 +0800)]
Fix compatible for webhook ref type (#25195)

Fix #25185
Caused by #24634

16 months agoHide limited users if viewed by anonymous ghost (#25214)
KN4CK3R [Tue, 13 Jun 2023 03:21:11 +0000 (05:21 +0200)]
Hide limited users if viewed by anonymous ghost (#25214)

The ghost user leads to inclusion of limited users/orgs in
`BuildCanSeeUserCondition`.

16 months agoUpdate `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig...
editfund-founder [Tue, 13 Jun 2023 02:53:51 +0000 (10:53 +0800)]
Update `from-source.zh-cn.md` & `from-source.en-us.md` - Cross Compile Using Zig (#25194)

## Compile & Cross Compile Gitea With CGO Dependencies Using Zig

---------

Co-authored-by: Jason Song <i@wolfogre.com>
16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 13 Jun 2023 00:27:02 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoRemove hacky patch for "safari emoji glitch fix" (#25208)
wxiaoguang [Mon, 12 Jun 2023 15:44:53 +0000 (23:44 +0800)]
Remove hacky patch for "safari emoji glitch fix"  (#25208)

According to my test, the UI (emoji) is fine in Safari

And actually the code is just dead code, because the "resize" event is
never fired on page loading. So for most cases users just view the pages
without this hacky patch, nobody ever complains.

16 months agoDo not overwrite the log mode when installing (#25203)
wxiaoguang [Mon, 12 Jun 2023 10:52:49 +0000 (18:52 +0800)]
Do not overwrite the log mode when installing (#25203)

Fix #24861

16 months agoFix fullscreen for action (#25200)
HesterG [Mon, 12 Jun 2023 10:18:01 +0000 (18:18 +0800)]
Fix fullscreen for action  (#25200)

An error occurs when clicking on `show full screen` on action page.

<img width="1440" alt="Screen Shot 2023-06-12 at 13 06 52"
src="https://github.com/go-gitea/gitea/assets/17645053/1d4ded3c-fb77-4dd8-9201-24d0696f96eb">

class name has changed in #25134, so the selector is not working.
Enhance the selectors to fix this.

16 months agoAdjust style for action run list (align icons, adjust padding) (#25170)
HesterG [Mon, 12 Jun 2023 09:36:08 +0000 (17:36 +0800)]
Adjust style for action run list (align icons, adjust padding) (#25170)

Main changes:

- Moved the icon into `action-item-main`, and make it `position:
absolute` to allow add margin it to align with `issue-item-top-row`.
- Adjusted padding and color of texts.

# Before

<img width="721" alt="Screen Shot 2023-06-09 at 17 04 38"
src="https://github.com/go-gitea/gitea/assets/17645053/3fc00e94-bcd4-4e06-b1d8-93be0576dbc3">

# After

<img width="1421" alt="Screen Shot 2023-06-09 at 18 32 47"
src="https://github.com/go-gitea/gitea/assets/17645053/c2a0f9df-cac4-4197-9cbd-6c16dfef215b">

On hover:

<img width="1431" alt="Screen Shot 2023-06-09 at 18 32 54"
src="https://github.com/go-gitea/gitea/assets/17645053/d0ab6fde-9722-4d76-831b-163fd6a1f560">

16 months agoImprove some documents: release version, logging, NFS lock (#25202)
wxiaoguang [Mon, 12 Jun 2023 09:05:49 +0000 (17:05 +0800)]
Improve some documents: release version, logging, NFS lock (#25202)

Close #23654
Close #24684

@techknowlogick I still think we need to rename
https://dl.gitea.com/gitea/1.20/ to
https://dl.gitea.com/gitea/1.20-nightly/

`/gitea/1.20/` is quite confusing, it needs these words to explain why.
If we call it `1.20-nightly`, the FAQ can be simplified a lot.

16 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 12 Jun 2023 00:29:16 +0000 (00:29 +0000)]
[skip ci] Updated licenses and gitignores

16 months agoAdd `WithPullRequest` for `actionsNotifier` (#25144)
Zettat123 [Sun, 11 Jun 2023 01:06:43 +0000 (09:06 +0800)]
Add `WithPullRequest` for `actionsNotifier` (#25144)

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 11 Jun 2023 00:29:35 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 10 Jun 2023 00:25:26 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoUpdate github.com/google/go-github to v53 (#25157)
Yevhen Pavlov [Fri, 9 Jun 2023 19:42:51 +0000 (22:42 +0300)]
Update github.com/google/go-github to v53 (#25157)

The new `go-github` version
[53](https://github.com/google/go-github/releases/tag/v53.0.0) has been
released.

16 months agoFix bug for code search if code is disabled (#25173)
Lunny Xiao [Fri, 9 Jun 2023 19:02:33 +0000 (03:02 +0800)]
Fix bug for code search if code is disabled (#25173)

Fix https://github.com/go-gitea/gitea/pull/24189/files#r1224144768

16 months agoMinor arc-green color tweaks (#25175)
silverwind [Fri, 9 Jun 2023 15:17:30 +0000 (17:17 +0200)]
Minor arc-green color tweaks (#25175)

Some minor color tweaks

<img width="1271" alt="Screenshot 2023-06-09 at 13 29 25"
src="https://github.com/go-gitea/gitea/assets/115237/b7b34995-5d34-461f-8d19-4f5755a98109">
<img width="1272" alt="Screenshot 2023-06-09 at 13 31 20"
src="https://github.com/go-gitea/gitea/assets/115237/63c866b4-797e-46ed-ba28-b1162ccd3e15">
<img width="1276" alt="Screenshot 2023-06-09 at 13 32 21"
src="https://github.com/go-gitea/gitea/assets/115237/de7ee02e-d0c7-4979-a8aa-0fd03e8db491">

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoFix duplicate Reviewed-by trailers (#24796)
Cory Todd [Fri, 9 Jun 2023 14:34:49 +0000 (07:34 -0700)]
Fix duplicate Reviewed-by trailers (#24796)

Enable deduplication of unofficial reviews. When pull requests are
configured to include all approvers, not just official ones, in the
default merge messages it was possible to generate duplicated
Reviewed-by lines for a single person. Add an option to find only
distinct reviews for a given query.

fixes #24795

---------

Signed-off-by: Cory Todd <cory.todd@canonical.com>
Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoFix #25133 (#25162)
yp05327 [Fri, 9 Jun 2023 10:27:10 +0000 (19:27 +0900)]
Fix #25133 (#25162)

Fix #25133

Thanks @wxiaoguang @silverwind.
I'm sorry I made a mistake, it will be fixed in this PR.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix mobile navbar and misc cleanups (#25134)
silverwind [Fri, 9 Jun 2023 09:10:51 +0000 (11:10 +0200)]
Fix mobile navbar and misc cleanups (#25134)

- Fix and improve mobile navbar layout
- Apply all cleanups suggested in
https://github.com/go-gitea/gitea/pull/25111
- Make media query breakpoints match Fomantic's exactly
- Clean up whitespace in class on navbar items

Mobile navbar before and after:
<img width="745" alt="Screenshot 2023-06-08 at 08 40 56"
src="https://github.com/go-gitea/gitea/assets/115237/ca84b239-b10f-41db-8c06-dcf2b6dd9d28">
<img width="739" alt="Screenshot 2023-06-08 at 08 41 23"
src="https://github.com/go-gitea/gitea/assets/115237/09133c54-eb7e-4110-858c-ead23c3b7521">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoButton and color enhancements (#24989)
silverwind [Fri, 9 Jun 2023 08:37:47 +0000 (10:37 +0200)]
Button and color enhancements (#24989)

- Various corrections to button styles, especially secondary
- Remove focus highlight, it's annoying when it stays on button after
press
- Clearly define ghost and link buttons with demos in devtest
- Remove black, grey and tertiary buttons, they should not be used
- Make `arc-green` slightly darker

<img width="1226" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/8d89786a-01ab-40f8-ae5a-e17f40e35084">
<img width="1249" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/83651e6d-3c27-46ff-b8bd-ff344d70e949">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoFix setup-go actions (#25167)
silverwind [Fri, 9 Jun 2023 07:33:48 +0000 (09:33 +0200)]
Fix setup-go actions (#25167)

The `setup-go` actions did not all have `check-latest` which means they
use some cached version of go that currently still resolves to go1.20.4,
as seen in a number of recent runs that currently fail at govulncheck
because of it:

````
Run actions/setup-go@v4
Setup go version spec >=1.20
Attempting to resolve the latest version from the manifest...
matching >=1.20...
Resolved as '1.20.4'
````

Add the
[check-latest](https://github.com/actions/setup-go#check-latest-version)
option which should guarantee that this cache is skipped.

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 9 Jun 2023 00:28:43 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoModify OAuth login ui and fix display name, iconurl related logic (#25030)
HesterG [Thu, 8 Jun 2023 16:35:29 +0000 (00:35 +0800)]
Modify OAuth login ui and fix display name, iconurl related logic (#25030)

Close #24808

Co-Authour @wxiaoguang @silverwind

1. Most svgs are found from https://worldvectorlogo.com/ , and some are
from conversion of png to svg. (facebook and nextcloud). And also
changed `templates/user/settings/security/accountlinks.tmpl`.

2. Fixed display name and iconurl related logic

# After

<img width="1436" alt="Screen Shot 2023-06-05 at 14 09 05"
src="https://github.com/go-gitea/gitea/assets/17645053/a5db39d8-1ab0-4676-82a4-fba60a1d1f84">

On mobile

<img width="378" alt="Screen Shot 2023-06-05 at 14 09 46"
src="https://github.com/go-gitea/gitea/assets/17645053/71d0f51b-baac-4f48-8ca2-ae0e013bd62e">

user/settings/security/accountlinks (The dropdown might be improved
later)

<img width="973" alt="Screen Shot 2023-06-01 at 10 01 44"
src="https://github.com/go-gitea/gitea/assets/17645053/27010e7e-2785-4fc5-8c49-b06621898f37">

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoFix open redirect check for more cases (#25143)
Lauris BH [Thu, 8 Jun 2023 14:08:14 +0000 (17:08 +0300)]
Fix open redirect check for more cases (#25143)

If redirect_to parameter has set value starting with `\\example.com`
redirect will be created with header `Location: /\\example.com` that
will redirect to example.com domain.

16 months agoUpdate js dependencies (#25137)
silverwind [Thu, 8 Jun 2023 10:54:31 +0000 (12:54 +0200)]
Update js dependencies (#25137)

- Update all JS dependencies
- Tweak eslint for more generic globs
- Tested mermaid, pdf, monaco

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoRemove duplicated functions when deleting a branch (#25128)
Lunny Xiao [Thu, 8 Jun 2023 10:10:59 +0000 (18:10 +0800)]
Remove duplicated functions when deleting a branch (#25128)

Extract from #22743

`DeleteBranch` will trigger a push update event, so that
`pull_service.CloseBranchPulls` has been invoked twice and
`AddDeletedBranch` is better to be moved to push update then even user
delete a branch via git command, it will also be triggered.

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoAdd codeowners feature (#24910)
Vladimir Buyanov [Thu, 8 Jun 2023 08:56:05 +0000 (11:56 +0300)]
Add codeowners feature (#24910)

Hello.
This PR adds a github like configuration for the CODEOWNERS file.

Resolves: #10161

16 months agoFix strange UI behavior of cancelling dismiss review modal (#25133)
yp05327 [Thu, 8 Jun 2023 08:52:35 +0000 (17:52 +0900)]
Fix strange UI behavior of cancelling dismiss review modal (#25133)

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

The old code uses `$(this).next()` to get `dismiss-review-modal`.
At first, it will get `$(#dismiss-review-modal)`, but the next time it
will get `$(#dismiss-review-modal).next();`
and then `$(#dismiss-review-modal).next().next();`.
Because div `dismiss-review-modal` will be removed when
`dismiss-review-btn` clicked.

Maybe the right usage is adding `show-modal` class and `data-modal`
attribute.

16 months agoFix `MilestoneIDs` when querying issues (#25125)
Zettat123 [Thu, 8 Jun 2023 08:08:35 +0000 (16:08 +0800)]
Fix `MilestoneIDs` when querying issues (#25125)

Fix #25114

16 months agoFix incorrect git ignore rule and add missing license files (#25135)
yp05327 [Thu, 8 Jun 2023 07:36:53 +0000 (16:36 +0900)]
Fix incorrect git ignore rule and add missing license files (#25135)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoChange branch name from master to main in some documents' links (#25126)
HesterG [Thu, 8 Jun 2023 07:35:55 +0000 (15:35 +0800)]
Change branch name from master to main in some documents' links (#25126)

As title. And needs to backport to 1.19

16 months agoRemove incorrect element ID on "post-install" page (#25104)
wxiaoguang [Thu, 8 Jun 2023 04:23:39 +0000 (12:23 +0800)]
Remove incorrect element ID on "post-install" page (#25104)

That ID is a "copy&paste" error, it conflicts with the
`initRepoMigrationStatusChecker` logic, which is the right function for
a real `#repo_migrating` element. That wrong ID causes incorrect page
navigation after installation.

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 8 Jun 2023 00:28:45 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoImprove notification icon and navbar (#25111) v1.21.0-dev
silverwind [Wed, 7 Jun 2023 22:21:57 +0000 (00:21 +0200)]
Improve notification icon and navbar  (#25111)

Improvements to the notification icon and `<nav>`:

- Add a opaque color for header hover and use it, allowing the border to
be the right color on hover (sadly, not otherwise possible with CSS, not
even `color-mix`).
- Increase font size by 1px
- Use flexbox for slightly better text centering
- Reduce padding of user and add repo button, add margin on right side
of user menu
- Remove the `following bar` wrapper on navbar

<img width="176" alt="Screenshot 2023-06-07 at 00 07 08"
src="https://github.com/go-gitea/gitea/assets/115237/23cdc3d6-7f63-49df-bec3-f2e75e32a304">
<img width="63" alt="Screenshot 2023-06-07 at 00 07 14"
src="https://github.com/go-gitea/gitea/assets/115237/fae602c2-4467-4d50-b1ec-56317843f9a2">
<img width="84" alt="Screenshot 2023-06-07 at 00 07 36"
src="https://github.com/go-gitea/gitea/assets/115237/c48141b8-0b3c-48cc-846a-3a272524dbdb">
<img width="329" alt="Screenshot 2023-06-07 at 00 25 10"
src="https://github.com/go-gitea/gitea/assets/115237/cda612f1-426e-466b-a351-fc992bfd18fd">
<img width="186" alt="Screenshot 2023-06-07 at 00 35 45"
src="https://github.com/go-gitea/gitea/assets/115237/04484a2e-9bbf-493c-aa26-8e936da008fa">
<img width="797" alt="Screenshot 2023-06-07 at 16 57 40"
src="https://github.com/go-gitea/gitea/assets/115237/e7ccb672-5807-4cb6-b306-b18ae0c7e321">

16 months agofix swagger documentation for multiple files API endpoint (#25110) v1.20.0-rc0
Denys Konovalov [Wed, 7 Jun 2023 15:49:58 +0000 (17:49 +0200)]
fix swagger documentation for multiple files API endpoint (#25110)

Fixes some issues with the swagger documentation for the new multiple
files API endpoint (#24887) which were overlooked when submitting the
original PR:

1. add some missing parameter descriptions
2. set correct `required` option for required parameters
3. change endpoint description to match it full functionality (every
kind of file modification is supported, not just creating and updating)

16 months agoFix webauthn regression and improve code (#25113)
wxiaoguang [Wed, 7 Jun 2023 11:20:18 +0000 (19:20 +0800)]
Fix webauthn regression and improve code (#25113)

Follow:

* #22697

There are some bugs in #22697:

* https://github.com/go-gitea/gitea/pull/22697#issuecomment-1577957966
* the webauthn failure message is never shown and causes console error
* The `document.getElementById('register-button')` and
`document.getElementById('login-button')` is wrong
    * there is no such element in code
    * it causes JS error when a browser doesn't provide webauthn
    * the end user can't see the real error message

These bugs are fixed in this PR.

Other changes:

* Use simple HTML/CSS layouts, no need to use too many `gt-` patches
* Make the webauthn page have correct "page-content" layout
* The "data-webauthn-error-msg" elements are only used to provide locale
texts, so move them into a single "gt-hidden", then no need to repeat a
lot of "gt-hidden" in code
* The `{{.CsrfTokenHtml}}`  is a no-op because there is no form
* Many `hideElem('#webauthn-error')` in code is no-op because the
`webauthn-error` already has "gt-hidden" by default
* Make the tests for "URLEncodedBase64" really test with concrete cases.

Screenshots:

* Error message when webauthn fails (before, there is no error message):

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/93cf9559-d93b-4f06-9d98-0f7032d9c65b)

</details>

* Error message when webauthn is unavailable

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/ffc0fcd9-b93b-4418-979c-c89bb627aaf2)

</details>

16 months agoAdd details summary for vertical menus in settings to allow toggling (#25098)
HesterG [Wed, 7 Jun 2023 02:49:48 +0000 (10:49 +0800)]
Add details summary for vertical menus in settings to allow toggling (#25098)

Close #25051
[referenced
answer](https://stackoverflow.com/questions/10813581/can-i-replace-the-expand-icon-of-the-details-element/69722686#69722686)
for marker overwrite. One limitation is that fomantic does not have
hover and active effects for the vertical submenu
([reference](https://fomantic-ui.com/collections/menu.html#sub-menu)).
And we might need to overwrite some styles if hover and active effects
are needed.

Update:
Used `data:image/svg` instead of `marker` content. And adjusted styles
for hover effect.

Take admin settings as an example:

https://github.com/go-gitea/gitea/assets/17645053/63f69823-ef43-47d5-a518-544b5ea35ba6

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix 500 error caused by notifications without an issue such as repo transfers (#25101)
Jason Song [Tue, 6 Jun 2023 15:17:56 +0000 (23:17 +0800)]
Fix 500 error caused by notifications without an issue such as repo transfers (#25101)

16 months agoClean up WebAuthn javascript code and remove JQuery code (#22697)
zeripath [Tue, 6 Jun 2023 05:29:37 +0000 (06:29 +0100)]
Clean up WebAuthn javascript code and remove JQuery code (#22697)

There were several issues with the WebAuthn registration and testing
code and the style
was very old javascript with jquery callbacks.

This PR uses async and fetch to replace the JQuery code.

Ref #22651

Signed-off-by: Andrew Thornton <art27@cantab.net>
---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoEnable all webpack sourcemaps in dev build, disable all in prod build (#25089)
silverwind [Tue, 6 Jun 2023 04:57:08 +0000 (06:57 +0200)]
Enable all webpack sourcemaps in dev build, disable all in prod build (#25089)

- Enable all source maps in dev build
- Disable all source maps in prod build
- Provide `ENABLE_SOURCEMAP` env var to override it.

I think the strange error seen in
https://github.com/go-gitea/gitea/issues/24784 is sourcemap related, so
if we enable/disable them all, it might go away. But it's most
definitely a Safari bug.

With all sourcemaps disabled, binary size goes down by around 1-2 MB,
with all enabled it goes up by around 12MB. If +12MB is acceptable, we
could also always enable them by default as fully source maps do have
some debugging benefits.

16 months agoDon't display `select all issues` checkbox when no issues are available (#25086)
Yevhen Pavlov [Tue, 6 Jun 2023 00:19:24 +0000 (03:19 +0300)]
Don't display `select all issues` checkbox when no issues are available (#25086)

Before:

![image](https://github.com/go-gitea/gitea/assets/1969460/8830c077-89d4-4897-a6e0-f5dba6830ff7)

After:

![image](https://github.com/go-gitea/gitea/assets/1969460/8fa06878-496b-4f65-87eb-04e1f94d4a3c)

16 months agochange placeholders in actions docs
techknowlogick [Mon, 5 Jun 2023 15:32:56 +0000 (11:32 -0400)]
change placeholders in actions docs

16 months agochange placeholders in actions docs
techknowlogick [Mon, 5 Jun 2023 15:28:51 +0000 (11:28 -0400)]
change placeholders in actions docs

16 months agofix "Remove stars when repo goes private #19904" (#25084)
6543 [Mon, 5 Jun 2023 15:23:09 +0000 (17:23 +0200)]
fix "Remove stars when repo goes private #19904" (#25084)

https://github.com/go-gitea/gitea/pull/19904#discussion_r1218111682

16 months agoIntroduce how to configure cache when starting a Runner with Docker (#25077)
sillyguodong [Mon, 5 Jun 2023 14:12:55 +0000 (22:12 +0800)]
Introduce how to configure cache when starting a Runner with Docker (#25077)

If a user starts a runner using a Docker image without making additional
configurations, the [cache action](https://github.com/actions/cache)
will not work properly.
Therefore, add a section in the documentation that explains how to
configure the cache correctly.

16 months agoRemove stars when repo goes private (#19904)
Wim [Mon, 5 Jun 2023 13:25:43 +0000 (15:25 +0200)]
Remove stars when repo goes private (#19904)

Fixes #18600

16 months agoUse correct selector for hiding RSS icon link in the branch selector dropdown (#25080)
wxiaoguang [Mon, 5 Jun 2023 12:34:25 +0000 (20:34 +0800)]
Use correct selector for hiding RSS icon link in the branch selector dropdown (#25080)

Fix  #25079

![image](https://github.com/go-gitea/gitea/assets/2114189/5d3f2f49-018a-4b75-8c90-ffafd898697a)

![image](https://github.com/go-gitea/gitea/assets/2114189/3e9dcf2e-eca7-4e96-be79-3b26f222cdb9)

![image](https://github.com/go-gitea/gitea/assets/2114189/855fffa4-0220-4ca2-a5e0-58c376fdc378)

![image](https://github.com/go-gitea/gitea/assets/2114189/f5ffa7e6-a974-4698-a45d-e38091903be1)

16 months agoFix parallelly generating index failure with Mysql (#24567)
Lunny Xiao [Mon, 5 Jun 2023 10:33:47 +0000 (18:33 +0800)]
Fix parallelly generating index failure with Mysql (#24567)

16 months agoUse git command instead of the ini package to remove the `origin` remote (#25066)
Lunny Xiao [Mon, 5 Jun 2023 10:05:31 +0000 (18:05 +0800)]
Use git command instead of the ini package to remove the `origin` remote (#25066)

16 months agoimprove permission documentation (#23942)
Lunny Xiao [Mon, 5 Jun 2023 07:43:17 +0000 (15:43 +0800)]
improve permission documentation (#23942)

16 months agoUse RepositoryList instead of []*Repository (#25074)
Lunny Xiao [Mon, 5 Jun 2023 07:25:47 +0000 (15:25 +0800)]
Use RepositoryList instead of []*Repository (#25074)

16 months agoAdd ability to set multiple redirect URIs in OAuth application UI (#25072)
Denys Konovalov [Mon, 5 Jun 2023 07:00:12 +0000 (09:00 +0200)]
Add ability to set multiple redirect URIs in OAuth application UI (#25072)

OAuth applications can already have multiple redirect URIs if
created/edited over API.

This change allows for setting multiple redirect URIs through the UI as
a comma-separated list (e. g.
`https://example.org/redirect,https://redirect.example.org`)

<details>
<summary>Screenshots</summary>

![Bildschirmfoto vom 2023-06-04
17-14-40](https://github.com/go-gitea/gitea/assets/47871822/2206dc32-e7e4-4953-9ecb-e098890b3f54)
![Bildschirmfoto vom 2023-06-04
17-14-50](https://github.com/go-gitea/gitea/assets/47871822/cd97c73c-9310-44ee-a83a-b927a1ef94da)

</details>

Closes #25068

16 months agoAdd Progressbar to Milestone Page (#25050)
JakobDev [Mon, 5 Jun 2023 06:25:46 +0000 (08:25 +0200)]
Add Progressbar to Milestone Page (#25050)

This is adds the progress bar, which is already on the Milestone List,
also to the Page of a Single Milestone.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/24e0fa28-369b-4bb9-807a-ee823b46ba81)

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 5 Jun 2023 00:27:49 +0000 (00:27 +0000)]
[skip ci] Updated licenses and gitignores

16 months agoRedesign Scoped Access Tokens (#24767)
Jack Hay [Sun, 4 Jun 2023 18:57:16 +0000 (14:57 -0400)]
Redesign Scoped Access Tokens (#24767)

## Changes
- Adds the following high level access scopes, each with `read` and
`write` levels:
    - `activitypub`
    - `admin` (hidden if user is not a site admin)
    - `misc`
    - `notification`
    - `organization`
    - `package`
    - `issue`
    - `repository`
    - `user`
- Adds new middleware function `tokenRequiresScopes()` in addition to
`reqToken()`
  -  `tokenRequiresScopes()` is used for each high-level api section
- _if_ a scoped token is present, checks that the required scope is
included based on the section and HTTP method
  - `reqToken()` is used for individual routes
- checks that required authentication is present (but does not check
scope levels as this will already have been handled by
`tokenRequiresScopes()`
- Adds migration to convert old scoped access tokens to the new set of
scopes
- Updates the user interface for scope selection

### User interface example
<img width="903" alt="Screen Shot 2023-05-31 at 1 56 55 PM"
src="https://github.com/go-gitea/gitea/assets/23248839/654766ec-2143-4f59-9037-3b51600e32f3">
<img width="917" alt="Screen Shot 2023-05-31 at 1 56 43 PM"
src="https://github.com/go-gitea/gitea/assets/23248839/1ad64081-012c-4a73-b393-66b30352654c">

## tokenRequiresScopes  Design Decision
- `tokenRequiresScopes()` was added to more reliably cover api routes.
For an incoming request, this function uses the given scope category
(say `AccessTokenScopeCategoryOrganization`) and the HTTP method (say
`DELETE`) and verifies that any scoped tokens in use include
`delete:organization`.
- `reqToken()` is used to enforce auth for individual routes that
require it. If a scoped token is not present for a request,
`tokenRequiresScopes()` will not return an error

## TODO
- [x] Alphabetize scope categories
- [x] Change 'public repos only' to a radio button (private vs public).
Also expand this to organizations
- [X] Disable token creation if no scopes selected. Alternatively, show
warning
- [x] `reqToken()` is missing from many `POST/DELETE` routes in the api.
`tokenRequiresScopes()` only checks that a given token has the correct
scope, `reqToken()` must be used to check that a token (or some other
auth) is present.
   -  _This should be addressed in this PR_
- [x] The migration should be reviewed very carefully in order to
minimize access changes to existing user tokens.
   - _This should be addressed in this PR_
- [x] Link to api to swagger documentation, clarify what
read/write/delete levels correspond to
- [x] Review cases where more than one scope is needed as this directly
deviates from the api definition.
   - _This should be addressed in this PR_
   - For example:
   ```go
m.Group("/users/{username}/orgs", func() {
m.Get("", reqToken(), org.ListUserOrgs)
m.Get("/{org}/permissions", reqToken(), org.GetUserOrgsPermissions)
}, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryUser,
auth_model.AccessTokenScopeCategoryOrganization),
context_service.UserAssignmentAPI())
   ```

## Future improvements
- [ ] Add required scopes to swagger documentation
- [ ] Redesign `reqToken()` to be opt-out rather than opt-in
- [ ] Subdivide scopes like `repository`
- [ ] Once a token is created, if it has no scopes, we should display
text instead of an empty bullet point
- [ ] If the 'public repos only' option is selected, should read
categories be selected by default

Closes #24501
Closes #24799

Co-authored-by: Jonathan Tran <jon@allspice.io>
Co-authored-by: Kyle D <kdumontnu@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoUse a separate admin page to show global stats, remove `actions` stat (#25062)
wxiaoguang [Sat, 3 Jun 2023 14:03:41 +0000 (22:03 +0800)]
Use a separate admin page to show global stats, remove `actions` stat (#25062)

Before, Gitea shows the database table stats on the `admin dashboard`
page.

It has some problems:

* `count(*)` is quite heavy. If tables have many records, this blocks
loading the admin page blocks for a long time
* Some users had even reported issues that they can't visit their admin
page because this page causes blocking or `50x error (reverse proxy
timeout)`
* The `actions` stat is not useful. The table is simply too large. Does
it really matter if it contains 1,000,000 rows or 9,999,999 rows?
* The translation `admin.dashboard.statistic_info` is difficult to
maintain.

So, this PR uses a separate page to show the stats and removes the
`actions` stat.

![image](https://github.com/go-gitea/gitea/assets/2114189/babf7c61-b93b-4a62-bfaa-22983636427e)

## :warning: BREAKING

The `actions` Prometheus metrics collector has been removed for the
reasons mentioned beforehand.
Please do not rely on its output anymore.

16 months agoRemove cancel button from branch protection form (#25063)
Yarden Shoham [Sat, 3 Jun 2023 12:06:09 +0000 (15:06 +0300)]
Remove cancel button from branch protection form (#25063)

It caused bugs. To cancel, just navigate away.

- Follows #21381 and #21872
- Resolves #25038

## Before

![image](https://github.com/go-gitea/gitea/assets/20454870/068c8d96-fc50-4725-8af2-d953e9f39024)

## After

![image](https://github.com/go-gitea/gitea/assets/20454870/105d5c50-e490-456a-a253-269b174c09ab)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
16 months agoAllow for PKCE flow without client secret + add docs (#25033)
Denys Konovalov [Sat, 3 Jun 2023 03:59:28 +0000 (05:59 +0200)]
Allow for PKCE flow without client secret + add docs (#25033)

The PKCE flow according to [RFC
7636](https://datatracker.ietf.org/doc/html/rfc7636) allows for secure
authorization without the requirement to provide a client secret for the
OAuth app.

It is implemented in Gitea since #5378 (v1.8.0), however without being
able to omit client secret.
Since #21316 Gitea supports setting client type at OAuth app
registration.

As public clients are already forced to use PKCE since #21316, in this
PR the client secret check is being skipped if a public client is
detected. As Gitea seems to implement PKCE authorization correctly
according to the spec, this would allow for PKCE flow without providing
a client secret.

Also add some docs for it, please check language as I'm not a native
English speaker.

Closes #17107
Closes #25047

16 months agoFix link to customizing-gitea (#25056)
kodermho [Sat, 3 Jun 2023 02:27:40 +0000 (22:27 -0400)]
Fix link to customizing-gitea (#25056)

The link to customizing-gitea in the label documentation is broken. This
PR should adjust the relative path to fix the link

16 months agoGitLab migration: Sanitize response for reaction list (#25054)
6543 [Fri, 2 Jun 2023 20:35:50 +0000 (22:35 +0200)]
GitLab migration: Sanitize response for reaction list (#25054)

16 months agoAdd up and down arrows to selected lookup repositories (#24727)
Tyrone Yeh [Fri, 2 Jun 2023 18:39:07 +0000 (02:39 +0800)]
Add up and down arrows to selected lookup repositories (#24727)

Use up and down arrow key to select repositories

![image](https://github.com/go-gitea/gitea/assets/1255041/3f3bce64-86d9-4b37-994b-3d129ebf48d9)

---------

Co-authored-by: silverwind <me@silverwind.io>
16 months agoShow file tree by default (#25052)
Kyle D [Fri, 2 Jun 2023 15:39:01 +0000 (11:39 -0400)]
Show file tree by default (#25052)

Feel free to close this if there isn't interest.

The tree view looks amazing, and all of our users are really enjoying it
(major kudos to developers!), but only IF I tell them it exists!

Essentially, the file tree view as it is effectively undiscoverable.

This PR changes the default state for the tree view to open, which
should significantly help with discoverability.

An alternative could be to reserve more horizontal space, as a typical
accordion panel would look (eg. VS Code), eg.

![image](https://github.com/go-gitea/gitea/assets/12700993/505ea40c-42b1-4111-b306-48e51e8e2130)

16 months agoMinor UI improvements: logo alignment, auth map editor, auth name display (#25043)
wxiaoguang [Fri, 2 Jun 2023 10:02:20 +0000 (18:02 +0800)]
Minor UI improvements: logo alignment, auth map editor, auth name display (#25043)

Some minor UI improvements together (then no need to review 3 small PRs)

# The Map for auth sources

Close #24826

Now the LDAP and OAuth2 both have multiple line editor for the map (and
it can be resized by the handler)

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/7eed1618-0d71-4df2-84bd-ca20a06c02db)

![image](https://github.com/go-gitea/gitea/assets/2114189/a94dc6dc-0e3b-4185-bac1-8d16561b8e62)

</details>

# The account link display

Before, the UI is misaligned

This PR fixes the misalignment, remove "float right", and show the auth
source name and auth type (in the tooltip).

And the "active" color is changed from dark red to primary color.

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/3bb4a8f2-2f66-4d62-ac96-096f14aeb819)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/05ca46ae-7769-422d-a52a-b7402679cd05)

</details>

# The UI logo alignment

Changed file: `css/base.css`.

Before, there were some "fine tunes", these "fine tunes" only causes
misalignment.

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/395b03c2-6e8c-4742-abf9-8d548dab908d)

</details>

After this PR:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/3339acdc-7391-45bc-b6ec-a5b3bc7830a6)

![image](https://github.com/go-gitea/gitea/assets/2114189/656a7bee-cdfb-4232-aee9-25b76cae8e00)

</details>

16 months agoRefactor INI package (first step) (#25024)
wxiaoguang [Fri, 2 Jun 2023 09:27:30 +0000 (17:27 +0800)]
Refactor INI package (first step) (#25024)

The INI package has many bugs and quirks, and in fact it is
unmaintained.

This PR is the first step for the INI package refactoring:

* Use Gitea's "config_provider" to provide INI access
* Deprecate the INI package by golangci.yml rule

16 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 2 Jun 2023 00:26:50 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

16 months agoAdd button on diff header to copy file name, misc diff header tweaks (#24986)
silverwind [Thu, 1 Jun 2023 10:47:28 +0000 (12:47 +0200)]
Add button on diff header to copy file name, misc diff header tweaks (#24986)

1. Add this button:

<img width="232" alt="Screenshot 2023-05-29 at 15 21 47"
src="https://github.com/go-gitea/gitea/assets/115237/5eaf6bd1-83db-4ffc-9503-eda0c59807d2">
<img width="297" alt="Screenshot 2023-05-29 at 15 20 22"
src="https://github.com/go-gitea/gitea/assets/115237/708a344f-f6d7-4229-bfda-76e1571b42c8">

2. Correct `button-link` styles to not have a background hover effect.
3. Tweak `.ui.container` padding to be the same for fluid and non-fluid.

4. Misc enhancements to diff header:

Before:
<img width="984" alt="Screenshot 2023-05-29 at 15 38 53"
src="https://github.com/go-gitea/gitea/assets/115237/c7926f6a-bd0a-4b05-97ad-c91fc25c62d5">

After:
<img width="987" alt="Screenshot 2023-05-29 at 15 43 10"
src="https://github.com/go-gitea/gitea/assets/115237/0149f545-45f8-42cf-b443-e1c76bd5cdeb">

16 months agoFix users cannot visit issue attachment bug (#25019)
Lunny Xiao [Wed, 31 May 2023 17:06:17 +0000 (01:06 +0800)]
Fix users cannot visit issue attachment bug (#25019)

Caused by #24362

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoFix incorrect issuel filter menu style (#25018)
wxiaoguang [Wed, 31 May 2023 10:44:28 +0000 (18:44 +0800)]
Fix incorrect issuel filter menu style (#25018)

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/b67b3a83-ebe4-4dac-b4b2-de93401d7ab2)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/fbf34418-2ddf-4d47-82da-155823501d31)

![image](https://github.com/go-gitea/gitea/assets/2114189/1b275de3-8c16-4873-b056-0df430c882f0)

</details>

16 months agoUpdate repo's default branch when adding new files in an empty one (#25017)
wxiaoguang [Wed, 31 May 2023 09:07:51 +0000 (17:07 +0800)]
Update repo's default branch when adding new files in an empty one (#25017)

Fix #25014

Only API needs this fix. On the Web UI, users could only add new file on
the default branch.

16 months agoRename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (#24988)
谈笑风生间 [Wed, 31 May 2023 07:54:46 +0000 (15:54 +0800)]
Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest (#24988)

after #24481

To keep consistent, maybe pull_request_review_request is better.

## what my pull request does

Rename NotifyPullReviewRequest to NotifyPullRequestReviewRequest.

<img width="1087" alt="image"
src="https://github.com/go-gitea/gitea/assets/75628309/2cf91f02-74f2-42fe-a998-0a039b821d8d">

16 months agoMerge `new project` templates into one (#24985)
delvh [Wed, 31 May 2023 06:50:18 +0000 (08:50 +0200)]
Merge `new project` templates into one (#24985)

Additionally simplify the `new project` template slightly.

Review hint: Disable whitespace changes.

<details><summary>Before</summary>

## New repo project

![grafik](https://github.com/go-gitea/gitea/assets/51889757/4de977e8-3688-45cd-8832-49b001e6f249)

## Edit repo project

![grafik](https://github.com/go-gitea/gitea/assets/51889757/daaf353f-6c99-48bd-b37a-a3bc64459079)

## New user/org project

![grafik](https://github.com/go-gitea/gitea/assets/51889757/6a5a3be5-f51a-4599-b75c-7adb9710d2fa)

## Edit user/org project

![grafik](https://github.com/go-gitea/gitea/assets/51889757/a4768f49-cf46-4773-8a0f-54dfdcc1c1b8)
</details>

<details><summary>After</summary>

## New repo project

![grafik](https://github.com/go-gitea/gitea/assets/51889757/3d0ac8a0-850a-4743-963c-71c66ef38d07)

## Edit repo project

![grafik](https://github.com/go-gitea/gitea/assets/51889757/6b86a1cd-e360-4a9b-aaf7-af032d0d991a)

## New user/org project

![grafik](https://github.com/go-gitea/gitea/assets/51889757/a7b0964c-e4c7-4924-842a-52a58499bc36)

## Edit user/org project

![grafik](https://github.com/go-gitea/gitea/assets/51889757/0fbc5605-afee-49bd-a44a-8646f8c55681)
</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
16 months agoAdd chinese documentations for `cran package registry` (#25012)
sillyguodong [Wed, 31 May 2023 06:14:31 +0000 (14:14 +0800)]
Add chinese documentations for `cran package registry` (#25012)

As title.

16 months agoRemove the service worker (#25010)
silverwind [Wed, 31 May 2023 02:07:04 +0000 (04:07 +0200)]
Remove the service worker (#25010)

It's been disabled by default since 1.17
(https://github.com/go-gitea/gitea/pull/18914), and it never really
delivered any benefit except being another cache layer that has its own
unsolved invalidation issues. HTTP cache works, we don't need two cache
layers at the browser for assets.

## :warning: BREAKING

You can remove the config `[ui].USE_SERVICE_WORKER` from your `app.ini`
now.

16 months agoAdd user level action runners (#24995)
HesterG [Wed, 31 May 2023 01:39:54 +0000 (09:39 +0800)]
Add user level action runners (#24995)

Used similar logic to organization.

<img width="1437" alt="Screen Shot 2023-05-30 at 10 18 06"
src="https://github.com/go-gitea/gitea/assets/17645053/49f3800a-44ae-4188-b1e6-91d49e3d7868">

<img width="1331" alt="Screen Shot 2023-05-30 at 10 31 18"
src="https://github.com/go-gitea/gitea/assets/17645053/221b2068-e9b9-4e34-bb4a-d390594b2f35">