Commit graph

18617 commits

Author SHA1 Message Date
Giteabot
39bc868092
Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175) (#30251)
Backport #30175 by @jmlt2002

- Inline math blocks couldn't be preceeded or succeeded by
alphanumerical characters due to changes introduced in PR #21171.
Removed the condition that caused this (precedingCharacter condition)
and added a new exit condition of the for-loop that checks if a specific
'$' was escaped using '\' so that the math expression can be rendered as
intended.
- Additionally this PR fixes another bug where math blocks of the type
'$xyz$abc$' where the dollar sign was not escaped by the user, generated
an error (shown in the screenshots below)
- Altered the tests to accomodate for the changes

Former behaviour (from try.gitea.io):

![image](https://github.com/go-gitea/gitea/assets/114936010/8f0cbb21-321d-451c-b871-c67a8e1e9235)

Fixed behaviour (from my local build):

![image](https://github.com/go-gitea/gitea/assets/114936010/5c22687c-6f11-4407-b5e7-c14b838bc20d)

(Edit) Source code for the README.md file:
```
$x$ -$x$ $x$-

a$xa$ $xa$a 1$xb$ $xb$1

$a a$b b$

a$b $a a$b b$

$a a\$b b$
```

Signed-off-by: João Tiago <joao.leal.tintas@tecnico.ulisboa.pt>
Co-authored-by: João Tiago <114936010+jmlt2002@users.noreply.github.com>
(cherry picked from commit ac65aeecbd42ed30cc0838b3fad12b58daadf3ad)
2024-04-08 11:49:51 +02:00
KN4CK3R
d9442b09b5
Fix missing 0 prefix of GPG key id (#30245)
Fixes #30235

If the key id "front" byte has a single digit, `%X` is missing the 0
prefix.
` 38D1A3EADDBEA9C` instead of
`038D1A3EADDBEA9C`
When using the `IssuerFingerprint` slice `%X` is enough but I changed it
to `%016X` too to be consistent.

(cherry picked from commit eb505b128c7b9b2459f2a5d20b5740017125178b)

Conflicts:
	- models/asymkey/gpg_key_commit_verification.go
          Ported the change to models/asymkey/gpg_key_object_verification.go
(cherry picked from commit 63904e2f97)
2024-04-08 11:46:40 +02:00
Giteabot
e40ab6d0bd
Fix spacing in issue navbar (#30238) (#30242)
Backport #30238 by @silverwind

Create a new `issue-navbar` class specifically for this bar, previous
class used in many places and I thought I had them all removed, but not
this one.

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

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 39322d9fc4644d2ede3efe3a9c4efee2e493d4cd)
2024-04-08 11:44:09 +02:00
Giteabot
b310027e55
Remove scheduled action tasks if the repo is archived (#30224) (#30230)
Backport #30224 by @Zettat123

Fix #30220

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 895d2795abe79cc2e87b35d39cb7d09b9234b06d)
2024-04-08 11:41:39 +02:00
Giteabot
94fc99c217
Prevent flash of dropdown menu on labels list (#30215) (#30216)
Backport #30215 by @silverwind

On the labels list, This `left` class caused the dropdown content to
flash on page load until JS had hidden it. Remove it as I see no purpose
to it.

<img width="215" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9e1de97f-dd89-41e0-9229-5c4a786ba762">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 3ff4a6936b5ee05b3df945c466285de47ea87ef2)
2024-04-08 11:39:53 +02:00
wxiaoguang
704df1ff28
Fix home topic edit form layout (#30213)
The UI has been refactored by #30191 , so here are 2 choices:

1. Backport #30191
2. Apply this quick fix

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/0db583cf-8ce8-4fdb-9e4d-8c93fe6766c7)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/0e732c4c-d28d-4c04-b328-72b9efd7daa9)

</details>

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit e579ddc31f6d6d0406f1c5330f2a31b9707fb3e2)
2024-04-08 11:35:30 +02:00
Giteabot
89a748b368
Fix GPG subkey verify (#30193) (#30203)
Backport #30193 by @KN4CK3R

Fixes #30189

Can't verify subkeys if they are not loaded.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit e581efe238d1f735787b5dbdfcce9a1d73384ef3)
2024-04-08 11:31:31 +02:00
Giteabot
d573c22a98
Fix unclickable checkboxes (#30195) (#30199)
Backport #30195 by @silverwind

Fix https://github.com/go-gitea/gitea/issues/30185, regression from
https://github.com/go-gitea/gitea/pull/30162.

The checkboxes were unclickable because the label was positioned over
the checkbox with `padding`. Now it uses `margin` so the checkbox itself
will be clickable in all cases.

Secondly, I changed the for/id linking to also add missing `for`
attributes when `id` is present. The other way around (only `for`
present) is currently not handled and I think there are likey no
occurences in the code and introducing new non-generated `id`s might
cause problems elsewhere if we do, so I skipped on that.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 9d38c4d60ef5bd015e1430386e38d9f32e050f8f)
2024-04-08 11:30:27 +02:00
Giteabot
f4a2f439a9
Include encoding in signature payload (#30174) (#30182)
Backport #30174 by @KN4CK3R

Fixes #30119

Include the encoding in the signature payload.

before

![grafik](https://github.com/go-gitea/gitea/assets/1666336/01ab94a3-8af5-4d6f-be73-a10b65a15421)

after

![grafik](https://github.com/go-gitea/gitea/assets/1666336/3a37d438-c70d-4d69-b178-d170e74aa683)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 19443a28b7eb74016c956ff74f85c9b0ce162ed5)
2024-04-08 11:30:08 +02:00
HEREYUA
b912e26e5f Fix:the rounded corners of the folded file are not displayed correctly (#29953)
Fix:    [#29933](https://github.com/go-gitea/gitea/issues/29933)

**Before**

![image](https://github.com/go-gitea/gitea/assets/37935145/71ec80f6-5896-4e4a-b686-4d792c11ebe2)

**After**

![image](https://github.com/go-gitea/gitea/assets/37935145/81348a61-946a-4562-881d-8d873e50228f)

---------

Co-authored-by: silverwind <me@silverwind.io>
Conflicts:
	- web_src/css/modules/segment.css
	  Ported by adding the new selector with a larger radius,
          keeping the existing one with ours.
(cherry picked from commit 43122ca984)
2024-04-08 09:29:21 +00:00
Giteabot
7ac46f1151
Remove fomantic checkbox module (#30162) (#30168)
Backport #30162 by @silverwind

CSS is pretty slim already and the `.ui.toggle.checkbox` sliders on
admin page also still work. The only necessary JS is the one that links
`input` and `label` so that it can be toggled via label. All checkboxes
except the markdown ones render at `--checkbox-size: 16px` now.

<img width="174" alt="Screenshot 2024-03-28 at 22 15 10"
src="https://github.com/go-gitea/gitea/assets/115237/3455c1bb-166b-47e4-9847-2d20dd1f04db">

<img width="499" alt="Screenshot 2024-03-28 at 21 00 07"
src="https://github.com/go-gitea/gitea/assets/115237/412be2b3-d5a0-478a-b17b-43e6bc12e8ce">

<img width="83" alt="Screenshot 2024-03-28 at 22 14 34"
src="https://github.com/go-gitea/gitea/assets/115237/d8c89838-a420-4723-8c49-89405bb39474">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 591759fdfae43bc87323b644919cc9581bff1d81)
2024-04-08 11:28:31 +02:00
Earl Warren
c98d61710e Merge pull request '[v7.0/forgejo] [PORT] gitea#30282: Markup color and font size fixes' (#3104) from bp-v7.0/forgejo-ff1744c into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3104
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-08 05:48:31 +00:00
silverwind
033f2a4a17 [PORT] gitea#30282: Markup color and font size fixes
1. Distinguish inline an block code with new CSS variable
`--color-markup-code-inline`
2. Various color tweaks, better contrast from background

(cherry picked from commit 662eb4b0852f9ce2c161e7fea5ac66bf912fc9f6)

---

- Revert the changes of #2874.
- Add more contrast to the inline block for light and dark theme.

(cherry picked from commit 662eb4b0852f9ce2c161e7fea5ac66bf912fc9f6)
(cherry picked from commit ff1744cbbc)
2024-04-07 19:53:55 +00:00
Gusted
f7cc76598d Merge pull request '[v7.0/forgejo] [BUG] Fix unblock action' (#3103) from bp-v7.0/forgejo-a3f1249 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3103
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-07 17:16:25 +00:00
Gusted
0af1418e6e [BUG] Fix unblock action
- At some point the unblock button was transformed into being handled by
Javascript, however the endpoint didn't yet respond in JSON.
- Ref: https://codeberg.org/kita/.profile/raw/branch/main/img/G94IqS9.png

(cherry picked from commit a3f1249f0a)
2024-04-07 15:35:31 +00:00
Gusted
730c667122 Merge pull request '[v7.0/forgejo] [BUG] Fix tone of callout boxes for Forgejo dark' (#3092) from bp-v7.0/forgejo-515ccaa into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3092
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-07 13:07:13 +00:00
Gusted
7c23dfba46 [BUG] Fix tone of callout boxes for Forgejo dark
- Adjust the warning and success text to be more representive (make them
more green and yellow). They still confirm to AAA contrast.
- For important, note and caution callout boxes make use of the light
variants for the colors colors rather than the dark variant.
- Resolves #3084

(cherry picked from commit 515ccaacd9)
2024-04-07 11:50:27 +00:00
Gusted
de440f8b93 Merge pull request '[v7.0/forgejo] [BUG] Fix admin layout' (#3088) from bp-v7.0/forgejo-c2d0f64 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3088
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-07 10:42:05 +00:00
Gusted
7bbb93b3b1 [BUG] Fix admin layout
- Fix the layout of admin pages, it previously was full-width and had
the alert at the incorrect place and within an container.
- Make the placement of the alert consistent with other pages, inside
`flex-container-main` and not wrapped around a container.
- We have to revert 145bebc829, as this
expected that the page contain provided padding, this was provided by
the incorrect placement of the alert. As well isn't consistent with how
other pages are being shown, non-full width. The solution to the
described problem isn't optimal and should rather be fixed with the tables.
- Reverts 145bebc829
- Resolves #3082

(cherry picked from commit c2d0f64340)
2024-04-06 20:48:09 +00:00
Earl Warren
572019129e Merge pull request '[v7.0/forgejo] [FEAT] Support Include/Exclude Filters for Grep' (#3080) from bp-v7.0/forgejo-baac15f into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3080
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-06 20:44:26 +00:00
Earl Warren
da1810b12c Merge pull request '[v7.0/forgejo] Add unit tests for update git hook' (#3083) from bp-v7.0/forgejo-dad799f into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3083
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 20:40:15 +00:00
Gusted
d4a4b4b4e3 Add unit tests for update git hook
- Add unit tests.
- Handle the 'impossible' case of not enough arguments.
- Ref: https://codeberg.org/forgejo/forgejo/pulls/2834

(cherry picked from commit dad799fa46)
2024-04-06 17:39:03 +00:00
Shiny Nematoda
328f694a33 [FEAT] Support Include/Exclude Filters for Grep (#3058)
fixes `TestRepoSearch` failing occasionally

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3058
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
(cherry picked from commit baac15f316)
2024-04-06 17:38:32 +00:00
Gusted
52d217ec50 Merge pull request '[v7.0/forgejo] Sort BuiltinApplicationsClientIDs() in test' (#3079) from bp-v7.0/forgejo-eea2590 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3079
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-06 14:09:20 +00:00
forgejo-backport-action
706a7ad41e [v7.0/forgejo] Fix "view file" button in diff compare view (#3077)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/3046

This PR fixes an issue in the diff compare view, where when working on a fork that has not the same name as the upstream repo, the "View file" button links to a wrong, often missing, location.

Demonstration of this issue:
- Visit https://next.forgejo.org/mai-lapyst-test-org/upstream/compare/main...Mai-Lapyst/downstream:mai-lapyst-patch-1.
- Click the "View file" button of the patch.
- Get taken to `4fe947d522/README.md` (which does not exist and returns a 404) instead of `4fe947d522/README.md`. Note the different repository name (`upstream` vs `downstream`).

Co-authored-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3077
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2024-04-06 13:24:55 +00:00
forgejo-backport-action
5bde9555b1 [v7.0/forgejo] Add optional pronoun field in user settings (#3076)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/1518

An attempt at adding an optional pronoun field for user profiles, as suggested here 3 years ago: https://github.com/go-gitea/gitea/issues/13990

![A Forgejo profile showing pronouns to the right of the user's username](/attachments/2e5ff300-d333-46db-9074-f030f199843c)

I made this for [my own instance](https://git.gay/h) and didn't initially think I'd make a PR because of the previous closed issue, but I thought I'd ask the Forgejo matrix chat to see if there was any support and there was!

I'm told I should make a database migration, some help as to how to do that would be appreciated.

Co-authored-by: hazycora <hazysu@riseup.net>
Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3076
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2024-04-06 13:23:43 +00:00
Gusted
8d8dce747a Sort BuiltinApplicationsClientIDs() in test
- Ref https://codeberg.org/forgejo/forgejo/pulls/3069#issuecomment-1736290

(cherry picked from commit eea259055e)
2024-04-06 12:55:31 +00:00
Gusted
a070f28c81 Merge pull request '[v7.0/forgejo] [BUG] Don't remove builtin OAuth2 applications' (#3069) from bp-v7.0/forgejo-6af8f3a into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3069
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-06 12:43:33 +00:00
Earl Warren
1065ee4a60 Merge pull request '[v7.0/forgejo] Fix #3030 add Cache-Control header for health-check' (#3074) from bp-v7.0/forgejo-323d7ad-84f5115-d2ff8f8-b210a3e into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3074
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 09:55:19 +00:00
Earl Warren
3da5ad9a00 Merge pull request '[v7.0/forgejo] feat: improve nuget nuspec api' (#3073) from bp-v7.0/forgejo-bc72fd7 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3073
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 09:50:50 +00:00
Gusted
d2a7905d9d Merge pull request '[v7.0/forgejo] Refactor LFS GC functions' (#3072) from bp-v7.0/forgejo-7ffa7f5 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3072
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 09:34:01 +00:00
Earl Warren
8e27c91df2 Merge pull request '[v7.0/forgejo] [BUG] fix webhook creation payload ref' (#3070) from bp-v7.0/forgejo-2c85a14-9d29192 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3070
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-06 09:01:19 +00:00
Ada
7aa0999c9f Remove useless t.run
(cherry picked from commit 323d7ad507)
2024-04-06 08:44:23 +00:00
Ada
8ddfd26d97 Add health-check test
(cherry picked from commit 84f5115bd1)
2024-04-06 08:44:23 +00:00
Ada
12c28641ab Remove old proxy backwards compatibility
(cherry picked from commit d2ff8f8720)
2024-04-06 08:44:23 +00:00
Ada
3eab81fdea Fix #3030 add Cache-Control header for health-check
(cherry picked from commit b210a3ebd5)
2024-04-06 08:44:23 +00:00
Michael Kriese
091400b656 feat: improve nuget nuspec api
(cherry picked from commit bc72fd7f46)
2024-04-06 08:32:53 +00:00
Gusted
aa7346c007 Refactor LFS GC functions
- Remove options that currently aren't set
on `GarbageCollectLFSMetaObjectsOptions` and
`IterateLFSMetaObjectsForRepoOptions`.
- Simplify `IterateRepositoryIDsWithLFSMetaObjects` and
`IterateLFSMetaObjectsForRepo`.
- `IterateLFSMetaObjectsForRepo` was previously able to get in a
loop (`gc-lfs` doctor check was able to reproduce this) because the code
expected that the records would be updated to not match the SQL query,
but that wasn't the case. Simply enforce that only records higher than
the latest `id` from the previous iteration are allowed.
- For `gc-lfs` doctor check this was because `UpdatedLessRecentlyThan`
option was not set, which caused that records just marked as active in
the iteration weren't being filtered.
- Add unit tests
- Most likely a regression from 2cc3a6381c.
- The bug with `gc-lfs` was found on Codeberg.

(cherry picked from commit 7ffa7f5bce)
2024-04-06 07:41:40 +00:00
oliverpool
a2a833c5ac [FIX] webhook creation payload ref
(cherry picked from commit 2c85a1417b)
2024-04-06 07:30:48 +00:00
oliverpool
4a8eb1caa1 [TEST] webhook creation payload ref
(cherry picked from commit 9d2919248b)
2024-04-06 07:30:48 +00:00
Gusted
2236574d50 [BUG] Don't remove builtin OAuth2 applications
- When the database consistency is being run it would check for any
OAuth2 applications that don't have an existing user. However there are
few special OAuth2 applications that don't have an user set, because
they are global applications.
- This was not taken into account by the database consistency checker
and were removed if the database consistency check was being run with
autofix enabled.
- Take into account to ignore these global OAuth2 applications when
running the database consistency check.
- Add unit tests.
- Ref: https://codeberg.org/Codeberg/Community/issues/1530

(cherry picked from commit 6af8f3a3f2)
2024-04-06 07:03:41 +00:00
Earl Warren
7e5fed7e29 Merge pull request '[v7.0/forgejo] [CHORE] Remove Gitea specific files' (#3066) from bp-v7.0/forgejo-396b539 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3066
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 07:02:35 +00:00
Gusted
1db55b1754 [CHORE] Remove Gitea specific files
- Removal of `docs`, this contains Gitea documentation which is not used
by Forgejo.
- Removal of `CHANGELOG.md` this contains only Gitea commits of
releases, instead `RELEASE-NOTES.md` should be used instead which also
contains Forgejo commits.

(cherry picked from commit 396b539496)
2024-04-05 20:41:12 +00:00
Earl Warren
7df46a9b34 Merge pull request '[v7.0/forgejo] [FEAT] sourcehut webhooks' (#3065) from bp-v7.0/forgejo-ed9dd0e-04a398a into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3065
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-05 20:35:05 +00:00
oliverpool
82b92c3f2c [FEAT] sourcehut webhooks
(cherry picked from commit ed9dd0e62a)
2024-04-05 19:36:04 +00:00
oliverpool
4ad42a4e3f [REFACTOR] webhook shared code to prevent import cycles
(cherry picked from commit 04a398a1af)
2024-04-05 19:36:03 +00:00
Earl Warren
be41258d5c Merge pull request '[v7.0/forgejo] Provide plural support for followers/following in user profiles' (#3053) from bp-v7.0/forgejo-ddedcd4-df2a83e into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3053
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-05 09:35:25 +00:00
Earl Warren
fe8b34b8fc Merge pull request 'Mark deprecation of MSSQL' (#3041) from gusted/forgejo-deprecate-mssql into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3041
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-05 06:46:08 +00:00
Earl Warren
f5cd6339a8 Merge pull request '[v7.0/forgejo] Revert "[CI] pin go v1.22.2 version"' (#3051) from bp-v7.0/forgejo-2625335 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3051
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-05 06:43:22 +00:00
0ko
68476e2494 Use people icon instead of person on profiles
(cherry picked from commit ddedcd44b7)
2024-04-05 06:32:11 +00:00