]> source.dussan.org Git - gitea.git/log
gitea.git
17 months agoFilter get single commit (#24613)
Matthew Walowski [Wed, 10 May 2023 01:34:07 +0000 (18:34 -0700)]
Filter get single commit (#24613)

Pretty much the same thing as #24568 but for getting a single commit
instead of getting a list of commits

17 months agoAttach a tooltip to the action status icon (#24614)
Yarden Shoham [Tue, 9 May 2023 19:39:16 +0000 (22:39 +0300)]
Attach a tooltip to the action status icon (#24614)

To clearly communicate the current state of the action

![image](https://github.com/go-gitea/gitea/assets/20454870/5d6de6b9-f34f-417d-b08e-fcd1b99b3079)
![image](https://github.com/go-gitea/gitea/assets/20454870/b976676a-4525-43e7-866f-8933be1a5dfd)
![image](https://github.com/go-gitea/gitea/assets/20454870/2e0a55fe-658f-4242-83de-b857a8b55f31)
![image](https://github.com/go-gitea/gitea/assets/20454870/6b42bcd1-c499-41ac-8419-1c4e60085d47)
![image](https://github.com/go-gitea/gitea/assets/20454870/363fcff8-fe61-4363-a04b-2db93cfc4fa3)
![image](https://github.com/go-gitea/gitea/assets/20454870/f8f59b68-93de-4f31-b9b0-24d94990d1d0)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoUse official Vue extension in Gitpod (#24609)
Yarden Shoham [Tue, 9 May 2023 18:03:50 +0000 (21:03 +0300)]
Use official Vue extension in Gitpod (#24609)

The previous one didn't work well

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoCreate a branch directly from commit on the create branch API (#22956)
来自村里的小螃蟹 [Tue, 9 May 2023 10:22:32 +0000 (18:22 +0800)]
Create a branch directly from commit on the create branch API (#22956)

#### Added
- API: Create a branch directly from commit on the create branch API
- Added `old_ref_name` parameter to allow creating a new branch from a
specific commit, tag, or branch.
- Deprecated `old_branch_name` parameter in favor of the new
`old_ref_name` parameter.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
17 months agoMake repository response support HTTP range request (#24592)
wxiaoguang [Tue, 9 May 2023 07:34:36 +0000 (15:34 +0800)]
Make repository response support HTTP range request (#24592)

Replace #20480
Replace #18448

Close #16414

17 months agoAdd Gitea Profile Readmes (#23260)
Nicholas Pease [Tue, 9 May 2023 05:57:24 +0000 (01:57 -0400)]
Add Gitea Profile Readmes (#23260)

Implements displaying a README.md file present in a users ```.profile```
repository on the users profile page. If no such repository/file is
present, the user's profile page remains unchanged.

Example of user with ```.profile/README.md```

![image](https://user-images.githubusercontent.com/34464552/222757202-5d53ac62-60d9-432f-b9e3-2537ffa91041.png)

Example of user without ```.profile/README.md```

![image](https://user-images.githubusercontent.com/34464552/222759972-576e058b-acd4-47ac-be33-38a7cb58cc81.png)

This pull request closes the feature request in #12233

Special thanks to @techknowlogick for the help in the Gitea discord!

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
17 months agoMake diff view full width again (#24598)
wxiaoguang [Tue, 9 May 2023 05:21:03 +0000 (13:21 +0800)]
Make diff view full width again (#24598)

Regression of #24459 , [the related
line](https://github.com/go-gitea/gitea/pull/24459/files#diff-f255004de8d715ff40852710390429bf2a06e7e33a4e3f8ad568af636557ac71L8)

The PR file diff view needs to be full-screen width.

17 months agoAdd permission check for moving issue action in project view page (#24589)
yp05327 [Tue, 9 May 2023 04:50:16 +0000 (13:50 +0900)]
Add permission check for moving issue action in project view page (#24589)

Fix #22954
Only users who have write permission can move issues in the project view page.

17 months agoUpdate JS dependencies, add new eslint rules (#24597)
silverwind [Tue, 9 May 2023 02:35:49 +0000 (04:35 +0200)]
Update JS dependencies, add new eslint rules (#24597)

- Update all JS dependencies
- Enable new eslint rules, fix issue (some via autofix)
- Fix some missed eslint rule renames from [unicorn
v25](https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v25.0.0)
- Tested Monaco, Katex, Swagger UI

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFilters for GetAllCommits (#24568)
Matthew Walowski [Tue, 9 May 2023 01:06:05 +0000 (18:06 -0700)]
Filters for GetAllCommits (#24568)

The `GetAllCommits` endpoint can be pretty slow, especially in repos
with a lot of commits. The issue is that it spends a lot of time
calculating information that may not be useful/needed by the user.

The `stat` param was previously added in #21337 to address this, by
allowing the user to disable the calculating stats for each commit. But
this has two issues:
1. The name `stat` is rather misleading, because disabling `stat`
disables the Stat **and** Files. This should be separated out into two
different params, because getting a list of affected files is much less
expensive than calculating the stats
2. There's still other costly information provided that the user may not
need, such as `Verification`

This PR, adds two parameters to the endpoint, `files` and `verification`
to allow the user to explicitly disable this information when listing
commits. The default behavior is true.

17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 9 May 2023 00:24:20 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoAttach a tooltip to the action control button (#24595)
Yarden Shoham [Mon, 8 May 2023 23:59:59 +0000 (02:59 +0300)]
Attach a tooltip to the action control button (#24595)

The first time I saw the big red X button I thought something failed but
apparently, it was just a "Cancel" button

# Before

![image](https://user-images.githubusercontent.com/20454870/236889564-3729926a-cfb3-4e47-a8ed-51389c4f193f.png)

![image](https://user-images.githubusercontent.com/20454870/236886259-b0ab0d55-28c3-41f5-8709-8cfc6819423f.png)

![image](https://user-images.githubusercontent.com/20454870/236886081-b7a97f01-6108-4c18-9adb-11cbafd8c19c.png)

# After

![image](https://user-images.githubusercontent.com/20454870/236889690-d1dfd74d-ad7d-4571-b712-69f0dc630c6e.png)

![image](https://user-images.githubusercontent.com/20454870/236885823-0734216d-b450-4a43-bfe3-e88525a8822a.png)

![image](https://user-images.githubusercontent.com/20454870/236903320-3b415619-8aff-4e5d-994e-6faa671990db.png)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoImprove Gitea's web context, decouple "issue template" code into service package...
wxiaoguang [Mon, 8 May 2023 23:30:14 +0000 (07:30 +0800)]
Improve Gitea's web context, decouple "issue template" code into service package (#24590)

1. Remove unused fields/methods in web context.
2. Make callers call target function directly instead of the light
wrapper like "IsUserRepoReaderSpecific"
3. The "issue template" code shouldn't be put in the "modules/context"
package, so move them to the service package.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoSupport markdown editor for issue template (#24400)
yp05327 [Mon, 8 May 2023 22:22:52 +0000 (07:22 +0900)]
Support markdown editor for issue template (#24400)

Fixes #24398

Task:
- [x] Reusing "textarea" like GitHub seems more friendly to users.
- [x] ^V image pasting and file uploading handling.

<details><summary>screenshots</summary>

![image](https://user-images.githubusercontent.com/18380374/235418877-00090552-ebda-411c-8e39-b47246bc8746.png)

![image](https://user-images.githubusercontent.com/18380374/235419073-dc33cad7-7626-4bce-9161-eb205c7384b5.png)
Display only one markdown editor:

![image](https://user-images.githubusercontent.com/18380374/235419098-ee21386d-2b2d-432e-bdb2-18646cc031e7.png)
Support file upload and ^V image pasting

![image](https://user-images.githubusercontent.com/18380374/235419364-7b390fa4-da56-437d-b55e-3847fbc049e7.png)

</details>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoDo not select line numbers when selecting text from the action run logs (#24594)
Yarden Shoham [Mon, 8 May 2023 18:50:05 +0000 (21:50 +0300)]
Do not select line numbers when selecting text from the action run logs (#24594)

- Fixes #24578

# Before

![image](https://user-images.githubusercontent.com/20454870/236873942-26e97f28-6595-4be9-88fa-158870eda253.png)

# After

![image](https://user-images.githubusercontent.com/20454870/236874171-8f0182a5-e953-4740-b875-f3542dee8325.png)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoIn TestViewRepo2, convert computed timezones to local time (#24579)
Nick [Mon, 8 May 2023 13:07:41 +0000 (09:07 -0400)]
In TestViewRepo2, convert computed timezones to local time (#24579)

This fixes up https://github.com/go-gitea/gitea/pull/10446; in that, the
*expected* timezone was changed to the local timezone, but the computed
timezone was left in UTC.

The result was this failure, when run on a non-UTC system:

```
Diff:
    --- Expected
    +++ Actual
    @@ -5,3 +5,3 @@
       commitMsg: (string) (len=12) "init project",
    -  commitTime: (string) (len=29) "Wed, 14 Jun 2017 09:54:21 EDT"
    +  commitTime: (string) (len=29) "Wed, 14 Jun 2017 13:54:21 UTC"
      },
    @@ -11,3 +11,3 @@
       commitMsg: (string) (len=12) "init project",
    -  commitTime: (string) (len=29) "Wed, 14 Jun 2017 09:54:21 EDT"
    +  commitTime: (string) (len=29) "Wed, 14 Jun 2017 13:54:21 UTC"
      }
    Test:        TestViewRepo2
```

I assume this was probably missed since the CI servers all run in UTC?

The Format() string "Mon, 02 Jan 2006 15:04:05 UTC" was incorrect: 'UTC'
isn't recognized as a variable placeholder, but was just being copied
verbatim. It should use 'MST' in order to command Format() to output the
attached timezone, which is what `time.RFC1123` has.

17 months agoFix close org projects (#24588)
yp05327 [Mon, 8 May 2023 12:19:27 +0000 (21:19 +0900)]
Fix close org projects (#24588)

A part of #22865
We can not close org projects now. This PR will fix it.

17 months agoRewrite queue (#24505)
wxiaoguang [Mon, 8 May 2023 11:49:59 +0000 (19:49 +0800)]
Rewrite queue (#24505)

# ⚠️ Breaking

Many deprecated queue config options are removed (actually, they should
have been removed in 1.18/1.19).

If you see the fatal message when starting Gitea: "Please update your
app.ini to remove deprecated config options", please follow the error
messages to remove these options from your app.ini.

Example:

```
2023/05/06 19:39:22 [E] Removed queue option: `[indexer].ISSUE_INDEXER_QUEUE_TYPE`. Use new options in `[queue.issue_indexer]`
2023/05/06 19:39:22 [E] Removed queue option: `[indexer].UPDATE_BUFFER_LEN`. Use new options in `[queue.issue_indexer]`
2023/05/06 19:39:22 [F] Please update your app.ini to remove deprecated config options
```

Many options in `[queue]` are are dropped, including:
`WRAP_IF_NECESSARY`, `MAX_ATTEMPTS`, `TIMEOUT`, `WORKERS`,
`BLOCK_TIMEOUT`, `BOOST_TIMEOUT`, `BOOST_WORKERS`, they can be removed
from app.ini.

# The problem

The old queue package has some legacy problems:

* complexity: I doubt few people could tell how it works.
* maintainability: Too many channels and mutex/cond are mixed together,
too many different structs/interfaces depends each other.
* stability: due to the complexity & maintainability, sometimes there
are strange bugs and difficult to debug, and some code doesn't have test
(indeed some code is difficult to test because a lot of things are mixed
together).
* general applicability: although it is called "queue", its behavior is
not a well-known queue.
* scalability: it doesn't seem easy to make it work with a cluster
without breaking its behaviors.

It came from some very old code to "avoid breaking", however, its
technical debt is too heavy now. It's a good time to introduce a better
"queue" package.

# The new queue package

It keeps using old config and concept as much as possible.

* It only contains two major kinds of concepts:
    * The "base queue": channel, levelqueue, redis
* They have the same abstraction, the same interface, and they are
tested by the same testing code.
* The "WokerPoolQueue", it uses the "base queue" to provide "worker
pool" function, calls the "handler" to process the data in the base
queue.
* The new code doesn't do "PushBack"
* Think about a queue with many workers, the "PushBack" can't guarantee
the order for re-queued unhandled items, so in new code it just does
"normal push"
* The new code doesn't do "pause/resume"
* The "pause/resume" was designed to handle some handler's failure: eg:
document indexer (elasticsearch) is down
* If a queue is paused for long time, either the producers blocks or the
new items are dropped.
* The new code doesn't do such "pause/resume" trick, it's not a common
queue's behavior and it doesn't help much.
* If there are unhandled items, the "push" function just blocks for a
few seconds and then re-queue them and retry.
* The new code doesn't do "worker booster"
* Gitea's queue's handlers are light functions, the cost is only the
go-routine, so it doesn't make sense to "boost" them.
* The new code only use "max worker number" to limit the concurrent
workers.
* The new "Push" never blocks forever
* Instead of creating more and more blocking goroutines, return an error
is more friendly to the server and to the end user.

There are more details in code comments: eg: the "Flush" problem, the
strange "code.index" hanging problem, the "immediate" queue problem.

Almost ready for review.

TODO:

* [x] add some necessary comments during review
* [x] add some more tests if necessary
* [x] update documents and config options
* [x] test max worker / active worker
* [x] re-run the CI tasks to see whether any test is flaky
* [x] improve the `handleOldLengthConfiguration` to provide more
friendly messages
* [x] fine tune default config values (eg: length?)

## Code coverage:

![image](https://user-images.githubusercontent.com/2114189/236620635-55576955-f95d-4810-b12f-879026a3afdf.png)

17 months agoSplit "modules/context.go" to separate files (#24569)
wxiaoguang [Mon, 8 May 2023 09:36:54 +0000 (17:36 +0800)]
Split "modules/context.go" to separate files (#24569)

The "modules/context.go" is too large to maintain.

This PR splits it to separate files, eg: context_request.go,
context_response.go, context_serve.go

This PR will help:

1. The future refactoring for Gitea's web context (eg: simplify the context)
2. Introduce proper "range request" support
3. Introduce context function

This PR only moves code, doesn't change any logic.

17 months agoPass 'not' to commit count (#24473)
Matthew Walowski [Mon, 8 May 2023 07:10:53 +0000 (00:10 -0700)]
Pass 'not' to commit count (#24473)

Due to #24409 , we can now specify '--not' when getting all commits from
a repo to exclude commits from a different branch.

When I wrote that PR, I forgot to also update the code that counts the
number of commits in the repo. So now, if the --not option is used, it
may return too many commits, which can indicate that another page of
data is available when it is not.

This PR passes --not to the commands that count the number of commits in
a repo

17 months agoRefresh the refernce of the closed PR when reopening (#24231)
sillyguodong [Mon, 8 May 2023 06:39:32 +0000 (14:39 +0800)]
Refresh the refernce of the closed PR when reopening (#24231)

Close #24213
Replace #23830

#### Cause

- Before, in order to making PR can get latest commit after reopening,
the `ref`(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR
will be updated when pushing commits to the `head branch` of the closed
PR.

#### Changes

- For closed PR , won't perform these behavior: insert`comment`, push
`notification` (UI and email), exectue
[pushToBaseRepo](https://github.com/go-gitea/gitea/blob/74225033413dc0f2b308bbe069f6d185b551e364/services/pull/pull.go#L409)
function and trigger `action` any more when pushing to the `head branch`
of the closed PR.
- Refresh the reference of the PR when reopening the closed PR (**even
if the head branch has been deleted before**). Make the reference of PR
consistent with the `head branch`.

17 months agoFix broken link in tests/e2e/README (#24576)
Steve Russo [Mon, 8 May 2023 00:52:11 +0000 (17:52 -0700)]
Fix broken link in tests/e2e/README (#24576)

17 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 8 May 2023 00:23:39 +0000 (00:23 +0000)]
[skip ci] Updated licenses and gitignores

17 months agoAdd goto issue id function (#24479)
Tyrone Yeh [Sun, 7 May 2023 15:44:16 +0000 (23:44 +0800)]
Add goto issue id function (#24479)

for
https://github.com/go-gitea/gitea/issues/4109#issuecomment-1527104992

Supports format:
`#1234`
`Org/Repo#1234`

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
17 months agoImprove decryption failure message (#24573)
wxiaoguang [Sun, 7 May 2023 11:29:43 +0000 (19:29 +0800)]
Improve decryption failure message (#24573)

Help some users like #16832 #1851

There are many users reporting similar problem: if the SECRET_KEY
mismatches, some operations (like 2FA login) only reports unclear 500
error and unclear "base64 decode error" log (some maintainers ever spent
a lot of time on debugging such problem)

The SECRET_KEY was not well-designed and it is also a kind of technical
debt. Since it couldn't be fixed easily, it's good to add clearer error
messages, then at least users could know what the real problem is.

---------

Co-authored-by: delvh <dev.lh@web.de>
17 months agoSimplify template helper functions (#24570)
wxiaoguang [Sun, 7 May 2023 09:49:46 +0000 (17:49 +0800)]
Simplify template helper functions (#24570)

To avoid bloating the template helper functions, some functions could be
provided by type methods.

And the new code `data-line-type="{{.GetHTMLDiffLineType}}"` reads
better than `data-line-type="{{DiffLineTypeToStr .GetType}}"`

After the fix, screenshots (the same as before):

<details>

![image](https://user-images.githubusercontent.com/2114189/236657918-20ce01e0-1192-443e-aeb4-6b3fe1aa2102.png)

![image](https://user-images.githubusercontent.com/2114189/236657950-ee19727f-a1fc-4133-afc7-e5d1a8c1783f.png)

</details>

17 months agoMakefile: Use portable !, not GNUish -not, with find(1). (#24565)
riastradh [Sun, 7 May 2023 04:41:33 +0000 (04:41 +0000)]
Makefile: Use portable !, not GNUish -not, with find(1). (#24565)

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

Co-authored-by: Taylor R Campbell <campbell+gitea@mumble.net>
17 months agoAdd org visibility label to non-organization's dashboard (#24558)
Hester Gong [Sun, 7 May 2023 00:33:43 +0000 (08:33 +0800)]
Add org visibility label to non-organization's dashboard (#24558)

17 months agoSort users and orgs on explore by recency by default (#24279)
techknowlogick [Sat, 6 May 2023 14:04:55 +0000 (10:04 -0400)]
Sort users and orgs on explore by recency by default (#24279)

This gives more "freshness" to the explore page. So it's not just the
same X users on the explore page by default, now it matches the same
sort as the repos on the explore page.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
17 months agoChange `add_on` translation to `added_on` and include placeholder for the date (...
Yarden Shoham [Sat, 6 May 2023 13:11:27 +0000 (16:11 +0300)]
Change `add_on` translation to `added_on` and include placeholder for the date (#24562)

- Very similar to #24550

The correct thing to do is to translate the entire phrase into a single
string. The previous translation assumed all languages have a space
between the "added on" and the date (and that "added on" comes before
the date).

Some languages, like Hebrew, have no space between the "added on" and
the date. For example:
```ini
added_on=נוסף ב-%s
```
("added" becomes נוסף, "on" is ב and when paired with a date we use a
dash to connect ב with the date)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: delvh <dev.lh@web.de>
17 months agoChange `valid_until` translation to `valid_until_date` and include placeholder for...
Yarden Shoham [Sat, 6 May 2023 12:37:02 +0000 (15:37 +0300)]
Change `valid_until` translation to `valid_until_date` and include placeholder for the date (#24563)

- Similar to #24550
- Similar to #24562

The correct thing to do is to translate the entire phrase into a single
string. The previous translation assumed all languages have a space
between the "valid until" and the date (and that "valid until" comes
before the date).

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoFix docs failing the build on `main` (#24561)
Yarden Shoham [Sat, 6 May 2023 11:52:44 +0000 (14:52 +0300)]
Fix docs failing the build on `main` (#24561)

Regression from https://github.com/go-gitea/gitea/pull/23380

First failing build: https://drone.gitea.io/go-gitea/gitea/74565
https://github.com/go-gitea/gitea/actions/runs/4897332409/jobs/8745242395

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoImprove wiki user title test (#24559)
wxiaoguang [Sat, 6 May 2023 11:24:18 +0000 (19:24 +0800)]
Improve wiki user title test (#24559)

The `..` should be covered by TestUserTitleToWebPath.

Otherwise, if the random string is "..", it causes unnecessary failure
in TestUserWebGitPathConsistency

17 months agoFix incorrect user visibility (#24557)
Zettat123 [Sat, 6 May 2023 10:54:26 +0000 (18:54 +0800)]
Fix incorrect user visibility (#24557)

Fix #24555

17 months agoChange `join_on` translation to `joined_on` and include placeholder for the date...
Yarden Shoham [Sat, 6 May 2023 10:10:30 +0000 (13:10 +0300)]
Change `join_on` translation to `joined_on` and include placeholder for the date (#24550)

The correct thing to do is to translate the entire phrase into a single
string. The previous translation assumed all languages have a space
between the "joined on" and the date (and that "joined on" comes before
the date).

Some languages, like Hebrew, have no space between the "joined on" and
the date. For example:
```ini
joined_on=נרשם ב-%s
```
("joined" becomes נרשם, "on" is ב and when paired with a date we use a
dash to connect ב with the date)

17 months agoRequire at least one unit to be enabled (#24189)
Lunny Xiao [Sat, 6 May 2023 09:39:06 +0000 (17:39 +0800)]
Require at least one unit to be enabled (#24189)

Don't remember why the previous decision that `Code` and `Release` are
non-disable units globally. Since now every unit include `Code` could be
disabled, maybe we should have a new rule that the repo should have at
least one unit. So any unit could be disabled.

Fixes #20960
Fixes #7525

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: yp05327 <576951401@qq.com>
17 months agoFix broken `README` link (#24546)
JakobDev [Sat, 6 May 2023 08:16:06 +0000 (10:16 +0200)]
Fix broken `README` link (#24546)

17 months agoCheck latest version on CI (#24556)
Lunny Xiao [Sat, 6 May 2023 07:43:56 +0000 (15:43 +0800)]
Check latest version on CI (#24556)

17 months agoAdd RPM registry (#23380)
KN4CK3R [Fri, 5 May 2023 20:33:37 +0000 (22:33 +0200)]
Add RPM registry (#23380)

Fixes #20751

This PR adds a RPM package registry. You can follow [this
tutorial](https://opensource.com/article/18/9/how-build-rpm-packages) to
build a *.rpm package for testing.

This functionality is similar to the Debian registry (#22854) and
therefore shares some methods. I marked this PR as blocked because it
should be merged after #22854.

![grafik](https://user-images.githubusercontent.com/1666336/223806549-d8784fd9-9d79-46a2-9ae2-f038594f636a.png)

17 months agoDocs for Gitea Actions (#24405)
Jason Song [Fri, 5 May 2023 20:07:20 +0000 (04:07 +0800)]
Docs for Gitea Actions (#24405)

A new documentation section for Gitea Actions.

Some content comes from:

- [Hacking on Gitea
Actions](https://blog.gitea.io/2023/03/hacking-on-gitea-actions/)
- The README of [act_runner](https://gitea.com/gitea/act_runner)
- @ChristopherHX's excellent overview of the differences between Gitea
Actions and GitHub Actions in [this
comment](https://github.com/go-gitea/gitea/issues/13539#issuecomment-1448888850).

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
17 months agoUpdate LDAP filters to include both username and email address (#24547)
Gary Moon [Fri, 5 May 2023 18:18:53 +0000 (14:18 -0400)]
Update LDAP filters to include both username and email address (#24547)

Since the login form label for user_name unconditionally displays
`Username or Email Address` for the `user_name` field, bring matching
LDAP filters to more prominence in the documentation/placeholders.

Signed-off-by: Gary Moon <gary@garymoon.net>
17 months agoTemporarily disable PATs until next release (#24527)
Kyle D [Fri, 5 May 2023 15:41:44 +0000 (11:41 -0400)]
Temporarily disable PATs until next release (#24527)

This might be a bit contentious, but I think we should try to limit the
impact of deprecating scoped PATs with the rewrite proposed here we're
working on for v1.20: https://github.com/go-gitea/gitea/issues/24501

We should have a PR opened shortly to re-scope the routes.

17 months agoReplace placeholders in licenses (#24354)
Jason Song [Fri, 5 May 2023 13:46:17 +0000 (21:46 +0800)]
Replace placeholders in licenses (#24354)

Replace #22117. Implement it in a more maintainable way.

Some licenses have placeholders e.g. the BSD licenses start with this
line:
```
Copyright (c) <year> <owner>.
```
This PR replaces the placeholders with the correct value when initialize
a new repo.

### FAQ

- Why not use a regex?
It will be a pretty complicated regex which could be hard to maintain.

- There're still missing placeholders.
There are over 500 licenses, it's impossible for anyone to inspect all
of them alone. Please help to add them if you find any, and it is also
OK to leave them for the future.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix the permission of team's `Actions` unit issue (#24536)
sillyguodong [Fri, 5 May 2023 12:02:30 +0000 (20:02 +0800)]
Fix the permission of team's `Actions` unit issue (#24536)

close #24449

The unit of `Actions` should be contorlled not only by
`repository.DISABLED_REPO_UNITS` but also by `actions.ENABLED`
in the `app.ini`.
Previously, the permission of the team's `Actions` unit was not
controlled by `actions.Enabled`. So, even if the user sets
`actions.Enabled` to false, he can still select the permission of the
`Actions` unit for the team.

This PR makes the permissions of the team's `Actions` unit also
controlled by `actions.Enabled`. Just append`TypeActions` into
`DisabledRepoUnits` slice when initializing if `actions.Enabled` is
false.

### Changes:

If `Actions` is set disbaled in `app.ini`, like below:
```yaml
[actions]
ENABLED = false
```

1. If user try to create/edit a team, will prompt user that `Actions` is disabled.

![image](https://user-images.githubusercontent.com/33891828/236370415-961082b2-82d2-4d9e-8025-83872ad08cbb.png)

2. `actions` is not displayed in the sidebar on the team details page

![image](https://user-images.githubusercontent.com/33891828/236371817-f39f9bc9-5926-4b88-b5e6-d93617fcfb07.png)

17 months agoBump golang deps (#24533)
techknowlogick [Fri, 5 May 2023 09:17:19 +0000 (05:17 -0400)]
Bump golang deps (#24533)

17 months agoFix mirrors repository disapeared on user dashboard (#24520)
Lunny Xiao [Fri, 5 May 2023 08:41:21 +0000 (16:41 +0800)]
Fix mirrors repository disapeared on user dashboard (#24520)

Fix regression from #23405

17 months agoRevert "Prevent a user with a different email from accepting the team invite" (#24531)
Lunny Xiao [Fri, 5 May 2023 07:59:12 +0000 (15:59 +0800)]
Revert "Prevent a user with a different email from accepting the team invite" (#24531)

Reverts go-gitea/gitea#24491

17 months agoFix form method/class (#24535)
wxiaoguang [Fri, 5 May 2023 05:14:22 +0000 (13:14 +0800)]
Fix form method/class (#24535)

Fix #24534

17 months agoFix typo in rename branch dialog (#24537)
sillyguodong [Fri, 5 May 2023 04:44:59 +0000 (12:44 +0800)]
Fix typo in rename branch dialog (#24537)

Fix https://github.com/go-gitea/gitea/pull/24512#discussion_r1185664695

17 months agoCheck length of `LogIndexes` in case it is outdated (#24516)
Jason Song [Fri, 5 May 2023 03:37:43 +0000 (11:37 +0800)]
Check length of `LogIndexes` in case it is outdated (#24516)

Fix #24458

17 months agoHarmonize title formatting in `docs/content/doc/development/api-usage.en-us.md` ...
Benjamin Loison [Fri, 5 May 2023 03:11:54 +0000 (05:11 +0200)]
Harmonize title formatting in `docs/content/doc/development/api-usage.en-us.md` (#24529)

17 months agoautomate locking closed threads (#24525)
techknowlogick [Fri, 5 May 2023 02:17:29 +0000 (22:17 -0400)]
automate locking closed threads (#24525)

With comments happening on closed issues/prs this locks issues that have
been closed for >45days. This allows for comments on recently closed
issues/prs to still happen.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 5 May 2023 00:22:45 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoDisplay warning when user try to rename default branch (#24512)
sillyguodong [Thu, 4 May 2023 22:54:38 +0000 (06:54 +0800)]
Display warning when user try to rename default branch (#24512)

Follow #24380

It's better to warn users when they try to rename the default branch.

![image](https://user-images.githubusercontent.com/33891828/236107929-c8ac2854-dd0f-4500-a0a7-800c8fe48861.png)

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoUpgrade to Node 20 on CI, enable actions cancellation (#24524)
silverwind [Thu, 4 May 2023 22:21:48 +0000 (00:21 +0200)]
Upgrade to Node 20 on CI, enable actions cancellation (#24524)

- Upgrade node, the
[snap](https://github.com/go-gitea/gitea/blob/7abe958f5b507efa676fb3b2e27d30517f6d1908/snap/snapcraft.yaml#L47)
is excluded from this because [there is no Node 20 snap
yet](https://snapcraft.io/node).
- Add actions build cancellation based on
[this](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value).

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
17 months agoFix incorrectly quoted translation (#24514)
Lunny Xiao [Thu, 4 May 2023 18:46:47 +0000 (02:46 +0800)]
Fix incorrectly quoted translation (#24514)

Looks like crowdin cannot recognize a value starting with a double quote but
not end with a double quote.

17 months agoFix color for transfer related buttons when having no permission to act (#24510)
Hester Gong [Thu, 4 May 2023 13:21:30 +0000 (21:21 +0800)]
Fix color for transfer related buttons when having no permission to act (#24510)

Before:

<img width="1410" alt="Screen Shot 2023-05-04 at 09 28 23"
src="https://user-images.githubusercontent.com/17645053/236100146-2b64d274-2d79-4b4c-827c-3906a2a9dbb7.png">
<img width="1413" alt="Screen Shot 2023-05-04 at 09 28 30"
src="https://user-images.githubusercontent.com/17645053/236100157-15c12e83-a4f5-4b4e-b26b-73a8ce8bc0db.png">

After:

With no permission:

<img width="1409" alt="Screen Shot 2023-05-04 at 12 17 12"
src="https://user-images.githubusercontent.com/17645053/236144666-c2bb6ca2-59e1-45ae-93cd-d43545500d06.png">
<img width="1402" alt="Screen Shot 2023-05-04 at 12 17 17"
src="https://user-images.githubusercontent.com/17645053/236144677-c51a65cf-8aef-4566-b265-14b2ebb46d0b.png">

With permission:

<img width="1412" alt="Screen Shot 2023-05-04 at 12 16 45"
src="https://user-images.githubusercontent.com/17645053/236144565-9c5aa9a6-1424-49e3-a2b2-a129fecb856c.png">
<img width="1420" alt="Screen Shot 2023-05-04 at 12 16 51"
src="https://user-images.githubusercontent.com/17645053/236144573-a4064136-80d9-4c41-8f98-f51b4352bdf7.png">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoFix some mistakes when using `ignSignIn` (#24415)
wxiaoguang [Thu, 4 May 2023 12:07:15 +0000 (20:07 +0800)]
Fix some mistakes when using `ignSignIn` (#24415)

Some old code doesn't respect the definition of `RequireSignInView` (the
`ignSignIn` is forgotten).

After #24413, this PR will do more fixes, ~~and rename the strange
`ignSignIn` to `optSignIn`.~~

This PR is ready for review, I think we can postpone the "ignSignIn"
renaming to another, to make this PR simple and clear.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoRemove unused zapx replace statement on go.mod (#24515)
Lunny Xiao [Thu, 4 May 2023 10:37:39 +0000 (18:37 +0800)]
Remove unused zapx replace statement on go.mod (#24515)

Fix #23617

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoDon't display creating page button in a mirror wiki repository (#24395)
Lunny Xiao [Thu, 4 May 2023 07:27:15 +0000 (15:27 +0800)]
Don't display creating page button in a mirror wiki repository (#24395)

A mirror repository with wiki is also a mirror. So creating page from UI
should be disabled. This PR hides the button like other places.

17 months agoImprove template system and panic recovery (#24461)
wxiaoguang [Thu, 4 May 2023 06:36:34 +0000 (14:36 +0800)]
Improve template system and panic recovery (#24461)

Partially for #24457

Major changes:

1. The old `signedUserNameStringPointerKey` is quite hacky, use
`ctx.Data[SignedUser]` instead
2. Move duplicate code from `Contexter` to `CommonTemplateContextData`
3. Remove incorrect copying&pasting code `ctx.Data["Err_Password"] =
true` in API handlers
4. Use one unique `RenderPanicErrorPage` for panic error page rendering
5. Move `stripSlashesMiddleware` to be the first middleware
6. Install global panic recovery handler, it works for both `install`
and `web`
7. Make `500.tmpl` only depend minimal template functions/variables,
avoid triggering new panics

Screenshot:

<details>

![image](https://user-images.githubusercontent.com/2114189/235444895-cecbabb8-e7dc-4360-a31c-b982d11946a7.png)

</details>

17 months agoFaster git.GetDivergingCommits (#24482)
oliverpool [Thu, 4 May 2023 05:08:41 +0000 (07:08 +0200)]
Faster git.GetDivergingCommits (#24482)

Using `git rev-list --left-right` is almost 2x faster than calling `git
rev-list` twice.

Co-authored-by: silverwind <me@silverwind.io>
17 months agoMerge setting.InitXXX into one function with options (#24389)
Lunny Xiao [Thu, 4 May 2023 03:55:35 +0000 (11:55 +0800)]
Merge setting.InitXXX into one function with options (#24389)

This PR will merge 3 Init functions on setting packages as 1 and
introduce an options struct.

17 months agoChangelog for 1.19.3 (#24495) (#24506)
Yarden Shoham [Thu, 4 May 2023 02:05:47 +0000 (05:05 +0300)]
Changelog for 1.19.3 (#24495) (#24506)

Frontport #24495

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
17 months agoUse Actions for DB & E2E tests (#24494)
techknowlogick [Thu, 4 May 2023 02:04:02 +0000 (22:04 -0400)]
Use Actions for DB & E2E tests (#24494)

following https://github.com/go-gitea/gitea/pull/24314 and
https://github.com/go-gitea/gitea/pull/24434, this PR moves drone cron
pipelines to (GitHub) Actions. As these are mostly compatible with Gitea
Actions, when we start to dogfood, these will already be migrated.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix intermittent CI failure in EmptyQueue (#23753)
zeripath [Thu, 4 May 2023 01:37:30 +0000 (02:37 +0100)]
Fix intermittent CI failure in EmptyQueue (#23753)

The ordering of the final token causing a close of the queue in this
test may be out of sync due to concurrency. Instead just use ensure that
the queue is closed when everything expected is done.

Fixes: https://github.com/go-gitea/gitea/issues/23608
Fixes: https://github.com/go-gitea/gitea/issues/23977
---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
17 months agoPrevent a user with a different email from accepting the team invite (#24491)
Jack Hay [Thu, 4 May 2023 01:21:58 +0000 (21:21 -0400)]
Prevent a user with a different email from accepting the team invite (#24491)

## Changes
- Fixes the case where a logged in user can accept an email invitation
even if their email address does not match the address in the invitation

17 months agoFix incorrect webhook time and use relative-time to display it (#24477)
yp05327 [Wed, 3 May 2023 23:53:43 +0000 (08:53 +0900)]
Fix incorrect webhook time and use relative-time to display it (#24477)

Fixes #24414
After click replay this webhook, it will display `now`

![image](https://user-images.githubusercontent.com/18380374/235559399-05a23927-13f5-442d-8f10-2c7cd24022a0.png)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoMake Issue/PR/projects more compact, misc CSS tweaks (#24459)
silverwind [Wed, 3 May 2023 21:58:59 +0000 (23:58 +0200)]
Make Issue/PR/projects more compact, misc CSS tweaks (#24459)

- Remove various horizontal dividers on repo pages that didn't provide
visual benefit
- Remove label/milestone pills on single issue/pr page
- Remove issue-related pill buttons on projects page
- Increase contrast of color-secondary on arc-green
- Improve notifications icon, make circle bigger
- Remove some inline styles
- Fix focus in issue/pr title edit and select all text on button click

### Issue and PR before and after

<img width="1249" alt="Screenshot 2023-05-01 at 11 44 22"
src="https://user-images.githubusercontent.com/115237/235436662-a708288e-84fb-4b2e-a5a2-3a1c17d28f6c.png">
<img width="1248" alt="Screenshot 2023-05-01 at 11 58 51"
src="https://user-images.githubusercontent.com/115237/235437992-f863e483-f3cc-4cc1-8204-fd223647a0c9.png">

### Projects before and after

<img width="1255" alt="Screenshot 2023-05-01 at 11 41 02"
src="https://user-images.githubusercontent.com/115237/235436433-0deb85d6-4e7d-4e74-847f-254cc70a0cf9.png">
<img width="1267" alt="Screenshot 2023-05-01 at 11 40 03"
src="https://user-images.githubusercontent.com/115237/235436431-715b13cb-f78c-4d86-b27a-9229f9738c5b.png">

### Releases before and after

<img width="1243" alt="Screenshot 2023-05-01 at 11 41 12"
src="https://user-images.githubusercontent.com/115237/235436457-b655ee6f-03b8-4595-8d8c-b15ea469e988.png">
<img width="1240" alt="Screenshot 2023-05-01 at 11 40 10"
src="https://user-images.githubusercontent.com/115237/235436456-05a2a0dd-7cbb-4f26-b0d3-4f667df4bb95.png">

### Misc

<img width="58" alt="Screenshot 2023-05-01 at 10 49 13"
src="https://user-images.githubusercontent.com/115237/235432494-936ce995-6e22-47bc-ab2d-c9e93d31987d.png">
<img width="57" alt="Screenshot 2023-05-01 at 18 57 08"
src="https://user-images.githubusercontent.com/115237/235492430-1d32cfe0-0f2c-467c-b2fa-925b27e30e0e.png">

Issue title edit and wrap:

<img width="1238" alt="Screenshot 2023-05-01 at 12 34 40"
src="https://user-images.githubusercontent.com/115237/235441407-d5067a57-e586-4865-a652-282e5944abb4.png">
<img width="1232" alt="Screenshot 2023-05-01 at 12 06 24"
src="https://user-images.githubusercontent.com/115237/235438710-1a543dda-220f-4d87-8f93-f1710c0695f0.png">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoImplement Cargo HTTP index (#24452)
KN4CK3R [Wed, 3 May 2023 20:58:43 +0000 (22:58 +0200)]
Implement Cargo HTTP index (#24452)

This implements the HTTP index
[RFC](https://rust-lang.github.io/rfcs/2789-sparse-index.html) for Cargo
registries.

Currently this is a preview feature and you need to use the nightly of
`cargo`:

`cargo +nightly -Z sparse-registry update`

See https://github.com/rust-lang/cargo/issues/9069 for more information.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoClean up polluted styles and remove dead CSS code (#24497)
wxiaoguang [Wed, 3 May 2023 18:32:10 +0000 (02:32 +0800)]
Clean up polluted styles and remove dead CSS code (#24497)

Follow #24393

The funny history:

* At the beginning, `.ui.message` was polluted by `text-align: center`
* Then people do `<div class="ui ... message text left">`
* But `.ui.left` is polluted by `float: left`
* Then people do `#xxx .ui.message { width: 100% !important;}`

The code just becomes more and more hacky.

After removing the pollution,  everything becomes clear and straight.

And, this PR also does:

1. Remove the `package.css`, its styles could be provided by `top
aligned`
2. Remove `#avatar-arrow`, dead code

Screenshot:

![image](https://user-images.githubusercontent.com/2114189/235862130-a9eb5d8f-7d01-457c-99f7-21d0abc3075e.png)

![image](https://user-images.githubusercontent.com/2114189/235862222-139709a7-95c2-4f89-a40f-100b2d76d9bb.png)

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoImprove pull request merge box when pull request merged and branch deleted. (#24397)
Lunny Xiao [Wed, 3 May 2023 13:52:19 +0000 (21:52 +0800)]
Improve pull request merge box when pull request merged and branch deleted. (#24397)

This PR hide the pull request merge box totally if it's merged and branch deleted.

It's also add a bold for merge base commit id in merged message comment

Before:

<img width="989" alt="图片"
src="https://user-images.githubusercontent.com/81045/235066590-28deb506-e824-4a42-a9a2-791cd136756e.png">

After:

<img width="1030" alt="图片"
src="https://user-images.githubusercontent.com/81045/235080749-11d5efe8-a06e-4528-a75f-f6c6d191db50.png">

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoFix EasyMDE toolbar (#24489)
silverwind [Wed, 3 May 2023 05:23:39 +0000 (07:23 +0200)]
Fix EasyMDE toolbar (#24489)

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

The "clean block" button is gone because I could not find a matching
octicon. Order of buttons is roughly equal to textarea.

<img width="824" alt="Screenshot 2023-05-02 at 21 10 00"
src="https://user-images.githubusercontent.com/115237/235762593-ceccb260-e665-4932-ac8a-ef6fe8406a3c.png">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoEnhance stylelint rule config, remove dead CSS (#24472)
silverwind [Wed, 3 May 2023 03:15:52 +0000 (05:15 +0200)]
Enhance stylelint rule config, remove dead CSS (#24472)

Make this stylelint rule match on more properties.

The dead CSS relates to the navbar, which currently has classes:

```
ui top secondary stackable main menu following bar light
```

Which means `.following.bar .top.menu` can never match, so remove this
dead CSS as well as inactive `z-index` and `left` on it.

Commits table striping becomes more visible on dark theme, but I don't
think it's worth introducing a new color until
https://github.com/go-gitea/gitea/pull/24423 is ready, which would have
to remove it again:

<img width="668" alt="Screenshot 2023-05-01 at 18 41 49"
src="https://user-images.githubusercontent.com/115237/235489873-6b272899-1d78-443a-872c-ee7731c269f9.png">
<img width="680" alt="Screenshot 2023-05-01 at 18 41 41"
src="https://user-images.githubusercontent.com/115237/235489878-1b9468af-c74f-48a6-a469-9eba57cfcb4d.png">

17 months agoFix api error message if fork exists (#24487)
Otto Richter (fnetX) [Wed, 3 May 2023 00:26:38 +0000 (02:26 +0200)]
Fix api error message if fork exists (#24487)

On the @Forgejo instance of Codeberg, we discovered that forking a repo
which is already forked now returns a 500 Internal Server Error, which
is unexpected. This is an attempt at fixing this.

The error message in the log:
~~~
2023/05/02 08:36:30 .../api/v1/repo/fork.go:147:CreateFork() [E]
[6450cb8e-113] ForkRepository: repository is already forked by user
[uname: ...., repo path: .../..., fork path: .../...]
~~~

The service that is used for forking returns a custom error message
which is not checked against.

About the order of options:
The case that the fork already exists should be more common, followed by
the case that a repo with the same name already exists for other
reasons. The case that the global repo limit is hit is probably not the
likeliest.

Co-authored-by: Otto Richter <otto@codeberg.org>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd ntlm authentication support for mail (#23811)
木木田 [Tue, 2 May 2023 21:40:46 +0000 (05:40 +0800)]
Add ntlm authentication support for mail (#23811)

Add ntlm authentication support for mail
use "github.com/Azure/go-ntlmssp"

---------

Co-authored-by: yangtan_win <YangTan@Fitsco.com.cn>
Co-authored-by: silverwind <me@silverwind.io>
17 months agoFix test delivery button in repo webhook settings page (#24478)
yp05327 [Tue, 2 May 2023 19:58:18 +0000 (04:58 +0900)]
Fix test delivery button in repo webhook settings page (#24478)

Caused by
https://github.com/go-gitea/gitea/pull/24246/files#diff-2bfe41d93dbb409583a4f945902e46bb513f60f1c9301649c1689200c4f1466eR1

Class `new` was removed in #24246, but in function
`initCompWebHookEditor`, it will check `.new.webhook`.
So in repo webhook settings page, `initCompWebHookEditor` will init
nothing, and no response after click the test delivery button.

https://github.com/go-gitea/gitea/blob/da65b7ad47e8d0d82f47cb24ee9ac2a0ec50dc25/web_src/js/features/comp/WebHookEditor.js#L6-L9

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoAdd Debian package registry (#24426)
KN4CK3R [Tue, 2 May 2023 16:31:35 +0000 (18:31 +0200)]
Add Debian package registry (#24426)

Co-authored-by: @awkwardbunny
This PR adds a Debian package registry.
You can follow [this
tutorial](https://www.baeldung.com/linux/create-debian-package) to build
a *.deb package for testing.
Source packages are not supported at the moment and I did not find
documentation of the architecture "all" and how these packages should be
treated.

![grafik](https://user-images.githubusercontent.com/1666336/218126879-eb80a866-775c-4c8e-8529-5797203a64e6.png)

Part of #20751.

Revised copy of #22854.

---------

Co-authored-by: Brian Hong <brian@hongs.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoEnable whitespace rendering on selection in Monaco (#24444)
silverwind [Tue, 2 May 2023 13:31:38 +0000 (15:31 +0200)]
Enable whitespace rendering on selection in Monaco (#24444)

Remove the
[renderWhitespace](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IEditorOptions.html#renderWhitespace)
override, so the default value of `selection` takes over and makes
whitespace visible on selection.

<img width="128" alt="Screenshot 2023-04-30 at 19 09 41"
src="https://user-images.githubusercontent.com/115237/235366707-d598268d-03cc-4839-a195-c460bddae99b.png">

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agoReplace `N/A` with `-` everywhere (#24474)
silverwind [Tue, 2 May 2023 09:54:29 +0000 (11:54 +0200)]
Replace `N/A` with `-` everywhere (#24474)

Followup to https://github.com/go-gitea/gitea/pull/24427.

Reasoning is that `N/A` is specific to english while `-` is
language-neutral and does not need translation.

Before:
<img width="891" alt="Screenshot 2023-05-01 at 20 58 20"
src="https://user-images.githubusercontent.com/115237/235511592-8a36d0f2-34ff-4dbe-b642-67c0ade644fe.png">

After:
<img width="901" alt="Screenshot 2023-05-01 at 20 59 59"
src="https://user-images.githubusercontent.com/115237/235511594-d49f6d09-92e8-4e99-be7b-2a37f5d24129.png">

17 months agoFix invite display (#24447)
KN4CK3R [Tue, 2 May 2023 07:59:31 +0000 (09:59 +0200)]
Fix invite display (#24447)

Regression of #23901

Before

![grafik](https://user-images.githubusercontent.com/1666336/235371271-f4d06df5-97a0-43bc-b905-5fcdc5666b29.png)

After

![grafik](https://user-images.githubusercontent.com/1666336/235371311-5c03003e-b628-4721-93a6-4e2b1ada4d87.png)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 2 May 2023 00:23:19 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

17 months agoreplace PR docker dry run in drone with Actions (#24475)
techknowlogick [Mon, 1 May 2023 20:39:36 +0000 (16:39 -0400)]
replace PR docker dry run in drone with Actions (#24475)

As before with past PRs to switch Drone pipelines to use (GitHub)
Actions.

---------

Co-authored-by: silverwind <me@silverwind.io>
17 months agocorrect env vars
techknowlogick [Mon, 1 May 2023 18:31:11 +0000 (14:31 -0400)]
correct env vars

17 months agonightly image tag for releases
techknowlogick [Mon, 1 May 2023 18:18:56 +0000 (14:18 -0400)]
nightly image tag for releases

17 months agoRemove `font-awesome` and fomantic `icon` module (#24471)
silverwind [Mon, 1 May 2023 17:25:54 +0000 (19:25 +0200)]
Remove `font-awesome` and fomantic `icon` module (#24471)

Fixes https://github.com/go-gitea/gitea/issues/10410.
This PR removes around 120kB of CSS.

17 months agoImprove "new-menu" (#24465)
wxiaoguang [Mon, 1 May 2023 16:08:37 +0000 (00:08 +0800)]
Improve "new-menu" (#24465)

I am not sure what "new-menu" means, but I think we need to fix these
problems:

1. it shouldn't have "stackable", which makes the items stacked when
width is small. the `new-menu` already has `overflow: auto`
2. `justify-content: center` doesn't work with `overflow: auto` (for
small width), so use `margin: auto`
*
https://bhch.github.io/posts/2021/04/centring-flex-items-and-allowing-overflow-scroll/
3. `runner-new-menu` is dead code (copying & pasting ?)

17 months agoRemove fomantic breadcrumb module (#24463)
silverwind [Mon, 1 May 2023 15:40:02 +0000 (17:40 +0200)]
Remove fomantic breadcrumb module (#24463)

### File path before/after

<img width="522" alt="Screenshot 2023-05-01 at 13 23 33"
src="https://user-images.githubusercontent.com/115237/235445636-57776038-c98e-4cab-8abe-045138a76958.png">
<img width="522" alt="Screenshot 2023-05-01 at 13 24 08"
src="https://user-images.githubusercontent.com/115237/235445638-70bef62a-1b70-41f8-ba51-728db4d54402.png">

### File edit before/after

<img width="499" alt="Screenshot 2023-05-01 at 13 24 46"
src="https://user-images.githubusercontent.com/115237/235445676-7b3cc23e-289b-40a6-8d4f-0d7fb2efb55e.png">
<img width="497" alt="Screenshot 2023-05-01 at 13 24 52"
src="https://user-images.githubusercontent.com/115237/235445677-db9f3974-8456-46de-a32b-9198110c0540.png">

### Cherry-pick before/after

<img width="590" alt="Screenshot 2023-05-01 at 13 25 30"
src="https://user-images.githubusercontent.com/115237/235445717-99445024-1bb2-46d4-9bd8-8086bad57d34.png">
<img width="582" alt="Screenshot 2023-05-01 at 13 25 37"
src="https://user-images.githubusercontent.com/115237/235445720-9c1dc497-eb23-4e10-a727-27f4d6df69e6.png">

17 months agoAdd rerun workflow button and refactor to use SVG octicons (#24350)
yp05327 [Mon, 1 May 2023 14:14:20 +0000 (23:14 +0900)]
Add rerun workflow button and refactor to use SVG octicons (#24350)

Changes:
- Add rerun workflow button. Then users can rerun the whole workflow by
only one-click.
- Refactor to use SVG octicons in RepoActionView.vue

![image](https://user-images.githubusercontent.com/18380374/234736083-dea9b333-ec11-4095-a113-763f3716fba7.png)

![image](https://user-images.githubusercontent.com/18380374/234736107-d657d19c-f70a-42f4-985f-156a8c7efb7a.png)

![image](https://user-images.githubusercontent.com/18380374/234736160-9ad372df-7089-4d18-9bab-48bca3f01878.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 months agoRemove .lgtm and reference to old bot (#24464)
silverwind [Mon, 1 May 2023 12:49:30 +0000 (14:49 +0200)]
Remove .lgtm and reference to old bot (#24464)

Since we now use
[gitea-backporter](https://github.com/GiteaBot/gitea-backporter) for
LGTM, we no longer need this.

17 months agoRemove unnecessary g-menu-stackable-scrollable (#24462)
wxiaoguang [Mon, 1 May 2023 10:51:14 +0000 (18:51 +0800)]
Remove unnecessary g-menu-stackable-scrollable (#24462)

Fix #24460

That's a mistake but ..... no idea why I wrote so ... remove it.

17 months agoReplace remaining fontawesome dropdown icons with SVG (#24455)
silverwind [Mon, 1 May 2023 09:35:02 +0000 (11:35 +0200)]
Replace remaining fontawesome dropdown icons with SVG (#24455)

- Replace leftover dropdown triangles with SVG
- Replace remove icon with SVG and add styling for it:

<img width="817" alt="Screenshot 2023-05-01 at 00 40 05"
src="https://user-images.githubusercontent.com/115237/235379271-4674d4f7-b11e-4d6d-90f9-1478325443ca.png">
<img width="816" alt="Screenshot 2023-05-01 at 00 46 56"
src="https://user-images.githubusercontent.com/115237/235379451-b515afb3-9773-4f6f-a259-e7048235bcba.png">

17 months agoMove links out of translation (#24446)
KN4CK3R [Mon, 1 May 2023 07:17:27 +0000 (09:17 +0200)]
Move links out of translation (#24446)

Addition to
https://github.com/go-gitea/gitea/pull/24426#discussion_r1181261215

I updated all existing translations too because otherwise they would
show something like

> For more information on the Container registry, see [the
documentation](#).%!(EXTRA
string=https://docs.gitea.io/en-us/packages/container/)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
17 months agotarget correct conditional
techknowlogick [Mon, 1 May 2023 04:31:50 +0000 (00:31 -0400)]
target correct conditional

17 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 1 May 2023 00:25:30 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

17 months agoSet stop_on_error (#24453)
KN4CK3R [Sun, 30 Apr 2023 22:31:16 +0000 (00:31 +0200)]
Set stop_on_error (#24453)

Current air version runs the old binary if the build fails. This
restores the old behaviour.

```
...
code.gitea.io/gitea/services/cron
code.gitea.io/gitea/routers/web/user/setting
code.gitea.io/gitea/routers/web/org
make[2]: *** [Makefile:814: gitea] Error 1
make[2]: Leaving directory '/src'
failed to build, error: exit status 2
running...
2023/04/30 21:04:11 cmd/web.go:125:runWeb() [I] Starting Gitea on PID: 29153
2023/04/30 21:04:11 cmd/web.go:178:runWeb() [I] Global init
...
```

Reference: https://github.com/cosmtrek/air/pull/336

17 months agoRemove all direct references to font-awesome (#24448)
Yarden Shoham [Sun, 30 Apr 2023 22:02:56 +0000 (01:02 +0300)]
Remove all direct references to font-awesome (#24448)

- Related #10410
- I had to add an SVG for an empty checkbox
https://github.com/primer/octicons/issues/942

# Before

![image](https://user-images.githubusercontent.com/20454870/235374683-13f355c3-1245-40db-adda-4c710fc80288.png)

# After

![image](https://user-images.githubusercontent.com/20454870/235374655-cc637132-f314-424d-9243-13d45b8915d5.png)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
17 months agoAdd `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442)
silverwind [Sun, 30 Apr 2023 18:58:32 +0000 (20:58 +0200)]
Add `ui-monospace` and `SF Mono` to `--fonts-monospace` (#24442)

- Add `ui-monospace` to support Safari 13.4+.
- Add `SF Mono` variant to support the font on non-mac.
- Quote fonts as per [W3C
recommendation](https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#propdef-font-family).

> it is recommended to quote font family names that contain white space,
digits, or punctuation characters other than hyphens

Fixes: https://github.com/go-gitea/gitea/issues/22125
17 months agoFix incorrect CurrentUser check for docker rootless (#24441)
wxiaoguang [Sun, 30 Apr 2023 18:14:57 +0000 (02:14 +0800)]
Fix incorrect CurrentUser check for docker rootless (#24441)

The IsRunUserMatchCurrentUser logic is fragile, the "SSH" config is not
ready when it executes.

17 months agoFix config list overflow and layout (#24312)
silverwind [Sun, 30 Apr 2023 17:32:07 +0000 (19:32 +0200)]
Fix config list overflow and layout (#24312)

Fixes: https://github.com/go-gitea/gitea/issues/24299
<img width="531" alt="Screenshot 2023-04-24 at 21 05 40"
src="https://user-images.githubusercontent.com/115237/234091905-9db42697-87b3-40a0-bd18-9e910ad8a2ae.png">