]> source.dussan.org Git - gitea.git/log
gitea.git
15 months agoMake "cancel" buttons have proper type in modal forms (#25618) (#25641)
wxiaoguang [Mon, 3 Jul 2023 09:09:38 +0000 (17:09 +0800)]
Make "cancel" buttons have proper type in modal forms (#25618) (#25641)

Replace #25446, fix #25438

All "cancel" buttons which do not have "type" should not submit the
form, should not be triggered by "Enter".

This is a complete fix for all modal dialogs.

The major change is "modules/aria/modal.js", "devtest" related code is
for demo/test purpose.

15 months agouse css on labels (#25626) (#25636)
Giteabot [Mon, 3 Jul 2023 04:25:16 +0000 (00:25 -0400)]
use css on labels (#25626) (#25636)

Backport #25626 by @derelm

Changes html to use CSS label class similar to
`templates/shared/actions/runner_list.tmpl`

Before:

![grafik](https://github.com/go-gitea/gitea/assets/465155/6729d580-3ea6-4a90-972e-6e5117459da7)

After:

![grafik](https://github.com/go-gitea/gitea/assets/465155/d4fc280c-c40b-4db4-b1ba-877270f875c8)

List view (for reference - unchanged):

![grafik](https://github.com/go-gitea/gitea/assets/465155/5ad2d8d1-2fb5-414d-823b-48a368a74724)

Co-authored-by: derelm <465155+derelm@users.noreply.github.com>
15 months agoUse AfterCommitId to get commit for Viewed functionality (#25529) (#25612)
Giteabot [Fri, 30 Jun 2023 23:56:56 +0000 (19:56 -0400)]
Use AfterCommitId to get commit for Viewed functionality (#25529) (#25612)

Backport #25529 by @sebastian-sauer

the PullHeadCommitID is not always available when the PR is merged.

Not sure if this is the best solution but in my simple tests it looks
like this fixes the problem - happy to get any feedback.

hopefully fixes https://github.com/go-gitea/gitea/issues/24813

Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
15 months agoRestrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581) (#25604)
Giteabot [Fri, 30 Jun 2023 07:53:00 +0000 (03:53 -0400)]
Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581) (#25604)

Backport #25581 by @wolfogre

Resolve #24789

## :warning: BREAKING :warning:

Before this, `DEFAULT_ACTIONS_URL` cound be set to any custom URLs like
`https://gitea.com` or `http://your-git-server,https://gitea.com`, and
the default value was `https://gitea.com`.

But now, `DEFAULT_ACTIONS_URL` supports only
`github`(`https://github.com`) or `self`(the root url of current Gitea
instance), and the default value is `github`.

If it has configured with a URL, an error log will be displayed and it
will fallback to `github`.

Actually, what we really want to do is always make it
`https://github.com`, however, this may not be acceptable for some
instances of internal use, so there's extra support for `self`, but no
more, even `https://gitea.com`.

Please note that `uses: https://xxx/yyy/zzz` always works and it does
exactly what it is supposed to do.

Although it's breaking, I belive it should be backported to `v1.20` due
to some security issues.

Follow-up on the runner side:

- https://gitea.com/gitea/act_runner/pulls/262
- https://gitea.com/gitea/act/pulls/70

Co-authored-by: Jason Song <i@wolfogre.com>
15 months agoread-only checkboxes don't appear and don't entirely act the way one might expect...
Giteabot [Thu, 29 Jun 2023 22:53:43 +0000 (18:53 -0400)]
read-only checkboxes don't appear and don't entirely act the way one might expect (#25573) (#25602)

Backport #25573 by @saegl5

This pull request fades read-only checkboxes and checkmark, and it makes
the checkboxes act more read-only/disabled by not changing the
border-color when clicked.

Examples using light mode:

| Before | After |
| - | - |
| ![Kapture 2023-06-28 at 00 20
45](https://github.com/go-gitea/gitea/assets/63764270/0899fd5c-18a9-4290-9ba9-d3cf71033cf8)
| ![Kapture 2023-06-28 at 00 23
12](https://github.com/go-gitea/gitea/assets/63764270/0db9be14-e16c-42ed-8fb1-999928fd1d25)
|
| ![Kapture 2023-06-28 at 00 25
22](https://github.com/go-gitea/gitea/assets/63764270/65c6c380-b928-4e6c-b403-3655d3565896)
| ![Kapture 2023-06-28 at 00 27
28](https://github.com/go-gitea/gitea/assets/63764270/d8c2a019-e07c-43a1-a7fa-93c0d4e01900)
|
| | read-only checkboxes and checkmark are faded<br>and the checkboxes
act more read-only/disabled |

Fixes/Closes/Resolves #25076

Co-authored-by: Ed Silkworth <ed.silkworth@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoRedirect to package after version deletion (#25594) (#25599)
KN4CK3R [Thu, 29 Jun 2023 22:14:57 +0000 (00:14 +0200)]
Redirect to package after version deletion (#25594) (#25599)

Related #25559

Current behaviour:
1. Deletion of a package version
2. Redirect to the owners package list

New behaviour:
1. Deletion of a package version
2.1. If there are more versions available, redirect to the package again
2.2. If there are no versions available, redirect to the owners package
list

15 months agoAdd documentation about supported workflow trigger events (#25582) (#25589)
Giteabot [Thu, 29 Jun 2023 12:51:46 +0000 (08:51 -0400)]
Add documentation about supported workflow trigger events (#25582) (#25589)

Backport #25582 by @Zettat123

Right now Gitea doesn't support all [Events that trigger
workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).
This PR lists the supported events to help users write workflow files.

Co-authored-by: Zettat123 <zettat123@gmail.com>
15 months agoReduce table padding globally (#25568) (#25577)
Giteabot [Thu, 29 Jun 2023 09:24:02 +0000 (05:24 -0400)]
Reduce table padding globally (#25568) (#25577)

Backport #25568 by @silverwind

Fomantic's tables have too much padding. Reduce it so we have more
information density in them. Especially the admin tables need this
because they are bursting already because of column count.

## Admin repolist before and after

<img width="909" alt="Screenshot 2023-06-28 at 20 27 55"
src="https://github.com/go-gitea/gitea/assets/115237/954c925c-8db5-47ce-ae51-a2168b857014">
<img width="897" alt="Screenshot 2023-06-28 at 20 36 03"
src="https://github.com/go-gitea/gitea/assets/115237/0bddc09a-9117-48b3-a17e-3d34c58d8d3d">

## Other tables

<img width="1230" alt="Screenshot 2023-06-28 at 20 36 22"
src="https://github.com/go-gitea/gitea/assets/115237/38f555b6-a7ce-416a-9f1f-706eaf18863b">
<img width="1236" alt="Screenshot 2023-06-28 at 20 26 37"
src="https://github.com/go-gitea/gitea/assets/115237/82b2878e-358c-4dc2-a6b4-c66e43cd2dfb">
<img width="1231" alt="Screenshot 2023-06-28 at 20 59 30"
src="https://github.com/go-gitea/gitea/assets/115237/c6a92e55-a3a3-4c80-9a0d-50aebb49886c">

Files table is unaffected because it has custom padding already.

Co-authored-by: silverwind <me@silverwind.io>
15 months agoFix milestones deletion (#25583) (#25584)
Giteabot [Thu, 29 Jun 2023 08:52:05 +0000 (04:52 -0400)]
Fix milestones deletion (#25583) (#25584)

Backport #25583 by @HesterG

Close #25557
Fix regression from #25315

`data-id` is still needed for deleting milestone.

Co-authored-by: HesterG <hestergong@gmail.com>
15 months agoDo not prepare oauth2 config if it is not enabled, do not write config in some sub...
wxiaoguang [Thu, 29 Jun 2023 04:30:40 +0000 (12:30 +0800)]
Do not prepare oauth2 config if it is not enabled, do not write config in some sub-commands (#25567) (#25576)

Backport #25567

Ref:

* https://github.com/go-gitea/gitea/issues/25377#issuecomment-1609757289

And some sub-commands like "generate" / "docs", they do not need to use
the ini config

15 months agoFix content holes in Actions task logs file (#25560) (#25566)
Giteabot [Wed, 28 Jun 2023 23:39:23 +0000 (19:39 -0400)]
Fix content holes in Actions task logs file (#25560) (#25566)

Backport #25560 by @wolfogre

Fix #25451.

Bugfixes:
- When stopping the zombie or endless tasks, set `LogInStorage` to true
after transferring the file to storage. It was missing, it could write
to a nonexistent file in DBFS because `LogInStorage` was false.
- Always update `ActionTask.Updated` when there's a new state reported
by the runner, even if there's no change. This is to avoid the task
being judged as a zombie task.

Enhancement:
- Support `Stat()` for DBFS file.
- `WriteLogs` refuses to write if it could result in content holes.

Co-authored-by: Jason Song <i@wolfogre.com>
15 months agoUse correct response code in push mirror creation response in v1_json.tmpl (#25476...
Giteabot [Wed, 28 Jun 2023 23:00:56 +0000 (19:00 -0400)]
Use correct response code in push mirror creation response in v1_json.tmpl (#25476) (#25571)

Backport #25476 by @GeorgDangl

In the process of doing a bit of automation via the API, we've
discovered a _small_ issue in the Swagger definition. We tried to create
a push mirror for a repository, but our generated client raised an
exception due to an unexpected status code.

When looking at this function:

https://github.com/go-gitea/gitea/blob/3c7f5ed7b5bff347198cbb26492e6354ea42733b/routers/api/v1/repo/mirror.go#L236-L240

We see it defines `201 - Created` as response:

https://github.com/go-gitea/gitea/blob/3c7f5ed7b5bff347198cbb26492e6354ea42733b/routers/api/v1/repo/mirror.go#L260-L262

But it actually returns `200 - OK`:

https://github.com/go-gitea/gitea/blob/3c7f5ed7b5bff347198cbb26492e6354ea42733b/routers/api/v1/repo/mirror.go#L373

So I've just updated the Swagger definitions to match the code😀

Co-authored-by: Georg Dangl <10274404+GeorgDangl@users.noreply.github.com>
15 months agoFix bugs related to notification endpoints (#25548) (#25562)
Giteabot [Wed, 28 Jun 2023 16:24:48 +0000 (12:24 -0400)]
Fix bugs related to notification endpoints (#25548) (#25562)

Backport #25548 by @Zettat123

This PR
- fixes #25545
- fixes two incorrect `reqToken()` in `/notifications` endpoints (caused
by #24767)

Co-authored-by: Zettat123 <zettat123@gmail.com>
15 months agoAlign language menu icon and fit the footer area (#25556) (#25563)
Giteabot [Wed, 28 Jun 2023 15:51:24 +0000 (11:51 -0400)]
Align language menu icon and fit the footer area (#25556) (#25563)

Backport #25556 by @wxiaoguang

Close #25551

## Before

![image](https://github.com/go-gitea/gitea/assets/2114189/f35aebeb-9c86-4632-8c1f-1c90aa757640)

## After

![image](https://github.com/go-gitea/gitea/assets/2114189/4a623687-6c6d-442a-a4f9-07dadeb9fc6d)

----

![image](https://github.com/go-gitea/gitea/assets/2114189/6a4e5ecf-b88b-4c22-98c3-21898bd41bc5)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoFix sub-command log level (#25537) (#25553)
wxiaoguang [Wed, 28 Jun 2023 09:35:20 +0000 (17:35 +0800)]
Fix sub-command log level (#25537) (#25553)

Backport #25537

More fix for #24981

* #24981

Close #22361, #25552

* #22361
* #25552

There were many patches for Gitea's sub-commands to satisfy the facts:

* Some sub-commands shouldn't output any log, otherwise the git protocol
would be broken
* Sometimes the users want to see "verbose" or "quiet" outputs

That's a longstanding problem, and very fragile. This PR is only a quick
patch for the problem.

In the future, the sub-command system should be refactored to a clear
solution.

----

Other changes:

* Use `ReplaceAllWriters` to replace
`RemoveAllWriters().AddWriters(writer)`, then it's an atomic operation.
* Remove unnecessary `syncLevelInternal` calls, because
`AddWriters/addWritersInternal` already calls it.

15 months agoChange `Regenerate Secret` button display (#25534) (#25541)
Giteabot [Tue, 27 Jun 2023 20:14:58 +0000 (16:14 -0400)]
Change `Regenerate Secret` button display (#25534) (#25541)

Backport #25534 by @KN4CK3R

Fixes #25527

Preview:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/a84ad1ba-43e6-42e5-a0e2-585fb226875d)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
15 months agoFix admin-dl-horizontal (#25512) (#25535)
Giteabot [Tue, 27 Jun 2023 17:06:36 +0000 (13:06 -0400)]
Fix admin-dl-horizontal (#25512) (#25535)

Backport #25512 by @wxiaoguang

![image](https://github.com/go-gitea/gitea/assets/2114189/fb731e07-da30-4470-8200-73b5ca8b78f1)

![image](https://github.com/go-gitea/gitea/assets/2114189/85930b6f-5df7-437f-863f-423f3b81dd26)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
15 months agoFix rerun icon on action view component (#25531) (#25536)
Giteabot [Tue, 27 Jun 2023 16:28:14 +0000 (12:28 -0400)]
Fix rerun icon on action view component (#25531) (#25536)

Backport #25531 by @HesterG

Right now rerun icon on action view component will not be seen when
duration text length is long, because the wrapper `job-brief-info` has a
fixed width, and the svg is squeezed. The way to fix this in this PR is
to change width to `fit-content` and exchange position of duration text
and rerun svg.

Before (rerun svg not shown on hover):

<img width="1401" alt="Screen Shot 2023-06-27 at 12 53 41"
src="https://github.com/go-gitea/gitea/assets/17645053/bb3f62ec-8c56-4dbc-96f1-718b50426d91">

After:

<img width="1409" alt="Screen Shot 2023-06-27 at 12 50 59"
src="https://github.com/go-gitea/gitea/assets/17645053/620aa02c-2326-408d-a763-453f48f42c40">

Co-authored-by: HesterG <hestergong@gmail.com>
15 months agoFix input `line-height` cutting off `g` (#25334) (#25533)
Giteabot [Tue, 27 Jun 2023 09:31:18 +0000 (05:31 -0400)]
Fix input `line-height` cutting off `g` (#25334) (#25533)

Backport #25334 by @hiifong

Fix the incomplete display of input text
Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/6bd8ca29-a096-46a8-bd23-fb833f45186f)

![image](https://github.com/go-gitea/gitea/assets/89133723/27e51e62-7150-45cd-8606-09317d462d70)
After:

![image](https://github.com/go-gitea/gitea/assets/89133723/8d0db5d3-d768-42b4-9a75-0b8816f0a299)

![image](https://github.com/go-gitea/gitea/assets/89133723/4193adc9-b635-4ed6-8e11-715ec5150563)

Co-authored-by: hiifong <i@hiif.ong>
Co-authored-by: silverwind <me@silverwind.io>
15 months agoChangelog for v1.20.0-rc2 (#25474)
6543 [Tue, 27 Jun 2023 04:08:37 +0000 (06:08 +0200)]
Changelog for v1.20.0-rc2 (#25474)

as title

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
15 months agoAllow change line of admin-dl-horizontal dt (#25508) (#25516)
HesterG [Mon, 26 Jun 2023 20:20:22 +0000 (04:20 +0800)]
Allow change line of admin-dl-horizontal dt (#25508) (#25516)

As https://github.com/go-gitea/gitea/pull/25515#issuecomment-1606626886
says, still need this backport

Close #25389

After:

<img width="915" alt="Screen Shot 2023-06-26 at 11 00 12"
src="https://github.com/go-gitea/gitea/assets/17645053/45026447-cf50-4603-ade3-7b80a9023c20">

admin/dashboard:

<img width="957" alt="Screen Shot 2023-06-26 at 10 59 51"
src="https://github.com/go-gitea/gitea/assets/17645053/f4f95bbe-f747-46f1-8fbd-5778a19ebef7">

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoAdd Adopt repository event and handler (#25497) (#25518)
Giteabot [Mon, 26 Jun 2023 20:09:07 +0000 (16:09 -0400)]
Add Adopt repository event and handler (#25497) (#25518)

Backport #25497 by @lunny

Fix #14304

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
15 months agoClarify the reason why the user can't add a new email if there is a pending activatio...
Giteabot [Mon, 26 Jun 2023 09:28:48 +0000 (05:28 -0400)]
Clarify the reason why the user can't add a new email if there is a pending activation (#25509) (#25514)

Backport #25509 by @wxiaoguang

![image](https://github.com/go-gitea/gitea/assets/2114189/cff20df0-ad0c-4140-b8e2-5782cad8a53a)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoFix CLI sub-command handling (#25501) (#25517)
Giteabot [Mon, 26 Jun 2023 08:41:52 +0000 (04:41 -0400)]
Fix CLI sub-command handling (#25501) (#25517)

Backport #25501 by @wxiaoguang

A regression of #25330 : The nil "Action" should be treated as "help"

In old releases: `./gitea admin` show helps

After #25330: `./gitea admin` panics (although the code returned `nil`
if action is nil, but Golang's quirk is: nil in interface is not nil)

With this PR: `./gitea admin` shows helps as the old releases.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoImprove loadprojects for issue list (#25468) (#25493)
Giteabot [Mon, 26 Jun 2023 02:06:58 +0000 (22:06 -0400)]
Improve loadprojects for issue list (#25468) (#25493)

15 months agoDocument creating an API key from the CLI (#25504)
lonix1 [Mon, 26 Jun 2023 01:33:34 +0000 (03:33 +0200)]
Document creating an API key from the CLI (#25504)

Related to https://github.com/go-gitea/gitea/issues/25503

---------

Co-authored-by: delvh <dev.lh@web.de>
15 months agoFine tune "dropdown button" icon (#25442) (#25499)
Giteabot [Sun, 25 Jun 2023 06:35:26 +0000 (02:35 -0400)]
Fine tune "dropdown button" icon (#25442) (#25499)

Backport #25442 by @wxiaoguang

![image](https://github.com/go-gitea/gitea/assets/2114189/143e043d-85c9-43a4-85ae-ca55f507f738)

----

![image](https://github.com/go-gitea/gitea/assets/2114189/bcba03a5-732e-4139-bc35-96a7f8bfcb88)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoUse InitWorkPathAndCfgProvider for environment-to-ini to avoid unnecessary checks... v1.20.0-rc2
Giteabot [Sat, 24 Jun 2023 14:04:50 +0000 (10:04 -0400)]
Use InitWorkPathAndCfgProvider for environment-to-ini to avoid unnecessary checks (#25480) (#25488)

Backport #25480 by @wxiaoguang

Fix #25481

The `InitWorkPathAndCommonConfig` calls `LoadCommonSettings` which does
many checks like "current user is root or not".

Some commands like "environment-to-ini" shouldn't do such check, because
it might be run with "root" user at the moment (eg: the docker's setup
script)

ps: in the future, the docker's setup script should be improved to avoid
Gitea's command running with "root"

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoRevert "Make buttons in a modal form have proper type. (#25446) (#25478)" (#25484)
wxiaoguang [Sat, 24 Jun 2023 13:28:55 +0000 (21:28 +0800)]
Revert "Make buttons in a modal form have proper type. (#25446) (#25478)" (#25484)

There is a side effect because some modal doesn't have a proper "ok"
button.

This reverts commit 050c38ca19cce06040741321e7871121981c76f4.

15 months agoFix wrong warn messages in migration steps (#25475) (#25487)
Giteabot [Sat, 24 Jun 2023 09:51:26 +0000 (05:51 -0400)]
Fix wrong warn messages in migration steps (#25475) (#25487)

15 months agoMake buttons in a modal form have proper type. (#25446) (#25478)
Denys Konovalov [Sat, 24 Jun 2023 03:56:06 +0000 (05:56 +0200)]
Make buttons in a modal form have proper type. (#25446) (#25478)

Backport #25446 by @wxiaoguang

Fix  #25438

All non-"ok" buttons which do not have "type" should not submit the
form, should not be triggered by "Enter".

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoImprove wiki sidebar and TOC (#25460) (#25477)
Giteabot [Sat, 24 Jun 2023 02:16:15 +0000 (22:16 -0400)]
Improve wiki sidebar and TOC (#25460) (#25477)

Backport #25460 by @wxiaoguang

Close #20976
Close #20975

1. Fix the bug: the TOC in footer was incorrectly rendered as main
content's TOC
2. Fix the layout: on mobile, the TOC is put above the main content,
while the sidebar is put below the main content
3. Auto collapse the TOC on mobile

ps: many styles of "wiki.css" are moved from old css files, so leave
nits to following PRs.

### for desktop

![image](https://github.com/go-gitea/gitea/assets/2114189/6c84201c-0648-465a-99e6-c53cdaee53c0)

### for mobile

![image](https://github.com/go-gitea/gitea/assets/2114189/9cb4fdfe-b6ab-4e6f-ae82-219ddb8fa27e)

### other changed pages

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/ef077736-2c3e-4e3d-82fe-d9bf1ebcca98)

![image](https://github.com/go-gitea/gitea/assets/2114189/bb528429-ad5f-4258-a5c4-05f997c624ea)

</details>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoFix repo search broken because of profile page added (#25455) (#25467) v1.20.0-rc1
Giteabot [Fri, 23 Jun 2023 13:48:35 +0000 (09:48 -0400)]
Fix repo search broken because of profile page added (#25455) (#25467)

Backport #25455 by @lunny

Fix #25433
Caused by #23260

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
15 months agoMake "dismiss" content shown correctly (#25461) (#25465)
Giteabot [Fri, 23 Jun 2023 11:04:15 +0000 (07:04 -0400)]
Make "dismiss" content shown correctly (#25461) (#25465)

Backport #25461 by @wxiaoguang

Close #25127

![image](https://github.com/go-gitea/gitea/assets/2114189/7d6be811-8e4a-4982-a5e4-857d171758d4)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoGitea version in Makefile (#25456) (#25457)
John Olheiser [Fri, 23 Jun 2023 07:52:03 +0000 (02:52 -0500)]
Gitea version in Makefile (#25456) (#25457)

Backport-ish of #25456

Signed-off-by: jolheiser <john.olheiser@gmail.com>
15 months agoSupport Drone building binaries too
techknowlogick [Fri, 23 Jun 2023 01:13:54 +0000 (21:13 -0400)]
Support Drone building binaries too

15 months agoRemove test string (#25447) (#25448)
Denys Konovalov [Thu, 22 Jun 2023 17:30:51 +0000 (19:30 +0200)]
Remove test string (#25447) (#25448)

Backport #25447

Remove test string on delete project button, I overlooked it in a
previous PR

15 months agoRefactor path & config system (#25330) (#25416)
wxiaoguang [Thu, 22 Jun 2023 16:27:18 +0000 (00:27 +0800)]
Refactor path & config system (#25330) (#25416)

Backport #25330

# The problem

There were many "path tricks":

* By default, Gitea uses its program directory as its work path
* Gitea tries to use the "work path" to guess its "custom path" and
"custom conf (app.ini)"
* Users might want to use other directories as work path
* The non-default work path should be passed to Gitea by GITEA_WORK_DIR
or "--work-path"
* But some Gitea processes are started without these values
    * The "serv" process started by OpenSSH server
    * The CLI sub-commands started by site admin
* The paths are guessed by SetCustomPathAndConf again and again
* The default values of "work path / custom path / custom conf" can be
changed when compiling

# The solution

* Use `InitWorkPathAndCommonConfig` to handle these path tricks, and use
test code to cover its behaviors.
* When Gitea's web server runs, write the WORK_PATH to "app.ini", this
value must be the most correct one, because if this value is not right,
users would find that the web UI doesn't work and then they should be
able to fix it.
* Then all other sub-commands can use the WORK_PATH in app.ini to
initialize their paths.
* By the way, when Gitea starts for git protocol, it shouldn't output
any log, otherwise the git protocol gets broken and client blocks
forever.

The "work path" priority is: WORK_PATH in app.ini > cmd arg --work-path
> env var GITEA_WORK_DIR > builtin default

The "app.ini" searching order is: cmd arg --config > cmd arg "work path
/ custom path" > env var "work path / custom path" > builtin default

## ⚠️ BREAKING

If your instance's "work path / custom path / custom conf" doesn't meet
the requirements (eg: work path must be absolute), Gitea will report a
fatal error and exit. You need to set these values according to the
error log.

15 months agoMove some regexp out of functions (#25430) (#25445)
John Olheiser [Thu, 22 Jun 2023 16:01:54 +0000 (11:01 -0500)]
Move some regexp out of functions (#25430)  (#25445)

Partial backport of #25430

Not a bug, but worth backporting for efficiency.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
15 months agoFix `Permission` in API returned repository struct (#25388) (#25441)
Giteabot [Thu, 22 Jun 2023 15:01:42 +0000 (11:01 -0400)]
Fix `Permission` in API returned repository struct (#25388) (#25441)

Backport #25388 by @wolfogre

The old code generates `structs.Repository.Permissions` with only
`access.Permission.AccessMode`, however, it should check the units too,
or the value could be incorrect. For example,
`structs.Repository.Permissions.Push` could be false even the doer has
write access to code unit.

Should fix
https://github.com/renovatebot/renovate/issues/14059#issuecomment-1047961128
(Not reported by it, I just found it when I was looking into this bug)

---

Review tips:

The major changes are
- `modules/structs/repo.go`
https://github.com/go-gitea/gitea/pull/25388/files#diff-870406f6857117f8b03611c43fca0ab9ed6d6e76a2d0069a7c1f17e8fa9092f7
- `services/convert/repository.go`
https://github.com/go-gitea/gitea/pull/25388/files#diff-7736f6d2ae894c9edb7729a80ab89aa183b888a26a811a0c1fdebd18726a7101

And other changes are passive.

Co-authored-by: Jason Song <i@wolfogre.com>
15 months agoDiff page enhancements (#25398) (#25437)
Giteabot [Thu, 22 Jun 2023 12:33:13 +0000 (08:33 -0400)]
Diff page enhancements (#25398) (#25437)

Backport #25398 by @silverwind

Two small tweaks:

1. Vertically center arrow here when editing a PR:

<img width="405" alt="Screenshot 2023-06-20 at 19 48 49"
src="https://github.com/go-gitea/gitea/assets/115237/1d63764d-9fd9-467e-8a8e-9258c06475eb">

2. Use 2-row layout on diff viewed status and show it again on mobile:

<img width="142" alt="Screenshot 2023-06-20 at 19 51 21"
src="https://github.com/go-gitea/gitea/assets/115237/3046e782-163c-4f87-910c-a22066de8f1b">

Mobile view:

<img width="370" alt="Screenshot 2023-06-20 at 19 44 40"
src="https://github.com/go-gitea/gitea/assets/115237/9cf56347-7323-4d05-99a5-17ad215ee44d">

Co-authored-by: silverwind <me@silverwind.io>
15 months agoChange default email domain for LDAP users (#25425) (#25434)
Giteabot [Thu, 22 Jun 2023 10:53:15 +0000 (06:53 -0400)]
Change default email domain for LDAP users (#25425) (#25434)

Backport #25425 by @Zettat123

Fixes #21169

Change `localhost` to `localhost.local`

Co-authored-by: Zettat123 <zettat123@gmail.com>
15 months agoVarious UI fixes (#25264) (#25431)
Giteabot [Thu, 22 Jun 2023 10:19:38 +0000 (06:19 -0400)]
Various UI fixes (#25264) (#25431)

Backport #25264 by @silverwind

Numerous small UI fixes:

- Fix double border in collaborator list
- Fix system notice table background
- Mute links in repo and org lists
- Downsize projects edit buttons
- Improve milestones and project list rendering
- Condense milestone list entry to a single line of "metas"
- Mute ".." button in repo files list

<img width="899" alt="Screenshot 2023-06-14 at 21 19 23"
src="https://github.com/go-gitea/gitea/assets/115237/40d70006-5f76-49ad-b43c-4343ec3311e1">

<img width="905" alt="Screenshot 2023-06-14 at 21 18 29"
src="https://github.com/go-gitea/gitea/assets/115237/46ef39ea-ab26-452d-89b0-a55d0cfacfdb">

<img width="270" alt="Screenshot 2023-06-14 at 21 14 09"
src="https://github.com/go-gitea/gitea/assets/115237/aa16e833-a03b-4231-bc7c-159a6a6bee19">

<img width="409" alt="Screenshot 2023-06-14 at 21 12 13"
src="https://github.com/go-gitea/gitea/assets/115237/b5242d41-f87a-4837-b0cf-9cc4c1f43daf">

<img width="286" alt="Screenshot 2023-06-14 at 21 10 03"
src="https://github.com/go-gitea/gitea/assets/115237/d0c36e47-651b-4d34-ad95-3d59474a7c3e">

<img width="928" alt="Screenshot 2023-06-14 at 21 05 24"
src="https://github.com/go-gitea/gitea/assets/115237/fc3b713e-d252-40f5-b6ba-6e5a741ab500">

<img width="217" alt="Screenshot 2023-06-14 at 21 02 01"
src="https://github.com/go-gitea/gitea/assets/115237/c4c33376-18d6-4820-aff5-f508f6d351a0">
<img width="79" alt="Screenshot 2023-06-14 at 20 42 43"
src="https://github.com/go-gitea/gitea/assets/115237/034b5950-c0bf-473b-a2f7-0c27a0259f29">
<img width="607" alt="Screenshot 2023-06-14 at 21 00 42"
src="https://github.com/go-gitea/gitea/assets/115237/fba2d3fd-bd3e-4daf-8b2f-530a1c99c8bc">

Co-authored-by: silverwind <me@silverwind.io>
15 months agoShow outdated comments in files changed tab (#24936) (#25428)
sebastian-sauer [Thu, 22 Jun 2023 08:34:42 +0000 (10:34 +0200)]
Show outdated comments in files changed tab (#24936) (#25428)

Backport #24936

If enabled show a clickable label in the comment. A click on the label
opens the Conversation tab with the comment focussed - there you're able
to view the old diff (or original diff the comment was created on).

**Screenshots**

![image](https://github.com/go-gitea/gitea/assets/1135157/63ab9571-a9ee-4900-9f02-94ab0095f9e7)

![image](https://github.com/go-gitea/gitea/assets/1135157/78f7c225-8d76-46f5-acfd-9b8aab988a6c)

When resolved and outdated:

![image](https://github.com/go-gitea/gitea/assets/1135157/6ece9ebd-c792-4aa5-9c35-628694e9d093)

Option to enable/disable this (stored in user settings - default is
disabled):

![image](https://github.com/go-gitea/gitea/assets/1135157/ed99dfe4-76dc-4c12-bd96-e7e62da50ab5)

![image](https://github.com/go-gitea/gitea/assets/1135157/e837a052-e92e-4a28-906d-9db5bacf93a6)

fixes #24913

Co-authored-by: silverwind <me@silverwind.io>
15 months agoUse "utf8mb4" for MySQL by default (#25432)
wxiaoguang [Thu, 22 Jun 2023 05:38:23 +0000 (13:38 +0800)]
Use "utf8mb4" for MySQL by default (#25432)

TBH, I don't see much difference from `Remove "CHARSET" config option
for MySQL, always use "utf8mb4"` #25413

Close #25413

15 months agoFix missing commit message body when the message has leading newlines (#25418) (...
Giteabot [Wed, 21 Jun 2023 11:55:08 +0000 (07:55 -0400)]
Fix missing commit message body when the message has leading newlines (#25418) (#25422)

Backport #25418 by @wolfogre

Commit with `echo "\nmessage after a blank line\nsecond line of the
message" | git commit --cleanup=verbatim -F -` and push.

<img width="1139" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/f9a2c28c-e307-4c78-9e31-3d3ace7b9274">

Co-authored-by: Jason Song <i@wolfogre.com>
15 months agoAvoid polluting config file when "save" (#25395) (#25406)
Giteabot [Wed, 21 Jun 2023 04:51:26 +0000 (00:51 -0400)]
Avoid polluting config file when "save" (#25395) (#25406)

Backport #25395 by @wxiaoguang

That's a longstanding INI package problem: the "MustXxx" calls change
the option values, and the following "Save" will save a lot of garbage
options into the user's config file.

Ideally we should refactor the INI package to a clear solution, but it's
a huge work.

A clear workaround is what this PR does: when "Save", load a clear INI
instance and save it.

Partially fix #25377, the "install" page needs more fine tunes.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoUse the new download domain replace the old (#25405) (#25409)
Giteabot [Wed, 21 Jun 2023 03:59:51 +0000 (23:59 -0400)]
Use the new download domain replace the old (#25405) (#25409)

Backport #25405 by @lunny

As title.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
15 months agoFix dropdown icon layout on diff page (#25397) (#25403)
Giteabot [Wed, 21 Jun 2023 02:55:11 +0000 (22:55 -0400)]
Fix dropdown icon layout on diff page (#25397) (#25403)

Backport #25397 by @wxiaoguang

Address
https://github.com/go-gitea/gitea/pull/25163#issuecomment-1599207916

Remove the unused  "icon-button".

And fix the layout:

Without the dropdown icon:

```
{{svg "gitea-whitespace"}}
```

![image](https://github.com/go-gitea/gitea/assets/2114189/58a524ba-f289-4982-aea2-6f9f9f9cbdcf)

With the dropdown icon:

```
{{svg "gitea-whitespace" 16 "gt-mr-3"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
```

![image](https://github.com/go-gitea/gitea/assets/2114189/eb99168b-5d49-40a7-8665-5296cbb4e486)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoFix blank dir message when uploading files from web editor (#25391) (#25400)
Giteabot [Tue, 20 Jun 2023 20:28:52 +0000 (16:28 -0400)]
Fix blank dir message when uploading files from web editor (#25391) (#25400)

Backport #25391 by @lunny

Fix #7883

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
15 months agoUse Actions git context instead of dynamically created buildkit one (#25381) (#25383)
Giteabot [Tue, 20 Jun 2023 06:52:38 +0000 (02:52 -0400)]
Use Actions git context instead of dynamically created buildkit one (#25381) (#25383)

Backport #25381 by @techknowlogick

The [docker/build-push-action@v2
action](https://github.com/docker/build-push-action) by default ignores
the checkout created using the actions/checkout@v2 action. When you pass
a git build context to docker build, it wouldn't include the .git
directory.

By passing `context: .` to the build step then it'll use the Actions git
context which includes the git fetch from the earlier step.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
15 months agoUpdate JS dependencies, remove space after emoji completion (#25266) (#25352)
silverwind [Tue, 20 Jun 2023 05:38:52 +0000 (07:38 +0200)]
Update JS dependencies, remove space after emoji completion (#25266) (#25352)

Manual backport of #25266 because of lockfile conflicts.

- Update all JS dependencies
- Enable stylint
[`media-feature-name-value-no-unknown`](https://stylelint.io/user-guide/rules/media-feature-name-value-no-unknown)
- Make use of new features in webpack and text-expander-element
- Tested Swagger and Mermaid

To explain the `text-expander-element` change: Before this version, the
element added a unavoidable space after emoji completion. Now that
https://github.com/github/text-expander-element/pull/36 is in, we gain
control over this space and I opted to remove it for emoji completion
and retain it for `@` mentions.

Co-authored-by: Giteabot <teabot@gitea.io>
15 months agoFix LDAP sync when Username Attribute is empty (#25278) (#25379)
Giteabot [Tue, 20 Jun 2023 05:11:22 +0000 (01:11 -0400)]
Fix LDAP sync when Username Attribute is empty (#25278) (#25379)

Backport #25278 by @Zettat123

Fix #21072

![image](https://github.com/go-gitea/gitea/assets/15528715/96b30beb-7f88-4a60-baae-2e5ad8049555)

Username Attribute is not a required item when creating an
authentication source. If Username Attribute is empty, the username
value of LDAP user cannot be read, so all users from LDAP will be marked
as inactive by mistake when synchronizing external users.

This PR improves the sync logic, if username is empty, the email address
will be used to find user.

Co-authored-by: Zettat123 <zettat123@gmail.com>
15 months agoFetch all git data for embedding correct version in docker image (#25361) (#25373)
Giteabot [Tue, 20 Jun 2023 03:07:51 +0000 (23:07 -0400)]
Fetch all git data for embedding correct version in docker image (#25361) (#25373)

Backport #25361 by @techknowlogick

Fix #25350

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
15 months agoFix label list divider (#25312) (#25372)
Giteabot [Mon, 19 Jun 2023 18:14:31 +0000 (14:14 -0400)]
Fix label list divider (#25312) (#25372)

Backport #25312 by @wxiaoguang

We only needs 2 lines to hide the dividers.

```
  $dropdownLabelFilter.dropdown('setting', {'hideDividers': 'empty'});
  $dropdownLabelFilter.dropdown('refreshItems');
```

Other code blocks are refactored by the way.

![image](https://github.com/go-gitea/gitea/assets/2114189/74989996-fcea-4df4-b534-b06f7957939a)

![image](https://github.com/go-gitea/gitea/assets/2114189/ee3b3761-b96e-4fb5-b646-e9d3117e5f40)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agofix issue filters on mobile view (#25368) (#25371)
Giteabot [Mon, 19 Jun 2023 17:43:22 +0000 (13:43 -0400)]
fix issue filters on mobile view (#25368) (#25371)

Backport #25368 by @denyskon

Fix #24846 applying the solution proposed by @silverwind

<details>
<summary>Screenshots</summary>

![Bildschirmfoto vom 2023-06-19
12-20-54](https://github.com/go-gitea/gitea/assets/47871822/3f4e4536-38c4-451b-bfc0-a7c39acd37f0)
![Bildschirmfoto vom 2023-06-19
12-21-02](https://github.com/go-gitea/gitea/assets/47871822/3403ecc2-4d7f-4acd-b0c0-1b7a10228ff7)
![Bildschirmfoto vom 2023-06-19
12-21-16](https://github.com/go-gitea/gitea/assets/47871822/ef28a2bf-b7cc-4aec-b54b-99d2cc46a1f6)
![Bildschirmfoto vom 2023-06-19
12-21-21](https://github.com/go-gitea/gitea/assets/47871822/f8cd72a5-379e-410b-b0ef-d58895719370)
![Bildschirmfoto vom 2023-06-19
12-21-28](https://github.com/go-gitea/gitea/assets/47871822/34c78301-820c-4106-a086-ae81dc97eb91)
![Bildschirmfoto vom 2023-06-19
12-21-48](https://github.com/go-gitea/gitea/assets/47871822/b677adf1-3a48-42c8-befe-fa9d2679f0a3)
</details>

Replaces #25335

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
15 months agoFix incorrect actions ref_name (#25358) (#25367)
Giteabot [Mon, 19 Jun 2023 16:37:52 +0000 (12:37 -0400)]
Fix incorrect actions ref_name (#25358) (#25367)

Backport #25358 by @nephatrine

Fix #25357 .

Just a simple fix the result of `${{ gitea.ref_name }}` to show the
shortened name rather than the full ref.

Co-authored-by: Daniel Wolf <1461334+nephatrine@users.noreply.github.com>
15 months agoAvoid polluting the config (#25345) (#25354)
Giteabot [Sun, 18 Jun 2023 20:56:50 +0000 (16:56 -0400)]
Avoid polluting the config (#25345) (#25354)

Backport #25345 by @wxiaoguang

Caught by #25330

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoFix incorrect config argument position for builtin SSH server (#25341)
wxiaoguang [Sun, 18 Jun 2023 16:56:21 +0000 (00:56 +0800)]
Fix incorrect config argument position for builtin SSH server (#25341)

The "--config" option is a global option, it shouldn't appear at the
end.

Otherwise it might not be respected in some cases.

Caught by #25330 and use a separate PR to fix it for 1.20

15 months agoAdd Exoscale to installation on cloud provider docs (#25342) (#25346)
Giteabot [Sun, 18 Jun 2023 15:48:06 +0000 (11:48 -0400)]
Add Exoscale to installation on cloud provider docs (#25342) (#25346)

Backport #25342 by @pmig

We created a Gitea application for the [Exoscale
Marketplace](https://www.exoscale.com/marketplace/listing/glasskube-gitea/)
for easier installation on the European cloud provider.

The installation is managed via the [Glasskube Kubernetes
Operator](https://github.com/glasskube/operator).

Signed-off-by: Philip Miglinci <pmig@glasskube.eu>
Co-authored-by: Philip Miglinci <p.miglinci@gmail.com>
15 months agoWrite absolute AppDataPath to app.ini when installing (#25331) (#25347)
Giteabot [Sun, 18 Jun 2023 15:07:46 +0000 (11:07 -0400)]
Write absolute AppDataPath to app.ini when installing (#25331) (#25347)

Backport #25331 by @wxiaoguang

If the APP_DATA_PATH isn't written into the config when installing, then
its value is uncertain because some Gitea command doesn't run with
correct WorkPath.

This is a quick fix for #25330  and can be backported.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
15 months agoFix UI on mobile view (#25315) (#25340)
Giteabot [Sun, 18 Jun 2023 13:02:41 +0000 (09:02 -0400)]
Fix UI on mobile view (#25315) (#25340)

Backport #25315 by @denyskon

Various fixes to pages or elements which were looking ugly on mobile.
<details>
<summary>Screenshots</summary>

![Bildschirmfoto vom 2023-06-17
20-38-41](https://github.com/go-gitea/gitea/assets/47871822/30b5d3ce-df3b-43eb-a4c2-c3790667fb9d)
![Bildschirmfoto vom 2023-06-17
20-39-27](https://github.com/go-gitea/gitea/assets/47871822/27c07b25-3602-4fb2-b34d-d5e875e054e9)

![Bildschirmfoto vom 2023-06-17
20-41-27](https://github.com/go-gitea/gitea/assets/47871822/dacdbb4e-e3dd-4b94-abf0-c68e3d64bd3b)
![Bildschirmfoto vom 2023-06-17
20-41-48](https://github.com/go-gitea/gitea/assets/47871822/72432c35-7c4a-4c7f-a767-3562f26a5c14)
![Bildschirmfoto vom 2023-06-17
20-42-37](https://github.com/go-gitea/gitea/assets/47871822/737c26ed-1910-4467-98ef-e8769bbbe6f0)
![Bildschirmfoto vom 2023-06-17
20-42-52](https://github.com/go-gitea/gitea/assets/47871822/1813b4bc-43c0-4912-8acb-5d799c090bf3)
![Bildschirmfoto vom 2023-06-17
20-43-06](https://github.com/go-gitea/gitea/assets/47871822/136466e8-34e5-419d-97ec-5202ff819fd2)
![Bildschirmfoto vom 2023-06-17
20-43-42](https://github.com/go-gitea/gitea/assets/47871822/59270bb2-d661-4a84-8504-3e50f771f767)
![Bildschirmfoto vom 2023-06-17
20-44-44](https://github.com/go-gitea/gitea/assets/47871822/494e274d-3771-4141-9419-0a4bbd8b7f64)

</details>

Co-authored by: @silverwind

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: silverwind <me@silverwind.io>
15 months agoFix action runner last online state on edit page (#25337)
derelm [Sun, 18 Jun 2023 12:04:35 +0000 (14:04 +0200)]
Fix action runner last online state on edit page (#25337)

Backport fix for action runner last online state not showing in
`release/v1.20` - fixes #25336

15 months agobuild nightly docker images (#25317) (#25333)
Giteabot [Sun, 18 Jun 2023 11:09:30 +0000 (07:09 -0400)]
build nightly docker images (#25317) (#25333)

Backport #25317 by @techknowlogick

followup of https://github.com/go-gitea/gitea/pull/25308 this time to
build & push nightly docker images

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
15 months agoWhen viewing a file, hide the add button (#25320) (#25339)
Giteabot [Sun, 18 Jun 2023 10:24:54 +0000 (06:24 -0400)]
When viewing a file, hide the add button (#25320) (#25339)

Backport #25320 by @hiifong

Fix #25281
When viewing a file, hide the add button

![image](https://github.com/go-gitea/gitea/assets/89133723/839babaf-6b67-46e1-a103-677306fb8503)

![image](https://github.com/go-gitea/gitea/assets/89133723/32a8aeca-31f4-4ce1-a0fa-7656e16b66d3)

Co-authored-by: hiifong <i@hiif.ong>
15 months agoRemove EasyMDE focus outline on text (#25328) (#25332)
Giteabot [Sun, 18 Jun 2023 07:35:40 +0000 (03:35 -0400)]
Remove EasyMDE focus outline on text (#25328) (#25332)

Backport #25328 by @silverwind

EasyMDE in Firefox currently shows a ugly outline in the fake textarea
the CodeMirror uses. Hide it.

Before:

<img width="845" alt="Screenshot 2023-06-18 at 02 54 09"
src="https://github.com/go-gitea/gitea/assets/115237/dc406166-9ad5-4a9b-9581-002b5cdcc6df">

After:

<img width="870" alt="Screenshot 2023-06-18 at 02 54 24"
src="https://github.com/go-gitea/gitea/assets/115237/ddd78759-2cf2-4385-b863-7576fec25c34">

Co-authored-by: silverwind <me@silverwind.io>
16 months agouse Actions environment variables in Makefile (#25319) (#25318)
techknowlogick [Sun, 18 Jun 2023 03:27:04 +0000 (23:27 -0400)]
use Actions environment variables in Makefile (#25319) (#25318)

16 months agoRemove more unused Fomantic variants (#25292) (#25323)
Giteabot [Sat, 17 Jun 2023 15:14:25 +0000 (11:14 -0400)]
Remove more unused Fomantic variants (#25292) (#25323)

Backport #25292 by @silverwind

Save another 50KB of CSS by removing unused and useless Fomantic
variants.

Removed the last instance of a `tertiary` button and fixed a TODO:

<img width="509" alt="Screenshot 2023-06-15 at 22 34 36"
src="https://github.com/go-gitea/gitea/assets/115237/8a16ae7b-2b17-439b-a096-60a52724e3d6">

Co-authored-by: silverwind <me@silverwind.io>
16 months agoBuild nightly binaries with Actions (#25308) (#25314)
Giteabot [Fri, 16 Jun 2023 17:59:20 +0000 (13:59 -0400)]
Build nightly binaries with Actions (#25308) (#25314)

Backport #25308 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix displayed RPM repo url (#25310) (#25313)
Giteabot [Fri, 16 Jun 2023 16:39:41 +0000 (12:39 -0400)]
Fix displayed RPM repo url (#25310) (#25313)

Backport #25310 by @KN4CK3R

Fixes #25302

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
16 months agoShow if File is Executable (#25287) (#25300)
Giteabot [Fri, 16 Jun 2023 09:29:26 +0000 (05:29 -0400)]
Show if File is Executable (#25287) (#25300)

Backport #25287 by @JakobDev

This simply shows if a File has the executable Permission

![grafik](https://github.com/go-gitea/gitea/assets/15185051/1d50c105-6d55-4ecc-808a-c9cd5559d238)

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoAdd link to support page for commercial support (#25293) (#25297)
Giteabot [Fri, 16 Jun 2023 06:26:32 +0000 (02:26 -0400)]
Add link to support page for commercial support (#25293) (#25297)

Backport #25293 by @techknowlogick

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
16 months agoDocs about how to generate config for act runner with docker and setup it with docker...
Giteabot [Fri, 16 Jun 2023 04:09:03 +0000 (00:09 -0400)]
Docs about how to generate config for act runner with docker and setup it with docker-compose (#25256) (#25296)

Backport #25256 by @thezzisu

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.

Co-authored-by: Zisu Zhang <thezzisu@gmail.com>
16 months agoFix some UI alignments (#25277) (#25290)
Giteabot [Fri, 16 Jun 2023 00:32:59 +0000 (20:32 -0400)]
Fix some UI alignments (#25277) (#25290)

Backport #25277 by @wxiaoguang

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 `+`

The `repo-button-row` is only used on 3 pages:

![image](https://github.com/go-gitea/gitea/assets/2114189/16057ff0-7d30-41ca-ac13-70d074364566)

![image](https://github.com/go-gitea/gitea/assets/2114189/cbe2acb1-07b6-48f3-9f28-407a75f8c4ed)

![image](https://github.com/go-gitea/gitea/assets/2114189/341416b3-f6a8-466f-a140-361ee80e53a7)

![image](https://github.com/go-gitea/gitea/assets/2114189/3d4b7857-ef99-4a3f-a667-9890714a096d)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoRemove fomantic inverted variations (#25286) (#25289)
Giteabot [Thu, 15 Jun 2023 16:13:03 +0000 (12:13 -0400)]
Remove fomantic inverted variations (#25286) (#25289)

Backport #25286 by @silverwind

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

Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix issue and commit status popup padding (#25254) (#25288)
Giteabot [Thu, 15 Jun 2023 14:52:23 +0000 (10:52 -0400)]
Fix issue and commit status popup padding (#25254) (#25288)

Backport #25254 by @wxiaoguang

Close #25249

Use "dialog" for the role

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoShow OAuth2 errors to end users (#25261) (#25271)
Giteabot [Thu, 15 Jun 2023 02:48:36 +0000 (22:48 -0400)]
Show OAuth2 errors to end users (#25261) (#25271)

Backport #25261 by @wxiaoguang

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)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoFix index generation parallelly failure (#25235) (#25269)
Giteabot [Thu, 15 Jun 2023 02:14:00 +0000 (22:14 -0400)]
Fix index generation parallelly failure (#25235) (#25269)

Backport #25235 by @lunny

Fix #22109

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix profile render when the README.md size is larger than 1024 bytes (#25270)
yp05327 [Thu, 15 Jun 2023 01:39:34 +0000 (10:39 +0900)]
Fix profile render when the README.md size is larger than 1024 bytes (#25270)

Backport #25131

16 months agoFix edit OAuth application width (#25262) (#25263)
Giteabot [Thu, 15 Jun 2023 00:39:51 +0000 (20:39 -0400)]
Fix edit OAuth application width (#25262) (#25263)

Backport #25262 by @denyskon

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

Before:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/df655636-0dc3-4c8a-9778-a14c80fc807b)

After:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/e74c74be-097e-43fb-a698-92337aa128e9)

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
16 months agoUse flex to align SVG and text (#25163) (#25260)
Giteabot [Wed, 14 Jun 2023 17:21:48 +0000 (13:21 -0400)]
Use flex to align SVG and text (#25163) (#25260)

Backport #25163 by @wxiaoguang

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: wxiaoguang <wxiaoguang@gmail.com>
16 months agoGitHub Actions enhancements for frontend (#25150) (#25259)
Giteabot [Wed, 14 Jun 2023 15:59:46 +0000 (11:59 -0400)]
GitHub Actions enhancements for frontend (#25150) (#25259)

Backport #25150 by @silverwind

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

Co-authored-by: silverwind <me@silverwind.io>
16 months agoFix panic when migrating a repo from GitHub with issues (#25246) (#25247)
Giteabot [Wed, 14 Jun 2023 07:08:08 +0000 (03:08 -0400)]
Fix panic when migrating a repo from GitHub with issues (#25246) (#25247)

Backport #25246 by @wolfogre

Fix #25245. Regression of #23946.

Co-authored-by: Jason Song <i@wolfogre.com>
16 months agoFix all possible setting error related storages and added some tests (#23911) (#25244)
Giteabot [Wed, 14 Jun 2023 06:36:52 +0000 (02:36 -0400)]
Fix all possible setting error related storages and added some tests (#23911) (#25244)

Backport #23911 by @lunny

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: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoRevert overflow: overlay (revert #21850) (#25231) (#25239)
Giteabot [Tue, 13 Jun 2023 19:45:45 +0000 (15:45 -0400)]
Revert overflow: overlay (revert #21850) (#25231) (#25239)

Backport #25231 by @wxiaoguang

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: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
16 months agoDo not overwrite the log mode when installing (#25203) (#25209)
Giteabot [Tue, 13 Jun 2023 18:35:37 +0000 (14:35 -0400)]
Do not overwrite the log mode when installing (#25203) (#25209)

Backport #25203 by @wxiaoguang

Fix #24861

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoChange access token UI to select dropdowns (#25109) (#25230)
Giteabot [Tue, 13 Jun 2023 12:42:25 +0000 (08:42 -0400)]
Change access token UI to select dropdowns (#25109) (#25230)

Backport #25109 by @jtran

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

Co-authored-by: Jonathan Tran <jon@allspice.io>
16 months agoUse inline SVG for built-in OAuth providers (#25171) (#25234)
Giteabot [Tue, 13 Jun 2023 12:04:40 +0000 (08:04 -0400)]
Use inline SVG for built-in OAuth providers (#25171) (#25234)

Backport #25171 by @silverwind

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: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoFix task list checkbox toggle to work with YAML front matter (#25184) (#25227)
Giteabot [Tue, 13 Jun 2023 08:23:21 +0000 (04:23 -0400)]
Fix task list checkbox toggle to work with YAML front matter (#25184) (#25227)

Backport #25184 by @jtran

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.

Co-authored-by: Jonathan Tran <jon@allspice.io>
16 months agoFix compatible for webhook ref type (#25195) (#25223)
Giteabot [Tue, 13 Jun 2023 06:51:50 +0000 (02:51 -0400)]
Fix compatible for webhook ref type (#25195) (#25223)

Backport #25195 by @lunny

Fix #25185
Caused by #24634

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
16 months agoHide limited users if viewed by anonymous ghost (#25214) (#25220)
Giteabot [Tue, 13 Jun 2023 05:53:26 +0000 (01:53 -0400)]
Hide limited users if viewed by anonymous ghost (#25214) (#25220)

Backport #25214 by @KN4CK3R

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

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
16 months agoRemove hacky patch for "safari emoji glitch fix" (#25208) (#25211)
Giteabot [Mon, 12 Jun 2023 16:16:04 +0000 (12:16 -0400)]
Remove hacky patch for "safari emoji glitch fix"  (#25208) (#25211)

Backport #25208 by @wxiaoguang

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.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoFix fullscreen for action (#25200) (#25207)
Giteabot [Mon, 12 Jun 2023 15:41:13 +0000 (11:41 -0400)]
Fix fullscreen for action  (#25200) (#25207)

Backport #25200 by @HesterG

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.

Co-authored-by: HesterG <hestergong@gmail.com>
16 months agoImprove some documents: release version, logging, NFS lock (#25202) (#25204)
Giteabot [Mon, 12 Jun 2023 15:17:43 +0000 (11:17 -0400)]
Improve some documents: release version, logging, NFS lock (#25202) (#25204)

Backport #25202 by @wxiaoguang

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.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
16 months agoMinor arc-green color tweaks (#25175) (#25205)
Giteabot [Mon, 12 Jun 2023 11:56:59 +0000 (07:56 -0400)]
Minor arc-green color tweaks (#25175) (#25205)

Backport #25175 by @silverwind

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: silverwind <me@silverwind.io>
16 months agoAdd `WithPullRequest` for `actionsNotifier` (#25144) (#25197)
Giteabot [Mon, 12 Jun 2023 09:08:09 +0000 (05:08 -0400)]
Add `WithPullRequest` for `actionsNotifier` (#25144) (#25197)

Backport #25144 by @Zettat123

Fix #25093

If
[`WithPullRequest`](https://github.com/go-gitea/gitea/blob/679b1f7949aa40d4f962ef27f91b0b384b9c56a5/services/actions/notifier_helper.go#L90-L96)
is not called, the `Ref` in
[`notifyInput`](https://github.com/go-gitea/gitea/blob/679b1f7949aa40d4f962ef27f91b0b384b9c56a5/services/actions/notifier_helper.go#L55-L65)
will be empty, so the workflows in the head branch will not be found and
triggered.

16 months agoFix strange UI behavior of cancelling dismiss review modal (#25172)
silverwind [Sun, 11 Jun 2023 02:54:30 +0000 (04:54 +0200)]
Fix strange UI behavior of cancelling dismiss review modal (#25172)

Backport clean cherry-picks of
https://github.com/go-gitea/gitea/pull/25133 and
https://github.com/go-gitea/gitea/pull/25162 to 1.20.

16 months agoButton and color enhancements (#24989) (#25176)
silverwind [Sun, 11 Jun 2023 02:13:08 +0000 (04:13 +0200)]
Button and color enhancements (#24989) (#25176)

Backport #24989. Clean cherry-pick aside from one small conflict with
divider.

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

16 months agoFix mobile navbar and misc cleanups (#25134) (#25169)
Giteabot [Sun, 11 Jun 2023 01:50:39 +0000 (21:50 -0400)]
Fix mobile navbar and misc cleanups (#25134) (#25169)

Backport #25134 by @silverwind

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

16 months agoFix bug for code search if code is disabled (#25173) (#25181)
Giteabot [Fri, 9 Jun 2023 19:32:55 +0000 (15:32 -0400)]
Fix bug for code search if code is disabled (#25173) (#25181)

Backport #25173 by @lunny

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

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>