Commit Graph

16727 Commits

Author SHA1 Message Date
Giteabot 9b14f1a8ed
Always delete existing scheduled action tasks (#27662) (#27688)
Backport #27662 by @KN4CK3R

Fixes #27650

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-10-19 09:37:20 +02:00
Giteabot 0b8b0072a2
Clipboard copy enhancements (#27669) (#27681)
Backport #27669 by @silverwind

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: silverwind <me@silverwind.io>
2023-10-19 00:23:28 +08:00
Giteabot dab40cd5f4
Support allowed hosts for webhook to work with proxy (#27655) (#27675)
Backport #27655 by @wolfogre

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.

Co-authored-by: Jason Song <i@wolfogre.com>
2023-10-18 15:07:52 +02:00
Giteabot 5b80157aad
Fix poster is not loaded in get default merge message (#27657) (#27666)
Backport #27657 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-10-17 18:20:35 +02:00
Giteabot bf76216de1
Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661)
Backport #27451 by @puni9869

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: puni9869 <80308335+puni9869@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-10-17 14:46:35 +00:00
Giteabot 21c3513d49
Improve dropdown button alignment and fix hover bug (#27632) (#27637)
Backport #27632 by @wxiaoguang

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-16 16:15:15 +08:00
Giteabot 8cf7548a18
Improve retrying index issues (#27554) (#27634)
Backport #27554 by @wolfogre

Fix #27540

Co-authored-by: Jason Song <i@wolfogre.com>
2023-10-16 09:55:53 +08:00
Giteabot 066aee28a5
Fix 404 when deleting Docker package with an internal version (#27615) (#27630)
Backport #27615 by @lng2020

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

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
2023-10-15 12:08:04 +02:00
Giteabot 148f6e3776
Change the default branch in the agit docs (#27621) (#27623)
Backport #27621 by @lng2020

It's main now.
relevant #27579

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
2023-10-15 09:16:15 +08:00
Nanguan Lin fa6941cf8c
Backport manually for a tmpl issue in v1.21 (#27612)
backport #27514 
close #27607
2023-10-14 11:51:58 +00:00
Giteabot 54dccbeb2e
Fix build errors on BSD (in BSDMakefile) (#27594) (#27608)
Backport #27594 by @sryze

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

Co-authored-by: Sergey Zolotarev <sryze@protonmail.com>
2023-10-14 07:29:55 +00:00
Chongyi Zheng 9f228704a3
Upgrade go dependencies (#27599) (#27609)
Backport #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>
2023-10-13 17:23:17 +00:00
Giteabot 21f1e223d8
Keep filter when showing unfiltered results on explore page (#27192) (#27589)
Backport #27192 by @JakobDev

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

Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-12 08:56:21 +08:00
Giteabot 63a321b83a
Don't show Link to TOTP if not set up (#27585) (#27588)
Backport #27585 by @JakobDev

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

When login in with WebAuth, the page has a link to use TOTP instead.
This link is always displayed, no matter if the User has set up TOTP or
not, which do of cause not work for those who have not.

Co-authored-by: JakobDev <jakobdev@gmx.de>
2023-10-11 22:59:21 +02:00
Giteabot 844ab9a441
Fix data-race bug when accessing task.LastRun (#27584) (#27586)
Backport #27584 by @wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-11 15:27:38 +00:00
Giteabot 7ec7c733c7
Replace ajax with fetch, improve image diff (#27267) (#27583)
Backport #27267 by @silverwind

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: silverwind <me@silverwind.io>
2023-10-11 16:12:31 +02:00
Giteabot 4986dc8351
fully replace drone with actions (#27556) (#27575)
Backport #27556 by @techknowlogick

this builds binaries and docker images for tags

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-10-11 12:03:06 +00:00
Giteabot 1380a46623
show manual cron run's last time (#27544) (#27577)
Backport #27544 by @earl-warren

- 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: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: silverwind <me@silverwind.io>
2023-10-11 13:26:34 +02:00
Nanguan Lin f19feb0f47
Revert "Fix pr template (#27436)" (#27567)
Reverts backport go-gitea/gitea#27440
Fix #27564
2023-10-11 03:11:04 +00:00
Giteabot 9da92835d1
Fix attachment download bug (#27486) (#27571)
Backport #27486 by @lunny

Fix #27204

This PR allows `/<username>/<reponame>/attachments/<uuid>` access with
personal access token and also changed attachments API download url to
it so it can be download correctly.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-10-11 04:39:12 +02:00
Giteabot 478e7042f5
Increase queue length (#27555) (#27562)
Backport #27555 by @wolfogre

It should be OK to increase the default queue length since the default
type is "level".

IMO, the old default length (100) is a little too small. See
https://github.com/go-gitea/gitea/issues/27540#issuecomment-1754269491

IIRC, a larger length could lead to more memory usage only when the type
is "channel," but it's an obscure case. Otherwise, it's just a limit
(for "level" or "redis").

Co-authored-by: Jason Song <i@wolfogre.com>
2023-10-10 20:22:26 +08:00
Giteabot 63587a4aef
Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536) (#27551)
Backport #27536 by @picsel2

Fixes #27535

Co-authored-by: Sebastian Grabowski <sebastian@grabel.de>
2023-10-10 07:37:58 +00:00
yp05327 29d3949271
Avoid run change title process when the title is same (#27467) (#27558)
Backport #27467 manually.
2023-10-10 09:01:46 +02:00
Giteabot 71f091ef97
Remove max-width and add hide text overflow (#27359) (#27550)
Backport #27359 by @kdumontnu

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

Co-authored-by: Kyle D <kdumontnu@gmail.com>
2023-10-09 22:02:26 -04:00
Giteabot 9a64a24f29
use hosted runners for nightly actions (#27485) (#27488)
Backport #27485 by @techknowlogick

I'm temporarily unable to properly evaluate actuated runners, and so I'm
switching back to hosted runners until I am able to focus on that again.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-10-09 14:10:42 -04:00
Giteabot d8513fc312
switch to using official AWS step in release nightly (#27532) (#27547)
Backport #27532 by @techknowlogick

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

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-10-09 13:53:45 -04:00
Giteabot 8c969cdf9c
Fix `environment-to-ini` inherited key bug (#27543) (#27546)
Backport #27543 by @wxiaoguang

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.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-09 17:46:58 +00:00
Giteabot 4c9f7d0710
api: GetPullRequestCommits: return file list (#27483) (#27539)
Backport #27483 by @msantos

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

---
Patch tested:

```json
[
  {
    "url": "7664dcb441",
    "sha": "7664dcb44167e0f9efd994e4ca6a9164694adc27",
    "created": "2023-10-06T09:57:08-04:00",
    "html_url": "7664dcb441",
...
    "files": [
      {
        "filename": "README.md",
        "status": "modified"
      }
    ],
    "stats": {
      "total": 2,
      "additions": 2,
      "deletions": 0
    }
  }
]
```

Co-authored-by: Michael Santos <michael.santos@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-09 14:21:35 +02:00
Giteabot a1ee172fb0
Improve dropdown's behavior when there is a search input in menu (#27526) (#27534)
Backport #27526 by @wxiaoguang

Follow #27225

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

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-09 15:15:18 +08:00
Giteabot fb5ae2ab94
Restore warning commit status (#27504) (#27529)
Backport #27504 by @silverwind

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: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
2023-10-09 11:56:02 +08:00
silverwind 8419897fba
Update JS and PY dependencies (#27501) (#27518)
Backport https://github.com/go-gitea/gitea/pull/27501 to 1.21

- Update all JS and PY dependencies
- Enable eslint `prefer-object-has-own` and autofix issue
- Fix styling on citation buttons
- Tested citation, mermaid, monaco, swagger, katex

Citation button issue was that these buttons were not filled:

<img width="136" alt="Screenshot 2023-10-07 at 14 05 08"
src="https://github.com/go-gitea/gitea/assets/115237/435f0c91-28ac-46b3-bae4-dad768b29c05">

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-08 19:31:33 +02:00
Giteabot 17698d4a62
Add hover background to wiki list page (#27507) (#27521)
Backport #27507 by @BLumia

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)

Co-authored-by: Gary Wang <git@blumia.net>
2023-10-08 13:48:51 +00:00
silverwind 0fb7294027
Fix mermaid flowchart margin issue (#27503) (#27516)
Backport https://github.com/go-gitea/gitea/pull/27503 to 1.21

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">
2023-10-08 15:31:47 +02:00
Giteabot 8e1ef5787f
bump go-deps (#27489) (#27493)
Backport #27489 by @techknowlogick

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
2023-10-08 00:07:09 +00:00
Giteabot 65020fdf7f
Enable markdownlint `no-duplicate-header` (#27500) (#27506)
Backport #27500 by @silverwind

Duplicate headers in a single Markdown document are problemlematic
because the auto-generated links won't be stable. Enable this rule with
no exceptions which is also the default of `markdownlint`. For example:

```md
# A
## Example
# B
## Example
```
Docasaurus will generated `example` and `example-1` links for this. If
the first heading is altered, the link `example` will unexpectedly move
to the second example heading.

Ref: https://github.com/go-gitea/gitea/pull/27461#discussion_r1347987659

Co-authored-by: silverwind <me@silverwind.io>
2023-10-07 21:41:41 +08:00
Giteabot 5b670d83e1
Fix panic in storageHandler (#27446) (#27479)
Backport #27446 by @sryze

storageHandler() is written as a middleware but is used as an endpoint
handler, and thus `next` is actually `nil`, which causes a null pointer
dereference when a request URL does not match the pattern (where it
calls `next.ServerHTTP()`).

Example CURL command to trigger the panic:

```
curl -I "http://yourhost/gitea//avatars/a"
```

Fixes #27409

---

Note: the diff looks big but it's actually a small change - all I did
was to remove the outer closure (and one level of indentation) ~and
removed the HTTP method and pattern checks as they seem redundant
because go-chi already does those checks~. You might want to check "Hide
whitespace" when reviewing it.

Alternative solution (a bit simpler): append `, misc.DummyOK` to the
route declarations that utilize `storageHandler()` - this makes it
return an empty response when the URL is invalid. I've tested this one
and it works too. Or maybe it would be better to return a 400 error in
that case (?)

Co-authored-by: Sergey Zolotarev <sryze@outlook.com>
2023-10-06 16:51:26 +02:00
delvh 9207331f4d
Revert #27426 (#27474)
Apparently, we didn't backport one of the refactoring PRs which caused
the fixup we backported to fail.

Fixes: https://github.com/go-gitea/gitea/issues/27473
2023-10-06 20:47:45 +08:00
Giteabot 44aca6a65a
Don't let API add 2 exclusive labels from same scope (#27433) (#27460)
Backport #27433 by @JakobDev

Fixes #27380

Co-authored-by: JakobDev <jakobdev@gmx.de>
2023-10-06 05:06:31 +08:00
Giteabot aaf35ee49c
Refactor system setting (#27000) (#27452)
Backport #27000 by @wxiaoguang

This PR reduces the complexity of the system setting system.

It only needs one line to introduce a new option, and the option can be
used anywhere out-of-box.

It is still high-performant (and more performant) because the config
values are cached in the config system.


![image](https://github.com/go-gitea/gitea/assets/2114189/f8cdd743-1145-41ab-9f8f-3996aa97d440)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-05 10:37:59 +00:00
Giteabot a9d547f55b
When comparing with an non-exist repository, return 404 but 500 (#27437) (#27442)
Backport #27437 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-10-04 14:41:57 +00:00
Giteabot 51001d9ffe
Fix pr template (#27436) (#27440)
Backport #27436 by @lunny

Fix #27431

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-10-04 12:56:02 +00:00
Giteabot 1ff6b7783c
Fix missing `ctx` in new_form.tmpl (#27434) (#27438)
Backport #27434 by @CaiCandong

Fix  #27432
Regression of #27265

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
2023-10-04 12:12:06 +00:00
Giteabot 99e2071eeb
Fix yet another `ctx` template bug (#27417) (#27426)
Backport #27417 by @delvh

Fixes #27416

Co-authored-by: delvh <dev.lh@web.de>
2023-10-04 07:52:57 +00:00
Giteabot 1dd84ec3a1
Use flex-container for repo and org settings (#27418) (#27430)
Backport #27418 by @silverwind

Same as https://github.com/go-gitea/gitea/pull/26046 but for repo and
org settings pages, reducing the margins between the boxes:

<img width="1247" alt="Screenshot 2023-10-03 at 23 25 19"
src="https://github.com/go-gitea/gitea/assets/115237/4e68ad5e-5fdc-4466-aefb-ec71bf411d45">
<img width="1255" alt="Screenshot 2023-10-03 at 23 27 12"
src="https://github.com/go-gitea/gitea/assets/115237/9068369b-a75d-401e-8b8d-3bd4bbe097dc">

Co-authored-by: silverwind <me@silverwind.io>
2023-10-04 07:20:43 +00:00
Giteabot 290440e1ee
Add Index to `action.user_id` (#27403) (#27425)
Backport #27403 by @JakobDev

Another Column that needs a Index. Found at
https://codeberg.org/forgejo/discussions/issues/61#issuecomment-1258744.

Co-authored-by: JakobDev <jakobdev@gmx.de>
2023-10-04 08:53:00 +02:00
Lunny Xiao 881a844c9d
Add 1.20.5 changelog (#27404) (#27412)
frontend #27404
2023-10-03 22:21:19 +08:00
Giteabot d5da0e622c
Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408)
Backport #27332 by @JakobDev

Part of https://codeberg.org/forgejo/discussions/issues/61

This is workaround for a bug in MariaDB

Co-authored-by: JakobDev <jakobdev@gmx.de>
2023-10-03 17:59:45 +08:00
Giteabot 8c6464e39b
Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)
Backport #27384 by @rbhz

Add support for HEAD in paths:
```
/src/branch/HEAD/README.md
/src/commit/HEAD/README.md
```

Closes #26920

Co-authored-by: Kirill Sorokin <48334247+rbhz@users.noreply.github.com>
2023-10-03 08:13:49 +00:00
Giteabot 4f02b4a7b9
Make Actions tasks/jobs timeouts configurable by the user (#27400) (#27402)
Backport #27400 by @fantognazza

With this PR we added the possibility to configure the Actions timeouts
values for killing tasks/jobs.
Particularly this enhancement is closely related to the `act_runner`
configuration reported below:
```
# The timeout for a job to be finished.
# Please note that the Gitea instance also has a timeout (3h by default) for the job.
# So the job could be stopped by the Gitea instance if it's timeout is shorter than this.
timeout: 3h
```

---

Setting the corresponding key in the INI configuration file, it is
possible to let jobs run for more than 3 hours.

Signed-off-by: Francesco Antognazza <francesco.antognazza@gmail.com>
2023-10-03 10:26:35 +08:00
Giteabot 7dc5ab2e95
Fix git 2.11 error when checking IsEmpty (#27393) (#27397)
Backport #27393 by @wxiaoguang

Fix #27389

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-02 22:36:18 +02:00