]> source.dussan.org Git - gitea.git/log
gitea.git
14 months agoUse frontend fetch for branch dropdown component (#25719)
HesterG [Fri, 21 Jul 2023 11:20:04 +0000 (19:20 +0800)]
Use frontend fetch for branch dropdown component  (#25719)

- Send request to get branch/tag list, use loading icon when waiting for
response.
- Only fetch when the first time branch/tag list shows.
- For backend, removed assignment to `ctx.Data["Branches"]` and
`ctx.Data["Tags"]` from `context/repo.go` and passed these data wherever
needed.
- Changed some `v-if` to `v-show` and used native `svg` as mentioned in
https://github.com/go-gitea/gitea/pull/25719#issuecomment-1631712757 to
improve perfomance when there are a lot of branches.
- Places Used the dropdown component:

     Repo Home Page

<img width="1429" alt="Screen Shot 2023-07-06 at 12 17 51"
src="https://github.com/go-gitea/gitea/assets/17645053/6accc7b6-8d37-4e88-ae1a-bd2b3b927ea0">

    Commits Page

<img width="1431" alt="Screen Shot 2023-07-06 at 12 18 34"
src="https://github.com/go-gitea/gitea/assets/17645053/2d0bf306-d1e2-45a8-a784-bc424879f537">

    Specific commit -> operations -> cherry-pick

<img width="758" alt="Screen Shot 2023-07-06 at 12 23 28"
src="https://github.com/go-gitea/gitea/assets/17645053/1e557948-3881-4e45-a625-8ef36d45ae2d">

    Release Page

<img width="1433" alt="Screen Shot 2023-07-06 at 12 25 05"
src="https://github.com/go-gitea/gitea/assets/17645053/3ec82af1-15a4-4162-a50b-04a9502161bb">

- Demo

https://github.com/go-gitea/gitea/assets/17645053/d45d266b-3eb0-465a-82f9-57f78dc5f9f3

- Note:

UI of dropdown menu could be improved in another PR as it should apply
to more dropdown menus.

Fix #14180

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
14 months agoRemove commit status running and warning from the dashboard repo list (#26036)
Yarden Shoham [Fri, 21 Jul 2023 10:32:25 +0000 (13:32 +0300)]
Remove commit status running and warning from the dashboard repo list (#26036)

Also added comments so the next time the dashboard repo list won't be
forgotten

Follows #25839

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
14 months agoRefactor to use urfave/cli/v2 (#25959)
wxiaoguang [Fri, 21 Jul 2023 09:28:19 +0000 (17:28 +0800)]
Refactor to use urfave/cli/v2 (#25959)

Replace #10912

And there are many new tests to cover the CLI behavior

There were some concerns about the "option order in hook scripts"
(https://github.com/go-gitea/gitea/pull/10912#issuecomment-1137543314),
it's not a problem now. Because the hook script uses `/gitea hook
--config=/app.ini pre-receive` format. The "config" is a global option,
it can appear anywhere.

----

## ⚠️ BREAKING ⚠️

This PR does it best to avoid breaking anything. The major changes are:

* `gitea` itself won't accept web's options: `--install-port` / `--pid`
/ `--port` / `--quiet` / `--verbose` .... They are `web` sub-command's
options.
    * Use `./gitea web --pid ....` instead
* `./gitea` can still run the `web` sub-command as shorthand, with
default options
* The sub-command's options must follow the sub-command
* Before: `./gitea --sub-opt subcmd` might equal to `./gitea subcmd
--sub-opt` (well, might not ...)
    * After: only `./gitea subcmd --sub-opt` could be used
    * The global options like `--config` are not affected

14 months agoRemove commit status running and warning to align GitHub (#25839)
caicandong [Fri, 21 Jul 2023 08:24:36 +0000 (16:24 +0800)]
Remove commit status running and warning to align GitHub (#25839)

Fix #25776. Close #25826.

In the discussion of #25776, @wolfogre's suggestion was to remove the
commit status of `running` and `warning` to keep it consistent with
github.

references:
-
https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#about-commit-statuses

## :warning: BREAKING :warning:

So the commit status of Gitea will be consistent with GitHub, only
`pending`, `success`, `error` and `failure`, while `warning` and
`running` are not supported anymore.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
14 months agoFix escape problems in the branch selector (#25875)
yp05327 [Fri, 21 Jul 2023 06:18:40 +0000 (15:18 +0900)]
Fix escape problems in the branch selector (#25875)

Fix #25865

14 months agoUpdate README.md to fix the broken link of Hugo (#26008)
Pavel [Fri, 21 Jul 2023 04:47:47 +0000 (07:47 +0300)]
Update README.md to fix the broken link of Hugo (#26008)

Fix gohugo installiation link

14 months agoSupport copy protected branch from template repository (#25889)
Lunny Xiao [Fri, 21 Jul 2023 04:32:47 +0000 (12:32 +0800)]
Support copy protected branch from template repository (#25889)

Fix #14303

14 months agoUpdate JS dependencies (#26025)
silverwind [Fri, 21 Jul 2023 03:34:10 +0000 (05:34 +0200)]
Update JS dependencies (#26025)

- Update all JS dependencies
- Tweak eslint config, disable SequenceExpression aka. [Comma
operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_operator),
remove deprecated rule
- Add new stylelint rule
- Tested Monaco and Swagger

14 months agoReduce margins on admin pages (#26026)
silverwind [Fri, 21 Jul 2023 03:11:42 +0000 (05:11 +0200)]
Reduce margins on admin pages (#26026)

Reduce margins around admin boxes and reduce sidebar size from 275px to
240px. This is the same 16px margin we use on issue pages.

Before and After:
<img width="1270" alt="Screenshot 2023-07-21 at 00 28 11"
src="https://github.com/go-gitea/gitea/assets/115237/f9b0dcb0-8f7e-49b4-b130-54bf31c142fd">
<img width="1271" alt="Screenshot 2023-07-21 at 00 30 51"
src="https://github.com/go-gitea/gitea/assets/115237/ddd75d59-9ab9-4061-8989-852e89727560">

14 months agoActions Artifacts support uploading multiple files and directories (#24874)
FuXiaoHei [Fri, 21 Jul 2023 02:42:01 +0000 (10:42 +0800)]
Actions Artifacts support uploading multiple files and directories (#24874)

current actions artifacts implementation only support single file
artifact. To support multiple files uploading, it needs:

- save each file to each db record with same run-id, same artifact-name
and proper artifact-path
- need change artifact uploading url without artifact-id, multiple files
creates multiple artifact-ids
- support `path` in download-artifact action. artifact should download
to `{path}/{artifact-path}`.
- in repo action view, it provides zip download link in artifacts list
in summary page, no matter this artifact contains single or multiple
files.

14 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 21 Jul 2023 00:26:46 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

14 months agoRemove redundant "RouteMethods" method (#26024)
wxiaoguang [Thu, 20 Jul 2023 22:43:49 +0000 (06:43 +0800)]
Remove redundant "RouteMethods" method (#26024)

The `RouteMethods` is mainly an alias for `Methods` with different
argument order.

Remove it to keep the "route.go" code clear

14 months agoAdding remaining enum for migration repo model type. (#26021)
puni9869 [Thu, 20 Jul 2023 17:28:38 +0000 (22:58 +0530)]
Adding remaining enum for migration repo model type. (#26021)

14 months agoRPM Registry: Show zypper commands for SUSE based distros as well (#25981)
Dominik Heidler [Thu, 20 Jul 2023 15:37:31 +0000 (17:37 +0200)]
RPM Registry: Show zypper commands for SUSE based distros as well (#25981)

After RPM is supported with https://github.com/go-gitea/gitea/pull/23380
let's show the user
how to add the repo and install the RPM via all common package managers.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoFix the route for pull-request's authors (#26016)
wxiaoguang [Thu, 20 Jul 2023 12:41:28 +0000 (20:41 +0800)]
Fix the route for pull-request's authors (#26016)

Close #25906

![image](https://github.com/go-gitea/gitea/assets/2114189/e689f3e1-9a90-46c0-89f4-2d61394d34d3)

Succeeded logs:

```
[I] router: completed GET /root/test/issues/posters?&q=%20&_=1689853025011 for [::1]:59271, 200 OK in 127.7ms @ repo/issue.go:3505(repo.IssuePosters)

[I] router: completed GET /root/test/pulls/posters?&q=%20&_=1689853968204 for [::1]:59269, 200 OK in 94.3ms @ repo/issue.go:3509(repo.PullPosters)
```

14 months agoRemove nfnt/resize and oliamb/cutter (#25999)
harryzcy [Thu, 20 Jul 2023 11:52:42 +0000 (06:52 -0500)]
Remove nfnt/resize and oliamb/cutter (#25999)

The package `github.com/nfnt/resize` is deprecated and archived by the
author. `github.com/oliamb/cutter` is not maintained since 2018. We
could use `golang.org/x/image/draw` instead.

14 months agoCorrectly refer to dev tags as nightly in the docker docs (#26004)
John Olheiser [Thu, 20 Jul 2023 09:26:02 +0000 (04:26 -0500)]
Correctly refer to dev tags as nightly in the docker docs (#26004)

As title, `dev` tags are no longer used since we switched to `nightly`

Signed-off-by: jolheiser <john.olheiser@gmail.com>
14 months agoFix env config parsing for "GITEA____APP_NAME" (#26001)
wxiaoguang [Thu, 20 Jul 2023 09:16:29 +0000 (17:16 +0800)]
Fix env config parsing for "GITEA____APP_NAME" (#26001)

Regression of #24832

Fix the bug and add a test for it

Co-authored-by: Giteabot <teabot@gitea.io>
14 months agoAdd file status for API "Get a single commit from a repository" (#16205) (#25831)
jeremiepozzigithub [Thu, 20 Jul 2023 08:35:47 +0000 (10:35 +0200)]
Add file status for API "Get a single commit from a repository" (#16205) (#25831)

#16205 To obtain a closer behavior to the api from github, the status
(added, modified, removed) of a file should be available in addition to
the filename.
See github doc :

https://docs.github.com/fr/rest/commits/commits?apiVersion=2022-11-28#get-a-commit

14 months agoAdd a link to OpenID Issuer URL in WebFinger response (#26000)
Noah Snelson [Thu, 20 Jul 2023 08:02:45 +0000 (01:02 -0700)]
Add a link to OpenID Issuer URL in WebFinger response (#26000)

This change adds an entry to the `links` field of the
`/.well-known/webfinger` response. The new entry points to the `appURL`
as an OpenID issuer. This is consistent with the output of
`/.well-known/openid-configuration`, which also uses the value of
`appURL`.

This change is required for Tailscale SSO to work, as it uses the OpenID
Issuer URL when querying the Tailscale user email during signup/login
([docs](https://tailscale.com/kb/1240/sso-custom-oidc/#webfinger-setup)).

14 months agoFix bug when pushing to a pull request which enabled dismiss approval automatically...
Lunny Xiao [Thu, 20 Jul 2023 07:18:52 +0000 (15:18 +0800)]
Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882)

Fix #25858

The option `dissmiss stale approvals` was listed on protected branch but
never implemented. This PR fixes that.

<img width="1006" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/60bfa968-4db7-4c24-b8be-2e5978f91bb9">

<img width="1021" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/8dabc14d-2dfe-40c2-94ed-24fcbf6e0e8f">

14 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 20 Jul 2023 00:27:21 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoFix commit status color on dashboard repolist (#25993)
silverwind [Wed, 19 Jul 2023 23:04:41 +0000 (01:04 +0200)]
Fix commit status color on dashboard repolist (#25993)

Followup to https://github.com/go-gitea/gitea/pull/25935 which has
missed to change the icon on the repolist because the logic is not
shared with templates.

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoImprove profile readme rendering (#25988)
Earl Warren [Wed, 19 Jul 2023 22:22:32 +0000 (00:22 +0200)]
Improve profile readme rendering (#25988)

- Tell the renderer to use the `document` mode, so it's consistent with
other renderers.
- Use the same padding as `.file-view.markup`, so it's consistent with
other containers that contain markup rendering.
- Resolves https://codeberg.org/forgejo/forgejo/issues/833

Co-authored-by: Gusted <postmaster@gusted.xyz>
15 months agoavoid hard-coding height in language dropdown menu (#25986)
Earl Warren [Wed, 19 Jul 2023 21:30:57 +0000 (23:30 +0200)]
avoid hard-coding height in language dropdown menu (#25986)

This commit removes the hard-coded height of 500px, using that as a
max-height instead. The height of items in the dropdown menu, assuming a
default font size of 16px, is 36px, so the old CSS would cause overly
large dropdown menus in instances where less than 14 languages are
offered.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1000

Co-authored-by: rome-user <rome-user@noreply.codeberg.org>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoparseScope with owner/repo always sets owner to zero (#25987)
Earl Warren [Wed, 19 Jul 2023 13:21:51 +0000 (15:21 +0200)]
parseScope with owner/repo always sets owner to zero (#25987)

Refs: https://codeberg.org/forgejo/forgejo/pulls/1001

15 months agoBump github.com/golang-jwt/jwt to v5 (#25975)
harryzcy [Wed, 19 Jul 2023 09:57:10 +0000 (04:57 -0500)]
Bump github.com/golang-jwt/jwt to v5 (#25975)

Bumping `github.com/golang-jwt/jwt` from v4 to v5.

`github.com/golang-jwt/jwt` v5 is bringing some breaking changes:

- standard `Valid()` method on claims is removed. It's replaced by
`ClaimsValidator` interface implementing `Validator()` method instead,
which is called after standard validation. Gitea doesn't seem to be
using this logic.
- `jwt.Token` has a field `Valid`, so it's checked in `ParseToken`
function in `services/auth/source/oauth2/token.go`

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoUpdate path related documents (#25417)
wxiaoguang [Wed, 19 Jul 2023 09:22:57 +0000 (17:22 +0800)]
Update path related documents (#25417)

Update WorkPath/WORK_PATH related documents, remove out-dated
information.

Remove "StaticRootPath" on the admin config display page, because few
end user really need it, it only causes misconfiguration.

![image](https://github.com/go-gitea/gitea/assets/2114189/8095afa4-da76-436b-9e89-2a92c229c01d)

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoUpdate djlint, enable H026 and T027 (#25980)
silverwind [Wed, 19 Jul 2023 08:35:25 +0000 (10:35 +0200)]
Update djlint, enable H026 and T027 (#25980)

New rules enabled as the bugs I reported were fixed:

- H026 | Empty id and class tags can be removed.
- T027 | Unclosed string found in template syntax.

Refs:

https://github.com/Riverside-Healthcare/djLint/issues/711
https://github.com/Riverside-Healthcare/djLint/issues/712

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Jul 2023 00:46:27 +0000 (00:46 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoShow the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947)
Jason Song [Tue, 18 Jul 2023 22:14:30 +0000 (06:14 +0800)]
Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (#25947)

Since OAuth2 will callback the root URL, if the user starts signing in
from a wrong host, Gitea will return 500 because it cannot find the
session.

<details>
<summary>How to reproduce</summary>

<img width="901" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2c2e255c-e13e-4a11-9be7-b226bee54920">

<img width="1014" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/b31cfcf6-a320-483d-9ce5-ba8562f065e1">

</details>

So show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is
enabled.

<img width="1015" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/99e80b17-c790-49a3-bbf2-2bd9396a7daa">

15 months agoRefactor "Content" for file uploading (#25851)
wxiaoguang [Tue, 18 Jul 2023 18:14:47 +0000 (02:14 +0800)]
Refactor "Content" for file uploading (#25851)

Before: the concept "Content string" is used everywhere. It has some
problems:

1. Sometimes it means "base64 encoded content", sometimes it means "raw
binary content"
2. It doesn't work with large files, eg: uploading a 1G LFS file would
make Gitea process OOM

This PR does the refactoring: use "ContentReader" / "ContentBase64"
instead of "Content"

This PR is not breaking because the key in API JSON is still "content":
`` ContentBase64 string `json:"content"` ``

15 months agoFix SSPI auth panic (#25955)
wxiaoguang [Tue, 18 Jul 2023 17:32:49 +0000 (01:32 +0800)]
Fix SSPI auth panic (#25955)

Try to fix #25952

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoMake pending commit status yellow again (#25935)
silverwind [Tue, 18 Jul 2023 16:59:02 +0000 (18:59 +0200)]
Make pending commit status yellow again (#25935)

With the introduction of Actions, the pending commit icon has changed
from yellow to grey for Drone integrations which never set the "running"
status, so it stays in "pending" until completion.

I find it better to have this icon colored like on 1.19. Now both the
"pending" and "running" icons look the same, but I guess we could add an
animation to the "running" state similar to GitHub has to it later.

Before:
<img width="339" alt="Screenshot 2023-07-17 at 19 14 19"
src="https://github.com/go-gitea/gitea/assets/115237/2f4886e4-74fd-42ea-b59e-9af8f141bf1f">

After:
<img width="335" alt="Screenshot 2023-07-17 at 19 14 30"
src="https://github.com/go-gitea/gitea/assets/115237/53189642-e72d-47f6-9cbe-f14eda28f730">

Also, it matches GH's icon:

<img width="466" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/5804ff90-d223-4a3c-8093-7a9abbaacf87">

---------

Co-authored-by: delvh <dev.lh@web.de>
15 months agoMove public asset files to the proper directory (#25907)
wxiaoguang [Tue, 18 Jul 2023 16:06:43 +0000 (00:06 +0800)]
Move public asset files to the proper directory (#25907)

Move `public/*` to `public/assets/*`

Some old PRs (like #15219) introduced inconsistent directory system.

For example: why the local directory "public" is accessed by
`http://site/assets`? How to serve the ".well-known" files properly in
the public directory?

For convention rules, the "public" directory is widely used for the
website's root directory. It shouldn't be an exception for Gitea.

So, this PR makes the things consistent:

* `http://site/assets/foo` means `{CustomPath}/public/assets/foo`.
* `{CustomPath}/public/.well-known` and `{CustomPath}/public/robots.txt`
can be used in the future.

This PR is also a prerequisite for a clear solution for:
* #21942
* #25892
* discourse.gitea.io: [.well-known path serving custom files behind
proxy?](https://discourse.gitea.io/t/well-known-path-serving-custom-files-behind-proxy/5445/1)

This PR is breaking for users who have custom "public" files (CSS/JS).
After getting approvals, I will update the documents.

----

## ⚠️ BREAKING ⚠️

If you have files in your "custom/public/" folder, please move them to
"custom/public/assets/".

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoDisallow dangerous url schemes (#25960)
KN4CK3R [Tue, 18 Jul 2023 15:18:37 +0000 (17:18 +0200)]
Disallow dangerous url schemes (#25960)

Regression: https://github.com/go-gitea/gitea/pull/24805
Closes: #25945
- Disallow `javascript`, `vbscript` and `data` (data uri images still
work) url schemes even if all other schemes are allowed
- Fixed older `cbthunderlink` tests

---------

Co-authored-by: delvh <dev.lh@web.de>
15 months agoAvoid creating directories when loading config (#25944)
wxiaoguang [Tue, 18 Jul 2023 12:32:36 +0000 (20:32 +0800)]
Avoid creating directories when loading config (#25944)

The "creating dir/file during load config" is a longstanding and complex
problem.

This PR only does a quick patch, it still needs more refactorings in the
future.

Fix #25938

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 18 Jul 2023 00:43:46 +0000 (00:43 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoImport `sortablejs` only once (#25936)
silverwind [Mon, 17 Jul 2023 18:06:37 +0000 (20:06 +0200)]
Import `sortablejs` only once (#25936)

Previously, `sortablejs` was imported twice, once synchronously and once
asynchronously, leading to webpack creating duplicate output code (once
in the index bundle, and once in a separate chunk). Fix this by always
asynchronously importing it. This was one of the build warnings observed
when trying to build with vite.

15 months agoMake environment-to-ini work with INSTALL_LOCK=true (#25926)
wxiaoguang [Mon, 17 Jul 2023 17:56:06 +0000 (01:56 +0800)]
Make environment-to-ini work with INSTALL_LOCK=true (#25926)

Regression of #25648, fix #25924

Test:

```bash
rm -f /tmp/example.ini /tmp/out.ini && \
echo "[security]" > /tmp/example.ini && \
echo "INSTALL_LOCK = true" >> /tmp/example.ini && \
GITEA__foo__bar=1 go run contrib/environment-to-ini/environment-to-ini.go --config=/tmp/example.ini --out=/tmp/out.ini && \
echo "==== example:" && \
cat /tmp/example.ini && \
echo "==== out:" && \
cat /tmp/out.ini
```

Output:

```
2023/07/17 17:40:51 ...nvironment-to-ini.go:99:runEnvironmentToIni() [I] Settings saved to: "/tmp/out.ini"
==== example:
[security]
INSTALL_LOCK = true
==== out:
[security]
INSTALL_LOCK = true

[foo]
bar = 1

```

15 months agoIgnore `runs-on` with expressions when warning no matched runners (#25917)
Jason Song [Mon, 17 Jul 2023 16:19:53 +0000 (00:19 +0800)]
Ignore `runs-on` with expressions when warning no matched runners (#25917)

Fix #25905

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoSkip unuseful error message in dev mode when watching local filesystem (#25919)
wxiaoguang [Mon, 17 Jul 2023 09:47:55 +0000 (17:47 +0800)]
Skip unuseful error message in dev mode when watching local filesystem (#25919)

Before, in dev mode, there might be some error logs like:

```
2023/07/17 13:54:51 ...s/assetfs/layered.go:221:WatchLocalChanges() [E] Unable to watch directory .: lstat /data/work/gitea/custom/templates: no such file or directory

```

Because there is no "custom/templates" directory.

After: ignore such error, no such error message anymore.

15 months agoAdd shutting down notice (#25920)
KN4CK3R [Mon, 17 Jul 2023 08:58:47 +0000 (10:58 +0200)]
Add shutting down notice (#25920)

Got the same problem as #25915 when updating an instance. The
`log.Fatal` should have been marked as breaking in #23911.

This PR adds a notice that the system is shutting down because of the
deprecated setting.

15 months agoDowngrading Snap to build with node/18 instead of node/20
techknowlogick [Mon, 17 Jul 2023 02:28:52 +0000 (22:28 -0400)]
Downgrading Snap to build with node/18 instead of node/20

15 months agoFix margin on the new/edit project page. (#25885)
puni9869 [Sun, 16 Jul 2023 14:53:54 +0000 (20:23 +0530)]
Fix margin on the new/edit project page. (#25885)

New/Edit Project page consistent layout. Fix margin on the new/edit
page.

Before:
<img width="1381" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/303e128c-0bd0-4289-a395-ff077e33b1c8">
<img width="1392" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/d11f7a42-ddf4-4c0a-a1b1-b8cefca9dfa1">

After
<img width="1390" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/8ae1a979-9050-4d68-8f5d-9dfaa620c0e8">
<img width="1391" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/24a62711-dc0a-4425-bf84-7c1896b9a005">

Co-authored-by: silverwind <me@silverwind.io>
15 months agoAdd 1.20.0 changelog (#25901)
delvh [Sun, 16 Jul 2023 12:28:21 +0000 (14:28 +0200)]
Add 1.20.0 changelog (#25901)

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
15 months agoFix incorrect milestone count when provide a keyword (#25880)
yp05327 [Sun, 16 Jul 2023 03:43:51 +0000 (12:43 +0900)]
Fix incorrect milestone count when provide a keyword (#25880)

You can confirm this issue in:
https://try.gitea.io/yp05327/testrepo/milestones?state=open&q=a
There's no milestone, but the count is 1.

![image](https://github.com/go-gitea/gitea/assets/18380374/25e58cee-aeeb-43c1-8ec8-6e2ec6bf1284)

15 months agoAvoid opening/closing PRs which are already merged (#25883)
yp05327 [Sat, 15 Jul 2023 22:10:49 +0000 (07:10 +0900)]
Avoid opening/closing PRs which are already merged (#25883)

We can select PRs to open/close them by one click, but we forgot to
check whether it is merged.
You can get an opening merged PR:

![image](https://github.com/go-gitea/gitea/assets/18380374/22c2e747-4bb9-4742-a9aa-ef39d5308bc5)

You can confirm this in:
https://try.gitea.io/yp05327/testrepo/pulls/5

15 months agoMake `add line comment` buttons focusable (#25894)
sebastian-sauer [Sat, 15 Jul 2023 09:45:34 +0000 (11:45 +0200)]
Make `add line comment` buttons focusable (#25894)

Use a real button and add an aria-label.
Additionally, show the button whenever it is focused.
See https://codeberg.org/forgejo/forgejo/issues/998 for explanation.

Our handling of this button is now equal to that of GitHub.
Nothing has changed visually.

15 months agoFix "Flash" message usage (#25895)
wxiaoguang [Sat, 15 Jul 2023 08:52:03 +0000 (16:52 +0800)]
Fix "Flash" message usage (#25895)

Resolve https://github.com/go-gitea/gitea/pull/25820/files#r1264309059

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 15 Jul 2023 00:29:55 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoAdd support for different Maven POM encoding (#25873)
KN4CK3R [Fri, 14 Jul 2023 09:39:15 +0000 (11:39 +0200)]
Add support for different Maven POM encoding (#25873)

Fixes #25853

- Maven POM files aren't always UTF-8 encoded.
- Reject the upload of unparsable POM files

15 months agoFix incorrect release count (#25879)
yp05327 [Fri, 14 Jul 2023 08:47:17 +0000 (17:47 +0900)]
Fix incorrect release count (#25879)

Release count is not correct:
https://try.gitea.io/yp05327/testrepo/tags

![image](https://github.com/go-gitea/gitea/assets/18380374/07f97c62-d450-4ccb-b3f2-3e0af9d9fc52)

https://try.gitea.io/yp05327/testrepo/releases

![image](https://github.com/go-gitea/gitea/assets/18380374/6f1d55a4-bb68-445d-84b9-90552a40f403)

https://try.gitea.io/yp05327/testrepo/releases/tag/testtag

![image](https://github.com/go-gitea/gitea/assets/18380374/09ab5d51-52b6-4621-a571-3100198eb260)

We already have correct release count, no need to calculate it again.

https://github.com/go-gitea/gitea/blob/c5e187c389b35b9e080a3187b93a775a3c81e585/modules/context/repo.go#L547

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoAdd Github related extensions in devcontainer (#25800)
yp05327 [Fri, 14 Jul 2023 07:58:02 +0000 (16:58 +0900)]
Add Github related extensions in devcontainer (#25800)

15 months agoAdd error info if no user can fork the repo (#25820)
yp05327 [Fri, 14 Jul 2023 07:56:20 +0000 (16:56 +0900)]
Add error info if no user can fork the repo (#25820)

Before: (Owner list is empty)

![image](https://github.com/go-gitea/gitea/assets/18380374/dbe87bfe-14ed-4997-8cb2-5c1308232a70)

After: (Disable the button and show the error info)

![image](https://github.com/go-gitea/gitea/assets/18380374/a7e4c315-67ab-408b-88f2-c554076ce87a)

15 months agoFix wrong usage of PathEscapeSegments in branch list page (#25864)
yp05327 [Fri, 14 Jul 2023 06:08:38 +0000 (15:08 +0900)]
Fix wrong usage of PathEscapeSegments in branch list page (#25864)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/21ce7bfa-36f7-4125-9a66-d644400916a8)

emmm, don't know how to write a good title to describe this issue.
If you have a good idea, I can change the title.

The fix code is copied from L122. Not sure it is right or not.

@lunny
Maybe `DefaultBranchBranch` is also typo?
Two `Branch` in variable name .

15 months agofix incorrect repo url when changed the case of ownername (#25733)
hiifong [Fri, 14 Jul 2023 05:42:10 +0000 (13:42 +0800)]
fix incorrect repo url when changed the case of ownername (#25733)

When only the case of the username changes and the new username is
consistent with the lowercase username of the old user name, update the
owner name of the repo, and keep the original logic consistent with
other conditions.

example: your username is `gitea`, lowercase username is `gitea`,repo
url is `.../gitea/{repo}`, you changed username to `Gitea` or `GiTea` or
other, but the lowercase username is still `gitea`, the repo url is
still `.../gitea/{repo}`.

this pr fixed it,keep username and repo url consistent.

Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/84177296-f0ff-4176-84f1-1f9ec3f5b86f)

![image](https://github.com/go-gitea/gitea/assets/89133723/8f8f4a12-ecdd-4dec-af89-85c009b0ccfe)

After:

![image](https://github.com/go-gitea/gitea/assets/89133723/0564edb6-9467-405a-8cd4-d6f70e6f614b)

![image](https://github.com/go-gitea/gitea/assets/89133723/554ecd6e-e5a1-43bc-a46d-99e988c2ff58)

15 months agoUpgrade go dependencies (#25819)
harryzcy [Fri, 14 Jul 2023 03:00:31 +0000 (22:00 -0500)]
Upgrade go dependencies (#25819)

15 months agoDon't stack PR tab menu on small screens (#25789)
sebastian-sauer [Fri, 14 Jul 2023 01:54:20 +0000 (03:54 +0200)]
Don't stack PR tab menu on small screens (#25789)

the stacking takes up screen space - display the tabs as the navigation
bar. github uses the same layout.

Screenshots (left before, right after):

![image](https://github.com/go-gitea/gitea/assets/1135157/d7e2aaec-c67b-403d-8d56-d4c824b04eed)
![image](https://github.com/go-gitea/gitea/assets/1135157/9e150881-c265-4074-afd7-407bb52e1934)

Large screen:

![image](https://github.com/go-gitea/gitea/assets/1135157/d5cbdaa3-2962-4c4f-9595-5938981ff99e)

15 months agoLink to list of vulnerabilities (#25872)
M Hickford [Fri, 14 Jul 2023 01:26:54 +0000 (02:26 +0100)]
Link to list of vulnerabilities (#25872)

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 14 Jul 2023 00:31:01 +0000 (00:31 +0000)]
[skip ci] Updated translations via Crowdin

15 months agomove issue filters to shared template (#25729)
Denys Konovalov [Thu, 13 Jul 2023 20:00:38 +0000 (22:00 +0200)]
move issue filters to shared template (#25729)

Issue filters are being used on repo list page and on milestone issues
page, and the code is mostly duplicated.

This PR does the following changes:
- move issue filters into a shared template
- allow filtering milestone issues by project, so no need to hide this
filter on milestone issues page
- remove some dead code (e. g. issue actions in milestone issues
template)
- fix label filter dropdown width

---------

Co-authored-by: 6543 <6543@obermui.de>
15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 13 Jul 2023 00:29:39 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoRemove `git.FileBlame` (#25841)
Jason Song [Wed, 12 Jul 2023 17:07:29 +0000 (01:07 +0800)]
Remove `git.FileBlame` (#25841)

The `FileBlame` function looks strange, it has `revision` as argument
but doesn't use it.

Since the function never be used, I think we could just remove it.

If anyone thinks it should be kept, please help fix `revision`.

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix empty project displayed in issue sidebar (#25802)
yp05327 [Wed, 12 Jul 2023 14:10:35 +0000 (23:10 +0900)]
Fix empty project displayed in issue sidebar (#25802)

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/1ab476dc-2f9b-4c85-9e87-105fc73af1ee)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/786f984d-5c27-4eff-b3d9-159f68034ce4)

This issue comes from the change in #25468.
`LoadProject` will always return at least one record, so we use
`ProjectID` to check whether an issue is linked to a project in the old
code.
As other `issue.LoadXXX` functions, we need to check the return value
from `xorm.Session.Get`.

In recent unit tests, we only test `issueList.LoadAttributes()` but
don't test `issue.LoadAttributes()`. So I added a new test for
`issue.LoadAttributes()` in this PR.

---------

Co-authored-by: Denys Konovalov <privat@denyskon.de>
15 months agoUpdate blog links (#25843)
HesterG [Wed, 12 Jul 2023 11:35:07 +0000 (19:35 +0800)]
Update blog links (#25843)

As title. Permalinks for lastest version of blog has changed, update the
blog links.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix margin on the `new/edit milestone` page (#25801)
puni9869 [Wed, 12 Jul 2023 10:36:56 +0000 (16:06 +0530)]
Fix margin on the `new/edit milestone` page (#25801)

There is some distortion in desktop and mobile ui for new/edit milestone
page.
Fixing the new/edit milestone page for desktop and mobile ui

Design background
https://uxplanet.org/primary-secondary-action-buttons-c16df9b36150
https://balsamiq.com/learn/articles/button-design-best-practices/

<details>
  <summary>Screen shots</summary>

Before:

![image](https://github.com/go-gitea/gitea/assets/80308335/c8627679-da2d-465f-bc8f-978d7b836919)

![image](https://github.com/go-gitea/gitea/assets/80308335/43b54599-2856-440a-a13c-08bb3cedf35c)

After

![image](https://github.com/go-gitea/gitea/assets/80308335/85ca3d32-4842-41bc-8647-aa4222b9cc06)

![image](https://github.com/go-gitea/gitea/assets/80308335/c00e87c4-e64e-4b18-aa42-d26c3942a21b)

</details>

---------

Co-authored-by: Denys Konovalov <privat@denyskon.de>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoDo not "guess" the file encoding/BOM when using API to upload files (#25828)
wxiaoguang [Wed, 12 Jul 2023 09:58:27 +0000 (17:58 +0800)]
Do not "guess" the file encoding/BOM when using API to upload files (#25828)

Related issue: #18368

It doesn't seem right to "guess" the file encoding/BOM when using API to
upload files.

The API should save the uploaded content as-is.

15 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 12 Jul 2023 00:32:23 +0000 (00:32 +0000)]
[skip ci] Updated translations via Crowdin

15 months agoShow correct SSL Mode on "install page" (#25818)
wxiaoguang [Tue, 11 Jul 2023 22:09:23 +0000 (06:09 +0800)]
Show correct SSL Mode on "install page" (#25818)

15 months agoFix incorrect oldest sort in project list (#25806)
yp05327 [Tue, 11 Jul 2023 18:47:50 +0000 (03:47 +0900)]
Fix incorrect oldest sort in project list (#25806)

sort type `oldest` should be `Asc`.
Added a test for this.

15 months agoFix the error message when the token is incorrect (#25701)
caicandong [Tue, 11 Jul 2023 02:04:28 +0000 (10:04 +0800)]
Fix the error message when the token is incorrect (#25701)

we refactored `userIDFromToken` for the token parsing part into a new
function `parseToken`. `parseToken` returns the string `token` from
request, and a boolean `ok` representing whether the token exists or
not. So we can distinguish between token non-existence and token
inconsistency in the `verfity` function, thus solving the problem of no
proper error message when the token is inconsistent.
close #24439
related #22119

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoExclude default branch from pushed branch hint (#25795)
Lunny Xiao [Mon, 10 Jul 2023 11:18:55 +0000 (19:18 +0800)]
Exclude default branch from pushed branch hint (#25795)

When pushing to default branch, no pushing hint should be prompt.
Fix #25778

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFor API attachments, use API URL (#25639)
Lunny Xiao [Mon, 10 Jul 2023 09:31:19 +0000 (17:31 +0800)]
For API attachments, use API URL (#25639)

Fix #25257

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix WORK_DIR for docker (root) image (#25738)
wxiaoguang [Mon, 10 Jul 2023 08:26:07 +0000 (16:26 +0800)]
Fix WORK_DIR for docker (root) image (#25738)

Fix #25726

#17846 chose an incorrect WORK_DIR path for docker root image.

Gitea's work-path was already used as the base path for various paths
(like AppDataPath), so, the work-path should be mounted to a volume in a
docker image.

Now, for docker root image, it's unavoidable to mix the
WorkPath/CustomPath/AppDataPath in the same directory ("/data/gitea"),
because some of them have already been mixed.

Some directories in the screenshot are for "CustomPath" , while others
are for "AppDataPath", due to the technical debts in old code:

```
CUSTOM_PATH="/data/gitea"
APP_DATA_PATH = /data/gitea
```

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/9f0648ac-f731-4a08-9f26-1af01a1824b1)

</details>

This PR is breaking but this is the only way at the moment to avoid
users losing their data accidently

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoAvoid amending the Rebase and Fast-forward merge if there is no message template...
wxiaoguang [Mon, 10 Jul 2023 08:12:50 +0000 (16:12 +0800)]
Avoid amending the Rebase and Fast-forward merge if there is no message template (#25779)

Related #22669. Close #25177

After the fix:

![image](https://github.com/go-gitea/gitea/assets/2114189/0e900927-ea72-4f8f-bde6-5ed927cb02f4)

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoShow edit title button on commits tab of PR, too (#25791)
sebastian-sauer [Mon, 10 Jul 2023 07:05:59 +0000 (09:05 +0200)]
Show edit title button on commits tab of PR, too (#25791)

All 3 tabs of the PR (Conversation, Commits and Files changed) should
show the edit title button.

Before this commit the edit button was not shown on commits tab

Screenshots:
After:

![image](https://github.com/go-gitea/gitea/assets/1135157/d04c700c-dffc-4bcd-8108-cb64838af0c6)

Before:

![image](https://github.com/go-gitea/gitea/assets/1135157/b6795ad3-c994-461c-98aa-a7331c3e3877)

Just for reference the edit button in files changed tab:

![image](https://github.com/go-gitea/gitea/assets/1135157/5750640d-489f-4a71-8144-543ef42afb42)

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoMake "install page" respect environment config (#25648)
wxiaoguang [Sun, 9 Jul 2023 22:43:37 +0000 (06:43 +0800)]
Make "install page" respect environment config (#25648)

Replace #25580

Fix #19453

The problem was: when users set "GITEA__XXX__YYY" , the "install page"
doesn't respect it.

So, to make the result consistent and avoid surprising end users, now
the "install page" also writes the environment variables to the config
file.

And, to make things clear, there are enough messages on the UI to tell
users what will happen.

There are some necessary/related changes to `environment-to-ini.go`:

* The "--clear" flag is removed and it was incorrectly written there.
The "clear" operation should be done if INSTALL_LOCK=true
* The "--prefix" flag is removed because it's never used, never
documented and it only causes inconsistent behavior.

![image](https://github.com/go-gitea/gitea/assets/2114189/12778ee4-3fb5-4664-a73a-41ebbd77cd5b)

15 months agoEnable H014 and H023 djlint rules (#25786)
silverwind [Sun, 9 Jul 2023 20:33:25 +0000 (22:33 +0200)]
Enable H014 and H023 djlint rules (#25786)

Enable these rules:

- H014 | More than 2 blank lines.
- H023 | Do not use entity references.

There are more potential rules to enable but they are blocked by bugs in
the linter:

- https://github.com/Riverside-Healthcare/djLint/issues/711
- https://github.com/Riverside-Healthcare/djLint/issues/712

15 months agoRestructure issue list template, styles (#25750)
Denys Konovalov [Sun, 9 Jul 2023 19:38:01 +0000 (21:38 +0200)]
Restructure issue list template, styles (#25750)

This PR does various modifications on the issue list shared template:
- restructure layout to achieve better responsiveness
-  fix various style issues
- restructure styles (better result with less code :)
- remove numerous `gt-*` patches and other unneeded classes -> use
existing css classes

<details>
<summary>Before:</summary>

![Bildschirmfoto vom 2023-07-07
14-35-00](https://github.com/go-gitea/gitea/assets/47871822/5301fc80-d58b-41c2-8090-5867e2e8459c)
![Bildschirmfoto vom 2023-07-07
14-35-19](https://github.com/go-gitea/gitea/assets/47871822/d36ab691-7dc4-44bb-a8f6-a4105a2a6777)
![Bildschirmfoto vom 2023-07-07
14-35-43](https://github.com/go-gitea/gitea/assets/47871822/0762c852-eb40-4b00-8757-c5dbfd2ae569)
</details>

<details>
<summary>After:</summary>

![Bildschirmfoto vom 2023-07-07
14-32-04](https://github.com/go-gitea/gitea/assets/47871822/0ac42d36-f98f-451a-b556-70c913d19df8)
![Bildschirmfoto vom 2023-07-07
14-31-32](https://github.com/go-gitea/gitea/assets/47871822/520fac9c-33e3-4290-bfe1-6e941f1100f8)
![Bildschirmfoto vom 2023-07-07
14-31-14](https://github.com/go-gitea/gitea/assets/47871822/05ad46bb-3c67-403d-85b8-d12d64f99c59)

</details>

---------

Co-authored-by: silverwind <me@silverwind.io>
15 months agoFix notification list bugs (#25781)
wxiaoguang [Sun, 9 Jul 2023 18:42:31 +0000 (02:42 +0800)]
Fix notification list bugs (#25781)

Fix #25627

1. `ctx.Data["Link"]` should use relative URL but not AppURL
2. The `data-params` is incorrect because it doesn't contain "page". JS
can simply use "window.location.search" to construct the AJAX URL
3. The `data-xxx` and `id` in notification_subscriptions.tmpl were
copied&pasted, they don't have affect.

15 months agoRevert package access change from #23879 (#25707)
KN4CK3R [Sun, 9 Jul 2023 13:00:07 +0000 (15:00 +0200)]
Revert package access change from #23879 (#25707)

Fixes (?) #25538
Fixes https://codeberg.org/forgejo/forgejo/issues/972

Regression #23879

#23879 introduced a change which prevents read access to packages if a
user is not a member of an organization.

That PR also contained a change which disallows package access if the
team unit is configured with "no access" for packages. I don't think
this change makes sense (at the moment). It may be relevant for private
orgs. But for public or limited orgs that's useless because an
unauthorized user would have more access rights than the team member.
This PR restores the old behaviour "If a user has read access for an
owner, they can read packages".

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoMake route middleware/handler mockable (#25766)
wxiaoguang [Sun, 9 Jul 2023 12:25:53 +0000 (20:25 +0800)]
Make route middleware/handler mockable (#25766)

To mock a handler:

```go
web.RouteMock(web.MockAfterMiddlewares, func(ctx *context.Context) {
// ...
})
defer web.RouteMockReset()
```

It helps:

* Test the middleware's behavior (assert the ctx.Data, etc)
* Mock the middleware's behavior (prepare some context data for handler)
* Mock the handler's response for some test cases, especially for some
integration tests and e2e tests.

15 months agoUpdate tool dependencies, lock govulncheck and actionlint (#25655)
silverwind [Sun, 9 Jul 2023 11:58:06 +0000 (13:58 +0200)]
Update tool dependencies, lock govulncheck and actionlint (#25655)

- Update all tool dependencies
- Lock `govulncheck` and `actionlint` to their latest tags

---------

Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoTest if container blob is accessible before mounting (#22759)
KN4CK3R [Sun, 9 Jul 2023 11:24:43 +0000 (13:24 +0200)]
Test if container blob is accessible before mounting (#22759)

related #16865

This PR adds an accessibility check before mounting container blobs.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
15 months agoAlways pass 6-digit hex color to monaco (#25780)
silverwind [Sun, 9 Jul 2023 10:17:22 +0000 (12:17 +0200)]
Always pass 6-digit hex color to monaco (#25780)

Monaco can not deal with color formats other than 6-digit hex, so we
convert the colors for it via new
[`tinycolor2`](https://github.com/bgrins/TinyColor) dependency (5kB
minzipped).

Also, with the addition of the module, we can replace the existing
`hexToRGBColor` usage, I verified it is compatible with the current
tests before removing the function.

Fixes: https://github.com/go-gitea/gitea/issues/25770
15 months agoFix the wrong default branch name displayed by checkout (#25777)
hiifong [Sun, 9 Jul 2023 09:09:06 +0000 (17:09 +0800)]
Fix the wrong default branch name displayed by checkout (#25777)

Related: #22743

Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/3cec886c-589c-41a8-86af-a08b62b8adef)

After:

![image](https://github.com/go-gitea/gitea/assets/89133723/74ee8adf-fca7-42a0-a67a-ecaa0ba91b4a)

15 months agoTweak repo topics bar (#25769)
silverwind [Sat, 8 Jul 2023 18:12:30 +0000 (20:12 +0200)]
Tweak repo topics bar (#25769)

Minor tweaks to repo topics:

- Use gap instead of margin to align "Manage Topics" when no topics
present
- Add margin to description instead

Before:

<img width="1232" alt="Screenshot 2023-07-08 at 13 08 15"
src="https://github.com/go-gitea/gitea/assets/115237/a5d3586c-6cbf-4b74-8137-11d91f2cbb45">
<img width="1233" alt="Screenshot 2023-07-08 at 13 08 05"
src="https://github.com/go-gitea/gitea/assets/115237/59b18d93-e4cb-4f2b-9bc2-d6aa63f93827">

After:

<img width="1232" alt="Screenshot 2023-07-08 at 13 08 42"
src="https://github.com/go-gitea/gitea/assets/115237/470d42ad-3f7e-40f9-b0a1-203b4af77eb9">
<img width="1231" alt="Screenshot 2023-07-08 at 13 08 32"
src="https://github.com/go-gitea/gitea/assets/115237/42d18048-748c-4a3f-ab89-3403866cef34">

---------

15 months agodocs: rootless docker ssh's default port is 2222 (#25771)
leavesster [Sat, 8 Jul 2023 15:38:35 +0000 (23:38 +0800)]
docs: rootless docker ssh's default port is 2222 (#25771)

15 months agoRepository Archived text title center align (#25767)
puni9869 [Sat, 8 Jul 2023 10:57:17 +0000 (16:27 +0530)]
Repository Archived text title center align (#25767)

Archive text title center align

<details>
  <summary>Screen shots</summary>

 Before

![image](https://github.com/go-gitea/gitea/assets/80308335/90182367-4d06-4fc8-b7aa-21c21225d2bd)

After

![image](https://github.com/go-gitea/gitea/assets/80308335/3dcc0d0d-75f4-415d-afbf-03921075b4db)

![image](https://github.com/go-gitea/gitea/assets/80308335/317d74f8-0ae9-4dc7-9508-1833d2d4f327)

BTW On github

![image](https://github.com/go-gitea/gitea/assets/80308335/1801fd2d-1803-4ee6-8856-ef2f623df2b4)

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoUpdate JS dependencies, misc tweaks (#25768)
silverwind [Sat, 8 Jul 2023 10:26:35 +0000 (12:26 +0200)]
Update JS dependencies, misc tweaks (#25768)

- Update all JS dependencies minus stylelint because of
https://github.com/elirasza/stylelint-stylistic/issues/12
- Misc tweaks to eslint and stylelint configs
- Tested Monaco and Mermaid

15 months agoClarify "text-align" CSS helpers, fix clone button padding (#25763)
wxiaoguang [Sat, 8 Jul 2023 09:53:56 +0000 (17:53 +0800)]
Clarify "text-align" CSS helpers, fix clone button padding (#25763)

Changes:

* Rename gt-tl/gt-tc/gt-tr to gt-text-left/gt-text-center/gt-text-right
* The gt-ab and gt-br-0 are removed because they are not needed anymore
* Fix the clone dropdown button padding by ":not(.icon)"

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/eb030633-622c-4ca7-8e88-ce010d9f51a6)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/64c09403-bf21-439c-88f1-780b34ccab6b)

</details>

Fixes #25758

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoSwitch to `vite-string-plugin` (#25762)
silverwind [Sat, 8 Jul 2023 04:56:12 +0000 (06:56 +0200)]
Switch to `vite-string-plugin` (#25762)

Switch to
[`vite-string-plugin`](https://github.com/silverwind/vite-string-plugin)
to load SVGs as string during tests. The plugin will also be useful once
we switch to vite.

15 months agoNewly pushed branches hints on repository home page (#25715)
Lunny Xiao [Sat, 8 Jul 2023 03:19:00 +0000 (11:19 +0800)]
Newly pushed branches hints on repository home page (#25715)

This PR will display a pull request creation hint on the repository home
page when there are newly created branches with no pull request. Only
the recent 6 hours and 2 updated branches will be displayed.

Inspired by #14003
Replace #14003
Resolves #311
Resolves #13196
Resolves #23743

co-authored by @kolaente

15 months agoTranslate untranslated string in issues list (#25759)
Maxim Slipenko [Fri, 7 Jul 2023 22:36:39 +0000 (01:36 +0300)]
Translate untranslated string in issues list (#25759)

15 months agoFix `ref` for workflows triggered by `pull_request_target` (#25743)
Zettat123 [Fri, 7 Jul 2023 19:22:03 +0000 (03:22 +0800)]
Fix `ref` for workflows triggered by `pull_request_target` (#25743)

Follow #25229

At present, when the trigger event is `pull_request_target`, the `ref`
and `sha` of `ActionRun` are set according to the base branch of the
pull request. This makes it impossible for us to find the head branch of
the `ActionRun` directly. In this PR, the `ref` and `sha` will always be
set to the head branch and they will be changed to the base branch when
generating the task context.

15 months agoMinify CSS with Lightning CSS (#25754)
silverwind [Fri, 7 Jul 2023 18:28:48 +0000 (20:28 +0200)]
Minify CSS with Lightning CSS (#25754)

Replace esbuild's rudimentary CSS minifier with [Lightning
CSS](https://github.com/parcel-bundler/lightningcss), which results in
around 4% smaller CSS bundle size, index.css goes from 608K to 584K.

The module is quite new but has active use in the Parcel bundler, and as
of yesterday is also under experimental support in Vite, so I trust it
that bugs will be sorted out quickly.

Before: `assets by path css/*.css 959 KiB`
After: `assets by path css/*.css 933 KiB`

I did give this a cursory test and everything seems to be in order.

15 months agoReformat some templates (#25756)
wxiaoguang [Fri, 7 Jul 2023 18:06:49 +0000 (02:06 +0800)]
Reformat some templates (#25756)

Only: indent/dedent/newline

15 months agoAdd open/closed field support for issue index (#25708)
techknowlogick [Fri, 7 Jul 2023 17:10:13 +0000 (13:10 -0400)]
Add open/closed field support for issue index (#25708)

A couple of notes:
* Future changes should refactor arguments into a struct
* This filtering only is supported by meilisearch right now
* Issue index number is bumped which will cause a re-index

15 months agoFix activity type match in `matchPullRequestEvent` (#25746)
Zettat123 [Fri, 7 Jul 2023 16:30:07 +0000 (00:30 +0800)]
Fix activity type match in `matchPullRequestEvent` (#25746)

Fix #25736
Caused by #24048

Right now we only check the activity type for `pull_request` event when
`types` is specified or there are no `types` and filter. If a workflow
only specifies filters but no `types` like this:
```
on:
  pull_request:
    branches: [main]
```
the workflow will be triggered even if the activity type is not one of
`[opened, reopened, sync]`. We need to check the activity type in this
case.

Co-authored-by: Giteabot <teabot@gitea.io>