]> source.dussan.org Git - gitea.git/log
gitea.git
9 months agoWarn that `DISABLE_QUERY_AUTH_TOKEN` is false only if it's explicitly defined (#28783)
Yarden Shoham [Sun, 14 Jan 2024 20:20:18 +0000 (22:20 +0200)]
Warn that `DISABLE_QUERY_AUTH_TOKEN` is false only if it's explicitly defined (#28783)

So we don't warn on default behavior

- Fixes https://github.com/go-gitea/gitea/issues/28758
- Follows https://github.com/go-gitea/gitea/pull/28390

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
9 months agoSpeed up loading the dashboard on mysql/mariadb (#28546)
Lunny Xiao [Sun, 14 Jan 2024 14:34:25 +0000 (22:34 +0800)]
Speed up loading the dashboard on mysql/mariadb (#28546)

Fixes #28155

9 months agoFix schedule tasks bugs (#28691)
Lunny Xiao [Fri, 12 Jan 2024 21:50:38 +0000 (05:50 +0800)]
Fix schedule tasks bugs (#28691)

Fix #28157

This PR fix the possible bugs about actions schedule.

## The Changes

- Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to
service layer
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when actions unit has been disabled
or global disabled.
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when default branch changed.

9 months agoAdd tests for #28765 (#28773)
Jack Hay [Fri, 12 Jan 2024 17:15:42 +0000 (12:15 -0500)]
Add tests for #28765 (#28773)

Adds tests to cover changes made in #28765

9 months agoFix issue dependencies (#27736)
Nanguan Lin [Fri, 12 Jan 2024 16:49:02 +0000 (00:49 +0800)]
Fix issue dependencies (#27736)

Fix #27722
Fix #27357
Fix #25837
1. Fix the typo `BlockingByDependenciesNotPermitted`, which causes the
`not permitted message` not to show. The correct one is `Blocking` or
`BlockedBy`
2. Rewrite the perm check. The perm check uses a very tricky way to
avoid duplicate checks for a slice of issues, which is confusing. In
fact, it's also the reason causing the bug. It uses `lastRepoID` and
`lastPerm` to avoid duplicate checks, but forgets to assign the
`lastPerm` at the end of the code block. So I rewrote this to avoid this
trick.
![I U1AT{GNFY3
1HZ`6L{(2L](https://github.com/go-gitea/gitea/assets/70063547/79acd02a-a567-4316-ae0d-11c6461becf1)
3. It also reuses the `blocks` slice, which is even more confusing. So I
rewrote this too.

![UARFPXRGGZQFB7J$2`R}5_R](https://github.com/go-gitea/gitea/assets/70063547/f21cff0f-d9ac-4ce4-ae4d-adffc98ecd99)

9 months agoAssign pull request to project during creation (#28227)
Denys Konovalov [Fri, 12 Jan 2024 15:25:15 +0000 (16:25 +0100)]
Assign pull request to project during creation (#28227)

When creating a pull request, allow directly assigning it to a project,
as it is already possible for issues.

After:

![grafik](https://github.com/go-gitea/gitea/assets/47871822/01dc2b3d-d56a-4053-b2fc-138725d7633a)

9 months agoFix button size in "attached header right" (#28770)
wxiaoguang [Fri, 12 Jan 2024 14:43:40 +0000 (22:43 +0800)]
Fix button size in "attached header right" (#28770)

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/c82f8615-04d4-408f-95bf-689c227a8814)

![image](https://github.com/go-gitea/gitea/assets/2114189/d01d05a7-09ca-48f3-a0e7-fec48119b426)

</details>

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/e560398e-2fa4-4f46-9229-f6acc70e32ab)

![image](https://github.com/go-gitea/gitea/assets/2114189/bd18961d-0636-4584-b893-c465daaf40af)

9 months agoImprove CSS helper naming (#28769)
wxiaoguang [Fri, 12 Jan 2024 12:28:01 +0000 (20:28 +0800)]
Improve CSS helper naming (#28769)

* `gt-w-100` => `gt-w-full` to match tailwind
* clarify `gt-hidden` priority

9 months agoRevamp repo header (#27760)
Denys Konovalov [Fri, 12 Jan 2024 03:44:06 +0000 (04:44 +0100)]
Revamp repo header (#27760)

Redesign repo header with following new aspects:
- responsive & better-looking repo title
- hide repo button text instead of icons in mobile view
- use same tab style as on explore and org page

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

![grafik](https://github.com/go-gitea/gitea/assets/47871822/57360b77-d43c-49ac-b798-2363c03da7ec)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/d4117f79-a5f5-4f36-bf65-bbada3e7e73b)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/e26f967f-e264-4337-9925-3d942e04fd6d)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/b4683c8d-9c6a-4089-afa7-8dd219e43a46)

</details>

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

![grafik](https://github.com/go-gitea/gitea/assets/47871822/8ddbc9f6-53c7-4e4e-bea9-704fd93524ca)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/c0588aa9-788d-469c-98a0-81484fbd220c)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/206e931e-404d-4d1b-92ce-908698addfcc)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/a508f9c8-fadc-4a85-94ba-18796f77e07b)

9 months agoSupport for grouping RPMs using paths (#26984)
Exploding Dragon [Fri, 12 Jan 2024 03:16:05 +0000 (11:16 +0800)]
Support for grouping RPMs using paths (#26984)

The current rpm repository places all packages in the same repository,
and different systems (el7,f34) may hit packages that do not belong to
this distribution ( #25304 ) , which now supports grouping of rpm.

![图片](https://github.com/go-gitea/gitea/assets/33776693/d1e1d99f-7799-4b2b-a19b-cb2a5c692914)

Fixes #25304 .
Fixes #27056 .

Refactor: [#25866](https://github.com/go-gitea/gitea/pull/25866)

9 months agoRequire token for GET subscription endpoint (#28765)
Jack Hay [Fri, 12 Jan 2024 01:57:58 +0000 (20:57 -0500)]
Require token for GET subscription endpoint (#28765)

Fixes  #28756

## Changes
- Require and check API token for `GET
/repos/{owner}/{repo}/subscription` in order to populate `ctx.Doer`.

9 months agoFix `convert.ToTeams` on empty input (#28426)
KN4CK3R [Thu, 11 Jan 2024 22:12:08 +0000 (23:12 +0100)]
Fix `convert.ToTeams` on empty input (#28426)

Fixes #28420

Don't return `nil` if the input was empty.

9 months agoShow description as tooltip instead of title for labels (#28754)
delvh [Thu, 11 Jan 2024 16:21:52 +0000 (17:21 +0100)]
Show description as tooltip instead of title for labels (#28754)

Follow GitHubs behavior of showing the label description as a tooltip
instead of the browser native title.

## Before

![grafik](https://github.com/go-gitea/gitea/assets/51889757/70448327-467b-4bee-b799-40a442a5ce16)

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/abe7d700-148b-4cef-a487-6b0f8f20b212)

9 months agoIntegration Test for Commit Search containing Square Brackets (#28751)
Mihir Joshi [Thu, 11 Jan 2024 03:04:45 +0000 (08:34 +0530)]
Integration Test for Commit Search containing Square Brackets (#28751)

Integration test for #28744

Change keywords commit search flag from `-F` to `--fixed-strings` for
readability

9 months agoHide code related setting options in repository when code unit is disabled (#28631)
Lunny Xiao [Wed, 10 Jan 2024 11:55:59 +0000 (19:55 +0800)]
Hide code related setting options in repository when code unit is disabled (#28631)

Since #20805, code can be hidden.
However, the related settings are still shown even though they don't
have any meaning then.

https://github.com/go-gitea/gitea/assets/81045/5fdee54d-ac81-418a-82f7-eadff048cedd

9 months agoAdd -F to commit search to treat keywords as strings (#28744)
Mihir Joshi [Wed, 10 Jan 2024 11:28:20 +0000 (16:58 +0530)]
Add -F to commit search to treat keywords as strings (#28744)

Fixes #28269

The [default
behavior](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp)
of --grep in git log is to interpret the keyword as a regular
expression. This causes the search to fail in the cases where the search
keyword contains a `[`, since `[` is a special character used in grep.

If we want our keywords to be interpreted as 'strings', we should use
[-F
flag](https://git-scm.com/docs/git-log#Documentation/git-log.txt---basic-regexp).

9 months agoRecommend/convert to use case-sensitive collation for MySQL/MSSQL (#28662)
wxiaoguang [Wed, 10 Jan 2024 11:03:23 +0000 (19:03 +0800)]
Recommend/convert to use case-sensitive collation for MySQL/MSSQL (#28662)

Mainly for MySQL/MSSQL.

It is important for Gitea to use case-sensitive database charset
collation. If the database is using a case-insensitive collation, Gitea
will show startup error/warning messages, and show the errors/warnings
on the admin panel's Self-Check page.

Make `gitea doctor convert` work for MySQL to convert the collations of
database & tables & columns.

* Fix #28131

## :warning: BREAKING :warning:

It is not quite breaking, but it's highly recommended to convert the
database&table&column to a consistent and case-sensitive collation.

9 months agoAdd download attribute to release attachments (#28739)
JakobDev [Tue, 9 Jan 2024 08:51:20 +0000 (09:51 +0100)]
Add download attribute to release attachments (#28739)

Fixes #28736

9 months agoConcatenate error in `checkIfPRContentChanged` (#28731)
Earl Warren [Tue, 9 Jan 2024 02:32:14 +0000 (03:32 +0100)]
Concatenate error in `checkIfPRContentChanged` (#28731)

- If there's a error with the Git command in `checkIfPRContentChanged`
the stderr wasn't concatendated to the error, which results in still not
knowing why an error happend.
- Adds concatenation for stderr to the returned error.
- Ref: https://codeberg.org/forgejo/forgejo/issues/2077

Co-authored-by: Gusted <postmaster@gusted.xyz>
9 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 8 Jan 2024 00:26:06 +0000 (00:26 +0000)]
[skip ci] Updated licenses and gitignores

9 months agoMove the captcha script loader to the template which really needs it (#28718)
wxiaoguang [Sun, 7 Jan 2024 15:41:46 +0000 (23:41 +0800)]
Move the captcha script loader to the template which really needs it (#28718)

It improves the maintainability for the templates.

Now `base/footer.tmpl` doesn't need to depend on "captcha" feature.

9 months agoSuggest to use Type=simple for systemd service (#28717)
wxiaoguang [Sun, 7 Jan 2024 15:18:04 +0000 (23:18 +0800)]
Suggest to use Type=simple for systemd service (#28717)

Although the systemd notify support was added, it seems that there are
some problems (#28553, for the "non-installed" instance)

9 months agoFix incorrect URL for "Reference in New Issue" (#28716)
wxiaoguang [Sun, 7 Jan 2024 10:50:03 +0000 (18:50 +0800)]
Fix incorrect URL for "Reference in New Issue" (#28716)

Gitea prefers to use relative URLs in code (to make multiple domain work
for some users)

So it needs to use `toAbsoluteUrl` to generate a full URL when click
"Reference in New Issues"

And add some comments in the test code

9 months agoAvoid unnecessary 500 panic when a commit doesn't exist (#28719)
wxiaoguang [Sun, 7 Jan 2024 10:20:22 +0000 (18:20 +0800)]
Avoid unnecessary 500 panic when a commit doesn't exist (#28719)

In #26851, it assumed that `Commit` always exists when
`PageIsDiff==true`.

But for a 404 page, the `Commit` doesn't exist, so the following code
would cause panic because nil value can't be passed as string parameter
to `IsMultilineCommitMessage(string)` (or the StringUtils.Cut in later
PRs)

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 7 Jan 2024 00:27:22 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoImprove frontend guideline (#28711)
wxiaoguang [Sat, 6 Jan 2024 17:14:10 +0000 (01:14 +0800)]
Improve frontend guideline (#28711)

It has been a consensus for long time during reviewing: "avoiding inline
styles as much as possible".

9 months agoFix panic when parsing empty pgsql host (#28708)
wxiaoguang [Sat, 6 Jan 2024 09:30:03 +0000 (17:30 +0800)]
Fix panic when parsing empty pgsql host (#28708)

Regression of #27723
Fix #28705

9 months agoAdd merge arrow direction and update styling (#28523)
Kyle D [Fri, 5 Jan 2024 17:38:56 +0000 (09:38 -0800)]
Add merge arrow direction and update styling (#28523)

Close https://github.com/go-gitea/gitea/issues/28522

~Adds some [negative
margin](https://tailwindcss.com/docs/margin#using-negative-values)
helper css classes using tailwind's [prefix
syntax](https://tailwindcss.com/docs/configuration#prefix)~

### Before

![image](https://github.com/go-gitea/gitea/assets/12700993/5bdabf91-facd-41c8-8e36-e1535beb9409)

### After

![image](https://github.com/go-gitea/gitea/assets/12700993/a6f11f6f-9e64-45b6-b9d7-dfea53fbc6d7)

9 months agoAdd links to owner home page in explore (#28341)
yp05327 [Fri, 5 Jan 2024 03:34:35 +0000 (11:34 +0800)]
Add links to owner home page in explore (#28341)

User can select access repo or owner's home page.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/f40a833f-8560-4585-b047-3a225be2e6ee)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/7893bf3a-5050-4bcb-af99-d56d6c7925f8)

9 months agoApply min-height in wiki only on preview pane (#28687)
Earl Warren [Thu, 4 Jan 2024 02:48:55 +0000 (03:48 +0100)]
Apply min-height in wiki only on preview pane (#28687)

In the commit 5a56f9699c (3.) the min-height was applied to all wiki
elements. This resulted in huge blank spaces when viewing the wiki.

This fixes this by only applying the min-height to the preview when
editing.

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

(cherry picked from commit 8f0baefe5dadc929fe7456c36c8b205e96f228f0)

Co-authored-by: Fl1tzi <git@fl1tzi.com>
9 months agoNormalize oauth email username (#28561)
Kyle D [Thu, 4 Jan 2024 00:48:20 +0000 (16:48 -0800)]
Normalize oauth email username (#28561)

9 months agoFix wrapping of label list (#28684)
Denys Konovalov [Wed, 3 Jan 2024 12:33:55 +0000 (13:33 +0100)]
Fix wrapping of label list (#28684)

The label list needs to wrap the items to avoid unnecessary overflow / incorrect text wrapping.

9 months agoFix grammar in `actions.variables.id_not_exist` (en-US) (#28680)
wackbyte [Wed, 3 Jan 2024 10:43:38 +0000 (05:43 -0500)]
Fix grammar in `actions.variables.id_not_exist` (en-US) (#28680)

Fixes the capitalization and grammar of the key.

9 months agoFix grammar issues on the repository Actions page (en-US) (#28679)
wackbyte [Wed, 3 Jan 2024 10:42:56 +0000 (05:42 -0500)]
Fix grammar issues on the repository Actions page (en-US) (#28679)

Fixes a few grammar issues in the en-US localization of the repository
Actions page.

9 months agoFix tooltip of variable edit button (#28681)
wackbyte [Wed, 3 Jan 2024 06:25:19 +0000 (01:25 -0500)]
Fix tooltip of variable edit button (#28681)

The `variables.edit` key does not exist.

![image](https://github.com/go-gitea/gitea/assets/29505620/462a1c6c-775c-466a-8398-37115b2af47a)

9 months agoMake cross-reference issue links work in markdown documents again (#28682)
Brecht Van Lommel [Wed, 3 Jan 2024 06:01:12 +0000 (07:01 +0100)]
Make cross-reference issue links work in markdown documents again (#28682)

In #26365 issue references were disabled entirely for documents,
intending to match GitHub behavior. However cross-references do appear
to work in documents on GitHub.

This is useful for example to write release notes in a markdown document
and reference issues. While the simpler syntax may create links when not
intended, hopefully the cross-reference syntax is unique enough to avoid
it.

9 months agoMake template `DateTime` show proper tooltip (#28677)
wxiaoguang [Tue, 2 Jan 2024 19:09:18 +0000 (03:09 +0800)]
Make template `DateTime` show proper tooltip (#28677)

There was a question about "how to improve the datetime display for
SSH/PGP/WebAuthn"
https://github.com/go-gitea/gitea/pull/28262#issuecomment-1831141611

The root problem is that `DateTime` misses the "data-tooltip-content"
attribute, which should be used to make the tooltip popup smoothly.

Now the UI is consistent and the end users could see the detailed
hour/minute/second easily by hovering the element.

![image](https://github.com/go-gitea/gitea/assets/2114189/2211336f-d59d-4f64-a83b-099f8ef6d29b)

![image](https://github.com/go-gitea/gitea/assets/2114189/f02a9c86-476d-48d6-aece-85a800235fbd)

9 months agoAdd global setting how timestamps should be rendered (#28657)
Yarden Shoham [Tue, 2 Jan 2024 01:25:30 +0000 (03:25 +0200)]
Add global setting how timestamps should be rendered (#28657)

- Resolves https://github.com/go-gitea/gitea/issues/22493
- Related to https://github.com/go-gitea/gitea/issues/4520

Some admins prefer all timestamps to display the full date instead of
relative time. They can do that now by setting

```ini
[ui]
PREFERRED_TIMESTAMP_TENSE = absolute
```

This setting is set to `mixed` by default, allowing dates to render as
"5 hours ago". Here are some screenshots of the UI with this setting set
to `absolute`:

![image](https://github.com/go-gitea/gitea/assets/20454870/f496457f-6afa-44be-a1e7-249ee5fe0706)

![image](https://github.com/go-gitea/gitea/assets/20454870/c03b14f5-063d-4e13-9780-76ab002d76a9)

![image](https://github.com/go-gitea/gitea/assets/20454870/f4b34e28-1546-4374-9199-c43348844edd)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: delvh <dev.lh@web.de>
9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 1 Jan 2024 00:27:55 +0000 (00:27 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoUpgrade xorm to new version which supported update join for all supported databases...
Lunny Xiao [Sun, 31 Dec 2023 05:00:35 +0000 (13:00 +0800)]
Upgrade xorm to new version which supported update join for all supported databases (#28590)

Fix https://github.com/go-gitea/gitea/pull/28547#issuecomment-1867740842

Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports
UPDATE JOIN.
To keep consistent from different databases, xorm use
`engine.Join().Update`, but the actural generated SQL are different
between different databases.

For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx
Where xxx`.

For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE
join_conditions`.

For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support
`UPDATE table1 SET xxx FROM table2 WHERE join conditions` from
3.33.0(2020-8-14).

POSTGRES is the same as SQLITE.

9 months agoFix: system webhooks API bug (#28531)
vincent [Sun, 31 Dec 2023 04:31:50 +0000 (12:31 +0800)]
Fix: system webhooks API bug (#28531)

- Fix the bug about admin/hooks API that `GET /admin/hooks` can only
fetch system_hooks, `POST /admin/hooks` can only create default_hooks.

9 months agoFix alpine package files are not rebuilt (#28638)
Nanguan Lin [Sun, 31 Dec 2023 04:08:46 +0000 (12:08 +0800)]
Fix alpine package files are not rebuilt (#28638)

I noticed the `BuildAllRepositoryFiles` function under the Alpine folder
is unused and I thought it was a bug.
But I'm not sure about this. Was it on purpose?

9 months agoFix migration test (#28659)
Lunny Xiao [Sat, 30 Dec 2023 13:54:48 +0000 (21:54 +0800)]
Fix migration test (#28659)

9 months agoAvoid cycle-redirecting user/login page (#28636)
wxiaoguang [Sat, 30 Dec 2023 08:48:34 +0000 (16:48 +0800)]
Avoid cycle-redirecting user/login page (#28636)

Fix #28231, and remove some unused code. The `db.HasEngine` doesn't seem
useful because the db engine is always initialized before web route.

9 months agoFix long package version names overflowing (#28619)
Mihir Joshi [Sat, 30 Dec 2023 07:42:16 +0000 (13:12 +0530)]
Fix long package version names overflowing (#28619)

Fixes #28534

---
Before:

![image](https://github.com/go-gitea/gitea/assets/50193156/b229551c-0a7d-4a99-9553-1f11b994876a)

After:
<img width="304" alt="image"
src="https://github.com/go-gitea/gitea/assets/50193156/53d04ad0-6d5c-47e2-8a7d-30a4d5dd9959">

Should we also apply this for long filenames in Assets?
It looks like this currently:
<img width="285" alt="image"
src="https://github.com/go-gitea/gitea/assets/50193156/e2dcbb2e-30d5-4e35-b304-6274ef60bda7">

---------

Co-authored-by: Mihir <mihir.joshi@senpiper.com>
9 months agoUpdate JS dependencies (#28537)
silverwind [Sat, 30 Dec 2023 05:29:03 +0000 (06:29 +0100)]
Update JS dependencies (#28537)

- Update all JS dependencies excluding mcaptcha (breaking changes) and
stylelint (plugin not compatible with v16)
- Regenerate SVGs
- Update markdownlint rule names
- Fix one issue of heading in markdown discovered during lint
- Update for monaco options renames
- Fix stylelint rule length-zero-no-unit for custom properties
- Tested editor, swagger, sorting, vue, lint

9 months agoImprove document for ARTIFACT_RETENTION_DAYS (#28646)
wxiaoguang [Fri, 29 Dec 2023 06:44:58 +0000 (14:44 +0800)]
Improve document for ARTIFACT_RETENTION_DAYS (#28646)

Follow #28626

9 months agofix empty ref for cron workflow runs (#28640)
Denys Konovalov [Fri, 29 Dec 2023 06:18:57 +0000 (07:18 +0100)]
fix empty ref for cron workflow runs (#28640)

Fix #27678
Please see
https://github.com/go-gitea/gitea/issues/27678#issuecomment-1871445853
for details.

9 months agoImprove 1.22 document for Database Preparation (#28643)
wxiaoguang [Fri, 29 Dec 2023 05:42:22 +0000 (13:42 +0800)]
Improve 1.22 document for Database Preparation (#28643)

Fix #28247

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 29 Dec 2023 00:20:25 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoswitch destination directory for apt signing keys (#28639)
Denys Konovalov [Thu, 28 Dec 2023 21:08:59 +0000 (22:08 +0100)]
switch destination directory for apt signing keys (#28639)

According to [Debian
docs](https://wiki.debian.org/DebianRepository/UseThirdParty):

> The certificate MUST NOT be placed in /etc/apt/trusted.gpg.d or loaded
by apt-key add.
> ...
> If future updates to the certificate will be managed by an apt/dpkg
package as recommended below, then it SHOULD be downloaded into
/usr/share/keyrings using the same filename that will be provided by the
package. If it will be managed locally , it SHOULD be downloaded into
/etc/apt/keyrings instead.
> ...
> A sources.list entry SHOULD have the signed-by option set.

9 months agoExtend description for ARTIFACT_RETENTION_DAYS (#28626)
Gerd Katzenbeisser [Thu, 28 Dec 2023 10:11:44 +0000 (11:11 +0100)]
Extend description for ARTIFACT_RETENTION_DAYS (#28626)

Make it clear that this value is just a default value and that every
artifact can have it's own value.

9 months agoRefactor timeutil package (#28623)
wxiaoguang [Thu, 28 Dec 2023 10:09:57 +0000 (18:09 +0800)]
Refactor timeutil package (#28623)

1. make names more readable
2. remove unused FormatLong/FormatShort
3. use `FormatDate` instead of `Format "2006-01-02"`

9 months agoRefactor some legacy code and remove unused code (#28622)
wxiaoguang [Thu, 28 Dec 2023 09:38:59 +0000 (17:38 +0800)]
Refactor some legacy code and remove unused code (#28622)

1. use slices.Contains, remove Int64sContains
2. use HashEmail, remove base.EncodeMD5
3. remove BasicAuthEncode, IsLetter

9 months agoRemove unnecessary syncbranchToDB with tests (#28624)
Lunny Xiao [Thu, 28 Dec 2023 07:28:57 +0000 (15:28 +0800)]
Remove unnecessary syncbranchToDB with tests (#28624)

#28361 introduced `syncBranchToDB` in `CreateNewBranchFromCommit`. This
PR will revert the change because it's unnecessary. Every push will
already be checked by `syncBranchToDB`.
This PR also created a test to ensure it's right.

9 months agoDo not set `Accept` header twice (#28598)
KN4CK3R [Thu, 28 Dec 2023 03:59:00 +0000 (04:59 +0100)]
Do not set `Accept` header twice (#28598)

Revert #28550

Don't add the `Accept` header twice.

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 28 Dec 2023 00:24:21 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

9 months agofix wrong link in user and organization profile when using relative url (#28617)
katsu [Wed, 27 Dec 2023 08:32:27 +0000 (16:32 +0800)]
fix wrong link in user and organization profile when using relative url (#28617)

fix #28436.
the doc https://docs.gitea.com/usage/profile-readme maybe also need to
be updated to tell that
the main branch is necessary,which means the following three conditions
should be satisfied:
- repo: **.profile**
- branch: **[default branch]**
- markdown: **README.md**

9 months agoAdd get actions runner registration token for API routes, repo, org, user and global...
Lunny Xiao [Wed, 27 Dec 2023 07:57:54 +0000 (15:57 +0800)]
Add get actions runner registration token for API routes, repo, org, user and global level (#27144)

Replace #23761

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
9 months agoFix session key conflict with database keyword (#28613)
Lunny Xiao [Wed, 27 Dec 2023 07:24:23 +0000 (15:24 +0800)]
Fix session key conflict with database keyword (#28613)

This is a regression from #28220 .
`builder.Cond` will not add `` ` `` automatically but xorm method
`Get/Find` adds `` ` ``.

This PR also adds tests to prevent the method from being implemented
incorrectly. The tests are added in `integrations` to test every
database.

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 27 Dec 2023 00:23:45 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoUse known issue IID to generate new PR index number when migrating from GitLab (...
wxiaoguang [Tue, 26 Dec 2023 17:57:25 +0000 (01:57 +0800)]
Use known issue IID to generate new PR index number when migrating from GitLab (#28616)

Fix #13884

9 months agoUpdate repo-mirror.en-us.md (#28612)
Volodymyr Stelmashchuk [Tue, 26 Dec 2023 16:36:11 +0000 (18:36 +0200)]
Update repo-mirror.en-us.md (#28612)

Add small changes to the doc. The workflow scope require for push code
to github mirror in case the project use the github action compatibility
ui.

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 26 Dec 2023 00:24:05 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoRefactor deletion (#28610)
delvh [Mon, 25 Dec 2023 20:25:29 +0000 (21:25 +0100)]
Refactor deletion (#28610)

Introduce the new generic deletion methods
- `func DeleteByID[T any](ctx context.Context, id int64) (int64, error)`
- `func DeleteByIDs[T any](ctx context.Context, ids ...int64) error`
- `func Delete[T any](ctx context.Context, opts FindOptions) (int64,
error)`

So, we no longer need any specific deletion method and can just use
the generic ones instead.

Replacement of #28450

Closes #28450

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
9 months agoRefactor CORS handler (#28587)
wxiaoguang [Mon, 25 Dec 2023 12:13:18 +0000 (20:13 +0800)]
Refactor CORS handler (#28587)

The CORS code has been unmaintained for long time, and the behavior is
not correct.

This PR tries to improve it. The key point is written as comment in
code. And add more tests.

Fix #28515
Fix #27642
Fix #17098

9 months agoAdded instance-level variables (#28115)
Jean-Baptiste Gomond [Mon, 25 Dec 2023 07:28:59 +0000 (08:28 +0100)]
Added instance-level variables (#28115)

This PR adds instance-level variables, and so closes #27726

![gitea_instance_variables_1](https://github.com/go-gitea/gitea/assets/8344487/ad409cd4-ce36-4c84-a764-34451b0fb63a)

![gitea_instance_variables_2](https://github.com/go-gitea/gitea/assets/8344487/426f0965-dec6-4560-948c-067cdeddd720)

![gitea_instance_variables_3](https://github.com/go-gitea/gitea/assets/8344487/cf1d7776-4938-4825-922e-cbbbf28a5f33)

9 months agoRevert "improve possible performance bottleneck (#28547)" (#28593)
Lunny Xiao [Mon, 25 Dec 2023 06:52:17 +0000 (14:52 +0800)]
Revert "improve possible performance bottleneck (#28547)" (#28593)

This reverts commit b35d3fddfac389a7be401a63b4e1283dd74af681.

This is totally wrong. I think `Update join` hasn't been supported well
by xorm.

I just revert the PR and will try to send another one.

9 months ago[skip ci] Updated licenses and gitignores
GiteaBot [Mon, 25 Dec 2023 00:25:23 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

9 months agoFix flex container width (#28603)
wxiaoguang [Sun, 24 Dec 2023 14:39:02 +0000 (22:39 +0800)]
Fix flex container width (#28603)

Fix #28489

9 months agoFix the scroll behavior for emoji/mention list (#28597)
wxiaoguang [Sun, 24 Dec 2023 05:08:41 +0000 (13:08 +0800)]
Fix the scroll behavior for emoji/mention list (#28597)

Fix #28595 by https://github.com/github/combobox-nav/pull/79 (combobox-nav v2.3.1)

9 months agobump to use alpine3.19 (#28594)
techknowlogick [Sat, 23 Dec 2023 21:04:58 +0000 (16:04 -0500)]
bump to use alpine3.19 (#28594)

9 months agoInclude heap pprof in diagnosis report to help debugging memory leaks (#28596)
wxiaoguang [Sat, 23 Dec 2023 19:06:02 +0000 (03:06 +0800)]
Include heap pprof in diagnosis report to help debugging memory leaks (#28596)

9 months agoDisable query token param in integration tests (#28592)
Kyle D [Sat, 23 Dec 2023 03:29:51 +0000 (22:29 -0500)]
Disable query token param in integration tests (#28592)

Follow up to https://github.com/go-gitea/gitea/pull/28484, this PR
enables the setting for integration tests and migrates a few additional
test queries.

9 months agoFix wrong due date rendering in issue list page (#28588)
Yarden Shoham [Fri, 22 Dec 2023 16:53:12 +0000 (18:53 +0200)]
Fix wrong due date rendering in issue list page (#28588)

It included the hours, minutes, and seconds. By removing these, the date
renders correctly.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
9 months agoFix `status_check_contexts` matching bug (#28582)
Zettat123 [Fri, 22 Dec 2023 13:29:50 +0000 (21:29 +0800)]
Fix `status_check_contexts` matching bug (#28582)

Fix #28570
Follow #24633

---
Copied from
https://github.com/go-gitea/gitea/issues/28570#issuecomment-1867327999

The feature introduced in #24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.

https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663

9 months agoFix 405 method not allowed CORS / OIDC (#28583)
morphelinho [Fri, 22 Dec 2023 12:23:24 +0000 (13:23 +0100)]
Fix 405 method not allowed CORS / OIDC (#28583)

Follow #28184
Follow #28515

Fix problem with 405 method not allowed for CORS wrt OIDC

9 months agoAdd more ways to try (#28581)
Jason Song [Fri, 22 Dec 2023 06:20:59 +0000 (14:20 +0800)]
Add more ways to try (#28581)

9 months agoConvert to url auth to header auth in tests (#28484)
KN4CK3R [Thu, 21 Dec 2023 23:59:59 +0000 (00:59 +0100)]
Convert to url auth to header auth in tests (#28484)

Related #28390

9 months agoFix 500 error of searching commits (#28576)
wxiaoguang [Thu, 21 Dec 2023 23:09:14 +0000 (07:09 +0800)]
Fix 500 error of searching commits (#28576)

Regression of #28454 . Now the string is escaped HTML, so it doesn't
need `| Safe`.

Fix #28575

9 months agoimprove possible performance bottleneck (#28547)
Lunny Xiao [Thu, 21 Dec 2023 22:25:57 +0000 (06:25 +0800)]
improve possible performance bottleneck (#28547)

Replace #28500

---------

Co-authored-by: Giteabot <teabot@gitea.io>
9 months agoUse information from previous blame parts (#28572)
KN4CK3R [Thu, 21 Dec 2023 21:48:18 +0000 (22:48 +0100)]
Use information from previous blame parts (#28572)

Fixes #28545

`git blame` output can contain blocks without commit information if it
was outputted before (the `0dafa97ea3f6d9662299579e5be1875cd28baaae 48
26 1` line):
```
fec25436488499df7231f63b857f66457c193d5c 24 25 1
author Bastien Montagne
author-mail <bastien@blender.org>
author-time 1660731031
author-tz +0200
committer Bastien Montagne
committer-mail <bastien@blender.org>
committer-time 1660731031
committer-tz +0200
summary LibOverride: Add Make/Reset/Clear entries to IDTemplate contextual menu.
previous 839ece6477203382b7a7483062961540180ff1cd source/blender/editors/interface/interface_ops.c
filename source/blender/editors/interface/interface_ops.c
        #include "BLT_translation.h"
0dafa97ea3f6d9662299579e5be1875cd28baaae 48 26 1

3d57bc4397fca53bc9702a27bbf50102827829b0 27 27 1
author Hans Goudey
author-mail <hans@blender.org>
author-time 1700131315
author-tz +0100
committer Hans Goudey
committer-mail <hooglyboogly@noreply.localhost>
committer-time 1700131315
committer-tz +0100
summary Cleanup: Move several blenkernel headers to C++
previous 451c054d9b7d3148a646caa5a72fb127a5b5c408 source/blender/editors/interface/interface_ops.cc
filename source/blender/editors/interface/interface_ops.cc
        #include "BKE_context.hh"
```
This PR reuses data from the previous blame part to fill these gaps.

9 months agoMake offline mode as default to no connect external avatar service by default (#28548)
Lunny Xiao [Thu, 21 Dec 2023 07:42:16 +0000 (15:42 +0800)]
Make offline mode as default to no connect external avatar service by default (#28548)

To keep user's privacy, make offline mode as true by default.

Users can still change it from installation ui and app.ini

9 months agoFix merging artifact chunks error when minio storage basepath is set (#28555)
FuXiaoHei [Thu, 21 Dec 2023 07:04:50 +0000 (15:04 +0800)]
Fix merging artifact chunks error when minio storage basepath is set (#28555)

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

When merging artifact chunks, it lists chunks from storage. When storage
is minio, chunk's path contains `MINIO_BASE_PATH` that makes merging
break.

<del>So trim the `MINIO_BASE_PATH` when handle chunks.</del>

Update the chunk file's basename to retain necessary information. It
ensures that the directory in the chunk's path remains unaffected.

9 months agofeat: bump `dessant/lock-threads` and `actions/setup-go` to use nodejs20 runtime...
Rui Chen [Thu, 21 Dec 2023 05:31:04 +0000 (00:31 -0500)]
feat: bump `dessant/lock-threads` and `actions/setup-go` to use nodejs20 runtime (#28565)

Update more actions to use nodejs20 runtime and also update the docs for
checkout action usage.

similar to:
- #27836
- #27096

---------

Signed-off-by: Rui Chen <rui@chenrui.dev>
9 months agoUpdate actions document about comparsion as Github Actions (#28560)
Lunny Xiao [Wed, 20 Dec 2023 20:12:25 +0000 (04:12 +0800)]
Update actions document about comparsion as Github Actions (#28560)

9 months agoFix inperformant query on retrifing review from database. (#28552)
6543 [Wed, 20 Dec 2023 15:19:58 +0000 (16:19 +0100)]
Fix inperformant query on retrifing review from database. (#28552)

can we please PLEAS PLEASE only use raw SQL statements if it is relay
needed!!!

source is https://github.com/go-gitea/gitea/pull/28544 (before
refactoring)

9 months agoFix the issue ref rendering for wiki (#28556)
wxiaoguang [Wed, 20 Dec 2023 14:11:59 +0000 (22:11 +0800)]
Fix the issue ref rendering for wiki (#28556)

Fix #28526, regression of
* #26365

(although the author of #26365 has recent activities, but there is no
response for the regression, so I proposed this quick fix and keep the
fix simple to make it easier to backport to 1.21)

9 months agoAdd missing head of lfs client batch (#28550)
Lunny Xiao [Wed, 20 Dec 2023 11:54:34 +0000 (19:54 +0800)]
Add missing head of lfs client batch (#28550)

ref https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#git-lfs-batch-api

9 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 20 Dec 2023 00:20:44 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

9 months agoRemove deadcode under models/issues (#28536)
Nanguan Lin [Tue, 19 Dec 2023 19:12:02 +0000 (03:12 +0800)]
Remove deadcode under models/issues (#28536)

Using the Go Official tool `golang.org/x/tools/cmd/deadcode@latest`
mentioned by [go blog](https://go.dev/blog/deadcode).
Just use `deadcode .` in the project root folder and it gives a list of
unused functions. Though it has some false alarms.
This PR removes dead code detected in `models/issues`.

9 months agoAlways enable caches (#28527)
Lunny Xiao [Tue, 19 Dec 2023 09:29:05 +0000 (17:29 +0800)]
Always enable caches (#28527)

Nowadays, cache will be used on almost everywhere of Gitea and it cannot
be disabled, otherwise some features will become unaviable.

Then I think we can just remove the option for cache enable. That means
cache cannot be disabled.
But of course, we can still use cache configuration to set how should
Gitea use the cache.

9 months agoImprove ObjectFormat interface (#28496)
Lunny Xiao [Tue, 19 Dec 2023 07:20:47 +0000 (15:20 +0800)]
Improve ObjectFormat interface (#28496)

The 4 functions are duplicated, especially as interface methods. I think
we just need to keep `MustID` the only one and remove other 3.

```
MustID(b []byte) ObjectID
MustIDFromString(s string) ObjectID
NewID(b []byte) (ObjectID, error)
NewIDFromString(s string) (ObjectID, error)
```

Introduced the new interfrace method `ComputeHash` which will replace
the interface `HasherInterface`. Now we don't need to keep two
interfaces.

Reintroduced `git.NewIDFromString` and `git.MustIDFromString`. The new
function will detect the hash length to decide which objectformat of it.
If it's 40, then it's SHA1. If it's 64, then it's SHA256. This will be
right if the commitID is a full one. So the parameter should be always a
full commit id.

@AdamMajer Please review.

9 months agoFix duplicate ID when deleting repo (#28520)
David Øvrelid [Tue, 19 Dec 2023 04:40:05 +0000 (05:40 +0100)]
Fix duplicate ID when deleting repo (#28520)

There is an accessibility issue in the interface when attempting to
delete a repository. When I click on "Delete repository," a dialog box
appears, requiring confirmation to proceed with the repository deletion.
However, when I press the "Repo name" label, the wrong input field gains
focus. The focused field is located behind the dialog and is intended
for renaming the repository.

9 months agochore(api): support ignore password if login source type is LDAP for creating user...
Bo-Yi Wu [Tue, 19 Dec 2023 02:32:45 +0000 (10:32 +0800)]
chore(api): support ignore password if login source type is LDAP for creating user API (#28491)

- Modify the `Password` field in `CreateUserOption` struct to remove the
`Required` tag
- Update the `v1_json.tmpl` template to include the `email` field and
remove the `password` field

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
9 months agoUpdate go dependencies (#28518)
wxiaoguang [Tue, 19 Dec 2023 01:18:42 +0000 (09:18 +0800)]
Update go dependencies (#28518)

Update golang.org/x/crypto for CVE-2023-48795 and update other packages.
`go-git` is not updated because it needs time to figure out why some
tests fail.

9 months agoBump google/go-github to v57 (#28514)
Yevhen Pavlov [Mon, 18 Dec 2023 21:42:04 +0000 (23:42 +0200)]
Bump google/go-github to v57 (#28514)

10 months agoOnly check online runner when detecting matching runners in workflows (#28286)
yp05327 [Mon, 18 Dec 2023 16:06:19 +0000 (01:06 +0900)]
Only check online runner when detecting matching runners in workflows (#28286)

Mentioned:
[#28277](https://github.com/go-gitea/gitea/issues/28277#issuecomment-1831325276)

We should only check online runner when detecting matching runners in
workflows,
as if runner is not online, the workflow will not run.

![image](https://github.com/go-gitea/gitea/assets/18380374/11855e9d-7241-4b7a-b8d7-49dbb94ba1c5)

10 months agoAdd orphaned topic consistency check (#28507)
Earl Warren [Mon, 18 Dec 2023 15:32:08 +0000 (16:32 +0100)]
Add orphaned topic consistency check (#28507)

- If a topic has zero repository count, it means that none of the
repositories are using that topic, that would make them 'useless' to
keep. One caveat is that if that topic is going to be used in the
future, it will be added again to the database, but simply with a new
ID.

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

Co-authored-by: Gusted <postmaster@gusted.xyz>
10 months agoImprove the prompt for "ssh-keygen sign" (#28509)
wxiaoguang [Mon, 18 Dec 2023 14:53:04 +0000 (22:53 +0800)]
Improve the prompt for "ssh-keygen sign" (#28509)

Close #28505, ref:
* https://github.com/go-gitea/gitea/pull/20112#issuecomment-1165423026
* https://github.com/go-gitea/gitea/issues/28505#issuecomment-1860048116