]> source.dussan.org Git - gitea.git/log
gitea.git
11 months agoFix label render containing invalid HTML (#27752)
Earl Warren [Mon, 23 Oct 2023 23:02:00 +0000 (01:02 +0200)]
Fix label render containing invalid HTML (#27752)

- The label HTML contained a quote that wasn't being closed.

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

(cherry picked from commit e2bc2c9a1fff482c49dbeb3a51e4e1c698bf506c)

Co-authored-by: Gusted <postmaster@gusted.xyz>
11 months agoFix duplicate project board when hitting `enter` key (#27746)
Nanguan Lin [Mon, 23 Oct 2023 12:40:33 +0000 (20:40 +0800)]
Fix duplicate project board when hitting `enter` key (#27746)

When hitting the `enter` key to create a new project column, the request
is sent twice because the `submit` event and `key up` event are both
triggered.
Probably a better solution is to rewrite these parts of the code to
avoid using native jQuery but reuse the `form-fetch-action` class. But
it's beyond my ability.

11 months agoFix `link-action` redirect network error (#27734)
Nanguan Lin [Mon, 23 Oct 2023 12:34:17 +0000 (20:34 +0800)]
Fix `link-action` redirect network error (#27734)

<img width="823" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/99da3d5a-c28a-4fd0-8ae0-88461a9142e2">

---------

Co-authored-by: 6543 <6543@obermui.de>
11 months agoFix incorrect ctx usage in defer function (#27740)
wxiaoguang [Sun, 22 Oct 2023 14:12:27 +0000 (22:12 +0800)]
Fix incorrect ctx usage in defer function (#27740)

11 months agoEnable followCursor for language stats bar (#27713)
silverwind [Sun, 22 Oct 2023 13:06:04 +0000 (15:06 +0200)]
Enable followCursor for language stats bar (#27713)

Fixes: https://github.com/go-gitea/gitea/issues/27600
![](https://github.com/go-gitea/gitea/assets/115237/96743d90-0712-4f13-84ec-66f84e6ed2d7)

Also tested together with https://github.com/go-gitea/gitea/pull/27704,
works well.

11 months agoteams: new View button (#27685)
tomholford [Sun, 22 Oct 2023 12:34:16 +0000 (05:34 -0700)]
teams: new View button (#27685)

Per the discussion on #22054, the flow for adding a new team member to
an org is not intuitive for new Gitea users.

The ideal solution would be to add a new button on the Org > Members
index view (see the screenshot mockup in the issue description).
However, this would require a refactor of the UX for the flow. The
current flow has an implicit context of which team within the org the
new member is being added to ('Owners' by default). From the Members
index, there is no implicit context; the flow would have to add a picker
for which team the new member should be added to.

So, as a stopgap, this change simply adds a button to the Teams index
page that performs the same action as clicking on the title of the team
(a behavior that is currently too obscure as indicated in the comments
on the issue). This should reduce support burden and serve as a decent
temporary measure until the Add Member flow is refactored.

---------

Co-authored-by: tomholford <tomholford@users.noreply.github.com>
11 months agofix issues in translation file (#27699)
Denys Konovalov [Sun, 22 Oct 2023 11:59:31 +0000 (13:59 +0200)]
fix issues in translation file (#27699)

- use correct comment sign for INI (`;`)
- remove duplicated `repo.branch.search` key
- remove duplicated spaces & similar

11 months agoFix an indentation in the Chinese documentation of Act Runner (#27730)
HoshinoRei [Sun, 22 Oct 2023 11:37:56 +0000 (19:37 +0800)]
Fix an indentation in the Chinese documentation of Act Runner (#27730)

In the [English
document](https://docs.gitea.com/1.21/usage/actions/act-runner#configuring-cache-when-starting-a-runner-using-docker-image),
there is indentation here, but there is no indentation in the Chinese
document.

11 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 22 Oct 2023 00:24:59 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

11 months agoFix org team endpoint (#27721)
Nanguan Lin [Sat, 21 Oct 2023 23:40:59 +0000 (07:40 +0800)]
Fix org team endpoint (#27721)

Fix #27711

11 months agoImprove diff tree spacing (#27714)
silverwind [Sat, 21 Oct 2023 10:38:19 +0000 (12:38 +0200)]
Improve diff tree spacing (#27714)

1. Un-indent top-level items, matching GitHub rendering
2. Increase item padding and add 1px gap between items

Before and After:

<img width="247" alt="Screenshot 2023-10-20 at 18 37 32"
src="https://github.com/go-gitea/gitea/assets/115237/43c1ce86-1814-4a8a-9dd2-0c4a82a2be7c">
<img width="241" alt="Screenshot 2023-10-20 at 18 40 46"
src="https://github.com/go-gitea/gitea/assets/115237/b541b85b-c428-4903-becd-773ae5807495">

---------

Co-authored-by: 6543 <m.huber@kithara.com>
11 months agorefactor: make db iterate context aware (#27710)
6543 [Sat, 21 Oct 2023 02:05:29 +0000 (04:05 +0200)]
refactor: make db iterate context aware (#27710)

the iteration will run until finished atm.

this changes it by checking if if the context got canceled before each
run of a loop sequence is executed

[View this pull with now
whitespace](https://github.com/go-gitea/gitea/pull/27710/files?diff=unified&w=1)

11 months ago[FIX] resolve confusing colors in languages stats by insert a gap (#27704)
MrDevil [Fri, 20 Oct 2023 17:33:05 +0000 (01:33 +0800)]
[FIX] resolve confusing colors in languages stats by insert a gap (#27704)

The current language stats are too obsessed with color matching. Similar
colors are always next to each other. It is a bit troublesome to find
the place where the color matching is generated, so just follow the
example of github and add a gap.

## before

<img width="883" alt="image"
src="https://github.com/go-gitea/gitea/assets/12915306/cf54430c-616c-4b37-b561-5a37c20b2d94">

## after

<img width="877" alt="image"
src="https://github.com/go-gitea/gitea/assets/12915306/e518ea36-2b8f-4f11-a867-a58dc393db85">

11 months agoFix sticky diff header background (#27697)
silverwind [Fri, 20 Oct 2023 14:56:19 +0000 (16:56 +0200)]
Fix sticky diff header background (#27697)

Fixes: https://github.com/go-gitea/gitea/issues/27604
Add negative margins so the header covers any shadow of active elements.
No rendering change of the content of the header because the padding
counteracts the effect.

<img width="128" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3d0f55b6-9351-4985-a290-da9a92d15b4e">

11 months agoReplace -1 with GhostUserID (#27703)
Nanguan Lin [Fri, 20 Oct 2023 14:43:08 +0000 (22:43 +0800)]
Replace -1 with GhostUserID (#27703)

11 months agoClean some functions about project issue (#27705)
Nanguan Lin [Fri, 20 Oct 2023 12:01:25 +0000 (20:01 +0800)]
Clean some functions about project issue (#27705)

1. remove unused function `MoveIssueAcrossProjectBoards`
2. extract the project board condition into a function
3. use db.NoCondition instead of -1. (BTW, the usage of db.NoCondition
is too confusing. Is there any way to avoid that?)
4. remove the unnecessary comment since the ctx refactor is completed.
5. Change `b.ID != 0` to `b.ID > 0`. It's more intuitive but I think
they're the same since board ID can't be negative.

11 months agoAdapt `.changelog.yml` to new labeling system (#27701)
delvh [Thu, 19 Oct 2023 22:22:00 +0000 (00:22 +0200)]
Adapt `.changelog.yml` to new labeling system (#27701)

Otherwise, it is not possible anymore to generate changelogs.

11 months agoUpdate and add new eslint plugins (#27698)
silverwind [Thu, 19 Oct 2023 19:51:56 +0000 (21:51 +0200)]
Update and add new eslint plugins (#27698)

- Switch `eslint-plugin-import` to
[`eslint-plugin-i`](https://github.com/un-es/eslint-plugin-i), a fork
with better dependencies
- Update `eslint-plugin-regexp` to 2.0.0 and add new rules
- Add
[`eslint-plugin-vitest`](https://github.com/veritem/eslint-plugin-vitest)

12 months agoShow total TrackedTime on issue/pull/milestone lists (#26672)
6543 [Thu, 19 Oct 2023 14:08:31 +0000 (16:08 +0200)]
Show total TrackedTime on issue/pull/milestone lists (#26672)

TODOs:
- [x] write test for `GetIssueTotalTrackedTime`
- [x] frontport kitharas template changes and make them mobile-friendly

---

![image](https://github.com/go-gitea/gitea/assets/24977596/6713da97-201f-4217-8588-4c4cec157171)

![image](https://github.com/go-gitea/gitea/assets/24977596/3a45aba8-26b5-4e6a-b97d-68bfc2bf9024)

---
*Sponsored by Kithara Software GmbH*

12 months agoAdd doctor dbconsistency fix to delete repos with no owner (#27290)
6543 [Thu, 19 Oct 2023 13:20:52 +0000 (15:20 +0200)]
Add doctor dbconsistency fix to delete repos with no owner (#27290)

to address #27273
replace #24873

12 months agoDelete repos of org when purge delete user (#27273)
JakobDev [Thu, 19 Oct 2023 13:16:11 +0000 (15:16 +0200)]
Delete repos of org when purge delete user (#27273)

Fixes https://codeberg.org/forgejo/forgejo/issues/1514

I had to remove `RenameOrganization` to avoid circular import.

We should really add some foreign keys to the database.

12 months agoFix required checkboxes in issue forms (#27592)
JakobDev [Thu, 19 Oct 2023 11:43:15 +0000 (13:43 +0200)]
Fix required checkboxes in issue forms (#27592)

If you set a checkbox as required in a issue form at the moment, the
checkbox is checked and read only, what does not make much sense. With
this PR, the Checkbox actually needs to be checked. The label supports
now also Markdown. This matches GitHub's behaviour.

And yes, I know the CSS is a ugly workaround. It looks like the given
CSS code is part Fomantic and I don't know how to change that. The
Maintainers are free to change that.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/3f35be75-b0b4-42a7-9048-a4970384a035)

12 months agoUpgrade xorm (#27673)
Nanguan Lin [Thu, 19 Oct 2023 10:25:57 +0000 (18:25 +0800)]
Upgrade xorm (#27673)

Related to https://gitea.com/xorm/xorm/pulls/2341

12 months ago[docs] Add note that PROTOCOL config is case-sensitive (#25685)
MiloCubed [Thu, 19 Oct 2023 08:14:46 +0000 (16:14 +0800)]
[docs] Add note that PROTOCOL config is case-sensitive (#25685)

See [issue on
gitea.com](https://gitea.com/gitea/gitea-docusaurus/issues/38), copied
below for convenience:
> Hello, may I first confirm that the app.ini PROTOCOL config is case
sensitive (must be lowercase)?
>
> If so, I'd like to suggest for it to be highlighted in the [HTTPS
Setup](https://docs.gitea.com/administration/https-setup#using-the-built-in-server)
page.
> Perhaps something like:
> For the PROTOCOL=https field, make sure https is lowercase. Writing
PROTOCOL=HTTPS may result in a SSL_ERROR_RX_RECORD_TOO_LONG error on
Firefox or ERR_SSL_PROTOCOL_ERROR on Chrome and Edge.
>
> Background
> At first I carelessly wrote PROTOCOL=HTTPS in my app.ini, and Firefox
didn't allow me to connect because:
> Secure Connection Failed
> An error occurred during a connection to gitea.local.lan. SSL received
a record that exceeded the maximum permissible length.
> Error code: SSL_ERROR_RX_RECORD_TOO_LONG
> I spent maybe half an hour troubleshooting my certs, ports, and other
configs before backtracking to the start and realizing the
capitalization difference there ðŸ˜…. When I changed that config to
lowercase, it worked.

For this PR I added the note in the Config Cheat Sheet page and fixed
the links to it from the HTTPS Setup page.

Was originally thinking to put the note in the HTTPS Setup page itself,
but since there are 2 sections referencing the PROTOCOL config, I was
thinking it'd be neater and more concise to put it in the Config Cheat
Sheet page instead. Especially since both sections already link to it,
and I actually tried to check that link quite early on in my
troubleshooting (but didn't pay much attention to it since the link was
broken).

## Before/After screenshots as per [this repo's
docs](https://github.com/go-gitea/gitea/tree/main/docs)

Before - links

![image](https://github.com/go-gitea/gitea/assets/135522693/e0745077-f6a9-4178-aa78-2155ccb58fd6)
Note: For this the links weren't broken, the links fix is because they
were broken on gitea.com's docs (see below).

After - links

![image](https://github.com/go-gitea/gitea/assets/135522693/748b3759-aa13-4ad0-9811-c6664b6cdd35)

Before - config cheat sheet

![image](https://github.com/go-gitea/gitea/assets/135522693/4ff2e4e6-3528-4cea-a7a6-64a75854eb99)

After - config cheat sheet

![image](https://github.com/go-gitea/gitea/assets/135522693/c8e07ab6-5a26-4582-a4d0-b83d1f11a30e)

## Before/After screenshots as per [gitea.com's
docs](https://gitea.com/gitea/gitea-docusaurus)

Before - links

![image](https://github.com/go-gitea/gitea/assets/135522693/4d26ea67-b987-4b91-810b-c53852a13078)

After - links

![image](https://github.com/go-gitea/gitea/assets/135522693/24d02907-7f9e-4228-a190-7696623c00f7)

Before - config cheat sheet

![image](https://github.com/go-gitea/gitea/assets/135522693/978eedfd-ce05-488d-ab54-9d7f3c9f233d)

After - config cheat sheet

![image](https://github.com/go-gitea/gitea/assets/135522693/12d22566-a2b0-45ec-8302-a88eae9365d8)

12 months agoRemove network call on `make clean` (#27689)
techknowlogick [Thu, 19 Oct 2023 08:02:22 +0000 (04:02 -0400)]
Remove network call on `make clean` (#27689)

fix #27653

credit to silverwind for finding issue

12 months agoAdd unit tests for action runner token (#27670)
Nanguan Lin [Thu, 19 Oct 2023 07:24:24 +0000 (15:24 +0800)]
Add unit tests for action runner token (#27670)

In case the behavior of the register token changes.

12 months agoTypos fixed in documentation files (#27687)
SandeshPyakurel [Thu, 19 Oct 2023 06:46:26 +0000 (12:31 +0545)]
Typos fixed in documentation files (#27687)

Typos fixed in multiple docs files.

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 19 Oct 2023 00:23:11 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoAdd link for repositories README file (#27684)
sebastian-sauer [Wed, 18 Oct 2023 22:59:46 +0000 (00:59 +0200)]
Add link for repositories README file (#27684)

this allows to deep link to the readme section of a repository.

fixes #27641

Screenshots:

No changes on initial display:

![image](https://github.com/go-gitea/gitea/assets/1135157/efbef50e-c24b-4cca-b19f-9092e70b5a5f)

On hover the link is shown:

![image](https://github.com/go-gitea/gitea/assets/1135157/c8dff2b8-31dc-4b7b-96d0-27642318483d)

12 months agoFix typo "GetLatestRunnerToken" (#27680)
Jason Song [Wed, 18 Oct 2023 15:52:44 +0000 (23:52 +0800)]
Fix typo "GetLatestRunnerToken" (#27680)

12 months agoClipboard copy enhancements (#27669)
silverwind [Wed, 18 Oct 2023 15:16:06 +0000 (17:16 +0200)]
Clipboard copy enhancements (#27669)

1. Do not show temporary tooltips that are triggered from within
dropdowns. Previously this resulted in the tooltip being stuck to
top-left of the page like seen on issue comment URL copy. I could not
figure out any tippy options that prevent this, so I think it's better
to just not show it.
1. Refactor `initGlobalCopyToClipboardListener` so that it does not run
a often useless `document.querySelector` on every click, make
`data-clipboard-text-type` work with `data-clipboard-target`. No use in
current code base but still good to have. Finally some minor code
cleanup in the function.

Point 1 is for this copy button:

<img width="229" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/81f34746-8ea5-43d9-8c6f-f6f417a9e4ad">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoRemove unnecessary parameter (#27671)
Lunny Xiao [Wed, 18 Oct 2023 15:03:10 +0000 (23:03 +0800)]
Remove unnecessary parameter (#27671)

12 months agoAlways delete existing scheduled action tasks (#27662)
KN4CK3R [Wed, 18 Oct 2023 10:34:39 +0000 (12:34 +0200)]
Always delete existing scheduled action tasks (#27662)

Fixes #27650

12 months agoSupport allowed hosts for webhook to work with proxy (#27655)
Jason Song [Wed, 18 Oct 2023 09:44:36 +0000 (17:44 +0800)]
Support allowed hosts for webhook to work with proxy (#27655)

When `webhook.PROXY_URL` has been set, the old code will check if the
proxy host is in `ALLOWED_HOST_LIST` or reject requests through the
proxy. It requires users to add the proxy host to `ALLOWED_HOST_LIST`.
However, it actually allows all requests to any port on the host, when
the proxy host is probably an internal address.

But things may be even worse. `ALLOWED_HOST_LIST` doesn't really work
when requests are sent to the allowed proxy, and the proxy could forward
them to any hosts.

This PR fixes it by:

- If the proxy has been set, always allow connectioins to the host and
port.
- Check `ALLOWED_HOST_LIST` before forwarding.

12 months agoImprove the list header in milestone page (#27302)
yp05327 [Wed, 18 Oct 2023 00:03:42 +0000 (09:03 +0900)]
Improve the list header in milestone page (#27302)

The ui of list header in milestone page is not same as issue and pr list
page.
And they are using different template codes which can be merged into
one.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/29eb426c-2dd6-4cf2-96e0-82339fb631bb)

![image](https://github.com/go-gitea/gitea/assets/18380374/b36c4dff-469a-4395-8a02-a8c54e17ab21)

![image](https://github.com/go-gitea/gitea/assets/18380374/d882c74a-451b-431d-b58e-3635a15d9718)

![image](https://github.com/go-gitea/gitea/assets/18380374/292cd38d-1b50-47f1-b32c-9b5de90ce5fb)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/4529234e-67dc-4e17-9440-e638be4fbc41)

![image](https://github.com/go-gitea/gitea/assets/18380374/c15b4d86-0762-497b-b28d-72d09443d629)

---------

Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
12 months agoFix poster is not loaded in get default merge message (#27657)
Lunny Xiao [Tue, 17 Oct 2023 15:07:23 +0000 (23:07 +0800)]
Fix poster is not loaded in get default merge message (#27657)

12 months agoHide archived labels by default from the suggestions when assigning labels for an...
puni9869 [Tue, 17 Oct 2023 14:10:45 +0000 (19:40 +0530)]
Hide archived labels by default from the suggestions when assigning labels for an issue (#27451)

Followup of #27115
Finally closes #25237

## Screenshots
### Issue Sidebar
<img width="513" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/9f7fda2f-5a03-4684-8619-fd3498a95b41">

### PR sidebar
<img width="367" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/53db9b64-faec-4a67-91d6-76945596a469">

### PR sidebar with archived labels shown
<img width="352" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/9dc5050f-4e69-4f76-bb83-582480a2281e">

---------

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
12 months agoactions/setup-go use go-version-file (#27651)
Yevhen Pavlov [Tue, 17 Oct 2023 10:24:54 +0000 (13:24 +0300)]
actions/setup-go use go-version-file (#27651)

These changes will allow not to specify the version of go in every
pipeline.

12 months agoUpdate agit-support.en-us.md (#27652)
Sandro Santilli [Tue, 17 Oct 2023 09:53:36 +0000 (11:53 +0200)]
Update agit-support.en-us.md (#27652)

Clarify Agit PR creation documentation

See https://github.com/go-gitea/gitea/issues/27579

12 months agocleanup repo details icons/labels (#27644)
Denys Konovalov [Mon, 16 Oct 2023 21:06:15 +0000 (23:06 +0200)]
cleanup repo details icons/labels (#27644)

Fix #27596

Change confusing behavior when showing information about a repo via
labels and icons. Implement changes proposed by @lng2020 in
https://github.com/go-gitea/gitea/pull/27627#pullrequestreview-1678787673.

12 months agoImprove dropdown button alignment and fix hover bug (#27632)
wxiaoguang [Mon, 16 Oct 2023 07:26:08 +0000 (15:26 +0800)]
Improve dropdown button alignment and fix hover bug (#27632)

1. fix #27631 , and add samples to devtest page
2. fix incorrect color for "ui dropdown button" when hover

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

12 months agoImprove retrying index issues (#27554)
Jason Song [Sun, 15 Oct 2023 18:56:57 +0000 (02:56 +0800)]
Improve retrying index issues (#27554)

Fix #27540

12 months agoReplace more db.DefaultContext (#27628)
Lunny Xiao [Sun, 15 Oct 2023 15:46:06 +0000 (23:46 +0800)]
Replace more db.DefaultContext (#27628)

Target #27065

12 months agoFix 404 when there is an internal version of package (#27615)
Nanguan Lin [Sun, 15 Oct 2023 09:22:10 +0000 (17:22 +0800)]
Fix 404 when there is an internal version of package (#27615)

close #27601
The Docker registry has an internal version, which leads to 404

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 15 Oct 2023 00:25:13 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoAdd anchor to review types (#26894)
Earl Warren [Sat, 14 Oct 2023 21:13:59 +0000 (23:13 +0200)]
Add anchor to review types (#26894)

- The review type '22' is a general comment type that is attached to
single codecomments, reviews with multiple comments or to simple approve
and request changes comment. This comment can be used to create a link
towards this action on an pull request.
- Adds an anchor to the review comment type, so that when its getting
linked to it, it actually jumps towards that event.
- This also now fixes the behavior that after you created a review you
will be redirected to that review and because this is an general comment
type other mails will also be 'fixed' such as the approved or request
changes.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1248

(cherry picked from commit 1741a5f1fe6adc68bb5f87bdd1c5bdc5bfaa45c7)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
12 months agoUpdate readme to remove drone svg (#27624)
Nanguan Lin [Sat, 14 Oct 2023 16:11:54 +0000 (00:11 +0800)]
Update readme to remove drone svg (#27624)

12 months agoChange the default branch in the agit docs (#27621)
Nanguan Lin [Sat, 14 Oct 2023 13:50:23 +0000 (21:50 +0800)]
Change the default branch in the agit docs (#27621)

12 months agoFinal round of `db.DefaultContext` refactor (#27587)
JakobDev [Sat, 14 Oct 2023 08:37:24 +0000 (10:37 +0200)]
Final round of `db.DefaultContext` refactor (#27587)

Last part of #27065

12 months agoFix permissions for Token DELETE endpoint to match GET and POST (#27610)
Evan Tobin [Sat, 14 Oct 2023 08:04:44 +0000 (03:04 -0500)]
Fix permissions for Token DELETE endpoint to match GET and POST (#27610)

Fixes #27598

In #27080, the logic for the tokens endpoints were updated to allow
admins to create and view tokens in other accounts. However, the same
functionality was not added to the DELETE endpoint. This PR makes the
DELETE endpoint function the same as the other token endpoints and adds unit tests

12 months agoEnhanced auth token / remember me (#27606)
KN4CK3R [Sat, 14 Oct 2023 00:56:41 +0000 (02:56 +0200)]
Enhanced auth token / remember me (#27606)

Closes #27455

> The mechanism responsible for long-term authentication (the 'remember
me' cookie) uses a weak construction technique. It will hash the user's
hashed password and the rands value; it will then call the secure cookie
code, which will encrypt the user's name with the computed hash. If one
were able to dump the database, they could extract those two values to
rebuild that cookie and impersonate a user. That vulnerability exists
from the date the dump was obtained until a user changed their password.
>
> To fix this security issue, the cookie could be created and verified
using a different technique such as the one explained at
https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence#secure-remember-me-cookies.

The PR removes the now obsolete setting `COOKIE_USERNAME`.

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 14 Oct 2023 00:22:28 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

12 months agorm outdated docs from some languages (#27530)
techknowlogick [Fri, 13 Oct 2023 19:29:18 +0000 (15:29 -0400)]
rm outdated docs from some languages (#27530)

related to #27499

12 months agoUpgrade go dependencies (#27599)
Chongyi Zheng [Fri, 13 Oct 2023 16:11:15 +0000 (12:11 -0400)]
Upgrade go dependencies (#27599)

Upgrade all dependencies in `go.mod`

`golang.org/x/net` v0.17.0 also fixes
[CVE-2023-39325](https://github.com/advisories/GHSA-4374-p667-p6c8)

---------

Co-authored-by: delvh <dev.lh@web.de>
12 months agoFix build errors on BSD (in BSDMakefile) (#27594)
Sergey Zolotarev [Fri, 13 Oct 2023 15:38:27 +0000 (21:38 +0600)]
Fix build errors on BSD (in BSDMakefile) (#27594)

1. `make build` fails because `||` and `&&` have the same precedence in
sh/bash, so the `false` command always evaluated (leading to an error).

   ```
   + which gmake /usr/local/bin/gmake
   + false

   *** Failed target:  .BEGIN
*** Failed command: which "gmake" || printf "Error: GNU Make is
required!\n\n" 1>&2 && false
   *** Error code 1
   ```

2. When `GPREFIX` is set to an empty string with quotation marks,
`gmake` mistakenly thinks that it's a file name:

   ``` gmake: *** empty string invalid as file name.  Stop. ```

12 months agoEnable shorthands in `declaration-strict-value` linter (#27597)
silverwind [Fri, 13 Oct 2023 08:19:21 +0000 (10:19 +0200)]
Enable shorthands in `declaration-strict-value` linter (#27597)

Enable [shorthand
matching](https://github.com/AndyOGo/stylelint-declaration-strict-value#expandshorthand)
in this lint rule and match color properties by regex. Patterns like
this will now fail lint:

```css
background: #123456;
border: 1px sold rgba(0,0,0,0);
```

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 13 Oct 2023 00:23:41 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoMake disk clean action a bit more robust (#27590)
silverwind [Thu, 12 Oct 2023 04:24:13 +0000 (06:24 +0200)]
Make disk clean action a bit more robust (#27590)

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 12 Oct 2023 00:21:30 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoKeep filter when showing unfiltered results on explore page (#27192)
JakobDev [Wed, 11 Oct 2023 22:10:51 +0000 (00:10 +0200)]
Keep filter when showing unfiltered results on explore page (#27192)

Fixes https://codeberg.org/Codeberg/Community/issues/1302

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoDon't show Link to TOTP if not set up (#27585)
JakobDev [Wed, 11 Oct 2023 20:12:54 +0000 (22:12 +0200)]
Don't show Link to TOTP if not set up (#27585)

12 months agoFix data-race bug when accessing task.LastRun (#27584)
wxiaoguang [Wed, 11 Oct 2023 14:51:20 +0000 (22:51 +0800)]
Fix data-race bug when accessing task.LastRun (#27584)

12 months agoFix template bug (#27581)
Lunny Xiao [Wed, 11 Oct 2023 14:02:15 +0000 (22:02 +0800)]
Fix template bug (#27581)

Regression from #27414

12 months agoReplace ajax with fetch, improve image diff (#27267)
silverwind [Wed, 11 Oct 2023 12:34:21 +0000 (14:34 +0200)]
Replace ajax with fetch, improve image diff (#27267)

1. Dropzone attachment removal, pretty simple replacement
2. Image diff: The previous code fetched every image twice, once via
`img[src]` and once via `$.ajax`. Now it's only fetched once and a
second time only when necessary. The image diff code was partially
rewritten.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoReplace assert.Fail with assert.FailNow (#27578)
Nanguan Lin [Wed, 11 Oct 2023 11:02:24 +0000 (19:02 +0800)]
Replace assert.Fail with assert.FailNow (#27578)

assert.Fail() will continue to execute the code while assert.FailNow()
not. I thought those uses of assert.Fail() should exit immediately.
PS: perhaps it's a good idea to use
[require](https://pkg.go.dev/github.com/stretchr/testify/require)
somewhere because the assert package's default behavior does not exit
when an error occurs, which makes it difficult to find the root error
reason.

12 months agoFix the robots.txt path
Lunny Xiao [Wed, 11 Oct 2023 10:01:52 +0000 (18:01 +0800)]
Fix the robots.txt path

12 months agoshow manual cron run's last time (#27544)
Earl Warren [Wed, 11 Oct 2023 07:28:16 +0000 (09:28 +0200)]
show manual cron run's last time (#27544)

- Currently in the cron tasks, the 'Previous Time' only displays the
previous time of when the cron library executes the function, but not
any of the manual executions of the task.
- Store the last run's time in memory in the Task struct and use that,
when that time is later than time that the cron library has executed
this task.
- This ensures that if an instance admin manually starts a task, there's
feedback that this task is/has been run, because the task might be run
that quick, that the status icon already has been changed to an
checkmark,
- Tasks that are executed at startup now reflect this as well, as the
time of the execution of that task on startup is now being shown as
'Previous Time'.
- Added integration tests for the API part, which is easier to test
because querying the HTML table of cron tasks is non-trivial.
- Resolves https://codeberg.org/forgejo/forgejo/issues/949

(cherry picked from commit fd34fdac1408ece6b7d9fe6a76501ed9a45d06fa)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: silverwind <me@silverwind.io>
12 months agofully replace drone with actions (#27556)
techknowlogick [Wed, 11 Oct 2023 06:39:32 +0000 (02:39 -0400)]
fully replace drone with actions (#27556)

this builds binaries and docker images for tags

12 months agoRevert "Simplify `contrib/backport` (#27520)" (#27566)
zeripath [Wed, 11 Oct 2023 05:55:17 +0000 (06:55 +0100)]
Revert "Simplify `contrib/backport` (#27520)" (#27566)

This reverts #27520 commit 79e8865aaed43de81816390ee616263bb2bee67f
which breaks `--continue` functionality.

12 months agoAlign ISSUE_TEMPLATE with the new label system (#27573)
Nanguan Lin [Wed, 11 Oct 2023 05:25:31 +0000 (13:25 +0800)]
Align ISSUE_TEMPLATE with the new label system (#27573)

As title

12 months agoPenultimate round of `db.DefaultContext` refactor (#27414)
JakobDev [Wed, 11 Oct 2023 04:24:07 +0000 (06:24 +0200)]
Penultimate round of `db.DefaultContext` refactor (#27414)

Part of #27065

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 11 Oct 2023 00:22:56 +0000 (00:22 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoFix attachment download bug (#27486)
Lunny Xiao [Tue, 10 Oct 2023 15:33:56 +0000 (23:33 +0800)]
Fix attachment download bug (#27486)

12 months agoMake actions default enabled for newly created repository if global configuraion...
Lunny Xiao [Tue, 10 Oct 2023 14:45:31 +0000 (22:45 +0800)]
Make actions default enabled for newly created repository if global configuraion enabled (#27482)

12 months agoFix the wrong HTTP response status code for duplicate packages (#27480)
Nanguan Lin [Tue, 10 Oct 2023 13:39:58 +0000 (21:39 +0800)]
Fix the wrong HTTP response status code for duplicate packages (#27480)

fix #27470
(hope there is nothing missing ðŸ˜¢ )

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
12 months agoIncrease queue length (#27555)
Jason Song [Tue, 10 Oct 2023 10:47:49 +0000 (18:47 +0800)]
Increase queue length (#27555)

12 months agoRespect SSH.KeygenPath option when calculating ssh key fingerprints (#27536)
Sebastian Grabowski [Tue, 10 Oct 2023 00:01:46 +0000 (02:01 +0200)]
Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536)

Fixes #27535

12 months agoRemove max-width and add hide text overflow (#27359)
Kyle D [Mon, 9 Oct 2023 23:04:31 +0000 (19:04 -0400)]
Remove max-width and add hide text overflow (#27359)

Closes https://github.com/go-gitea/gitea/issues/27358

12 months agoFix `environment-to-ini` inherited key bug (#27543)
wxiaoguang [Mon, 9 Oct 2023 17:10:37 +0000 (01:10 +0800)]
Fix `environment-to-ini` inherited key bug (#27543)

Fix  #27541

The INI package has a quirk: by default, the keys are inherited.
When maintaining the keys, the newly added sub key should not be
affected by the parent key.

12 months agoImprove docs about register/run as a service (#27461)
Nanguan Lin [Mon, 9 Oct 2023 13:20:16 +0000 (21:20 +0800)]
Improve docs about register/run as a service (#27461)

As title

12 months agoapi: GetPullRequestCommits: return file list (#27483)
Michael Santos [Mon, 9 Oct 2023 11:22:12 +0000 (07:22 -0400)]
api: GetPullRequestCommits: return file list (#27483)

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

----

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoswitch to using official AWS step in release nightly (#27532)
techknowlogick [Mon, 9 Oct 2023 10:12:19 +0000 (06:12 -0400)]
switch to using official AWS step in release nightly (#27532)

`jakejarvis/s3-sync-action@master` is out of date, and using official
actions is always recommended

12 months agoImprove file history UI and fix URL escaping bug (#27531)
wxiaoguang [Mon, 9 Oct 2023 07:19:23 +0000 (15:19 +0800)]
Improve file history UI and fix URL escaping bug (#27531)

Follow #27354

Major changes:

1. The `right aligned` in `<th class="one wide right aligned">` is a
no-op because it doesn't have any content
2. The `gt-df` in `<td class="sha gt-df">` was wrong, it causes UI
misalignment, a table cell shouldn't be "flex"
3. Use `gt-py-0` for `gt-pt-0 gt-pb-0`
4. Simplify the layout for buttons, because the `text right aligned` is
widely used and good enough, it doesn't make sense to introduce the
`<div class="gt-df gt-je">`
5. Escape the `$.FileName` correctly

Before:

![image](https://github.com/go-gitea/gitea/assets/2114189/eb2ced3f-1dad-4149-9ed2-aee4c0663621)

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/08244b61-416b-4279-b495-029bc0a96f67)

12 months agoImprove dropdown's behavior when there is a search input in menu (#27526)
wxiaoguang [Mon, 9 Oct 2023 06:48:51 +0000 (14:48 +0800)]
Improve dropdown's behavior when there is a search input in menu (#27526)

Follow #27225

The change in #27225 is not ideal, this should be the complete fix:
support the layout which Fomantic doesn't support.

12 months agoSimplify `contrib/backport` (#27520)
silverwind [Mon, 9 Oct 2023 06:16:16 +0000 (08:16 +0200)]
Simplify `contrib/backport` (#27520)

This script was trying to be too smart, make it more straightforward and
less error-prone so that i could be used by the backport bot too
ideally.

- Always delete the backport branch so that script is idempotent in this
regard
- Remove the push functionality, it's best done by the user because only
they know the remote name
- Remove reading docs/config.yaml, it no longer exists
- Remove version detection, version is now a required argument
- Remove opening the pull request with xdg-open, xdg-open is not
portable
- Remove continue from failed cherry pick. It's best to reset manually
in this case
- Clean up the console logging

Example run:

```
$ go run ./contrib/backport --version v1.21 27503
* Backporting 27503 to origin/release/v1.21 as backport-27503-v1.21
* `git fetch origin main`
* `git fetch origin release/v1.21`
* `git branch -D backport-27503-v1.21`
* `git checkout -b backport-27503-v1.21 origin/release/v1.21`
* Attempting git cherry-pick 08efeb5cdc22d21b5ef12cc540727594a22062d1
* Amending commit to prepend `Backport #27503` to body
Backport done! You can now push it with `git push yourremote backport-27503-v1.21`
```

---------

Co-authored-by: delvh <dev.lh@web.de>
12 months agoAdd docs section for sub-paths with the container registry (#27505)
KN4CK3R [Mon, 9 Oct 2023 04:45:41 +0000 (06:45 +0200)]
Add docs section for sub-paths with the container registry (#27505)

Fixes #21092

suggested by
https://github.com/go-gitea/gitea/issues/21092#issuecomment-1749965397

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
12 months agoDocument our new labeling strategy (#27523)
delvh [Mon, 9 Oct 2023 01:16:05 +0000 (03:16 +0200)]
Document our new labeling strategy (#27523)

12 months ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 9 Oct 2023 00:23:39 +0000 (00:23 +0000)]
[skip ci] Updated translations via Crowdin

12 months agoRestore warning commit status (#27504)
silverwind [Sun, 8 Oct 2023 22:16:06 +0000 (00:16 +0200)]
Restore warning commit status (#27504)

Partial revert of https://github.com/go-gitea/gitea/pull/25839. This
commit status is used by a number of external integrations, so I think
we should not remove it (See
https://github.com/go-gitea/gitea/pull/25839#issuecomment-1729002077).
This is a rare case where an existing migration needed to be alterted to
avoid data loss.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
12 months agoUpdate labeler to match new labeling system (#27525)
Denys Konovalov [Sun, 8 Oct 2023 16:16:56 +0000 (18:16 +0200)]
Update labeler to match new labeling system (#27525)

12 months agoApply to become a maintainer (#27522)
Gary Wang [Sun, 8 Oct 2023 14:36:40 +0000 (22:36 +0800)]
Apply to become a maintainer (#27522)

12 months agoRemove unnecessary desc for openssh key cron task (#27515)
Lunny Xiao [Sun, 8 Oct 2023 14:23:39 +0000 (22:23 +0800)]
Remove unnecessary desc for openssh key cron task (#27515)

12 months agoTweak labeler config (#27502)
silverwind [Sun, 8 Oct 2023 13:11:26 +0000 (15:11 +0200)]
Tweak labeler config (#27502)

Alternative to https://github.com/go-gitea/gitea/pull/27439. Removes a
few spammy labels, and disables `sync-labels` which make it never remove
labels (which is default behaviour).

12 months agoAdd hover background to wiki list page (#27507)
Gary Wang [Sun, 8 Oct 2023 10:07:55 +0000 (18:07 +0800)]
Add hover background to wiki list page (#27507)

This patch adds a hover background for the wiki row in wiki list page,
which make its behavior more close to repo's file list page.

This patch also make the wiki-git-entry visible on the row is hovered
instead of the cel, so users won't be confused since the 'grid' is not
visible from the web page.

After the patch: (when the wiki named 'Home' is hovered)

![image](https://github.com/go-gitea/gitea/assets/10095765/f6c67c41-ad54-4ce4-a3b1-8c7551396ce0)

12 months ago[FIX] missing ctx in new_form (#27514)
mohammed ahmed [Sun, 8 Oct 2023 06:35:20 +0000 (09:35 +0300)]
[FIX] missing ctx in new_form (#27514)

added the ctx for the project link in new_form.tmpl

---

![Screenshot_20231008_075757](https://github.com/go-gitea/gitea/assets/64513301/8adaa287-9e55-4428-bc48-f8e6a2080624)

12 months agoPre-register OAuth application for tea (#27509)
M Hickford [Sun, 8 Oct 2023 03:51:08 +0000 (04:51 +0100)]
Pre-register OAuth application for tea (#27509)

It remains to implement OAuth login in tea
https://gitea.com/gitea/tea/issues/598

Fixes #27510

12 months agoFix mermaid flowchart margin issue (#27503)
silverwind [Sun, 8 Oct 2023 03:20:12 +0000 (05:20 +0200)]
Fix mermaid flowchart margin issue (#27503)

Fixes: https://github.com/go-gitea/gitea/issues/27435
Related: https://github.com/mermaid-js/mermaid/issues/4907

<img width="924" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">

12 months agoadd a shortcut to user's profile page to admin user details (#27299)
techknowlogick [Sun, 8 Oct 2023 02:48:32 +0000 (22:48 -0400)]
add a shortcut to user's profile page to admin user details (#27299)

12 months agoFix actionlint (#27513)
silverwind [Sun, 8 Oct 2023 00:42:32 +0000 (02:42 +0200)]
Fix actionlint (#27513)

`make lint-actions` is currently failing because of undeclared runner
name.