Compare commits

...

3127 Commits

Author SHA1 Message Date
Earl Warren b1c16a673d Merge pull request 'Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.59.0' (#3971) from renovate/github.com-golangci-golangci-lint-cmd-golangci-lint-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3971
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-06-02 16:24:19 +00:00
Earl Warren 36ae4ae70e Merge pull request 'add missed return in POST /repos/{owner}/{repo}/push_mirrors' (#3945) from earl-warren/forgejo:wip-missed-return into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3945
Reviewed-by: Victoria <efertone@noreply.codeberg.org>
2024-06-02 15:43:51 +00:00
Earl Warren 166bb2861f
tests(api): POST /repos/{owner}/{repo}/push_mirrors coverage 2024-06-02 16:31:41 +02:00
Earl Warren 5747951cc7
test(mock): DeletePushMirrors & AddPushMirrorRemote
make them into variables that can be mocked
2024-06-02 16:31:41 +02:00
Lunny Xiao ba37b9e577
Add missed return after `ctx.ServerError` (#31130) (partial)
Only routers/api/v1/repo/mirror.go

(cherry picked from commit b6f15c7948ac3d09977350de83ec91d5789ea083)
2024-06-02 16:31:41 +02:00
Earl Warren 16e8dfe417 Merge pull request 'test(util): MockProtect when mocking multiple times' (#3959) from earl-warren/forgejo:wip-mock-protect into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3959
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Reviewed-by: Victoria <efertone@noreply.codeberg.org>
2024-06-02 14:27:35 +00:00
Earl Warren 884b3c0f4b
test(util): MockProtect when mocking multiple times
It is fine to use MockVariableValue to change a setting such as:

defer test.MockVariableValue(&setting.Mirror.Enabled, true)()

But when testing for errors and mocking a function, multiple variants
of the functions will be used, not just one. MockProtect a function
will make sure that when the test fails it always restores a sane
version of the function. For instance:

defer test.MockProtect(&mirror_service.AddPushMirrorRemote)()

mirror_service.AddPushMirrorRemote = mockOne
do some tests that may fail

mirror_service.AddPushMirrorRemote = mockTwo
do more tests that may fail
2024-06-02 15:24:06 +02:00
0ko c7f01c9bbd Refactor install page hints (#3961)
- rewrite a lot of hints on install page
- make sure checkboxes don't hide useful information behind hover
This is good for compactness but makes first-time installation more painful than it should be. BTW, this was inherited from Gogs.
- update related translation keys (will require Weblate sync to merge)
- make sure string locations in en-US.ini make sense. Unfortunately, makes viewing changes harder, but I've attached screenshots

## Preview

![](https://codeberg.org/attachments/b0d26013-5fd9-495c-b4c0-7919f9f6fbf4)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3961
Reviewed-by: Otto <otto@codeberg.org>
2024-06-02 13:06:56 +00:00
Codeberg Translate ebabb96ce0 [I18N] Translations update from Weblate (#3908)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: wintryexit <weatherdowner@proton.me>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Atalanttore <Atalanttore@users.noreply.translate.codeberg.org>
Co-authored-by: kdh8219 <kdh8219@monamo.dev>
Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: purkwiat <purkwiat@gmail.com>
Co-authored-by: KaKi87 <KaKi87@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: gitcookie-1 <gitcookie-1@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3908
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-06-02 12:01:06 +00:00
Earl Warren 319af78171 Merge pull request 'Adding release note for #3337' (#3984) from Mai-Lapyst/forgejo:add-releasenote-3337 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3984
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-06-02 06:41:20 +00:00
Earl Warren 2c94bbf751 Merge pull request 'Add missing options & values to app.example.ini' (#3983) from Mai-Lapyst/forgejo:cleanup-app-example-ini into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3983
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-06-02 06:39:42 +00:00
Mai-Lapyst 56a6d3f77d
Adding release note for #3337 2024-06-02 06:04:53 +02:00
Mai-Lapyst c3d60ed9f7
Cleanup & add missing options to app.example.ini 2024-06-02 03:32:36 +02:00
0ko 1084362f7c CSS improvements around commit status icons (#3948)
- make sure margins are all consistent and good, elements are not too close or too apart
- this also applies to "Show commit body" button
- remove unused code. The class `commit-status-link` doesn't exist in templates, nor I could find it on any related pages in case it's generated in runtime

## Preview

![](/attachments/9cf6d73a-8132-4f30-8094-5687d7dd98e9)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3948
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-06-01 15:20:40 +00:00
Earl Warren 6d712590f1
chore(lint): make golangci-lint to v1.59.0 happy 2024-06-01 16:17:07 +02:00
Renovate Bot 288075c724 Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.59.0 2024-06-01 02:07:47 +00:00
Earl Warren f887972348 Merge pull request 'forgejo-federated-star: UI to define following repos' (#3886) from meissa/forgejo:forgejo-federated-pr5 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3886
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-31 15:57:17 +00:00
Earl Warren 5e71e0fd4a Merge pull request 'chore(renovate): use sqlite package cache' (#3958) from viceice/renovate-sqlite into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3958
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-31 15:32:02 +00:00
Michael Jerger 8aade372cb add a release note 2024-05-31 16:28:26 +02:00
Earl Warren 3a469d72a0 Merge pull request 'Update module github.com/go-testfixtures/testfixtures/v3 to v3.11.0' (#3955) from renovate/github.com-go-testfixtures-testfixtures-v3-3.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3955
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-31 13:51:08 +00:00
Earl Warren dd4a1aa0d4
chore(dependency): automerge go-testfixtures/testfixtures
Refs: https://codeberg.org/forgejo/forgejo/pulls/3955
2024-05-31 15:10:49 +02:00
Michael Kriese 629554f8a8
chore(renovate): use sqlite package cache 2024-05-31 13:54:12 +02:00
Earl Warren a1ef8eaf29 Merge pull request 'Disable self-registration by default on the install page' (#3934) from algernon/forgejo:abandon-all-registration-all-ye-who-enter-here into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3934
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-05-31 11:49:20 +00:00
Earl Warren 05c55e53a8 Merge pull request 'Update linters' (#3921) from renovate/linters into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3921
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-31 10:39:01 +00:00
forgejo-renovate-action 494ef1a78a Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.382.4' (#3957) from renovate/ghcr.io-visualon-renovate-37.x into forgejo 2024-05-31 10:33:50 +00:00
Renovate Bot 1a6fb16166 Update ghcr.io/visualon/renovate Docker tag to v37.382.4 2024-05-31 09:09:22 +00:00
Renovate Bot 430183fa14 Update linters 2024-05-31 08:55:12 +00:00
Earl Warren dcc842dfeb Merge pull request 'chore(renovate): disallow `eslint-plugin-no-use-extend-native` v0.6.0+, requires eslint v9' (#3951) from viceice/forgejo:chore/renovate/update-config into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3951
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-31 08:36:38 +00:00
Michael Kriese 99789e2b9a
chore(renovate): disallow `eslint-plugin-no-use-extend-native` v0.6.0+, requires eslint v9 2024-05-31 09:00:52 +02:00
Gergely Nagy 6b24a7919d
Add a release note about the previous changes
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-31 08:21:55 +02:00
Earl Warren e48b23c2be Merge pull request 'Update dependency happy-dom to v14.12.0' (#3954) from renovate/happy-dom-14.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3954
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-31 05:56:24 +00:00
Earl Warren 3a8a8fb467 Merge pull request 'Update module github.com/alecthomas/chroma/v2 to v2.14.0 (take 2)' (#3952) from earl-warren/forgejo:wip-chroma into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3952
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-05-31 05:25:06 +00:00
forgejo-renovate-action d1c4586d6b Merge pull request 'Update dependency swagger-ui-dist to v5.17.13' (#3929) from renovate/swagger-ui-dist-5.17.x into forgejo 2024-05-31 04:34:46 +00:00
Renovate Bot 652c2840f9 Update dependency happy-dom to v14.12.0 2024-05-31 04:07:17 +00:00
Renovate Bot 7ad366d253 Update dependency swagger-ui-dist to v5.17.14 2024-05-31 04:06:55 +00:00
0ko 503953fb9b Unify vertical and horizontal paddings in markup file view (#3944)
Use the same padding horizontally and vertically, so the views like readme look a bit nicer. Just slightly adjusted two values, nothing really test-able here.

## Motivation

I came to the conclusion that they should be the same myself, later I checked GitHub and it turned out to also use the same paddings. I would like to notice that the padding here (2em = 32px) is the same as GitHub uses too.
I find this as a logical UI change because the paddings are usually same on both axis across the UI (like on PR sidebar).

Also updated paddings for when the files are shown in profile, but copied the `1.5em` that GitHub uses. This, once again, makes sense, because the overview markdown isn't the primary content, or as primary as the readme on the repo is, taking the full usable width.

## Preview

https://codeberg.org/attachments/55f6685c-1978-410a-a17b-9fac91f0642e
---
https://codeberg.org/attachments/d9016a1c-13cf-4ea6-a8e4-2619d93f3560

## Note

`.non-diff-file-content .plain-text` is left untouched with `1em 2em`, because the plaintext seems to add it's own margins, so it would make it look worse.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3944
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-31 03:38:45 +00:00
Renovate Bot 5e33f2d50f Update module github.com/go-testfixtures/testfixtures/v3 to v3.11.0 2024-05-31 00:05:11 +00:00
Earl Warren e417e424fa
Update module github.com/alecthomas/chroma/v2 to v2.14.0 (take 2)
Because the branch of the other PR was deleted by mistake.

Refs: https://codeberg.org/forgejo/forgejo/pulls/3922
2024-05-30 22:52:26 +02:00
0ko 68c9e9c2b9 Remove unused CSS rules (#3937)
Remove CSS code that was made unused by some changes in Gitea. I was working on a layout change here but was bothered a bit by these. I dug a bit into the git history to find out how they were made unused but it's relatively uneasy.

- remove rule that was setting `width: 100%;`: the exactly same selector setting this exact value is duplicated below
- remove rules with `followers` in selectors: we don't use this class in templates (would be nice if someone double-checks)
- my editor forced EoF fix

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3937
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-30 11:41:45 +00:00
Earl Warren b1e04a89be Merge pull request 'Fix localization of release/tag counters on releases page' (#3938) from 0ko/forgejo:i18n-release-page into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3938
2024-05-29 22:06:22 +00:00
0ko 83e6b0c0c6 Fix localization of release/tag counters on releases page 2024-05-29 22:46:36 +05:00
Michael Jerger 2f7f1aab8a fix review 2024-05-29 18:31:06 +02:00
Michael Jerger 5620dd76fa Merge branch 'forgejo' into forgejo-federated-pr5 2024-05-29 18:26:16 +02:00
Earl Warren 73f6e8809a Merge pull request 'Update dependency happy-dom to v14.11.2' (#3928) from renovate/happy-dom-14.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3928
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-28 17:52:41 +00:00
Earl Warren 8cca0d74dc Merge pull request 'mailer: Switch X-Mailer to "Forgejo"' (#3931) from algernon/forgejo:mailer-detox into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3931
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-28 17:51:04 +00:00
Earl Warren f770ae3eb6 Merge pull request 'mailer: Put the username in X-Forgejo-Sender and -Recipient' (#3932) from algernon/forgejo:of-display-and-user-names into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3932
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-28 17:50:01 +00:00
Earl Warren ae99aa0bbe Merge pull request 'migrations: Map non-existant external users to Ghost' (#3935) from algernon/forgejo:who-let-the-nils-out into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3935
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-28 16:42:31 +00:00
Renovate Bot 59a1336b8d Update dependency happy-dom to v14.11.2 2024-05-28 14:04:44 +00:00
Earl Warren 7af3a981b5 Merge pull request '[gitea] week 2024-22 cherry pick (gitea/main -> forgejo)' (#3917) from earl-warren/wcp/2024-22 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3917
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-05-28 10:50:48 +00:00
Gergely Nagy ade7304eea
migrations: Map non-existant external users to Ghost
When performing migrations, and need to remap external users to local
ones, when no local mapping is possible, map the external user to Ghost,
rather than the user who initiated the migration.

Mapping the external user to the migration initiator has the potential
of breaking assumptions elsewhere, like only having one review per pull
request per user. Mapping these migrated, locally unavailable users to
Ghost makes sure these - often hidden - assumptions do not break.

Fixes #3860.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-28 12:40:11 +02:00
Gergely Nagy 9fc61cae48
install: Force DisableRegistration on during install
When installing Forgejo via the on-line installer, force
DisableRegistration to true, to discourage creating instances with open
registration. Because open registration requires constant vigil to fight
off spammers of all kinds, it is not a great default. It should be a
conscious decision. This change is made in an effort to make the choice
of running an instance with open registration a conscious choice, rather
than simply the default.

Partially addresses #3925.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-28 08:57:30 +02:00
Gergely Nagy 95808a3cfd
install: Make "Disable self-registration" more prominent
Having an instance with open registration requires work, otherwise it
will be overrun by spammers of all kinds. Yet, the setting to disable
open registration on the installation page is hidden behind "optional
settings", a place hardly anyone ever looks.

To improve the situation, lift the setting out of that, and place it
more prominently, just above the update checker setting.

Partially addresses #3925.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-28 08:53:31 +02:00
Gergely Nagy 4bccc96684
mailer: Put the username in X-Forgejo-Sender and -Recipient
Following gitea#28981, set `X-Forgejo-Sender` and `X-Forgejo-Recipient`
to the username of the respective users, rather than their display name.
The username is more appropriate for these headers, for filtering
purposes. The display name is already included in the From header.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-28 08:27:37 +02:00
Gergely Nagy 887c027ec2
mailer: Switch X-Mailer to "Forgejo"
Fixes #3930.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-28 08:19:03 +02:00
silverwind afa1380672
Change `--border-radius-circle` to `--border-radius-full` (gitea#30936)
Cherry-pick of 2ced31e81d adapted to Forgejo releases UI.

Percentage-based `border-radius` [creates undesirable
ellipse](https://jsfiddle.net/silverwind/j9ko5wnt/4/) on non-square
content. Instead, use pixel value and use same wording `full` like
tailwind does, but increast to 99999px over their 9999px.

(cherry picked from commit 2ced31e81dd9e45659660c1abff529d0192fd8ed)
2024-05-27 13:15:20 +02:00
Earl Warren 95ccbb5995 Merge pull request 'Update dependency updates to v16.1.1' (#3920) from renovate/updates-16.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3920
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-27 05:47:51 +00:00
Earl Warren d17c8ad7fc Merge pull request 'Update dependency markdownlint-cli to v0.41.0' (#3919) from renovate/markdownlint-cli-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3919
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-27 05:46:18 +00:00
0ko b6849b8e7d Merge pull request 'Port: Fix long branch name overflows (https://github.com/go-gitea/gitea/pull/30345)' (#3890) from 0ko/forgejo:fix-branch-overflow-2 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3890
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
2024-05-27 04:24:41 +00:00
0ko b2eba34506 Unify usercards margins (#3915)
These are some slight design changes to how usercards are presented.

- `margin`: removed one of the sides so the margins are the same in both axis
- `margin`: increased from 10px to 15px
Previously it was (Y, X) = (20, 10); now it's (15, 15)
 - `width`: slightly decreased so that the point, where too small screen width causes card relocation to another row, doesn't increase
- `padding`: this change does nothing visually. `padding-bottom` was useless because padding was already set for all sides by another rule `.ui.segment {padding: 1em};`. This change just ensures that padding stays the same for all sides even if `.ui.segment` changes, instead of causing inconsistency
- `margin-bottom`: added as an override to margin caused by `display: flex`. From my research, usually there's `25px` gap between the content and the pagination. It was `39px` here, now it's `25px` too

### Before

![image](/attachments/0ebf6f44-6b27-4d4d-8856-77568291518c)

### After

![image](/attachments/1e0a3d95-ac49-4d10-8e00-86cc041d4338)

I can't show the distance between the content and the pagination, but the change does work when applying via devtools on https://codeberg.org/forgejo/forgejo/stars.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3915
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>
2024-05-27 04:22:48 +00:00
Renovate Bot 23a991a0b4 Update dependency updates to v16.1.1 2024-05-27 00:04:27 +00:00
Renovate Bot 319acec27c Update dependency markdownlint-cli to v0.41.0 2024-05-27 00:04:18 +00:00
Earl Warren 4a9dd87496 Merge pull request 'fix(release): golang:1.22-alpine3.20 does not have all architectures' (#3918) from earl-warren/forgejo:wip-alpine into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3918
Reviewed-by: thefox <thefox@noreply.codeberg.org>
2024-05-26 20:24:52 +00:00
Earl Warren d59ed64345
fix(release): golang:1.22-alpine3.20 does not have all architectures
It was premature to try to use them, try again later.

https://codeberg.org/forgejo-integration/forgejo/actions/runs/2147

github.com/docker/buildx v0.14.1 59582a88fca7858dbe1886fd1556b2a0d79e43a3
::endgroup::
[command]/usr/bin/docker buildx build --build-arg RELEASE_VERSION=8.0-test --file Dockerfile --iidfile /tmp/docker-actions-toolkit-UzuWxS/iidfile --platform linux/amd64,linux/arm64,linux/arm/v6 --tag codeberg.org/***/forgejo:8.0-test --metadata-file /tmp/docker-actions-toolkit-UzuWxS/metadata-file --push .
------
 > [linux/arm/v6 internal] load metadata for code.forgejo.org/oci/golang:1.22-alpine3.20:
------
Dockerfile:3
--------------------
   1 |     FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
   2 |
   3 | >>> FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.22-alpine3.20 as build-env
   4 |
   5 |     ARG GOPROXY
--------------------
Dockerfile:1
--------------------
   1 | >>> FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
   2 |
   3 |     FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.22-alpine3.20 as build-env
--------------------
Dockerfile:54
--------------------
  52 |     RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
  53 |
  54 | >>> FROM code.forgejo.org/oci/golang:1.22-alpine3.20
  55 |     ARG RELEASE_VERSION
  56 |     LABEL maintainer="contact@forgejo.org" \
--------------------
ERROR: failed to solve: code.forgejo.org/oci/golang:1.22-alpine3.20: failed to resolve source metadata for code.forgejo.org/oci/golang:1.22-alpine3.20: no match for platform in manifest: not found
::error::buildx failed with: ERROR: failed to solve: code.forgejo.org/oci/golang:1.22-alpine3.20: failed to resolve source metadata for code.forgejo.org/oci/golang:1.22-alpine3.20: no match for platform in manifest: not found
2024-05-26 21:51:57 +02:00
Zettat123 df15abd072
Support setting the `default` attribute of the issue template dropdown field (#31045)
Fix #31044

According to [GitHub issue template
documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-for-dropdown),
the `default` attribute can be used to specify the preselected option
for a dropdown field.

(cherry picked from commit 7ab0988af140aa3e0204979765f75961f1dc9c11)
2024-05-26 20:13:09 +02:00
Kemal Zebari d6e454c320
Sync up deleted branches & action assets related cleanup documentation (#31022)
Syncs up docs associated to actions and deleted branch cleanup i.e. in
custom/app.example.ini and the config cheat sheet.

(cherry picked from commit c9eac519961ecd5d0e1d6ee856ab532e8c16c65d)

Conflicts:
	docs/content/administration/config-cheat-sheet.en-us.md
	docs do not exist here in Forgejo
2024-05-26 20:09:01 +02:00
6543 2717d7bdad
Add nix flake for dev shell (#30967)
To try it you need **nix** installed `nix-daemon ` running and your user
has to be member of the **nix-users** group. Or use NixOS.

then by just:
```sh
nix develop -c $SHELL
```
a dedicated development environment with all needed packages will be
created.

(cherry picked from commit de6f0488a67ad65bd2ac40356b08a78a365414cd)
2024-05-26 20:08:07 +02:00
Denys Konovalov 07fe5a8b13
use existing oauth grant for public client (#31015)
Do not try to create a new authorization grant when one exists already,
thus preventing a DB-related authorization issue.

Fix https://github.com/go-gitea/gitea/pull/30790#issuecomment-2118812426

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 9c8c9ff6d10b35de8d2d7eae0fc2646ad9bbe94a)
2024-05-26 19:02:48 +02:00
Lunny Xiao 7d7ea45465
Fix automerge will not work because of some events haven't been triggered (#30780)
Replace #25741
Close #24445
Close #30658
Close #20646
~Depends on #30805~

Since #25741 has been rewritten totally, to make the contribution
easier, I will continue the work in this PR. Thanks @6543

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit c6cf96d31d80ab79d370a6192fd761b4443daec2)

Conflicts:
	tests/integration/editor_test.go
	trivial context conflict because of 75ce1e2ac1 [GITEA] Allow user to select email for file operations in Web UI
	tests/integration/pull_merge_test.go
	trivial context conflicts in imports because more tests were added in Forgejo
2024-05-26 19:01:36 +02:00
Kemal Zebari 0e0ab349fb
Don't include link of deleted branch when listing branches (#31028)
From
https://github.com/go-gitea/gitea/issues/31018#issuecomment-2119622680.

This commit removes the link to a deleted branch name because it returns
a 404 while it is in this deleted state. GitHub also throws a 404 when
navigating to a branch link that was just deleted, but this deleted
branch is removed from the branch list after a page refresh. Since with
Gitea this deleted branch would be kept around for quite some time
(well, until the "cleanup deleted branches" cron job begins), it makes
sense to not have this as a link that users can navigate to.

(cherry picked from commit 1007ce764ea80b48120b796175d7d1210cbb6f74)
2024-05-26 18:45:23 +02:00
wxiaoguang 5612cf32e5
Refactor sha1 and time-limited code (#31023)
Remove "EncodeSha1", it shouldn't be used as a general purpose hasher
(just like we have removed "EncodeMD5" in #28622)

Rewrite the "time-limited code" related code and write better tests, the
old code doesn't seem quite right.

(cherry picked from commit fb1ad920b769799aa1287441289d15477d9878c5)

Conflicts:
	modules/git/utils_test.go
	trivial context conflict because sha256 testing in Forgejo has diverged
2024-05-26 18:43:30 +02:00
Zettat123 886a675f62
Return `access_denied` error when an OAuth2 request is denied (#30974)
According to [RFC
6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1),
when the resource owner or authorization server denied an request, an
`access_denied` error should be returned. But currently in this case
Gitea does not return any error.

For example, if the user clicks "Cancel" here, an `access_denied` error
should be returned.

<img width="360px"
src="https://github.com/go-gitea/gitea/assets/15528715/be31c09b-4c0a-4701-b7a4-f54b8fe3a6c5"
/>

(cherry picked from commit f1d9f18d96050d89a4085c961f572f07b1e653d1)
2024-05-26 18:37:20 +02:00
wxiaoguang f6e50abd65
Fix data-race during testing (#30999)
Fix #30992

(cherry picked from commit 47accfebbd69e5f47d1b97a3e39cf181fab7e597)

Conflicts:
	models/unit/unit.go
	trivial context conflict because of
	e07b0e75ff Add a direct link from repo header to unit settings
2024-05-26 18:28:26 +02:00
wxiaoguang a649610d61
Fix "force private" logic (#31012)
When creating a repo, the "FORCE_PRIVATE" config option should be
respected, `readonly` doesn't work for checkbox, so it should use
`disabled` attribute.

(cherry picked from commit edbf74c418061b013a5855f604dd6be6baf34132)

Conflicts:
	templates/repo/create.tmpl
	templates/repo/migrate/codebase.tmpl
	templates/repo/migrate/git.tmpl
	templates/repo/migrate/gitbucket.tmpl
	templates/repo/migrate/gitea.tmpl
	templates/repo/migrate/github.tmpl
	templates/repo/migrate/gitlab.tmpl
	templates/repo/migrate/gogs.tmpl
	templates/repo/migrate/onedev.tmpl
	already in forgejo fc0c5e80da Fix and improve repo visibility checkbox when FORCE_PRIVATE is on (#3786)
        enforcing FORCE_PRIVATE on repo settings was manually tested
	with a repository of an unprivileged user after setting
	FORCE_PRIVATE = true
2024-05-26 18:20:33 +02:00
GiteaBot 4d30a49031
[skip ci] Updated licenses and gitignores
(cherry picked from commit 82a0c36332824b8ab41efdf6503e86170ce92f08)
2024-05-26 17:59:46 +02:00
Earl Warren f2204d81f1 Merge pull request 'tests(web): verify compressed files are not re-compressed' (#3909) from earl-warren/forgejo:wip-skip-gzip into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3909
Reviewed-by: Victoria <efertone@noreply.codeberg.org>
2024-05-26 11:12:05 +00:00
0ko c3ffa30e7a [I18N] Fixes and improvements to English locale (#3912)
Mostly cap fixes and a few improvements.

As for `activity.active_prs_count_`, it currently looks like this in the UI, I fixed it:
![image](/attachments/5d2dc089-519e-4655-8f8b-f78964ff179a)

Although I'm also the person who [introduced](4c1af0d9a6) the inconsistency.

`send_reset_mail` is a button, removed redundant word from it. It would be good to refactor such keys, but it will be an impossibly long process. Anyway, key refactors are done in separate PRs for easier merges.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3912
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-26 11:06:28 +00:00
Earl Warren 8790ce1890 Merge pull request 'Delete .changelog.yml' (#3913) from 0ko/forgejo:_.changelog.yml into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3913
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-26 10:50:36 +00:00
0ko b4c7cf6099 Delete .changelog.yml 2024-05-26 09:49:38 +05:00
Earl Warren a05eb66c99
tests(web): verify compressed files are not re-compressed
the test file used has a size below the default threshold and will
never be compressed because of that, regardless of its extension. Reduce
the threshold to 10 bytes otherwise the test is a false positive.
2024-05-25 23:54:28 +02:00
Codeberg Translate 0281af75f4 [I18N] Translations update from Weblate (#3851)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: Anonymous <anonymous@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: kdh8219 <kdh8219@monamo.dev>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: NameLessGO <NameLessGO@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3851
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-05-25 18:32:20 +00:00
Earl Warren bd32dedb48 Merge pull request 'fix(services): set SendNotificationEmailOnNewUser' (#3904) from earl-warren/forgejo:wip-new-user-notify into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3904
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-05-25 15:11:16 +00:00
Earl Warren ff2a3f4e3a
fix(services): set SendNotificationEmailOnNewUser
regression from 767e9634d3. It changed
the parsing of the [admin] section from being derived from the content
of each key with mustMapSetting(rootCfg, "admin", &Admin) to
explicitly listing all keys in the code.

SEND_NOTIFICATION_EMAIL_ON_NEW_USER was not added and therefore
ignored. As a consequence notifications of newly registered users were
never sent.
2024-05-25 16:27:44 +02:00
Earl Warren b1e78f0354 Merge pull request 'Update redis Docker tag to v7.2.5' (#3896) from renovate/redis-7.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3896
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-25 08:40:32 +00:00
Earl Warren 3cf92e07df Merge pull request 'Update dependency codespell to v2.3.0' (#3898) from renovate/codespell-2.x-lockfile into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3898
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-25 08:23:55 +00:00
Earl Warren b208b368d8 Merge pull request 'fix(cli): add missing quote in storage help' (#3893) from earl-warren/forgejo:wip-cli-typo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3893
Reviewed-by: Victoria <efertone@noreply.codeberg.org>
2024-05-25 07:46:22 +00:00
Earl Warren 8153dafc73 Merge pull request 'feat(release): fetch OCI alpine images from code.forgejo.org/oci' (#3892) from earl-warren/forgejo:wip-alpine into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3892
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-25 07:45:37 +00:00
Earl Warren c7711dac6d
chore: fix typos identified by mispell 2024-05-25 09:43:50 +02:00
Earl Warren 041932ed01
feat(release): fetch OCI alpine images from code.forgejo.org/oci
Use code.forgejo.org/oci instead of docker.io
so that builds are not subject to rate-limiting when debugging.

The mirrored images are updated daily

https://code.forgejo.org/forgejo/oci-mirror/src/branch/main/.forgejo/workflows/mirror.yml
2024-05-25 08:55:31 +02:00
Earl Warren 8c3c68e613 Merge pull request 'Update code.forgejo.org/oci/alpine Docker tag to v3.20' (#3897) from renovate/code.forgejo.org-oci-alpine-3.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3897
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-25 06:34:06 +00:00
Earl Warren 98be7826a3
chore(dependency): pin redis to 7.2 for testing
There is no need to pin a specific patch version for testing. The
worst that can happen in this context is that the CI fails and it can
be addressed in this context. It will not impact releases.
2024-05-25 08:25:51 +02:00
Earl Warren 534f88dd9a Merge pull request 'Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.58.2' (#3895) from renovate/github.com-golangci-golangci-lint-cmd-golangci-lint-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3895
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-25 06:17:21 +00:00
Renovate Bot 5d5ac041cd Update dependency codespell to v2.3.0 2024-05-25 02:07:08 +00:00
Renovate Bot 3b0501e69f Update code.forgejo.org/oci/alpine Docker tag to v3.20 2024-05-25 02:05:40 +00:00
Renovate Bot 237362ddd3 Update redis Docker tag to v7.2.5 2024-05-25 00:05:17 +00:00
Renovate Bot 5f0380cefb Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.58.2 2024-05-25 00:05:01 +00:00
Earl Warren 84bc4662c2
fix(cli): add missing quote in storage help 2024-05-25 00:32:36 +02:00
0ko b478bfb3cf Merge pull request 'Update dependency @github/text-expander-element to v2.7.0' (#3807) from renovate/github-text-expander-element-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3807
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-24 17:34:21 +00:00
0ko da12320a0c Replace imgage diff png background pattern with gradient (#3870)
Made the checkerboard background be more flexible in terms of scale and coloring. Provides dark theme for image diff.

I suppose these colors should not be re-used for a color-picker for a example, because it's usually more convenient to always have it in the light mode.

## Test

* go to e6d3623c7e99d6b65100904ed82d6b05d2
* or migrate https://next.forgejo.org/image-test/image-diff to your local instance

## Before/after

![image](/attachments/3835a455-69e0-4aec-bc67-5b226d8016c1)

(Old any - New Forgejo dark - New Gitea dark - New Forgejo/Gitea light)

---

Gradient property is taken from [here](https://www.reddit.com/r/css/comments/u08pf3/how_to_make_a_checkerboard_using_background/).

[CSS compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/conic-gradient#browser_compatibility): about four years of browser versions.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3870
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-24 17:33:13 +00:00
silverwind f6c1fd76f2 Fix long branch name overflows (https://github.com/go-gitea/gitea/pull/30345)
Fixes: https://github.com/go-gitea/gitea/issues/27971
Fixes: https://github.com/go-gitea/gitea/pull/28010

<img width="689" alt="Screenshot 2024-04-09 at 00 19 57"
src="https://github.com/go-gitea/gitea/assets/115237/7c895a47-274f-40a6-a126-290658f1982d">

Also fixes a similar issue in issue list where CSS was there but not
active because of missing `display: block`.

<img width="372" alt="Screenshot 2024-04-09 at 00 18 25"
src="https://github.com/go-gitea/gitea/assets/115237/cfbee7cd-2e15-4ac7-96ce-020816f48798">

---
Little conflict in branch_selector_field (repo.pulls.no_results is renamed in Gitea)
And some weird conflict on new CSS rules added.
2024-05-24 22:11:37 +05:00
Earl Warren 509a077ec0 Merge pull request 'mysql: faster user deletion (hook_task query) for mariadb 10' (#3865) from oliverpool/forgejo:join_delete_hook_task into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3865
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-24 12:44:03 +00:00
Earl Warren 5fa2d8f5ca Merge pull request 'Fix expand diff in pull requests being 404 (port of gitea#31013)' (#3885) from algernon/forgejo:gitea/port/31013 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3885
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-24 12:42:19 +00:00
Michael Jerger 9705d42e02 lint 2024-05-24 13:38:43 +02:00
Michael Jerger 82cb9e0203 ui for adding following repos 2024-05-24 13:28:15 +02:00
oliverpool 4ffda656e8 mysql: use inner join for hook_task deletion
Attempt to fix #3678
2024-05-24 10:31:41 +02:00
oliverpool bb165fadf6 test: check hook_task deletion
move test to integration to ensure Sqlite + MySQL testing
2024-05-24 10:31:41 +02:00
Gergely Nagy fd9ee1901b
tests: Add a test for code expansion on PRs
This adds a new test case to `TestCompareCodeExpand` to exercise the
case where we're viewing a PR's diff.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-24 10:30:38 +02:00
wxiaoguang a62a887649
Fix incorrect "blob excerpt" link when comparing files (#31013)
When comparing files between the base repo and forked repo, the "blob
excerpt" link should point to the forked repo, because the commit
doesn't exist in base repo.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit f48cc501c46a2d34eb701561f01d888d689d60d5)

Conflicts:
	- templates/repo/diff/section_split.tmpl
	- templates/repo/diff/section_unified.tmpl
          Resolved the conflict by picking Gitea's change over ours, and
	  porting it.
	- tests/integration/compare_test.go
	  Kept our test, but picked the "compare all of the relevant
	  links" part of the Gitea test.
2024-05-24 10:08:24 +02:00
Earl Warren 7c5a755602 Merge pull request 'Update dependency postcss-nesting to v12.1.5' (#3882) from renovate/postcss-packages into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3882
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-24 08:01:37 +00:00
Renovate Bot 95ae3a3c7e Update dependency postcss-nesting to v12.1.5 2024-05-24 02:04:27 +00:00
Earl Warren eea841d25d Merge pull request 'Update dependency @playwright/test to v1.44.1' (#3879) from renovate/playwright-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3879
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-24 00:43:31 +00:00
Michael Jerger b01f3bb2a1 federated-star: finalize receive activity (#3871)
PR will finalize the ability to receive a federated star from a remote instance.

This is part of: https://codeberg.org/forgejo/forgejo/pulls/1680

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3871
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
2024-05-24 00:25:57 +00:00
Earl Warren 32222d7d0a Merge pull request '[BUG] Fix SourceHut Builds webhook with triggers field' (#3864) from oliverpool/forgejo:sourcehut_trigger into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3864
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-24 00:16:22 +00:00
Renovate Bot 2d245351e5 Update dependency @playwright/test to v1.44.1 2024-05-24 00:04:17 +00:00
Earl Warren 8cfe353061 Merge pull request 'Update module github.com/jhillyerd/enmime to v1.2.0' (#3791) from renovate/github.com-jhillyerd-enmime-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3791
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-23 10:21:31 +00:00
Earl Warren 3056a2ea2e Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.374.3' (#3775) from renovate/ghcr.io-visualon-renovate-37.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3775
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-23 09:50:14 +00:00
Earl Warren ba6d5ae2af
chore(release-notes): enmime upgrade to v1.2.0
Refs: https://codeberg.org/forgejo/forgejo/pulls/3791
2024-05-23 11:44:26 +02:00
Earl Warren adba05bac5 Merge pull request 'Update dependency swagger-ui-dist to v5.17.12' (#3806) from renovate/swagger-ui-dist-5.17.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3806
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-23 09:35:41 +00:00
Earl Warren c66c4d8fd5 Merge pull request 'Update module github.com/markbates/goth to v1.80.0' (#3808) from renovate/github.com-markbates-goth-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3808
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-23 09:26:08 +00:00
Earl Warren f84235166e
chore(release-notes): goth upgrade to v1.80.0
Refs: https://codeberg.org/forgejo/forgejo/pulls/3808
2024-05-23 10:55:32 +02:00
Renovate Bot f5157085aa Update ghcr.io/visualon/renovate Docker tag to v37.374.3 2024-05-22 20:06:04 +00:00
Renovate Bot 0376b5087d Update dependency swagger-ui-dist to v5.17.12 2024-05-22 16:08:46 +00:00
Earl Warren 9c7ff70072 Merge pull request '[skip ci] docs(release-notes): 7.0.3 (take 2)' (#3868) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3868
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-05-22 15:14:26 +00:00
Earl Warren b2378d6d5f
[skip ci] docs(release-notes): 7.0.3 (take 2)
This commit was reverted because it introduces a regression.

Refs: https://codeberg.org/forgejo/forgejo/pulls/3867
2024-05-22 16:48:19 +02:00
Earl Warren d8e21e673d Merge pull request 'Creation of federated user' (#3792) from meissa/forgejo:forgejo-federated-pr3 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3792
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-22 11:11:42 +00:00
oliverpool 0e479f3502 add release-notes 2024-05-22 12:59:41 +02:00
oliverpool 1f6f909b2e refactor: sourcehut_builds ignore unused fields 2024-05-22 12:56:51 +02:00
oliverpool c9f38e2813 fix: sourcehut_builds preserve unused fields
Fix #3820
2024-05-22 12:56:51 +02:00
oliverpool 7b47cb43c1 test: sourcehut_builds trigger 2024-05-22 12:56:51 +02:00
Earl Warren 0dd00a6023 Merge pull request '[skip ci] docs(release-notes): 7.0.3' (#3858) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3858
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-05-22 10:38:39 +00:00
Clemens 1c24e2dec6 Removed test case from integration test which will be added in a later pr 2024-05-22 12:37:52 +02:00
Earl Warren ce0921d0c5
[skip ci] docs(release-notes): 7.0.3 2024-05-22 12:34:50 +02:00
Earl Warren 780f176fd9 Merge pull request 'fix(build): generate does not need gomock' (#3862) from earl-warren/forgejo:wip-source-tarbal into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3862
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-22 06:17:32 +00:00
Earl Warren f145617b0f
fix(build): generate does not need gomock
* the file generated to by gomock is already in the sources
* add generate-gomock to help with rebuilding the files

Fixes: https://codeberg.org/forgejo/forgejo/issues/3861
2024-05-22 07:41:57 +02:00
Earl Warren 7bd8443739 Merge pull request 'test: even more sha256 repositories tests' (#3856) from oliverpool/forgejo:push_create_sha256 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3856
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-21 21:50:37 +00:00
Earl Warren 7ce8090346 Merge pull request 'tests(services/mailer): add tooling and coverage for issues/default.tmpl' (#3816) from earl-warren/forgejo:wip-test-mail into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3816
Reviewed-by: Otto <otto@codeberg.org>
2024-05-21 21:46:58 +00:00
Earl Warren cf391f937a Merge pull request 'refactor: redis queue backend test cleanup' (#3850) from efertone/forgejo:refactor-redis-queue-test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3850
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-21 20:40:00 +00:00
Renovate Bot 1602f60e53 Update module github.com/markbates/goth to v1.80.0 2024-05-21 20:07:52 +00:00
oliverpool c19b1cc76d test-sha256: skip push-create
See #3783 why it is hard to support
2024-05-21 21:24:06 +02:00
oliverpool 7e1f7f6a50 test-sha256: GitPushCreate 2024-05-21 21:24:06 +02:00
Michael Jerger 735d9629cf add more integration testcases 2024-05-21 18:49:31 +02:00
Victoria Nadasdi 87e2454858
lint: fix import order issue
Signed-off-by: Victoria Nadasdi <victoria@efertone.me>
2024-05-21 18:02:37 +02:00
Victoria Nadasdi e195b47ffc
go mod tidy
Signed-off-by: Victoria Nadasdi <victoria@efertone.me>
2024-05-21 18:02:37 +02:00
Victoria Nadasdi 54acfa8880
refactor: redis queue backend test cleanup
Summary:
- Move existing test under a `testify` Suite as `baseRedisWithServerTestSuite`
  - Those tests require real redis server.
- Add `go.uber.org/mock/mockgen@latest` as dependency
  - as a tool (Makefile).
  - in the `go.mod` file.
- Mock redis client lives under a `mock` directory under the queue module.
  - That mock module has an extra hand-written mock in-memory redis-like struct.
- Add tests using the mock redis client.
- Changed the logic around queue provider creation.
  - Now the `getNewQueue` returns a Queue provider directly, not an init
    function to create it.

The whole Queue module is close to impossible to test properly because
everything is private, everything goes through a struct route. Because
of that, we can't test for example what keys are used for given queue.

To overcome this, as a first step I removed one step from that hard
route by allowing custom calls to create new queue provider. To achieve
this, I moved the creation logic into the `getNewQueue` (previously it
was `getNewQueueFn`). That changes nothing on that side, everything goes
as before, except the `newXXX` call happens directly in that function
and not outside that.

That made it possible to add extra provider specific parameters to those
function (`newXXX`). For example a client on redis. Calling it through
the `getNewQueue` function, it gets `nil`.

- If the provided client is not `nil`, it will use that instead of the
connection string.
- If it's `nil` (default behaviour), it creates a new redis client as it
  did before, no changes to that.

The rest of the provider code is unchanged. All these changes were
required to make it possible to generate mock clients for providers and
use them.

For the tests, the existing two test cases are good with redis server,
and they need some extra helpers, for example to start a new redis
server if required, or waiting on a redis server to be ready to use.
These helpers are only required for test cases using real redis server.

For better isolation, moved existing test under a testify Suite, and
moved them into a new test file called `base_redis_with_server_test.go`
because, well they test the code with server. These tests do exactly the
same as before, calling the same sub-tests the same way as before, the
only change is the structure of the test (remove repetition, scope
server related helper functions).

Finally, we can create unit tests without redis server. The main focus of
this group of tests are higher level overview of operations. With the
mock redis client we can set up expectations about used queue names,
received values, return value to simulate faulty state.

These new unit test functions don't test all functionality, at least
it's not aimed for it now. It's more about the possibility of doing that
and add extra tests around parts we couldn't test before, for example
key.

What extra features can test the new unit test group:
- What is the received key for given queue? For example using `prefix`,
  or if all the `SXxx` calls are expected to use `queue_unique` if
  it's a unique queue.
- If it's not a unique queue, no `SXxx` functions are called, because
  those sets are used only to check if a value is unique or not.
- `HasItem` return `false` always if it's a non-unique queue.
- All functions are called exactly `N` times, and we don't have any
  unexpected calls to redis from the code.

Signed-off-by: Victoria Nadasdi <victoria@efertone.me>
2024-05-21 18:02:33 +02:00
Earl Warren 74e07656d2 Merge pull request '[gitea] week 2024-21 cherry pick (gitea/main -> forgejo)' (#3838) from algernon/wcp/2024-21 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3838
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-21 08:05:01 +00:00
Earl Warren fb1338537b Merge pull request '[FEAT] Wiki Search' (#3847) from snematoda/wiki-search-grep into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3847
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-21 06:27:30 +00:00
Mai-Lapyst d4b1ed859c Port: Fix issue/PR title edit (gitea#30858) (#3797)
This PR ports [gitea#30858](https://github.com/go-gitea/gitea/pull/30858) / [this commit](5c236bd4c0) to forgejo.

[week 2024-20 cherry pick](https://codeberg.org/forgejo/forgejo/pulls/3729)

## Tests
- [ ] Click "edit" to get into edit mode, change the title and then use Alt+Enter to save the title

## Screenshots

Before:
![grafik](/attachments/bb0b2562-7da0-4205-a647-3270d66f2ad7)
![grafik](/attachments/c3d05a21-659d-4616-b357-87de57232182)

After:
![grafik](/attachments/d9af6966-3282-439b-a845-76618a24b9a6)
![grafik](/attachments/5acd6684-69c4-41a4-8e27-7cb75fe3c7e4)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3797
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Co-committed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-20 23:32:48 +00:00
Léana 江 3561cc710b [I18N] Injected updated time in translation string (#3837)
Hello,

It is more idiomatic to put the date/time before the action in Mandarin (in this context). To achieve this, instead of having the time following the string that's passed to the translating function, I added it as a parameter so that one can reference it and reorder the sentence for better translatability.

Only Traditional Chinese has been changed at the time of opening this PR, as this is more of a proof of concept and I would like to have feedbacks on whether this is a good solution or is there a better alternative.

Thank you and have a nice day :)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3837
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Léana 江 <leana.jiang+git@icloud.com>
Co-committed-by: Léana 江 <leana.jiang+git@icloud.com>
2024-05-20 18:47:35 +00:00
0ko bcd2e64a93 s/return_to_gitea/return_to_forgejo (#3822)
Just a small actualization of a string key. I don't think we have any more replaceable `gitea` in the locales at the moment.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3822
Reviewed-by: Otto <otto@codeberg.org>
2024-05-20 18:44:33 +00:00
Codeberg Translate 504d4abe12 [I18N] Translations update from Weblate (#3759)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: kdh8219 <kdh8219@monamo.dev>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: Fitik <Fitik@users.noreply.translate.codeberg.org>
Co-authored-by: b1nar10 <b1nar10@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: Mumulhl <mumulhl@duck.com>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3759
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-05-20 18:37:38 +00:00
Victoria Nadasdi df0d1a2134 feat: parse prefix from redis URI for queues (#3836)
For security reasons, scoping access to a redis server via ACL rules is
a good practice. Some parts of the codebase handles prefix like cache[^1]
and session[^2], but the queue module doesn't.

This patch adds this missing functionality to the queue module.

Note about relevant test:
I tried to keep the PR as small as possible (and reasonable), and not
change how the test runs. Updated the existing test to use the same
redis address and basically duplicated the test with the extra flag. It
does NOT test if the keys are correct, it ensures only it works as
expected. To make assertions about the keys, the whole test has to be
updated as the general wrapper doesn't allow the main test to check
anything provider (redis) specific property. That's not something I
wanted to take on now.

[^1]: e4c3c039be/modules/cache/cache_redis.go (L139-L150)
[^2]: e4c3c039be/modules/session/redis.go (L122-L129)

Signed-off-by: Victoria Nadasdi <victoria@efertone.me>

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3836
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Victoria Nadasdi <victoria@efertone.me>
Co-committed-by: Victoria Nadasdi <victoria@efertone.me>
2024-05-20 14:10:54 +00:00
Shiny Nematoda ec4f5495ba feat: wiki search using git-grep
+ add release note
2024-05-20 13:48:50 +00:00
Earl Warren 37962e2b2a Merge pull request 'badges: Relax the default workflow badge conditions' (#3843) from algernon/forgejo:relax-and-have-a-badge into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3843
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-20 10:44:12 +00:00
Gergely Nagy d6915f4d5f
badges: Relax the default workflow badge conditions
Previously, if no branch was explicitly specified for a workflow, it
defaulted to the default branch of the repo. This worked fine for
workflows that were triggered on push, but it prevented showing badges
for workflows that only run on tags, or on schedule - since they do not
run on a specific branch.

Thus, relax the conditions, and if no branch is specified, just return
the latest run of the given workflow. If one is specified, *then*
restrict it to said branch.

Fixes #3487.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-20 11:20:11 +02:00
Haoyuan (Bill) Xing 6cb8c81de1 Add minimal implementation for RubyGems compact index API. (#3811)
Current package registry for RubyGems does not work with Bundler, because it implements neither the [compact index](https://guides.rubygems.org/rubygems-org-compact-index-api/) or the [dependency API](https://guides.rubygems.org/rubygems-org-api/). As a result, bundler complains about finding non-existing dependencies when installing anything with dependency: `revealed dependencies not in the API or the lockfile`.

This patch provides a minimal implementation for the compact index API to solve this issue. Specifically, we implemented a version that does not cache the results / do incremental updates; which is consistent with the current implementation.

Testing:
  * Modified existing integration tests.
  * Manually Verified bundler is able to parse the served versions / info file.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3811
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Haoyuan (Bill) Xing <me@hoppinglife.com>
Co-committed-by: Haoyuan (Bill) Xing <me@hoppinglife.com>
2024-05-19 23:30:41 +00:00
0ko 3351ce2bc5 Fix error on renaming merged PRs (#3840)
Closes https://codeberg.org/forgejo/forgejo/issues/3743.

This is a simple fix for https://codeberg.org/forgejo/forgejo/issues/3743, based on changes in [gitea#30990](https://github.com/go-gitea/gitea/pull/30990), which was not included in https://codeberg.org/forgejo/forgejo/pulls/3838 due to large code differences.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3840
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-19 18:19:31 +00:00
Earl Warren fc45a0d9ba
cleanup(services/mailer): mark deadcode for removal
There is no activities_model.Action* when sending a review comment,
this is deadcode and should be removed. Or a new event should be added
to differentiate it from a regular comment when evaluating templates.
2024-05-19 16:47:34 +02:00
Earl Warren 55c850a8a8
tests(services/mailer): coverage for the issue/default.tmpl logic
* the tests fail when issue/default.tmpl is removed
* coverage for:
  * activities_model.ActionCreateIssue
  * activities_model.ActionCommentIssue
  * activities_model.ActionCloseIssue
  * activities_model.ActionReopenIssue
  * activities_model.ActionCommentPull
  * activities_model.ActionMergePullRequest
  * activities_model.ActionApprovePullRequest
  * activities_model.ActionRejectPullRequest
* replace mocks with calls to mockMailSettings
2024-05-19 16:47:22 +02:00
wxiaoguang 193ac67176
Always load or generate oauth2 jwt secret (#30942)
Fix #30923

(cherry picked from commit effb405cae88474c27f5c8322a2627019af1cf64)
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>

Conflicts:
	- modules/setting/oauth2.go
	  Conflicted due to different ways of logging. Since the log
	  message is removed anyway, resolved by removing it.
	- modules/setting/oauth2_test.go
	  Manually copied the test added by Gitea.
	- routers/install/install.go
	  Not a conflict per se, but adjusted to use NewJwtSecret().
2024-05-19 15:47:39 +02:00
Lunny Xiao 1be797faba
Fix bug on avatar (#31008)
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 58a03e9fadb345de5653345c2a68ecfd0750940a)
2024-05-19 13:57:52 +02:00
silverwind 99f29e59a1
Clean up revive linter config, tweak golangci output (#30980)
The `errorCode` and `warningCode` options were removed at some point,
they are not recognized by golangci-lint any more at least and they do
not match their published json schema. `confidence` and
`ignore-generated-header` are at the default value so does not need to
be configured.

https://golangci-lint.run/usage/linters/#revive
(cherry picked from commit 028992429a2e14de39c9bb028637948e446d23ad)
2024-05-19 13:57:52 +02:00
wxiaoguang 50b4e7f26e
Simplify mirror repository API logic (#30963)
Fix #30921

(cherry picked from commit 821d2fc2a3cc897f21d707455850177077b72410)
2024-05-19 13:57:52 +02:00
silverwind 87def3837b
Upgrade `tqdm` dependency (#30996)
Result of `make update-py`

Fixes: https://github.com/go-gitea/gitea/security/dependabot/65
(cherry picked from commit a73e3c6a696029541ebd423f4eb2fec1ba151f79)
2024-05-19 13:57:52 +02:00
Lunny Xiao a20e924ee7
Remove unnecessary double quotes on language file (#30977)
The double quotes and the prefix/suffix space are unnecessary.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 5b6f80989fbd0574ca188ab683389ff7659de30d)
2024-05-19 13:15:16 +02:00
KN4CK3R 597dcd864a
Protected tag is no internal server error (#30962)
Fixes #30959

Adds an API test for protected tags.
Fix existing tag in combination with fixtures.

(cherry picked from commit b1d8f13bd0ecd9c576ebf2ecbd9c7dbeb3f5254f)
2024-05-19 13:12:35 +02:00
Zettat123 8e1de85980
Support using label names when changing issue labels (#30943)
Resolve #30917

Make the APIs for adding labels and replacing labels support both label
IDs and label names so the
[`actions/labeler`](https://github.com/actions/labeler) action can work
in Gitea.

<img width="600px"
src="https://github.com/go-gitea/gitea/assets/15528715/7835c771-f637-4c57-9ce5-e4fbf56fa0d3"
/>

(cherry picked from commit b3beaed147466739de0c24fd80206b5af8b71617)

Conflicts:
	- modules/structs/issue_label.go
	  Resolved by applying the Gitea change by hand.
	- tests/integration/api_issue_label_test.go
	  Resolved by copying the new tests.
2024-05-19 13:12:35 +02:00
GiteaBot 4fb3f2a1fe
[skip ci] Updated licenses and gitignores
(cherry picked from commit 2442ead6807528f5791671b8a3aab6629bae66ad)
2024-05-19 12:54:14 +02:00
Emmanuel BENOÎT 0801518f5d fix(actions): prevent deleted records' UUID from colliding with new records (#3830)
This commit changes the code that deletes a runner so it updates the UUID before deleting the record. The new UUID is set to 8 0xff bytes followed by a little endian version of the record's numeric ID. Such UUIDs cannot be created from tokens when registering runners, as the first 16 bytes of the token are in the `[0-9a-f]` range. This should prevent deleted runners from colliding with new records if the tokens share the same first 16 characters.

It is a possible solution to issue #3828

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3830
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Emmanuel BENOÎT <tseeker@nocternity.net>
Co-committed-by: Emmanuel BENOÎT <tseeker@nocternity.net>
2024-05-19 10:46:15 +00:00
Earl Warren 23bbec4459
tests(services/mailer): refactor mail_admin_new_user_test
* use MockVariableValue where appropriate
* split the tests in two with t.Run for clarity
2024-05-19 08:54:25 +02:00
David Davies-Payne e4c3c039be Suppress Monaco JavaScript errors in Safari (#3805)
Fix #3638

This is a manual Forgejo-specific version of the Gitea PR https://github.com/go-gitea/gitea/pull/30862. The weekly Forgejo PR #3772 could not cherry-pick this commit due to conflicts (eg subsequent CodeSpell changes).

Only occurs with Webkit in Safari over eg `http://192..`. (not localhost).
See https://webkit.org/blog/10855/async-clipboard-api/

---
**Before**
![Before.jpg](/attachments/c570d030-fcce-48ea-ac96-06b624541c7b)

**After**
![After.jpg](/attachments/1a9132ab-f7f3-43a5-b3ea-37b6f2b671c4)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3805
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: David Davies-Payne <d2p@me.com>
Co-committed-by: David Davies-Payne <d2p@me.com>
2024-05-18 21:07:09 +00:00
Earl Warren 11a031e238 Merge pull request '[I18N] Some English decap and other fixes' (#3823) from 0ko/forgejo:i18n-20240518 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3823
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-18 06:52:53 +00:00
Earl Warren ed46d44b97 Merge pull request 'Fix overflowing titles in project columns' (#3821) from beowulf/projects-issue-title-overflows into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3821
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-18 06:44:48 +00:00
0ko 1b12ca80ec [I18N] Some English decap and other fixes 2024-05-18 10:24:39 +05:00
Beowulf 853f005180
fixed overflow of projects column title
This fixes that titles of project columns can overflow and push the
action menu out of the card, so that interaction is no longer possible.

Fixes #3717
2024-05-17 23:11:11 +02:00
Earl Warren deec6c43a1 Merge pull request 'Fix contrast for issue count in projects columns' (#3804) from beowulf/projects-column-issue-count-contrast into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3804
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-17 10:14:08 +00:00
0ko f9ac5b327a Remove `title` from email heads (#3810)
One part of https://codeberg.org/forgejo/forgejo/pulls/3316, though it may have a little more files touched because I re-created the changes.

> Removed HTML `<title>` part in `<head>` that was present inconsistently in these emails. It doesn't appear to be used by other websites. After all, these are emails, not webpages.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3810
Reviewed-by: Otto <otto@codeberg.org>
2024-05-17 10:10:33 +00:00
Michael Jerger 5ce359b14e rename fkt name 2024-05-17 08:15:51 +02:00
Michael Jerger 8b90194d1b lint it 2024-05-17 07:54:46 +02:00
Renovate Bot f64c2e0a7f Update dependency @github/text-expander-element to v2.7.0 2024-05-17 00:06:12 +00:00
Beowulf 82e0066ed4
Fixed contrast for issue count in projects column
Regression introduced by 9934931f1f

See #3772
2024-05-17 00:54:10 +02:00
Michael Jerger b2c3eb1644 add migration & enhance int-test 2024-05-16 18:25:16 +02:00
Earl Warren 45a41811de Merge pull request 'Update dependency mermaid to v10.9.1' (#3776) from renovate/mermaid-10.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3776
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-16 15:55:54 +00:00
Earl Warren e47dd122f8
chore(release-notes): update dependency mermaid to v10.9.1
Refs: https://codeberg.org/forgejo/forgejo/pulls/3776
2024-05-16 15:34:17 +02:00
Earl Warren e8c32255da Merge pull request 'Port: Fix some UI problems (install) (gitea#30854)' (#3787) from Mai-Lapyst/forgejo:cherry-pick-30854 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3787
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-16 13:13:48 +00:00
Earl Warren d30fa97729 Merge pull request 'Update module github.com/go-swagger/go-swagger/cmd/swagger to v0.31.0' (#3778) from renovate/github.com-go-swagger-go-swagger-cmd-swagger-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3778
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-16 13:10:44 +00:00
Earl Warren 56ca2e43e9 Merge pull request 'test: add more sha256 repositories tests' (#3794) from oliverpool/forgejo:push_deploy_sha256 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3794
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-16 13:02:44 +00:00
Otto c4d7045a24 Merge pull request 'template: `label` fix correct input id' (#3789) from Frankkkkk/forgejo:fvd/fix-label into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3789
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-05-16 10:15:10 +00:00
oliverpool 67effd6985 test-sha256: APICreateFile 2024-05-16 11:01:47 +02:00
oliverpool df8aaeb1d5 test-sha256: APICreateBranch 2024-05-16 10:54:40 +02:00
oliverpool 348182f4b3 test-sha256: PushDeployKeyOnEmptyRepo 2024-05-16 10:54:40 +02:00
oliverpool e3e82d02ad test: useless duplication 2024-05-16 09:56:13 +02:00
Michael Jerger 1c7a9b00be initial 2024-05-16 08:15:43 +02:00
0ko fc0c5e80da Fix and improve repo visibility checkbox when FORCE_PRIVATE is on (#3786)
This was [implemented](022820103d) almost 10 years ago in Gogs.

It was using `readonly` attribute instead of `disabled` on checkbox which was doing nothing. According to [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly), `readonly` attribute is not applicable to checkbox inputs. This bug was reported by mrwusel in Matrix room.
Fork page that has similar UI feature did not have this bug.

- replace `readonly` with `disabled`
- do not put info about the restriction directly into the checkbox title

### Before
![image](/attachments/6adaf1a3-6e28-416a-ac85-aa6e570e438d)

### After
![image](/attachments/3590b02b-3c83-4864-bae8-ff1a6a56b2b0)

### In other case
![image](/attachments/7f49d84d-5b3a-43a1-b09c-fb6089c1fb5e)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3786
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-16 05:51:55 +00:00
Frank Villaro-Dixon 208eed05ff template: `label` fix correct input id
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-05-15 23:13:05 +02:00
Earl Warren cb551effb9 Merge pull request 'fix: hook post-receive for sha256 repos' (#3652) from oliverpool/forgejo:hook_post_receive_error into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3652
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-15 21:06:24 +00:00
wxiaoguang c16ae1ab39
Fix some UI problems (install) (#30854)
(cherry picked from commit ce8b11ae131bef6cd7df0849ed39da7984953a4b)
2024-05-15 20:12:14 +02:00
oliverpool 5e73c67d67 fix: hook post-receive for sha256 repos 2024-05-15 16:43:16 +02:00
oliverpool 2ac3dcbd43 test: hook post-receive for sha256 repos
failing push-to-create for sha256 will be fixed in a followup PR
2024-05-15 16:27:00 +02:00
Earl Warren fe3473fc8b Merge pull request 'Update dependency happy-dom to v14.11.0' (#3777) from renovate/happy-dom-14.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3777
2024-05-15 06:31:30 +00:00
Renovate Bot a2dc3cb388 Update module github.com/jhillyerd/enmime to v1.2.0 2024-05-15 02:07:19 +00:00
Renovate Bot ca5186978e Update module github.com/go-swagger/go-swagger/cmd/swagger to v0.31.0 2024-05-15 02:05:32 +00:00
Renovate Bot 103ad53f45 Update dependency happy-dom to v14.11.0 2024-05-15 00:06:10 +00:00
Renovate Bot 03e2aed969 Update dependency mermaid to v10.9.1 2024-05-15 00:05:40 +00:00
Earl Warren 77092c7a0c Merge pull request 'Federation: Parse ActorId & cache FederationHost' (#3662) from meissa/forgejo:forgejo-federated-parse-actorId into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3662
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 22:42:02 +00:00
Earl Warren 48813e6be1 Merge pull request 'Port "Enable `declaration-block-no-redundant-longhand-properties` (#30950)' (#3769) from beowulf/gitea-port-pull-30950 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3769
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 22:23:54 +00:00
Shiny Nematoda b6ca8abcfd [FEAT] support searching non default branches/tags when using git-grep (#3654)
resolves https://codeberg.org/forgejo/forgejo/pulls/3639#issuecomment-1806676 and https://codeberg.org/forgejo/forgejo/pulls/3513#issuecomment-1794990

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3654
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
2024-05-14 15:41:03 +00:00
silverwind 8f4e653020
Enable `declaration-block-no-redundant-longhand-properties` (#30950)
Enable
[`declaration-block-no-redundant-longhand-properties`](https://stylelint.io/user-guide/rules/declaration-block-no-redundant-longhand-properties/)
and autofix issues. The exclusions are because I find these two
shorthands to be harder to read.

(cherry picked from commit 46b7004f050bd2fdaf9800794cf2c1e9eeb08d51)

Signed-off-by: Beowulf <beowulf@beocode.eu>
2024-05-14 17:28:58 +02:00
Earl Warren 9b4452fd7b Merge pull request '[DOC] fix release notes link' (#3768) from snematoda/fix-release-notes-link into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3768
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 14:56:12 +00:00
Shiny Nematoda fd1fff11cc [skip ci] fix release notes link 2024-05-14 12:48:07 +00:00
Earl Warren 1b3e6a4831 Merge pull request '[gitea] week 2024-20 cherry pick (gitea-github/main -> forgejo)' (#3729) from earl-warren/wcp/2024-20 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3729
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-05-14 12:23:10 +00:00
Earl Warren a6262a662e Merge pull request 'Expand code diffs against the commits repo' (#3765) from algernon/forgejo:<del>300</del>500 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3765
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 12:04:04 +00:00
Earl Warren b88bae5c5a Merge pull request 'Enable renovate osv vulnerability alerts' (#2788) from viceice/forgejo:chore/renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2788
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 12:01:47 +00:00
Earl Warren 069b78b305 Merge pull request 'Fixes indentation style in .editorconfig for go.mod' (#3754) from beowulf/fix-editorconfig-for-go.mod into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3754
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-14 11:39:15 +00:00
Earl Warren 6c1573d0aa Merge pull request 'Update dependency postcss-nesting to v12.1.4' (#3756) from renovate/postcss-packages into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3756
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-14 11:37:55 +00:00
Earl Warren b60a302821 Merge pull request 'Update dependency swagger-ui-dist to v5.17.9' (#3757) from renovate/swagger-ui-dist-5.17.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3757
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-14 11:36:59 +00:00
Earl Warren 3c490163ea Merge pull request 'Update module connectrpc.com/connect to v1.16.2' (#3758) from renovate/connectrpc.com-connect-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3758
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-14 11:35:32 +00:00
Earl Warren 2ed61cbe35 Merge pull request 'Update dependency happy-dom to v14.10.2' (#3755) from renovate/happy-dom-14.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3755
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-14 11:33:37 +00:00
Earl Warren 0cc19d6a9f Merge pull request 'chore(renovate): automerge devcontainer image and features' (#3761) from viceice/forgejo:chore/renovate-devcontainer into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3761
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-14 11:00:13 +00:00
forgejo-renovate-action c588ccd63e Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.353.1' (#3692) from renovate/ghcr.io-visualon-renovate-37.x into forgejo 2024-05-14 10:27:55 +00:00
Renovate Bot 159474ff23 Update ghcr.io/visualon/renovate Docker tag to v37.359.0 2024-05-14 10:03:32 +00:00
Gergely Nagy 220c3fe3b3
Expand code diffs against the commits repo
When expanding code diffs, the expansion should search for more context
in the commits repo, rather than in the repo in context, because the
commit may not be available in the base repo. For example, when
previewing a pull request, the commit is not in the target repo yet -
it's in the fork.

Fixes #3746.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-14 10:25:28 +02:00
Michael Kriese fc51559556
chore(renovate): automerge devcontainer image and features 2024-05-14 09:57:10 +02:00
Michael Kriese 06725504a3
Enable renovate osv vulnerability alerts 2024-05-14 09:42:22 +02:00
Michael Jerger fddc063b97 missed by diff 2024-05-14 08:48:05 +02:00
Michael Jerger 9d32c5a29b added validation fixes 2024-05-14 08:31:34 +02:00
Michael Jerger fc38e56373 enhance test & fix reviews 2024-05-14 08:24:31 +02:00
Renovate Bot 16f7f0501f Update module connectrpc.com/connect to v1.16.2 2024-05-14 02:07:44 +00:00
Renovate Bot 989e750e48 Update dependency swagger-ui-dist to v5.17.9 2024-05-14 02:05:52 +00:00
Renovate Bot 46e36e2dda Update dependency postcss-nesting to v12.1.4 2024-05-14 00:07:56 +00:00
Renovate Bot 9bde9b18f1 Update dependency happy-dom to v14.10.2 2024-05-14 00:07:20 +00:00
Beowulf ff592dd66f
fixed indentation style in editorconfig for go.mod 2024-05-14 00:24:18 +02:00
Beowulf 2810b9ae0a Replace reply with a forked version to fix the cut-off of the incoming mail text (#3747)
replace reply with forgejos forked version

If plain text is selected as the message format in e.g. Apple Mail, the inline attachments are no longer at the end of the mail, but instead directly where they are in the mail. When parsing the mail, these inline attachments are replaced by "--". The new reply version no longer cuts the text at the first "--".

Tests for this are present in reply (7dc5750c6d).

Fixes https://codeberg.org/forgejo/forgejo/issues/3496#issuecomment-1798416

---

Additionally, I reduced the allocations for the inline attachments.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3747
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2024-05-13 21:24:58 +00:00
Earl Warren d09a6d130c Merge pull request 'Update module github.com/go-enry/go-enry/v2 to v2.8.8' (#3723) from renovate/github.com-go-enry-go-enry-v2-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3723
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-13 18:28:44 +00:00
Earl Warren b873107275 Merge pull request 'Rename Str2html to SanitizeHTML and clarify its behavior (followup) (take 2)' (#3744) from earl-warren/forgejo:wip-notify-push into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3744
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-05-13 18:26:47 +00:00
0ko e4e84a7ecf Improve translatability of "Transfer ownership" (#3739)
This text can have different forms in other languages depending on context.

The commit also contains a change to .editorconfig to prevent EoF changes when mass-replacing strings, as that causes unintentional merge conflicts with Weblate.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3739
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-13 18:22:16 +00:00
0ko 61643a698c Translation updates from Weblate (#3748)
This is not the usual Weblate PR. I did not reset Weblate after squash-merging https://codeberg.org/forgejo/forgejo/pulls/3637, so Weblate failed to rebase and locked. These are manually cherry-picked commits that Weblate produced after that PR was merged. We need to squash-merge them too before resetting Weblate, so the new translations don't get lost.

Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: Cwpute <Cwpute@users.noreply.translate.codeberg.org>
Co-authored-by: Mylloon <Mylloon@users.noreply.translate.codeberg.org>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: owofied <furry@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3748
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-13 18:16:35 +00:00
Earl Warren 4b59e3f971 Merge pull request 'Port "Use CSS `inset` shorthand (#30939)"' (#3745) from proton-ab/forgejo:pr/css-inset into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3745
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-13 16:02:05 +00:00
Earl Warren 48c18e17d5
chore(release-notes): go-enry v2.8.8
Refs: https://codeberg.org/forgejo/forgejo/pulls/3723
2024-05-13 17:32:28 +02:00
Earl Warren 337f4f9d87
Rename Str2html to SanitizeHTML and clarify its behavior (followup) (take 2)
In
  801792e4dc Rename Str2html to SanitizeHTML and clarify its behavior (followup)
the replacement was incorrect because
  c9d0e63c20  Remove unnecessary "Str2html" modifier from templates
was not applied and Str2html should have not been present in the first
place.

Fixes: https://codeberg.org/forgejo/forgejo/issues/3554
2024-05-13 17:05:03 +02:00
silverwind 584f36f0a1 Use CSS `inset` shorthand (#30939)
Use [inset](https://developer.mozilla.org/en-US/docs/Web/CSS/inset)
shorthand instead of longhands. There may be more cases but these ones I
was able to definitely identify.

Signed-off-by: proton <proton_ab@tuta.io>
2024-05-13 17:00:21 +02:00
Earl Warren 286cb4cde8 Merge pull request 'Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.58.1' (#3736) from renovate/github.com-golangci-golangci-lint-cmd-golangci-lint-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3736
2024-05-13 13:32:25 +00:00
Earl Warren 66cb6732ed
chore(dependency): automerge golangci-lint upgrades 2024-05-13 14:36:54 +02:00
0ko 182d5eeef9 [I18N] Improve base locale related to settings and accounts (#3733)
- general English improvements
- separated the header of Language part in user settings into a new string for better translatability
- made that header contain "Default", just like the theme one, because this is how this actually works: the bottom selector saves the language temporarily, the selector in the settings saves it permanently. Not many users know about this difference. This clarification will help some
- removed some of "Manage" from the headers where they aren't really needed. This improves the consistency with some other headers

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3733
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-13 12:05:49 +00:00
Earl Warren cf8641964c Merge pull request 'Improve how icon colors are defined' (#3702) from 0ko/forgejo:ui-icon-contrast into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3702
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-13 11:48:41 +00:00
Codeberg Translate 010cccd33e [I18N] Translations update from Weblate (#3637)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: kdh8219 <kdh8219@monamo.dev>
Co-authored-by: enricpineda <enricpineda@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: nmmr <nmmr@users.noreply.translate.codeberg.org>
Co-authored-by: VioletLul <VioletLul@users.noreply.translate.codeberg.org>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Nifou <Nifou@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3637
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-05-13 11:48:36 +00:00
Earl Warren bef650d4a4 Merge pull request 'Update module github.com/golangci/misspell/cmd/misspell to v0.5.1' (#3737) from renovate/github.com-golangci-misspell-cmd-misspell-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3737
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-13 10:15:57 +00:00
Renovate Bot 4fadf7c75b Update module github.com/golangci/misspell/cmd/misspell to v0.5.1 2024-05-13 02:04:30 +00:00
Renovate Bot 418cd41f14 Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.58.1 2024-05-13 00:06:54 +00:00
Earl Warren 81e3156f8b
chore(release-notes): [gitea] week 2024-20 cherry pick 2024-05-12 20:20:18 +02:00
Earl Warren c18094ee07 Merge pull request 'chore(renovate): manually upgrade xgo, oapi-codegen & kin-openapi' (#3732) from earl-warren/forgejo:wip-renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3732
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-12 18:06:28 +00:00
Earl Warren 4157f8f2ec
chore(deadcode): update 2024-05-12 20:03:10 +02:00
Lunny Xiao eb792d9f8a
Move database operations of merging a pull request to post receive hook and add a transaction (#30805)
Merging PR may fail because of various problems. The pull request may
have a dirty state because there is no transaction when merging a pull
request. ref
https://github.com/go-gitea/gitea/pull/25741#issuecomment-2074126393

This PR moves all database update operations to post-receive handler for
merging a pull request and having a database transaction. That means if
database operations fail, then the git merging will fail, the git client
will get a fail result.

There are already many tests for pull request merging, so we don't need
to add a new one.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ebf0c969403d91ed80745ff5bd7dfbdb08174fc7)

Conflicts:
	modules/private/hook.go
	routers/private/hook_post_receive.go
	trivial conflicts because
	  263a716cb5 * Performance optimization for git push (#30104)
	was not cherry-picked and because of
	  998a431747 Do not update PRs based on events that happened before they existed
2024-05-12 20:03:10 +02:00
Lunny Xiao 1f56a49f28
Move reverproxyauth before session so the header will not be ignored even if user has login (#27821)
When a user logout and then login another user, the reverseproxy auth
should be checked before session otherwise the old user is still login.

(cherry picked from commit 26ae5922348d2dbaf2161bbd6ac79b2aa455e5f0)
2024-05-12 20:03:10 +02:00
Lunny Xiao 32c97efab4
Remove If Exist check on migration for mssql because that syntax required SQL server 2016 (#30894)
Fix #30872

We will assume the database is consistent before executing the
migration. So the indexes should exist. Removing `IF EXIST` then is safe
enough.

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 40de54ece82356b161cdb9cc224ed9004af8ae5d)

Conflicts:
	models/migrations/v1_22/v286.go
	MSSQL is not supported in Forgejo
2024-05-12 20:03:10 +02:00
wxiaoguang b8f65234bc
Fix some UI regressions for commit list (#30920)
Close #30919

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 080486e47dba7ed767707fb0a2939677dfbcb0e3)
2024-05-12 20:03:10 +02:00
silverwind 51f6c3a059
Forbid deprecated `break-word` in CSS (#30934)
Forbid
[deprecated](https://drafts.csswg.org/css-text-3/#word-break-property)
`break-word` and fix all occurences.

Regarding `overflow-wrap: break-word` vs `overflow-wrap: anywhere`:

Example of difference: https://jsfiddle.net/silverwind/1va6972r/

[Here](https://stackoverflow.com/questions/77651244) it says:

> The differences between normal, break-word and anywhere are only clear
if you are using width: min-content on the element containing the text,
and you also set a max-width. A pretty rare scenario.

I don't think this difference will make any practical impact as we are
not hitting this rare scenario.

(cherry picked from commit 5556782ebeb1ca4d17e2fff434b11651887b9899)
2024-05-12 20:03:10 +02:00
Jason Song 38ea77ebbe
Remove deprecated stuff for runners (#30930)
It's time (maybe somewhat late) to remove some deprecated stuff for the
runner.

- `x-runner-version`: runners needn't to report version in every
request, they will call `Declare`.
- `AgentLabels`: runners will report them as `Labels`.

(cherry picked from commit b9396a9b852e4fea0e2c39ef3ef2fdfbc9ea248a)

Conflicts:
	routers/api/actions/runner/interceptor.go
	trivial conflict because
	  e80466f734 Resolve lint for unused parameter and unnecessary type arguments (#30750)
	was not cherry-picked
2024-05-12 20:03:10 +02:00
yp05327 1a250c7b2b
Fix incorrect default branch when adopt a repository (#30912)
Fix #30521

we should sync branches first, then detect default branch, or
`git_model.FindBranchNames` will always return empty list, and the
detection will be wrong.

(cherry picked from commit e94723f2de7d9bf12d870f5ce9ffb291a99ba090)

Conflicts:
	services/repository/adopt.go
	trivial conflict because
	  e80466f734 Resolve lint for unused parameter and unnecessary type arguments (#30750)
	was not cherry-picked
2024-05-12 20:03:10 +02:00
yp05327 6c9b8401f9
Fix misspelling of mergable (#30896)
https://github.com/go-gitea/gitea/pull/25812#issuecomment-2099833692
Follow #30573

(cherry picked from commit f7d2f695a4c57b245830a526e77fa62e99e00254)

Conflicts:
	services/pull/check.go
	trivial conflict because
	  9b2536b78fdcd3cf444a2f54857d9871e153858f Update misspell to 0.5.1 and add `misspellings.csv` (#30573)
	was not cherry-picked
2024-05-12 20:03:10 +02:00
Zettat123 8f0f6bf89c
Update issue indexer after merging a PR (#30715)
Fix #30684

(cherry picked from commit f09e68ec33262d5356779572a0b1c66e6e86590f)

Conflicts:
	tests/integration/pull_merge_test.go
	trivial context conflict
2024-05-12 20:03:10 +02:00
Lunny Xiao 7d3ca90dfe
Fix various problems around projects board view (#30696)
The previous implementation will start multiple POST requests from the
frontend when moving a column and another bug is moving the default
column will never be remembered in fact.

- [x] This PR will allow the default column to move to a non-first
position
- [x] And it also uses one request instead of multiple requests when
moving the columns
- [x] Use a star instead of a pin as the icon for setting the default
column action
- [x] Inserted new column will be append to the end
- [x] Fix #30701 the newly added issue will be append to the end of the
default column
- [x] Fix when deleting a column, all issues in it will be displayed
from UI but database records exist.
- [x] Add a limitation for columns in a project to 20. So the sorting
will not be overflow because it's int8.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a303c973e0264dab45a787c4afa200e183e0d953)

Conflicts:
	routers/web/web.go
	e91733468ef726fc9365aa4820cdd5f2ddfdaa23 Add missing database transaction for new issue (#29490) was not cherry-picked
	services/issue/issue.go
	fe6792dff3 Enable/disable owner and repo projects independently (#28805) was not cherry-picked
2024-05-12 20:03:10 +02:00
Lunny Xiao 9bc391250d
Fix wrong transfer hint (#30889)
Fix #30187

(cherry picked from commit f5f921c09555f5b31226fc31bbbb463649d0bfdc)
2024-05-12 20:03:10 +02:00
silverwind 12b6bcaf05
Remove obsolete monaco workaround (#30893)
This workaround is not neccessary any more since monaco 0.35.0.

Ref: https://github.com/microsoft/monaco-editor/issues/2962
Ref: https://github.com/microsoft/vscode/pull/173688
(cherry picked from commit d9b37d085acb7e93409061e541b6a3aa53261bb0)
2024-05-12 20:03:10 +02:00
Lunny Xiao 7028fe0b4d
Fix missing migrate actions artifacts (#30874)
The actions artifacts should be able to be migrate to the new storage
place.

(cherry picked from commit 6ad77125cabe53a943d46b50e8cb79cfcea5491f)
2024-05-12 20:03:10 +02:00
wxiaoguang 8cb8547532
Make "sync branch" also sync object format and add tests (#30878)
(cherry picked from commit 9c08637eae8c3a44d15e62d85144e07ae9dabbec)
2024-05-12 20:03:10 +02:00
6543 eb4c6f3f09
Get repo list with OrderBy alpha should respect owner too (#30784)
instead of:
- zowner/gcode
- awesome/nul
- zowner/nul
- zowner/zzz

we will get:
- awesome/nul
- zowner/gcode
- zowner/nul
- zowner/zzz

(cherry picked from commit 8e8ca6c6530e49e39f970bdfa84716ffda8973d0)
2024-05-12 20:03:10 +02:00
Kemal Zebari 16eb85adfb
Have time.js use UTC-related getters/setters (#30857)
Before this patch, we were using `Date` getter/setter methods that
worked with local time to get a list of Sundays that are in the range of
some start date and end date. The problem with this was that the Sundays
are in Unix epoch time and when we changed the "startDate" argument that
was passed to make sure it is on a Sunday, this change would be
reflected when we convert it to Unix epoch time. More specifically, I
observed that we may get different Unix epochs depending on your
timezone when the returned list should rather be timezone-agnostic.

This led to issues in US timezones that caused the contributor, code
frequency, and recent commit charts to not show any chart data. This fix
resolves this by using getter/setter methods that work with UTC since it
isn't dependent on timezones.

Fixes #30851.

---------

Co-authored-by: Sam Fisher <fisher@3echelon.local>
(cherry picked from commit 22c7b3a74459833b86783e84d4708c8934d34e58)
2024-05-12 20:03:09 +02:00
Renovate Bot 8672ad12b1 Update module github.com/caddyserver/certmagic to v0.21.0 (#3724)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/caddyserver/certmagic](https://github.com/caddyserver/certmagic) | require | minor | `v0.20.0` -> `v0.21.0` |

---

### Release Notes

<details>
<summary>caddyserver/certmagic (github.com/caddyserver/certmagic)</summary>

### [`v0.21.0`](https://github.com/caddyserver/certmagic/releases/tag/v0.21.0)

[Compare Source](https://github.com/caddyserver/certmagic/compare/v0.20.0...v0.21.0)

CertMagic v0.21 introduces some big changes:

-   Draft support for draft-03 of [ACME Renewal Information (ARI)](https://datatracker.ietf.org/doc/draft-ietf-acme-ari/) which assists with deciding when to renew certificates. This augments CertMagic's already-advanced logic using cert lifetime and OCSP/revocation status.
-   New [`ZeroSSLIssuer`](https://pkg.go.dev/github.com/caddyserver/certmagic@v0.21.0#ZeroSSLIssuer) uses the [ZeroSSL API](https://zerossl.com/documentation/api/) to get certificates. ZeroSSL also has an ACME endpoint, which can still be accesed using the existing ACMEIssuer, as always. Their proprietary API is paid, but has extra features like IP certificates, better reliability, and support.
-   DNS challenges should be smoother in some cases as we've improved propagation checking.
-   In the odd case your ACME account disappears from the ACME server, CertMagic will automatically retry with a new account. (This happens in some test/dev environments.)
-   ACME accounts are identified only by their public keys, but CertMagic maps accounts by CA+email for practical/storage reasons. So now you can "pin" an account key to use by specifying your email and the account public key in your config, which is useful if you need to absolutely be sure to use a specific account (like if you get rate limit exemptions from a CA).

Please try it out and report any issues!

Thanks to [@&#8203;Framer](https://github.com/Framer) for their contributions to this release!

#### What's Changed

-   Bump golang.org/x/crypto from 0.14.0 to 0.17.0 by [@&#8203;dependabot](https://github.com/dependabot) in https://github.com/caddyserver/certmagic/pull/264
-   Demote "storage cleaning happened too recently" from WARN to INFO by [@&#8203;francislavoie](https://github.com/francislavoie) in https://github.com/caddyserver/certmagic/pull/270
-   Check DNS propagation at authoritative nameservers only with default resolvers by [@&#8203;pgeh](https://github.com/pgeh) in https://github.com/caddyserver/certmagic/pull/274
-   Retry with new account if account disappeared remotely by [@&#8203;mholt](https://github.com/mholt) in https://github.com/caddyserver/certmagic/pull/269
-   Update readme examples to use TLS-ALPN const from ACMEz by [@&#8203;goksan](https://github.com/goksan) in https://github.com/caddyserver/certmagic/pull/277
-   Initial implementation of ZeroSSL API issuer by [@&#8203;mholt](https://github.com/mholt) in https://github.com/caddyserver/certmagic/pull/279
-   Allow deleting directories via FileStorage by [@&#8203;goksan](https://github.com/goksan) in https://github.com/caddyserver/certmagic/pull/282
-   Use the `email` configuration in the ACME issuer to "pin" an account to a key by [@&#8203;ankon](https://github.com/ankon) in https://github.com/caddyserver/certmagic/pull/283
-   Initial implementation of ARI by [@&#8203;mholt](https://github.com/mholt) in https://github.com/caddyserver/certmagic/pull/286

#### New Contributors

-   [@&#8203;pgeh](https://github.com/pgeh) made their first contribution in https://github.com/caddyserver/certmagic/pull/274
-   [@&#8203;goksan](https://github.com/goksan) made their first contribution in https://github.com/caddyserver/certmagic/pull/277

**Full Changelog**: https://github.com/caddyserver/certmagic/compare/v0.20.0...v0.21.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am" (UTC), Automerge - "before 4am" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6W119-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3724
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
2024-05-12 14:56:39 +00:00
Earl Warren 0a67dbffb0
chore(renovate): manually upgrade xgo, oapi-codegen & kin-openapi 2024-05-12 15:58:52 +02:00
Earl Warren 3678c376c9 Merge pull request 'Update postcss packages' (#3713) from renovate/postcss-packages into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3713
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-05-12 10:55:40 +00:00
Renovate Bot 95b2821824 Update module github.com/go-enry/go-enry/v2 to v2.8.8 2024-05-12 00:05:15 +00:00
Earl Warren 6c33d55d16 Merge pull request 'Add class tw-break-anywhere' (#3718) from 0ko/forgejo:ui-pick-break into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3718
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-11 17:09:11 +00:00
Earl Warren 9915e163c5 Merge pull request 'Update ghcr.io/devcontainers/features/git-lfs Docker tag to v1.2.0' (#3715) from renovate/ghcr.io-devcontainers-features-git-lfs-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3715
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-11 16:46:20 +00:00
Earl Warren 7cdd5e546f Merge pull request 'Update mcr.microsoft.com/devcontainers/go Docker tag to v1.22' (#3716) from renovate/mcr.microsoft.com-devcontainers-go-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3716
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-11 16:45:58 +00:00
0ko b45fbe1dcc Add class tw-break-anywhere
very partial port of 9946353282 (diff-38f10be6b48c74bcacbf9f6e15cc8582a45b7a6cbd1cdd8efec8e592575290c5) to fix a few picked areas where lack of it causes bugs.
2024-05-11 18:15:29 +05:00
Renovate Bot 6f3c50e75d Update postcss packages 2024-05-11 12:03:36 +00:00
Renovate Bot 2db58b786d Update mcr.microsoft.com/devcontainers/go Docker tag to v1.22 2024-05-11 02:04:41 +00:00
Renovate Bot 84d01b1828 Update ghcr.io/devcontainers/features/git-lfs Docker tag to v1.2.0 2024-05-11 02:04:33 +00:00
0ko b1a239cdc4 Improve how icon colors are defined
- define specific colors for icons for themes
- fix related contrast issues on Forgejo dark theme
2024-05-10 23:19:35 +05:00
Earl Warren cf0e451ef4 Merge pull request 'templates: Be more forgiving about missing package metadata' (#3701) from algernon/forgejo:missing-metadata-makes-me-mumble-murky-messages into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3701
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-10 18:06:04 +00:00
Michael Jerger 33648f2a4c add second federated instance to integration test 2024-05-10 17:30:34 +02:00
Gergely Nagy ac4d535dbf
templates: Be more forgiving about missing package metadata
When rendering templates for packages, be more forgiving about missing
metadata. For some repository types - like maven - metadata is uploaded
separately. If that upload fails, or does not happen, there will be no
metadata.

In that case, Forgejo should handle it gracefully, and render as much of
the information as possible, without erroring out. Rendering without
metadata allows one to delete a partial package, while if we throw
errors, that becomes a whole lot harder.

This patch adjusts the generic metadata template, and also the maven
template. There may be more cases of the same problem lying around.

Fixes #3663.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-10 12:07:24 +02:00
Earl Warren 09855c0caf Merge pull request 'Add a release note for #3285' (#3697) from algernon/forgejo:release-notes/cloning-in-sshtyle into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3697
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-10 09:32:35 +00:00
Earl Warren 46e81f0890 Merge pull request 'Add a release note for #3464' (#3698) from algernon/forgejo:release-notes/i-object-exclamationmark-format-name into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3698
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-10 09:31:51 +00:00
Earl Warren 69bc0fb8b3 Merge pull request '[PORT] gitea#30535: Refactor and fix archive link bug' (#3696) from algernon/forgejo:si-si-no-jquery into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3696
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-10 09:30:57 +00:00
Gergely Nagy a5c038f5e8
Add a release note for #3464
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-10 09:39:52 +02:00
Gergely Nagy 9d1ceee797
Add a release note for #3285
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-10 09:32:07 +02:00
wxiaoguang 7dd3c01606
Refactor and fix archive link bug (#30535)
Regression of #29920
Fixes: #30569

Also this is a rewriting to eliminate the remaining jQuery usages from code.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit d0e07083559180b124a08359fcc72f9ef695e723)

Conflicts:
	- web_src/js/features/repo-common.js
	  Conflict resolved in favour of Gitea.
2024-05-10 09:20:12 +02:00
Earl Warren 88804dd558 Merge pull request 'Update dependency happy-dom to v14.10.1' (#3695) from renovate/happy-dom-14.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3695
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-10 05:26:46 +00:00
Earl Warren 19fec86f9b Merge pull request 'Update dependency swagger-ui-dist to v5.17.7' (#3693) from renovate/swagger-ui-dist-5.17.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3693
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-10 05:24:55 +00:00
Earl Warren 0dec5bb161 Merge pull request 'Update dependency eslint-plugin-vue to v9.26.0' (#3694) from renovate/linters into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3694
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-10 05:23:21 +00:00
Renovate Bot 7a5f0faf0c Update dependency happy-dom to v14.10.1 2024-05-10 02:06:06 +00:00
Renovate Bot 9a812f16bd Update dependency eslint-plugin-vue to v9.26.0 2024-05-10 02:05:33 +00:00
Renovate Bot 1148206fc8 Update dependency swagger-ui-dist to v5.17.7 2024-05-10 00:08:05 +00:00
Earl Warren e49e0ebe56 Merge pull request 'Fix some 7.0 missing variables' (#3685) from 0ko/forgejo:ui-var-fixes into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3685
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-09 18:42:42 +00:00
Earl Warren 456b82d2bb Merge pull request '[PORT] gitea#29674: Add result check in TestAPIEditUser' (#3686) from algernon/forgejo:gitea/port/29674 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3686
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-09 18:35:29 +00:00
Earl Warren 15fe4fd175 Merge pull request 'Teach activities.GetFeeds() how to avoid returning duplicates' (#3598) from algernon/forgejo:action-inaction-reaction into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3598
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-09 18:33:21 +00:00
yp05327 f81890fa95
Add result check in TestAPIEditUser (#29674)
Fix #29514
There are too many usage of `NewRequestWithValues`, so there's no need
to check all of them.
Just one is enough I think.

(cherry picked from commit ecd1d96f494d2400f7659165ff9376354edda395)

Conflicts:
	- tests/integration/api_admin_test.go
	  Conflict resolved by manually applying the change to
	  `full_name`.
2024-05-09 19:26:21 +02:00
0ko 0dc35c9df9 [THEME] Fix some 7.0 missing variables 2024-05-09 21:58:23 +05:00
Gergely Nagy 9cb2aa989a
Teach activities.GetFeeds() how to avoid returning duplicates
Before explaining the fix itself, lets look at the `action` table, and
how it is populated. Data is only ever inserted into it via
`activities_model.NotifyWatchers`, which will:

- Insert a row for each activity with `UserID` set to the acting user's
  ID - this is the original activity, and is always inserted if anything
  is to be inserted at all.
- It will insert a copy of each activity with the `UserID` set to the
  repo's owner, if the owner is an Organization, and isn't the acting
  user.
- It will insert a copy of each activity for every watcher of the repo,
  as long as the watcher in question has read permission to the repo
  unit the activity is about.

This means that if a repository belongs to an organizations, for most
activities, it will have at least two rows in the table. For
repositories watched by people other than their owner, an additional row
for each watcher.

These are useful duplicates, because they record which activities are
relevant for a particular user. However, for cases where we wish to see
the activities that happen around a repository, without limiting the
results to a particular user, we're *not* interested in the duplicates
stored for the watchers and the org. We only need the originals.

And this is what this change does: it introduces an additional option to
`GetFeedsOptions`: `OnlyPerformedByActor`. When this option is set,
`activities.GetFeeds()` will only return the original activities, where
the user id and the acting user id are the same. As these are *always*
inserted, we're not missing out on any activities. We're just getting
rid of the duplicates. As this is an additional `AND` condition, it can
never introduce items that would not have been included in the result
set before, it can only reduce, not extend.

These duplicates were only affecting call sites where `RequestedRepo`
was set, but `RequestedUser` and `RequestedTeam` were not. Both of those
call sites were updated to set `OnlyPerformedByActor`. As a result,
repository RSS feeds, and the `/repos/{owner}/{repo}/activities/feeds`
API end points no longer return dupes, only the original activities.

Rather than hardcoding this behaviour into `GetFeeds()` itself, I chose
to implement it as an explicit option, for the sake of clarity.

Fixes Codeberg/Community#684, and addresses gitea#20986.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-09 18:33:33 +02:00
Yaroslav Halchenko 2b2fd2728c Add codespell support and fix a good number of typos with its help (#3270)
More about codespell: https://github.com/codespell-project/codespell .

I personally introduced it to dozens if not hundreds of projects already and so far only positive feedback.

```
❯ grep lint-spell Makefile
	@echo " - lint-spell                       lint spelling"
	@echo " - lint-spell-fix                   lint spelling and fix issues"
lint: lint-frontend lint-backend lint-spell
lint-fix: lint-frontend-fix lint-backend-fix lint-spell-fix
.PHONY: lint-spell
lint-spell: lint-codespell
.PHONY: lint-spell-fix
lint-spell-fix: lint-codespell-fix
❯ git grep lint- -- .forgejo/
.forgejo/workflows/testing.yml:      - run: make --always-make -j$(nproc) lint-backend checks-backend # ensure the "go-licenses" make target runs
.forgejo/workflows/testing.yml:      - run: make lint-frontend
```
so how would you like me to invoke `lint-codespell` on CI? (without that would be IMHO very suboptimal and let typos sneak in)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3270
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
Co-committed-by: Yaroslav Halchenko <debian@onerussian.com>
2024-05-09 13:49:37 +00:00
Earl Warren 06843c1cdc Merge pull request 'Update dependency swagger-ui-dist to v5.17.6' (#3679) from renovate/swagger-ui-dist-5.17.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3679
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-09 07:21:21 +00:00
Earl Warren 326d5e6b63 Merge pull request 'Update dependency vue to v3.4.27' (#3680) from renovate/patch-vue-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3680
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-09 07:20:21 +00:00
Earl Warren 2ecdffd65c Merge pull request 'Update dependency @playwright/test to v1.44.0' (#3684) from renovate/playwright-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3684
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-09 07:17:13 +00:00
Renovate Bot e89e253636 Update dependency @playwright/test to v1.44.0 2024-05-09 02:05:43 +00:00
Renovate Bot 15c0878084 Update dependency vue to v3.4.27 2024-05-09 00:06:36 +00:00
Renovate Bot e71f8b8f7b Update dependency swagger-ui-dist to v5.17.6 2024-05-09 00:06:13 +00:00
Earl Warren 996dbdb0b4 Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.351.2' (#3646) from renovate/ghcr.io-visualon-renovate-37.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3646
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-08 22:07:13 +00:00
Earl Warren 9ac8bc9328 Merge pull request 'Update module github.com/blevesearch/bleve/v2 to v2.4.0' (#3647) from renovate/github.com-blevesearch-bleve-v2-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3647
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-08 21:34:21 +00:00
Gergely Nagy f4dd53d79d Fix an incorrect form submission in repo-issue.js (#3675)
This fixes `initRepoPullRequestAllowMaintainerEdit()` to submit the form correctly (as a web form, rather than as JSON payload).

Fixes #3618, cherry picked from gitea#30854.

Co-Authored-By: wxiaoguang <wxiaoguang@gmail.com>

---

Manual testing steps:

- Open a PR against any repository, with the "Allow edits from maintainers" option checked.
- Open the developer console (`Ctrl-Shift-I` on Firefox), and look at the Network tab.
- Visit the PR, find the "Allow edits from maintainers" checkbox, and click it.
- See the developer console, and check that the response says the setting is false.
- Refresh the page *completely* (`Ctrl-Shift-R` on Firefox)
- Observe that the setting is off.
- Click the box again to enable it.
- See the developer console, and check that the response says the setting is true.
- Reload without cache again (`Ctrl-Shift-R` on Firefox)
- Observe that the setting is now on.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3675
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Co-committed-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-08 21:14:46 +00:00
Renovate Bot 8e1a6d8e73 Update ghcr.io/visualon/renovate Docker tag to v37.351.2 2024-05-08 20:05:21 +00:00
Earl Warren d3e02eaa89 chore(licenses): make go-license 2024-05-08 19:31:56 +00:00
Renovate Bot 4bff06dafb Update module github.com/blevesearch/bleve/v2 to v2.4.0 2024-05-08 19:31:56 +00:00
Earl Warren 18c8ae844e Merge pull request 'chore(dependency): automerge all JavaScript CI dependencies' (#3676) from earl-warren/forgejo:wip-ci-renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3676
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-08 19:31:01 +00:00
Earl Warren 4af9d9b6c3 Merge pull request 'Update dependency @stylistic/eslint-plugin-js to v1.8.1' (#3666) from renovate/linters into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3666
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-08 17:45:20 +00:00
Earl Warren bfe4995ed5 Merge pull request 'Update dependency @vue/test-utils to v2.4.6' (#3667) from renovate/vue-test-utils-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3667
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-08 17:44:26 +00:00
Earl Warren d4bb667051
chore(dependency): automerge all JavaScript CI dependencies
Make a pass to have a full inventory of JavaScript dependencies that
can be automerged because they only have an impact on the CI. It is
easier than to examine them one by one when an update is proposed.

- add packages:test which indirectly includes packages:jsUnitTest and
  a number of test dependencies such as vitest
- add prefixes for dependencies which are known to be exclusively
  used for testing (playwright, ...)
- add modules

Refs: https://docs.renovatebot.com/presets-packages
2024-05-08 19:32:24 +02:00
Earl Warren 1c3c773dac Merge pull request 'Cumulative English improvements (May 2024)' (#3668) from 0ko/forgejo:i18n-20240508 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3668
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-08 17:04:21 +00:00
Renovate Bot 7105e19468 Update dependency @stylistic/eslint-plugin-js to v1.8.1 2024-05-08 16:03:56 +00:00
Earl Warren 7729cb3ecc Merge pull request 'fix(security): CVE-2024-24788 malformed DNS message' (#3671) from earl-warren/forgejo:wip-go-1.22.3 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3671
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-08 14:44:52 +00:00
Earl Warren f3045f0519
fix(security): CVE-2024-24788 malformed DNS message
Refs: https://pkg.go.dev/vuln/GO-2024-2824
2024-05-08 14:25:08 +02:00
0ko b11eddfaa8 [I18N] English improvements (May 2024)
- `editor.commit_id_not_matching` was reported by https://codeberg.org/kita. I confirmed the meaning on next.forgejo.org.
- `additional_repo_units_hint` was suggested by https://codeberg.org/leana8959.
2024-05-08 08:58:25 +05:00
Renovate Bot 84224a65ff Update dependency @vue/test-utils to v2.4.6 2024-05-08 02:05:00 +00:00
Earl Warren a2c8fe0370 Merge pull request '[gitea] week 2024-19 cherry pick (gitea-github/main -> forgejo)' (#3639) from earl-warren/wcp/2024-19 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3639
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-05-07 22:47:53 +00:00
Michael Jerger 778dd81615 unused code of the moment 2024-05-07 18:40:27 +02:00
Michael Jerger 1a76664d56 next step on the way to federation 2024-05-07 17:58:13 +02:00
Earl Warren 99d1ae52fc Merge pull request 'Update module github.com/PuerkitoBio/goquery to v1.9.2' (#3634) from renovate/github.com-puerkitobio-goquery-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3634
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-07 11:28:32 +00:00
Earl Warren cae4a5456f
chore(dependency): automerge goquery when the CI passes 2024-05-07 11:57:25 +01:00
Earl Warren 3f6e4af5a9 Merge pull request 'UI: Hide hidden email from own profile, again' (#3636) from n0toose/profile/hide-unhidden-hidden-email into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3636
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-05-07 10:39:01 +00:00
Earl Warren 420f017bce Merge pull request 'Update module github.com/cosmtrek/air to v1.52.0' (#3650) from renovate/github.com-cosmtrek-air-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3650
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-07 10:10:41 +00:00
Twenty Panda 44895011dc chore(dependencies): switch to air@v1
there are no tests but since Gitea uses @v1 since last month and Gitea
maintainers rely on make watch, it is safe to assume that upgrading is
not broken. Switching to v1 would require less scrutiny on the
upgrades. Even if there is breakage, it can be fixed with minimal
impact on the developer workflow.
2024-05-07 10:11:21 +01:00
Michael Jerger 2177d38e9c feat(federation): validate like activities (#3494)
First step on the way to #1680

The PR will

* accept like request on the api
* validate activity in a first level

You can find

* architecture at: https://codeberg.org/meissa/forgejo/src/branch/forgejo-federated-star/docs/unsure-where-to-put/federation-architecture.md

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3494
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
2024-05-07 07:59:49 +00:00
0ko 8c3511a8b3 Merge pull request 'Allow org members to navigate between the org and the dashboard' (#3642) from 0ko/forgejo:ui-add-org-dashboard-goto into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3642
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-05-06 03:50:47 +00:00
Renovate Bot 62c3540467 Update module github.com/cosmtrek/air to v1.52.0 2024-05-06 02:05:34 +00:00
0ko b034ab5a8e [UI] Allow org members to navigate between the org and the dashboard
- add a new button to the org view that is only shown to the org members
- add integration test to verify the expected navigatability
- add a new translation string to that button
- fix display style of "View <orgname>" button on the dashboard
- fix gap size between buttons on the org view by utilizing the common class top-right-buttons
2024-05-05 23:14:57 +05:00
Earl Warren 434ef46088 Merge pull request 'Update module gitea.com/go-chi/binding to v0.0.0-20240430071103-39a851e106ed' (#3597) from renovate/gitea.com-go-chi-binding-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3597
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-05 12:15:39 +00:00
Earl Warren 308304e4a4 Merge pull request 'Improve repo filter names' (#3612) from 0ko/forgejo:i18n-filters into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3612
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-05 12:13:40 +00:00
Kemal Zebari e388822e9d
Don't only list code-enabled repositories when using repository API (#30817)
We should be listing all repositories by default.

Fixes #28483.

(cherry picked from commit 9f0ef3621a3b63ccbe93f302a446b67dc54ad725)

Conflict:
   -		if ctx.IsSigned && ctx.Doer.IsAdmin || permission.UnitAccessMode(unit_model.TypeCode) >= perm.AccessModeRead {
   +		if ctx.IsSigned && ctx.Doer.IsAdmin || permission.HasAccess() {
   because of https://codeberg.org/forgejo/forgejo/pulls/2001
2024-05-05 12:15:40 +01:00
yp05327 6a4bc0289d
Fix no edit history after editing issue's title and content (#30814)
Fix #30807

reuse functions in services

(cherry picked from commit a50026e2f30897904704895362da0fb12c7e5b26)

Conflicts:
	models/issues/issue_update.go
	routers/api/v1/repo/issue.go
	trivial context conflict because of 'allow setting the update date on issues and comments'
2024-05-05 12:15:40 +01:00
wxiaoguang d93d62371c
Ignore useless error message "broken pipe" (#30801)
Fix #30792

(cherry picked from commit 53b55223d167c3fc996dd0278a656f421408ace7)
2024-05-05 12:15:40 +01:00
Bo-Yi Wu b29190c4f0
refactor: merge ListActionTasks func to action.go file (#30811)
Just merge actions.go file to action.go

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
(cherry picked from commit e67fbe4f15cdc544f6bec975de6560556724f098)
2024-05-05 12:15:40 +01:00
Archer 1b088fade6
Prevent automatic OAuth grants for public clients (#30790)
This commit forces the resource owner (user) to always approve OAuth 2.0
authorization requests if the client is public (e.g. native
applications).

As detailed in [RFC 6749 Section 10.2](https://www.rfc-editor.org/rfc/rfc6749.html#section-10.2),

> The authorization server SHOULD NOT process repeated authorization
requests automatically (without active resource owner interaction)
without authenticating the client or relying on other measures to ensure
that the repeated request comes from the original client and not an
impersonator.

With the implementation prior to this patch, attackers with access to
the redirect URI (e.g., the loopback interface for
`git-credential-oauth`) can get access to the user account without any
user interaction if they can redirect the user to the
`/login/oauth/authorize` endpoint somehow (e.g., with `xdg-open` on
Linux).

Fixes #25061.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 5c542ca94caa3587329167cfe9e949357ca15cf1)
2024-05-05 12:15:40 +01:00
Kemal Zebari 9cd0441cd3
Catch and handle unallowed file type errors in issue attachment API (#30791)
Before, we would just throw 500 if a user passes an attachment that is
not an allowed type. This commit catches this error and throws a 422
instead since this should be considered a validation error.

(cherry picked from commit 872caa17c0a30d95f85ab75c068d606e07bd10b3)

Conflicts:
	tests/integration/api_comment_attachment_test.go
	tests/integration/api_issue_attachment_test.go
	trivial context conflict because of 'allow setting the update date on issues and comments'
2024-05-05 12:15:40 +01:00
silverwind 396f16e7b2
Add hover outline to heatmap squares (#30828)
Makes it easier to use because you see which square is currently
hovered:

<img width="314" alt="Screenshot 2024-05-02 at 15 38 20"
src="https://github.com/go-gitea/gitea/assets/115237/3a15dad1-2259-4f28-9fae-5cf6ad3d8798">

I did try a `scoped` style for this, but that did not work for some
reason.

(cherry picked from commit 6f89d5e3a0886d02ead732005f593ae003f78f78)
2024-05-05 12:15:40 +01:00
silverwind fb693442f5
Remove external API calls in `TestPassword` (#30716)
The test had a dependency on `https://api.pwnedpasswords.com` which
caused many failures on CI recently:

```
--- FAIL: TestPassword (2.37s)
    pwn_test.go:41: Get "https://api.pwnedpasswords.com/range/e6b6a": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
FAIL
coverage: 82.9% of statements
```

(cherry picked from commit 9235442ba58524c8d12ae54865d583acfa1f439d)
2024-05-05 12:15:40 +01:00
wxiaoguang ee97bb17ba
Fix issue card layout (#30800)
Fix #30788

(cherry picked from commit 6ff2acc52c976e9d7bb6a5693f8a2365d12400f5)
2024-05-05 12:15:40 +01:00
wxiaoguang 4e35e5b8ae
Skip gzip for some well-known compressed file types (#30796)
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit be112c1fc30f87a248b30f48e891d1c8c18e8280)

Conflicts:
	routers/web/web.go
	trivial conflict because of https://codeberg.org/forgejo/forgejo/pulls/1533
2024-05-05 12:15:40 +01:00
Kemal Zebari f0e466420a
Don't have `redis-cluster` as possible cache/session adapter in docs (#30794)
This is because it doesn't exist as an adapter. The `redis` adapter
already handles Redis cluster configurations.

Fixes #30534.

(cherry picked from commit f135cb7c9457f7b9bdc43601f44757834573950f)

Conflicts:
	docs/content/administration/config-cheat-sheet.en-us.md
	does not exist in Forgejo
2024-05-05 12:15:40 +01:00
Chester 1a40fe54a6
Add API endpoints for getting action jobs status (#26673)
Sample of response, it is similar to Github actions

ref
https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository

``` json
{
    "workflow_runs": [
        {
            "id": 3,
            "name": "Explore-Gitea-Actions",
            "head_branch": "main",
            "head_sha": "6d8d29a9f7a01ded8f8aeb64341cb31ee1ab5f19",
            "run_number": 3,
            "event": "push",
            "display_title": "More job",
            "status": "success",
            "workflow_id": "demo2.yaml",
            "url": "/chester/test/actions/runs/3",
            "created_at": "2023-08-22T13:41:33-04:00",
            "updated_at": "2023-08-22T13:41:37-04:00",
            "run_started_at": "2023-08-22T13:41:33-04:00"
        },
        {
            "id": 2,
            "name": "Explore-Gitea-Actions",
            "head_branch": "main",
            "head_sha": "6d8d29a9f7a01ded8f8aeb64341cb31ee1ab5f19",
            "run_number": 2,
            "event": "push",
            "display_title": "More job",
            "status": "success",
            "workflow_id": "demo.yaml",
            "url": "/chester/test/actions/runs/2",
            "created_at": "2023-08-22T13:41:30-04:00",
            "updated_at": "2023-08-22T13:41:33-04:00",
            "run_started_at": "2023-08-22T13:41:30-04:00"
        },
        {
            "id": 1,
            "name": "Explore-Gitea-Actions",
            "head_branch": "main",
            "head_sha": "e5369ab054cae79899ba36e45ee82811a6e0acd5",
            "run_number": 1,
            "event": "push",
            "display_title": "Add job",
            "status": "failure",
            "workflow_id": "demo.yaml",
            "url": "/chester/test/actions/runs/1",
            "created_at": "2023-08-22T13:15:21-04:00",
            "updated_at": "2023-08-22T13:18:10-04:00",
            "run_started_at": "2023-08-22T13:15:21-04:00"
        }
    ],
    "total_count": 3
}
```

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
(cherry picked from commit 6709e28da78a0ea7e63f9fe4e32f620abdc88d14)

Conflicts:
	routers/api/v1/swagger/repo.go
	trivial context conflict
2024-05-05 12:15:40 +01:00
Panagiotis "Ivory" Vasilopoulos d03be77665 UI: Hide hidden email from own profile, again
This is a follow-up for 5e1bd8af5f, which
was my first commit to Gitea. It is also a follow up for the
Gitea PR #29300 (https://github.com/go-gitea/gitea/pull/23900) created
by myself, which turned stale.

This change partially restores the behavior of Gitea PR #23747
(https://github.com/go-gitea/gitea/pull/23747) by wxiaoguang, but
maintains the lock.

The original idea was to differentiate things from GitHub and GitLab a
little bit, and show the email address on the profile. The profile is
not only a place where the user chooses to show how they present
themselves on an instance, it is also a place where they can assess
their relationship *with* the instance, as it provides features such
as the Public Activity feed that can be only shown to the user, in
private.

It's, in some way, a dashboard. The email was shown there to remind
the user that this is the primary email that will be used by a supposed
administrator to contact them. There were other motivations behind that
change as well, but, long story short, the idea did not work very well,
as some people (e.g. people livestreaming on the Internet, or 'normal'
users sharing their screens) do not want to put their email address
out there when showing their screen to other people.

Other alternatives, such as blurring the text or only showing the real
email address, were explored, but were rejected because of
browser compatibility and simplicity reasons. The padlock icon that
is shown when showing the email address to other people has been kept.
One viable alternative could be displaying the placeholder email
instead, but that requires some more thought.

Fixes https://codeberg.org/forgejo/forgejo/issues/1950.
2024-05-05 13:08:31 +02:00
silverwind 9792a377e4
Fix tautological conditions (#30735)
As discovered by https://github.com/go-gitea/gitea/pull/30729.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 610802df85933e7a190a705bc3f7800da87ce868)

Conflicts:
	tests/integration/git_test.go
	trivial conflict because of https://codeberg.org/forgejo/forgejo/pulls/2834
2024-05-05 08:59:40 +01:00
6543 51b8d964c8
Get repo assignees and reviewers should ignore deactivated users (#30770) (#30782)
Backport  #30770

If an user is deactivated, it should not be in the list of users who are
suggested to be assigned or review-requested.

old assignees or reviewers are not affected.

---
*Sponsored by Kithara Software GmbH*

(cherry picked from commit f2d8ccc5bb2df25557cc0d4d23f2cdd029358274)

Conflicts:
	models/repo/user_repo_test.go
	because there is one less fixture user compared to Gitea
2024-05-05 08:53:27 +01:00
Zettat123 60e5825579
Fix duplicate status check contexts (#30660)
Caused by #30076.

There may be some duplicate status check contexts when setting status
checks for a branch protection rule. The duplicate contexts should be
removed.

Before:
<img
src="https://github.com/go-gitea/gitea/assets/15528715/97f4de2d-4868-47a3-8a99-5a180f9ac0a3"
width="600px" />

After:
<img
src="https://github.com/go-gitea/gitea/assets/15528715/ff7289c5-9793-4090-ba31-e8cb3c85f8a3"
width="600px" />

(cherry picked from commit 7ad50313284db7eec565ad1750108de1444c5a84)
2024-05-05 08:48:45 +01:00
Chongyi Zheng c504461b66
Resolve lint for unused parameter and unnecessary type arguments (#30750)
Resolve all cases for `unused parameter` and `unnecessary type
arguments`

Related: #30729

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit e80466f7349164ce4cf3c07bdac30d736d20f035)

Conflicts:
	modules/markup/markdown/transform_codespan.go
	modules/setting/incoming_email.go
	routers/api/v1/admin/user_badge.go
	routers/private/hook_pre_receive.go
	tests/integration/repo_search_test.go
	resolved by discarding the change, this is linting only and
	for the sake of avoiding future conflicts
2024-05-05 08:38:16 +01:00
Micash b8e7b3941a
Add support for npm bundleDependencies (#30751)
(cherry picked from commit ad4e902d5a1430c0c1df18bf404537df5ded1dba)
2024-05-05 08:24:01 +01:00
Sergey Zolotarev 96fd8008cd
Fix cross-compilation errors when CGO_CFLAGS/CGO_LDFLAGS is set (#30749)
When you cross-compile Gitea and you specify one of the envrionment
variables related to C flags, cgo will fail to build the generator
programs (e.g. generate-bindata) because GOOS and GOARCH are unset, but
those additional flags variables are not unset together with those.

To solve this issue, the simplest way that I've found is to disable cgo
in the `go generate` command as it's not really used there.

For example, I've had this problem with cross-compiling Gitea on FreeBSD
x86_64 to ARMv7 where it's necessary to pass `--target` to `clang` via
`CGO_CFLAGS`:
```
GOOS=freebsd \
GOARCH=arm \
GGOARM=7 \
CGO_ENABLED=1 \
SYSROOT=/usr/local/freebsd-sysroot/armv7 \
CC=clang \
CGO_CFLAGS="--target=armv7-unknown-freebsd13.2-gnueabihf" \
TAGS="bindata sqlite sqlite_unlock_notify" \
make SHELL='sh -x' build
```

```
Running go generate...
# runtime/cgo
In file included from gcc_freebsd_amd64.c:9:
In file included from /usr/include/signal.h:42:
/usr/include/sys/_ucontext.h:44:2: error: unknown type name 'mcontext_t'
modules/migration/schemas_bindata.go:8: running "go": exit status 1
# runtime/cgo
In file included from gcc_freebsd_amd64.c:9:
In file included from /usr/include/signal.h:42:
/usr/include/sys/_ucontext.h:44:2: error: unknown type name 'mcontext_t'
modules/options/options_bindata.go:8: running "go": exit status 1
# runtime/cgo
In file included from gcc_freebsd_amd64.c:9:
In file included from /usr/include/signal.h:42:
/usr/include/sys/_ucontext.h:44:2: error: unknown type name 'mcontext_t'
modules/public/public_bindata.go:8: running "go": exit status 1
# runtime/cgo
In file included from gcc_freebsd_amd64.c:9:
In file included from /usr/include/signal.h:42:
/usr/include/sys/_ucontext.h:44:2: error: unknown type name 'mcontext_t'
modules/templates/templates_bindata.go:8: running "go": exit status 1
gmake[1]: *** [Makefile:781: generate-go] Error 1
*** Error code 2

Stop.
```

But with this fix Gitea compiles successfully.

(cherry picked from commit d11133b83652238023b52576e0d3e57a4f4b21c9)
2024-05-05 08:23:25 +01:00
GiteaBot 6a4dfc5ba4
[skip ci] Updated licenses and gitignores
(cherry picked from commit e67141756d058045cf64a441255a2042425eda3b)
2024-05-05 08:23:06 +01:00
silverwind 60c78658ef
add built js files to eslint ignore (#30737)
For the rare case that some overzealous tooling wants to lint our output
files.

(cherry picked from commit d89bf3d3ec933c11f4ee7e4e714804d5815afa75)
2024-05-05 08:22:50 +01:00
Earl Warren 0dd382883f Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.340.9' (#3596) from renovate/ghcr.io-visualon-renovate-37.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3596
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-05 06:48:14 +00:00
Earl Warren 58351b9a63 Merge pull request 'Update dependency stylelint to v16.5.0' (#3626) from renovate/linters into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3626
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-05 06:47:30 +00:00
Earl Warren 51d295a1da Merge pull request 'Update dependency vitest to v1.6.0' (#3633) from renovate/vitest-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3633
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-05 06:39:27 +00:00
Renovate Bot 73031f4b80 Update ghcr.io/visualon/renovate Docker tag to v37.340.9 2024-05-05 02:04:30 +00:00
Renovate Bot aa8a757fe2 Update module github.com/PuerkitoBio/goquery to v1.9.2 2024-05-05 00:05:34 +00:00
Renovate Bot 1ecd0916d5 Update dependency vitest to v1.6.0 2024-05-05 00:04:10 +00:00
Renovate Bot fe922fce87 Update dependency stylelint to v16.5.0 2024-05-04 20:04:08 +00:00
Codeberg Translate 3fa8be77d6 [I18N] Translations update from Weblate (#3508)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: zyachel <zyachel@users.noreply.translate.codeberg.org>
Co-authored-by: Panagiotis \"Ivory\" Vasilopoulos <git@n0toose.net>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: monstorix <monstorix@users.noreply.translate.codeberg.org>
Co-authored-by: petrcech <petrcech@users.noreply.translate.codeberg.org>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: kdh8219 <kdh8219@monamo.dev>
Co-authored-by: Xinayder <Xinayder@users.noreply.translate.codeberg.org>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: sunwoo1524 <sunwoo1524@users.noreply.translate.codeberg.org>
Co-authored-by: woutput <woutput@users.noreply.translate.codeberg.org>
Co-authored-by: Pi-Cla <Pi-Cla@users.noreply.translate.codeberg.org>
Co-authored-by: Werenter <Werenter@users.noreply.translate.codeberg.org>
Co-authored-by: Anonymous <anonymous@users.noreply.translate.codeberg.org>
Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: KaKi87 <KaKi87@users.noreply.translate.codeberg.org>
Co-authored-by: mareklach <mareklach@users.noreply.translate.codeberg.org>
Co-authored-by: 747 <747@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3508
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-05-04 18:36:49 +00:00
Earl Warren 6253ab7bb0 Merge pull request 'Update dependency clippie to v4.1.1' (#3614) from renovate/clippie-4.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3614
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-04 15:45:21 +00:00
Earl Warren 385d1d2c24 Merge pull request 'Update dependency vite-string-plugin to v1.3.1' (#3627) from renovate/vite-string-plugin-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3627
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-04 15:41:59 +00:00
Earl Warren 96ee3e50a7
chore(renovate): automerge on vite-string-plugin 2024-05-04 08:38:52 +01:00
Earl Warren c9624d4cdb Merge pull request 'Add an immutable tarball link to archive download headers for Nix' (#3615) from jadeprime/forgejo:jade/nix-tarball-link into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3615
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-04 07:01:02 +00:00
Renovate Bot 526261937d Update dependency vite-string-plugin to v1.3.1 2024-05-04 00:04:51 +00:00
Jade Lovelace 6631f56ebf Add an immutable tarball link to archive download headers for Nix
This allows `nix flake metadata` and nix in general to lock a *branch*
tarball link in a manner that causes it to fetch the correct commit even
if the branch is updated with a newer version.

For further context, Nix flakes are a feature that, among other things,
allows for "inputs" that are "github:someuser/somerepo",
"https://some-tarball-service/some-tarball.tar.gz",
"sourcehut:~meow/nya" or similar. This feature allows our users to fetch
tarballs of git-based inputs to their builds rather than using git to
fetch them, saving significant download time.

There is presently no gitea or forgejo specific fetcher in Nix, and we
don't particularly wish to have one. Ideally (as a developer on a Nix
implementation myself) we could just use the generic tarball fetcher and
not add specific forgejo support, but to do so, we need additional
metadata to know which commit a given *branch* tarball represents, which
is the purpose of the Link header added here.

The result of this patch is that a Nix user can specify `inputs.something.url =
"https://forgejo-host/some/project/archive/main.tar.gz"` in flake.nix
and get a link to some concrete tarball for the actual commit in the
lock file, then when they run `nix flake update` in the future, they
will get the latest commit in that branch.

Example of it working locally:

 » nix flake metadata --refresh 'http://localhost:3000/api/v1/repos/jade/cats/archive/main.tar.gz?dir=configs/nix'
Resolved URL:  http://localhost:3000/api/v1/repos/jade/cats/archive/main.tar.gz?dir=configs/nix
Locked URL:    804ede182b.tar.gz?dir=configs
/nix&narHash=sha256-yP7KkDVfuixZzs0fsqhSETXFC0y8m6nmPLw2GrAMxKQ%3D
Description:   Computers with the nixos
Path:          /nix/store/s856c6yqghyan4v0zy6jj19ksv0q22nx-source
Revision:      804ede182b6b66469b23ea4d21eece52766b7a06
Last modified: 2024-05-02 00:48:32

For details on the header value, see:
56763ff918/doc/manual/src/protocols/tarball-fetcher.md
2024-05-03 15:21:45 -07:00
Earl Warren f866bf8dbe Merge pull request 'chore(renovate): fix config' (#3622) from viceice/forgejo:chore/renovate-reconfigure into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3622
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-05-03 17:16:08 +00:00
Michael Kriese 28d186a13d
chore(renovate): fix config 2024-05-03 14:00:29 +02:00
Earl Warren fbbbd36535 Merge pull request 'chore(renovate): reconfigure node versioning' (#3617) from viceice/forgejo:chore/renovate-reconfigure into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3617
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-03 09:46:15 +00:00
Earl Warren ff328f0f6f Merge pull request 'Update dependency markdownlint-cli to v0.40.0' (#3600) from renovate/markdownlint-cli-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3600
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-03 09:39:24 +00:00
Earl Warren d0708b0051 Merge pull request 'Update dependency @stylistic/eslint-plugin-js to v1.8.0' (#3599) from renovate/stylistic-eslint-plugin-js-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3599
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-03 09:38:46 +00:00
Michael Kriese baa7c8f975
chore(renovate): reconfigure node versioning 2024-05-03 09:08:03 +02:00
Renovate Bot ab23f5e6cd Update dependency clippie to v4.1.1 2024-05-03 06:03:34 +00:00
0ko 82f7308e1b [I18N] Improve repo filter names 2024-05-02 23:09:45 +05:00
Earl Warren 85f2727872 Merge pull request 'Fix text selection color' (#3608) from 0ko/forgejo:fix-color-sel into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3608
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-02 17:44:36 +00:00
0ko 787b16a7be [THEME] fix text selection color
regression of c2280a2009
2024-05-02 21:31:03 +05:00
JakobDev d50efa626a Show repo count in blocked users tab (#3601)
Fixes #3595

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3601
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-committed-by: JakobDev <jakobdev@gmx.de>
2024-05-02 15:51:27 +00:00
Earl Warren 9bc866124b Merge pull request 'Use PostFormValue instead of PostForm.Get' (#3563) from algernon/forgejo:s/Req.PostForm.Get/Req.PostFormValue/g into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3563
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-02 15:48:28 +00:00
Gergely Nagy b08aef967e
Use PostFormValue instead of PostForm.Get
In `repo.RemoveDependency`, use `PostFormValue` instead of
`PostForm.Get`. The latter requires `ParseForm()` to be called prior,
and in this case, has no benefit over `PostFormValue` anyway (which
calls `ParseForm()` if necessary).

While this currently does not cause any issue as far as I can tell, it
feels like a bug lying in wait for the perfect opportunity. Lets squash
it before it can do harm.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-02 10:51:07 +02:00
Renovate Bot 47ea0f5f98 Update dependency markdownlint-cli to v0.40.0 2024-05-02 02:04:58 +00:00
Renovate Bot 3e3f7c3f47 Update dependency @stylistic/eslint-plugin-js to v1.8.0 2024-05-02 02:04:31 +00:00
Earl Warren cd6ae89cd9 Merge pull request 'markup: Allow cross references to contain URL query parameters too' (#3584) from algernon/forgejo:a-capture-group-a-day-keeps-the-query-params-away into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3584
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-02 01:15:35 +00:00
Renovate Bot 58bf120eba Update module gitea.com/go-chi/binding to v0.0.0-20240430071103-39a851e106ed 2024-05-02 00:05:56 +00:00
Gergely Nagy 8164ef9762
markup: Allow cross references to contain URL query parameters too
Adjust the `anyHashPattern` to match URL query parameters too, and
adjust `fullHashPatternProcessor` accordingly.

Includes a test case, and an update to an existing one to account for
the new capture group.

Fixes #3548.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-01 21:14:16 +02:00
0ko d096a21da6 Fix inconsistent required field (#3583)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3583
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-05-01 18:29:42 +00:00
varp0n 4a2959b3ec FIX gogs migration if gogs is hosted at a subpath (#3572)
Also add a test for GogsDownloaderFactory.New() to make sure
that the URL of the source repository is parsed correctly.

When the source gogs instance is hosted at a subpath like `https://git.example.com/gogs/<username>/<reponame>` the migration fails.
This PR fixes that.

Co-authored-by: hecker <tomas.hecker@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3572
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: varp0n <tom@gkstn.de>
Co-committed-by: varp0n <tom@gkstn.de>
2024-05-01 16:28:44 +00:00
Earl Warren c6cc1430a9 Merge pull request 'docs(release-notes): 7.0.2' (#3561) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3561
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-05-01 12:59:00 +00:00
Earl Warren a050b546b9
[skip ci] docs(release-notes): 7.0.2 2024-05-01 14:22:18 +02:00
Earl Warren 39732d74c9 Merge pull request 'Fix Issue watching / unwatching on the web ui' (#3562) from algernon/forgejo:vogon-poetry into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3562
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: crystal <crystal@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-01 10:35:48 +00:00
Gergely Nagy 21911bfe57
Add a test case for unsubscribing from an issue
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-01 11:06:38 +02:00
Gergely Nagy 8cc5d5dc78
tests: Support creating a declarative repo without AutoInit
To be able to easily test cases where the repository does not have any
code, where the git repo itself is completely uninitialized, lets
support a case where the `AutoInit` property is false.

For the sake of backwards compatibility, if the option is not set either
way, it will default to `true`.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-01 11:06:38 +02:00
Gergely Nagy 632a274b8f
Fix Issue watching / unwatching on the web ui
When subscribing or unsubscribing to/from an issue on the web ui, the
request was posted to a route handled by `repo.IssueWatch`. This
function used `ctx.Req.PostForm.Get()`, erroneously.

`request.PostForm` is *only* available if `request.ParseForm()` has been
called before it. The function in question did not do that. Under some
circumstances, something, somewhere did end up calling `ParseForm()`,
but not in every scenario.

Since we do not need to check for multiple values, the easiest fix here
is to use `ctx.Req.PostFormValue`, which will call `ParseForm()` if
necessary.

Fixes #3516.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-01 11:04:54 +02:00
Earl Warren 97ef18db65 Merge pull request 'Update dependency vue to v3.4.26' (#3439) from renovate/vue-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3439
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-01 08:08:52 +00:00
Earl Warren f11957b8f4
chore(renovate): vue patch releases can be automerged 2024-05-01 09:32:01 +02:00
Renovate Bot bb5395cd29
Update dependency vue to v3.4.26 2024-05-01 09:30:24 +02:00
Earl Warren 0978095a37 Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.330.1' (#3490) from renovate/ghcr.io-visualon-renovate-37.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3490
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-01 07:26:21 +00:00
Earl Warren cf16782338 Merge pull request 'Update dependency dayjs to v1.11.11' (#3545) from renovate/dayjs-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3545
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-05-01 07:25:09 +00:00
Earl Warren 8f93ac7e7a Merge pull request 'feat: UI: use full screen height for displaying pdf files' (#3434) from Beowulf/forgejo:full-screen-height-pdf into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3434
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-01 07:03:15 +00:00
Earl Warren 756bb7f6e1 Merge pull request 'UI: Actions: Replace runs list description semicolon' (#3534) from n0toose/settings/runs-list-colon-brist into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3534
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-01 06:59:53 +00:00
Earl Warren ee52a8e805 Merge pull request '[I18N] Fix tepository->repository typo' (#3539) from proton-ab/forgejo:patch-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3539
Reviewed-by: Otto <otto@codeberg.org>
2024-05-01 06:58:48 +00:00
Earl Warren a454954bd0 Merge pull request 'Update dependency vitest to v1.5.3' (#3576) from renovate/vitest-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3576
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-01 06:37:39 +00:00
Renovate Bot 9a581e70a1 Update dependency vitest to v1.5.3 2024-05-01 06:03:44 +00:00
Renovate Bot 15978d4d07 Update ghcr.io/visualon/renovate Docker tag to v37.330.1 2024-05-01 06:02:32 +00:00
Earl Warren 288747c660 Merge pull request 'Fix SQL command with too many placeholders' (#3570) from algernon/forgejo:many-question-marks-handle-it into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3570
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-05-01 05:24:08 +00:00
Gergely Nagy 33cd8446d3
Performance improvement for FindReposLastestCommitStatuses
If `commitstatus_service.FindReposLastestCommitStatuses` receives no
repos in its params, short-circuit, and return early, without performing
any potentially expensive work.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-01 00:34:48 +02:00
Gergely Nagy 0d029ebe6d
Fix git_model.FindBranchesByRepoAndBranchName
When a logged in user with no repositories visits their dashboard, it will
display a search box that lists their own repositories.

This is served by the `repo.SearchRepos` handler, which in turn calls
`commitstatus_service.FindReposLastestCommitStatuses()` with an empty
repo list.

That, in turn, will call `git_model.FindBranchesByRepoAndBranchName()`,
with an empty map. With no map, `FindBranchesByRepoAndBranchName()` ends
up querying the entire `branch` table, because no conditions were set
up.

Armed with a gazillion repo & commit shas, we return to
`FindReposLastestCommitStatuses`, and promptly call
`git_model.GetLatestCommitStatusForPairs`, which constructs a monstrous
query with so many placeholders that the database tells us to go
somewhere else, and flips us off. At least on instances the size of
Codeberg. On smaller instances, it will eventually return, and throw
away all the data, and return an empty set, having performed all this
for naught.

We fix this by short-circuiting `FindBranchesByRepoAndBranchName`, and
returning fast if our inputs are empty.

A test case is included.

Fixes #3521.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-05-01 00:34:39 +02:00
0ko abcb23a838 Merge pull request 'Cumulative English locale improvements' (#3266) from 0ko/forgejo:i18n-20240416 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3266
Reviewed-by: Otto <otto@codeberg.org>
2024-04-30 14:49:48 +00:00
Earl Warren f7b53ef959 Merge pull request 'Fix user mention processing' (#3565) from algernon/forgejo:call-me-maybe into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3565
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-30 12:24:07 +00:00
Earl Warren 9a3a3feb4c Merge pull request 'Add inline attachments to comments and prevent double handling of mails' (#3504) from Beowulf/forgejo:mail-inline-attachments-not-added-to-comment into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3504
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-30 12:19:42 +00:00
Gergely Nagy 9a01062ae2
Fix user mention processing
When mentioning a user, the markup post-processor did not handle the
case where the mentioned user did not exist well: it tried to skip to
the next node, which in turn, ended up skipping the rest of the line.

To fix this, lets skip just the mentioned, but non-existing user, and
continue processing the current node from there.

Fixes #3535.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-30 12:51:30 +02:00
Beowulf 34134df3a7
added release notes 2024-04-30 12:05:22 +02:00
oliverpool 6ba60f61cb Merge pull request 'fix: webhook: send short ref on gitea create/delete payload' (#3558) from oliverpool/forgejo:webhook_gitea_fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3558
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-30 09:10:39 +00:00
Beowulf aeb544aff7
added test for reading inline attachments 2024-04-30 10:47:48 +02:00
oliverpool 0d3a9e6491 webhook: send short ref on gitea create/delete payload 2024-04-30 10:41:42 +02:00
oliverpool cb0f361171 test: webhook gitea tag creation ref 2024-04-30 10:41:38 +02:00
Earl Warren afb3bcaa8b Merge pull request 'fix: webhook getPayloadBranch' (#3555) from oliverpool/forgejo:webhook_ref_compat into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3555
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-30 08:15:42 +00:00
oliverpool df06904f4a webhook: fix getPayloadBranch 2024-04-30 09:38:35 +02:00
oliverpool 79380c209d test: webhook fix branch filter tests 2024-04-30 09:38:35 +02:00
Earl Warren 425d64a023 Merge pull request 'Update module connectrpc.com/connect to v1.16.1' (#3491) from renovate/connectrpc.com-connect-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3491
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-30 07:10:13 +00:00
Earl Warren e58a4c9a76 Merge pull request 'Update dependency @stylistic/stylelint-plugin to v2.1.2' (#3544) from renovate/stylistic-stylelint-plugin-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3544
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-30 07:04:10 +00:00
Earl Warren 79ffb2de47 Merge pull request '[gitea] week 2024-18 cherry pick (gitea-github/main -> forgejo)' (#3513) from earl-warren/wcp/2024-18 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3513
Reviewed-by: jean-daricade <jean-daricade@noreply.codeberg.org>
2024-04-30 06:42:26 +00:00
Earl Warren fb5c6d3837 Merge pull request 'remove `MAINTAINERS` file' (#3549) from Cyborus/forgejo:remove-maintainers into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3549
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-30 05:53:47 +00:00
Earl Warren fd67dccc5c Merge pull request 'Fix colour contrast issues in forms' (#3543) from fnetx/form-colour-contrast into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3543
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-30 05:36:14 +00:00
Earl Warren fdfef07d15 Merge pull request 'Choose better icon for Add more repo units suggestion' (#3542) from fnetx/repo-units-icon into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3542
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-30 05:34:58 +00:00
Earl Warren a1dbecf3b8 Merge pull request 'Fix toggling WIP state in PR footer' (#3537) from fnetx/fix-wip-toggle-footer into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3537
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-30 05:24:31 +00:00
Earl Warren b4383065d3 Merge pull request 'UI: Disable internal wiki options when enabling external wiki' (#3533) from n0toose/settings/wiki-unit-toggles into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3533
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-30 05:13:46 +00:00
Cyborus 57956d0525
remove `MAINTAINERS` file 2024-04-30 00:40:39 -04:00
0ko 11a7d8adfb [I18N] Cumulative English locale improvements
- decap wiki UI
- decap release UI
- fix cap of self visibility toggle button on org member list
- simplify `release.add_tag`
- simplify `admin_indexer_commit_sha` (we got multiple hash types now, but this referes to commit)
- some improvements to admin dashboard
- fnetX suggestions: [[1]](https://codeberg.org/forgejo/forgejo/pulls/3266#issuecomment-1795685), [[2]](https://codeberg.org/forgejo/forgejo/pulls/3266#issuecomment-1795734)
2024-04-30 08:59:46 +05:00
Renovate Bot a7fcc3ca3f Update dependency dayjs to v1.11.11 2024-04-30 00:11:43 +00:00
Renovate Bot aba5fe36d8 Update dependency @stylistic/stylelint-plugin to v2.1.2 2024-04-30 00:11:35 +00:00
Otto Richter 03c1c88b5b Fix colour contrast issues 2024-04-30 01:48:30 +02:00
Codeberg Build Maintainers a8211e07d8 CB/tmpl: Modify icon for add more button 2024-04-30 01:17:18 +02:00
Otto 74ac5b802d Merge pull request '[UI] Remove italics from Settings UI' (#2627) from n0toose/settings/remove-italics into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2627
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-29 23:12:00 +00:00
proton-ab 5ed3ffc0c8 [I18N] Fix tepository->repository typo
Signed-off-by: proton-ab <proton_ab@tuta.io>
2024-04-29 22:17:18 +00:00
Otto Richter 900bf43a8a Fix PR WIP toggle prefixes
When the variable was renamed, this occurence was missed.
2024-04-29 23:35:44 +02:00
Panagiotis "Ivory" Vasilopoulos 870a1c85c7 UI: Actions: Replace runs list description semicolon
The current format makes the text look somewhat like this:

```
testing.yml #15065 :Commit 103306f00c pushed by n0toose
```

This looks wrong. We will have to work on that list at a later point
in time anyways, as well as make the way that we separate information
in subheaders in lists like this one more consistent.

However, this should do for now.

This change should make each entry look like this instead:

```
testing.yml #15065 - Commit 103306f00c pushed by n0toose
```
2024-04-29 21:05:20 +02:00
Panagiotis "Ivory" Vasilopoulos 103306f00c UI: Disable internal wiki options when enabling external wiki
Using "data-target", it is possible to set a value to a target element
that can enable it or disable it. Using "data-context" lets us perform
the opposite action on a different target.

Before, only the #external_wiki_box target was used, which was enabled
or disabled depending on whether the user has chosen to use the internal
wiki or the external wiki. If the user chooses to use the internal wiki,
they will disable the box that lets them enter a link pointing to an
external wiki, and vice versa. Although it is not possible to use, say,
boolean operations, we can introduce a target that is
called #globally_writeable_checkbox that gets enabled when
the #external_wiki_box box is disabled, and vice versa.

This makes the box's behavior more consistent with the behavior in the
"Issues" section. To keep things consistent with that section, a new
property was assigned to the "globally_writeable_checkbox" that makes
the box go a bit further in (`tw-pl-4`).
2024-04-29 20:29:00 +02:00
Panagiotis "Ivory" Vasilopoulos 3224628f36 [UI] Replace italics in Settings UI 2024-04-29 19:16:52 +02:00
Earl Warren 837b49a5d2 Merge pull request 'Update module github.com/urfave/cli/v2 to v2.27.2' (#3505) from renovate/github.com-urfave-cli-v2-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3505
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-29 13:01:28 +00:00
Earl Warren ce2becb55e Merge pull request 'feat: implement PKCE when acting as oauth2 client (for user login)' (#3307) from oliverpool/forgejo:pkce into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3307
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-29 10:58:17 +00:00
Earl Warren 18a936e648 Merge pull request 'Fixes that the settings button moves in the overflow menu when the add more button is shown' (#3520) from Beowulf/forgejo:fix-setting-button-on-right into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3520
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: crystal <crystal@noreply.codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-29 10:53:26 +00:00
Earl Warren c283547692 Merge pull request 'Add release note for #3139' (#3519) from JakobDev/forgejo:releasenote into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3519
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-29 10:32:18 +00:00
oliverpool e1d93950ad feat: implement PKCE when acting as oauth2 client (for user login)
Closes #2766
2024-04-29 11:20:26 +02:00
Beowulf fb5e36bc6f
Fixes that the settings button moves in the overflow menu
and the add more button is on the right

This fix moves the settings button back to the right and the add more
button back to the left.
2024-04-28 23:31:31 +02:00
JakobDev d59ebc3e32
Add release note for #3139 2024-04-28 22:44:59 +02:00
Earl Warren 27fa12427c Merge pull request 'replaced link to gitea docu' (#3503) from mainboarder/forgejo:repo-mirror into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3503
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-28 14:05:18 +00:00
Earl Warren 295b2fff5a
feat(renovate): github.com/urfave/cli/v2 is good at managing patches
let them be merged automatically
2024-04-28 16:01:28 +02:00
Beowulf c54896ba70 Show repo activities even if only code unit active or git repo is empty but issue is active (#3455)
When all repository units are deactivated except for the code unit, the activity tab will not be shown.
Since the activities tab also shows contributing stats, it would be good to show the activities tab also when only code is active.
This commit changes the behavior when the activities tab is shown.
Previous it would only be shown when Issues, Pull-Requests or Releases are activated. Now it would additionally be shown when the code unit is activated.

Refs: #3429

| Before (Code + Issues - Owner) | Before (Code - Viewer) | After (Code + Issues - Owner) | After (Code - Viewer) |
| -- | -- | -- | -- |
| ![image](/attachments/2af997bc-1f38-48c6-bdf3-cfbd7087b220)  | ![image](/attachments/ef1797f0-5c9a-4a1a-ba82-749f3ab4f403) | ![image](/attachments/fd28a96c-04ca-407e-a70d-d28b393f223d) | ![image](/attachments/2cd0d559-a6de-4ca0-a736-29c5fea81b5a) |
|  | `/activity` returns 404 for everyone | ![image](/attachments/e0e97d8f-48cb-4c16-a505-1fafa46c4b8e)  | - |

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3455
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2024-04-28 13:47:52 +00:00
Chongyi Zheng ec6d46bc8f
Fix nil dereference on error (#30740)
In both cases, the `err` is nil because of `if` checks before

Reference: #30729
(cherry picked from commit 970965f6d8fb4e68613ca445d2414c6c796b5231)
2024-04-28 15:39:02 +02:00
Chongyi Zheng 7517e70740
Use `ProtonMail/go-crypto` for `opengpg` in tests (#30736)
(cherry picked from commit 8b8b48ef5fb1c5c164d5534ea4b8049f1db26ce9)

Conflicts:
	go.mod
	trivial context confllict
2024-04-28 15:39:02 +02:00
Chongyi Zheng 781789e779
Replace deprecated `math/rand` functions (#30733)
Suggested by logs in #30729

- Remove `math/rand.Seed`
`rand.Seed is deprecated: As of Go 1.20 there is no reason to call Seed
with a random value.`
- Replace `math/rand.Read`
`rand.Read is deprecated: For almost all use cases, [crypto/rand.Read]
is more appropriate.`
- Replace `math/rand` with `math/rand/v2`, which is available since Go
1.22

(cherry picked from commit 7b8e418da1e082786b844562a05864ec1177ce97)
2024-04-28 15:39:02 +02:00
wxiaoguang 2d2c18f0bd
Rename migration package name for 1.22-rc1 (#30730)
Ref: Propose to restart 1.22 release #30501
(cherry picked from commit 6d2a307ad8af7d686f1c3a3706ff0f2df895658a)

Conflicts:
	models/migrations/migrations.go
	models/migrations/v1_22/v297.go
	trivial conflict because a migration does not exist in Forgejo
2024-04-28 15:39:01 +02:00
silverwind cbcee5d87d
Issue card improvements (#30687)
Fixes https://github.com/go-gitea/gitea/issues/30682 and does a few
improvements:

- Use gap instead of margin/padding
- Don't render empty image div
- Remove `right floated` class that did nothing

<img width="406" alt="Screenshot 2024-04-24 at 20 21 20"
src="https://github.com/go-gitea/gitea/assets/115237/2fa88707-c2c4-40df-aee7-a684c3097ed0">

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit b93c87b6fe025408777d9f2091d29941e439e58c)
2024-04-28 15:39:01 +02:00
Yarden Shoham 38ed1cbc9d
Don't show loading indicators when refreshing the system status (#30712)
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 51c28d96838a743d2ba4fd679d92e8e15b536a19)
2024-04-28 15:39:01 +02:00
Kemal Zebari 4ed372af13
Prevent allow/reject reviews on merged/closed PRs (#30686)
Resolves #30675.

(cherry picked from commit dd301cae1c40c9ef2805bd13af6b09a81ff4f5d7)

Conflicts:
	tests/integration/pull_review_test.go
	trivial context conflict in import
2024-04-28 15:39:01 +02:00
silverwind 8ee31a6ba3
Improve diff stats bar (#30669)
Minor tweaks:

- Remove unnecessary `item` class which was causing unwanted padding to
be added.
- Add some padding and prevent wrapping so it looks better on mobile.
- Increase width by 4px.

<img width="116" alt="Screenshot 2024-04-24 at 00 15 07"
src="https://github.com/go-gitea/gitea/assets/115237/1f1cf54c-8053-4297-b309-71d9c2ceb9ee">
<img width="441" alt="Screenshot 2024-04-24 at 00 14 57"
src="https://github.com/go-gitea/gitea/assets/115237/2f3a33dc-edad-4b97-b64c-6812aae513cb">

(cherry picked from commit b2abac5e5ff05362e2d200c99cf792e7c3ba1330)
2024-04-28 15:39:01 +02:00
Chongyi Zheng bb7d22d019
Remove unused parameter for some functions in `services/mirror` (#30724)
Suggested by gopls `unusedparams`

(cherry picked from commit 4ae6b1a5534e4cc85602e990054c66a08b11852e)
2024-04-28 15:39:01 +02:00
silverwind 3c3cdb2736
Suppress browserslist warning in webpack target (#30571)
1. Set
[`BROWSERSLIST_IGNORE_OLD_DATA`](c6ddf7b387/node.js (L400))
to avoid warning on outdated browserslist data which the end user can
likely not do anything about and which is currently visible in the v1.21
branch.
2. Suppress all command echoing and add a "Running webpack..." message
in place.

Warning in question was this:

```
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
```

(cherry picked from commit dcc3c17e5c41ad446b71215b095617e066a2e8e1)
2024-04-28 15:39:01 +02:00
Bo-Yi Wu 7b456a28d1
feat(api): enhance Actions Secrets Management API for repository (#30656)
- Add endpoint to list repository action secrets in API routes
- Implement `ListActionsSecrets` function to retrieve action secrets
from the database
- Update Swagger documentation to include the new
`/repos/{owner}/{repo}/actions/secrets` endpoint
- Add `actions` package import and define new routes for actions,
secrets, variables, and runners in `api.go`.
- Refactor action-related API functions into `Action` struct methods in
`org/action.go` and `repo/action.go`.
- Remove `actionAPI` struct and related functions, replacing them with
`NewAction()` calls.
- Rename `variables.go` to `action.go` in `org` directory.
- Delete `runners.go` and `secrets.go` in both `org` and `repo`
directories, consolidating their content into `action.go`.
- Update copyright year and add new imports in `org/action.go`.
- Implement `API` interface in `services/actions/interface.go` for
action-related methods.
- Remove individual action-related functions and replace them with
methods on the `Action` struct in `repo/action.go`.

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: appleboy <appleboy.tw@gmail.com>
(cherry picked from commit 852547d0dc70299589c7bf8d00ea462ed709b8e5)

Conflicts:
	routers/api/v1/api.go
	trivial conflict because of Fix #2512 /api/forgejo/v1/version auth check (#2582)
2024-04-28 15:39:01 +02:00
wxiaoguang 089e95f250
Fix code search input for different views (#30678)
Now only show the "code search" on the repo home page, because it only
does global search.
So do not show it when viewing file or directory to avoid misleading
users (it doesn't search in a directory)

(cherry picked from commit 993736d838c36e26951b6cfea9c6a549958addd1)
2024-04-28 15:39:01 +02:00
Yarden Shoham 9ea73fcb09
Bump htmx version to 1.9.12 (#30711)
There are no breaking changes. I tested and everything works as before.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 68a3e6b5e64b4035aa0659cb6daa1c4d1eec892a)
2024-04-28 15:39:01 +02:00
wxiaoguang 5e81ae1798
Refactor imagediff and fix regression bug (#30694)
Fix #30683

(cherry picked from commit fd63b96f6a4c5b3ea9e53d37af85e0d2d09715b9)
2024-04-28 15:39:01 +02:00
Jiaxin Zhu 93820d26ba
Fix view of readme file in the home code page. (#30564)
Gitea attempts to display image file, pdf file, etc. named readme in the
home code page (but it cannot).
I think only the markdown and plain-text file should be displayed, which
is also the behavior of GitHub.

Co-authored-by: jxshin <zhujiaxinabc@gmail.com>
(cherry picked from commit a63f14b90839821a480fb56fd9b45a27864b77d1)
2024-04-28 15:39:01 +02:00
silverwind bce70cc024
Fix border-radius of header+segment boxes (#30667)
This is a very old bug with the bottom border-radiuses not being there
and the `:has` selector now makes it possible to cleanly solve it. It
affects all header+segment boxes, which there are many throughout the
UI:

<img width="1017" alt="Screenshot 2024-04-23 at 20 47 21"
src="https://github.com/go-gitea/gitea/assets/115237/870fe352-cc38-4bd6-bfe6-9fe8c3066f92">

(cherry picked from commit 3f19a6334575e1d2849999e8339f1b515cefaf1a)
2024-04-28 15:39:01 +02:00
Lunny Xiao 931ca18340
Fix some bug on migrations (#30647)
Fix https://github.com/go-gitea/gitea/pull/23894#discussion_r1573718690

(cherry picked from commit 2ad9ef4984f0b68ef38241fd6b557d8427d851d8)

Conflicts:
	models/migrations/v1_16/v210.go
	models/migrations/v1_22/v286.go
	trivial conflicts because MSSQL is no longer supported
2024-04-28 15:39:01 +02:00
silverwind 2079d61a14
Fix checkbox field markup (#30666)
Fixes https://github.com/go-gitea/gitea/issues/30664.

Previous use was not a supported way by fomantic and the misuse only
became visible after the checkbox migration.

(cherry picked from commit 1a2ae64b16f10b8d1e17197d18b9eb373faf58db)
2024-04-28 15:39:01 +02:00
wxiaoguang bafe237375
Avoid doubled border for the PR info segment (#30663)
(cherry picked from commit 2ee93ea17869de8fe24c6965fa3416ff30d55c5a)
2024-04-28 15:39:00 +02:00
sillyguodong 561a7cf520
Interpolate runs-on with variables when scheduling tasks (#30640)
Follow #29468
1. Interpolate runs-on with variables when scheduling tasks.
2. The `GetVariablesOfRun` function will check if the `Repo` of the run
is nil.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 2f6b1c46a1a4a90f56ca0f3ad7840e8e70daeab5)

Conflicts:
	services/actions/schedule_tasks.go
	trivial conflict because of 'Add vars context to cron jobs (#3059)'
2024-04-28 15:39:00 +02:00
wxiaoguang a72b660cbb
Fix flash message for flex-container (#30657)
(cherry picked from commit dd2aaadce3ecd3134a1ba0c82c5aaa05d6c11b2b)

Conflicts:
	templates/admin/layout_head.tmpl
	    mostly already done by https://codeberg.org/forgejo/forgejo/pulls/3087
	web_src/css/base.css
            the conflict is because
            https://codeberg.org/forgejo/forgejo/pulls/3350
            skipped Remove fomantic menu module (gitea#30325)
            and it was not ported.
2024-04-28 15:39:00 +02:00
Kemal Zebari 50917ead5f
Perform Newest sort type correctly when sorting issues (#30644)
Should resolve #30642.

Before this commit, we were treating an empty `?sort=` query parameter
as the correct sorting type (which is to sort issues in descending order
by their created UNIX time). But when we perform `sort=latest`, we did
not include this as a type so we would sort by the most recently updated
when reaching the `default` switch statement block.

This commit fixes this by considering the empty string, "latest", and
just any other string that is not mentioned in the switch statement as
sorting by newest.

(cherry picked from commit 9b7af4340c36d3e1888788499d16f83feeb1601b)
2024-04-28 15:39:00 +02:00
silverwind 39faa125d5
Fix project name wrapping, remove horizontal margin on header (#30631)
Enable wrapping of unbroken lines:

<img width="1308" alt="Screenshot 2024-04-22 at 00 31 33"
src="https://github.com/go-gitea/gitea/assets/115237/1a28ade1-d708-4260-96a3-cf508b6dcb79">

Remove extra margin added by nested `.ui.container` on certain
viewports:

Before:
<img width="1305" alt="Screenshot 2024-04-22 at 00 40 23"
src="https://github.com/go-gitea/gitea/assets/115237/d3d8c0d1-380c-4867-b95c-4d53d70d4a93">

After:
<img width="1310" alt="Screenshot 2024-04-22 at 00 40 33"
src="https://github.com/go-gitea/gitea/assets/115237/2ba7b9f2-db2f-4bcc-8cce-5c415625ddea">

(cherry picked from commit 370b1bdb3757e91c59303b0ce6ec49c56eca795b)
2024-04-28 15:39:00 +02:00
Zettat123 168cb758ec
Add a db consistency check to remove runners that do not belong to a repository (#30614)
Follow #30406

(cherry picked from commit 30dd4beeee631860c7dd393c341e9955997095a4)
2024-04-28 15:39:00 +02:00
Lunny Xiao 4f73382e95
Fix wrong table name (#30557)
The table name should be `oauth2_application` but `o_auth2_application`

Caused by
https://github.com/go-gitea/gitea/pull/21316/files#diff-9610efbc608a41f1f2eaff5790423f0a187906f6ff0beb23a5e8d18366cc2ccfR38

(cherry picked from commit e94864e86c43f435af7e1fc3c4831a4cc0a3e981)

Conflicts:
	models/migrations/migrations.go
	trivial context conflict because
	Allow everyone to read or write a wiki by a repo unit setting (#30495)
        was skipped.
2024-04-28 15:39:00 +02:00
wxiaoguang b9891088ad
Allow everyone to read or write a wiki by a repo unit setting (#30495)
Replace #6312
Help #5833
Wiki solution for #639

(cherry picked from commit 3feba9f1f44156c256a30d25ad1c25f751819c94)

Conflicts:
  Trash everything, just keep the migration placeholder to ensure the Gitea
  sequence is preserved. The Wiki edition is implemented differently.
2024-04-28 15:39:00 +02:00
Lunny Xiao 4e6e63dca2
Fix compare api swagger (#30648)
The swagger format on #30349 is not right. This PR will fix it.

(cherry picked from commit 8924d9b2efd52132876fcd106c625a2a2db7a295)
2024-04-28 15:39:00 +02:00
silverwind f619b96228
Enable jquery-related eslint rules that have no violations (#30632)
All these have no violations, so enable them.

(cherry picked from commit 99c5683da5e5c50154dcf9c07229a455a5095058)

Conflicts:
	.eslintrc.yaml
	do not enable no-sizzle as Forgejo still uses it
2024-04-28 15:39:00 +02:00
silverwind 12b199c5e5
Enable more `revive` linter rules (#30608)
Noteable additions:

- `redefines-builtin-id` forbid variable names that shadow go builtins
- `empty-lines` remove unnecessary empty lines that `gofumpt` does not
remove for some reason
- `superfluous-else` eliminate more superfluous `else` branches

Rules are also sorted alphabetically and I cleaned up various parts of
`.golangci.yml`.

(cherry picked from commit 74f0c84fa4245a20ce6fb87dac1faf2aeeded2a2)

Conflicts:
	.golangci.yml
	apply the linter recommendations to Forgejo code as well
2024-04-28 15:39:00 +02:00
silverwind 31b608a1e9
Remove obsolete CSS text classes (#30576)
- `.text-thin` and `.text-italic` are not present in CSS so were doing nothing and I removed them.
- `.text.middle` was unused so I removed it.
- `.text.italic` is replaced with `tw-italic`.
- `.text.normal` had exactly one use and it wasn't even needed.
- add a `muted` class to the link to `org_profile_avatar.tmpl`.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit aff7b7bdd285cc1fcabea774f153886e11ae9f5d)
2024-04-28 15:39:00 +02:00
silverwind 02316e1e40
Hide diff stats on empty PRs (#30629)
When a PR is empty, e.g. has neither additions nor deletions, we don't
need to show this:

<img width="125" alt="Screenshot 2024-04-21 at 23 25 38"
src="https://github.com/go-gitea/gitea/assets/115237/0b987eb5-66f5-4b9b-b5aa-7e9e267e9b52">

(cherry picked from commit 0386a42f70d1026c50697b12378f5026a63182b9)
2024-04-28 15:39:00 +02:00
GiteaBot 2b45aa42f5
[skip ci] Updated licenses and gitignores
(cherry picked from commit 31386dc2bb94346b5a1039f009021a4e2f5eb166)
2024-04-28 15:39:00 +02:00
Bo-Yi Wu 4e2de8bdc6
fix(api): refactor branch and tag existence checks (#30618)
- Update branch existence check to also include tag existence check
- Adjust error message for branch/tag existence check

ref: https://github.com/go-gitea/gitea/pull/30349

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 6459c50278906893f3cbc2bf3e52eff65e739b37)
2024-04-28 15:39:00 +02:00
silverwind e64e8d24ac
Fix flash on dashboard (#30572)
Fixes https://github.com/go-gitea/gitea/issues/30566, regression from
https://github.com/go-gitea/gitea/pull/30214.

(cherry picked from commit 1b1b8500aea0a17e999093e65b573ce54ae080ae)

Conflicts:
	web_src/css/base.css
	the conflict is because
	https://codeberg.org/forgejo/forgejo/pulls/3350
	skipped Remove fomantic menu module (gitea#30325)
	and it was not ported.
2024-04-28 15:39:00 +02:00
Cheng 2ec0c5e284
chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621)
use errors.New to replace fmt.Errorf with no parameters will much better

(cherry picked from commit 9de443ced2c328d9b58a5e144a765f402aab859d)
2024-04-28 15:39:00 +02:00
Earl Warren de9d498109 Merge pull request 'Fix issue watch button' (#3509) from fnetx/fix-issue-watch into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3509
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-28 12:45:27 +00:00
Beowulf b796694cd5
Skip already handled incoming emails
It seems like (at least on my machine) that every mail is processed
twice. Added a check if the email is already handled and if so, skip it.
2024-04-28 14:21:06 +02:00
Otto 641ddbbbb9 Merge pull request 'Release notes: Limit database max connections by default' (#3500) from fnetx/release-notes-maxconn into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3500
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-28 11:19:22 +00:00
Otto Richter bc8860ce32 Move watching sub-template to sidebar folder 2024-04-28 12:56:28 +02:00
Otto Richter 4b8f0d0972 Revert "Unify watching template"
This reverts commit 47ef51d51e.
2024-04-28 12:48:17 +02:00
Earl Warren e8361b3c0e Merge pull request 'Move settings button back to the right in repo and org header' (#3462) from Beowulf/forgejo:move-repo-settings-btn-back-to-right into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3462
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-28 06:20:32 +00:00
Renovate Bot 95f8b1bbc5 Update module github.com/urfave/cli/v2 to v2.27.2 2024-04-28 00:05:53 +00:00
Beowulf 162b840100
Add inline attachments to comments
If incoming email is configured and an email is sent, inline
attachments are currently not added to the comment if it has the
`Content-Disposition: inline` instead of
`Content-Disposition: attachment` as e.g. with Apple Mail.

This adds inline attachments (`Content-Disposition: inline`) that have a
filename as attachment to the comment.

Fixes #3496
2024-04-28 00:33:03 +02:00
Robin Kloppe 10cd0f3992 replaced link to gitea docu 2024-04-27 23:27:57 +02:00
Otto Richter 5c76c37a50 Release notes for Limit database max connections by default 2024-04-27 22:03:25 +02:00
Earl Warren bfdbc2371d Merge pull request 'RELEASE Version Link Interface customization' (#3498) from mainboarder/forgejo:release-version into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3498
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-27 20:00:05 +00:00
Otto 9f5fda6a04 Merge pull request 'Split issue sidebar template into smaller files' (#3445) from fnetx/split-sidebar-template into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3445
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-27 19:18:56 +00:00
Otto 98589b487c Merge pull request 'Update module github.com/minio/minio-go/v7 to v7.0.70' (#3469) from renovate/github.com-minio-minio-go-v7-7.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3469
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-27 19:15:38 +00:00
Robin Kloppe df8b1b5dd2 RELEASE Version Link 2024-04-27 20:17:33 +02:00
Codeberg Translate cb004e9d8b [I18N] Translations update from Weblate (#3359)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: leana8959 <leana8959@users.noreply.translate.codeberg.org>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: SteffoSpieler <SteffoSpieler@users.noreply.translate.codeberg.org>
Co-authored-by: Mylloon <Mylloon@users.noreply.translate.codeberg.org>
Co-authored-by: lucasmz <lucasmz@users.noreply.translate.codeberg.org>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: FunctionalHacker <FunctionalHacker@users.noreply.translate.codeberg.org>
Co-authored-by: owofied <furry@users.noreply.translate.codeberg.org>
Co-authored-by: Xinayder <Xinayder@users.noreply.translate.codeberg.org>
Co-authored-by: kecrily <kecrily@users.noreply.translate.codeberg.org>
Co-authored-by: ZilloweZ <ZilloweZ@users.noreply.translate.codeberg.org>
Co-authored-by: toasterbirb <toasterbirb@users.noreply.translate.codeberg.org>
Co-authored-by: Pi-Cla <Pi-Cla@users.noreply.translate.codeberg.org>
Co-authored-by: sinsky <sinsky@users.noreply.translate.codeberg.org>
Co-authored-by: kdh8219 <kdh8219@users.noreply.translate.codeberg.org>
Co-authored-by: 747 <747@users.noreply.translate.codeberg.org>
Co-authored-by: Quitaxd <Quitaxd@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3359
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-04-27 16:37:31 +00:00
Earl Warren 8da64860e7 Merge pull request 'Update module gitea.com/gitea/act to v0.261.1' (#3492) from renovate/gitea.com-gitea-act-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3492
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-27 11:01:59 +00:00
Earl Warren 3db929a2be
chore(licenses): github.com/minio/sha256-simd is no longer in use 2024-04-27 10:43:27 +02:00
Earl Warren d90b1e2c00
fix(renovate): gitea.com/gitea/act requires dashboard approval 2024-04-27 10:31:13 +02:00
Renovate Bot 004fe91d37 Update module gitea.com/gitea/act to v0.261.1 2024-04-27 02:04:59 +00:00
Otto Richter 5bc72998e0 I feel responsible … (Codeowners)
… for dealing with conflicts and future modification of this template
2024-04-27 02:22:05 +02:00
Otto Richter 66b22c5818 Unify allow edits logic 2024-04-27 02:22:05 +02:00
Otto Richter 6bd4925753 Split allow edits checkbox 2024-04-27 02:22:05 +02:00
Otto Richter a8f8667a03 Split references and actions 2024-04-27 02:22:05 +02:00
Otto Richter 0eec8b84a1 Split issue dependencies 2024-04-27 02:22:05 +02:00
Otto Richter cc83b9349d Split deadline / due date 2024-04-27 02:22:05 +02:00
Otto Richter 27a9fd1792 Split timetracking 2024-04-27 02:22:04 +02:00
Otto Richter 47ef51d51e Unify watching template 2024-04-27 02:22:04 +02:00
Otto Richter 35c967653b Split watching 2024-04-27 02:22:04 +02:00
Otto Richter dfaeb4692c Split participants 2024-04-27 02:22:04 +02:00
Otto Richter 019d322351 Split assignees 2024-04-27 02:22:04 +02:00
Otto Richter 3d5c1c6cef Split milestones and projects 2024-04-27 02:22:04 +02:00
Otto Richter 66cab785fc Split PR-only templates 2024-04-27 02:22:04 +02:00
Otto Richter b406025aae Move branch_selection to sidebar folder 2024-04-27 02:22:04 +02:00
Renovate Bot 01d9faefa5 Update module connectrpc.com/connect to v1.16.1 2024-04-27 00:07:16 +00:00
Baptiste Daroussin 08f5a25d3b ldap: default domain name (#3414)
When the ldap synchronizer is look for an email address and fails at
finding one, it falls back at creating one using "localhost.local"
domain.

This new field makes this domain name configurable.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3414
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Baptiste Daroussin <bapt@FreeBSD.org>
Co-committed-by: Baptiste Daroussin <bapt@FreeBSD.org>
2024-04-26 22:38:58 +00:00
Earl Warren 4da76d0e5f Merge pull request 'fix(Dockerfile.rootless): revert to default path for `app.ini`' (#3363) from gmask/forgejo:fix/container-app-ini-variable into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3363
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-26 22:36:33 +00:00
Earl Warren c4db84ad0e Merge pull request 'docs(release-notes): 7.0.1' (#3484) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3484
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: crystal <crystal@noreply.codeberg.org>
2024-04-26 22:34:25 +00:00
Earl Warren a5df622099
docs(release-notes): 7.0.1 2024-04-27 00:31:22 +02:00
Beowulf f9628f883d
Move settings button back to the right in repo and org header
This will move the settings button back to the right, like known from
older versions.
For this, the overflow-menu was changed when a setting button is
available. If no settings button is available, the behavior will not
change.

Fixes #3301
2024-04-26 23:59:08 +02:00
Gerard Salvatella dad16cd589 fix(Dockerfile.rootless): revert to default path for `app.ini`
The current path of the `$GITEA_APP_INI` configuration file makes the
forgejo application reset every time the container is restarted, unless
a specific volume for this file is created. Consider the following:

* This quirk is not documented
* All configuration data resides in `/var/lib/gitea`
* The custom configuration path defaults to `/var/lib/gitea/custom/conf`
  (see `forgejo -h`)
* Containers mounting the volume `-v /foo/bar:/var/lib/gitea` already
  have this file available to modify. Another volume shouldn't be
  required
* Containers using named volumes can use `docker cp` to modify the file
  inside the volume, if desired

For these reasons, it makes more sense to use the default path for
`$GITEA_APP_INI` rather than require users to create a dedicated volume
for the file. Revert it back to its default while maintaining backwards
compatibility (users can update by simply moving the file to the new
path).
2024-04-26 21:30:10 +02:00
Beowulf 9035b400a6
UI: use full screen height for displaying pdf files 2024-04-26 20:42:45 +02:00
Earl Warren d6c36ec406 Merge pull request 'Drop Gitea-specific columns from two tables' (#3475) from algernon/forgejo:wiki-branch-wars-episode-iii-a-new-migration into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3475
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-26 10:21:28 +00:00
oliverpool 20350846fc Merge pull request 'fix: git.ComputeHash did not write the content' (#3466) from oliverpool/forgejo:fix_compute_hash into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3466
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-26 10:15:23 +00:00
Earl Warren c31ae1a651 fix(lfs): gogit /settings/lfs/find 500 error (#3472)
Refs: https://codeberg.org/forgejo/forgejo/pulls/3448
Refs: https://codeberg.org/forgejo/forgejo/issues/3438
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3472
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2024-04-26 09:22:09 +00:00
Earl Warren 0819ed2053 Merge pull request 'Update dependency vitest to v1.5.2' (#3468) from renovate/vitest-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3468
2024-04-26 08:37:20 +00:00
Earl Warren 51a610d46c Merge pull request 'Update dependency swagger-ui-dist to v5.17.2' (#3467) from renovate/swagger-ui-dist-5.17.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3467
2024-04-26 08:36:47 +00:00
Gergely Nagy 2bc226eb57
Drop Gitea-specific columns from two tables
Gitea and Forgejo chose to implement wiki branch naming differently, but
Forgejo picked the Gitea migration anyway, resulting in an unused column
in the database, which wasn't part of the `Repository` struct either -
something warned about during startup, too.

Similarly, Forgejo chose not to implement User badges at all - but kept
the existing code for it -, and the `badge` table ended up with an
unused `slug` column due to a Gitea migration, and resulted in another
warning at startup.

To keep the database consistent with the code, and to get rid of these
warnings, lets introduce a new migration, which simply drops these
Gitea-specific columns from the database.

Fixes #3463.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-26 10:34:06 +02:00
Earl Warren 801554f708 Merge pull request 'Limit database max connections by default' (#3383) from fnetx/Limit database max connections by default into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3383
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-26 08:31:15 +00:00
Earl Warren c864448dc9 Merge pull request 'services/convert: Convert a Repository's ObjectFormatName too' (#3464) from algernon/forgejo:i-object-exclamationmark-format-name into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3464
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-26 08:27:41 +00:00
Earl Warren 127eff49ee docs(release-notes): split items in files to avoid conflicts (#3452)
I thought there would be conflicts but that they would not be so difficult to manage. Worst idea I had this week. Change to @oliverpool idea instead.

> Instead of documenting the release notes in the issue, why not in the codebase?
>
> For instance in [go](https://cs.opensource.google/go/go/+/master:doc/README.md) there is a `doc/next` folder where you add `<pr-number>.md` files which document each pr.
>
> Before the release, a script takes all those files to generate the changelog.
>
> Having them as a file tracked by git, makes them easy to review and to programmatically handle.

Refs: https://codeberg.org/forgejo/discussions/issues/155#issuecomment-1787013
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3452
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2024-04-26 08:26:33 +00:00
oliverpool 5247fd50db fix: git.ComputeHash did not write the content 2024-04-26 10:16:59 +02:00
oliverpool 3dfa5ba43a test: LFS gc should not delete all metadata objects
and ComputeBlobHash should depend on the blob content (not only the
length)
2024-04-26 10:16:59 +02:00
Renovate Bot 90c56a9d66 Update dependency vitest to v1.5.2 2024-04-26 08:10:29 +00:00
Renovate Bot aa2af10f67 Update dependency swagger-ui-dist to v5.17.2 2024-04-26 08:10:19 +00:00
Shiny Nematoda a641ebf221 [FIX] Set max fuzziness to 2 for bleve (#3444)
closes #3443

regression from ab5f0b7558

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3444
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
2024-04-26 08:08:47 +00:00
Earl Warren 40d0f50838 Merge pull request 'docs(release-notes): 7.0.0 LFS garbage collection and workaround' (#3473) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3473
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-26 08:05:12 +00:00
Gergely Nagy 2385f3c9db
services/convert: Convert a Repository's ObjectFormatName too
When converting a `repo_model.Repository` to `api.Repository`, copy the
`ObjectFormatName` field too.

Fixes #3458.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-26 09:25:30 +02:00
Earl Warren b51c608d3f
docs(release-notes): 7.0.0 LFS garbage collection and workaround
Refs: https://codeberg.org/forgejo/forgejo/issues/3438
(cherry picked from commit a37836f228)
2024-04-26 09:16:50 +02:00
Renovate Bot a3be70f0a5 Update ghcr.io/visualon/renovate Docker tag to v37.323.3 2024-04-26 04:02:40 +00:00
Renovate Bot ca9c039ba6 Update module github.com/minio/minio-go/v7 to v7.0.70 2024-04-26 02:05:51 +00:00
Earl Warren 7f187f9857 Merge pull request 'fix(ui): /settings/lfs/find 500 error (take 2)' (#3465) from earl-warren/forgejo:wip-lfs-template into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3465
Reviewed-by: Otto <otto@codeberg.org>
2024-04-25 21:39:14 +00:00
Earl Warren 4036448c02
fix(ui): /settings/lfs/find 500 error (take 2)
Make the test actually fails on error and not just report failure on
the output and succeed.
2024-04-25 23:00:11 +02:00
Earl Warren 94d7523f83 Merge pull request '[BUG] save empty comments' (#3442) from oliverpool/forgejo:empty_comments into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3442
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-25 19:32:28 +00:00
Earl Warren f7786e207e Merge pull request 'Change the default SSH clone url to the ssh:// style' (#3285) from algernon/forgejo:cloning-in-sshtyle into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3285
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-25 19:24:54 +00:00
Earl Warren 9e212c515e Merge pull request 'chore(eslint): avoid lint the build' (#3446) from kecrily/forgejo:chore/eslint into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3446
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-25 19:20:06 +00:00
Nicolas CARPi ad9872d884 docs: contributing: avoid information duplication (#3454)
The file CONTRIBUTING.md contains a list of links that points to
different parts of the developer documentation.

Unfortunately, this list is now incomplete and contains a dead link for the
Developer Workflow.

Given that a more complete similar list is present at:
https://forgejo.org/docs/latest/developer/, this patch removes the
duplication of information, which leads to dead links and
maintenance burden, and replaces the list with simply a link to the page
that has all the current links.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3454
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Nicolas CARPi <nico-git@deltablot.email>
Co-committed-by: Nicolas CARPi <nico-git@deltablot.email>
2024-04-25 19:10:43 +00:00
Earl Warren 90757544fd Merge pull request 'Fix Repository icon, name and label not centered vertically' (#3433) from Beowulf/forgejo:fix-repo-header-vertically-center into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3433
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-25 16:18:48 +00:00
Earl Warren 302daddcd1 Merge pull request 'Implement remote user login source and promotion to regular user' (#2465) from earl-warren/forgejo:wip-remote-user into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2465
2024-04-25 15:25:05 +00:00
Beowulf a278e925a1
Fix Repository icon, name and label not centered vertically
Readded correct tailwind class for vertical centering

Regression introduced by 65e190ae8b

Fixes #3428.
2024-04-25 17:24:41 +02:00
Earl Warren a8413a1539 Merge pull request 'fix(ui): /settings/lfs/find 500 error' (#3448) from earl-warren/forgejo:wip-lfs-template into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3448
Reviewed-by: Otto <otto@codeberg.org>
2024-04-25 15:12:39 +00:00
Earl Warren 078229a5e4
fix(ui): /settings/lfs/find 500 error
When in the repository settings, visiting

- `LFS` to `/{owner}/{repo}/settings/lfs`
- `Find pointer files` to `/{owner}/{repo}/settings/lfs/pointers`
- `Find commits` to `/{owner}/{repo}/settings/lfs/find?oid=...`

failed with an error 500 because of an incorrect evaluation of the
template.

Regression introduced by
cbf923e87b

A test is added to visit the page and guard against future
regressions.

Refs: https://codeberg.org/forgejo/forgejo/issues/3438
2024-04-25 16:37:12 +02:00
Percy Ma 44a1f90308
chore(eslint): avoid lint the build 2024-04-25 21:49:18 +08:00
Earl Warren b222ec7631 Merge pull request 'Update dependency swagger-ui-dist to v5.17.1' (#3436) from renovate/swagger-ui-dist-5.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3436
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-25 13:20:22 +00:00
Earl Warren f136cca5df
feat(renovate): automerge swagger-ui-dist patch updates
Looking at
https://github.com/swagger-api/swagger-ui/graphs/contributors
it looks like https://github.com/char0n is actively maintaining the
package and the changes of the last release suggest it can be
trusted with patch upgrades.
2024-04-25 13:14:30 +02:00
Earl Warren 7cabc5670d
Implement remote user login source and promotion to regular user
A remote user (UserTypeRemoteUser) is a placeholder that can be
promoted to a regular user (UserTypeIndividual). It represents users
that exist somewhere else. Although the UserTypeRemoteUser already
exists in Forgejo, it is neither used or documented.

A new login type / source (Remote) is introduced and set to be the login type
of remote users.

Type        UserTypeRemoteUser
LogingType  Remote

The association between a remote user and its counterpart in another
environment (for instance another forge) is via the OAuth2 login
source:

LoginName   set to the unique identifier relative to the login source
LoginSource set to the identifier of the remote source

For instance when migrating from GitLab.com, a user can be created as
if it was authenticated using GitLab.com as an OAuth2 authentication
source.

When a user authenticates to Forejo from the same authentication
source and the identifier match, the remote user is promoted to a
regular user. For instance if 43 is the ID of the GitLab.com OAuth2
login source, 88 is the ID of the Remote loging source, and 48323
is the identifier of the foo user:

Type        UserTypeRemoteUser
LogingType  Remote
LoginName   48323
LoginSource 88
Email       (empty)
Name        foo

Will be promoted to the following when the user foo authenticates to
the Forgejo instance using GitLab.com as an OAuth2 provider. All users
with a LoginType of Remote and a LoginName of 48323 are examined. If
the LoginSource has a provider name that matches the provider name of
GitLab.com (usually just "gitlab"), it is a match and can be promoted.

The email is obtained via the OAuth2 provider and the user set to:

Type        UserTypeIndividual
LogingType  OAuth2
LoginName   48323
LoginSource 43
Email       foo@example.com
Name        foo

Note: the Remote login source is an indirection to the actual login
source, i.e. the provider string my be set to a login source that does
not exist yet.
2024-04-25 13:03:49 +02:00
oliverpool ea9051624d comment: save empty comments 2024-04-25 11:21:39 +02:00
oliverpool 0d37f3a79b test: empty existing comment 2024-04-25 11:20:04 +02:00
forgejo-renovate-action 7624b78544 Merge pull request 'Update dependency vitest to v1.5.1' (#3437) from renovate/vitest-monorepo into forgejo 2024-04-25 06:37:37 +00:00
Renovate Bot f1afbb3442 Update dependency vitest to v1.5.1 2024-04-25 06:03:55 +00:00
Earl Warren 1e0642b086 Merge pull request 'api: The repo wiki APIs should respect WikiBranch' (#3430) from algernon/forgejo:master-of-branches into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3430
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-25 05:37:25 +00:00
Renovate Bot d7ce77b7c6 Update dependency swagger-ui-dist to v5.17.1 2024-04-25 00:05:18 +00:00
Gergely Nagy 1d894dda24
Add a note about the previous bugfix to RELEASE-NOTES
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-25 01:07:41 +02:00
Earl Warren d0bfd3e523 Merge pull request 'tests: Refactor CreateDeclarativeRepo' (#3432) from algernon/forgejo:declaration-of-repositorytance into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3432
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-24 22:38:14 +00:00
Gergely Nagy a1dfe07bfc
tests: Test the Wiki APIs with a non-master branch
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-25 00:36:58 +02:00
Gergely Nagy 6d2f645363
tests: Let CreateDeclarativeRepoWithOptions create a Wiki too
Add a new member to `DeclarativeRepoOptions`: `WikiBranch`. If
specified, create a Wiki with the given branch, and a single "Home"
page.

This will be used by an upcoming test.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-25 00:36:58 +02:00
Gergely Nagy c647e8639f
api: The repo wiki APIs should respect WikiBranch
Back in #2264, we made it possible to change the branch wikis use from
the hardcoded "master" branch to `[repository].DEFAULT_BRANCH`. However,
the API endpoints were not updated, and the "master" branch remained
hardcoded there.

This change fixes that, the API endpoints will now respect the
repository's `WikiBranch`.

Fixes #3391.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-25 00:36:58 +02:00
Earl Warren bdb729a5f2 Merge pull request 'fix(cli): admin user create first user never require a password change' (#3412) from earl-warren/forgejo:wip-cli-user-create into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3412
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-04-24 22:12:05 +00:00
Earl Warren 217feb6a1f Merge pull request 'feat(docs): 8.0.0 release notes template' (#3416) from earl-warren/forgejo:wip-release-notes-v8.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3416
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-04-24 22:07:17 +00:00
Earl Warren 52ec4120cd Merge pull request 'test(ldap): add LDAP tests' (#3426) from earl-warren/forgejo:wip-ci-ldap into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3426
Reviewed-by: thefox <thefox@noreply.codeberg.org>
2024-04-24 22:05:41 +00:00
Gergely Nagy e7fcf3f189
tests: Refactor CreateDeclarativeRepo
Lets introduce a new helper function,
`CreateDeclarativeRepoWithOptions`! This is almost the same as the
existing `CreateDeclarativeRepo` helper, but instead of taking a list of
random parameters the author thought of at the time of its introduction,
it takes a `DeclarativeRepoOptions` struct, with optional members.

This makes it easier to extend the function, as new members can be added
without breaking or having to update existing callsites, as long as the
newly added members default to compatible values.

`CreateDeclarativeRepo` is then reimplemented on top of the new
function. Callsites aren't updated yet, we can do that organically,
whenever touching code that uses the older function.

No new functionality is introduced just yet, this is merely a refactor.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-24 23:39:47 +02:00
Earl Warren aa66d0a0eb
test(ldap): add LDAP tests 2024-04-24 22:06:32 +02:00
JakobDev 1bce2dc5c5 [FEAT]Add Option to hide Release Archive links (#3139)
This adds a new options to releases to hide the links to the automatically generated archives. This is useful, when the automatically generated Archives are broken e.g. because of Submodules.

![grafik](/attachments/5686edf6-f318-4175-8459-89c33973b181)
![grafik](/attachments/74a8bf92-2abb-47a0-876d-d41024770d0b)

Note:
This juts hides the Archives from the UI. Users can still download 5the Archive if they know t correct URL.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3139
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-committed-by: JakobDev <jakobdev@gmx.de>
2024-04-24 15:15:55 +00:00
Earl Warren 6bcaf4f875 Merge pull request 'UI: fix rounding of vertical menus on /issues, /pulls' (#3418) from 0ko/forgejo:rounding1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3418
Reviewed-by: Otto <otto@codeberg.org>
2024-04-24 15:10:58 +00:00
0ko 0956415707 UI: fix rounding of vertical menus on /issues, /pulls 2024-04-24 19:07:16 +05:00
Earl Warren ec334239e0
fix(cli): admin user create first user never require a password change
Fixes: https://codeberg.org/forgejo/forgejo/issues/3399
2024-04-24 15:43:27 +02:00
Earl Warren b9424e634f
test(cli): admin user change-password --must-change-password 2024-04-24 15:43:27 +02:00
Earl Warren eb74846d7d
test(cli): admin user create and must change password value 2024-04-24 15:43:24 +02:00
Earl Warren 97dab9be8d
feat(docs): 8.0.0 release notes template
so that individual commits can include additions to the release notes
when relevant.
2024-04-24 14:24:44 +02:00
Earl Warren 3df4a78464 Merge pull request 'fix(docs): v7.0.0 admin user create regression (take2)' (#3411) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3411
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-24 12:17:48 +00:00
Earl Warren 3138cb015a Merge pull request 'chore(renovate): require more approvals' (#3415) from viceice/forgejo:chore/renovate-reconfigure into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3415
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-24 12:17:23 +00:00
Michael Kriese f502886510
chore(renovate): require more approvals 2024-04-24 13:47:54 +02:00
Earl Warren b127b24f02
fix(docs): v7.0.0 admin user create regression (take2)
The scope of the regression is limited to the first created user when
it is not an admin.

Refs: https://codeberg.org/forgejo/forgejo/issues/3399
2024-04-24 12:41:14 +02:00
Earl Warren 9eb0c668c4 Merge pull request 'chore(renovate): update config' (#3407) from viceice/forgejo:chore/renovate-linter-automerge into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3407
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-24 07:55:14 +00:00
Earl Warren 813f14aa02 Merge pull request 'feat(docs): 7.0.1 release notes template' (#3406) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3406
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-24 07:16:22 +00:00
Michael Kriese 01ea982fca
chore(renovate): enable automerge and require release age for some packages 2024-04-24 09:06:30 +02:00
Earl Warren a452fea96d Merge pull request 'Update dependency vitest to v1.5.0' (#3401) from renovate/vitest-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3401
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-24 06:42:52 +00:00
Earl Warren b1ebd6632f Merge pull request 'Update linters' (#3402) from renovate/linters into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3402
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-24 06:41:40 +00:00
Earl Warren a7602781c4
feat(docs): 7.0.1 release notes template
so that individual commits can include additions to the release notes
when relevant.
2024-04-24 08:36:24 +02:00
Earl Warren 30d0df8b79 Merge pull request 'fix(docs): v7.0.0 admin user create regression' (#3404) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3404
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-24 06:27:25 +00:00
Earl Warren 4b57362056
fix(docs): v7.0.0 admin user create regression
The tests in Forgejo extensively rely on admin user create to create
the first admin user. This regression was not noticed because it
is an exception and a password change will not be required.

Refs: https://codeberg.org/forgejo/forgejo/issues/3399
2024-04-24 07:59:28 +02:00
Renovate Bot 92ef180efa Update linters 2024-04-24 02:04:15 +00:00
Renovate Bot 314bac6cee Update dependency vitest to v1.5.0 2024-04-24 00:04:34 +00:00
Earl Warren 5c5cc42fe0 Merge pull request 'fix(docs): tweak 7.0 release notes for FAQ' (#3398) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3398
Reviewed-by: crystal <crystal@noreply.codeberg.org>
2024-04-23 18:16:37 +00:00
Earl Warren f9734a3c52
fix(docs): tweak 7.0 release notes for FAQ
- running doctor convert
- disabling Add More...
2024-04-23 19:47:51 +02:00
Earl Warren d0f378d719 Merge pull request 'Adds support for log-line groups' (#3337) from Mai-Lapyst/forgejo:actions-add-logline-groups into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3337
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-23 14:32:23 +00:00
Earl Warren c60cb0ba90 Merge pull request '[RELEASE] update the release notes introduction' (#3397) from earl-warren/forgejo:wip-release-notes-v7.0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3397
Reviewed-by: Otto <otto@codeberg.org>
2024-04-23 14:31:33 +00:00
Earl Warren 85f074b95a
[RELEASE] update the release notes introduction
- the release cycle is no longer tied to the Gitea release cycle
- breaking changes happen in a manner consistent with semantic versioning
2024-04-23 15:59:26 +02:00
Mai-Lapyst 66bbf75dd3
Add frontend test 2024-04-23 15:55:39 +02:00
Earl Warren 7f52d8e860 Merge pull request 'Update dependency postcss-nesting to v12.1.2' (#3386) from renovate/postcss-packages into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3386
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-23 13:14:42 +00:00
Earl Warren 0c748c1be4 Merge pull request 'Update dependency vue to v3.4.24' (#3387) from renovate/vue-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3387
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-23 13:14:18 +00:00
Earl Warren 949ab9a5c4 [RELEASE] v7.0.0 release notes (#3203)
These release notes need a lot of attention to be good. But they are passable and ready for review.

Multiple factors made them challenging to collect:

- lack of organization Forgejo side which is going to be better for the next version
- complete reorganization of the development workflows which made it challenging to sort out what is in the release or not
- unification of the branches into a single one after the hard fork decision

Refs: https://codeberg.org/forgejo/forgejo/issues/2425
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3203
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2024-04-23 08:40:07 +00:00
Earl Warren ca46a1cbe6 Merge pull request 'Fix the WIP prefix toggling on the sidebar' (#3384) from algernon/forgejo:it-really-wips-the-prs-title into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3384
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-23 07:57:56 +00:00
Earl Warren aa2d197642 Merge pull request 'Update dependency vite-string-plugin to v1.2.0' (#3388) from renovate/vite-string-plugin-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3388
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-23 07:21:25 +00:00
Earl Warren 0f2ed33ec2 Merge pull request 'chore(renovate): force merge commit' (#3389) from viceice/forgejo:chore/renovate-automerge-strategy into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3389
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-23 06:47:16 +00:00
Michael Kriese c4d0758f52
chore(renovate): force merge commit 2024-04-23 08:10:55 +02:00
Renovate Bot e10296831e Update dependency vite-string-plugin to v1.2.0 2024-04-23 02:04:06 +00:00
Renovate Bot 208af3e130 Update dependency vue to v3.4.24 2024-04-23 02:03:37 +00:00
Renovate Bot 0951c06fdf Update dependency postcss-nesting to v12.1.2 2024-04-23 00:04:10 +00:00
Gergely Nagy a93a99eef3
Fix the WIP prefix toggling on the sidebar
The WIP prefix toggling link on the sidebar only supported toggling
the *first* prefix specified in
`[repository.pullrequest].WORK_IN_PROGRESS_PREFIXES`. If the pull
request had a title with any other prefix, the first prefix listed in
the config was added (and then removed on toggling it off).

This little change makes all of the prefixes available for the
JavaScript function that does the toggling, and changes said function to
find the used prefix first, and toggle that.

When adding the prefix, it will still default to adding the first one
listed in the configuration, but it will happily remove any others if
those are present.

Fixes #3377.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-23 01:41:35 +02:00
Earl Warren c22110cf21 Merge pull request 'Fix user search paging' (#3379) from algernon/forgejo:paging-all-users-exclamationmark into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3379
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-22 23:12:28 +00:00
Otto Richter f23fd221e4 Limit database max connections by default
Our default of unlimited database connections is not sane, because every database has a limit, and our default should just follow this. Otherwise it will lead to issues every time a small instance gets a high traffic peak.

Part of https://codeberg.org/forgejo/forgejo/issues/3381

The value of 100 is the lowest value from:

- 100 Postgres https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS
- 151 MySQL https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_connections
- 151 MariaDB https://mariadb.com/docs/server/ref/mdb/system-variables/max_connections/
2024-04-23 00:47:50 +02:00
Earl Warren a3829d3e72 Merge pull request 'fix(incoming): allow replies to comments' (#3378) from earl-warren/forgejo:wip-incoming into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3378
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-22 22:36:19 +00:00
Gergely Nagy 9b85f97835
Fix user search paging
When searching for users, page the results by default, and respect the
default paging limits.

This makes queries like '/api/v1/users/search?limit=1' actually work.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-23 00:06:05 +02:00
Earl Warren 54285319f6
fix(incoming): allow replies to comments
- allow attachments to code comments
- incoming mails from issue comments are now identified as comments

Fixes: https://codeberg.org/forgejo/forgejo/issues/3374
2024-04-23 00:05:12 +02:00
Earl Warren 387e63e6f6 Merge pull request 'Fix dropdown text ellipsis (#30628) (#30633)' (#3372) from earl-warren/forgejo:wip-dropdown into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3372
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-22 19:30:31 +00:00
wxiaoguang 112df5a3fe
Fix dropdown text ellipsis (#30628)
Follow
https://github.com/go-gitea/gitea/pull/30547#discussion_r1573866519

Fix #30624

The Fomantic UI Dropdown wasn't designed to work that way, its "text"
element might contain images. So the "overflow" shouldn't be added to
any general dropdown text.

![image](https://github.com/go-gitea/gitea/assets/2114189/f6ceaabd-bc89-4bf2-baa2-a6f0324c1962)

(cherry picked from commit 1e4867730b261352d63098b85cf53ca05867c8c2)
2024-04-22 21:02:29 +02:00
Earl Warren b63b224c36 Merge pull request '[gitea] week 2024-17 cherry pick (gitea/main -> forgejo)' (#3350) from algernon/wcp/2024-17 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3350
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-22 18:48:13 +00:00
Earl Warren 20537e87a4 Merge pull request 'setting: Infer [email.incoming].PORT from .USE_TLS' (#3366) from algernon/forgejo:this-bool-can-hold-many-ports-in-it into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3366
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-22 17:02:48 +00:00
Earl Warren f94569f9ca Merge pull request 'Accessibility improvements to code review' (#3293) from fnetx/codereview-accessibility into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3293
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: crystal <crystal@noreply.codeberg.org>
2024-04-22 14:37:00 +00:00
Earl Warren 69e0380406 Merge pull request 'Update dependency swagger-ui-dist to v5.17.0' (#3345) from renovate/swagger-ui-dist-5.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3345
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-22 14:36:52 +00:00
Gergely Nagy 0cb46f63df
setting: Infer [email.incoming].PORT from .USE_TLS
If `[email.incoming].USE_TLS` is set, but the port isn't, infer the
default from `.USE_TLS`: set the port to 993 if using tls, and to 143
otherwise. Explicitly setting a port overrides this.

Fixes #3357.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-22 16:30:35 +02:00
Gergely Nagy 073cc891c6
setting: Allow aliases for some email settings
The keys for setting the username and password for incoming and outgoing
mail are inconsisent: one uses `USERNAME` and `PASSWORD`, the other uses
`USER` and `PASSWD`.

To make things simpler, allow both to be configured by either, thus,
`[mailer].USERNAME` and `[mailer.PASSWORD]` will be aliases for `.USER`
and `.PASSWD`, and similarly, `[email.incoming].USER` and
`[email.incoming].PASSWD` will be aliases for `.USERNAME` and
`.PASSWORD`.

Fixes #3355.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-22 16:09:01 +02:00
Earl Warren dbf3121c81 Merge pull request 'Update dependency mini-css-extract-plugin to v2.9.0' (#3333) from renovate/mini-css-extract-plugin-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3333
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-22 14:08:26 +00:00
Renovate Bot b263484c30 Update dependency swagger-ui-dist to v5.17.0 2024-04-22 14:02:40 +00:00
Renovate Bot 56831d345d Update ghcr.io/visualon/renovate Docker tag to v37.316.2 2024-04-22 12:03:00 +00:00
Earl Warren 27f8f955bf Merge pull request 's/Gitea/Forgejo in various log messages and comments' (#3353) from 0ko/forgejo:forgejo-forgejo-forgejo-forgejo-forgejo-forgejo-forgejo-forgejo-forgejo-forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3353
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-22 07:54:30 +00:00
Earl Warren f4716de5b6 Merge pull request '[PORT] gitea#30546: Add form field id generation, remove duplicated ids' (#3361) from algernon/forgejo:gitea/port/30546 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3361
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-22 07:43:25 +00:00
silverwind a01387f5b1
Add form field id generation, remove duplicated ids (#30546)
Fixes: https://github.com/go-gitea/gitea/issues/30384

On repo settings page, there id `repo_name` was used 5 times on the same
page, some in modal and such. I think we are better off just
auto-generating these IDs in the future so that labels link up with
their form element.

Ideally this id generation would be done in backend in a subtemplate,
but seeing that we already have similar JS patches for checkboxes, I
took the easy path for now.

I also checked that these `#repo_name` were not in use in JS and the
only case where this id appears in JS is on the migration page where
it's still there.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit d4ec6b3d16496ce3b479d5a08f79823122dc2b7b)

Conflicts:
	- templates/repo/settings/options.tmpl
	  Conflict resolved by manually removing all `id` and `for`
	  attributes from elements that had `repo_name` as their id.
2024-04-22 08:09:00 +02:00
0ko 438efc9ca2 Merge pull request '[UI] Fix and refactor for milestone headers' (#3340) from 0ko/forgejo:mileston-inconsist into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3340
Reviewed-by: Otto <otto@codeberg.org>
2024-04-21 16:39:38 +00:00
0ko 469c214ec8 s/Gitea/Forgejo in various log messages and comments 2024-04-21 21:26:15 +05:00
Gergely Nagy 81f9c1e7d1
[DEADCODE] update
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-21 16:40:43 +02:00
KN4CK3R 27f459b63b
Fix package list performance (#30520)
Fixes #28255

The new query uses the id field to sort by "newer". This most not be
correct (usually it is) but it's faster (see #28255).
If someone has a better idea, please propose changes.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit b06aac40e6552b0ce1f7b8a92c977fcc27566f68)
2024-04-21 16:28:16 +02:00
yp05327 829c3c6838
Use action user as the trigger user of schedules (#30581)
Follow https://github.com/go-gitea/gitea/pull/30357

When user push to default branch, the schedule trigger user will be the
user.
When disable then enable action units in settings, the schedule trigger
user will be action user.
When repo is a mirror, the schedule trigger user will be action user. (
before it will return error, fixed by #30357)

As scheduled job is a cron, the trigger user should be action user from
Gitea, not a real user.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit cb6814adad4dc81a683b50826a211ce7bce731d7)

Conflicts:
	- services/actions/notifier_helper.go
	  Conflict resolved by keeping Forgejo's version of the line.
2024-04-21 16:28:16 +02:00
wxiaoguang 27434acef6
Fix commit file status parser (#30602)
Try to fix  #30492

(cherry picked from commit 53cf46cae7475befa2dde554bbd9147e436072b9)
2024-04-21 16:28:16 +02:00
wxiaoguang 3330b4d5d8
Fix HEAD method for robots.txt (#30603)
Fix #30601

(cherry picked from commit f60e1a1af25154160f08b85eb159c930b340df8b)
2024-04-21 16:28:16 +02:00
wxiaoguang abeea42751
Fix project description rendering for org (#30587)
Fix #30263

![image](https://github.com/go-gitea/gitea/assets/2114189/41cabe6c-f94a-4874-a26f-d01bb89bb28c)

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit eb24d973b036e4dddf505d8c12e905ecb1a688f9)
2024-04-21 16:28:16 +02:00
Jason Song e7a484e401
Avoid importing `modules/web/middleware` in `modules/session` (#30584)
Related to #30375.

It doesn't make sense to import `modules/web/middleware` and
`modules/setting` in `modules/web/session` since the last one is more
low-level.

And it looks like a workaround to call `DeleteLegacySiteCookie` in
`RegenerateSession`, so maybe we could reverse the importing by
registering hook functions.

(cherry picked from commit 61457cdf6b49225ae831fd9fb084deadd8bdb0fb)
2024-04-21 16:28:16 +02:00
silverwind 1e06c1e392
Improve "Reference in new issue" modal (#30547)
Fixes: https://github.com/go-gitea/gitea/issues/29994

Also some misc enhancements done to the form in the modal.

<img width="840" alt="Screenshot 2024-04-17 at 23 02 55"
src="https://github.com/go-gitea/gitea/assets/115237/e71fba55-55cd-4e48-a497-6b1025c36a43">

(cherry picked from commit dd8e6ae270b4b5e91a152a145978029dacb938ff)
2024-04-21 16:28:16 +02:00
silverwind 688cc2320d
Add a few root files to lint-spell (#30530)
Files in root were not linted, add them. No new violations.

(cherry picked from commit 354705450a410329d253023d2c66ef6d68ecc046)

Conflicts:
	- CHANGELOG.md
	  Gitea specific, removed.
	- Makefile
	  Adjusted SPELLCHECK_FILES: we don't need to filter the
          CHANGELOG.md out. The conflict itself was resolved by manually
	  applying the change.
2024-04-21 16:28:16 +02:00
Jerry Jacobs 5271792666
Fixup app.example.ini for task section, which is now queue.task (#30555)
Config section `[task]` has been deprecated in favor of `[queue.task]`

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 86d4c8a4662e9ab49888569d77529d2d22292e6b)

Conflicts:
	- docs/content/administration/config-cheat-sheet.en-us.md
	- docs/content/administration/config-cheat-sheet.zh-cn.md
	  Removed, they're Gitea specific.
2024-04-21 16:28:16 +02:00
silverwind b8dfea9ae3
Fix border-radius on view, blame and code search (#30545)
Fixes: https://github.com/go-gitea/gitea/issues/30540

1. Fix all these boxes by adding `bottom attached` and removing a
problematic CSS rule:

<img width="1319" alt="Screenshot 2024-04-17 at 22 25 31"
src="https://github.com/go-gitea/gitea/assets/115237/346445a4-4944-4003-a1ef-6f5b0eda624e">
<img width="643" alt="Screenshot 2024-04-17 at 22 21 18"
src="https://github.com/go-gitea/gitea/assets/115237/10f17ed3-9ad6-48de-92fa-bac6621815b9">

2. Change the "last commit" box to `ui segment` which has correct
border-radius. Also included is a tiny tweak to make author name ellipse
instead of wrap.

<img width="1331" alt="Screenshot 2024-04-17 at 22 23 23"
src="https://github.com/go-gitea/gitea/assets/115237/285fbd45-ced0-4d33-abe3-7384ffa03188">

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 31538133c32009532897989ad623067bd224f924)
2024-04-21 16:28:16 +02:00
silverwind 5b08c0a013
Disable enter key for accepting code completion in Monaco (#30548)
Fixes https://github.com/go-gitea/gitea/issues/28114 and behaviour
matches vscode on desktop as well.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 49b80f8ac1cf9f0b56da0c73d0f34ef030f4c447)
2024-04-21 16:28:16 +02:00
Edward Zhang b3a6596b54
Fix branch_protection api shows users/teams who has no readAccess (#30291)
Add some logic in `convert.ToBranchProtection` to return only the names
associated with readAccess instead of returning all names. This will
ensure consistency in behavior between the frontend and backend.
Fixes: #27694

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
Co-authored-by: wenzhuo.zhang <wenzhuo.zhang@geely.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 02e183bf3fa502b7cef76e8dcdbf01b85ce641f0)
2024-04-21 16:28:16 +02:00
silverwind 3918db10c8
Run `go generate` and `go vet` on all packages (#30529)
Fixes: https://github.com/go-gitea/gitea/issues/30512

I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?

(cherry picked from commit 8e12ef911a1d10dedb03e3127c42ca76f9850aca)

Conflicts:
	- Makefile
	  Manually adjusted the changes.
2024-04-21 16:28:16 +02:00
Codeberg Translate f0f8210279 [I18N] Translations update from Weblate (#3244)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Justman10000 <Justman10000@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: EssGeeEich <EssGeeEich@users.noreply.translate.codeberg.org>
Co-authored-by: Zughy <Zughy@users.noreply.translate.codeberg.org>
Co-authored-by: Xinayder <Xinayder@users.noreply.translate.codeberg.org>
Co-authored-by: m0s <m0s@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3244
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-04-21 14:02:21 +00:00
silverwind eea7ea9d0a
Fix and tweak pull request commit list (#30528)
Fixes https://github.com/go-gitea/gitea/issues/30493, regression from
https://github.com/go-gitea/gitea/pull/30374.

Also did the flexbox convertion as suggested by the existing comment.

<img width="850" alt="Screenshot 2024-04-16 at 22 28 48"
src="https://github.com/go-gitea/gitea/assets/115237/e8905944-620a-4211-b5c5-53ed3b3ee23e">

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 311f5261cdb23b46d3f510e40fd4e2ac06e376c0)
2024-04-21 12:10:57 +02:00
silverwind 36bddba74a
Fix install page checkboxes and dropdown width (#30526)
Fixes: https://github.com/go-gitea/gitea/issues/30523

1. Fix checkbox rendering
2. Fix width of selection dropdowns (was too small)

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 4f276a336355c4bf999034fb79f0fe5c967ceb50)
2024-04-21 12:07:51 +02:00
Lunny Xiao 77c4a5e95b
Reduce unnecessary database queries on actions table (#30509)
(cherry picked from commit 6f7d70fb3d2624507c3ccd5640f6d1837259c27d)
2024-04-21 12:07:30 +02:00
silverwind cfb8617fc8
Tweak and fix toggle checkboxes (#30527)
Fixes: https://github.com/go-gitea/gitea/issues/30524. Slightly restyled
them so that the "knob" is contained inside the background.

<img width="179" alt="Screenshot 2024-04-16 at 21 58 09"
src="https://github.com/go-gitea/gitea/assets/115237/be94517b-9cb7-46e2-ae96-fcf6767ce4ba">
<img width="187" alt="Screenshot 2024-04-16 at 21 58 50"
src="https://github.com/go-gitea/gitea/assets/115237/c13a1959-5c5a-4e88-9225-e5f6fb72e3e0">

(cherry picked from commit 5ccd042f7080e1f4ef4b96591e1b1002a4826115)
2024-04-21 12:06:42 +02:00
Tobias Balle-Petersen 23f032eaa5
Update API to return 'source_id' for users (#29718)
Using the API, a user's _source_id_ can be set in the _CreateUserOption_
model, but the field is not returned in the _User_ model.

This PR updates the _User_ model to include the field _source_id_ (The
ID of the Authentication Source).

(cherry picked from commit 58b204b813cd3a97db904d889d552e64a7e398ff)
2024-04-21 12:04:18 +02:00
yp05327 3662829cc9
Fix empty field `login_name` in API response JSON when creating user (#30511)
Fix #30508

ps: if `sourceID` is not set, `LoginName` will be ignored
(cherry picked from commit cf9061f44a439aa7775e301a7467dbda22a06eaa)
2024-04-21 11:59:16 +02:00
Bo-Yi Wu e025ec0131
feat(api): implement branch/commit comparison API (#30349)
- Add new `Compare` struct to represent comparison between two commits
- Introduce new API endpoint `/compare/*` to get commit comparison
information
- Create new file `repo_compare.go` with the `Compare` struct definition
- Add new file `compare.go` in `routers/api/v1/repo` to handle
comparison logic
- Add new file `compare.go` in `routers/common` to define `CompareInfo`
struct
- Refactor `ParseCompareInfo` function to use `common.CompareInfo`
struct
- Update Swagger documentation to include the new API endpoint for
commit comparison
- Remove duplicate `CompareInfo` struct from
`routers/web/repo/compare.go`
- Adjust base path in Swagger template to be relative (`/api/v1`)

GitHub API
https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit c70e442ce4b99e2a1f1bf216afcfa1ad78d1925a)

Conflicts:
	- routers/api/v1/swagger/repo.go
	  Conflict resolved by manually adding the lines from the Gitea
	  PR.
2024-04-21 11:58:18 +02:00
silverwind ac0a20365b
Fix various overflows on actions view (#30344)
Fix a number of text overflow issues in actions view and run list. Also
improve mobile view of run list.

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

<img width="782" alt="Screenshot 2024-04-08 at 23 10 16"
src="https://github.com/go-gitea/gitea/assets/115237/3d9f9f88-3eab-44a0-8144-30c2b58b24cb">
<img width="935" alt="Screenshot 2024-04-08 at 23 17 46"
src="https://github.com/go-gitea/gitea/assets/115237/581d73ea-a31d-416b-be3a-47313b879b12">
<img width="1008" alt="Screenshot 2024-04-08 at 23 49 05"
src="https://github.com/go-gitea/gitea/assets/115237/c5d10565-f285-477f-8659-1caf94797647">
<img width="397" alt="Screenshot 2024-04-08 at 23 55 30"
src="https://github.com/go-gitea/gitea/assets/115237/368aaa75-1903-4058-9d75-d1fe91c564d6">

(cherry picked from commit b9f69b4a4d1d6b5b1f94852f6dfcae41b30658ff)
2024-04-21 11:53:50 +02:00
yp05327 b691a3e6b8
Convert max file name length to 255 (#30489)
Quick/Partly fix #29907

In Linux and MacOS, by default the max file name length is 255.
In windows, it depends on the version and settings, and has no file name
length limitation, but has path length limitation.
By default it is 260, considering path length is longer than filename,
so I think it is ok to do this.

For Windows, see
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
For Linux, see
https://github.com/torvalds/linux/blob/master/include/uapi/linux/limits.h#L12-L13
For MacOS, see
https://discussions.apple.com/thread/254788848?sortBy=best

(cherry picked from commit 2c80421243ed1fd6f53c3e1a84c06648524f7c66)
2024-04-21 11:53:41 +02:00
silverwind 579ca341b4
Fix overflow on issue dependency (#30484)
Small tweak here to prevent this and likely other events from
overflowing in the timeline:

<img width="895" alt="Screenshot 2024-04-14 at 22 53 17"
src="https://github.com/go-gitea/gitea/assets/115237/001b4f6b-f649-44ff-b2f0-c8e0dedeb384">

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 1508a85f6235814271ea927d651bcbcd8c9f5f18)
2024-04-21 11:39:14 +02:00
silverwind d99d2e3ef4
Kill all gitea processes before air build (#30477)
So it happened to me multiple times that air leaves zombie processes
after termination. I think ultimately it's some kind of bug in air, but
we can work around.

The change in the delay is unrelated to the zombie processes but seems
to help a bit with duplicate changes resulting in duplicate `make
generate` as seen here:

<img width="424" alt="Screenshot 2024-04-14 at 17 05 47"
src="https://github.com/go-gitea/gitea/assets/115237/6dd1d787-6be3-4fb2-8b0b-cd711c281793">

---------

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 994920c677b04a720726d982e4d6212664b82a43)
2024-04-21 11:38:58 +02:00
GiteaBot 8dfbfd8e7d
[skip ci] Updated licenses and gitignores
(cherry picked from commit 708e87e17df2b6a03eca3cac026a51beed296b5b)
2024-04-21 11:38:04 +02:00
silverwind ff306281b9
Revert 100% label max-width (#30481)
Partial revert of https://github.com/go-gitea/gitea/pull/30479

It's causing problems at least here:
https://github.com/go-gitea/gitea/pull/30344#discussion_r1564895591

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ef3941f2ebe9d8353f9546e7df00b24092c71cb7)
2024-04-21 11:37:55 +02:00
wxiaoguang 9f8ebe489f
Improve flex ellipsis (#30479)
![image](https://github.com/go-gitea/gitea/assets/2114189/857794d8-2170-42be-a5bf-47ebacbafebd)

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit b84baf21fa19521e1ab303a60918c74f85fcad1c)

Conflicts:
	- web_src/css/base.css
	  Trivial commit resolved by removing the conflicting part.
	  (it conflicted because we did not pick a previous PR)
2024-04-21 11:35:31 +02:00
wxiaoguang b122c6ef8b
Improve "must-change-password" logic and document (#30472)
Unify the behaviors of "user create" and "user change-password".

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 4c6e2da088cf092a9790df5c84b7b338508fede7)

Conflicts:
	- cmd/admin_user_create.go
          Resolved by favoring Gitea's version of the conflicting areas.
	- docs/content/administration/command-line.en-us.md
          Removed, Gitea specific.
2024-04-21 11:29:08 +02:00
silverwind d8258482e2
Use `flex-container` for dashboard layout (#30214)
Added new class `flex-container-sidebar` to cover the dashboard sidebar.
Previously this was 37.5% with more padding. Now there is less empty
space between the two columns and this matches other pages like repo or
admin settings page.

Desktop:

<img width="1345" alt="Screenshot 2024-03-31 at 15 11 36"
src="https://github.com/go-gitea/gitea/assets/115237/717389d9-d42c-466e-a8fe-e968f79447fd">

Mobile:
<img width="444" alt="Screenshot 2024-03-31 at 15 11 44"
src="https://github.com/go-gitea/gitea/assets/115237/7faa840b-513a-411b-bf2d-26d52b9b71a0">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 044cc169e75dccbf1d846f8774ef2feccd0da1fd)
2024-04-21 11:12:00 +02:00
silverwind 3e53c51903
Pulse page improvements (#30149)
1. add border-radius and spacing to bars
2. use tailwind background classes
3. Add more space around activity list headers

<img width="983" alt="Screenshot 2024-03-27 at 23 40 54"
src="https://github.com/go-gitea/gitea/assets/115237/70f72c30-e69f-4ecb-882f-32b8bc94d638">
<img width="1020" alt="Screenshot 2024-03-27 at 23 41 02"
src="https://github.com/go-gitea/gitea/assets/115237/a35dbbda-515c-40b0-938a-d759f9686b8e">

(cherry picked from commit 6999a88fd9bef6baa0a8cc5f63e419079611fc9b)
2024-04-21 11:08:33 +02:00
Earl Warren bb11bf8748 Merge pull request 'cleanup(tests): remove manual testing submodule' (#3347) from earl-warren/forgejo:wip-manual-testing into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3347
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-21 08:46:02 +00:00
Earl Warren 69c614162f
cleanup(tests): remove manual testing submodule
It is not effective, a different approach is needed
2024-04-21 10:13:51 +02:00
Earl Warren d029796e1e Merge pull request 'Fix some edge cases with permalink rendering' (#3286) from Mai-Lapyst/forgejo:fix-permalink-rendering-edgecases into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3286
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-20 10:24:05 +00:00
0ko 38f2aa871e [UI] Refactor display of milestone issue list header 2024-04-20 14:11:38 +05:00
0ko 592367c43a [UI] Fix milestone header inconsistencies with issues/PRs 2024-04-20 14:06:26 +05:00
Earl Warren 41e0507cd3 Merge pull request 'hooks: Harden when we accept push options that change repo settings' (#3314) from earl-warren/forgejo:wip-push-options into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3314
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-20 05:57:35 +00:00
0ko 8947948a0a Merge pull request 'Various improvements to pages: notifications and subscriptions' (#3175) from 0ko/forgejo:meet-your-subscribtions into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3175
Reviewed-by: Otto <otto@codeberg.org>
2024-04-20 05:27:15 +00:00
Mai-Lapyst ee2f71f71b
Adds support for log-line groups
Supports special rendering of `##[group]` and `##[endgroup]`.
2024-04-20 07:02:58 +02:00
Renovate Bot ba0f05b286 Update dependency mini-css-extract-plugin to v2.9.0 2024-04-20 00:03:42 +00:00
Mai-Lapyst acfae43253
Fix panic where now a third link breaks everything 2024-04-19 23:54:46 +02:00
Mai-Lapyst e9eacdecd2
Fix issue where rendering stops after the first invalid parmalink 2024-04-19 18:21:21 +02:00
Gergely Nagy 8eba631f8d
hooks: Harden when we accept push options that change repo settings
It is possible to change some repo settings (its visibility, and
template status) via `git push` options: `-o repo.private=true`, `-o
repo.template=true`.

Previously, there weren't sufficient permission checks on these, and
anyone who could `git push` to a repository - including via an AGit
workflow! - was able to change either of these settings. To guard
against this, the pre-receive hook will now check if either of these
options are present, and if so, will perform additional permission
checks to ensure that these can only be set by a repository owner or
an administrator. Additionally, changing these settings is disabled for
forks, even for the fork's owner.

There's still a case where the owner of a repository can change the
visibility of it, and it will not propagate to forks (it propagates to
forks when changing the visibility via the API), but that's an
inconsistency, not a security issue.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Signed-off-by: Earl Warren <contact@earl-warren.org>
2024-04-19 16:53:14 +02:00
0ko 67d6c674df Merge pull request 'Remove EasyMDE from various areas' (#2916) from 0ko/forgejo:easymde into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2916
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-19 13:48:34 +00:00
Earl Warren b05a7809b5 Merge pull request 'fix(tests): 30s to cancel processes to avoid false negatives' (#3317) from earl-warren/forgejo:wip-cancel-test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3317
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-19 12:48:41 +00:00
Earl Warren 0342b7fdcd Merge pull request '[RELEASE] v1.21.11-1 release notes' (#3330) from earl-warren/forgejo:wip-release-notes-1.21 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3330
Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
2024-04-19 11:49:03 +00:00
Earl Warren af7decae18 Merge pull request 'Update citation-js monorepo to v0.7.11' (#3321) from renovate/citation-js-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3321
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-19 11:08:57 +00:00
Earl Warren 080f1e8250
[RELEASE] v1.21.11-1 release notes 2024-04-19 13:00:57 +02:00
Gusted b6992ed6b9 Merge pull request 'services: Use proper Message-IDs for release mails' (#3309) from algernon/forgejo:are-we-dot-atom-text-yet into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3309
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-19 08:35:17 +00:00
Renovate Bot 82ec2a65e0 Update citation-js monorepo to v0.7.11 2024-04-19 00:02:54 +00:00
Earl Warren 9a80f6b57e Merge pull request 'v1.21.11-0 release notes' (#3287) from crystal/forgejo:pr/releasenotes-1.21.11-0 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3287
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-18 20:14:21 +00:00
Earl Warren 77843135b0
slight wording change and most serious fix first 2024-04-18 21:57:53 +02:00
crystal 2b2c0f1ae2
add security fixes details, link to compare 2024-04-18 12:37:59 -06:00
Earl Warren d335a3330f Merge pull request 'ci(renovate): fix step names (take 2)' (#3318) from earl-warren/forgejo:wip-renovate-run into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3318
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-18 18:17:16 +00:00
Earl Warren 9303f8e72d
ci(renovate): fix step names (take 2) 2024-04-18 20:08:27 +02:00
Earl Warren 6316e21be2
fix(tests): 30s to cancel processes to avoid false negatives
on slower machines it can take more than 1 second to cancel leftover
tasks
2024-04-18 18:47:49 +02:00
Otto Richter 87d4746f5e Rename button to "Finish Review"
Motivation: The meaning of the button is apparent from the visual
position and the number icon. This is not exposed to a screenreader.
Naming it to "Finish Review" helps with to provide the meaning of the
button as well as the number in the label.
2024-04-18 16:21:30 +02:00
Otto Richter 187e10d8c9 Fix unlabelled button in code review 2024-04-18 16:20:29 +02:00
Earl Warren c7b8a434c3 Merge pull request 'ci(renovate): fix step names' (#3311) from viceice/forgejo:ci/renovate/fix-step-names into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3311
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-18 14:04:19 +00:00
Earl Warren b58474173a Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.305.0' (#3312) from renovate/ghcr.io-visualon-renovate-37.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3312
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-18 13:54:22 +00:00
crystal 95fa27374b
typo 2024-04-18 07:27:48 -06:00
Gergely Nagy b0c0167c54
services: Use proper Message-IDs for release mails
When sending notification emails about a release, use a properly
formatted, RFC-compliant message id, rather than the release's HTML URL
wrapped in angle brackets (which would not be compliant).

Fixes #3105.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-18 13:44:18 +02:00
Renovate Bot 0f078ba4c9 Update ghcr.io/visualon/renovate Docker tag to v37.305.0 2024-04-18 11:25:53 +00:00
Michael Kriese 1f4915692b
ci(renovate): fix step names 2024-04-18 13:22:51 +02:00
Renovate Bot ca2473e895 Update ghcr.io/visualon/renovate Docker tag to v37.303.2 2024-04-17 16:05:21 +00:00
Earl Warren bc3e66097c Merge pull request 'fix(release): add missing ARG RELEASE_VERSION' (#3290) from earl-warren/forgejo:wip-oci-labels into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3290
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-17 15:51:36 +00:00
Earl Warren 97189d41f3
fix(release): add missing ARG RELEASE_VERSION
The ARG RELEASE_VERSION set in the build-env image does not propagate
to the images that follow. As a result the value of the version label
is always empty.

This should have been caught by the test in the CI but although it
notified the problem in the output, it did not fail. Upgrade to the
forgejo-build-publish version that fixes this false positive.
2024-04-17 17:16:53 +02:00
crystal 0ff5be49ab
[RELEASE] v1.21.11-0 release notes 2024-04-17 05:45:41 -06:00
Earl Warren d07f12e010 Merge pull request 'Do not require login_name & source_id for /admin/user/{username}' (#3278) from algernon/forgejo:leave-your-name-at-the-door into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3278
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 11:05:13 +00:00
Mai-Lapyst 5b6b3f3fb3
Fix some edge cases; closes #3232
- Fixes wrong usage of AppURL
- Fixes wrong rendering with extra path segments when AppSubURL is empty
- Now also renders all links when 2+ permalinks are present
2024-04-17 13:02:48 +02:00
Earl Warren 618e517d4c Merge pull request 'Update dependency vue to v3.4.23' (#3280) from renovate/vue-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3280
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-17 10:32:43 +00:00
Earl Warren c2f2858363 Merge pull request 'chore(renovate): schedule some deps quarterly' (#3284) from viceice/forgejo:chore/renovate-schedule into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3284
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 10:16:50 +00:00
Gergely Nagy dc39043cd6
Change the default SSH clone url to the ssh:// style
Rather than using an scp-style URI, use the same URL style for SSH
clones as for HTTP(S) ones. This is not only more consistent, but the
URL style allows one to specify a port, and makes it clear that it is an
SSH clone URL.

git itself favours the URL style, and mentions the scp-style in passing
only. Said style is prominently used by GitHub, and might be more
familiar for a lot of people, but other than familiarity, it has no
advantage over the URL style.

For the benefit of consistency, and flexibility, lets flip the default,
and make it the URL style. Instance admins who prefer to use the
scp-style, and are running SSH on its standard port, can change the
setting back to false.

This addresses #3193.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-17 11:04:48 +02:00
Gergely Nagy d07c8c821c
Do not require login_name & source_id for /admin/user/{username}
When editing a user via the API, do not require setting `login_name` or
`source_id`: for local accounts, these do not matter. However, when
editing a non-local account, require *both*, as before.

Fixes #1861.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-17 10:33:52 +02:00
Michael Kriese bb0daa9522
chore(renovate): schedule some deps quarterly 2024-04-17 09:24:59 +02:00
Earl Warren e4aa7bd511 Merge pull request 'webhook: improve UX for sourcehut and matrix' (#3156) from oliverpool/forgejo:webhook_sourcehut_polish into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3156
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 06:39:54 +00:00
Gergely Nagy ea4071ca9f Allow admins to fork repos even when creation limits are exhausted (#3277)
This is a continuation of #2728, with a test case added.

Fixes #2633.

I kept @zareck 's commit as is, because I believe it is correct. We can't move the check to `owner.CanForkRepo()`, because `owner` is the future owner of the forked repo, and may be an organization. We need to check the admin permission of the `doer`, like in the case of repository creation.

I verified that the test fails without the `ForkRepository` change, and passes with it.

Co-authored-by: Cassio Zareck <cassiomilczareck@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3277
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Co-committed-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-17 05:52:02 +00:00
Earl Warren 33d0617538 Merge pull request 'feat(release): add OCI labels to container images' (#3261) from earl-warren/forgejo:wip-oci-labels into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3261
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-17 05:46:36 +00:00
Earl Warren a003691c7b Merge pull request 'Allow changing global wiki editability via the API' (#3276) from algernon/forgejo:let-the-api-control-your-wiki-editability into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3276
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-17 05:46:10 +00:00
Renovate Bot a5c0643d13 Update dependency vue to v3.4.23 2024-04-17 00:04:27 +00:00
Gusted 787bc6ed94 Merge pull request 'Update dependency @stylistic/eslint-plugin-js to v1.7.2' (#3251) from renovate/stylistic-eslint-plugin-js-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3251
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-16 20:59:10 +00:00
Gergely Nagy df8e58c5cb
Allow changing global wiki editability via the API
The global wiki editability can be set via the web UI, this patch makes
it possible to set the same thing via the API too. This is accomplished
by adjusting the GET and PATCH handlers of the
`/api/v1/repos/{owner}/{repo}` route.

The first will include the property when checking the repo's settings,
the second allows a repo admin to change the setting too.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-16 22:51:36 +02:00
oliverpool ada8bfa52f Merge pull request 'Fix release published actions not triggering for releases created from existing tags' (#3220) from zotan/forgejo:forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3220
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 18:27:59 +00:00
Laura Hausmann 8506dbe2e5
Add tests for webhook release events
Co-authored-by: oliverpool <git@olivier.pfad.fr>
2024-04-16 19:25:26 +02:00
Earl Warren a5a0fc7344 Merge pull request '[BUG] Escape editor.add_tmpl translation' (#3269) from gusted/forgejo-escape-tr into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3269
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 16:19:47 +00:00
Earl Warren 028d19c0fe
feat(release): add OCI labels to container images 2024-04-16 17:50:57 +02:00
Earl Warren a76f71a648 Merge pull request '[BUG] Fix styling of close button' (#3267) from gusted/forgejo-theme-reg into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3267
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-16 15:18:03 +00:00
Gusted a0f47b8de7
[BUG] Escape editor.add_tmpl translation
- Previously translations were escaped, but now translations are
accepted as-is and will be rendered as HTML. Use `TrString` to escape
the translation value.
- Adds integration test.
- Regression of 65248945c9.
- Resolves #3260
2024-04-16 15:50:49 +02:00
oliverpool df042909bb Merge pull request '[Port] container.FilterSlice function (gitea#30339 & gitea#30370)' (#3264) from oliverpool/forgejo:port_30339 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3264
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-16 13:12:11 +00:00
Earl Warren 9aa430268b Merge pull request 'Add commit status summary table to reduce query from commit status table' (#3245) from viceice/forgejo:feat/commit-status-summary into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3245
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 12:22:49 +00:00
0ko 41ab13c14f Various improvements to pages: notifications and subscriptions
- fix rounding on /notifications/subscriptions
- add navigation interconnectivity between notifications and subscriptions
- use modern style for tabs
- clearing notificatons: hide the whole form instead of div. It doesn't seem like its changed via JS?
- replace issue-title-buttons and edit-buttons with universal top-right-buttons, get rid of tw-mr-0 helpers
- repo issues: fix misalignments on mobile view
2024-04-16 15:29:28 +05:00
Gusted 7fcb9c3636
[BUG] Fix styling of close button
- This is a partial revert of c2280a2009,
it was already fixed upstream, but not for the `.basic` variant.
- Resolves #3252
2024-04-16 12:25:09 +02:00
Earl Warren 4fc06cfd78 Merge pull request '[PORT] gitea#30139: Refactor markdown render' (#3259) from algernon/forgejo:gitea/port/30139 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3259
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 10:08:52 +00:00
Michael Kriese 8e9c296014
fix: don't update cache for empty state 2024-04-16 12:02:01 +02:00
Lunny Xiao c0d22d55c9
Fix commitstatus summary (#30431)
The target_url is necessary for the UI, but missed in
commit_status_summary table. This PR fix it.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-16 12:01:27 +02:00
Lunny Xiao f393ccf745
Fix commit status cache which missed target_url (#30426)
Fix #30421

---------

Co-authored-by: Jason Song <i@wolfogre.com>
2024-04-16 12:01:26 +02:00
Lunny Xiao 6495741238
Add commit status summary table to reduce query from commit status table (#30223)
This PR adds a new table named commit status summary to reduce queries
from the commit status table. After this change, commit status summary
table will be used for the final result, commit status table will be for
details.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
2024-04-16 12:01:20 +02:00
oliverpool b125b3e3aa Partial revert of "Refactor more filterslice (gitea#30370)"
This reverts commit 44abf6ab47.
2024-04-16 11:54:47 +02:00
oliverpool 2db6d5dae9 simplify getPendingRepoIDs 2024-04-16 11:53:18 +02:00
Lunny Xiao 44abf6ab47 Refactor more filterslice (gitea#30370) 2024-04-16 11:51:00 +02:00
oliverpool 525accfae6 Add container.FilterSlice function (gitea#30339)
Many places have the following logic:
```go
func (jobs ActionJobList) GetRunIDs() []int64 {
	ids := make(container.Set[int64], len(jobs))
	for _, j := range jobs {
		if j.RunID == 0 {
			continue
		}
		ids.Add(j.RunID)
	}
	return ids.Values()
}
```

this introduces a `container.FilterMapUnique` function, which reduces
the code above to:
```go
func (jobs ActionJobList) GetRunIDs() []int64 {
	return container.FilterMapUnique(jobs, func(j *ActionRunJob) (int64, bool) {
		return j.RunID, j.RunID != 0
	})
}
```
Conflicts:
models/issues/comment_list.go due to premature refactor in #3116
2024-04-16 11:49:44 +02:00
Earl Warren 5a10eec50f Merge pull request '[PORT] gitea#30406: Check the token's owner and repository when registering a runner' (#3257) from algernon/forgejo:gitea/port/30406 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3257
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 08:44:34 +00:00
wxiaoguang f692069616
Refactor markdown render (#30139)
Only split the file into small ones (and rename AttentionTypes to
attentionTypes)

(cherry picked from commit 71706126b56616750a65290460fd211b9b8449da)
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>

Conflicts:
	- modules/markup/markdown/goldmark.go
	- modules/markup/markdown/transform_blockquote.go
	Conflicts were resolved by favouring the Forgejo implementation:
	I copied the Forgejo code to the same place Gitea copied them
	to, and adjusted the imports accordingly.

	Apart from conflict resolution, this also moves
	`applyElementDir` from a local func in `goldmark.Transform` to a
	method on `*ASTTransformer`, to make it callable from the
	extracted functions.
2024-04-16 10:42:49 +02:00
Zettat123 463ea8fdd2
Check the token's owner and repository when registering a runner (#30406)
Fix #30378

(cherry picked from commit 0fe9f93eb4c94d55e43b18b9c3cc6d513a34c0b5)

Conflicts:
	- models/organization/org.go
	- services/repository/delete.go
	- services/user/delete.go
	In all three cases, conflicts were resolved by manually adding
        the lines added by the Gitea patch, keeping the Forgejo code
        surrounding them.
2024-04-16 09:38:26 +02:00
oliverpool 94dd22a784 webhook: matrix use v3 endpoint and drop headers 2024-04-16 08:59:56 +02:00
oliverpool 99830a40a1 webhook: matrix access_token helper text 2024-04-16 08:59:56 +02:00
oliverpool 5d45545ca1 webhook deliver: keep Bearer prefix in history 2024-04-16 08:59:56 +02:00
oliverpool 36f05e6f4e webhook: sourcehut_builds: ask for access_token instead of authorization_header 2024-04-16 08:59:55 +02:00
oliverpool 3155e21cbb webhook: sourcehut_builds: prefill sr.ht as defaults 2024-04-16 08:59:11 +02:00
oliverpool 6227422c4d move webhook/settings file around 2024-04-16 08:59:11 +02:00
Earl Warren 7d0ea92da4 Merge pull request '[PORT] gitea#30396: Fix author name alignment in commits table' (#3243) from gusted/forgejo-gt-30396 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3243
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 06:41:45 +00:00
Earl Warren 75bd708010 Merge pull request '[PORT] gitea#30342: Fix label-list rendering in timeline, decrease gap' (#3242) from gusted/forgejo-gt-30342 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3242
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-16 06:40:16 +00:00
Earl Warren df6f84945b Merge pull request 'Some NuGet package enhancements' (#3246) from viceice/forgejo:feat/nuget/improvements into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3246
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 06:32:06 +00:00
Earl Warren 9a43c39d3e Merge pull request '[BUG] Use correct empty commit ID' (#3247) from gusted/forgejo-sha256-index into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3247
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-16 06:26:23 +00:00
Earl Warren a1cd356232 Merge pull request '[BUG] Fix archive button on release page' (#3248) from gusted/forgejo-release-btn into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3248
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-16 05:18:07 +00:00
Renovate Bot aebe03b585 Update dependency @stylistic/eslint-plugin-js to v1.7.2 2024-04-16 02:03:02 +00:00
Gusted eeaef556c2
[BUG] Use correct empty commit ID
- `RemoveFilesFromIndex` used an hardcoded empty commit ID for the SHA1
object format, this would result in an error if the repository was
initialized to use the sha256 object format. Get the object format of
the Git repository and use that to get the empty commit id.
- Adds unit test.
- Resolves #3184
2024-04-16 01:08:15 +02:00
Gusted 39c3295f68
[BUG] Fix archive button on release page
- Add another selector to the list, which corresponds to the container
of the archive buttons on the release page of an repository.
- Seems like that 8d2b764607 missed
another case.
- Resolves #3180
2024-04-16 01:06:04 +02:00
Laura Hausmann 46977b0f01
Fix release published actions not triggering for releases created from existing tags 2024-04-15 22:53:53 +02:00
Earl Warren e4fa133c47 Merge pull request '[gitea] week 16 cherry pick' (#3212) from algernon/forgejo:wcp/week-16 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3212
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-15 20:07:37 +00:00
Michael Kriese 2e613ad5e7
Some NuGet package enhancements
- https://github.com/go-gitea/gitea/pull/30280
2024-04-15 20:45:14 +02:00
silverwind 6ece8c0ad7
[PORT] gitea#30396: Fix author name alignment in commits table
Fixes https://github.com/go-gitea/gitea/issues/30129 by introducing a
wrapper div with flexbox that collapses any inter-tag whitespace within.
View diff with whitespace hidden.

Author names aligned:
<img width="172" alt="Screenshot 2024-04-10 at 19 41 27"
src="https://github.com/go-gitea/gitea/assets/115237/d761e8f2-0e67-4f84-8d37-9ed73850470a">

Vertically centered on expand:
<img width="466" alt="Screenshot 2024-04-10 at 19 43 02"
src="https://github.com/go-gitea/gitea/assets/115237/decd68b3-19b5-4cfa-a505-b358e4a0715b">

Ellipsis works:

<img width="344" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/6f8624a2-f8b6-4f3e-ac98-c44dd0cdfca5">

---

Conflict resolution: Trivial
(cherry picked from commit 50dbed652738182eb42af51967ec7bd10e84ede9)
2024-04-15 20:09:34 +02:00
Gergely Nagy 5bf959a3a5
Convert the remaining `interface{}`s to `any`
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-15 20:01:36 +02:00
silverwind a59a32eb08
Fix JS error when opening to expanded code comment (#30463)
Fix regression from
e0b018706f
where opening to a code comment via hash link would give this error:

<img width="1247" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/f9aaeded-8492-4416-9a73-afa0c56220a7">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ce130ae8daa37c977443045390209e9095dc42b1)
2024-04-15 20:01:36 +02:00
Jonathan Tran 7ff74a47c8
fix: Fix to delete cookie when AppSubURL is non-empty (#30375)
Cookies may exist on "/subpath" and "/subpath/" for some legacy reasons (eg: changed CookiePath behavior in code). The legacy cookie should be removed correctly.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Kyle D <kdumontnu@gmail.com>
(cherry picked from commit b18c04ebde94e23d97da4958173faea843d5344f)
2024-04-15 20:01:36 +02:00
silverwind bf933f5ca4
Add `interface{}` to `any` replacement to `make fmt`, exclude `*.pb.go` (#30461)
Since https://github.com/go-gitea/gitea/pull/25686, a few `interface{}`
have sneaked into the codebase. Add this replacement to `make fmt` to
prevent this from happening again.

Ideally a linter would do this, but I haven't found any suitable.

(cherry picked from commit c77e8140bc2ac6521dbebfb77613dce2648bfcb8)

Conflicts:
	- .gitattributes
	  Trivial conflict resolved by picking our choice of language
          for `*.tmpl` files.
2024-04-15 20:01:36 +02:00
yp05327 9987b75662
Fix network error when open/close organization/individual projects and redirect to project page (#30387)
Follow #27734

![image](https://github.com/go-gitea/gitea/assets/18380374/02ed6b9a-cbb6-4f49-a54a-ca76a0d052a9)

Updated:
Redirect to project page instead of project list page.

(cherry picked from commit af02b8a0e9b00a324fb92f1f73ea386dd9595c3d)
2024-04-15 20:01:36 +02:00
Jason Song 982e9ce58f
Avoid losing token when updating mirror settings (#30429)
Fix #30416.

Before (it shows as "Unset" while there's a token):

<img width="980" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/d7148e3e-62c9-4d2e-942d-3d795b79515a">

After:

<img width="977" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/24aaa1db-5baa-4204-9081-470b15ea72b5">

The username shows as "oauth2" because of
f9fdac9809/services/migrations/dump.go (L99)

I have checked that all usage of `MirrorRemoteAddress` has been updated.

<img width="1806" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2f042501-2824-4511-9203-c84a6731a02d">

However, it needs to be checked again when backporting.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit fd59cd9450cbd511ad4a0790bf51f8d5d2c18aa3)
2024-04-15 20:01:36 +02:00
wxiaoguang 27977851fb
Add comment for ContainsRedirectURI about the exact match (#30457)
Close #26897
Replace #30336

(cherry picked from commit 92e27e15c38b95be2309dae316b896ee1d80324b)
2024-04-15 20:01:36 +02:00
silverwind 86736193fe
Fix admin notice view-detail (#30450)
Fix https://github.com/go-gitea/gitea/issues/30434, regression from
https://github.com/go-gitea/gitea/pull/30115.

I also removed the date insertion into the modal which was also broken
since that date was switched to `absolute-date` because I see no real
purpose to putting that date into the modal.

Result:

<img width="1038" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/aa2eb8b4-73dc-4d98-9b80-3f276f89d9e5">

(cherry picked from commit 8fd8978b4934865c2b041216e84e923ad574a4c7)
2024-04-15 20:01:36 +02:00
yp05327 6cc141516b
Fix mirror error when mirror repo is empty (#30432)
Fix #30424

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit b4d86912ef18c58e973ee10c4a3bc621e9bd6c52)
2024-04-15 20:01:36 +02:00
silverwind c08b3a8ebd
Add `/public/assets/img/webpack` to ignore files again (#30451)
Fixes https://github.com/go-gitea/gitea/issues/30442

It's inconvenient to have new untracked files show up in git when
switching to older branches that had generated them.

Introduce a list of such files and folders to gitignore and
dockerignore.

(cherry picked from commit 68271834d6ae6d397b5a2048f9e515ff53735994)
2024-04-15 20:01:36 +02:00
Yarden Shoham 5ef80ceb64
Remove jQuery from the commit graph (except Fomantic) (#30395)
- Switched to plain JavaScript
- Tested the commit graph and it works as before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/d0755ed6-bb5c-4601-a2b7-ebccaf4abce4)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 25427e0aee435cdedb9f8aae58767174d877767f)
2024-04-15 20:01:36 +02:00
Kazushi (Jam) Marukawa 6513515555
Change the default maxPerPage for gitbucket (#30392)
This patch improves the migration from gitbucket to gitea.

The gitbucket uses it's own internal perPage value (= 25) for paging and
ignore per_page arguments in the requested URL. This cause gitea to
migrate only 25 issues and 25 PRs from gitbucket repository. This may
not happens on old gitbucket. But recent gitbucket 4.40 or 4.38.4 has
this problem.

This patch change to use this internally hardcoded perPage of gitbucket
as gitea's maxPerPage numer when migrating from gitbucket. There are
several perPage values in gitbucket like 25 for Isseus/PRs and 10 for
Releases. Some of those API doesn't support paging yet. It sounds
difficult to implement, but using the minimum number among them worked
out very well. So, I use 10 in this patch.

Brief descriptions of problems and this patch are also available in
https://github.com/go-gitea/gitea/issues/30316.

In addition, I'm not sure what kind of test cases are possible to write
here. It's a test for migration, so it requires testing gitbucket server
and gitea server, I guess. Please let me know if it is possible to write
such test cases here. Thanks!

(cherry picked from commit 7af074dbeebc3c863618992b43f84ec9e5ab9657)
2024-04-15 20:01:36 +02:00
HEREYUA 6652b2eb2a
Fix the spacing issue in the Project view (#30415)
**fix**:  [#30388](https://github.com/go-gitea/gitea/issues/30388)

**before**

![image](https://github.com/go-gitea/gitea/assets/37935145/52ca7311-dca4-4430-9a37-3c45b08fe3dd)

**after**

![image](https://github.com/go-gitea/gitea/assets/37935145/6b75ce69-4423-4ea4-99a1-d7234287c5c0)

(cherry picked from commit e8a99c8f92c5b36382abb38a1471c94245457560)
2024-04-15 20:01:36 +02:00
yp05327 e74865caba
Avoid user does not exist error when detecting schedule actions when the commit author is an external user (#30357)
![image](https://github.com/go-gitea/gitea/assets/18380374/ddf6ee84-2242-49b9-b066-bd8429ba4d76)

When repo is a mirror, and commit author is an external user, then
`GetUserByEmail` will return error.

reproduce/test:
- mirror Gitea to your instance
- disable action and enable it again, this will trigger
`DetectAndHandleSchedules`

ps: also follow #24706, it only fixed normal runs, not scheduled runs.
(cherry picked from commit 96d31fe0a8b88c09488989cd5459d4124dcb7983)
2024-04-15 20:01:36 +02:00
silverwind a527f5a3e7
Various improvements for long file and commit names (#30374)
Fixes: https://github.com/go-gitea/gitea/issues/29438

This contains numerous enhancements for how large commit messages and
large filenames render. Another notable change is that the file path is
no longer cut off by backend at 30 chars, but rendered in full with
wrapping.

<img width="1329" alt="Screenshot 2024-04-09 at 21 53 57"
src="https://github.com/go-gitea/gitea/assets/115237/5ccbb3d6-643a-4f60-ba79-3572b36d5182">
<hr>
<img width="711" alt="Screenshot 2024-04-09 at 21 44 24"
src="https://github.com/go-gitea/gitea/assets/115237/6ffe8fbb-407c-4aa7-b591-3d80daea7d57">
<hr>
<img width="439" alt="Screenshot 2024-04-09 at 21 19 03"
src="https://github.com/go-gitea/gitea/assets/115237/1ec7f6e9-2fd8-4841-87eb-6ca02ab9cd61">
<hr>
<img width="444" alt="Screenshot 2024-04-09 at 21 18 52"
src="https://github.com/go-gitea/gitea/assets/115237/70931b9e-5841-477e-b3bc-98f8d2662964">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 50099d7af436785daf66a3a9f27bd5c009f90684)

Conflicts:
	- templates/repo/diff/box.tmpl
          Picked Gitea's version, because it appears we missed a
          gt-gap-1 => tw-gap-1 conversion
	- web_src/css/repo.css
          Conflict due to tag signature highlighting, resolved by
          adding the Gitea changes on top of ours manually.
2024-04-15 20:01:35 +02:00
silverwind 12f721717b
Fix line height on inline code preview (#30372)
Fixes https://github.com/go-gitea/gitea/issues/30353.

I don't know what causes `code-inner` to not inherit `line-height` from
its direct parent `.lines-code` but instead from grandparent `.markup`
even thought MDN tells me it's
[inherited](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#formal_definition).
This causes no negative impact on other code views, so I think it's the
best solution.

(cherry picked from commit 6cac11cb1bc4b42bc7851a59b1f3a94700c5eb84)
2024-04-15 20:01:35 +02:00
Jason Song 63c707b38b
Fix ambiguous id when fetch Actions tasks (#30382)
Fix regression of #30331.

```txt
time="2024-04-10T02:23:49Z" level=error msg="failed to fetch task" func="[fetchTask]" file="[poller.go:91]" error="unknown: rpc error: code = Internal desc = pick task: CreateTaskForRunner: Error 1052 (23000): Column 'id' in field list is ambiguous"
```

(cherry picked from commit 310e2517e5d55a037f612a8561fb1850b517b37f)
2024-04-15 20:01:35 +02:00
silverwind da7396110b
Fix floated list items (#30377)
Fixes https://github.com/go-gitea/gitea/issues/30365, regression from
https://github.com/go-gitea/gitea/pull/30281

(cherry picked from commit fec754258cce7f82ce9263f2dd0fad3f0b078d8a)
2024-04-15 20:01:35 +02:00
silverwind b13e969dd5
Reduce checkbox size to 15px (#30346)
16 seems to big, 14 too small. Let's do 15. Alignment:

<img width="181" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/f2988611-dee2-492e-a18f-dc5ab3a1cd6c">

(cherry picked from commit 72dc75e594fb5227abfa1cb74cb652cc33bacc93)
2024-04-15 20:01:35 +02:00
Lunny Xiao f544bb25b5
Fix missed doer (#30231)
Fix #29879

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 908426aa0fcc58961c345994f0f66056f6cf5f48)
2024-04-15 20:01:35 +02:00
yp05327 84abf4bd91
Avoid running action when action unit is disabled after workflows detected (#30331)
Fix #30243

We only checking unit disabled when detecting workflows, but not in
runner `FetchTask`.
So if a workflow was detected when action unit is enabled, but disabled
later, `FetchTask` will still return these detected actions.

Global setting: repo.ENABLED and repository.`DISABLED_REPO_UNITS` will
not effect this.

(cherry picked from commit d872ce006c0400edb10a05f7555f9b08070442e3)
2024-04-15 20:01:35 +02:00
GiteaBot 84207afaf0
[skip ci] Updated licenses and gitignores
(cherry picked from commit 0c7b0c5acaae911d3d3fefa1d8b394594c860620)
2024-04-15 20:01:35 +02:00
silverwind d80fca38e9
Add `--page-spacing` variable, fix admin dashboard notice (#30302)
Fixes https://github.com/go-gitea/gitea/issues/30293 and introduce the
`--page-spacing` variable which holds the spacing between the elements
on the page. This is working vertically for all pages, including ones
that have fomantic grid, and horizontally for all that use
`flex-container`.

The `.page-content > :first-child:not(.secondary-nav)` selector uses
margin which in some cases enables to adjacent margins to overlap, which
is nice.

<img width="1320" alt="Screenshot 2024-04-06 at 01 35 19"
src="https://github.com/go-gitea/gitea/assets/115237/3e81e707-e9ff-4b7f-a211-3d98f4f85353">
---
<img width="1327" alt="Screenshot 2024-04-06 at 01 35 45"
src="https://github.com/go-gitea/gitea/assets/115237/aad196c0-9e21-4c06-ae59-7e33a76c61e1">
---
<img width="1321" alt="Screenshot 2024-04-06 at 01 35 31"
src="https://github.com/go-gitea/gitea/assets/115237/785f6c5d-08b6-4e66-aa16-aeca7cfed3ad">

(cherry picked from commit 019857a7015cae32c12b5eac0b895c05f0264b77)
2024-04-15 20:01:35 +02:00
silverwind 50e0587546
Action view mobile improvements and fixes (#30309)
Fix the action issue in https://github.com/go-gitea/gitea/issues/30303,
specifically:

- Use opaque step header hover background to avoid transparency issue
- Un-sticky the `action-view-left` on mobile, it would otherwise overlap
into right view
- Improve commit summary, let it wrap
- Fix and comment z-indexes
- Tweak width for run-list-item-right so it wastes less space on desktop
- Synced latest changes to console colors from dark to light theme

<img width="467" alt="Screenshot 2024-04-06 at 18 58 15"
src="https://github.com/go-gitea/gitea/assets/115237/8ad26b72-6cd9-4522-8ad1-6fd86b2d0d53">

(cherry picked from commit 0178eaec256a349371c75e582edd7fefca2085d0)
2024-04-15 20:01:35 +02:00
silverwind 0bd1e13676
Fix checkboxes on mobile view, remove some dead css (#30308)
Fix the checkbox issues in
https://github.com/go-gitea/gitea/issues/30303 which were existing
problems with these selectors, but made visible with
https://github.com/go-gitea/gitea/pull/30162.

There is a lot of dead/useless CSS in `form.css`, I only fixed the two
problems and remove CSS that was definitely not in use or needed.

<img width="369" alt="Screenshot 2024-04-06 at 18 00 08"
src="https://github.com/go-gitea/gitea/assets/115237/720f178b-1b22-48d4-8704-becb8ce66129">
<img width="405" alt="Screenshot 2024-04-06 at 18 00 28"
src="https://github.com/go-gitea/gitea/assets/115237/61c0f8ec-34af-46c5-a3fa-7c5c4d30c7d2">

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 644ade5ae6805a3db063b3f81a596febe49bacaf)
2024-04-15 20:01:35 +02:00
wxiaoguang 9b8de15797
Clean up log messages (#30313)
`log.Xxx("%v")` is not ideal, this PR adds necessary context messages.
Remove some unnecessary logs.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 83f83019ef3471b847a300f0821499b3896ec987)

Conflicts:
	- modules/util/util.go
          Conflict resolved by picking `util.Iif` from 654cfd1dfbd3f3f1d94addee50b6fe2b018a49c3
2024-04-15 20:01:35 +02:00
0ko 089e37026f Add integration test for EasyMDE button 2024-04-15 22:59:26 +05:00
silverwind 8110dc959a
[PORT] gitea#30342: Fix label-list rendering in timeline, decrease gap
Not sure exactly when this regressed, but has been a while I think.

Before:

<img width="895" alt="Screenshot 2024-04-08 at 22 46 50"
src="https://github.com/go-gitea/gitea/assets/115237/9b1788f8-017e-4fe1-8ab9-938e0d76fb41">

After:

<img width="689" alt="Screenshot 2024-04-08 at 23 00 58"
src="https://github.com/go-gitea/gitea/assets/115237/90193df9-5c24-4a1a-96fe-3d4e8392063c">

Co-authored-by: Giteabot <teabot@gitea.io>

---
Conflict resolution: none

(cherry picked from commit 8d14266269f1b4fd5e13d701830919c1a1613444)
2024-04-15 19:52:59 +02:00
0ko ceba1abe06 Merge pull request 'Improve English locale' (#2941) from 0ko/forgejo:english20240401 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2941
Reviewed-by: Otto <otto@codeberg.org>
2024-04-15 17:34:52 +00:00
Earl Warren 3d2fa4930d Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.296.0' (#3221) from renovate/ghcr.io-visualon-renovate-37.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3221
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-15 17:25:56 +00:00
Earl Warren fc04d48f1f Merge pull request 'Update dependency happy-dom to v14.7.1' (#3224) from renovate/happy-dom-14.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3224
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-15 17:25:21 +00:00
Codeberg Translate 64f4f7a38e [I18N] Translations update from Weblate (#3138)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: WithLithum <WithLithum@users.noreply.translate.codeberg.org>
Co-authored-by: EssGeeEich <EssGeeEich@users.noreply.translate.codeberg.org>
Co-authored-by: rguards <rguards@users.noreply.translate.codeberg.org>
Co-authored-by: kecrily <kecrily@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3138
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-04-15 17:23:31 +00:00
Earl Warren 0bf73bae39 Merge pull request '[CI] configure backport to comment on the PR on failure' (#3237) from earl-warren/forgejo:wip-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3237
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-15 17:15:12 +00:00
Earl Warren 51c2daec6e Merge pull request 'fix(actions): call automerge service on successful commit state' (#3231) from viceice/forgejo:fix/actions/automerge-head into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3231
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-15 16:47:23 +00:00
Earl Warren bd431f64f6
[CI] configure backport to comment on the PR on failure 2024-04-15 18:23:57 +02:00
0ko 703aee4cad Remove EasyMDE from various areas
Ref https://codeberg.org/forgejo/forgejo/issues/2831

Removed from:
- form for creating comment
- form for updating comment
- popup reviewing form
- line reviewing form
- I did not check the use of textarea.tmpl but I belive its used for issue templates, so also removed
- I did not check the use of box.tmpl, could not get any comments on compare

EasyMDE is left for these pages:
- release notes editor
- wiki editor
2024-04-15 21:23:33 +05:00
0ko f5c7ccaeff Make display of EasyMDE in UI optional to template
This commit adds EasyMDE field to combomarkdowneditor, as well as to all its calls.
2024-04-15 21:23:33 +05:00
Renovate Bot 84b3136f26 Update ghcr.io/visualon/renovate Docker tag to v37.296.0 2024-04-15 16:07:18 +00:00
Earl Warren d780a9a47d Merge pull request '[PORT] gitea#30430: Fix rename branch 500 when the target branch is deleted but exist in database' (#3233) from gusted/forgejo-bp-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3233
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-15 15:36:15 +00:00
Earl Warren 4985a44058 Merge pull request '[PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs' (#3234) from gusted/forgejo-bp-2 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3234
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-15 15:34:27 +00:00
Michael Kriese 36f4732e6a
fix(actions): call automerge service on successful commit state
- Backport of https://github.com/go-gitea/gitea/pull/30225
2024-04-15 16:17:45 +02:00
silverwind f6c0c39f1a
[PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs
1. The previous color contrast calculation function was incorrect at
least for the `#84b6eb` where it output low-contrast white instead of
black. I've rewritten these functions now to accept hex colors and to
match GitHub's calculation and to output pure white/black for maximum
contrast. Before and after:
<img width="94" alt="Screenshot 2024-04-02 at 01 53 46"
src="https://github.com/go-gitea/gitea/assets/115237/00b39e15-a377-4458-95cf-ceec74b78228"><img
width="90" alt="Screenshot 2024-04-02 at 01 51 30"
src="https://github.com/go-gitea/gitea/assets/115237/1677067a-8d8f-47eb-82c0-76330deeb775">

2. Fix project-related issues:

- Expose the new `ContrastColor` function as template helper and use it
for project cards, replacing the previous JS solution which eliminates a
flash of wrong color on page load.
- Fix a bug where if editing a project title, the counter would get
lost.
- Move `rgbToHex` function to color utils.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>

---
Conflict resolution: Trivial.
(cherry picked from commit 36887ed3921d03f1864360c95bd2ecf853bfbe72)
2024-04-15 16:11:34 +02:00
Gusted db39b8f4a7
[PORT] gitea#30430: Fix rename branch 500 when the target branch is deleted but exist in database
Fix https://github.com/go-gitea/gitea/issues/30428

---

Conflict resolution: trivial and move test to own subtest run directly
after `Normal`.

(cherrypicked commit 9466fec879f4f2c88c7c1e7a5cffba319282ab66)
2024-04-15 16:03:09 +02:00
Gusted 6f4827b3e0 Merge pull request '[CHORE] Exclude git repository testdate from watching' (#3229) from gusted/forgejo-air into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3229
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-15 13:39:59 +00:00
oliverpool 16879b07d2 [PORT] drop utils.IsExternalURL (and expand IsRiskyRedirectURL tests) (#3167)
Related to  #2773
Related to Refactor URL detection [gitea#29960](https://github.com/go-gitea/gitea/pull/29960)
Related to Refactor external URL detection [gitea#29973](https://github.com/go-gitea/gitea/pull/29973)

I added a bunch of tests to `httplib.TestIsRiskyRedirectURL` and some cases should be better handled (however it is not an easy task).

I also ported the removal of `utils.IsExternalURL`, since it prevents duplicated (subtle) code.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3167
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2024-04-15 13:03:08 +00:00
Gusted 0f47b04b49
[CHORE] Exclude git repository testdate from watching
- Add the _recently_ added Git repository for testdata to the exclusion
list of air.
2024-04-15 13:00:03 +02:00
Renovate Bot 8e40ba197a Update dependency happy-dom to v14.7.1 2024-04-15 02:03:36 +00:00
Earl Warren 20c0292b5c Merge pull request 'fix(actions): the trigger user of a schedule is the action user' (#3213) from earl-warren/forgejo:wip-actions-trigger-user into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3213
Reviewed-by: thefox <thefox@noreply.codeberg.org>
2024-04-14 17:35:25 +00:00
Earl Warren c3e2c25359
fix(actions): the trigger user of a schedule is the action user
The user that caused the notification to re-evaluates the
schedules is not the one that will trigger the workflows. They are
background tasks that are authored by the action user (id -2).

Such a mis-assignment is problematic when the user that caused the
notification is deleted.

Fixes: https://codeberg.org/forgejo/forgejo/issues/3211
2024-04-14 12:53:20 +02:00
Earl Warren b833e5e7db Merge pull request '[BUG] Fix code search in explore reporting as git grep even with indexer enabled' (#3173) from snematoda/fix-grep-tmpl into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3173
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-13 08:52:08 +00:00
0ko ea7a3ea8bf Merge pull request 'Fix box rounding on dashboard' (#3194) from 0ko/forgejo:fix-dashboard-rounding into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3194
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-13 07:17:10 +00:00
Shiny Nematoda a67ca43f75 add test 2024-04-13 06:04:00 +00:00
Earl Warren 9f785710e9 Merge pull request 'Update module golang.org/x/vuln/cmd/govulncheck to v1.0.4' (#3201) from renovate/golang.org-x-vuln-cmd-govulncheck-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3201
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-13 05:38:16 +00:00
Earl Warren 306e0706a1
GOVULNCHECK_PACKAGE: pin to v1 instead of patch version 2024-04-13 07:00:52 +02:00
Renovate Bot 463ead502d Update module golang.org/x/vuln/cmd/govulncheck to v1.0.4 2024-04-13 02:11:12 +00:00
Renovate Bot 2059abd9c0 Update ghcr.io/visualon/renovate Docker tag to v37.290.1 2024-04-13 00:04:43 +00:00
Mai-Lapyst 1d1c0131bb Fix inline permalinks across repo; closes #2965 (#3042)
This PR fixes the possible ambiguity of rendered inline permalinks across repos by adding it as a suffix to the title element if the permalink refers to a file not inside the current repository. Closes #2965

![grafik](/attachments/e70e37b8-24c7-4f7b-ab52-92f1e8dfb009)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3042
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
Co-committed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-04-12 22:30:20 +00:00
Earl Warren 828ae39c22 Merge pull request '[BUG] Fix for PyPi Registry PEP 503 Compliance' (#3190) from Zottelchen/forgejo:bug/pep-503 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3190
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 22:19:51 +00:00
Zottelchen 14badb37fe Update tests/integration/api_packages_pypi_test.go 2024-04-12 21:02:42 +00:00
Earl Warren 0e42ba33fb Merge pull request '[BUG] Render correct label link' (#3187) from gusted/forgejo-labels into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3187
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-12 20:43:16 +00:00
Earl Warren 7bd3b18ebc Merge pull request 'Fix the settings tab highlighting' (#3191) from algernon/forgejo:highlight-of-another into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3191
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-12 20:42:31 +00:00
0ko 39cdcb4daf Fix box rounding on dashboard
Regression of d40127a3e8 (diff-1daf5eae3896bddcde764fc8a88dc3fd0c0ea21a) and 4711d3311b (diff-1daf5eae3896bddcde764fc8a88dc3fd0c0ea21a).
2024-04-12 23:16:17 +05:00
Gergely Nagy 65ed86e396
Fix the settings tab highlighting
When visiting a repos `/settings/units` page, highlight the active tab
properly: "Add more..." if the tab is displayed, or "Settings"
otherwise.

Fixes #3188.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-12 19:11:21 +02:00
Zottelchen 303b95a1c1 Update templates/api/packages/pypi/simple.tmpl 2024-04-12 16:43:30 +00:00
Gusted 7a97c05206
[BUG] Render correct label link
- Render the correct label for pull requests, it should link to the pull
requests list and not the issue list.
- Add unit test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/3183
2024-04-12 17:23:20 +02:00
Gusted 0c42e3c755 Merge pull request '[CHORE] Remove `println`' (#3185) from gusted/forgejo-println into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3185
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 12:35:38 +00:00
Earl Warren 9ef05fec5d Merge pull request 'Update forgejo/forgejo-build-publish action to v5' (#3182) from renovate/forgejo-forgejo-build-publish-5.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3182
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 12:22:24 +00:00
Gusted 706846b628
[CHORE] Remove `println`
- It's not recommended to use it per the documentation: https://pkg.go.dev/builtin#println.
2024-04-12 13:36:31 +02:00
Earl Warren ed7957d987 Merge pull request '[CI] backport upgrade to git-backporting@v4.8.0' (#3155) from earl-warren/forgejo:wip-ci-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3155
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-12 10:31:06 +00:00
Renovate Bot d7ae60ae91 Update forgejo/forgejo-build-publish action to v5 2024-04-12 10:19:15 +00:00
Earl Warren c6a117fe4f Merge pull request 'Upgrade github.com/editorconfig-checker/editorconfig-checker to v2.8.0' (#3181) from viceice/forgejo:build/upgrade-editorconfig-checker into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3181
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 07:29:07 +00:00
Michael Kriese 222e69bfaa
Upgrade github.com/editorconfig-checker/editorconfig-checker to v2.8.0 2024-04-12 09:00:41 +02:00
Earl Warren c85f0f59a8 Merge pull request 'Update module github.com/rhysd/actionlint/cmd/actionlint to v1.6.27' (#3179) from renovate/github.com-rhysd-actionlint-cmd-actionlint-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3179
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-12 06:43:46 +00:00
Renovate Bot 1331c7de8a Update module github.com/rhysd/actionlint/cmd/actionlint to v1.6.27 2024-04-12 02:07:18 +00:00
Antonin Delpeuch 6053dc624f Merge pull request 'Update golangci-lint to 1.57.2' (#3163) from wetneb/forgejo:3162-update-golangci-lint into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3163
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-11 18:36:53 +00:00
Antonin Delpeuch 592c20c7d4 Fix spelling mistakes caught by golangci-lint 2024-04-11 17:16:26 +02:00
Antonin Delpeuch 035bba89f5 Update golangci-lint to 1.57.2 2024-04-11 17:16:25 +02:00
Gusted 70972f70d7 Merge pull request 'chore(renovate): Update deps inside `Makefile`' (#3166) from viceice/forgejo:chore/renovate-makefile into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3166
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Antonin Delpeuch <wetneb@noreply.codeberg.org>
2024-04-11 15:12:30 +00:00
Shiny Nematoda aec787b927 fix code search template 2024-04-11 14:52:37 +00:00
Earl Warren c3aed7cb69 Merge pull request 'Update dependency @playwright/test to v1.43.0' (#3152) from renovate/playwright-monorepo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3152
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-11 14:39:50 +00:00
Michael Kriese 9f4f7368d0 chore(renovate): Update deps inside `Makefile` 2024-04-11 13:46:27 +00:00
Gusted f89f7ced5f Merge pull request '[BUG] Handle bigger files in `git grep`' (#3160) from gusted/forgejo-grep into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3160
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
2024-04-11 13:17:02 +00:00
Earl Warren ad8a3ed2a1 Merge pull request 'Do not update PRs based on events that happened before they existed' (#2932) from earl-warren/forgejo:wip-superfluous into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2932
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-11 12:07:07 +00:00
Earl Warren b90d7e4956 Merge pull request '[BUG] Store JSON in contributors commit cache' (#3159) from gusted/forgejo-cache-json into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3159
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-11 12:03:54 +00:00
Earl Warren 3266acb2ce Merge pull request '[RENOVATE] bitnami/minio upgrades are rare' (#3157) from earl-warren/forgejo:wip-renovate-minio into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3157
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-11 11:59:59 +00:00
Gusted 668709a33f
[BUG] Handle bigger files in `git grep`
- The parser of `git grep`'s output uses `bufio.Scanner`, which is a good
choice overall, however it does have a limit that's usually not noticed,
it will not read more than `64 * 1024` bytes at once which can be hit in
practical scenarios.
- Use `bufio.Reader` instead which doesn't have this limitation, but is
a bit harder to work with as it's a more lower level primitive.
- Adds unit test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/3149
2024-04-11 13:47:50 +02:00
Gusted 4c8b67c4b2
[BUG] Store JSON in contributors commit cache
- The code that gets contributor stats tried to store an
`map[string]*ContributorData` type in the cache, this works for the
memory cache but not for other caches such as Redis.
- The cache implementation for Redis would convert this map via
`fmt.Sprintf` to an string, which would simply print the pointer and not
the value of the pointer. Storing pointers is a no-go as this will get
GC-ed eventually within a few minutes. Therefore store everything with
json, that does properly store the value of the pointers.
- Adds unit test that verifies JSON is being used.
- Resolves https://codeberg.org/forgejo/forgejo/issues/3158
2024-04-11 13:01:33 +02:00
Renovate Bot 1d383a6354 Update dependency @playwright/test to v1.43.0 2024-04-11 10:05:56 +00:00
Earl Warren 998a431747
Do not update PRs based on events that happened before they existed
* Split TestPullRequest out of AddTestPullRequestTask
* A Created field is added to the Issue table
* The Created field is set to the time (with nano resolution) on creation
* Record the nano time repo_module.PushUpdateOptions is created by the hook
* The decision to update a pull request created before a commit was
  pushed is based on the time (with nano resolution) the git hook
  was run and the Created field

It ensures the following happens:

* commit C is pushed
* the git hook queues AddTestPullRequestTask for processing and returns with success
* TestPullRequest is not called yet
* a pull request P with commit C as the head is created
* TestPullRequest runs and ignores P because it was created after the commit was received

When the "created" column is NULL, no verification is done, pull
requests that were created before the column was created in the
database cannot be newer than the latest call to a git hook.

Fixes: https://codeberg.org/forgejo/forgejo/issues/2009
2024-04-11 11:16:23 +02:00
Earl Warren f1c1a1e877
models: reserve v11 for backporting release blocker 2024-04-11 11:13:28 +02:00
Earl Warren f672a63ae7
[RENOVATE] bitnami/minio upgrades are rare
It is used in the CI to verify the S3 backend works. It has no
security or feature requirements and upgrading would only be required
when a major version is published, which cannot be deduced from the
version number.

Making that upgrade available from the dashboard and dealt with when
and if it gets the attention of a developer, even if once a year, is
good enough.
2024-04-11 10:59:40 +02:00
Earl Warren 656554e247 Merge pull request 'Update dependency @eslint-community/eslint-plugin-eslint-comments to v4.3.0' (#3151) from renovate/eslint-community-eslint-plugin-eslint-comments-4.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3151
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-11 08:49:51 +00:00
Earl Warren 0355f63a48
[CI] backport upgrade to git-backporting@v4.8.0
* no-auto-squash: true so it DTRT for merged & squashed PRs
* target-branch-pattern: replaces the ad-hoc logic to determine the
  target branch name

It also now supports backporting to multiple branches. This is not
going to be immediately useful but will greatly help in three months
when there are two releases receiving backports.
2024-04-11 10:15:38 +02:00
Earl Warren 7af114aebe Merge pull request '[TESTS] disable test failure on log.Error for now (part 2)' (#3154) from earl-warren/forgejo:wip-transient-errors into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3154
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-11 06:40:12 +00:00
Earl Warren fd62033b98
[TESTS] disable test failure on log.Error for now (part 2)
Fixes: https://codeberg.org/forgejo/forgejo/issues/3153
2024-04-11 07:36:59 +02:00
Renovate Bot 37f7c899a5 Update dependency @eslint-community/eslint-plugin-eslint-comments to v4.3.0 2024-04-11 00:06:13 +00:00
Renovate Bot 90b160dd34 Update ghcr.io/visualon/renovate Docker tag to v37.282.1 2024-04-11 00:04:53 +00:00
Gusted 97fe5e6341 Merge pull request '[BUG] Fix tooltip for 1000+ stars/forks' (#3147) from gusted/forgejo-tooltip-1000 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3147
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-10 22:34:03 +00:00
Gusted 3e9a97b9ce
[BUG] Fix tooltip for 1000+ stars/forks
- The tooltip attribute should be inside the `<a>` element not outside of it.
- Regression of 854164f40b
2024-04-10 23:53:40 +02:00
Earl Warren 9396edb2e3 Merge pull request 'Update checker setting updates' (#2925) from 0ko/forgejo:update_check_default into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2925
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-10 20:54:10 +00:00
Gusted 06c134e96a Merge pull request 'Update module github.com/klauspost/compress to v1.17.8' (#3136) from renovate/github.com-klauspost-compress-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3136
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-10 20:16:40 +00:00
Gusted 9ea80a6139 Merge pull request 'Update dependency vue-chartjs to v5.3.1' (#3135) from renovate/vue-chartjs-5.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3135
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-10 20:00:52 +00:00
Earl Warren c20285aa9d Merge pull request 'Remove redundant / deadcode error check' (#3144) from gusted/forgejo-rm-deadcode into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3144
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-10 17:39:35 +00:00
Gusted 9862f28ac5
Remove error check
- This error check was made redudant by 375fd15fbf
2024-04-10 19:07:11 +02:00
Earl Warren 91617c30ca Merge pull request '[TEST] make the indexer and pull tasks cancellable (without shutdown)' (#3141) from oliverpool/forgejo:cancellable_queues into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3141
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-10 16:37:01 +00:00
oliverpool d79690ce18 [TEST] make the indexer and pull tasks cancellable (without shutdown) 2024-04-10 14:42:59 +02:00
Renovate Bot aec0e1c43a Update module github.com/klauspost/compress to v1.17.8 2024-04-10 02:10:00 +00:00
Renovate Bot 92a5dbe015 Update dependency vue-chartjs to v5.3.1 2024-04-10 00:06:37 +00:00
Earl Warren 0905961fde Merge pull request '[BUG] webhook: fix admin-hooks and add more tests' (#3125) from oliverpool/forgejo:webhook_admin_fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3125
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-09 21:55:54 +00:00
Earl Warren fd0c8f5059 Merge pull request '[TEST] cancel all processes on PrepareTestEnv' (#3126) from oliverpool/forgejo:test_cancel_processes_on_prepare_test_env into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3126
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-09 21:54:57 +00:00
oliverpool 8ffaa08b04 add missing defer 2024-04-09 21:14:51 +02:00
oliverpool aba99ab8fc [TEST] cancel all processes on PrepareTestEnv 2024-04-09 21:14:51 +02:00
oliverpool 9a94019db4 webhook: add admin-hooks tests 2024-04-09 20:02:14 +02:00
oliverpool e0b5f2d59b webhook: fix admin-hooks new dropdowns 2024-04-09 20:02:14 +02:00
oliverpool c1f7c49804 webhook: add admin-hooks new list test 2024-04-09 20:02:14 +02:00
0ko f35a30d316 Merge pull request 'Remove unused translation' (#3078) from gusted/forgejo-rm-tr into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3078
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-09 17:34:53 +00:00
Gusted f7aca6ed21
Remove unused translation
- Remove `enable_update_checker_helper` translation key which became
obsolete with #278
2024-04-09 19:06:33 +02:00
Codeberg Translate a31631e342 [I18N] Translations update from Weblate (#3064)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: WithLithum <WithLithum@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: adaaa <adaaa@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Panagiotis \"Ivory\" Vasilopoulos <git@n0toose.net>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: Anonymous <anonymous@users.noreply.translate.codeberg.org>
Co-authored-by: emansije <emansije@users.noreply.translate.codeberg.org>
Co-authored-by: Xinayder <Xinayder@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3064
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-04-09 16:59:31 +00:00
oliverpool c48e4d12c9 Merge pull request 'Makefile: test-e2e-sqlite-firefox' (#3127) from oliverpool/forgejo:makefile_e2e into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3127
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-09 16:08:50 +00:00
oliverpool 07d044a32c Makefile: test-e2e-sqlite-firefox 2024-04-09 16:50:10 +02:00
Earl Warren 9d6389352d Merge pull request 'Update dependency updates to v16.0.1' (#3119) from renovate/updates-16.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3119
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-09 13:02:08 +00:00
oliverpool 7d95cf6472 webhook: add org tests 2024-04-09 12:02:10 +02:00
Earl Warren 2d3705bb81 Merge pull request '[CHORE] Remove Microsoft SQL Server support' (#3040) from gusted/forgejo-rm-mssql into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3040
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-09 05:34:54 +00:00
Earl Warren 26fc7c3461 Merge pull request '[gitea] week 15 cherry pick' (#3091) from algernon/forgejo:wcp/week-15 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3091
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-09 05:31:44 +00:00
Renovate Bot 4c5b5109c6 Update dependency updates to v16.0.1 2024-04-09 00:06:50 +00:00
Earl Warren 7179ae8cc1 Merge pull request '[GITEA PORT] Do some performance optimize for issues list and view issue/pull (gitea#29515)' (#3116) from oliverpool/forgejo:port_29515 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3116
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 19:04:40 +00:00
0ko 640bcef48e Merge pull request 'Made "no key to sign this commit with" error clearer' (#3090) from Laxystem/forgejo:forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3090
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-08 19:04:15 +00:00
Earl Warren 721edf2ed8 Merge pull request 'Require dashboard approval for some deps' (#3114) from viceice/forgejo:chore/renovate-settings into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3114
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 18:59:56 +00:00
Earl Warren 11e966b402 Merge pull request 'Renovate enable weekly lockfile maintenance' (#3115) from viceice/forgejo:chore/renovate-lockfile-maintenance into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3115
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 18:58:49 +00:00
Gusted 2e5f9d5035 Merge pull request 'Update dependency temporal-polyfill to v0.2.4' (#3089) from renovate/temporal-polyfill-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3089
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-08 14:34:29 +00:00
Gusted 43402b3d9a Merge pull request 'Update ghcr.io/visualon/renovate Docker tag to v37.280.0' (#3068) from renovate/ghcr.io-visualon-renovate-37.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3068
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-08 14:31:56 +00:00
Renovate Bot 6b7aaad986 Update ghcr.io/visualon/renovate Docker tag to v37.280.0 2024-04-08 14:05:06 +00:00
Earl Warren 48c962343e Merge pull request '[Feat]Count downloads for tag archives' (#2976) from JakobDev/forgejo:archivecount into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2976
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 13:39:11 +00:00
Earl Warren 7e5cf471a0 Merge pull request '[PORT] gitea#30190: Add unique index for project_issue to prevent duplicate data' (#3096) from gusted/forgejo-gt-30190 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3096
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-08 13:30:11 +00:00
oliverpool 9ae805538a Use HasAttachmentSupport method 2024-04-08 15:24:00 +02:00
oliverpool 33444a3308 Fix: missing value for In() condition 2024-04-08 15:16:40 +02:00
Lunny Xiao c9854bee98 Do some performance optimize for issues list and view issue/pull (gitea#29515)
This PR do some performance optimzations.

- [x] Add `index` for the column `comment_id` of `Attachment` table to
accelerate query from the database.
- [x] Remove unnecessary database queries when viewing issues. Before
some conditions which id = 0 will be sent to the database
- [x] Remove duplicated load posters
- [x] Batch loading attachements, isread of comments on viewing issue

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Conflicts:
models/issues/comment_code.go: function was renamed in Forgejo
models/migrations/migrations.go: migration already ported
2024-04-08 14:47:31 +02:00
JakobDev 94d4b241b3 Resolve conflicts 2024-04-08 12:55:05 +02:00
JakobDev ffbe89ec2e Update Frontend 2024-04-08 12:54:43 +02:00
JakobDev a610e93cc9 Add fix and migration 2024-04-08 12:54:43 +02:00
JakobDev 613e5387c5 Count downloads for tag archives 2024-04-08 12:51:27 +02:00
Michael Kriese fe7b8d671b
Renovate enable weekly lockfile maintenance 2024-04-08 12:40:29 +02:00
Michael Kriese cd96d33598
Require dashboard approval for some deps 2024-04-08 12:19:13 +02:00
Renovate Bot e37fd3a8f4 Update dependency temporal-polyfill to v0.2.4 2024-04-08 10:09:28 +00:00
Earl Warren f8a5d6872c Merge pull request '[PORT] gitea#29953: Fix:the rounded corners of the folded file are not displayed correctly' (#3102) from algernon/forgejo:gitea/port/29953 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3102
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-08 09:26:34 +00:00
Earl Warren b7303cd3b5 Merge pull request 'Run Renovate more often' (#3108) from viceice/forgejo:chore/renovate-settings into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3108
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 08:11:32 +00:00
Michael Kriese cca2141078
Run Renovate more often 2024-04-08 09:19:58 +02:00
Earl Warren cc1ea0b0b0 Merge pull request 'Fix renovate cache' (#3106) from viceice/forgejo:chore/renovate-cache-fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3106
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 07:15:08 +00:00
Michael Kriese ad9af34f99
Fix renovate cache 2024-04-08 08:47:02 +02:00
Earl Warren 1830df1922 Merge pull request '[PORT] gitea#30279: Update JS dependencies and add new eslint rules' (#3097) from gusted/forgejo-gt-30279 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3097
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-08 05:51:12 +00:00
Earl Warren 6b5236a359 Merge pull request '[PORT] gitea#30282: Markup color and font size fixes' (#3099) from gusted/forgejo-gt-30282 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3099
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-07 19:52:58 +00:00
Earl Warren ba2cd8ee64 Merge pull request '[BUG] Fix unblock action' (#3086) from gusted/forgejo-unblock into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3086
2024-04-07 15:33:51 +00:00
HEREYUA 43122ca984
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.
2024-04-07 16:37:36 +02:00
Gergely Nagy 9bd261acde
[DEADCODE] update
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-07 15:40:31 +02:00
silverwind 8583b7f485
Fix right-aligned input icons (#30301)
Fix regression from https://github.com/go-gitea/gitea/pull/30194 where
right-aligned items would not display correctly.

Before and After:

<img width="285" alt="Screenshot 2024-04-06 at 01 12 11"
src="https://github.com/go-gitea/gitea/assets/115237/f9168db5-0f69-4b5d-ba17-b60145ac4a09">
<img width="285" alt="Screenshot 2024-04-06 at 01 11 49"
src="https://github.com/go-gitea/gitea/assets/115237/639ab6ed-d018-4e3a-9980-1f079e4ebe9d">

Frontpage search tweaked to accommodate (which was the reason for the
changes that broken above):

<img width="445" alt="Screenshot 2024-04-06 at 01 11 34"
src="https://github.com/go-gitea/gitea/assets/115237/1919220b-390e-463a-8e3d-33a3556bf111">
<img width="438" alt="Screenshot 2024-04-06 at 01 11 39"
src="https://github.com/go-gitea/gitea/assets/115237/fd94f8e4-1d56-4b04-99e3-1cd240bd7ab4">

(cherry picked from commit 94aad35a120b05897a0b6b97f0d9605a52ea9642)
2024-04-07 15:40:31 +02:00
silverwind 3408bcd294
Remove fomantic list module (#30281)
Likely still some unnecessary CSS but any combinations with the `ui
list` classes are covered. There was only on instance of `horizontal
list` which I removed. It was this part of the commit page:

<img width="396" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/c49ec4f5-93c3-41d6-a907-cdbedf8abc44">

(cherry picked from commit 649aada3664f5adccdaecc7dd24b8252ae070220)
2024-04-07 15:40:31 +02:00
silverwind 02416856b9
Markup color and font size fixes (#30282)
1. Distinguish inline an block code with new CSS variable
`--color-markup-code-inline`
2. Various color tweaks, better contrast from background

<img width="447" alt="Screenshot 2024-04-05 at 00 51 00"
src="https://github.com/go-gitea/gitea/assets/115237/93e069f4-6807-4f2c-9331-2d69730919d4">
<img width="456" alt="Screenshot 2024-04-05 at 00 50 44"
src="https://github.com/go-gitea/gitea/assets/115237/0dc9c745-c531-40fa-94ec-b0ba10bd7ccf">

(cherry picked from commit 662eb4b0852f9ce2c161e7fea5ac66bf912fc9f6)
2024-04-07 15:40:31 +02:00
sebastian-sauer 300c8dedfd
Commit-Dropdown: Show Author of commit if available (#30272)
As in commits page we show the author of the commit in the commits
dropdown and not the committer.

Commits Page:
![Screenshot from 2024-04-03
22-34-41](https://github.com/go-gitea/gitea/assets/1135157/1c7c5c19-6d0a-4176-8a87-7bca6a0c6dc8)

and the same contents in our dropdown:

![image](https://github.com/go-gitea/gitea/assets/1135157/aa094af2-c369-47ac-9c27-ca208d1d03f0)

fixes #29588

(cherry picked from commit 07bcfc171bcccfe78a86c7b4b3f9b729ba7d60b6)
2024-04-07 15:40:31 +02:00
Yakov b0ff1a17a4
Add `[other].SHOW_FOOTER_POWERED_BY` setting to hide `Powered by` (#30253)
This allows you to hide the "Powered by" text in footer via
`SHOW_FOOTER_POWERED_BY` flag in configuration.

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 609a627a44dbcb7b630ff51ce9f4b9f448b48ca8)

Conflicts:
	- docs/content/administration/config-cheat-sheet.en-us.md
	- docs/content/administration/config-cheat-sheet.zh-cn.md
	  Removed both, they're Gitea specific.
	- templates/base/footer_content.tmpl
	  Applied the change manually, keeping the Forgejo footer.
2024-04-07 15:40:31 +02:00
guangwu 0eb2105b16
fix: close file in the Upload func (#30262)
(cherry picked from commit 0ceecfc11ab4851863a5a6bc5e398d2baf7e86f6)
2024-04-07 15:40:31 +02:00
silverwind a53a94e1c2
Replace coloris with vanilla-colorful (#30201)
Found [a better color
picker](https://github.com/web-padawan/vanilla-colorful) that [does not
rely](https://github.com/mdbassit/Coloris/issues/139) on
`querySelectorAll` or a global shared instance, and is also around a
third of the size of the previous one.

The popover is handled by tippy.js for which I introduced a new "bare"
theme and it uses a new sibling-based mechanism which should prove
useful later to create tippy popovers via HTML only.

<img width="846" alt="Screenshot 2024-03-31 at 04 03 38"
src="https://github.com/go-gitea/gitea/assets/115237/7639b911-a2d7-4f5c-bffd-a9d84561e747">

(cherry picked from commit 1195be41a13d2198ab644c8558549edd74485510)
2024-04-07 15:40:31 +02:00
João Tiago 2adc3a45fb
Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175)
- 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: Giteabot <teabot@gitea.io>
(cherry picked from commit e006451ab1509f8d6d43c5974387c05b26517392)
2024-04-07 15:40:31 +02:00
KN4CK3R 63904e2f97
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
2024-04-07 15:40:31 +02:00
silverwind 0b27b96255
Fix spacing in issue navbar (#30238)
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
(cherry picked from commit 944c76e78423405a33450eb3d07cd2b772f4a81c)
2024-04-07 15:40:31 +02:00
Zettat123 87870ade49
Remove scheduled action tasks if the repo is archived (#30224)
Fix #30220

(cherry picked from commit 1ef2eb50d82d07b1e4ff312ef58953d1bba2437a)
2024-04-07 15:40:31 +02:00
GiteaBot 9214824510
[skip ci] Updated licenses and gitignores
(cherry picked from commit 3607f827fb432378dbe7d90bdedbff4fd4565e13)
2024-04-07 15:40:31 +02:00
silverwind f3e97bc27c
Add `/options/license` and `/options/gitignore` to `.ignore` (#30219)
Ignore this folder in tools like `rg` or `ag`. Also sorted the entries
alphabetically.

(cherry picked from commit 934fa46f769f0b90fc319054612d4f5c9a4c46ba)
2024-04-07 15:40:31 +02:00
silverwind d40127a3e8
Remove fomantic input module (#30194)
Another pure CSS module. Some styling is part of the `form` module which
will likely follow next.

(cherry picked from commit ff334749f58c71980ec19143bc21c0a799074b30)

Conflicts:
	- web_src/js/components/DashboardRepoList.vue
	  Resolved the conflict by manually applying the Gitea change.
2024-04-07 15:40:31 +02:00
Yarden Shoham 1983226581
Remove most jQuery function calls from the repository topic box (#30191)
Remove most jQuery function calls

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 0497b2607d1052e771af4017c2c4180adb7d86b2)
2024-04-07 15:40:31 +02:00
silverwind 4be577085e
Prevent flash of dropdown menu on labels list (#30215)
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: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 8da9130c1ffe93e0e97290fddb908ae5b67432e2)
2024-04-07 15:40:31 +02:00
Yarden Shoham 998f4dc36b
Remove jQuery class from the `repo-issue.js` file (#30192)
Switched from jQuery class functions to plain JavaScript `classList`.

Tested the following functionalities and they work as before:
- delete issue comment
- cancel code comment
- update (merge or rebase) pull request
- re-request review
- reply to code comment
- show/hide outdated comments
- add code comment
- edit issue title

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit ef5892d988f71743c7f5446bc6ce69cb4384455b)
2024-04-07 15:40:31 +02:00
silverwind 29a8be7c3d
Ignore fomantic folder in linters (#30200)
We are not linting these files but editor integrations will still try to
lint, disable that.

(cherry picked from commit 38d56ca10600bdb867b363be717f7cf5d176297a)
2024-04-07 15:40:31 +02:00
Yarden Shoham 6c3dbc2eee
Make a distinction between `active` and `selected` in the issue author dropdown (#30207)
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit f8fbaaf26fa7798fde690f4400910069fbccd40e)
2024-04-07 15:40:31 +02:00
silverwind c5dc579017
Move and simplify tab-size helpers (#30196)
Tailwind does not support. Dropped the vendor-prefix.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 44dd6d6927180a4d36b3811fd2fb7557d0b44adb)
2024-04-07 15:40:31 +02:00
KN4CK3R 5a674dd02e
Fix GPG subkey verify (#30193)
Fixes #30189

Can't verify subkeys if they are not loaded.

(cherry picked from commit 82ffd91607ba03907ebad31ec9a38555b153a331)
2024-04-07 15:40:31 +02:00
silverwind fbca0dd9a6
Fix unclickable checkboxes (#30195)
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.

(cherry picked from commit 640850e15f56bbe01f5d8ea407f99c79dc38457e)
2024-04-07 15:40:31 +02:00
Yarden Shoham 25303b2dfe
Remove jQuery class from the issue author dropdown (#30188)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the issue author dropdown functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 72a5d3faa8b65042a4fc7525d511d8942a47dafe)
2024-04-07 15:40:31 +02:00
Yarden Shoham 936448e11c
Remove jQuery class from the comment edit history (#30186)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the comment edit history functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 6aeff21b76fcbb10d5ce9009ed4243c14633d899)
2024-04-07 15:40:31 +02:00
Yarden Shoham bd1419899d
Remove jQuery class from the repository branch settings (#30184)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the repository branch settings functionality and it works as
before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 2b3f7d3e966ab60cb147115303d1992e8b50d4df)
2024-04-07 15:40:31 +02:00
Yarden Shoham 702f112602
Remove jQuery class from the project page (#30183)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the edit column modal functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit b535c6ca7b9e8c4bcf5637091ee5ad6d9c807c31)
2024-04-07 15:40:31 +02:00
Yarden Shoham f8a332c2e6
Remove jQuery class from the comment context menu (#30179)
- Switched from jQuery class functions to plain JavaScript
- Tested the comment context menu functionality and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 66f7d47d2c702bab4ca9bcedc1c0ba9ddfa49a17)
2024-04-07 15:40:31 +02:00
KN4CK3R 6925c0eee4
Include encoding in signature payload (#30174)
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)

(cherry picked from commit b6a3cd4b8dc20ba48d0044a972f6ff0f0de6e49e)
2024-04-07 15:40:31 +02:00
silverwind bef622d3e7
Add `stylelint-value-no-unknown-custom-properties` and convert stylelint config to js (#30117)
Add
[`stylelint-value-no-unknown-custom-properties`](https://github.com/csstools/stylelint-value-no-unknown-custom-properties)
which lints for undefined CSS variables. No current violations.

To make it work properly with editor integrations, I had to convert the
config to JS to be able to pass absolute paths to the plugin, but this
is a needed change anyways.

(cherry picked from commit f31a88d3cb64106e75bbe8a3502856db71dbacfc)

Conflicts:
	- .github/labeler.yml
	- .github/workflows/files-changed.yml
          Removed both, Gitea specific files.
2024-04-07 15:40:31 +02:00
Yarden Shoham 0f1bd1be06
Remove jQuery class from the commit button (#30178)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the commit button disabled toggling functionality and it works
as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 42870cf40278e84024ccea41368312451f79a4d6)
2024-04-07 15:40:31 +02:00
Yarden Shoham ecc78da55a
Remove jQuery class from the diff view (#30176)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the diff view functionality and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit c487a32bcd093affe3284282ea279d97f52a867f)
2024-04-07 15:40:31 +02:00
Yarden Shoham 6d164224e9
Remove jQuery class from the notification count (#30172)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the notification count and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 56ac5f18e8022242316d86c8f3091bce554faebb)
2024-04-07 15:40:31 +02:00
Yarden Shoham 811c14b8ba
Remove jQuery class from the code range selection (#30173)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the code range selection functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 911993429f3bec0ff4440c012b2a8f295673f961)
2024-04-07 15:40:31 +02:00
silverwind ff1744cbbc
[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)
2024-04-07 15:16:22 +02:00
silverwind e875220edd
[PORT] gitea#30279: Update JS dependencies and add new eslint rules
- Run `make update-js`
- Added new eslint rules
- Tested webpack build and swagger ui

---

Conflict resolution:
- package.json for minimatch choose the newest favor.
- package-lock.json, run `npm install` to generate this.

(cherry picked from commit 5dabc679aa0a33bc1b997335a216acfe97e70ea5)
2024-04-07 15:05:08 +02:00
Lunny Xiao f0004760f6
[PORT] gitea#30190: Add unique index for project_issue to prevent duplicate data
Fix #27639

---

Remove MSSQL specific code per https://codeberg.org/forgejo/discussions/issues/122

(cherry picked from commit b4825670596fe745cebdcc63a8ead4388602d42c)
2024-04-07 14:51:50 +02:00
Gusted efc2f53954 Merge pull request '[BUG] Fix tone of callout boxes for Forgejo dark' (#3085) from gusted/forgejo-theme-contrast into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3085
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-07 11:49:05 +00:00
Laxystem 53dadee350 Made "no key to sign this commit with" error more clear 2024-04-07 10:00:43 +00:00
Jack Hay e08f05b069
Add setting to disable user features when user login type is not plain (#29615)
- Adds setting `EXTERNAL_USER_DISABLE_FEATURES` to disable any supported
user features when login type is not plain
- In general, this is necessary for SSO implementations to avoid
inconsistencies between the external account management and the linked
account
- Adds helper functions to encourage correct use

(cherry picked from commit 59d4aadba5c15d02f3b9f0e61abb7476870c20a5)

Conflicts:
	- docs/content/administration/config-cheat-sheet.en-us.md
          Removed.
	- modules/setting/admin.go
          Trivial resolution: pick the newly added struct member.
2024-04-07 11:09:21 +02:00
Yarden Shoham ee33869f84
Remove jQuery class from the image diff (#30140)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the image diff and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 849eee8db70c8999d54350b85ea7a16fc44dc404)
2024-04-07 11:05:47 +02:00
silverwind 66f9a4ee68
Remove fomantic checkbox module (#30162)
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: delvh <dev.lh@web.de>
(cherry picked from commit 8fd15990c5c8980caf2b9ffefc0b3427efacdc04)
2024-04-07 11:05:37 +02:00
silverwind 2e542f17a3
replace jquery-minicolors with coloris (#30055)
Get rid of one more jQuery dependant and have a nicer color picker as
well.

Now there is only a single global color picker init because that is all
that's necessary because the elements are present on the page when the
init code runs. The init is slightly weird because the module only takes
a selector instead of DOM elements directly.

The label modals now also perform form validation because previously it
was possible to trigger a 500 error `Color cannot be empty.` by clearing
out the color value on labels.

<img width="867" alt="Screenshot 2024-03-25 at 00 21 05"
src="https://github.com/go-gitea/gitea/assets/115237/71215c39-abb1-4881-b5c1-9954b4a89adb">
<img width="860" alt="Screenshot 2024-03-25 at 00 20 48"
src="https://github.com/go-gitea/gitea/assets/115237/a12cb68f-c38b-4433-ba05-53bbb4b1023e">

(cherry picked from commit dd8dde2be89921b2b1497c6cc5eafdde213429cb)
2024-04-07 11:02:33 +02:00
sillyguodong 16696a42f5
Add API for `Variables` (#29520)
close #27801

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 62b073e6f31645e446c7e8d6b5a506f61b47924e)

Conflicts:
	- modules/util/util.go
          Trivial resolution, only picking the newly introduced function
	- routers/api/v1/swagger/options.go
          Trivial resolution. We don't have UserBadges, don't pick that part.
	- templates/swagger/v1_json.tmpl
          Regenerated.
2024-04-07 10:57:53 +02:00
yp05327 473b90da53
Fix `DEFAULT_SHOW_FULL_NAME=false` has no effect in commit list and commit graph page (#30096)
Fix #20446

This PR will fix the username in:
repo home page

![image](https://github.com/go-gitea/gitea/assets/18380374/347c0f70-ea42-432d-aae3-bf87a7e07ae1)
repo commit list page

![image](https://github.com/go-gitea/gitea/assets/18380374/b3b1f5d5-c371-4222-ac2e-64b8994c7551)
repo commit graph page

![image](https://github.com/go-gitea/gitea/assets/18380374/01b7117c-3aea-4d7d-8bd1-35e5ea942821)
pr commit page

![image](https://github.com/go-gitea/gitea/assets/18380374/4d180c30-2150-4348-8eeb-0b4b2559ec19)

Will not fix:
wiki revisions page:

![image](https://github.com/go-gitea/gitea/assets/18380374/b49df6bf-d751-4374-b7ea-1ac85e2739e3)
ps: the author name is `FullName` by default

(cherry picked from commit 61036235966773a0af6b690b10b33ff8222df1d7)
2024-04-07 10:52:45 +02:00
silverwind 60d2d0ff3a
Add gap to commit status details (#30284)
Before:
<img width="162" alt="Screenshot 2024-04-05 at 02 25 27"
src="https://github.com/go-gitea/gitea/assets/115237/9f786811-3e45-4b3c-aaf9-e1d2cad284d2">

After:
<img width="172" alt="Screenshot 2024-04-05 at 02 27 25"
src="https://github.com/go-gitea/gitea/assets/115237/f5254877-9e0d-44cb-9605-ba15c75872bb">

(cherry picked from commit 556099fa72f6239aa9446d06265876bc72b021b8)
2024-04-07 10:39:23 +02:00
Earl Warren e70e93c4b4 Merge pull request '[BUG] Fix admin layout' (#3087) from gusted/forgejo-admin-layout into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3087
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-06 20:39:01 +00:00
TheFox0x7 5f05196915 Add vars context to cron jobs (#3059)
Introduce vars context into cron triggered actions

Fixes #3044

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3059
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
2024-04-06 19:54:53 +00:00
Gusted c2d0f64340
[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
2024-04-06 21:23:50 +02:00
Gusted a3f1249f0a
[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
2024-04-06 20:57:51 +02:00
Gusted 515ccaacd9
[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
2024-04-06 20:38:37 +02:00
0ko 3b23633721 [I18N] Improve English locale
- user settings/profile: renamed Description fild of biography to Biography
2024-04-06 23:06:39 +05:00
Gusted d9f6c59543 Merge pull request 'Add unit tests for update git hook' (#3081) from gusted/forgejo-hook-test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3081
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-06 17:38:17 +00:00
Gusted dad799fa46
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
2024-04-06 17:01:33 +02:00
Shiny Nematoda baac15f316 [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>
2024-04-06 13:25:39 +00:00
Gusted 0a51ae26bc Merge pull request 'Sort `BuiltinApplicationsClientIDs()` in test' (#3075) from gusted/forgejo-sort into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3075
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-06 12:43:42 +00:00
Gusted 5691becace Merge pull request 'Fix "view file" button in diff compare view' (#3046) from Mai-Lapyst/forgejo:fix-diffcompare-viewfile-url into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3046
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 12:25:12 +00:00
Gusted d8eebe7698 Merge pull request 'Add optional pronoun field in user settings' (#1518) from hazy/forgejo:feat/pronoun-field into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1518
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-06 12:23:54 +00:00
Gusted d5fd40821e Merge pull request 'feat: extend webfinger to respond to profile page URIs' (#2883) from realaravinth/forgejo:cb-2870 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2883
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 12:21:35 +00:00
Earl Warren ec973ee6c3 Merge pull request '[PORT] Refactor dropzone (#30232)' (#3048) from earl-warren/forgejo:wip-repo-legacy into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3048
Reviewed-by: Mai-Lapyst <mai-lapyst@noreply.codeberg.org>
2024-04-06 09:56:32 +00:00
Gusted eea259055e
Sort `BuiltinApplicationsClientIDs()` in test
- Ref https://codeberg.org/forgejo/forgejo/pulls/3069#issuecomment-1736290
2024-04-06 11:30:02 +02:00
Mai-Lapyst ca8479c681
Update integration test 2024-04-06 11:19:32 +02:00
Earl Warren 3093f8765f Merge pull request 'Fix #3030 add Cache-Control header for health-check' (#3060) from adaaa/forgejo:cache-control-healthz into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3060
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 08:09:39 +00:00
Earl Warren 6077d10be3 Merge pull request 'feat: improve nuget nuspec api' (#2996) from viceice/forgejo:feat/nuget/nuspec-api into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2996
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-06 07:48:31 +00:00
Earl Warren 668edc1948 Merge pull request 'Refactor LFS GC functions' (#3056) from gusted/forgejo-lfs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3056
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-06 07:27:22 +00:00
Earl Warren a015ada29a Merge pull request '[BUG] fix webhook creation payload ref' (#3055) from oliverpool/forgejo:webhook_fix_create_payload_ref into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3055
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-06 07:25:20 +00:00
Earl Warren dbdab1bc60 Merge pull request 'Update bitnami/minio Docker tag to v2024.3.30' (#2917) from renovate/bitnami-minio-2024.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2917
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-06 07:20:08 +00:00
Earl Warren 8595e251a2 Merge pull request '[BUG] Don't remove builtin OAuth2 applications' (#3067) from gusted/forgejo-db-consistency-oauth2 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3067
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-06 07:02:07 +00:00
oliverpool adc5dd0520 Merge pull request '[CHORE] Remove u2f dependency' (#3057) from gusted/forgejo-rm-u2f into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3057
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-06 06:14:45 +00:00
Gusted 6af8f3a3f2
[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
2024-04-06 01:07:45 +02:00
Ada 323d7ad507
Remove useless t.run 2024-04-06 00:43:22 +02:00
Ada 84f5115bd1
Add health-check test 2024-04-06 00:34:55 +02:00
Michael Kriese bc72fd7f46
feat: improve nuget nuspec api 2024-04-05 23:39:45 +02:00
Gusted 2d9afd0c21
[CHORE] Remove Microsoft SQL Server Support
- Per https://codeberg.org/forgejo/discussions/issues/122
2024-04-05 23:37:36 +02:00
Earl Warren af47c583b4 Merge pull request '[CHORE] Remove Gitea specific files' (#3039) from gusted/forgejo-rm-gitea into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3039
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-05 20:40:12 +00:00
Ada d2ff8f8720
Remove old proxy backwards compatibility 2024-04-05 22:08:22 +02:00
Earl Warren 8205ed9495 Merge pull request '[FEAT] sourcehut webhooks' (#3022) from oliverpool/forgejo:webhook_7_sourcehut into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3022
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-05 19:23:54 +00:00
Ada b210a3ebd5
Fix #3030 add Cache-Control header for health-check 2024-04-05 18:44:17 +02:00
Gusted 5ae3098faa Merge pull request 'Update dependency @stoplight/spectral-cli to v6.11.1' (#3049) from renovate/stoplight-spectral-cli-6.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3049
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-05 14:50:15 +00:00
Gusted 7ffa7f5bce
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.
2024-04-05 16:49:15 +02:00
Gusted 32134e3a43
[CHORE] Remove u2f dependency
- It was only used to parse old U2F data to webauthn credentials. We
only used the public key and keyhandle. This functiontionality was
reworked to `parseU2FRegistration`.
- Tests are already present, `Test_RemigrateU2FCredentials`.
2024-04-05 16:23:10 +02:00
oliverpool 2c85a1417b [FIX] webhook creation payload ref 2024-04-05 16:21:41 +02:00
oliverpool 9d2919248b [TEST] webhook creation payload ref 2024-04-05 16:21:41 +02:00
oliverpool 38ec6d90a5 CODEOWNERS: add more reviewers (#3054)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3054
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2024-04-05 10:53:39 +00:00
oliverpool ed9dd0e62a [FEAT] sourcehut webhooks 2024-04-05 10:20:40 +02:00
wxiaoguang c1ac3e5891
[PORT] Refactor dropzone (#30232)
Simplify code and use `.files` elements

(cherry picked from commit ca297a90fb1fec5b270fad1a3e575916510e7385)

Conflicts:
	web_src/js/features/repo-legacy.js
2024-04-05 09:23:51 +02:00
Mai-Lapyst 06478da63b
Add integration test 2024-04-05 08:25:24 +02:00
Earl Warren 11fd8d5109 Merge pull request 'Provide plural support for followers/following in user profiles' (#2954) from 0ko/forgejo:plpro into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2954
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-05 06:21:21 +00:00
0ko ddedcd44b7
Use people icon instead of person on profiles 2024-04-05 06:53:25 +02:00
0ko df2a83ed20
[I18N] Provide plural support for followers/following in user profiles 2024-04-05 06:53:22 +02:00
Codeberg Translate 2c69ca43f5 [I18N] Translations update from Weblate (#2982)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Eriwi <Eriwi@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Co-authored-by: Kita Ikuyo <searinminecraft@courvix.com>
Co-authored-by: FedericoSchonborn <FedericoSchonborn@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2982
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-04-05 04:35:59 +00:00
Earl Warren 1b5b756a0e Merge pull request 'Revert "[CI] pin go v1.22.2 version"' (#3045) from earl-warren/forgejo:wip-no-pin into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3045
2024-04-05 04:23:22 +00:00
Renovate Bot 1497790209 Update dependency @stoplight/spectral-cli to v6.11.1 2024-04-05 04:23:05 +00:00
Earl Warren 7692aeecfa Merge pull request 'Fixes regression of issue edit not working' (#3043) from Mai-Lapyst/forgejo:fix-issue-edit-button into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3043
Reviewed-by: Otto <otto@codeberg.org>
2024-04-05 03:49:43 +00:00
Earl Warren 262533570f
Revert "[CI] pin go v1.22.2 version"
The golang action now knows about the latest Go version.

This reverts commit 3509242ee6.
2024-04-05 05:31:00 +02:00
Mai-Lapyst 33e8926efe
Fix view file button in diff compare 2024-04-05 05:27:20 +02:00
Mai-Lapyst 8c31b78630
Fixes regression of issue edit not working 2024-04-05 00:39:30 +02:00
Gusted 396b539496
[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.
2024-04-04 19:39:20 +02:00
Earl Warren 9c82789664 Merge pull request '[RELEASE] v1.21.10-0 release notes' (#3026) from earl-warren/forgejo:wip-release-notes-1.21 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3026
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-04-04 17:37:47 +00:00
Earl Warren 4ccb8c8b1f Merge pull request '[FEAT] Add label filters in organization issues dashboard' (#2944) from iminfinity/forgejo:add/label-filters into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2944
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-04 16:58:12 +00:00
Aravinth Manivannan fc3c944c16 fix: cleanup webfinger URI parsing 2024-04-04 16:52:25 +00:00
Aravinth Manivannan f7ca56557c feat: parse for all ForgeFed actors 2024-04-04 16:52:25 +00:00
Aravinth Manivannan 8273f8b756 feat: improve URI parsing in webfinger endpoint 2024-04-04 16:52:25 +00:00
Aravinth Manivannan 855d75d0bc fix: respond with 404 when webfingered with non-actor URIs 2024-04-04 16:52:25 +00:00
Aravinth Manivannan 1cc6ed8fb6 chore: add trailing slash query test case for webfinger endpoint 2024-04-04 16:52:25 +00:00
Aravinth Manivannan fc31f14507 feat: extend webfinger to respond to profile page URIs 2024-04-04 16:52:25 +00:00
Earl Warren a179695f33 Merge pull request '[BUG] Fix crash in issue forms' (#3012) from gusted/forgejo-crash into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3012
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-04 16:42:16 +00:00
Earl Warren 691bb9d171 Merge pull request 'feat: add optional storage init to doctor commands' (#3034) from viceice/forgejo:feat/doctor/add-init-storage-option into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3034
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-04 16:41:30 +00:00
Earl Warren d38edd02bf Merge pull request 'Plural support for release download count' (#3031) from 0ko/forgejo:download_plu into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3031
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-04 16:39:32 +00:00
Earl Warren dfa413a39e
[RELEASE] v1.21.10-0 release notes 2024-04-04 18:37:59 +02:00
Michael Kriese e226a27233
feat: add optional storage init to doctor commands 2024-04-04 17:21:12 +02:00
0ko 2fff6c255d [I18N] Provide plural support for release download count
Following https://codeberg.org/forgejo/forgejo/pulls/2899 and my review

See https://codeberg.org/forgejo/forgejo/pulls/3031#issuecomment-1733158 for why older strings were dropped
2024-04-04 19:16:00 +05:00
Gusted b0cd0ebb91
[BUG] Fix crash in issue forms
- Fix a crash in the issue forms, because `ctx.Ctx` was trying to be
accessed, however this is not set in all contexts thus could result to NPE.
- Adds integration test.
- Resolves #3011
2024-04-04 15:54:06 +02:00
Earl Warren 5951c9b2c4 Merge pull request '[FEAT] Visual separation between types of attachments' (#2899) from gusted/forgejo-attachment-divide into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2899
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-04 13:37:45 +00:00
iminfinity 8d13ed4a8d add label filters in org/{org_name}/issues 2024-04-04 17:57:11 +05:30
Earl Warren ba35934824 Merge pull request '[BUG] Center icon and callout text' (#3010) from gusted/forgejo-center-icon into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3010
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-04 12:10:27 +00:00
oliverpool 04a398a1af [REFACTOR] webhook shared code to prevent import cycles 2024-04-04 08:24:33 +02:00
Earl Warren c4adb08d6d Merge pull request 'Update dependency go to v1.22.2' (#3015) from renovate/golang-packages into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3015
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-04-04 05:40:10 +00:00
Earl Warren 3509242ee6
[CI] pin go v1.22.2 version
Because setup-go fails to pick it up. It usually happens within 24h
and this commit can be reverted then.
2024-04-04 06:45:48 +02:00
Gusted ded1080bc2
[CHORE] Update golang.org/x/net
Per https://pkg.go.dev/vuln/GO-2024-2687
2024-04-04 06:17:41 +02:00
Renovate Bot e6da9c6cd9 Update dependency go to v1.22.2 2024-04-04 04:04:38 +00:00
Gusted 6ffae461d4
[BUG] Center icon and callout text
- Wrap the icon and callout into a seperate `<p>` which has `display:
flex; align-items: center` set. To center the icon with the callout text.
- Resolves #3006
2024-04-03 22:26:19 +02:00
hazycora 2bed909a17
use EqualValues in test of pronouns not being displayed when unspecified 2024-04-03 15:24:23 -05:00
Gergely Nagy 9bb7b3fbdd
Add a new test for "Unspecified" pronouns
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-03 15:18:54 -05:00
hazycora 152f26f05b
remove unused assignment 2024-04-03 15:18:53 -05:00
Gergely Nagy 276bf850c9
Add tests for the Pronouns field
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-03 15:18:53 -05:00
Gergely Nagy 6aba69ce85
Enable user pronoun editing from the admin ui
While users can edit their own pronouns, the admin UI enables an admin
to edit *any* user setting. As such, pronouns should be editable here,
too.

For the sake of simplicity, the input here is a simple text input field,
rather than a dropdown.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-03 15:18:02 -05:00
Gergely Nagy efa9649696
services/convert/user: Convert pronouns properly
When converting from a `user_model.User` to `api.User` or
`api.UserSettings`, convert the `Pronouns` field too.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-03 15:18:01 -05:00
Gergely Nagy 66ac657159
Add Pronouns to the User and UserSettings api structs
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-03 15:17:15 -05:00
hazycora 1c551f923b
only add name attribute to pronouns input in JS, to ensure fallback works 2024-04-03 15:16:40 -05:00
hazycora 454ceb2ada
add some comments 2024-04-03 15:16:40 -05:00
hazycora 8cbacf850a
Add back ID field to pronouns migration
looks unnecessary, but not doing this seems to cause failed tests. Other previous migrations follow this pattern as well.
2024-04-03 15:16:38 -05:00
hazycora 75890e8f37
gofumpt 2024-04-03 15:15:53 -05:00
hazycora 8d086ad91c
change "any/all" to "any pronouns" 2024-04-03 15:15:53 -05:00
hazycora 20f96796d7
use recognisedPronouns variable 2024-04-03 15:15:53 -05:00
hazycora 204dd9e300
Add migration for pronouns 2024-04-03 15:15:53 -05:00
hazycora bbf906eccc
fix locale function in profile settings 2024-04-03 15:12:30 -05:00
hazycora 21c8c09430
generate swagger 2024-04-03 15:12:30 -05:00
hazycora 74da95df67
move pronouns below full name in user profile settings 2024-04-03 15:12:30 -05:00
hazycora 12e00abe29
add any/all pronoun option to dropdown 2024-04-03 15:12:30 -05:00
hazycora 708327a548
set width on pronoun dropdown and custom input 2024-04-03 15:12:30 -05:00
hazycora 864a4332df
Make "Custom" pronoun option italic 2024-04-03 15:12:29 -05:00
hazycora 563e8b49e8
Add "Unspecified" option to pronouns dropdown 2024-04-03 15:12:29 -05:00
hazycora 994c6d3cde
move pronouns JS 2024-04-03 15:12:16 -05:00
hazycora a6f068a93b
use dropdown for pronoun input 2024-04-03 15:12:15 -05:00
hazycora f8e48e066a
add pronoun field to user profiles 2024-04-03 15:11:17 -05:00
Earl Warren efd0f0f224 Merge pull request 'Port archived labels visual filter' (#2887) from 0ko/forgejo:lable-archive-bw into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2887
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-03 20:06:39 +00:00
Earl Warren 5ff20d4583 Merge pull request 'Better color for labels/counters' (#2935) from 0ko/forgejo:glorious-label-color into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2935
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-03 20:03:54 +00:00
Earl Warren c360b630e3 Merge pull request '[FEAT] Allow non-explicit push options' (#2984) from gusted/forgejo-push-options into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2984
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-03 19:00:16 +00:00
Earl Warren f703a29cd4 Merge pull request 'Fix primary button background inconsistency' (#3002) from 0ko/forgejo:fix2947 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3002
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-03 18:59:37 +00:00
Gusted f5ad6d4be5
[FEAT] Allow non-explicit push options
- Currently the parsing of the push options require that `=` is present
in the value, however we shouldn't be that strict and assume if that's
not set the value is `true`.
- This allow for more natural commands, so become `-o force-push=true`
simply `-o force-push`.
- Add unit test.
2024-04-03 20:11:49 +02:00
oliverpool 6f807c3519 Merge pull request 'Simplify delay writer Close' (#2994) from gusted/forgejo-simplify into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2994
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-03 17:25:55 +00:00
Earl Warren 6af253cc5d Merge pull request '[BUG] Disable 'View at this point in history' for wikis' (#2999) from gusted/forgejo-wiki-view-here into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2999
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-03 16:59:21 +00:00
Earl Warren 4aebf52129 Merge pull request 'Update module github.com/editorconfig/editorconfig-core-go/v2 to v2.6.2' (#2987) from renovate/github.com-editorconfig-editorconfig-core-go-v2-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2987
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-03 16:56:21 +00:00
Earl Warren f45aed66b0 Merge pull request '[THEME] Update variables' (#2998) from gusted/forgejo-theme-code into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2998
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-03 16:49:06 +00:00
0ko d44f290750 [UI] Fix primary button background inconsistency
Fixes https://codeberg.org/forgejo/forgejo/issues/2947
2024-04-03 19:52:36 +05:00
Gusted 8df9100994
[BUG] Disable 'View at this point in history' for wikis
- Don't show the 'View at this point in history' button for wikis as
wikis don't have this feature.
- Adds integration test
- Resolves https://codeberg.org/forgejo/forgejo/issues/2995
2024-04-03 16:00:36 +02:00
Gusted 629d9aa174 Merge pull request 'fix: set proper go directive' (#2997) from viceice/forgejo:fix/set-proper-go-directive into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2997
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-04-03 13:18:26 +00:00
Gusted eae9397fa2
[THEME] Update variables
- Follows a579a0f318
- Remove `--color-code-sidebar-bg`.
- `--color-active-line` -> `--color-highlight-bg`.
- Add `--color-highlight-fg`.
- Resolves #2964
2024-04-03 15:15:13 +02:00
Michael Kriese 99efe01a08
fix: set proper go directive 2024-04-03 14:50:34 +02:00
Gusted 6acedb973a
Simplify delay writer Close
Per https://codeberg.org/forgejo/forgejo/pulls/2983#issuecomment-1730756
2024-04-03 14:06:39 +02:00
Earl Warren 7d35a76ebf Merge pull request '[BUG] Make delay writer actually work' (#2983) from gusted/forgejo-hook-processing into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2983
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-03 07:33:45 +00:00
Earl Warren 141e66b538 Merge pull request '[CI] backport auto-squash detection and -x' (#2989) from earl-warren/forgejo:wip-backport-workaround into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2989
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-04-03 07:09:35 +00:00
Earl Warren 6c7179355e
[CI] backport auto-squash detection and -x
* Behaves as it should with merge & squashed pull requests
* Cherry-pick commits with -x for traceability

Refs: https://github.com/kiegroup/git-backporting/issues/113
2024-04-03 08:18:39 +02:00
Renovate Bot 8f3b2096a8 Update module github.com/editorconfig/editorconfig-core-go/v2 to v2.6.2 2024-04-03 04:08:11 +00:00
Renovate Bot 59bb7c2bf0 Update ghcr.io/visualon/renovate Docker tag to v37.278.0 2024-04-03 02:06:10 +00:00
Gusted 9320ffd2b5
[BUG] Make delay writer actually work
- Reading the code of this delay writer implemenation, it looks like
that it should only actually write content to the `io.Writer` if x
amount of time has passed by. However in practice it was always printing
the buffer even if the X amount of time didn't pass yet. This is in line
with what was being said in the issue that this was to help with
https://github.com/go-gitea/gitea/issues/9610.
- This was caused by the extra `Close()` calls which in turn caused that
when the second `Close` is called (which is done in a defer already) it
would've printed the buffer anyway. So remove the extra calls to `Close()`.
- Add unit test.
2024-04-03 02:46:46 +02:00
Earl Warren 0a9f6297a3 Merge pull request 'Adjust the signed tag verification line' (#2966) from algernon/forgejo:were-not-gonna-stop-until-we-reach-the-highest-top into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2966
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-02 22:02:03 +00:00
Gergely Nagy d58143e4e1
Adjust the signed tag verification line
Move the signed tag verification line above the release notes, don't
disable the bottom margin, and make sure the verification line's box is
properly rounded like other boxes.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-02 23:02:34 +02:00
0ko a245fb5c83 [THEME] Use better color for labels/counters
- improves contrast
- looks good
- improves consistency with other label-y elements
2024-04-02 17:40:34 +00:00
Earl Warren 4b8d06b0a7 Merge pull request 'Allow custom repo size format' (#2974) from 0ko/forgejo:percent_s into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2974
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-02 15:08:41 +00:00
Earl Warren 2a006e850e Merge pull request '[FEAT] Mark database errors in tests as failure' (#2972) from gusted/forgejo-log-db into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2972
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-02 14:47:32 +00:00
Earl Warren 3aad608649 Merge pull request '[BUG] Use correct template for commitmail error' (#2973) from gusted/forgejo-fix-committmail into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2973
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-02 14:45:54 +00:00
Gusted 58fc87091d Merge pull request '[TESTS] fix flacky git check-attr subtest' (#2963) from oliverpool/forgejo:git_check_attr_test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2963
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-02 14:24:20 +00:00
0ko 2f38c2220f [I18N] Allow custom repo size format
Following https://codeberg.org/forgejo/forgejo/pulls/2528#issuecomment-1721846

- simplify the code
- allow to have custom format in translations
- provide proper Russian translation because test depends on it
2024-04-02 18:43:12 +05:00
Gusted 27f39047c1
[BUG] Use correct template for commitmail error
- Use the correct template that was given when there's an error in
retrieving which git identity should be used.
- Remove the error from the exception list.
2024-04-02 15:08:53 +02:00
Gusted 2dabd202ce
[FEAT] Mark database errors in tests as failure
- If the database returns a error in integration tests, it should be
marked as a failure of the test.
- Ref: https://codeberg.org/forgejo/forgejo/issues/2962 (this should
help with logging the SQL that is resulting in the error).
2024-04-02 14:40:31 +02:00
Earl Warren 7e575603ee Merge pull request 'Provide plural support for issue participants' (#2695) from 0ko/forgejo:participants into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2695
2024-04-02 10:46:51 +00:00
Codeberg Translate fc715fb31e [I18N] Translations update from Weblate (#2937)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: Mormegil <Mormegil@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: hankskyjames777 <hankskyjames777@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2937
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-04-02 10:45:15 +00:00
Gusted 20a3597220
[FEAT] Visual separation between types of attachments
- Add a visual (but still semantic way) separation between Forgejo's
generated attachments and the user's uploaded ones.
- The styling was first done by `ul` element, but is moved to the
individual list items to have better control over them.
- Add tooltip explaining the attachment was generated by Forgejo.
- Remove the tooltip of the other attachments and 'simplify' them into a text.
- Resolves #2893

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
2024-04-02 12:30:47 +02:00
Earl Warren a7190aa19a Merge pull request 'Update dependency happy-dom to v14.3.10' (#2959) from renovate/happy-dom-14.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2959
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-02 10:22:52 +00:00
oliverpool cef39b2940 [TESTS] fix flack git check-attr flacky subtest 2024-04-02 11:56:48 +02:00
Earl Warren 04fcaf783e Merge pull request 'fix: respond with JSON Resource Descriptor Content-Type per RFC7033' (#2882) from realaravinth/forgejo:cb-2871 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2882
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-02 09:38:27 +00:00
Aravinth Manivannan 2c2f146895
fix: respond with JSON Resource Descriptor Content-Type per RFC7033 2024-04-02 14:11:47 +05:30
Earl Warren a2f603dedd Merge pull request '[BUG] Use correct translation on closed milestones' (#2957) from gusted/forgejo-milestone into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2957
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
2024-04-02 05:32:40 +00:00
Renovate Bot 335dd3cee6 Update dependency happy-dom to v14.3.10 2024-04-02 04:04:45 +00:00
Gusted 095d845f3c
[BUG] Use correct translation on closed milestones
- Uh self explanatory? Fix a typo.
- Regression of 365bb77a54
- Resolves https://codeberg.org/Codeberg/Community/issues/1526
2024-04-02 00:51:27 +02:00
Earl Warren 68e900822b Merge pull request '[CI] backport workaround to cherry-pick in order' (#2953) from earl-warren/forgejo:wip-git-backporting-order into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2953
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-01 19:40:01 +00:00
Earl Warren 385bcca788 Merge pull request 'Data size unit localization' (#2528) from 0ko/forgejo:sizelocalize into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2528
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-01 19:31:26 +00:00
Earl Warren ec091b59af Merge pull request '[FEAT] Configure if protected branch rule should apply to admins' (#2867) from gusted/forgejo-protectedbranch-admins into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2867
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-01 19:28:29 +00:00
Earl Warren 8194d7d760 Merge pull request 'Make pprof labels conformant with prometheus spec' (#2933) from thefox/forgejo:pprof_fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2933
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-01 18:08:43 +00:00
0ko 53dc9f3393 Add integration test for (non-)archived label properties 2024-04-01 21:38:34 +05:00
Earl Warren 21dda0d1f7
[CI] backport workaround to cherry-pick in order
Refs: https://github.com/kiegroup/git-backporting/issues/114
2024-04-01 17:48:39 +02:00
Earl Warren 2e744dc991 Merge pull request 'Render inline file permalinks' (#2669) from Mai-Lapyst/forgejo:markup-add-filepreview into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2669
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-01 13:57:01 +00:00
Earl Warren b9a1d5c2be Merge pull request 'Highlight signed tags like signed commits' (#2534) from algernon/forgejo:message-in-a-bottle-ctrl-w-tag into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2534
2024-04-01 13:38:55 +00:00
0ko 1060b7cfa8 Add opacity and grayscale to archived labels
Co-authored-by: Gusted <gusted@noreply.codeberg.org>
2024-04-01 17:46:02 +05:00
0ko cab47bbb0e [I18N] Improve translatability of archived labels
Allow any position and writing style of `(Archived)`.
2024-04-01 17:46:02 +05:00
0ko 4b09dd11ec [GITEA] Apply changes to archived labels
This is a squashed result of conflict resolution for the following commits from Gitea:
- 36de5b299b
- 9a93b1816e
- 712e19fa6f
- 83850cc479

It is lacking CSS rule for archived labels, though.

Changes in this commit are authored by:
- 6543
- delvh
- silverwind
2024-04-01 17:46:02 +05:00
Earl Warren e18429aeb0 Merge pull request '[TESTS] disable test failure on log.Error for now' (#2942) from oliverpool/forgejo:disable_logger_failures into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2942
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-04-01 09:37:01 +00:00
oliverpool 62148859b9 [TESTS] disable test failure on log.Error for now 2024-04-01 11:00:32 +02:00
Earl Warren 4d7a57a9f3 Merge pull request '[REFACTOR] git attribute: test proper cancellation and unify nul-byte reader' (#2906) from oliverpool/forgejo:git_attr_error into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2906
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-04-01 05:58:37 +00:00
Earl Warren 75234fc6bc Merge pull request '[TESTS] do not include line numbers in the error whitelist' (#2936) from earl-warren/forgejo:wip-ignore-list into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2936
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-03-31 22:04:50 +00:00
Earl Warren a60b34a451
[TESTS] do not include line numbers in the error whitelist
They are bound to change. The worst that can happen is that the same
error happens somewhere else and is ignored although it should
not. Which is not worse than the previous situation which was to
ignore all errors anyway.

Also be more liberal about what is ignored. Some error messages are
very long and may contain elements with some variance. It is enough to
have an ignored that is specific.
2024-03-31 23:32:49 +02:00
Gusted e96714016c Merge pull request '[BUG] Consistent styling for Sort filter' (#2920) from gusted/forgejo-filter-type into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2920
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2024-03-31 20:58:30 +00:00
Earl Warren 9bd55ced76 Merge pull request '[CI] backport workaround to avoid duplicated job runs' (#2934) from earl-warren/forgejo:wip-backport-workaround into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2934
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-03-31 19:02:54 +00:00
Earl Warren d9b5df89e3
[CI] backport workaround to avoid duplicated job runs
Refs: https://codeberg.org/forgejo/forgejo/issues/2009
2024-03-31 17:34:21 +02:00
0ko c2d137d1f2 Rename ByteSize to ReadableSize 2024-03-31 20:17:12 +05:00
TheFox0x7 c8f515dff7
[FIX] make pprof labels conformant with prometheus spec 2024-03-31 17:07:14 +02:00
Gusted b7d55de222
[BUG] Consistent styling for Sort filter
- The dropdowns that contain filters for issues and pull requests are
currently not styled with the `small` class, which causes a smaller font
size to be set. Remove it for the `Sort` filter to make it consistent
and make it _more_ readable.
- Resolves #2914
2024-03-31 16:24:03 +02:00
Earl Warren 99842e9ff5 Merge pull request '[TESTS] prevent overriding testlogger when calling mainApp' (#2846) from oliverpool/forgejo:non_failing_test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2846
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-31 13:50:20 +00:00
Earl Warren 502db7a873 Merge pull request '[TESTS] pull review deletion (partial port of gitea#29888)' (#2796) from oliverpool/forgejo:port_29888 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2796
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-31 13:48:15 +00:00
oliverpool 6b857193ff [TESTS] pull review deleted from gitea#29888
Instead of db.TruncateBeans(db.DefaultContext, &issues_model.Review{}), reviews are deleted using issue.DeleteReview
2024-03-31 13:53:47 +02:00
oliverpool bd97bd875d [TESTS] deliver webhooks on localhost 2024-03-31 10:34:37 +02:00
Earl Warren b2312f32c4 Merge pull request 'English improvements' (#2703) from 0ko/forgejo:english20240320 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2703
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-31 08:10:51 +00:00
Earl Warren 76fca987a7 Merge pull request 'Fix New issue button position consistency' (#2845) from 0ko/forgejo:issue-button-const into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2845
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-31 08:07:53 +00:00
Earl Warren e5d30af29d Merge pull request '[CI] backport: show event information for debug purposes' (#2923) from earl-warren/forgejo:wip-ci-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2923
2024-03-31 07:00:40 +00:00
oliverpool 0bb7758cb0 git attribute: test proper cancellation and unify nul-byte reader 2024-03-31 08:44:09 +02:00
Earl Warren ae96a5e725 Merge pull request '[REFACTOR] add Icon to webhook.Interface' (#2908) from oliverpool/forgejo:webhook_6_icon_method into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2908
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-31 06:22:51 +00:00
Codeberg Translate 03cac08b1d [I18N] Translations update from Weblate (#2841)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: kita <kita@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <Fjuro@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: cherryb <cherryb@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2841
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-03-31 06:16:47 +00:00
0ko e498069fd5 Update checker setting updates
- revert c53f802778
- enable by default on install page
- save checkbox state between form submissions

Resolves https://codeberg.org/forgejo/forgejo/issues/2859
2024-03-31 10:52:24 +05:00
Earl Warren 7aa686d979
[CI] backport: show event information for debug purposes
It will help figure out why two runs of testing happen when a backport
PR is open.

Refs: https://codeberg.org/forgejo/forgejo/pulls/2922
Refs: https://codeberg.org/forgejo/forgejo/issues/2009
2024-03-31 07:27:23 +02:00
Renovate Bot 7ec39aa756 Update bitnami/minio Docker tag to v2024.3.30 2024-03-31 02:07:27 +00:00
Earl Warren ebf8eb5b85 Merge pull request '[RELEASE] GITEA_VERSION is a fallback for FORGEJO_VERSION' (#2861) from earl-warren/forgejo:wip-version into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2861
2024-03-30 22:23:37 +00:00
Earl Warren 48a7bb90fe Merge pull request '[BUG] Fix selector inner radius' (#2860) from 0ko/forgejo:thousand_percent_scale into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2860
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 22:22:23 +00:00
Earl Warren e0421b28bf Merge pull request '[FEAT] Use 'Text' instead of 'Plaintext'' (#2833) from eo/forgejo:patch-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2833
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 22:21:14 +00:00
Gusted 854164f40b Merge pull request 'Fix accessibility and translatability of repo explore counters' (#2862) from 0ko/forgejo:tr.repo.stars into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2862
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 22:14:22 +00:00
Gusted 46fead4c73 Merge pull request '[BUG] Don't color dot literal color names' (#2905) from gusted/forgejo-colordots into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2905
Reviewed-by: Algernon <algernon@noreply.codeberg.org>
2024-03-30 22:08:36 +00:00
oliverpool 0532a91b1a populate testlogger ignoreList 2024-03-30 22:50:54 +01:00
Gergely Nagy bc080070ed
An integration test for SSH signed tags
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-30 20:14:42 +01:00
Gergely Nagy 432ff7d767
Highlight signed tags like signed commits
This makes signed tags show a badge in the tag list similar to signed
commits in the commit list, and a more verbose block when viewing a
single tag. Works for both GPG and SSH signed tags.

Fixes #1316.

Work sponsored by @glts.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-30 20:14:42 +01:00
Earl Warren bbf612b3a8 Merge pull request '[CI] run renovate daily instead of every 30 minutes' (#2913) from earl-warren/forgejo:wip-renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2913
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 16:49:20 +00:00
Earl Warren ae5e0c0ff6
[CI] run renovate daily instead of every 30 minutes
It was necessary in the debug period to help with a faster debug
loop. Now that it works reliably, there is no need for renovate
updates more than once a day.

It will still possible to force a run, should it be necessary, by
re-running the last scheduled job.
2024-03-30 17:48:08 +01:00
Gusted ff6feca946 Merge pull request 'Update module github.com/go-sql-driver/mysql to v1.8.1' (#2911) from renovate/github.com-go-sql-driver-mysql-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2911
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 16:41:38 +00:00
0ko dae95f473e Deprecate usage of FileSize in templates 2024-03-30 21:10:47 +05:00
0ko bba1884582 Add integration test for TrSize 2024-03-30 21:10:47 +05:00
0ko 075e0de142 Add unit test for TrSize 2024-03-30 21:10:47 +05:00
0ko 29cc80d849 Provide a way to translate data units 2024-03-30 21:10:47 +05:00
0ko 7b9c346cde Add data unit translations 2024-03-30 21:10:18 +05:00
0ko 892fc82a20 Fix New issue button consistency
Fixes https://codeberg.org/forgejo/forgejo/issues/2613
Based on https://codeberg.org/forgejo/forgejo/issues/2613#issuecomment-1654709

- add new class `list-header-issues`;
- add rules that fix button position;
- use variable to keep the vertical offset constant;
- fix gap for edit button.

Co-authored-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 21:08:34 +05:00
0ko 177d8e7769 Fix selector inner radius
- Fixes https://codeberg.org/forgejo/forgejo/issues/2835
2024-03-30 21:04:48 +05:00
0ko d183d32c58 [I18N] English improvements 2024-03-30 20:54:04 +05:00
Gergely Nagy cd19564acc
models/asymkey: Implement Tag verification
This is, in large part, a refactoring: we rename `CommitVerification` to
`ObjectVerification`, and adjust `ParseObjectWithSignature` (previously
`ParseCommitWithSignature`) to work on an object, rather than a commit.

This in turn, lets us implement `ParseTagWithSignature` on top of it, so
commit & tag signature verification will share most of the code.

Work sponsored by @glts.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-30 16:22:05 +01:00
oliverpool 69115baf41 [REFACTOR] use Icon from interface in webhook list 2024-03-30 16:00:06 +01:00
oliverpool 120fa61a0a [REFACTOR] add Icon to webhook.Interface 2024-03-30 15:59:56 +01:00
Renovate Bot 85cbdefaaa Update module github.com/go-sql-driver/mysql to v1.8.1 2024-03-30 14:46:43 +00:00
Leo Heitmann Ruiz afcff0eebd Fix 2024-03-30 15:23:48 +01:00
Gusted bc04183e47 Merge pull request 'Update module github.com/felixge/fgprof to v0.9.4' (#2805) from renovate/github.com-felixge-fgprof-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2805
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 13:47:43 +00:00
Gusted 71df02bc09 Merge pull request 'Update dependency happy-dom to v14.3.9' (#2900) from renovate/happy-dom-14.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2900
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 13:45:55 +00:00
Gusted 80f22ab0d8
[BUG] Don't color dot literal color names
- Colordots are generated for colors in inline code, such as `red`,
`rgb(255, 0, 124)`, `#ffaabb` and `hsl(124, 52%, 50%)`. However this
shouldn't be doon for literal color names as these can be too common
assiocated with non-color related stuff _and matches the behavior of
some other forge_.
- Move the regexes from bluemonday to Forgejo and do the checking
ourselves.
- Adds unit tests.
- Resolves https://codeberg.org/Codeberg/Community/issues/1510
2024-03-30 14:30:41 +01:00
Gusted 57d27dcbee Merge pull request '[CI] allow backports to be launched on merged pull requests' (#2903) from earl-warren/forgejo:wip-ci-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2903
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 13:17:09 +00:00
Earl Warren d8ab364889
[CI] allow backports to be launched on merged pull requests
The intention was good initially but the expression was wrong for two
reasons:

* When a pull_request event is received for a labeled action, the
  match should be github.event.action == 'label_updated' and not
  'labeled'
* The event does not have a github.event.label field and
  contains(github.event.label.name, 'backport/v') will always be
  false.

Since the expression is only evaluated in the context of a merged pull
request, either because it was just closed or because it was labeled
after the fact, the only verification that is needed is to assert that
there is at least one `backport/v*` label.
2024-03-30 13:35:56 +01:00
Renovate Bot 05376503ed Update dependency happy-dom to v14.3.9 2024-03-30 11:48:44 +00:00
Gusted ec459b23c8 Merge pull request '[BUG] Render emojis in labels in issue info popup' (#2888) from gusted/forgejo-emoji-popup into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2888
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 11:20:57 +00:00
Earl Warren 0761207cc2 Merge pull request 'Update module github.com/minio/minio-go/v7 to v7.0.69' (#2851) from renovate/github.com-minio-minio-go-v7-7.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2851
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 11:11:37 +00:00
Earl Warren 659452a1bc Merge pull request 'Improve look of user profiles' (#2875) from 0ko/forgejo:profile-card-bg into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2875
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 10:19:12 +00:00
Gusted ddc24177dd
[BUG] Render emojis in labels in issue info popup
- Currently emojis that are part of the label's name aren't rendered
when shown in the popup that you get when you hover over issue
references.
- This patch fixes that by rendering the emoji.
- Adds CSS to not make the emoji big in the label.
- Resolves #1531
2024-03-30 11:18:46 +01:00
Earl Warren 053ab13f99 Merge pull request '[CI] backport strategy must fail when it conflicts' (#2896) from earl-warren/forgejo:wip-ci-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2896
2024-03-30 10:13:15 +00:00
Renovate Bot 02dcd07437 Update module github.com/felixge/fgprof to v0.9.4 2024-03-30 10:11:45 +00:00
Earl Warren 2e3ea3e045 Merge pull request 'Update module github.com/opencontainers/image-spec to v1.1.0' (#2858) from renovate/github.com-opencontainers-image-spec-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2858
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 09:54:35 +00:00
0ko 951a276174 Improve look of user profiles
- use more standard backgounds for user card and readme
- add proper border to user card
2024-03-30 14:40:50 +05:00
Earl Warren ffdba30a62
[CI] backport strategy must fail when it conflicts
strategy: ort

The strategy is changed from "recursive" to "ort", which is the
default for git >= 2.43.2 and claims to reduce the likelyhood of
conflicts according to man git-merge:

> This has been reported to result in fewer merge conflicts without
> causing mismerges...

strategy-option: find-renames

The default option are the same for both strategies and "theirs" will:

> This option forces conflicting hunks to be auto-resolved
> cleanly by favoring their version.

"their" being whatever is not in the commits being cherry-picked.

In the context of Forgejo backports, this is not what is desired:
whenever a conflict happens it needs to be manually resolved and
prefering whatever is in the stable branch will not lead to a sane
backport.

It is changed back to "find-renames" which is documented to be the
default:

> Turn on rename detection, optionally setting the similarity
> threshold. This is the default.

Fixes: https://codeberg.org/forgejo/forgejo/issues/2886
2024-03-30 10:34:23 +01:00
Earl Warren 91b745a5b6 Merge pull request '[gitea] week 14 cherry-pick' (#2872) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2872
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-30 08:01:06 +00:00
Earl Warren 8f10247585
[BUG] Fix Ctrl+Enter on editor (followup)
s/$editContentZone/editContentZone/

because the variable was renamed by

Remove jQuery `.attr` from the code comments (#30112)
2024-03-30 07:17:32 +01:00
Yarden Shoham d8fa9b1580
Remove jQuery from the user search form in admin page (#29151)
- Switched to plain JavaScript
- Tested the form and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a8748eedae3518550bd43fd592d206df2bea6bef)

Conflicts:
	web_src/js/features/admin/users.js
	prefer Gitea version and discard jQuery specific fixes from
	Forbid jQuery `.prop` and fix related issues (#29832)
2024-03-30 07:17:32 +01:00
Lunny Xiao 459b1b20fe
Fix migration v292 (#30153)
Fix https://github.com/go-gitea/gitea/pull/29874#discussion_r1542227686

- The migration of v292 will miss many projects. These projects will
have no default board. This PR introduced a new migration number and
removed v292 migration.

- This PR also added the missed transactions on project-related
operations.

- Only `SetDefaultBoard` will remove duplicated defaults but not in
`GetDefaultBoard`

(cherry picked from commit 40cdc84b368cce8328b4b49ea5ecf1c5fa040300)
2024-03-30 07:17:32 +01:00
Paweł Bogusławski ade559edb7
Adjust VS Code debug filename match in .gitignore (#30158)
(cherry picked from commit 9585e19bb4386691760f741e23fba56cbfca8afb)
2024-03-30 07:17:32 +01:00
Kemal Zebari 23676bfea7
Prevent re-review and dismiss review actions on closed and merged PRs (#30065)
Resolves #29965.

---
Manually tested this by:
- Following the
[installation](https://docs.gitea.com/next/installation/install-with-docker#basics)
guide (but built a local Docker image instead)
- Creating 2 users, one who is the `Owner` of a newly-created repository
and the other a `Collaborator`
- Had the `Collaborator` create a PR that the `Owner` reviews
- `Collaborator` resolves conversation and `Owner` merges PR

And with this change we see that we can no longer see re-request review
button for the `Owner`:

<img width="1351" alt="Screenshot 2024-03-25 at 12 39 18 AM"
src="https://github.com/go-gitea/gitea/assets/60799661/bcd9c579-3cf7-474f-a51e-b436fe1a39a4">

(cherry picked from commit 242b331260925e604150346e61329097d5731e77)
2024-03-30 07:17:32 +01:00
silverwind 3ccb0c2512
Render code tags in commit messages (#30146)
Extend https://github.com/go-gitea/gitea/pull/21432 to commit messages.
Color is changed because the markup code block bg does not offer enough
contrast on varying backgrounds.

<img width="568" alt="Screenshot 2024-03-27 at 19 52 55"
src="https://github.com/go-gitea/gitea/assets/115237/ddc9307e-f32f-4e97-8b88-91f88ced2a36">
<img width="573" alt="Screenshot 2024-03-27 at 19 53 33"
src="https://github.com/go-gitea/gitea/assets/115237/14b30fd2-bf28-46b8-9e82-eb60a28f6bf2">
<img width="422" alt="Screenshot 2024-03-27 at 19 53 01"
src="https://github.com/go-gitea/gitea/assets/115237/a12136b5-c02b-460c-9830-f830542987ae">
<img width="397" alt="Screenshot 2024-03-27 at 19 53 27"
src="https://github.com/go-gitea/gitea/assets/115237/c9f05d81-c73e-468e-98e9-e5929bc0da3e">
<img width="333" alt="Screenshot 2024-03-27 at 19 53 07"
src="https://github.com/go-gitea/gitea/assets/115237/06b5a9f9-f95d-46b6-8c57-df0b02555652">
<img width="279" alt="Screenshot 2024-03-27 at 19 53 21"
src="https://github.com/go-gitea/gitea/assets/115237/b06a0afc-ddd8-48ae-b557-a6dc47802e68">

(cherry picked from commit e40fc75bac65933f2ed3de8fbc5fb336195b59f5)
2024-03-30 07:17:32 +01:00
Yarden Shoham ca1c90dc83
Bump `@github/relative-time-element` to v4.4.0 (#30154)
I tested and all timestamps work as before.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit eca4c485343069fc3e59f0dba7823cc13b5ab1d8)
2024-03-30 07:17:32 +01:00
silverwind bcfb7e0356
Migrate font-family to tailwind (#30118)
Enable us to use tailwind's
[`font-family`](https://tailwindcss.com/docs/font-family) classes as
well as remove `gt-mono` in favor of `tw-font-mono`. I also merged the
"compensation" to one selector, previously this was two different values
0.9em and 0.95em. I did not declare a `serif` font because I don't think
there will ever be a use case for those. Command ran:

```sh
perl -p -i -e 's#gt-mono#tw-font-mono#g' web_src/js/**/* templates/**/*

(cherry picked from commit 226a82a9396dc94f362ba27bd1c9318630df74b4)
2024-03-30 07:17:32 +01:00
YR Chen 2813425488
Move from `max( id )` to `max( index )` for latest commit statuses (#30076)
This PR replaces the use of `max( id )`, and instead using ``max(
`index` )`` for determining the latest commit status. Building business
logic over an `auto_increment` primary key like `id` is risky and
there’re already plenty of discussions on the Internet.

There‘s no guarantee for `auto_increment` values to be monotonic,
especially upon failures or with a cluster. In the specific case, we met
the problem of commit statuses being outdated when using TiDB as the
database. As [being
documented](https://docs.pingcap.com/tidb/stable/auto-increment),
`auto_increment` values assigned to an `insert` statement will only be
monotonic on a per server (node) basis.

Closes #30074.

(cherry picked from commit 7443a10fc3d722d3326a0cb7b15b208f907c72d7)
2024-03-30 07:17:31 +01:00
delvh 06645e7d46
Remember login for a month by default (#30150)
Previously, the default was a week.
As most instances don't set the setting, this leads to a bad user
experience by default.

## ⚠️ Breaking

If your instance requires a high level of security,
you may want to set `[security].LOGIN_REMEMBER_DAYS` so that logins are
not valid as long.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit 0d5abe3454c73f11d90d2809af0949a0e0636c22)
2024-03-30 07:17:31 +01:00
silverwind 47c61f909c
Drag-and-drop improvements for projects and issue pins (#29875)
1. Add "grabbing" cursor while dragging items:

![](https://github.com/go-gitea/gitea/assets/115237/c60845ff-7544-4215-aeaa-408e8c4ef03a)

2. Make project board only drag via their header, not via their whole
body.

![](https://github.com/go-gitea/gitea/assets/115237/62c27f3d-993a-481d-9cc3-b6226b4c5d61)

3. Fix some cursor problems in projects
4. Move shared options into `createSortable`.

(cherry picked from commit 7fda109aba6cd077343edef086b2f2ff60124f78)
2024-03-30 07:17:31 +01:00
silverwind c5ac296cd9
Fix table alignment classes (#30144)
Fixes https://github.com/go-gitea/gitea/issues/30142, regression from
https://github.com/go-gitea/gitea/pull/30047. I searched the codebase
and only `bottom aligned` was definitely not in use so I removed it.

(cherry picked from commit b08c7afe5f60075ed62a5ffe034b88624983d007)
2024-03-30 07:17:31 +01:00
Denys Konovalov 8ffb9c6fb1
Add default board to new projects, remove uncategorized pseudo-board (#29874)
On creation of an empty project (no template) a default board will be
created instead of falling back to the uneditable pseudo-board.

Every project now has to have exactly one default boards. As a
consequence, you cannot unset a board as default, instead you have to
set another board as default. Existing projects will be modified using a
cron job, additionally this check will run every midnight by default.

Deleting the default board is not allowed, you have to set another board
as default to do it.

Fixes #29873
Fixes #14679 along the way
Fixes #29853

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit e5160185ed65fd1c2bcb2fc7dc7e0b5514ddb299)

Conflicts:
	options/locale/locale_en-US.ini
	trivial conflict because Forgejo strings do not have
	surrounding double quotes
2024-03-30 07:17:31 +01:00
Lunny Xiao b019ecce89
Do some performance optimize for issues list and view issue/pull (#29515) (migration only)
Refs: https://codeberg.org/forgejo/forgejo/pulls/2679#issuecomment-1720941
2024-03-30 07:17:31 +01:00
silverwind d67e7ae25a
Fix loading spinner on ContextPopup (#30145)
Fix regression from https://github.com/go-gitea/gitea/pull/26670. Here
with simulated delay:

![](https://github.com/go-gitea/gitea/assets/115237/9de5a136-c8a6-4d69-adc7-07e1184e3311)

(cherry picked from commit 4eb86d68233241d53cff1009ecff17ac35efccd4)
2024-03-30 07:17:31 +01:00
silverwind 8d2b764607
Fix download buttons on branches page (#30147)
Fixes https://github.com/go-gitea/gitea/issues/30143, regression from
https://github.com/go-gitea/gitea/pull/29920.

We have `.button` on the repo page, but on the branch page it's a
`.btn`. Eventually we should find a solution to have a single button
class but until then this solution should be acceptable.

(cherry picked from commit c85619b82d19a928cb219eba3f38473928b29b0c)
2024-03-30 07:17:31 +01:00
wxiaoguang ea4755be6d
Relax generic package filename restrictions (#30135)
Now, the chars `=:;()[]{}~!@#$%^ &` are possible as well
Fixes #30134

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 1ad48f781eb0681561b083b49dfeff84ba51f2fe)
2024-03-30 07:17:31 +01:00
Yarden Shoham 708fdf2da9
Remove jQuery class from the common admin functions (#30137)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the new authentication source form and the deletion of system
notices. They work as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 1551d73d3f95284965675b828e1eeceafa378437)
2024-03-30 07:17:31 +01:00
Yarden Shoham 36ee0745cc
Remove jQuery class from the reaction selector (#30138)
- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the reaction selector and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 1a71dbfb7881f65d39b689a5be26cc94afefb10f)
2024-03-30 07:17:31 +01:00
Yarden Shoham e10cae3862
Forbid jQuery `.attr` (#30116)
Use `.getAttribute`, `.setAttribute`, or `.removeAttribute` instead

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 34acd8e3767ec0898f90a74b64ac738d0ce05f0a)
2024-03-30 07:17:31 +01:00
wxiaoguang 94515b0db0
Refactor render (#30136)
(cherry picked from commit f1707f4562158853552d57394b8b1fea6df645b0)
2024-03-30 07:17:31 +01:00
HEREYUA 969df61926
Fix: Organization Interface Display Issue (#30133)
**Before**

![image](https://github.com/go-gitea/gitea/assets/37935145/88d04a4b-6dc5-4399-9813-2c339eae3722)

**After**

![image](https://github.com/go-gitea/gitea/assets/37935145/e97a64b8-ea24-4de7-992d-5928888872d0)

(cherry picked from commit 0262c66ba6c1d7488456269b2e56220bf6cf0b6f)
2024-03-30 07:17:31 +01:00
Yarden Shoham bdc3f7beb1
Remove jQuery `.attr` from the Fomantic dropdowns (#30114)
- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the dropdowns and they work as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 0922ce8191ae83834b89b59c5c504209a8a0558e)
2024-03-30 07:17:31 +01:00
Yarden Shoham b95a893b22
Remove jQuery `.attr` from the common admin functions (#30115)
- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested most of the functions and they work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit a190f68f1bf92554923a4adde50e5cbc637a2a2e)
2024-03-30 07:17:31 +01:00
Yarden Shoham 4249512c73
Remove jQuery from the create/rename branch modals (except Fomantic) (#30109)
- Switched to plain JavaScript
- Tested the create/rename branch modals' functionality and they work as
before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/ca53155e-856e-44ca-9852-12ff60065735)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 4efe7884a3c99235b39998472ea430bffe0799e5)
2024-03-30 07:17:31 +01:00
silverwind 8bc4c1c9b0
Remove fomantic label module (#30081)
Of note is the CSS has references to "floating label" and "transparent
label" but I could not find those anywhere in the code. They are related
to https://github.com/go-gitea/gitea/pull/3939, but I think these have
long been removed.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 643e6b09587a89dba1f6b58ae21e5d0e7cfd9776)

Conflicts:
	web_src/css/base.css
	trivial context conflict
2024-03-30 07:17:31 +01:00
HEREYUA b4e97d6881
Fix: The interface is broken when modifying code comments under mobile devices (#30125)
**Fix**: [#30123](https://github.com/go-gitea/gitea/issues/30123)

**Before**

![image](https://github.com/go-gitea/gitea/assets/37935145/2a186399-85b0-480a-b2f9-f4feffd9a8e2)

**After**

![image](https://github.com/go-gitea/gitea/assets/37935145/ce1ce3e4-3bbb-4a4b-b0e7-e7943a0774f2)

(cherry picked from commit 4640441a0e23e40bc9ad73ca60f8ade0f29950ee)
2024-03-30 07:17:31 +01:00
HEREYUA 8c2559a726
When the title in the issue has a value, set the text cursor at the end of the text. (#30090)
Fix:  [#25055](https://github.com/go-gitea/gitea/issues/25055)

Before

![image](https://github.com/go-gitea/gitea/assets/37935145/1b89cd7b-4fa3-49aa-9b5e-a8413add436e)

After

![image](https://github.com/go-gitea/gitea/assets/37935145/fa808f8d-d3ce-4245-a4fe-dd0282ba3fdf)

ps: I've noticed that we are gradually replacing jQuery, so I didn't use jQuery here.
(cherry picked from commit 1261dd6742fb7095e51c173ca4641477d81a3634)
2024-03-30 07:17:31 +01:00
yp05327 fa87a57b59
Load attachments for code comments (#30124)
Fix #30103

ps: comments has `LoadAttributes`, but maybe considering performance
problem, we don't call it.

(cherry picked from commit ce3c3512265df3b4940672be40065c4fb415ef95)
2024-03-30 07:17:31 +01:00
silverwind 3a7d05f1ac
Upgrade fabric to 6.0.0-beta20 (#30121)
Fixes https://github.com/go-gitea/gitea/issues/29326 because it includes
https://github.com/fabricjs/fabric.js/pull/9707.

(cherry picked from commit a9e5706696f7d593e281d33783877b7772e48e19)
2024-03-30 07:17:31 +01:00
silverwind 43db1e81c1
Fix click handler in job-step-summary (#30122)
Fix mistake from https://github.com/go-gitea/gitea/pull/29977 where the
click handler wasn't updated for the change with the `isExpandable`
function.

(cherry picked from commit 57539bcdc024110c890320e3e785bf3d6ad6df55)
2024-03-30 07:17:31 +01:00
Yarden Shoham 544e66ec3a
Remove jQuery `.attr` from the Fomantic modal cancel buttons (#30113)
- Switched from jQuery `attr` to plain javascript `setAttribute`
- Tested the modals and they work as before

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit f47e00d9d3c3bd58b5944a29c4ff5cec0357520a)
2024-03-30 07:17:30 +01:00
Yarden Shoham 0cf308107e
Remove jQuery `.attr` from the code comments (#30112)
- Switched from jQuery `attr` to plain javascript `getAttribute`
- Tested the code comments and they work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 5687aca4fc9aef44e1fb5af655b2320d18583dbd)
2024-03-30 07:17:30 +01:00
Yarden Shoham 95024f1486
Remove jQuery calls that have no effect on `showElem` and `hideElem` (#30110)
There's no need to initialize a jQuery object with a CSS selector when
we can pass the CSS selector directly.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit a1f11e2e33f20409eac65b2d0e9a7cd7c767eb72)
2024-03-30 07:17:30 +01:00
Yarden Shoham 7e0dfa07ba
Remove jQuery `.attr` from the common issue page functions (#30083)
- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested most of the functions and they work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit e0b018706fa7703ef1759d9a75a1399383715808)
2024-03-30 07:17:30 +01:00
silverwind c7091d5476
Restore aligned grid column CSS (#30106)
Fixes #30097, regression from #29894.

(cherry picked from commit 30a561ce569fcb1dfc12edf658104a126281494d)
2024-03-30 07:17:30 +01:00
Lunny Xiao ef800a7ff1
Fix possible data race on tests (#30093)
(cherry picked from commit 0c8b828f5d5ac7eb8e251edfb1f2536ce1c30336)
2024-03-30 07:17:30 +01:00
silverwind 72a3a6fde7
Add svg linter and fix incorrect svgs (#30086)
Fixes https://github.com/go-gitea/gitea/issues/30082.

Adds a new linter that searches for non-existant SVG images in
templates. Output before the fix was:

```
$ make lint-templates
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-warning" not found, used in templates/devtest/flex-list.tmpl
SVG "octicon-markup" not found, used in templates/repo/diff/comment_form.tmpl
make: *** [Makefile:438: lint-templates] Error 1
```

<img width="306" alt="Screenshot 2024-03-25 at 23 31 05"
src="https://github.com/go-gitea/gitea/assets/115237/1052d1a9-bfec-4d5a-9cae-f895f78f7c93">

(cherry picked from commit 2ab5f05f40d93224f73e211e84de50a88a6ecf03)

Conflicts:
	.github/workflows/files-changed.yml
	.github/workflows/pull-compliance.yml
	do not exist in Forgejo and the Forgejo workflows
	already contain the changes
2024-03-30 07:17:30 +01:00
yp05327 e93e29822d
Fix duplicate migrated milestones (#30102)
Fix #17567

(cherry picked from commit 274bc00ca2c3bf5a734d74e47cc28fa8c41e3875)
2024-03-30 07:17:30 +01:00
silverwind f77922ce4e
Update JS any PY dependencies, remove workarounds (#30085)
- Update dependencies via `make update-js update-py svg`
- Remove `postcss` workaround -
https://github.com/postcss/postcss/issues/1914
- Remove `happy-dom` workaround -
https://github.com/capricorn86/happy-dom/pull/1365.
- Tested Katex and Asciinema

(cherry picked from commit c1ac72150885b327f56ea61273e27b16d6da5435)
2024-03-30 07:17:30 +01:00
yp05327 1360e31091
Fix gitea doctor will remove repo-avatar files when execute command `storage-archives` (#30094)
Fix #30037

(cherry picked from commit 9cf0f0bb040162509702ec9aaf7df6662ecc13b1)
2024-03-30 07:17:30 +01:00
silverwind 82e83d3076
Fix alignment in actions right view (#29979)
Fixes: https://github.com/go-gitea/gitea/issues/29974, Regression from
https://github.com/go-gitea/gitea/pull/29640.

Depending on the number of steps on the left side, the right side will
vertically expand. Collapse it with `align-self`.

<img width="1308" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9bcede9c-d869-4f3f-8a10-026c74c03f71">

(cherry picked from commit a4455d313e2c129dc9734292035b89339577174d)
2024-03-30 07:17:30 +01:00
crazeteam 3aa6f17e1e
Remove repetitive words (#30091)
remove repetitive words

Signed-off-by: crazeteam <lilujing@outlook.com>
(cherry picked from commit ecbc9cee2b69cd9707acb1e23ccbca048484c460)
2024-03-30 07:17:30 +01:00
silverwind 11765a8206
Fix table header text-align (#30084)
Fix regression from https://github.com/go-gitea/gitea/pull/30047.
Apparently tables have certain user-agent styles that center inside
`<th>` etc. Restored the original fomantic rules for these.

Before:
<img width="1332" alt="Screenshot 2024-03-25 at 21 59 33"
src="https://github.com/go-gitea/gitea/assets/115237/e06a5509-b505-4752-9b6e-91d5ed49f61d">

After:
<img width="1330" alt="Screenshot 2024-03-25 at 21 59 40"
src="https://github.com/go-gitea/gitea/assets/115237/6444817f-dd61-4a1e-a8b3-959c2780148d">

(cherry picked from commit dd75237c3492140140c7413d788bd961692048d8)
2024-03-30 07:17:30 +01:00
yp05327 eb696438fe
Fix panic for `fixBrokenRepoUnits16961` (#30068)
![image](https://github.com/go-gitea/gitea/assets/18380374/508b3ceb-f53d-4d3b-a781-97c1542af1cb)

(cherry picked from commit 08aec2c20adae8e6f04cac08566a8decd818e5cd)
2024-03-30 07:17:30 +01:00
silverwind faffda01e3
Enable eslint `space-before-function-paren` (#30078)
Anonymous are set to ignore as I [couldn't
decide](https://github.com/go-gitea/gitea/pull/30077#discussion_r1538117497).
No current violations.

Rule docs: https://eslint.style/rules/js/space-before-function-paren

(cherry picked from commit bcb151c220c3fa6003810e436acdda9cc0501e58)
2024-03-30 07:17:30 +01:00
Yarden Shoham e8c5406971
Remove jQuery `.attr` from the code line range selection (#30077)
- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the code line range selection and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit a9a5734185a1a2837cfae42de7b17cf41dbb218a)
2024-03-30 07:17:30 +01:00
yp05327 18caa53859
Add muted class to author name in repo commit list (#29989)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/f6b3728c-ed9a-4e47-8755-89373235dff2)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/272c85e3-620d-4758-ae4d-ad90b54e142c)

If repo is a mirror, external user's name will be white, but if user is
existed, then you will see blue names and white names together:

![image](https://github.com/go-gitea/gitea/assets/18380374/747622da-56e3-4162-b391-919787a8cee4)

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 13921569dd5f77ee7d8352d0036ff649b03e72c8)
2024-03-30 07:17:30 +01:00
silverwind c55e30ff13
Refactor all `.length === 0` patterns in JS (#30045)
This pattern comes of often during review, so let's fix it once and for
all. Did not test, but changes are trivial enough imho.

(cherry picked from commit 8fe26fb314f1710139728d9118b455fc6a16cce2)
2024-03-30 07:17:30 +01:00
silverwind c5745f9d24
Remove fomantic table module (#30047)
Big CSS module. I tested basic functionality on admin and commits table.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit f73d891fc4979cbd704d145f7e892f73d0eb5e39)
2024-03-30 07:17:30 +01:00
silverwind 67659c5d46
Fix menu buttons in issues and release (#30056)
Fix regression from https://github.com/go-gitea/gitea/pull/30033

These buttons had lost their border because `.ui.header` sets `none` but
`.ui.menu` has it, after the migration, the order of styles changed and
header won. I see no reason why those have the `header` class in first
place, besides for semantic meaning.

Before:
<img width="491" alt="Screenshot 2024-03-25 at 00 39 27"
src="https://github.com/go-gitea/gitea/assets/115237/fa1b7505-75cf-4854-a97f-db3c46f31e93">

After:
<img width="496" alt="Screenshot 2024-03-25 at 00 39 14"
src="https://github.com/go-gitea/gitea/assets/115237/8f6bdc07-9596-436b-8c82-9af283300004">

(cherry picked from commit 8717c1c2bef1afcc6b0bb2d84627b158b95836b0)
2024-03-30 07:17:30 +01:00
silverwind 553ef46226
Fix button hover border (#30048)
Fix regression from https://github.com/go-gitea/gitea/pull/30014. The
rule was to broad and affecting things like `primary` button
unintentionally.

(cherry picked from commit bbaf62589fe538be4afc86455d772360de80e7d8)
2024-03-30 07:17:30 +01:00
Jason Song 2c4e85421e
Fix misuse of `TxContext` (#30061)
Help #29999, or its tests cannot pass.

Also, add some comments to clarify the usage of `TxContext`.

I don't check all usages of `TxContext` because there are too many
(almost 140+). It's a better idea to replace them with `WithTx` instead
of checking them one by one. However, that may be another refactoring
PR.

(cherry picked from commit c6c4d66004c70b24abc8048b39b660b8361a0395)
2024-03-30 07:17:29 +01:00
Yarden Shoham 8e3e31a566
Remove jQuery `.attr` from the reaction selector (#30052)
- Switched from jQuery `attr` to plain javascript `getAttribute`
- Tested the reaction selector and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 2e31a2800e1112ee0ab5a8d3c66b0fba2e737870)
2024-03-30 07:17:29 +01:00
Yarden Shoham 8557c6ae43
Remove jQuery `.attr` from the ComboMarkdownEditor (#30051)
- Switched from jQuery `attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the markdown editor and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 428e05662f4f745fe7fef04ce9218a86aa4f1b6c)
2024-03-30 07:17:29 +01:00
Yarden Shoham e9b729fc46
Remove jQuery `.attr` from the label edit exclusive checkbox (#30053)
- Switched from jQuery `attr` to plain javascript `getAttribute`
- Tested the label edit exclusive checkbox and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit a7d0c5de4c82d8d206f6c5c51f012ee831502f67)
2024-03-30 07:17:29 +01:00
Yarden Shoham 91f8164012
Remove jQuery `.attr` from the repository topic bar (#30050)
- Switched from jQuery `.attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the repository topic bar. It works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 314cd1ec98b1ea015e7585d3f6f5d08218379399)
2024-03-30 07:17:29 +01:00
Lunny Xiao 9ca245ad96
Use db.ListOptions directly instead of Paginator interface to make it easier to use and fix performance of /pulls and /issues (#29990)
This PR uses `db.ListOptions` instead of `Paginor` to make the code
simpler.
And it also fixed the performance problem when viewing /pulls or
/issues. Before the counting in fact will also do the search.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 3f26fe2fa2c7141c9e622297e50a70f3e0003e4d)
2024-03-30 07:17:29 +01:00
silverwind 5016bc5d5c
Migrate `gt-hidden` to `tw-hidden` (#30046)
We have to define this one in helpers.css because tailwind only
generates a single class but certain things rely on this being
double-class. Command ran:

```sh
perl -p -i -e 's#gt-hidden#tw-hidden#g' web_src/js/**/* templates/**/* models/**/* web_src/css/**/*

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ec3d467f15a683b305ac165c3eba6683628dcb25)

Conflicts:
	templates/install.tmpl
	templates/repo/diff/conversation.tmpl
	templates/repo/issue/view_content/conversation.tmpl
	templates/repo/issue/view_content/sidebar.tmpl
	templates/repo/issue/view_title.tmpl

	resolved by prefering Forgejo version and applying the
	commands to all files
2024-03-30 07:17:29 +01:00
silverwind e28f4328b3
Forbid jQuery `is` and fix issues (#30016)
Tested all functionality.

---------

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 0a2f973de9b681a472c96bdfcd945978e88458d8)
2024-03-30 07:17:29 +01:00
silverwind c5eae64e06
Remove fomantic segment module (#30042)
Another CSS-only module. Also, I re-ordered the imports based on
[original fomantic
order](https://github.com/fomantic/Fomantic-UI/blob/2.8.7/src/semantic.less).

(cherry picked from commit 8d93cea2969730fc8f3bdeb3704a3b89db0bbcc0)
2024-03-30 07:17:29 +01:00
silverwind c82bef515e
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:

```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g'   {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g'   {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g'   {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g'   {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g'   {web_src/js,templates,routers,services}/**/*
```

(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)

Conflicts:
	routers/web/repo/view.go
	templates/base/head_navbar.tmpl
	templates/repo/code/recently_pushed_new_branches.tmpl
	templates/repo/diff/box.tmpl
	templates/repo/diff/compare.tmpl
	templates/repo/diff/conversation.tmpl
	templates/repo/header.tmpl
	templates/repo/issue/filter_list.tmpl
	templates/repo/issue/view_content/conversation.tmpl
	templates/repo/issue/view_content/sidebar.tmpl
	templates/repo/settings/options.tmpl
	templates/repo/view_file.tmpl
	templates/shared/user/blocked_users.tmpl
	templates/status/500.tmpl
	web_src/js/components/DashboardRepoList.vue
	resolved by prefering Forgejo version and applying the
	commands to all files
2024-03-30 07:17:29 +01:00
Renovate Bot 0cb9ea64a6 Update module github.com/opencontainers/image-spec to v1.1.0 2024-03-30 06:05:12 +00:00
Renovate Bot a517e4aeb1 Update module github.com/minio/minio-go/v7 to v7.0.69 2024-03-30 06:05:07 +00:00
Earl Warren ade8fc51b7 Merge pull request '[FEAT] Remove add organization on dashboard switcher' (#2895) from gusted/forgejo-rm-org into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2895
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 06:04:22 +00:00
Earl Warren 6dade3b438 Merge pull request '[BRANDING] Move docs.gitea.com to forgejo.org/docs' (#2894) from gusted/forgejo-docs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2894
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 06:01:20 +00:00
Earl Warren 62359600b9 Merge pull request '[CHORE] Cleanup dependency' (#2890) from gusted/forgejo-rm-dep into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2890
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-30 05:45:54 +00:00
Gusted 3ccc7b22d8
[FEAT] Remove add organization on dashboard switcher
- Similair to #2593 that removed subtle add button in a place where it's
strictly not needed.
- Remove the "Add organization" item in the 'context dashboard switcher' dropdown.
2024-03-30 03:58:50 +01:00
Gusted 6c55347377
[BRANDING] Move docs.gitea.com to forgejo.org/docs
- Replace links from docs.gitea.com with forgejo.org/docs for those
where the relevant links are available on the Forgejo documentation.
- Resolves #2892
2024-03-30 01:56:25 +01:00
Gusted f579bde69d
[CHORE] Cleanup dependency
- Remove `gitea.com/lunny/dingtalk_webhook` as dependency, we only use
two structs which are small enough to be recreated in Forgejo and don't
need to rely on the dependency.
- Existing tests (thanks @oliverpool) prove that this has no effect.
2024-03-30 00:01:42 +01:00
Gusted 91b8874acf Merge pull request '[I18N] make merge-locales & build/merge-forgejo-locales.go are noop' (#2864) from earl-warren/forgejo:wip-backward-locales into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2864
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-29 18:51:45 +00:00
Gusted f24478bf82 Merge pull request '[THEME] Revert darker tone on labels' (#2881) from gusted/forgejo-theme-label into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2881
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-29 17:21:18 +00:00
Earl Warren 3d638cc161 Merge pull request '[BUG] Don't delete inactive emails explicitly' (#2880) from gusted/forgejo-inactive-email into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2880
Reviewed-by: Otto <otto@codeberg.org>
2024-03-29 15:37:09 +00:00
Gusted 722e0dbac1
[THEME] Revert darker tone on labels
- In #1782 I made these darker to make some elements look good, but this
variable is used quite broadly which causes some issues. So reverting
the darker tone to the more light tone (which is identical with what's
the behavior before #1782 was merged).
- Resolves https://codeberg.org/forgejo/forgejo/issues/2879
2024-03-29 15:38:31 +01:00
Gusted 190383dbf8
[BUG] Don't delete inactive emails explicitly
- `user_model.DeleteInactiveEmailAddresses` related code was added in
Gogs as part to delete inactive users, however since then the related
code to delete users has changed and this code now already delete email
addresses of the user, it's therefore not needed anymore to
`DeleteInactiveEmailAddresses`.
- The call to `DeleteInactiveEmailAddresses` can actually cause issues.
As the associated user might not have been deleted, because it
was not older than the specified `olderThan` argument. Therefore causing
a database inconsistency and lead to internal server errors if the user
tries to activate their account.
- Adds unit test to verify correct behavior (fails without this patch).
2024-03-29 15:14:09 +01:00
0ko 39b53ef56f Provide plural support for issue participants 2024-03-29 19:07:02 +05:00
Earl Warren a4d8d04401 Merge pull request '[BUG] Allow to exclude files in dump' (#2876) from gusted/forgejo-dump into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2876
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-29 13:45:26 +00:00
Earl Warren e043b54884 Merge pull request '[THEME] Increase contrast of code block' (#2874) from gusted/forgejo-codeblock into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2874
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-29 12:56:48 +00:00
Gusted 92aaa14117
[BUG] Allow to exclude files in dump
- Move the skip path check outside the `file.IsDir()` condition, so it
can be used to skip files.
- Add unit tests.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1397
- Ref: https://codeberg.org/forgejo/forgejo/pulls/1438
2024-03-29 13:25:11 +01:00
Earl Warren 6548f8feae Merge pull request '[Port] gitea#29999: Fix Add/Remove WIP on pull request title failure' (#2873) from gusted/forgejo-port-gitea-prs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2873
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-29 12:12:19 +00:00
Gusted 8880005939
[THEME] Increase contrast of code block
- Make the background color of code blocks a bit darker, so they are
more distinctive when used in containers that use `--color-box-body` as
background color (for example, comments).
- Ref: https://codeberg.org/Codeberg/Community/issues/1523
2024-03-29 12:55:37 +01:00
Lunny Xiao 3ba127c618
[Port] gitea#29999: Fix Add/Remove WIP on pull request title failure
Fix #29997

---

Conflict resolution:
- Use Forgejo's user blocking feature (services/issue/issue.go)
- Trivial (tests/integration/pull_review_test.go)
Ref: https://codeberg.org/forgejo/forgejo/pulls/2872
(cherry picked from commit 475b6e839caa88994318f905f0965c3b418f876a)
2024-03-29 12:21:51 +01:00
Earl Warren 22315117ac Merge pull request '[REFACTOR] PKT protocol' (#2868) from gusted/forgejo-refactor-pkt into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2868
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-29 07:40:00 +00:00
Earl Warren fc0da11f10 Merge pull request '[BUG] Use correct format for attr-check error log' (#2866) from gusted/forgejo-error-fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2866
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-29 07:31:09 +00:00
Gusted 2c8bcc163e
[REFACTOR] PKT protocol
- Use `Fprintf` to convert to hex and do padding. Simplifies the code.
- Use `Read()` and `io.ReadFull` instead of `ReadByte()`. Should improve
performance and allows for cleaner code.
- s/pktLineTypeUnknow/pktLineTypeUnknown.
- Disallow empty Pkt line per the specification.
- Disallow too large Pkt line per the specification.
- Add unit tests.
2024-03-29 00:53:04 +01:00
Gusted 79b7089360
[FEAT] Configure if protected branch rule should apply to admins
- Currently protected branch rules do not apply to admins, however in
some cases (like in the case of Forgejo project) you might also want to
apply these rules to admins to avoid accidental merges.
- Add new option to configure this on a per-rule basis.
- Adds integration tests.
- Resolves #65
2024-03-29 00:21:49 +01:00
Gusted 1ebf4abddc
[BUG] Use correct format
- `%w` is to wrap errors, but can only be used by `fmt.Errorf`. Instead
use `%v` to display the error.
- Regression of #2763

Before:
[E] failed to run attr-check. Error: %!w(*exec.ExitError=&{0xc006568e28 []})
Stderr: fatal: this operation must be run in a work tree

After:
[E] failed to run attr-check. Error: exit status 128
Stderr: fatal: this operation must be run in a work tree
2024-03-28 22:27:53 +01:00
Earl Warren 6647e4d53f
[I18N] make merge-locales & build/merge-forgejo-locales.go are noop
Instead of failing or do things that could be damaging, this script
prints a deprecation notice. It fixes the unnecessary breaking
change introduced in `[I18n] tooling and process`.

https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/version-management/forgejo/default.nix#L80

$ make merge-locales
NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY
$ go run build/merge-forgejo-locales.go
NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY

Also remove the build/crowdin-to-weblate.sh script that was never
needed.
2024-03-28 18:02:55 +01:00
Earl Warren 6bf6a473cf Merge pull request '[BUG] Do not allow deletion of internal references' (#2834) from gusted/forgejo-internal-reference into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2834
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 16:53:53 +00:00
Earl Warren 340aa1960e Merge pull request '[Port] gitea#29842: Notify reviewers added via CODEOWNERS' (#2855) from gusted/forgejo-port-29842 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2855
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 16:40:17 +00:00
Earl Warren fc72f30bdc Merge pull request 'Port CSS commits' (#2863) from gusted/forgejo-port-css into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2863
2024-03-28 16:16:43 +00:00
silverwind 510252613f
[Port] gitea#30036: Remove fomantic container module
Small CSS module. There was a ordering conflict between `.ui.menu` and
`.ui.container` which I've solved by adding the `.ui.menu` rule into
base.

Co-authored-by: Giteabot <teabot@gitea.io>

---

Conflict resolution: None
Ref: https://codeberg.org/forgejo/forgejo/issues/2776
(cherry picked from commit 2d281704de8c5b67592dd7f9362620927230ef2b)
2024-03-28 16:43:14 +01:00
silverwind 4834583f02
[Port] gitea#30033: Remove fomantic header module
Likely still a few useless classes left, but I think I at least don't
have missed any.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>

---

Conflict resolution: Trivial
Ref: https://codeberg.org/forgejo/forgejo/issues/2776
(cherry picked from commit f22fe4e1944d8084dec7c04f064a8e782fca94d4)
2024-03-28 16:43:14 +01:00
silverwind a579a0f318
[Port] gitea#30014: Various code view improvements
1. Restore missing styles for message close icon
2. Move `code-line-button` so that it does not go off-screen on small
viewports
3. Make `code-line-button` look and behave like other buttons
4. Make `code-line-button` work in blame
5. Make the active selection span the whole line, not just the code part
6. Tweak colors, make dark theme code bg darker, make line numbers same
color in diff and file view.
7. Move code background to parent, fixing border radius and other
problems
8. Enable code wrap in blame
9. Improve blame responsiveness
10. Remove `--color-code-sidebar-bg` in blame, now it uses same
background as code
11. Rename `--color-active-line` to `--color-highlight-bg`
12. Add `--color-highlight-bg`
13. Fix button group borders on hover and border-right on last button.

<img width="1343" alt="Screenshot 2024-03-23 at 22 34 13"
src="https://github.com/go-gitea/gitea/assets/115237/fcbb919f-5dc3-43f0-97f6-870d6f412554">
<img width="1334" alt="Screenshot 2024-03-23 at 22 34 26"
src="https://github.com/go-gitea/gitea/assets/115237/ca44c3b7-4328-4645-ba49-b0dc6a5ac06d">

<img width="1338" alt="Screenshot 2024-03-23 at 22 34 57"
src="https://github.com/go-gitea/gitea/assets/115237/00eb0b5a-1ec7-4669-a94a-4602b9d1c1ac">
<img width="1337" alt="Screenshot 2024-03-23 at 22 34 42"
src="https://github.com/go-gitea/gitea/assets/115237/752edc4a-064f-413c-9dff-c086187fcd85">

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

---

Conflict resolution: Trivial.
Ref: https://codeberg.org/forgejo/forgejo/issues/2776
(cherry picked from commit db01bf6cc88a8a7b5132b9306b3af1649566b10f)
2024-03-28 16:43:14 +01:00
silverwind 1ee494a045
[Port] gitea#29982 Introduce `.secondary-nav` and handle `.page-content` spacing universally
Fixes: https://github.com/go-gitea/gitea/issues/29981. Introduce
`.secondary-nav` as a universal way for styling and margin adjustments
inside `.page-content`.

If the first child of `.page-content` is `.secondary-nav`, we add margin
below it, otherwise we add padding to the first child. Notable changes:

- `--color-header-wrapper` is replaced with `--color-secondary-nav-bg`.
- `navbar` class is removed.

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

---

Conflict resolution: Trivial conflict & changed selector to reflect new
classes.
Ref: https://codeberg.org/forgejo/forgejo/issues/2776
(cherry picked from commit 3ccda41a539b8ba7841919ee12dc2877ddc03818)
2024-03-28 16:43:09 +01:00
Earl Warren 869795a530
[RELEASE] GITEA_VERSION is a fallback for FORGEJO_VERSION
Existing Forgejo packages may rely on setting GITEA_VERSION to specify
the version to build if:

* they do not build from the git repository with the proper tag
* they build from a source tarbal that does not have a VERSION file

With 7.0 the logic of setting the version was modified in the
`[RELEASE] Gitea version is for interoperability only` commit and
ignores this variable which creates an unecessary breaking change.

If GITEA_VERSION is set, the versions will be set on 7.0 exactly as
they would have with version before and included 1.21.

* If GITEA_VERSION is not set, all versions are the same
* If GITEA_VERSION is set, there is a distinction between the version
  set in the binary are returned by the Gitea API and the
  version returned by the Forgejo API which includes metadata.

Before:

$ make GITEA_VERSION=7.0.0 show-version-full
7.0.0-dev-1809-cd6fa771ab+gitea-1.22.0
$ make GITEA_VERSION=7.0.0 show-version-api
7.0.0-dev-1809-cd6fa771ab+gitea-1.22.0

After:

$ make GITEA_VERSION=7.0.0 show-version-full
7.0.0
$ make GITEA_VERSION=7.0.0 show-version-api
7.0.0+gitea-1.22.0
2024-03-28 16:18:52 +01:00
silverwind 18d13000e9
[PORT] gitea#29831: Prevent layout shift in `<overflow-menu>` items
There is a small layout shift in when active tab changes. Notice how the
actions SVG is unstable:

![](https://github.com/go-gitea/gitea/assets/115237/a6928e89-5d47-4a91-8f36-1fa22fddbce7)

This is because the active item with bold text is wider then the
inactive one. I have applied [this
trick](https://stackoverflow.com/a/32570813/808699) to prevent this
layout shift. It's only active inside `<overflow-menu>` because I wanted
to avoid changing HTML and doing it in regular JS would cause a flicker.
I don't expect us to introduce other similar menus without
`<overflow-menu>`, so that place is likely fine.

![after](https://github.com/go-gitea/gitea/assets/115237/d6089924-8de6-4ee0-8db4-15f16069a131)

I also changed the weight from 500 to 600, slightly reduced horizontal
padding, merged some tab-bar related CSS rules and a added a small
margin below repo-header so it does not look so crammed against the
buttons on top.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

---

Conflict resolution: Moved an `:focus` selector to the new CSS rule.
Ref: https://codeberg.org/forgejo/forgejo/issues/2776
(cherry picked from commit 99d7ef50917e8d61798715e1b0b3dc1a99709f27)
2024-03-28 16:09:14 +01:00
Gusted a11116602e Merge pull request '[Port] gitea#29930: Move notifications to a standalone file' (#2856) from gusted/forgejo-port-29930 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2856
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 15:05:35 +00:00
0ko cbd067e759 Fix accessibility and translatability of repo explore counters
Progression of: 9e69ef9c51
Regression of: 65e190ae8b (diff-8d94e33cfe70fa6443d059b9c34e3f8064514816)
2024-03-28 19:48:56 +05:00
Earl Warren 168c56d7d4 Merge pull request 'Update module github.com/gliderlabs/ssh to v0.3.7' (#2806) from renovate/github.com-gliderlabs-ssh-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2806
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 14:01:48 +00:00
Jimmy Praet 003881b06d
[Port] gitea#29842: Notify reviewers added via CODEOWNERS
Fixes https://github.com/go-gitea/gitea/issues/28297

This PR also fixed a problem that it needs a database transaction when
removing the WIP title.

---

Resolves #2771
Also partially ports gitea#29783

(cherry picked from commit 17d7ab5ad4ce3d0fbc1251572c22687c237a30b1)
2024-03-28 14:58:39 +01:00
Lunny Xiao 6b49276f97
[Port] gitea#29930: Move notifications to a standalone file
There is no code change. Just move notification list related
structs/functions from one file to another.

---

Resolves #2772

Simply move the moderation code to the new function (which wasn't
changed).

(cherry picked from commit b25eec41eb4d7058be808daefd6fd47eed61c7d3)
2024-03-28 14:21:42 +01:00
Gusted 33d6b5b11a Merge pull request '[REFACTOR] webhook templates simplification' (#2853) from webhook_5_template_simplification into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2853
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-28 12:52:07 +00:00
Gusted c2e7f1a0be Merge pull request 'Replace IfZero with cmp.Or' (#2854) from snematoda/revert-ifzero into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2854
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-28 12:43:32 +00:00
Gusted 42b97fd836 Merge pull request '[COSMETIC] unify the wording of the Forgejo migration comments' (#2849) from earl-warren/forgejo:wip-migration-comments into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2849
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-28 12:36:57 +00:00
Shiny Nematoda db7e6948a1 replace IfZero with cmp.Or 2024-03-28 11:58:26 +00:00
Shiny Nematoda a38260aed9 Revert "cherry pick only `IfZero` from (#29755)"
This reverts commit 82851f429a.
2024-03-28 11:46:41 +00:00
Earl Warren 1684f0e5bf Merge pull request '[PERFORMANCE] git check-attr on bare repo if supported' (#2763) from oliverpool/forgejo:check_attr_bare into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2763
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 11:14:52 +00:00
Earl Warren ba458530aa
[COSMETIC] unify the wording of the Forgejo migration comments 2024-03-28 12:08:43 +01:00
Earl Warren 26f6a3b578 Merge pull request 'Revert "avoid superfluous synchronized pull_request run when opening a PR"' (#2848) from earl-warren/forgejo:wip-revert-bad-race-fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2848
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-28 10:38:55 +00:00
oliverpool be6434662a [REFACTOR] webhook/new remove redundant if 2024-03-28 11:13:37 +01:00
oliverpool 9558b18d22 [REFACTOR] webhook move templates 2024-03-28 11:13:37 +01:00
oliverpool 3c81f7478c [PERFORMANCE] git check-attr on bare repo if supported 2024-03-28 10:52:51 +01:00
Earl Warren 327deee2d7 Merge pull request '[PORT] Support repo code search without setting up an indexer (gitea#29998)' (#2813) from snematoda/port-git-grep into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2813
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 08:15:47 +00:00
wxiaoguang eb21829800 Fix git grep search limit, add test (#30071)
Fix #30069
2024-03-28 07:48:35 +00:00
Earl Warren ceea9c4334
Revert "avoid superfluous synchronized pull_request run when opening a PR"
The fix against the race incorrectly assumes the sha of the commit being
pushed belongs to the base repository. It finds the highest possible
pull request ID from the head repository instead of looking it up in
the base repository.

Figuring out if a PR was created in the future based on the highest
index of the base repository would require collecting all of them
because there is no way to know in advance which repository may be
involved in the race.

Fixing this race can be done either by:

* Introducing a new field in the pull_request table https://codeberg.org/forgejo/forgejo/pulls/2842
  which feels more like a hack than a real solution
* Refactoring the logic
  which would be a significant undertaking

The race has been in the codebase for a very long time and manifests
itself in the CI, when events happen in quick succession. The only
concrete manifestation was however fixed by https://codeberg.org/forgejo/forgejo/issues/2009

Since this race now only exists in theory and not in practice, let's
revert this bugous commit until a proper solution is implemented.

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

This reverts commit 036f1eddc5.

Conflicts:
	services/pull/pull.go
2024-03-28 07:08:17 +01:00
Earl Warren 57e7650d70 Merge pull request '[REFACTOR] webhook endpoint logic cleanup' (#2847) from oliverpool/forgejo:webhook_4_cleanup_endpoints into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2847
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-28 05:46:00 +00:00
Shiny Nematoda 82851f429a cherry pick only `IfZero` from (#29755)
original commit:
  Author: wxiaoguang <wxiaoguang@gmail.com>
  Date:   Thu Mar 14 09:10:51 2024 +0800

  Add test for webhook (#29755)

  Follow #29690
2024-03-28 05:21:52 +00:00
wxiaoguang 1e7a6483b8 Support repo code search without setting up an indexer (#29998)
By using git's ability, end users (especially small instance users) do
not need to enable the indexer, they could also benefit from the code
searching feature.

Fix #29996

![image](https://github.com/go-gitea/gitea/assets/2114189/11b7e458-88a4-480d-b4d7-72ee59406dd1)

![image](https://github.com/go-gitea/gitea/assets/2114189/0fe777d5-c95c-4288-a818-0427680805b6)

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-03-28 05:16:51 +00:00
Shiny Nematoda 488a99fb56 Reverts commits releated to git-grep
This reverts commit
	51fb6f3983
	71a72d8a22
2024-03-28 05:09:41 +00:00
Mai-Lapyst 6e98bacbbd
Format code 2024-03-28 05:42:25 +01:00
Mai-Lapyst 16a8658878
Update test 2024-03-28 04:20:13 +01:00
oliverpool 5785ae72c7 [TESTS] prevent overriding testlogger when calling mainApp 2024-03-27 22:54:13 +01:00
oliverpool bc36f85b5f [REFACTOR] webhook repo naming consistency 2024-03-27 22:26:55 +01:00
oliverpool 9c3611ec50 [REFACTOR] simplify checkHookType 2024-03-27 22:26:55 +01:00
oliverpool c0dd92e9c5 [REFACTOR] webhook move edit endpoints 2024-03-27 22:26:55 +01:00
oliverpool 635230ca5d [TESTS] webhook forms keep submitted data when invalid 2024-03-27 22:26:55 +01:00
oliverpool 1e050d01c0 [REFACTOR] merge once-called functions 2024-03-27 22:26:54 +01:00
Mai-Lapyst 7e0014dd13
Fix formating & remove commented out code 2024-03-27 18:43:55 +01:00
Gusted 9d82059840
[BUG] Do not allow deletion of internal references
- Currently it's possible to modify remote references such as
`refs/pull/<idx>/head` and `refs/heads/<branch>`.
- Disallow that the pull request reference is deleted, as this should
not be at the control of the user. Doing so would result in
inconsistencies within Forgejo and lead to internal server errors when
trying access the pull request, this action should be reserved for
Forgejo.
- Do this by utilizing the `update` hook, which process each reference
individually and therefore allow to only skip deleting internal
references and still allow other modifications that is being done in
the same push.
- Ref: https://codeberg.org/Codeberg/Community/issues/1517
2024-03-27 18:27:00 +01:00
Mai-Lapyst 4c7cb0a5d2
Close git.Repository when GetRepoFileBlob returns 2024-03-27 18:25:37 +01:00
Earl Warren 883cb2d542 Merge pull request '[REFACTOR] webhook settings: merge Create/Update endpoints' (#2843) from oliverpool/forgejo:webhook_3_endpoint_merge into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2843
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-27 17:21:09 +00:00
oliverpool 4ab341e971 [REFACTOR] webhook gogs endpoint 2024-03-27 15:38:39 +01:00
oliverpool dce754cde1 [REFACTOR] webhook packagist endpoint 2024-03-27 15:38:39 +01:00
oliverpool 36a1d37532 [REFACTOR] webhook wechatwork endpoint 2024-03-27 15:38:39 +01:00
oliverpool 6b719f08d0 [REFACTOR] webhook feishu endpoint 2024-03-27 15:38:39 +01:00
oliverpool 97f0ad49ff [REFACTOR] webhook msteams endpoint 2024-03-27 15:38:39 +01:00
oliverpool 46b71ec709 [REFACTOR] webhook telegram endpoint 2024-03-27 15:38:39 +01:00
oliverpool 9dff719523 [REFACTOR] webhook dingtalk endpoint 2024-03-27 15:38:39 +01:00
oliverpool c3f8e6ed60 [REFACTOR] webhook discord endpoint 2024-03-27 15:38:39 +01:00
oliverpool 6f00821f3d [REFACTOR] webhook slack endpoints 2024-03-27 15:38:38 +01:00
oliverpool 7e0965b02c [REFACTOR] webhook forgejo/gitea endpoints 2024-03-27 15:38:38 +01:00
oliverpool 8dfbbfef07 [REFACTOR] webhook matrix endpoints 2024-03-27 15:38:38 +01:00
Earl Warren e41e18f87e Merge pull request '[REFACTOR] webhook.Handler interface' (#2758) from oliverpool/forgejo:webhook_2_interface into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2758
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-27 13:45:04 +00:00
Earl Warren 50de5046d7 Merge pull request 'Improve localization of repo summary' (#2756) from 0ko/forgejo:i18n-repository-summary into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2756
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-27 13:35:54 +00:00
Earl Warren ee6c238f03 Merge pull request '[port] gitea#29969: repo header/list refactor' (#2839) from algernon/forgejo:gitea/port/29969/refactor-repo-header-list into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2839
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-27 10:06:24 +00:00
Earl Warren 82ecfd7481 Merge pull request 'models/forgejo_migrations: Gitea tables migration ID' (#2838) from earl-warren/forgejo:wip-forgejo-migrations-index into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2838
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-27 10:03:20 +00:00
Gergely Nagy 2692ee3791
Further consistency in the repo header
The recent refactor imported from Gitea made the Fork counter/button in
the repo header appear as icon only on mobile, but left the Star & Watch
buttons unchanged, so they appeared with text. That resulted in the
mobile view looking a bit awkward, with half the widgets (rss & fork) as
icon-only, while the other half (star & watch) with both icon and text.

This changes the other two in the same way: to appear without text on
mobile.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-27 09:33:06 +01:00
Earl Warren d6eab2b586
models/forgejo_migrations: Gitea tables migration ID
Sync() will act on the given struct and the ID field should be exactly
as it is in the Gitea migration when a Gitea table is modified.
2024-03-27 09:27:32 +01:00
wxiaoguang 65e190ae8b
Refactor repo header/list (#29969)
1. Use general "mobile-only" and "not-mobile" CSS styles, remove some`@media (max-width: 767.98px)` tricks
2. Use `CountFmt` for repo list, just like the repo header (and it matches GitHub, to avoid big numbers bloat the page)

(cherry picked from commit bfa160fc98a23923b6ce1cd4d99e8970d937d6ec)

Conflicts:
	templates/explore/repo_list.tmpl
	templates/repo/header.tmpl
	web_src/css/repo/header.css

 Resolved the template conflicts by porting the changes to Forgejo (in
 case of `header.tmpl`, applying the changes in `header_fork.tmpl). In
 case of the CSS change, opted to take Gitea's version and drop the
 entire media query.
2024-03-27 09:22:24 +01:00
Renovate Bot e3570ec3e3 Update ghcr.io/visualon/renovate Docker tag to v37.272.0 2024-03-27 07:32:23 +00:00
Earl Warren d5a3f14063 Merge pull request 'Update module github.com/klauspost/compress to v1.17.7' (#2824) from renovate/github.com-klauspost-compress-1.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2824
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-27 06:34:48 +00:00
Earl Warren ac672fc3ff Merge pull request '[ACTIONS] port scheduled actions from Gitea' (#2826) from earl-warren/forgejo:wip-gitea-schedule into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2826
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-27 06:23:56 +00:00
Leo Heitmann Ruiz c340e02078 "Plaintext" => "Text" 2024-03-26 22:25:34 +01:00
Leo Heitmann Ruiz 4f43b7338b "Plaintext" => "Text" 2024-03-26 22:01:53 +01:00
Earl Warren 8339b24d61 Merge pull request '[gitea] week 13 cherry-pick' (#2769) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2769
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-26 18:45:57 +00:00
Codeberg Translate 3015788523 [I18N] Translations update from Weblate (#2830)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2830
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-03-26 18:38:16 +00:00
Gusted 828d0f8364 Merge pull request 'Add missing translation for more_items' (#2828) from 0ko/forgejo:more_items into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2828
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-26 18:37:21 +00:00
wxiaoguang 6243973899
Fix comment review avatar alignment (#29935)
Fix #29934

(cherry picked from commit bc55a80693aded26efd856812097536e2402d491)

Conflicts:
	templates/repo/issue/view_content/comments.tmpl
	trivial context conflict
2024-03-26 19:04:28 +01:00
Earl Warren 522eb73ec9
lint: apply lint-frontend-fix 2024-03-26 19:04:28 +01:00
silverwind 5940dc17fd
Migrate `gap` helpers to tailwind (#30034)
Commands ran:

```sh
perl -p -i -e 's#gt-gap-0#tw-gap-0#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-1#tw-gap-0.5#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-2#tw-gap-1#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-3#tw-gap-2#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-4#tw-gap-4#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-5#tw-gap-8#g'   web_src/js/**/* templates/**/*

perl -p -i -e 's#gt-gap-x-0#tw-gap-x-0#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-1#tw-gap-x-0.5#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-2#tw-gap-x-1#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-3#tw-gap-x-2#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-4#tw-gap-x-4#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-x-5#tw-gap-x-8#g'   web_src/js/**/* templates/**/*

perl -p -i -e 's#gt-gap-y-0#tw-gap-y-0#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-1#tw-gap-y-0.5#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-2#tw-gap-y-1#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-3#tw-gap-y-2#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-4#tw-gap-y-4#g'   web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-gap-y-5#tw-gap-y-8#g'   web_src/js/**/* templates/**/*

(cherry picked from commit 90a4f9a49eecc4b672df0c29f5034be25244191c)

Conflicts:
	templates/repo/diff/box.tmpl
	templates/repo/diff/conversation.tmpl
	prefered Forgejo files & re-ran the commands to ensure all are applied
2024-03-26 19:04:28 +01:00
silverwind 8f2b95012d
Dont show expansion for empty actions steps (#29977)
This hides the chevron icon and makes the step header unclickable for
skipped steps because there is no content to expand on those.

Before:

<img width="272" alt="Screenshot 2024-03-21 at 20 06 47"
src="https://github.com/go-gitea/gitea/assets/115237/9bb328d1-6f74-48a9-af19-de9b351e3707">

After:
<img width="295" alt="Screenshot 2024-03-21 at 20 03 07"
src="https://github.com/go-gitea/gitea/assets/115237/72a26e14-5a28-4606-8c3c-184b405872c8">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 5bd0773741be8f9476be0c76e8733f8c9dd65d19)
2024-03-26 19:04:28 +01:00
silverwind 42c22b886b
Enable a few stylelint rules (#30038)
No violations but still good to have them.

(cherry picked from commit 9c6e6f4d1b7acf6adc4b201da2dbc51d092c9a17)
2024-03-26 19:04:28 +01:00
silverwind 1ac099cf0f
Remove remaining jQuery .css code (#30015)
The linter missed these because they were set on a object. Tested and I
also renamed those properties to add `$` indicating a jQuery selection.

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit e4a481e0ca7e952efdf7a96ccd33f80f527d8c86)
2024-03-26 19:04:28 +01:00
DrMaxNix a9a2f5200b
Respect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (#30013)
This PR adds `setting.Service.DefaultOrgMemberVisible` value to dataset
of user when the initial org creator is being added to the created org.

Fixes #30012.

(cherry picked from commit e3e08dcc5184cdbdac5023fabaafba123a995c3e)
2024-03-26 19:04:28 +01:00
Yarden Shoham 0dc6919e2d
Remove jQuery `.attr` from the common global functions (#30023)
- Switched from jQuery `.attr` to plain javascript `getAttribute`
- Tested the show/hide modal buttons, they work as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 900dd79d8adaf2569df0f1346b6e6e91ed4b5ad3)
2024-03-26 19:04:28 +01:00
silverwind 66feafb3de
Migrate font-size helpers to tailwind (#30029)
Migrate `gt-font-*` to `tw-text-*` All tailwind-original class names are
also available and render like they would with 16px root font size.

We currently have root font size at 14px, but I would like to eventually
migrate us to 16px so that the tailwind docs apply to us unchangend and
because 16px is the recommended root font size for web pages in general.
Also the number 16 is much better dividable than 14 so will result in
more integers.

(cherry picked from commit 75e2e5c736687ae1897cf760a432b572feed56f5)

Conflicts:
	templates/repo/header.tmpl
	trivial context conflict
2024-03-26 19:04:28 +01:00
silverwind eaac4af245
Replace all simple inline styles with tailwind (#30032)
These should be all simple inline styles that were left in the
templates.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 0bef9a2775af0e27a0754207fc87537b96c2792e)
2024-03-26 19:04:28 +01:00
silverwind 76315e0919
Migrate font-weight helpers to tailwind (#30027)
Commands ran:

```sh
perl -p -i -e 's#gt-font-light#tw-font-light#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-font-normal#tw-font-normal#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-font-medium#tw-font-medium#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-font-semibold#tw-font-semibold#g' web_src/js/**/* templates/**/*
perl -p -i -e 's#gt-font-bold#tw-font-bold#g' web_src/js/**/* templates/**/*
```

(cherry picked from commit fabe01478ab449cc4870b7e2a9a1db3911bb14bd)

Conflicts:
	templates/repo/header.tmpl
	prefered Forgejo file & re-ran the commands to ensure the
	migration is done
2024-03-26 19:04:28 +01:00
Yarden Shoham 9968139b6b
Remove jQuery from the issue "go to" button (#30028)
- Switched to plain JavaScript
- Tested the "go to" button functionality and it works as before

![demo](https://github.com/go-gitea/gitea/assets/20454870/76add18f-3294-4117-98b7-a97f576370e2)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit d9e33959b38d1463f69f6f8807bc50095cf6dbdb)

Conflicts:
	web_src/js/features/common-issue-list.js
	because "Make submit event code work with both jQuery event
	and native event (#29223)" was not cherry-picked. The change
	it introduced in this file is reverted by this commit so it
	does not matter.
2024-03-26 19:04:27 +01:00
6543 ab5f0b7558
Determine fuzziness of bleve indexer by keyword length (#29706)
also bleve did match on fuzzy search and the other way around. this also fix that bug.

(cherry picked from commit b9c57fb78e8e0d80d786d8e1da433b6c7ebf2f1c)

Conflicts:
	tests/integration/repo_search_test.go
	simple conflict resolution in the tests
2024-03-26 19:04:27 +01:00
wxiaoguang b73117127c
Escape paths for find file correctly (#30026)
Fix #30020

(cherry picked from commit 1cdc6c3a4ea28396788b2697f9cf257df161ff9a)
2024-03-26 19:04:27 +01:00
Yarden Shoham d64b9757e8
Remove jQuery `.attr` from the diff page (#30021)
- Switched from jQuery `.attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the review box counter and Previous/Next code review
conversation buttons. They work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 74c1378dfb5f1831ca2bf1f0b18ab150134f4beb)
2024-03-26 19:04:27 +01:00
Yarden Shoham 08a9a61faf
Remove jQuery `.attr` from the repository settings (#30018)
- Switched from jQuery `.attr` to plain javascript `getAttribute` and
`setAttribute`
- Tested the collaborator access mode change, team search box, and
branch protection form. They all work as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 26dbca741114587f4191050a76ee1a36282a2018)
2024-03-26 19:04:27 +01:00
Yarden Shoham a395806812
Remove jQuery `.attr` from the image diff again (#30022)
- Follows https://github.com/go-gitea/gitea/pull/29917

Missed these

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit d0d7b4b6d124dd8fd420a5f3850e37794e09e302)
2024-03-26 19:04:27 +01:00
Yarden Shoham 7092ffc5dd
Remove jQuery `.attr` from the branch/tag selector (#30010)
- Switched from jQuery `.attr` to plain javascript `.setAttribute`
- Tested the cherry-pick from the branch/tag selector and it works as
before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit bc92478575d9c1e84aa4ba4052dffcdc109a0323)
2024-03-26 19:04:27 +01:00
Yarden Shoham 598d7c030d
Remove jQuery `.attr` from the commit graph (#30006)
Switched from jQuery `.attr` to plain javascript `.getAttribute` and
`.setAttribute`

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit d4ac1bd26e3ebc8e3bc7e84313e566634b672477)
2024-03-26 19:04:27 +01:00
Yarden Shoham bc31bf2d09
Remove jQuery from the citation modal (except fomantic) (#30008)
- Switched to plain JavaScript
- Tested the citation modal functionality and it works as before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/65bba1eb-dd4c-477f-8a2d-08e65f1e9f42)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit dade40407e333fbc6811bdd738c3d191b5dc0ef1)
2024-03-26 19:04:27 +01:00
Yarden Shoham c3e9b8b6f9
Remove jQuery `.attr` from the project page (#30004)
- Switched from jQuery `.attr` to plain javascript `.getAttribute`
- Tested the issue movement between columns, column background color
setting, and column deletion. It all works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 5c91d7920f4aff08768e274269e211e926aa3d36)
2024-03-26 19:04:27 +01:00
silverwind 3ea7437fa6
Fix incorrect tailwind migration (#30007)
Fixes https://github.com/go-gitea/gitea/issues/30005. Regression from
https://github.com/go-gitea/gitea/pull/29945.

There was only once instance of `tw-content-center` before that PR, so I
just ran below command and reverted that one instance.

```sh
perl -p -i -e 's#tw-content-center#tw-items-center#g' web_src/js/**/* templates/**/* models/**/* tests/**/*
```

(cherry picked from commit 04f9ad056882fc3f21b247b16f84437adf0f36d8)

Conflicts:
	templates/repo/diff/conversation.tmpl
	templates/repo/header.tmpl
	templates/repo/issue/filter_list.tmpl
	templates/repo/issue/view_content/conversation.tmpl
	templates/repo/wiki/view.tmpl
	web_src/js/components/DashboardRepoList.vue
	re-ran the command after discarding the Gitea changes to
	ensure all Forgejo files are also covered
2024-03-26 19:04:27 +01:00
silverwind b96845ae01
Enforce trailing comma in JS on multiline (#30002)
To keep blame info accurate and to avoid [changes like
this](https://github.com/go-gitea/gitea/pull/29977/files#diff-c3422631a14edbe1e508c4b22f0c718db318be08a6e889427802f9b6165d88d6R359),
it's good to always have a trailing comma, so let's enforce it in JS.

This rule is completely automatically fixable with `make lint-js-fix`
and that's what I did here.

(cherry picked from commit 3d751b6ec18e57698ce86b79866031d2c80c2071)

Conflicts:
	web_src/js/components/DashboardRepoList.vue
	trivial context conflict because of '3b7b899afa fix commit_status'
2024-03-26 19:04:27 +01:00
Earl Warren 9c9f40f6d3
Replace 10 more gt- classes with tw- (#29945) (step 2)
Same operation ran to cover all Forgejo specific files as well.

---

Likely the biggest change of the tailwind refactors. Only thing of note
is that `tw-flex-1` resolves to `flex: 1 1 0%` while our `gt-f1` was
`flex: 1 1 0`, I don't think it will make any difference. Commands I've
ran:

```sh
perl -p -i -e 's#gt-vm#tw-align-middle#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-fw#tw-flex-wrap#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-f1#tw-flex-1#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-fc#tw-flex-col#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-sb#tw-justify-between#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-je#tw-justify-end#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-jc#tw-justify-center#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-ac#tw-content-center#g' web_src/js/**/* templates/**/* models/**/* tests/**/*
perl -p -i -e 's#gt-df#tw-flex#g' web_src/js/**/* templates/**/* models/**/* tests/**/*
perl -p -i -e 's#gt-dib#tw-inline-block#g' web_src/js/**/* templates/**/* models/**/* tests/**/*

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit f88ad5424f381bf2a45fd863b551c5a72891bb68)
2024-03-26 19:04:27 +01:00
silverwind 2befd9a3cf
Replace 10 more gt- classes with tw- (#29945)
Likely the biggest change of the tailwind refactors. Only thing of note
is that `tw-flex-1` resolves to `flex: 1 1 0%` while our `gt-f1` was
`flex: 1 1 0`, I don't think it will make any difference. Commands I've
ran:

```sh
perl -p -i -e 's#gt-vm#tw-align-middle#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-fw#tw-flex-wrap#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-f1#tw-flex-1#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-fc#tw-flex-col#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-sb#tw-justify-between#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-je#tw-justify-end#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-jc#tw-justify-center#g' web_src/js/**/* templates/**/* models/**/*
perl -p -i -e 's#gt-ac#tw-content-center#g' web_src/js/**/* templates/**/* models/**/* tests/**/*
perl -p -i -e 's#gt-df#tw-flex#g' web_src/js/**/* templates/**/* models/**/* tests/**/*
perl -p -i -e 's#gt-dib#tw-inline-block#g' web_src/js/**/* templates/**/* models/**/* tests/**/*

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit f88ad5424f381bf2a45fd863b551c5a72891bb68)

Conflicts:
	templates/repo/diff/conversation.tmpl
	templates/repo/header.tmpl
	templates/repo/issue/filter_actions.tmpl
	templates/repo/issue/filter_list.tmpl
	templates/repo/issue/view_content/conversation.tmpl
	templates/repo/release/list.tmpl
	templates/repo/wiki/view.tmpl
	web_src/js/components/DashboardRepoList.vue
	discard the proposed changes and prefer Forgejo. A followup
	commit will apply the same commands.
2024-03-26 19:04:27 +01:00
Lunny Xiao 44bc7b9954
Add border radius for wiki pages (#29937)
Before

<img width="1312" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/26a6dec2-9fea-4c0c-b6fb-290eab12a55a">

After

<img width="1298" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/01f7a714-eae9-4729-918f-3b4795094d0b">

(cherry picked from commit 0c55506b407731546c6bacd1442a785db68f55a7)
2024-03-26 19:04:27 +01:00
Lunny Xiao 196c8772a8
Use db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995)
(cherry picked from commit f8ab9dafb7a173a35e9308f8f784735b0f822439)

Conflicts:
	routers/web/repo/fork.go
	trivial context conflict, the file does not exist in Forgejo
2024-03-26 19:04:27 +01:00
silverwind c97a7b8347
Small refactors in anchors.js (#29947)
Some minor refactors, remove unnecessary `:is` selector and move the
`:target` check out of the function. Might as well backport for the rare
browser that does not support `:is`.

(cherry picked from commit 29118743a58cf3172bddb6a4fa287484c62b4eb1)
2024-03-26 19:04:27 +01:00
silverwind f63ed42087
Remove fomantic site module (#29980)
Had to fiddle a bit with the css ordering, but seems to work well now
and should render exactly like before. Some of the CSS may be
unnecessary, but I kept it for now.

(cherry picked from commit 6845717158991d41fc52690de857e2a4987f1c5c)
2024-03-26 19:04:27 +01:00
HEREYUA 9cf4ab0338
Fix: Abnormal strings appear when comments are saved after editing (#29991)
Partially resolved(The second problem):
[#29986](https://github.com/go-gitea/gitea/issues/29986)

**Before**
HTML strings appear when comments are saved after editing

![image](https://github.com/go-gitea/gitea/assets/37935145/c356d99a-8473-4cc5-8e38-1b207ccd8b12)

**After**

https://github.com/go-gitea/gitea/assets/37935145/525601f9-3ee1-4266-9105-36d82b91b1c8
(cherry picked from commit bf34723491dcbb45dee7888c574e295cae6096be)
2024-03-26 19:04:27 +01:00
wxiaoguang d4ea1c2559
Fix some pending problems (#29985)
These changes are quite independent and trivial, so I don't want to open
too many PRs.

* https://github.com/go-gitea/gitea/pull/29882#discussion_r1529607091
    * the `f.Close` should be called properly
* the error message could be more meaningful
(https://github.com/go-gitea/gitea/pull/29882#pullrequestreview-1942557935)
*
https://github.com/go-gitea/gitea/pull/29859#pullrequestreview-1942324716
    * the new translation strings don't take arguments
* https://github.com/go-gitea/gitea/pull/28710#discussion_r1443778807
    * stale for long time
*  #28140
    * a form was forgotten to be changed to work with backend code

(cherry picked from commit 226231ea27d4f2b0f09fa4efb39501507613b284)

Conflicts:
	templates/repo/issue/view_content/pull.tmpl
	discarded because unexplained
	templates/status/404.tmpl
	implemented differently in Forgejo
2024-03-26 19:04:26 +01:00
Zettat123 8848b0ea2b
Fix bugs in rerunning jobs (#29955)
Fix #28761
Fix #27884
Fix #28093

## Changes

### Rerun all jobs
When rerun all jobs, status of the jobs with `needs` will be set to
`blocked` instead of `waiting`. Therefore, these jobs will not run until
the required jobs are completed.

### Rerun a single job
When a single job is rerun, its dependents should also be rerun, just
like GitHub does
(https://github.com/go-gitea/gitea/issues/28761#issuecomment-2008620820).
In this case, only the specified job will be set to `waiting`, its
dependents will be set to `blocked` to wait the job.

### Show warning if every job has `needs`
If every job in a workflow has `needs`, all jobs will be blocked and no
job can be run. So I add a warning message.

<img
src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b"
width="480px" />

(cherry picked from commit 2f060c5834d81f0317c795fc281f9a07e03e5962)
2024-03-26 19:04:26 +01:00
silverwind 3d99b43dd2
remove PATH and GOPATH modification in Makefile (#29978)
We don't need these modifications anymore since all tool
dependencies run via `go run`.

(cherry picked from commit ef33dcf946cc9754b51c955975d67f871702b958)
2024-03-26 19:04:26 +01:00
silverwind 1f1178ce9b
Fix various loading states, remove `.loading` class (#29920)
Various code was using fomantic `loading` class which I think got broken
a while ago and rendered only a full circle. Fix those to use
`is-loading`.

Before:
<img width="295" alt="Screenshot 2024-03-19 at 22 56 26"
src="https://github.com/go-gitea/gitea/assets/115237/dbe83395-5db4-4868-90bc-3613866a35f0">

After:
<img width="60" alt="Screenshot 2024-03-19 at 22 54 35"
src="https://github.com/go-gitea/gitea/assets/115237/8ac19b7e-035a-4c6d-850b-53a234ef69c2">
<img width="294" alt="Screenshot 2024-03-19 at 22 54 56"
src="https://github.com/go-gitea/gitea/assets/115237/34e819d7-25f7-43a1-9d48-4a68dcd2b6ad">
<img width="320" alt="Screenshot 2024-03-19 at 22 55 16"
src="https://github.com/go-gitea/gitea/assets/115237/05127544-47ff-4e18-9fd8-c84e44c374f8">
<img width="153" alt="Screenshot 2024-03-19 at 23 01 43"
src="https://github.com/go-gitea/gitea/assets/115237/a33248c6-b11d-40ff-82d8-f5a3d85b55aa">
<img width="1300" alt="Screenshot 2024-03-19 at 23 56 25"
src="https://github.com/go-gitea/gitea/assets/115237/562ca876-b5d5-4295-961e-9d2cdab31ab0">
<img width="136" alt="Screenshot 2024-03-20 at 00 00 38"
src="https://github.com/go-gitea/gitea/assets/115237/44838ac4-67f3-4fec-a8e3-978cc5dbdb72">

(cherry picked from commit d6fed9ab88b13e124c5e59ceac5b21a3af52ad24)
2024-03-26 19:04:26 +01:00
yp05327 64fcf0cb64
Update register application URL for GitLab (#29959)
Fix #26593
The old URL was updated 7 years ago. Maybe no need to hold it any more.

![image](https://github.com/go-gitea/gitea/assets/18380374/95a0b364-832b-4f10-800e-21845d64df1a)

(cherry picked from commit 4bef1fb3e49127316596cef1d3ca103a199c0536)
2024-03-26 19:04:26 +01:00
wxiaoguang e5920b4a62
Refactor StringsToInt64s (#29967)
And close #27176

(cherry picked from commit cdb4d1a8db096d60dba04728924dab85def45b19)
2024-03-26 19:04:26 +01:00
silverwind f8060bb5d9
Switch to happy-dom for testing (#29948)
Use `happy-dom` again in vitest as it has caught up recently to `jsdom`
in terms of features and it is a much more lightweight solution.

I encountered [one
bug](https://github.com/capricorn86/happy-dom/issues/1342), but it's an
easy workaround until fixed.

I regenerated the lockfile to get rid of the transitive dependencies so
that's why the diff also has some upgrades in it.

In total, this change removes 39 npm dependencies.

(cherry picked from commit 82979588f4d8699097451ebb70c56a4bdd090c52)
2024-03-26 19:04:26 +01:00
Lunny Xiao d92c2048b3
Performance improvements for pull request list page (#29900)
This PR will avoid load pullrequest.Issue twice in pull request list
page. It will reduce x times database queries for those WIP pull
requests.

Partially fix #29585

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 62f8174aa2fae1481c7e17a6afcb731a5b178cd0)

Conflicts:
	models/activities/notification_list.go
	moved to models/activities/notification.go
2024-03-26 19:04:26 +01:00
HEREYUA 0f4614004e
Solving the issue of UI disruption when the review is deleted without refreshing (#29951)
**After deleting the review and refreshing, the display is normal.
However, Without refreshing, the interface will be broken**

https://github.com/go-gitea/gitea/assets/37935145/f5cb19a6-eb26-47b0-b8ee-15b575bbe1ac

**after**

https://github.com/go-gitea/gitea/assets/37935145/aa65922c-2ebf-4fce-ad91-35661f70329a

(cherry picked from commit 0b4ff15356769db092fd7718da553e8a216c32fa)
2024-03-26 19:04:26 +01:00
silverwind faed93370f
Fix JS error and improve error message styles (#29963)
Fixes: https://github.com/go-gitea/gitea/issues/29956. This error
exposed a existing bug in the code, it was just never noticed because
the jQuery expression evaluated without error before while the new one
doesn't.

Also improves error message styles:

Before:
<img width="1338" alt="Screenshot 2024-03-21 at 09 16 07"
src="https://github.com/go-gitea/gitea/assets/115237/1cc1ef89-ad94-491e-bbca-75387f7547a0">

After:
<img width="1335" alt="Screenshot 2024-03-21 at 09 15 44"
src="https://github.com/go-gitea/gitea/assets/115237/312efc79-5353-4e2a-a703-1bccd3c01736">

(cherry picked from commit 1a4f693f9f9723c181b747cb6d658aa37118005a)
2024-03-26 19:04:26 +01:00
Lunny Xiao cb656d1a43
Fix the bug that user may logout if he switch pages too fast (#29962)
This PR fixed a bug when the user switching pages too fast, he will
logout automatically.

The reason is that when the error is context cancelled, the previous
code think user hasn't login then the session will be deleted. Now it
will return the errors but not think it's not login.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 82db9a2ba77d2a6c470b62be3c82b73c0a544fcc)
2024-03-26 19:04:26 +01:00
silverwind 6dabb41129
Exclude `routers/private/tests` from air (#29949)
Exclude this and reformat the toml option to multiline.

I wasn't able to get `exclude_regex` to work so it would include a
`tests` directory anywhere. I think that option only works on files.

(cherry picked from commit 3ee39db34efd532626d710de6717bf3c6255c10e)
2024-03-26 19:04:26 +01:00
silverwind 01f729f764
Misc color tweaks (#29943)
Minor color tweaks:

- Better text contrasts
- Better distinguish nav and header wrapper in light theme
- Input boxes are now white on light theme
- Slightly darker dark theme background

<img width="503" alt="Screenshot 2024-03-20 at 19 31 54"
src="https://github.com/go-gitea/gitea/assets/115237/c7802a84-2386-4332-bd91-f419473ff644">
<img width="510" alt="Screenshot 2024-03-20 at 19 32 24"
src="https://github.com/go-gitea/gitea/assets/115237/21d3529e-6e0a-413a-9e9e-a03bea2405eb">

(cherry picked from commit 444460ea807c6a669d1a1467510868335abee5fb)
2024-03-26 19:04:26 +01:00
Lunny Xiao e8f3efe1da
Fix and rewrite markup anchor processing (#29931)
Fix #29877

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 76ec5410510f09b3ea2bfd2602fcb8f3251087b6)
2024-03-26 19:04:26 +01:00
silverwind dda010cddf
Remove fomantic grid module (#29894)
Removed the grid module and moved the used parts it into our own CSS,
eliminating around 75% unused CSS in turn.

(cherry picked from commit 286268c9155c9e0b3a3aa0a18675111e5b744a5b)
2024-03-26 19:04:26 +01:00
wxiaoguang 0710de9d0d
Fix loadOneBranch panic (#29938)
Try to fix #29936

Far from ideal, but still better than panic.

(cherry picked from commit 21151474e36eecc5b808963b924cd27ec34e0608)
2024-03-26 19:04:26 +01:00
silverwind 165182a92d
Remove the negative margin from `.page-content` (#29922)
The negative margin was suboptimal and presents a few unnecessary
challenges while styling the page. Remove it and add custom margin
values, which slightly changes the height a few things near the top of
the page as well:

15px less height of explore and login navbar:

<img width="899" alt="Screenshot 2024-03-20 at 00 52 34"
src="https://github.com/go-gitea/gitea/assets/115237/72a01ca4-5d17-4a0f-b915-61f95054fcb1">

15px reduced padding-top height of "user bar" and equal 4px padding
added:

<img width="484" alt="Screenshot 2024-03-20 at 00 52 50"
src="https://github.com/go-gitea/gitea/assets/115237/a8507e6d-372d-4a8b-9048-66fcf8a5facd">

3px less padding on top of repo:

<img width="552" alt="Screenshot 2024-03-20 at 00 53 49"
src="https://github.com/go-gitea/gitea/assets/115237/dede6e44-7688-440f-a1b6-13532638ae03">

(cherry picked from commit 8cad44f4109b6f87e565d43e137e99ab23b54349)
2024-03-26 19:04:26 +01:00
wxiaoguang 4f8763c4fd
Remove unnecessary ".Link" usages (#29929)
Follow #29909

(cherry picked from commit 91699a9bb1fc59029a2605912f1e380eff7297fa)
2024-03-26 19:04:26 +01:00
Earl Warren 4061cb32f7
Remove unnecessary ".Link" usages (#29909) (part 2)
5143ebb507 Add rel="nofollow" to issue filter links

has a test that fails because it assumes the link starts with the link
where it now starts with a ?
2024-03-26 19:04:26 +01:00
wxiaoguang c758c5612e
Remove unnecessary ".Link" usages (#29909)
In HTML, `?key=val` already means "use the current link with new query parameters"

(cherry picked from commit 4c476fa41dc29dc24afda0925023ae3d0b9707cd)

Conflicts:
	templates/repo/issue/filter_list.tmpl
	templates/shared/issuelist.tmpl
	trivial context conflict because the lines in Forgejo have rel=nofollow
2024-03-26 19:04:26 +01:00
Jason Song 06db43f858
Show Actions post step when it's running (#29926)
The post step was always waiting, even if all steps were done. Then,
once the task was done, the post step became success immediately.

Before:

<img width="915" alt="xnip_240320_120228"
src="https://github.com/go-gitea/gitea/assets/9418365/00347430-f998-4c43-917a-bf6dd6d0e333">

After:

<img width="905" alt="xnip_240320_120443"
src="https://github.com/go-gitea/gitea/assets/9418365/a419b111-17c2-4029-a022-c761cc419091">

(cherry picked from commit 35cfd98e121005f90f6d0d55d9a69e37d7990010)
2024-03-26 19:04:25 +01:00
Jason Song 18e95af24f
Restore deleted branches when syncing (#29898)
Regression of #29493. If a branch has been deleted, repushing it won't
restore it.

Lunny may have noticed that, but I didn't delve into the comment then
overlooked it:
https://github.com/go-gitea/gitea/pull/29493#discussion_r1509046867

The additional comments added are to explain the issue I found during
testing, which are unrelated to the fixes.

(cherry picked from commit f371f84fa3456c2a71470632b6458d81e4892a54)
2024-03-26 19:04:25 +01:00
Yarden Shoham e358500519
Remove jQuery `.attr` from the user search box (#29919)
- Switched from jQuery `.attr` to plain javascript `.getAttribute`
- Tested the user search box and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit adc61c5d71651acc316bbc3a7fee6f2c0c60b06e)
2024-03-26 19:04:25 +01:00
Yarden Shoham 872287c380
Remove jQuery `.attr` from the archive download and compare page branch selector (#29918)
- Switched from jQuery `.attr` to plain javascript `.getAttribute`
- Tested the archive download and compare page branch selector
functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit dd043854ee8963057daa7b835fc700731ae5fb9e)
2024-03-26 19:04:25 +01:00
Yarden Shoham 32cef22bfd
Remove jQuery `.attr` from the image diff (#29917)
- Switched from jQuery `.attr` to plain javascript `.setAttribute`
- Tested the image diff functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit cb98e27992cae7d62e527e922cae3c0f738a7cab)
2024-03-26 19:04:25 +01:00
Yarden Shoham f9546aa0f2
Remove jQuery `.attr` from the quick pull request button text (#29916)
- Switched from jQuery `.attr` to plain javascript `.getAttribute`
- Tested the quick pull request button text change functionality and it
works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 4cfda0241993eabb50ed937dab2ffa7deff3d36e)
2024-03-26 19:04:25 +01:00
Yarden Shoham 5ed8c86aab
Remove jQuery `.attr` from the issue author dropdown (#29915)
- Switched from jQuery `.attr` to plain javascript `.getAttribute`
- Tested the issue author dropdown functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 55a8f4510af5ef67e484d45dd3789c29f120d58e)
2024-03-26 19:04:25 +01:00
Yarden Shoham 7512b9f7d4
Switch to the maintained vitest extension (#29914)
https://marketplace.visualstudio.com/items?itemName=zixuanchen.vitest-explorer
was moved to
https://marketplace.visualstudio.com/items?itemName=vitest.explorer

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 8bf4173e31a4018fb277c871df7d8d31c98dba0b)
2024-03-26 19:04:25 +01:00
silverwind 8c3d7c049a
Forbid jQuery `.css` and refactor all usage (#29852)
Tested all functionality. There is a [pre-existing
bug](https://github.com/go-gitea/gitea/issues/29853) when moving a
project panels which is not caused by this refactoring.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit fa100618c4b644346bf5666f92d33dce0747d0a2)
2024-03-26 19:04:25 +01:00
silverwind 272dffb0d6
Fix border on focus in dashboard repo search (#29893)
Before:

<img width="449" alt="Screenshot 2024-03-18 at 22 35 10"
src="https://github.com/go-gitea/gitea/assets/115237/f2893870-e7a3-4e34-b0cf-4610735c9b36">

After:

<img width="453" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/36a9f800-28a4-40fc-b6d2-a2e717ddba01">

(cherry picked from commit 5a8559ec47a271e45bf5836eaf5e9040a0f1d6bf)
2024-03-26 19:04:25 +01:00
yp05327 e8e8d14b53
Fix invalid link of the commit status when ref is tag (#29752)
Fix #29731
Caused by #24634
Also remove fixme.

ps: we can not fix the existed runs, as wrong refs are all recorded in
DB, and we can not know whether they are branch or tag:

![image](https://github.com/go-gitea/gitea/assets/18380374/cb7cf266-f73f-419a-be1a-4689fdd1952a)

(cherry picked from commit 98217b034076157547cf688cc10f47cd3275c872)

Conflicts:
	tests/integration/actions_trigger_test.go
	there is a need for more imports because the exist tests
	are done differently, using CreateDeclarativeRepo
2024-03-26 19:04:25 +01:00
Zettat123 0da787f237
Fix milestoneID filter bug in issue list (#29897)
Fix #29717

(cherry picked from commit 656d8e2267dbdbb595704d507a780533038bb7ed)
2024-03-26 19:04:25 +01:00
coldWater 664052fb0b
Fix missing error check of bufio.Scanner (#29882)
maybe more

(cherry picked from commit 0e183d81fc5283f9d2047472de580e4f04a046c1)
2024-03-26 19:04:25 +01:00
Nanguan Lin 40c9fa43cd
Remove unused error in graceful manager (#29871)
As title.

(cherry picked from commit 1f0d31ce8fdfc8c32f84e4e0801c2d04b727bbd8)
2024-03-26 19:04:25 +01:00
silverwind 4711d3311b
Migrate border and margin classes to Tailwind (#29828)
Used all existing css vars, other migrations are 1:1.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 34290a00c4501ffeba26db267be71ab68e3ec97f)

Conflicts:
	templates/repo/issue/filter_list.tmpl
	web_src/js/components/DashboardRepoList.vue
	trivial context conflicts
2024-03-26 19:04:25 +01:00
wxiaoguang fbf0b3d661
Only do counting when count_only=true for repo dashboard (#29884)
Ref: #29878
(cherry picked from commit b251e608c01392c947f84be387f956541bfea25c)
2024-03-26 19:04:25 +01:00
buckybytes 0d3ddec26c
Editor error message misleading due to re-used key. (#29859)
The error message:

`editor.file_changed_while_editing = The file contents have changed
since you started editing. <a target="_blank" rel="noopener noreferrer"
href="%s">Click here</a> to see them or <strong>Commit Changes
again</strong> to overwrite them.`

Is re-used in inappropriate contexts. The link in the key goes to a 404
when the key is used in a situation where the file contents have not
changed.

Added two new keys to differentiate commit id mismatch and push out of
date conditions.

(cherry picked from commit 16e360099d0a515d429538ec88cff1f3ede23fb4)
2024-03-26 19:04:25 +01:00
GiteaBot 0500d926b2
[skip ci] Updated licenses and gitignores
(cherry picked from commit a4a766f4a205d507d157f2f17a0e761e00939cb8)
2024-03-26 19:04:25 +01:00
silverwind 6eb576c36d
move some scripts from 'build' to 'tools' directory, misc refactors (#29844)
- Move some scripts from `build` to new `tools` dir. Eventually i would
like to move all but let's do it step-by-step.
- Add dir to eslint and move the files into vars.
- Update docs accordingly.
- While updating docs I noticed we were incorrectly having `public/img`
path still in a few places. Replace those with the current
`public/assets/img`.

---------

Co-authored-by: Nanguan Lin <nanguanlin6@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 095fdd691dd1a7d7748372cc73e7708278c80933)
2024-03-26 19:04:25 +01:00
Nanguan Lin a2f4ab60e8
Fix missing code in the user profile (#29865)
fix #29820
deleted by
https://github.com/go-gitea/gitea/pull/29248/files#diff-2b0b591787f16325539485e648a09ab6d3177f47dc129cfe84a35ffe141dfd19L39-L62,
which causing malfunction of follow/unfollow and missing description in
the user profile page.

(cherry picked from commit 5ca65d33906ebbca1e502536ffef18942b541c1d)

Conflicts:
	routers/web/shared/user/header.go
	trivial context conflict because of user blocking code
2024-03-26 19:04:25 +01:00
Denys Konovalov 20f839ad00
fix telegram webhook (#29864)
Fix #29837 which is a regression caused by

https://github.com/go-gitea/gitea/pull/29145/files#diff-731445ee00f0f1bf2ff731f4f96ddcf51cdc53fd2faaf406eb3536fc292ea748L48.

The line was probably removed by accident.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 0285b04f4ca981d7467097dbca3b281011b7798c)
2024-03-26 19:04:25 +01:00
Nanguan Lin 32380ffa57
Fix user id column case (#29863)
Sometimes the column name is case-sensitive and it may cause 500.

(cherry picked from commit df05c558da704f0c9c9f11d32bba2a9c1cb2f8a8)
2024-03-26 19:04:25 +01:00
silverwind 003d860aac
Avoid JS error on issue/pr list when logged out (#29854)
When logged out, the checkboxes are not there on the issue/pr lists,
which would cause an error here.

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

---------

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 33973ac567d6681bda26d82f26b7294a297c693f)
2024-03-26 19:04:24 +01:00
wxiaoguang 2141bc3298
Refactor clone-panel styles (#29861)
1. The borders were doubled on the "empty" page, fix it.
2. Remove unnecessary CSS classes like "clone", "compact", etc
3. Use CSS class "clone-panel" instead of ID "clone-panel"
4. Use `tw-flex-1` instead of `gt-f1`
5. Remove unnecessary ID "more-btn"

(cherry picked from commit 673286d8c8a00bf7240a93187d767fb5a5e32a31)
2024-03-26 19:04:24 +01:00
0ko 8c4445ad3a [I18N] Add missing translation for more_items
- Resolves https://codeberg.org/forgejo/forgejo/issues/2818
- Removes entry for test ignorelist
2024-03-26 22:39:46 +05:00
Codeberg Translate cd28684ac3 [I18N] Translations update from Weblate (#2727)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Fjuro <Fjuro@users.noreply.translate.codeberg.org>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: ormai <ormai@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: kita <kita@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Maytham Alsudany <maytha8thedev@gmail.com>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2727
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-03-26 17:28:11 +00:00
Earl Warren 4766cbe8ea Merge pull request '[BUG] Detect protected branch on branch rename' (#2811) from gusted/forgejo-protectedbranch-rename into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2811
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-26 16:15:13 +00:00
Earl Warren a117dfd2b1
[ACTIONS] port scheduled actions from Gitea
Refs: https://codeberg.org/forgejo/forgejo/issues/2798
2024-03-26 16:51:56 +01:00
Earl Warren 52e9d2db06
[DEADCODE] update 2024-03-26 16:51:56 +01:00
Jason Song 547d32c492
Cancel previous runs of the same PR automatically (#29961)
Follow #25716. Also cancel previous runs for `pull_request_sync`.

It's not a bug since it original PR said "if the event is push".

The main change is
https://github.com/go-gitea/gitea/pull/29961/files#diff-08adda3f8ae0360937f46abb1f4418603bd3518522baa356be11c6c7ac4abcc3.

And also rename `CancelRunningJobs` to `CancelPreviousJobs` to make it
more clear.

(cherry picked from commit b150ff0bab3fc6c419edf1569a0271ebcb9734fa)
2024-03-26 16:51:56 +01:00
yp05327 869286595f
Add empty repo check in `DetectAndHandleSchedules` (#29606)
![image](https://github.com/go-gitea/gitea/assets/18380374/e6081301-bd3e-4cf6-ba4e-e574348dffb4)

(cherry picked from commit 3f3335ae51d89520acce6573e870590423248c5c)
2024-03-26 16:51:56 +01:00
Gusted 0f79122053
[BUG] Detect protected branch on branch rename
- If a branch cannot be renamed due to a protected branch rule, show
this error in the UI instead of throwing an internal server error.
- Add integration test (also simplify the existing one).
- Resolves #2751
2024-03-26 15:58:52 +01:00
Earl Warren 8693e4d63d Merge pull request 'Add more renovate groups and priorize self updates' (#2816) from viceice/forgejo:chore/renovate-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2816
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-26 11:40:08 +00:00
Michael Kriese 91d34924fa
Reduce concurrent Renovate PR's 2024-03-26 09:40:48 +01:00
Michael Kriese bfde9c6866
Add prio for renovate self updates 2024-03-26 09:37:19 +01:00
Michael Kriese c60600a689
Add more renovate groups 2024-03-26 09:24:24 +01:00
oliverpool d301fbc3c0 Merge pull request 'modules/git: Recognize SSH signed tags too' (#2520) from algernon/forgejo:ssh-exclamation-mark-one-one-exclamation-mark-space-key into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2520
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-26 08:09:36 +00:00
Gergely Nagy 40c357bbc5 Rename CommitGPGSignature to ObjectSignature
`CommitGPGSignature` was originally made to store information about a
commit's GPG signature. Nowadays, it is used to store information about
SSH signatures too, and not just commit signatures, but tag signatures
too.

As such, rename it to `ObjectSignature`, because that describes what it
does a whole lot better.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-26 08:09:36 +00:00
Gergely Nagy 8fdffc94ca Add a migration to remove SSH signatures from release notes
Because the `git` module did not recognize SSH signed tags, those
signatures ended up in the `notes` column of the `release` table. While
future signatures will not end up there, Forgejo should clean up the old
ones.

This migration does just that: finds all releases that have an SSH
signature, and removes those signatures, preserving the rest of the
note (if any).

While this may seem like an expensive operation, it's only done once,
and even on the largest known Forgejo instance as of this
writing (Codeberg), the number of affected rows are just over a hundred,
a tiny amount all things considered.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-26 08:09:36 +00:00
Gergely Nagy 26ed995290 modules/git: Recognize SSH signed tags too
Just like commits, tags can be signed with either an OpenPGP, or with an
SSH key. While the latter is supported already, SSH-signed tags have not
been. This patch teaches the git module to recognize and handle
SSH-signed tags too.

This will stop the signatures appearing in release notes, but are
currently unused otherwise.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-26 08:09:36 +00:00
Earl Warren a334c7ca17 Merge pull request 'Add more Renovate groupings' (#2815) from viceice/forgejo:chore/renovate-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2815
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-26 07:58:16 +00:00
Michael Kriese ec8925902b
Add more Renovate groupings 2024-03-26 08:48:38 +01:00
Earl Warren c74649bcff Merge pull request 'go: upgrade to go v1.22 - Dockerfile*' (#2814) from earl-warren/forgejo:wip-go-1.22 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2814
2024-03-26 06:42:46 +00:00
Earl Warren a140d4b90d Merge pull request '[BUG] Fix Ctrl+Enter on editor' (#2810) from gusted/forgejo-ctrlenter-editor into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2810
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-26 06:39:48 +00:00
Earl Warren 06e27e31c2
go: upgrade to go v1.22 - Dockerfile* 2024-03-26 06:48:32 +01:00
Gusted 9db76036bb
[BUG] Fix Ctrl+Enter on editor
- Add event listener for the `ce-quick-submit` event, which will be
triggered if `Ctrl+Enter` is pressed on a text area.
- Regression of 5cc0801de9
- Resolves #2762
2024-03-26 00:25:36 +01:00
Renovate Bot 9ff9036377 Update module github.com/klauspost/compress to v1.17.7 2024-03-25 20:07:17 +00:00
Earl Warren 5194bd15ef Merge pull request 'Update module github.com/editorconfig/editorconfig-core-go/v2 to v2.6.1' (#2804) from renovate/github.com-editorconfig-editorconfig-core-go-v2-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2804
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 19:48:58 +00:00
Earl Warren bc4f09c16b Merge pull request 'Update module github.com/go-enry/go-enry/v2 to v2.8.7' (#2807) from renovate/github.com-go-enry-go-enry-v2-2.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2807
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 19:47:15 +00:00
Renovate Bot a6fdab95f8 Update module github.com/go-enry/go-enry/v2 to v2.8.7 2024-03-25 19:05:23 +00:00
Renovate Bot ac08242493 Update module github.com/gliderlabs/ssh to v0.3.7 2024-03-25 18:24:23 +00:00
Earl Warren 892f0bb069 Merge pull request 'Update dependency katex to v0.16.10' (#2801) from renovate/katex-0.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2801
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 17:59:11 +00:00
Earl Warren 63952406e4 Merge pull request 'Update dependency asciinema-player to v3.7.1' (#2800) from renovate/asciinema-player-3.x into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2800
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 17:56:07 +00:00
Renovate Bot eccd824b01 Update module github.com/editorconfig/editorconfig-core-go/v2 to v2.6.1 2024-03-25 17:37:18 +00:00
Earl Warren d3b4e8132f Merge pull request 'Update gitea.com/go-chi/session digest to 16768d9' (#2782) from renovate/gitea.com-go-chi-session-digest into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2782
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 16:40:48 +00:00
Renovate Bot 823c173970 Update dependency katex to v0.16.10 2024-03-25 16:30:12 +00:00
Zettat123 07eeab863b
Only delete scheduled workflows when needed (#29091)
Fix #29040

`handleSchedules` should be called only if `DetectWorkflows` should
detect schedule workflows

(cherry picked from commit e600c35f066c79b717dc0c416b07d5c34502d286)
2024-03-25 16:28:18 +01:00
Zettat123 cf78141bdd
Fix an actions schedule bug (#28942)
In #28691, schedule plans will be deleted when a repo's actions unit is
disabled. But when the unit is enabled, the schedule plans won't be
created again.

This PR fixes the bug. The schedule plans will be created again when the
actions unit is re-enabled

(cherry picked from commit adc3598a75)
2024-03-25 16:27:32 +01:00
Lunny Xiao 3d19921dbe
Fix schedule not trigger bug because matching full ref name with short ref name (#28874)
Fix #28533

Caused by #28691

(cherry picked from commit 23efd9d278)
2024-03-25 16:27:00 +01:00
Lunny Xiao 3b3747ffe8
Fix schedule tasks bugs (#28691)
Fix #28157

This PR fix the possible bugs about actions schedule.

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

(cherry picked from commit 97292da960)

Conflicts:
	modules/actions/github.go
	routers/web/repo/setting/default_branch.go
	routers/web/repo/setting/setting.go
	services/repository/branch.go
	services/repository/setting.go
	tests/integration/actions_trigger_test.go
2024-03-25 16:25:02 +01:00
Renovate Bot d00f542651 Update dependency asciinema-player to v3.7.1 2024-03-25 15:18:44 +00:00
Renovate Bot 6e968e0ce3 Update gitea.com/go-chi/session digest to 16768d9 2024-03-25 15:18:21 +00:00
Earl Warren 623c79dfd2
Revert "[ACTIONS] on.schedule: the event is always "schedule""
This reverts commit 403bb4bf48.
2024-03-25 16:07:17 +01:00
Mai-Lapyst 2b6546adc9
Add setting to restrict count of lines being displayed & only highlight those lines 2024-03-25 16:05:01 +01:00
Earl Warren 23f68cad7e Merge pull request 'Update gitea.com/go-chi/captcha digest to fb487f6' (#2778) from renovate/gitea.com-go-chi-captcha-digest into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2778
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 14:48:29 +00:00
Earl Warren 9e72beae0b Merge pull request 'Update renovate config' (#2789) from viceice/forgejo:chore/renovate-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2789
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 13:54:43 +00:00
Michael Kriese b561c02b56
Update renovate config 2024-03-25 14:52:42 +01:00
Renovate Bot 46aaecc2b8 Update gitea.com/go-chi/captcha digest to fb487f6 2024-03-25 13:37:57 +00:00
Mai-Lapyst 069d87b80f
Remove unneeded case for a trailing dot 2024-03-25 14:33:54 +01:00
Mai-Lapyst d6428f92ce
Fix typo in language files 2024-03-25 14:33:30 +01:00
Earl Warren 60a01255e7 Merge pull request 'Disable renovate digist pinning' (#2787) from viceice/forgejo:chore/renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2787
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 13:15:23 +00:00
Michael Kriese 477832f4a2
Disable renovate digist pinning 2024-03-25 14:12:49 +01:00
Earl Warren 9e77bf310c Merge pull request 'Update renovate config' (#2784) from viceice/forgejo:chore/renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2784
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 13:03:46 +00:00
Michael Kriese 8f1c26aa54
Update renovate config 2024-03-25 13:58:51 +01:00
Earl Warren 674a711127 Merge pull request 'Update renovate config' (#2783) from viceice/forgejo:chore/renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2783
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 12:34:51 +00:00
Michael Kriese 0023f78a17
Disable duplicate builds 2024-03-25 13:24:53 +01:00
Michael Kriese a32772e695
Update renovate config 2024-03-25 13:16:16 +01:00
Earl Warren eb3ea82ee6 Merge pull request 'Update renovate configs' (#2780) from viceice/forgejo:chore/renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2780
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 12:05:14 +00:00
Michael Kriese 102531cba1
Update renovate configs 2024-03-25 13:03:20 +01:00
Earl Warren 7288fb5dff Merge pull request 'Add renovate' (#2775) from viceice/forgejo:chore/renovate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2775
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 11:22:03 +00:00
Earl Warren 9397bfd276 Merge pull request 'Offer to remove WIP: prefix in sidebar' (#2660) from 0ko/forgejo:convert-to-normal into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2660
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-25 10:30:11 +00:00
Earl Warren 1e16f3d7d1 Merge pull request 'go: upgrade to go v1.22' (#2770) from earl-warren/forgejo:wip-go-1.22 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2770
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-25 10:27:04 +00:00
Michael Kriese 8ce7de5677
Add renovate 2024-03-25 10:34:01 +01:00
Earl Warren 84f28f36b0
go: upgrade to go v1.22 2024-03-25 06:52:23 +01:00
Gusted 9f088464ea Merge pull request 'Fix typo in translation' (#2768) from forgejo-tr-typo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2768
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-24 22:02:44 +00:00
Gusted efc79dd41e Fix typo in translation
Regression of 4c1af0d9a6
2024-03-24 21:30:08 +00:00
oliverpool 702152bfde [REFACTOR] webhook.Handler interface 2024-03-24 10:35:06 +01:00
0ko 4158346f1e [I18N] Add plurals for commit list title
Co-authored-by: Gusted <gusted@noreply.codeberg.org>
2024-03-24 14:09:26 +05:00
0ko d4f48dfc4a [I18N] Improve localization of repo summary
Co-authored-by: Gusted <gusted@noreply.codeberg.org>
2024-03-24 14:09:04 +05:00
Gusted 142459bbe0
[BUG] Use new translation key
- Caused by 847f03b6a6
- Resolve CI failures on `forgejo` branch.
2024-03-24 09:16:30 +01:00
Earl Warren 5a18b74632 Merge pull request '[TESTS] fail when log.Error is called' (#2657) from oliverpool/forgejo:fail_test_on_log_error into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2657
2024-03-24 07:28:31 +00:00
Earl Warren 7e8e27b8ef Merge pull request '[CI] backport: do no nothing if there are no backport labels' (#2757) from earl-warren/forgejo:wip-ci-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2757
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-24 07:25:59 +00:00
Earl Warren f326f14da7
[CI] backport: do no nothing if there are no backport labels 2024-03-24 07:52:00 +01:00
oliverpool 2d209f1130 drop log.Error in ReadRepoNotifications 2024-03-24 07:12:31 +01:00
oliverpool c0fb62cb5a fix action fixtures 2024-03-24 07:12:31 +01:00
oliverpool 25daa267bb migration v1_11/v111.go: Unknown columns in 'field list' 2024-03-24 07:12:31 +01:00
oliverpool 639ac7a131 workergroup: gracefully exit on close(popItemErr) 2024-03-24 07:12:31 +01:00
oliverpool fb6bcf1029 packages/maven: log.Warn on bad request 2024-03-24 07:12:31 +01:00
oliverpool dda88488ca packages: skip error logging on duplicate 2024-03-24 07:12:31 +01:00
oliverpool 7b576d0a5d activitypub: warn instead of error 2024-03-24 07:12:31 +01:00
oliverpool e7abda6a0d actions artifacts: warn instead of error on invalid request 2024-03-24 07:12:31 +01:00
oliverpool a0d1cfdf7d fix missing admin.config.allow_dots_in_usernames translation 2024-03-24 07:12:30 +01:00
oliverpool b990e07af0 old migrations: warning instead of error 2024-03-24 07:11:19 +01:00
oliverpool 3b7b899afa fix commit_status 2024-03-24 07:11:19 +01:00
oliverpool 2536c2db89 fix webhook fixtures 2024-03-24 07:11:19 +01:00
oliverpool 8750a5a42b fix TestBranchActions error log 2024-03-24 07:11:18 +01:00
oliverpool 036b98884c fix action_run fixtures 2024-03-24 07:11:18 +01:00
oliverpool ca209a04b1 log.Error on missing translation 2024-03-24 07:11:18 +01:00
oliverpool e43c6cd9df fail test when log.Error is called
except for some specific messages (to make the test pass for now)
2024-03-24 07:11:18 +01:00
Earl Warren 0bfd4ca532 Merge pull request 'Allow users to hide all "Add more units..." hints' (#2533) from algernon/forgejo:less-is-more into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2533
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-24 05:42:37 +00:00
Earl Warren 2b656a2bea Merge pull request '[META] Adjust default issues and pull requests labels' (#2723) from oliverpool/forgejo:main into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2723
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-24 05:36:05 +00:00
Earl Warren b7c535dba8 Merge pull request '[TESTS] webhook forms creation and edition' (#2755) from oliverpool/forgejo:webhook_1_tests into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2755
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-24 05:35:07 +00:00
Earl Warren 33ede09135 Merge pull request '[PORT] Unify search boxes (gitea#29530)' (#2688) from snematoda/port-29530 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2688
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-24 05:33:13 +00:00
oliverpool 33a3ee1955 [TESTS] webhook forms creation and edition 2024-03-23 23:02:06 +01:00
Earl Warren af0bb6e68a Merge pull request '[port] gitea#29833: Refactor markdown attention render' (#2747) from algernon/forgejo:gitea/port/29833/refactor into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2747
2024-03-23 19:44:45 +00:00
Gergely Nagy eb97e721d1
Align callout icons with the callout text
Adjust some CSS so that callout/attention icons line up better with the
text of the attention header.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 18:42:38 +01:00
Earl Warren a28e289d06 Merge pull request 'Remove some more dead code from the markup sanitizer' (#2750) from algernon/forgejo:gitea/port/29833/more-dead-code-removal into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2750
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 17:15:06 +00:00
Earl Warren 99c4b0930d Merge pull request 'Improve branch select list ui in go templates (gitea#29729)' (#2744) from algernon/forgejo:gitea/port/29729 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2744
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 17:13:05 +00:00
Gergely Nagy 3c57a62050
Restore the "repo.pulls.no_results" translation key
The previous (cherry picked) commit changed a translation key, from
`repo.pulls.no_results` to `common.no_results_found`. This would break
existing translations, and will have to be handled differently, if at
all.

This changes the affected code to continue using the old key.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 17:29:06 +01:00
HEREYUA 729849a2fd
Improve branch select list ui in go templates (#29729)
Relate:[#27417](https://github.com/go-gitea/gitea/issues/27471)
Reference:  [#26631](https://github.com/go-gitea/gitea/pull/26631)

Before

![image](https://github.com/go-gitea/gitea/assets/37935145/88ca8da5-25dd-4f60-bea8-a80107f19cc5)

After

![image](https://github.com/go-gitea/gitea/assets/37935145/3cb180dc-1331-43e9-8633-be5e288401e8)

---------

Co-authored-by: silverwind <me@silverwind.io>

(cherry picked from commit 2eb7c564df950fb96a1970559719003e979ff30a)
2024-03-23 17:29:06 +01:00
Gergely Nagy d571a2c202
Remove some more dead code from the markup sanitizer
This removes some more dead code from the markup sanitizer:

- Allowing unlabelled labels is no longer neccessary as of
  41e8b834af.
- Allowing `style` attributes on `span` and `p` are no longer necessary,
  `bluemonday` allows them by default now.

Selectively cherry picked from commit 66902d89e567ab1ae6dfb828636999c61ff0149e.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 17:16:22 +01:00
Earl Warren f42f044bc4
Revert "NEWFILE"
This reverts commit a6c620dfeb.
2024-03-23 17:13:09 +01:00
Earl Warren d66474c801 Merge pull request 'TEST PLEASE IGNORE' (#2748) from earl-warren/forgejo:wip-test-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2748
2024-03-23 16:09:40 +00:00
Earl Warren a6c620dfeb
NEWFILE 2024-03-23 16:53:20 +01:00
Earl Warren ee269b2bb8 Merge pull request '[CI] backport PRs with the label backport/v*' (#2739) from earl-warren/forgejo:wip-ci-backport into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2739
2024-03-23 15:52:29 +00:00
Earl Warren b5775f6d6e Merge pull request 'modules/markup/markdown/ast: Drop IsColorPreview' (#2746) from algernon/forgejo:gitea/cherry-pick/29833/dead-code-removal into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2746
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 15:25:08 +00:00
Earl Warren 155d79473d Merge pull request 'Add newly added languages' (#2724) from 0ko/forgejo:i18n-2024-03 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2724
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 15:00:17 +00:00
Gergely Nagy 50fb2ac47f
[DEADCODE] update
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 15:52:24 +01:00
Earl Warren 5f73b2bd5b Merge pull request '[port] gitea#29753: Improve a11y document and dropdown item' (#2745) from algernon/forgejo:gitea/port/29753 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2745
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 14:50:50 +00:00
Gergely Nagy 87cd08539e
Update the TestRenderAlertBlocks integration test
The alert/callout blocks rendering has been changed in the previous few
commits, this adapts the test case that verifies them to the updated
output.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 15:38:43 +01:00
Gergely Nagy 58d4af8fdb
Refactor the GitHub Legacy callout renderer too
Following up on the previous commit, change the GitHub Legacy callout
renderer to render the same as the refactored modern renderer.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 15:38:43 +01:00
wxiaoguang ec2201a3da
Refactor markdown attention render (#29833)
* Remove some deadcode
* Use 2-word name for CSS class names
* Remove "gt-*" rules for sanitizer

The UI doesn't change much.

(cherry picked from commit 66902d89e567ab1ae6dfb828636999c61ff0149e)
2024-03-23 15:38:43 +01:00
wxiaoguang 1d4bf7e211
Improve a11y document and dropdown item (#29753)
Co-authored-by: silverwind <me@silverwind.io>

(cherry picked from commit e01b0014de5b732181ac42c03a77c21219f88c6a)
2024-03-23 14:57:59 +01:00
Earl Warren 012ed7019a Merge pull request '[port] Move all login and account creation page labels to be above inputs (gitea#29432)' (#2742) from algernon/forgejo:gitea/port/29432/move-some-labels-above-inputs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2742
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 13:56:18 +00:00
Gergely Nagy 8af8682f7d
modules/markup/markdown/ast: Drop IsColorPreview
The function isn't used anywhere, it's dead code. Remove it.

Partially cherry picked from commit 46c3f3b9e81e25c3ed08ba6c5bfeb8802b3ba1fd.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 14:47:15 +01:00
Earl Warren a631e5c249 Merge pull request 'Don't use `<br />` in alert block (#29650)' (#2741) from algernon/forgejo:gitea/port/29650-dont-use-br-in-alert-block into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2741
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-23 13:46:40 +00:00
Earl Warren 1a1e1604d5 Merge pull request 'Replace "configurable clone methods" with Gitea's more flexible implementation' (#2740) from algernon/forgejo:gitea/port/repo-open-with into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2740
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-23 13:44:42 +00:00
Gergely Nagy f99cf911e8
Revert "Remove inputs in dropdowns from taborder"
This reverts commit 7dc453bb39.
2024-03-23 14:35:59 +01:00
Rafael Heard 3acea02eb6
Move all login and account creation page labels to be above inputs (#29432)
There are a few inconsistencies within Gitea and this PR addresses one
of them. This PR updates the sign-in page layout, including the register
and openID tabs, to match the layout of the settings pages
(/user/settings) for more consistency.

This PR updates the following routes:
`/user/login`
`/user/sign_up`
`/user/login/openid`
`/user/forgot_password`
`/user/link_account`
`/user/recover_account`

**Before**
<img width="968" alt="Screenshot 2024-02-05 at 8 27 24 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/fb0cb517-57c0-4eed-be1d-56f36bd1960d">

**After**
<img width="968" alt="Screenshot 2024-02-05 at 8 26 39 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/428d691d-0a42-4a67-a646-05527f2a7b41">

This PR addresses a revert of the original PR due to this
[comment](https://github.com/go-gitea/gitea/pull/28753#issuecomment-1956596817).

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
2024-03-23 12:36:12 +01:00
Gergely Nagy 1386d3faf7
[DEADCODE] update
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 12:26:14 +01:00
Yarden Shoham 20446ac6b3
Don't use `<br />` in alert block (#29650)
- Follows https://github.com/go-gitea/gitea/pull/29121

When I implemented alert blocks I was always testing the markdown in
issue comments. I used `<br />` for line breaks and it looked good. I
have since learned that the markdown on README files doesn't allow these
tags. So a comment with

```md
> [!NOTE]
> If you're interested in using our APIs, we have experimental support with [documentation](https://try.gitea.io/api/swagger).
```

looked like this in a comment

![image](https://github.com/go-gitea/gitea/assets/20454870/96b1de01-2c87-4d4f-83dd-98192b83e9d0)
but looked like this in a README

![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3)

So I changed how we render the alert block by having the alert itself
have a dedicated paragraph, so line breaks happen naturally between
paragraphs.

![image](https://github.com/go-gitea/gitea/assets/20454870/474b636d-dd7a-4b7f-ba27-643803c71aa3)

![image](https://github.com/go-gitea/gitea/assets/20454870/167a8d37-9a44-4479-9340-5dc80347b595)

![image](https://github.com/go-gitea/gitea/assets/20454870/2f99fec0-98ff-4ba8-97fe-b4567041ae79)

![image](https://github.com/go-gitea/gitea/assets/20454870/ffdeae11-fb06-4d00-b497-eae135f0d7ad)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
2024-03-23 12:18:40 +01:00
Gergely Nagy 6c330a85ec
Add tests for the "Open with" repository clone menu
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-23 11:58:54 +01:00
wxiaoguang eb4061baba
Move citiation button to proper place (#29374)
The citiation button shouldn't be controlled by
DisableDownloadSourceArchives (line 134)

So move it out of that "if" block.

Co-authored-by: Giteabot <teabot@gitea.io>
2024-03-23 11:58:54 +01:00
wxiaoguang 44221a3cd7
Customizable "Open with" applications for repository clone (#29320)
Users could customize the "clone" menu with their own application URLs on the admin panel.

Replace #22378
Close #21121
Close #22149
2024-03-23 11:58:54 +01:00
Gergely Nagy 3123725ff3
Revert "[GITEA] Configurable clone methods"
This reverts commit 1d8bca07f3.
2024-03-23 11:58:54 +01:00
Earl Warren 549720bbef
[CI] backport PRs with the label backport/v* 2024-03-23 11:43:55 +01:00
Earl Warren b7ee0b6ad2 Merge pull request '[RELEASE] v1.21.8-0 release notes' (#2722) from earl-warren/forgejo:wip-release-notes-1.21 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2722
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-22 13:26:06 +00:00
0ko 404101931a [I18N] Language selector: bg, fil, eo, sl
Resolves https://codeberg.org/forgejo/forgejo/issues/2422
2024-03-22 15:59:56 +05:00
Earl Warren f68100ceea Merge pull request '[CI] workerqueue attempt to fix flacky test' (#2721) from oliverpool/forgejo:queue_flaky_fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2721
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-22 09:14:00 +00:00
oliverpool fec49269c6 pull_request_template: test/needed label 2024-03-22 10:11:47 +01:00
oliverpool 8ac4538a00 issue_template: bug/new-report label 2024-03-22 10:11:35 +01:00
Earl Warren 1d530ba022
[RELEASE] v1.21.8-0 release notes 2024-03-22 09:02:57 +01:00
oliverpool 5c248adcf1 [CI] workerqueue attempt to fix flacky test 2024-03-22 08:52:16 +01:00
Earl Warren 0aa77d0b9e Merge pull request 'Add plural support for PR subtitles' (#2614) from 0ko/forgejo:prplu into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2614
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-22 06:14:10 +00:00
0ko 60a9df1908
Add test for pull summary 2024-03-22 07:11:52 +01:00
0ko debeedfe42
Add plural support for PR subtitles 2024-03-22 07:11:24 +01:00
Codeberg Translate 489805c322 [I18N] Translations update from Weblate (#2710)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Fjuro <Fjuro@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <Wuzzy@users.noreply.translate.codeberg.org>
Co-authored-by: be4zad <be4zad@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Mumulhl <mumulhl@duck.com>
Co-authored-by: ormai <ormai@users.noreply.translate.codeberg.org>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2710
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-03-22 06:02:26 +00:00
0ko 8e1b6a4090 Add test for add/remove WIP link display 2024-03-21 19:33:02 +05:00
Gergely Nagy 36147f580c
Allow users to hide all "Add more units..." hints
Repositories displaying an "Add more..." tab on the header is a neat way
to let people discover they can enable more units. However, displaying
it all the time for repository owners, even when they deliberately do
not want to enable more units gets noisy very fast.

As such, this patch introduces a new setting which lets people disable
this hint under the appearance settings.

Fixes #2378.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-21 08:15:51 +01:00
Earl Warren 96d2f2b8cd Merge pull request 'Fix repo badges when the label or text contains dashes' (#2711) from algernon/forgejo:badges/dash-encoding into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2711
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-21 07:05:34 +00:00
Gergely Nagy 8433f3aa09
Fix repo badges when the label or text contains dashes
shields.io uses dashes to separate parts of the badge it needs to
return. If our label or text parts contain dashes, we need to encode
those for shields.io to recognise what we want it to do, and to have the
correct text on the badge, too.

Fortunately, this is as simple as replacing all dashes with double
dashes in both the label and the text parts. We do not need to do the
same for the color, because that part is not user controlled.

This fixes the badges for cases when a workflow name includes dashes, or
when a release's tag name does.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-20 22:41:20 +01:00
Earl Warren 3fb488e80d Merge pull request '[CI] simplify running end-to-end tests while building a release' (#2709) from earl-warren/forgejo:wip-release into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2709
2024-03-20 20:14:52 +00:00
Earl Warren 03aebc4b0f
[CI] simplify running end-to-end tests while building a release 2024-03-20 20:20:42 +01:00
Earl Warren 89f8d33127 Merge pull request '[CI] simplify end-to-end test cascading PR' (#2706) from wip-ci-end-to-end into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2706
2024-03-20 18:12:41 +00:00
Earl Warren a1889ac348
[CI] simplify end-to-end test cascading PR
Closes: https://codeberg.org/forgejo/forgejo/issues/2670
2024-03-20 18:16:56 +01:00
Shiny Nematoda 4a061ca26c simplify template 2024-03-20 12:31:36 +00:00
Shiny Nematoda ed15c92668 fixes for port 2024-03-20 12:31:36 +00:00
Denys Konovalov 847f03b6a6 Unify search boxes (#29530)
Unify all but a few search boxes to use uniform style, uniform
translations and shared templates where possible.
Remove a few duplicated search templates, e. g. code search.

<details><summary>Example after screenshots:</summary>

![grafik](https://github.com/go-gitea/gitea/assets/47871822/e20e7d6b-c6be-4a47-b132-672766f41421)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/d5b11b9c-c12f-4a29-8fb0-24e5aa511d18)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/d86bb444-36c7-426d-9cf1-c634963dffb1)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/a76c0319-0518-484a-a840-563d02b61198)

</details>

Also includes #29700

Co-authored-by: 6543 <6543@obermui.de>

---------

Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
Conflicts:
	routers/web/repo/search.go
	templates/repo/home.tmpl
	templates/repo/search.tmpl
	templates/shared/repo_search.tmpl
2024-03-20 12:31:05 +00:00
Earl Warren 6d340bcfea Merge pull request 'Update look of repo/org tabs on homepage' (#2593) from 0ko/forgejo:hometab into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2593
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-20 11:45:17 +00:00
Earl Warren d4f067c6f9 Merge pull request '[CI] attempt to fix flacky test' (#2704) from oliverpool/forgejo:workerqueue_flaky_test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2704
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-20 11:38:54 +00:00
Earl Warren 84f33ead4e Merge pull request '[BUG] Reflect Cargo index state in settings' (#2698) from gusted/forgejo-cargo-index into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2698
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-20 11:38:26 +00:00
Earl Warren 468b879fe8 Merge pull request '[PORT] add skip ci support for pull request title (#29774)' (#2701) from earl-warren/forgejo:wip-gitea-skip-ci into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2701
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-20 11:34:49 +00:00
oliverpool 9b3bfd0585 [CI] attempt to fix flacky test 2024-03-20 11:06:44 +01:00
Gusted b06110715c Merge pull request 'Accessibility: Label Stars/Forks links in repo explore' (#2634) from fnetx/explore-label into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2634
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-20 08:20:32 +00:00
Gusted 461f925554
[BUG] Reflect Cargo index state in settings
- Currently in the Cargo section of the packages setting menu two
buttons are always shown, "Initalize index" and "Rebuild index", however
only of these should be shown depending on the state of the index, if
there's no index the "Initalize index" button should be shown and if
there's an index the "Rebuild index" button should be shown. This patch
does exactly that.
- Resolves #2628
2024-03-20 09:17:49 +01:00
Earl Warren 2f78daa3af Merge pull request '[gitea] week 12 cherry-pick' (#2679) from algernon/forgejo:wcp/week-12 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2679
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-20 08:15:06 +00:00
Earl Warren dd884cde6c Merge pull request 'Plurals and translations for heatmap (take 2)' (#2702) from earl-warren/forgejo:wip-heatmap-i18n into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2702
2024-03-20 07:54:19 +00:00
Gergely Nagy adbc5d206b
[DEADCODE] update
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-20 08:46:30 +01:00
silverwind f2fc2dcfc9
Load citation JS only when needed (#29855)
Previously, the citation js would load every time when opening a citable
repo. Now it only loads when the user clicks the button for it. The
loading state is representend with a spinner on the button:

<img width="83" alt="Screenshot 2024-03-17 at 00 25 13"
src="https://github.com/go-gitea/gitea/assets/115237/29649089-13f3-4974-ab81-e12c0f8e651f">

Diff ist best viewed with whitespace hidden.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 4b1c88628a6856e533ff10d346ca5bd73ce952b3)
2024-03-20 08:46:30 +01:00
silverwind f4ed953b1b
Fix semantic.json (#29860)
Followup https://github.com/go-gitea/gitea/pull/29856

(cherry picked from commit c20b56815d4f27ffd1b457ec238e494adc5fba81)
2024-03-20 08:46:30 +01:00
norohind d74f74a025
Fix PR creation via api between branches of same repo with head field namespaced (#26986)
Fix #20175

Current implementation of API does not allow creating pull requests
between branches of the same
repo when you specify *namespace* (owner of the repo) in `head` field in
http request body.

---

Although GitHub implementation of API allows performing such action and
since Gitea targeting
compatibility with GitHub API I see it as an appropriate change.

I'm proposing a fix to the described problem and test case which covers
this logic.

My use-case just in case:
https://github.com/go-gitea/gitea/issues/20175#issuecomment-1711283022

(cherry picked from commit ed02d1fab85c9b8206c0af84dcfc3792e61609cf)
2024-03-20 08:46:30 +01:00
silverwind cd83e8bce6
Remove fomantic message module (#29856)
Remove this CSS-only module, which gives a nice reduction in CSS size.
Should look exactly like before.

(cherry picked from commit 4e547822f348c2963e0db33135b45d43dfc58df8)
2024-03-20 08:46:30 +01:00
silverwind 547a619744
fix double border and border-radius on empty action steps (#29845)
Before, double border-bottom and incorrect border-radius:

<img width="914" alt="Screenshot 2024-03-16 at 14 46 31"
src="https://github.com/go-gitea/gitea/assets/115237/6ea63c42-754c-420c-a0f5-c889a8507d9f">

After, both fixed:

<img width="917" alt="Screenshot 2024-03-16 at 14 45 59"
src="https://github.com/go-gitea/gitea/assets/115237/9d3f2dba-6b22-441d-8e99-5809d5f1f1c0">

(cherry picked from commit 43aa914b1750add631698a7fd57d76f743b0489b)
2024-03-20 08:46:30 +01:00
silverwind b9ef8b7839
add `.suppressed` link class (#29847)
Extract from https://github.com/go-gitea/gitea/pull/29344. With this
class it's possible to have links that don't color on hover. It will be
useful for https://github.com/go-gitea/gitea/pull/29429.

(cherry picked from commit ffeaf2d0bd6c99c486aa7869779bb9ceb0aedad6)
2024-03-20 08:46:30 +01:00
Gergely Nagy 4db9cbc29c
Forbid jQuery `.prop` and fix related issues (#29832) (followup)
Fixes the remaining jQuery `.prop()` uses.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-20 08:46:30 +01:00
silverwind 18256b024e
Forbid jQuery `.prop` and fix related issues (#29832)
The issue checkbox code received a few more cleanups and I specifically
tested it. The other changes are trivial. Also, I checked the cases for
how many elements match the jQuery selection to determine querySelector
vs. querySelectorAll.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 21fe512aac42c9ce3440b8eaae6b2cb2116a0e50)
2024-03-20 08:46:30 +01:00
Yarden Shoham c1b6182625
Forbid HTML injection using jQuery (#29843)
See
https://github.com/wikimedia/eslint-plugin-no-jquery/blob/master/docs/rules/no-append-html.md

Tested the following components and they work as before:
- notification table
- issue author dropdown
- comment edit box attachments div

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit f9b4efd42c17d7f75b689142b17575a478fe903c)
2024-03-20 08:46:30 +01:00
6543 9ea9b850da
Meilisearch double quote on "match" query (#29740)
make `nonFuzzyWorkaround` unessesary

cc @Kerollmops

(cherry picked from commit c6e5ec51bd5d2d3ede30b7506e7cc47f18a49ca8)
2024-03-20 08:46:30 +01:00
Yarden Shoham d5f44c2499
Forbid variables containing jQuery collections not having the `$` prefix (#29839)
See
https://github.com/wikimedia/eslint-plugin-no-jquery/blob/master/docs/rules/variable-pattern.md

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 3cd64949ae1402a4ff45fba0a27c4acca1c5aead)
2024-03-20 08:46:30 +01:00
Yarden Shoham 96e5d38b55
Forbid jQuery AJAX (#29818)
Please use the fetch wrapper instead, or even better `htmx`.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: 6543 <6543@obermui.de>
(cherry picked from commit 6ead30dbc469803d7e8361b13217e07d87d6f80d)
2024-03-20 08:46:30 +01:00
Yarden Shoham afc27fb2a3
Remove jQuery AJAX from the notifications (#29817)
- Removed 2 jQuery AJAX calls and replaced with our fetch wrapper
- Deleted an AJAX call that wasn't attached to any element since #24989
- Tested the notification count and notification table functionality and
it works as before

# Demo using `fetch` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/ff862a9a-1c88-41cc-bd01-5a0711dbd6f8)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 043f55fabfadd765125690052920ba31ebd3817b)
2024-03-20 08:46:30 +01:00
silverwind 23e2ace77d
Light theme color enhancements (#29830)
Same as https://github.com/go-gitea/gitea/pull/29822 but for light
theme. Slight shift towards blue and made the themes match more, like on
header and footer background.

Before
<img width="1342" alt="Screenshot 2024-03-16 at 00 43 03"
src="https://github.com/go-gitea/gitea/assets/115237/b46021a1-241c-446a-b220-ca25cc90f3bf">

After
<img width="1343" alt="Screenshot 2024-03-16 at 00 45 21"
src="https://github.com/go-gitea/gitea/assets/115237/1c898875-a6bb-4bd3-b059-f82e1a145c99">

Before
<img width="1018" alt="Screenshot 2024-03-16 at 00 43 13"
src="https://github.com/go-gitea/gitea/assets/115237/d237ee7d-b4cc-4688-a074-1e96515ac475">

After
<img width="1022" alt="Screenshot 2024-03-16 at 00 43 50"
src="https://github.com/go-gitea/gitea/assets/115237/89b1da77-6bc9-4b38-9688-546e794aadfa">

(cherry picked from commit 68169133a3b0d29fe348ee065088d33f6dd1b087)
2024-03-20 08:46:30 +01:00
Yarden Shoham 24305e4d09
Remove the `time-since` class (#29826)
It serves no purpose.

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 3f1e4896b6d71dc061e23fa2dcac4c1b7d412540)
2024-03-20 08:46:30 +01:00
Yarden Shoham b97b1d03cf
Remove jQuery AJAX from the project page (#29814)
Removed all jQuery AJAX calls and replaced with our fetch wrapper.

Tested the following functionalities and they work as before:
- column creation
- column deletion
- issue movement between columns
- column reordering
- column edit
- default column changing

# Demo using `fetch` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/99e6898f-baa3-462c-acec-46a910874dbe)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 397997093870226dafb70c4a3133f2ebe0fe3e2c)
2024-03-20 08:46:30 +01:00
Yarden Shoham 61e123bdc2
Upgrade `htmx` to v1.9.11 (#29821)
Also added BSD Zero Clause License to the list of allowed licenses in
webpack.

Tested various `htmx` operations. Nothing broke.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit c00633971a4e66835fffe7cfcea0f427689cf550)
2024-03-20 08:46:30 +01:00
silverwind 704a59e595
Dark theme color enhancements (#29822)
- Few very minor colors tweaks to dark theme. Slightly darker
background, slightly bluer secondary colors.
- Alias `--color-nav-hover-bg` in both themes.

Before:
<img width="1013" alt="Screenshot 2024-03-15 at 18 43 59"
src="https://github.com/go-gitea/gitea/assets/115237/ce4bdb0d-6e25-4fd6-88f5-dc8f9e3093cd">

After:
<img width="1016" alt="Screenshot 2024-03-15 at 19 02 04"
src="https://github.com/go-gitea/gitea/assets/115237/4a6dd5a1-a5b4-4fc2-9835-05a0c2c58c42">

Before:
<img width="1340" alt="Screenshot 2024-03-15 at 18 40 19"
src="https://github.com/go-gitea/gitea/assets/115237/4465fa9c-d529-4a05-94d7-e21080e0a153">

After:
<img width="1341" alt="Screenshot 2024-03-15 at 19 00 51"
src="https://github.com/go-gitea/gitea/assets/115237/6595afef-592b-42c4-a6cd-196968ba5881">

(cherry picked from commit aa3012849ea59cdfb8464b0b71f28bffad19d54c)
2024-03-20 08:46:30 +01:00
Yarden Shoham 1e16dd9c9b
Remove jQuery AJAX from the comment edit box (#29812)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the file addition and removal functionality and it works as
before

# Demo using `fetch` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/846ed6d5-3798-43ca-920c-d619e9c3d745)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit bfb0a5a41ecb040f66ab664e22250571f339826a)
2024-03-20 08:46:29 +01:00
Yarden Shoham a1bdf214ab
Fix `for` attribute not pointing to the ID of the color picker (#29813)
It didn't include the word picker.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 3b6e57273ae3fbefefd60daa0f826b0b3d15cf27)
2024-03-20 08:46:29 +01:00
coldWater 94c70c7753
Refactor graceful manager, fix misused WaitGroup (#29738)
Follow #29629

(cherry picked from commit d08f4360c96e130e0454b76ecef9405f2bd312a1)
2024-03-20 08:46:29 +01:00
silverwind 1a17c39e00
Use `Temporal.PlainDate` for absolute dates (#29804)
Use the upcoming
[Temporal.PlainDate](https://tc39.es/proposal-temporal/docs/plaindate.html)
via polyfill. If there is any remaining bugs in `<absolute-date>` this
will iron them out. I opted for the lightweight polyfill because both
seem to achieve our goal of localizeable absolute dates.

- With
[`@js-temporal/polyfill`](https://www.npmjs.com/package/@js-temporal/polyfill)
chunk size goes from 81.4 KiB to 274 KiB
- With
[`temporal-polyfill`](https://www.npmjs.com/package/temporal-polyfill)
chunk size goes from 81.4 KiB to 142 KiB

Also see [this
table](https://github.com/fullcalendar/temporal-polyfill?tab=readme-ov-file#comparison-with-js-temporalpolyfill)
for more comparisons of these polyfills. Soon there will be
[treeshakable
API](https://github.com/fullcalendar/temporal-polyfill?tab=readme-ov-file#tree-shakable-api)
as well which will further reduce size.

(cherry picked from commit 0d3ec8e2adfcf49329b52d74367698b62ffb3f73)
2024-03-20 08:46:29 +01:00
silverwind ab01aac0c0
Remove scrollbar customizations (#29800)
Fixes https://github.com/go-gitea/gitea/issues/29652. Removes all
scrollbar customization as per popular vote on
https://github.com/go-gitea/gitea/issues/29652#issuecomment-1985846162.

There is one more case of `-webkit-scrollbar` left in CSS and
https://github.com/go-gitea/gitea/pull/29400 will get rid of that as
well.

(cherry picked from commit 0827552d9ab6bec5fccef86139cbad3ae7b582b7)
2024-03-20 08:46:29 +01:00
silverwind ca39d74363
Fix Citation modal responsiveness and clipboard copy (#29799)
The modal was broken in two ways:

- On small screens, the input box was partially hanging outside the
modal. Fixed with flexbox and increased modal width.
- The clipboard copy was not working because the modal had both
`data-clipboard-text` and `data-clipboard-target`, while we only support
one of those. Made a small tweak in clipboard as well so that it will
still fall back to target if text is empty.

(cherry picked from commit 94512ee0628dc0d2b697441a4355ace54b6515cd)
2024-03-20 08:46:29 +01:00
silverwind 5a16c9d9c0
Add `<overflow-menu>`, rename webcomponents (#29400)
1. Add `<overflow-menu>` web component
2. Rename `<gitea-origin-url>` to `<origin-url>` and make filenames
match.

<img width="439" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/2fbe4ca4-110b-4ad2-8e17-c1e116ccbd74">

<img width="444" alt="Screenshot 2024-03-02 at 21 36 52"
src="https://github.com/go-gitea/gitea/assets/115237/aa8f786e-dc8c-4030-b12d-7cfb74bdfd6e">

<img width="537" alt="Screenshot 2024-03-03 at 03 05 06"
src="https://github.com/go-gitea/gitea/assets/115237/fddd50aa-adf1-4b4b-bd7f-caf30c7b2245">

![image](https://github.com/go-gitea/gitea/assets/115237/0f43770c-834c-4a05-8e3d-d30eb8653786)

![image](https://github.com/go-gitea/gitea/assets/115237/4b4c6bd7-843f-4f49-808f-6b3aed5e9f9a)

TODO:

- [x] Check if removal of `requestAnimationFrame` is possible to avoid
flash of content. Likely needs a `MutationObserver`.
- [x] Hide tippy when button is removed from DOM.
- [x] ~~Implement right-aligned items
(https://github.com/go-gitea/gitea/pull/28976)~~. Not going to do it.
- [x] Clean up CSS so base element has no background and add background
via tailwind instead.
- [x] Use it for org and user page.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 256a1eeb9a67b18c62a10f5909b584b7b220848a)

Conflicts:
	options/locale/locale_en-US.ini
	templates/package/content/cargo.tmpl
	templates/package/content/cran.tmpl
	templates/package/content/debian.tmpl
	templates/package/content/maven.tmpl
2024-03-20 08:46:29 +01:00
silverwind b73ed15209
Update JS dependences (#29797)
Update all non-excluded JS deps, tested monaco, swagger and mermaid.

(cherry picked from commit 4a377c033608d64a7a3e352d1a55955dcc988f87)
2024-03-20 08:46:29 +01:00
Daniel YC Lin 4eb8a09423
Fix document error about 'make trans-copy' (#29710)
Change document to 'make docs'

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
(cherry picked from commit 607ed27b4fb8ead346f89b379d9788f5c76fb799)
2024-03-20 08:46:29 +01:00
Yarden Shoham edf28c7432
Remove jQuery AJAX from the diff functions (#29743)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the review conversation comment, resolve, unresolve, show more
files, and load diff functionality and it works as before

![demo](https://github.com/go-gitea/gitea/assets/20454870/cc0bed59-f11f-4e48-bfa3-59ab52d9889e)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 70e077036f8d3026cecddb746a1de69e02ab9b9a)

Conflicts:
	web_src/js/features/repo-diff.js
2024-03-20 08:46:29 +01:00
silverwind 9df7f56361
Fix Safari spinner rendering (#29801)
Fixes: https://github.com/go-gitea/gitea/issues/29041
Fixes: https://github.com/go-gitea/gitea/pull/29713

Any of the `width: *-content` properties seem to workaround this Webkit
bug, this one seemed most suitable.

(cherry picked from commit 35def319fdb8c73aa5e2c52fad5230d287e2bd93)
2024-03-20 08:46:29 +01:00
Yarden Shoham f4d75ed41a
Remove jQuery AJAX from the `repo-issue.js` file (#29776)
Removed all jQuery AJAX calls and replaced with our fetch wrapper.

Tested the following functionalities and they work as before:
- due-date update
- comment deletion
- branch update by merge or rebase
- allow edits from maintainers button
- reviewer addition or deletion
- WIP toggle button
- new diff code comment button
- issue title edit button

# Demo using `fetch` instead of jQuery AJAX
## Updating the due-date of an issue

![due_date](https://github.com/go-gitea/gitea/assets/20454870/7de395d3-63e8-49e8-9a13-8d14fc26810d)

## Deleting a comment

![comment_delete](https://github.com/go-gitea/gitea/assets/20454870/2814e695-44e3-4548-9ee7-7b437bef4b01)

## Updating a branch in a pull request

![branch_update](https://github.com/go-gitea/gitea/assets/20454870/137da77e-acc4-4984-a1bc-be58583bf52a)

## Checking and unchecking the "Allow edits from maintainers" checkbox

![allow_edits](https://github.com/go-gitea/gitea/assets/20454870/8d4829af-5813-432d-90ef-da057f8cdafc)

## Requesting review and removing review request

![reviewer_addition](https://github.com/go-gitea/gitea/assets/20454870/08f210e0-be3f-41af-b271-214a1dd2d0ba)

## Toggling the WIP status of a pull request

![wip](https://github.com/go-gitea/gitea/assets/20454870/dea5e668-1c89-4f3d-a5d6-4c26aefc4814)

## Clicking the new code comment button on the diff page

![code_comment](https://github.com/go-gitea/gitea/assets/20454870/1d17174e-3bba-4cf8-81fe-c3a2c21f80b9)

## Editing the issue title and target branch

![issue_title](https://github.com/go-gitea/gitea/assets/20454870/7099888e-81c0-47d4-9371-8e4469e9e519)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 0679e60c776cd45f32acc12f52fe41b627da57e9)
2024-03-20 08:46:29 +01:00
yp05327 ed1798f66d
Improve commit record's ui in comment list (#26619)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/795f9941-9989-4045-b0fc-d6dd0262269b)

![image](https://github.com/go-gitea/gitea/assets/18380374/f6505f5e-4248-456e-a98d-e714c6484b2f)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/321dda1e-6999-4851-afff-2e6c8d20367b)

![image](https://github.com/go-gitea/gitea/assets/18380374/182f18d1-2295-4004-852b-c0ebb498b411)

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit ce085b26fc5076b36c55e6a0a30ba8f11105c0bf)
2024-03-20 08:46:29 +01:00
Rafael Heard 989dc10cf2
enable tailwind nesting (#29746)
Currently, if you implement native CSS nesting within a Vue component a
warning will appear in the terminal. It states
`Nested CSS was detected, but CSS nesting has not been configured
correctly.
Please enable a CSS nesting plugin *before* Tailwind in your
configuration.` To fix this error we need to enable the built-in
[tailwinds nesting
config](https://tailwindcss.com/docs/using-with-preprocessors#nesting).

Example code to trigger the warning within a vue component:

```CSS
<style>
.example {
  &:hover,
  &:focus-visible {
    color: var(--color-text);
  }

  & svg {
    margin-right: 0.78rem;
  }
}
</style>
```

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 03753cbc0ff68cc4eee0a65b556e6d86a8f1c63f)
2024-03-20 08:46:29 +01:00
Jason Song 9d08d00dbf
Support GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT env (#29788)
It is convenient to skip by setting environment, since it's OK
to use root user in job containers.

It's not a bug, but I want to backport it to v1.21 since it doesn't
break anything.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 487ac9bf6c239ce897f1a2f6c4321d6f1769a22f)
2024-03-20 08:46:29 +01:00
silverwind 4069429114
Tweak actions view sticky (#29781)
Add some space when the left side items are sticky due to scrolling the
right side.

<img width="419" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/292e1b03-a071-4744-bb79-e50d109056c8">

(cherry picked from commit eb8c34fc367f324226625d39d0487f945269cd73)
2024-03-20 08:46:29 +01:00
coldWater d413a8fcac
Refactor markup/csv: don't read all to memory (#29760)
(cherry picked from commit e79a807a8461a73bd66146d816f635b66e198c89)
2024-03-20 08:46:29 +01:00
yp05327 2da0628f18
Fix incorrect menu/link on webhook edit page (#29709)
Fix #29699

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 2da13675c0cfdc531044553636c3b74f2fda3eb4)
2024-03-20 08:46:29 +01:00
wxiaoguang 071d871dcf
Fix incorrect locale Tr for gpg command (#29754)
(cherry picked from commit df60dbfb9918081962614d063485337fb42e0ee7)
2024-03-20 08:46:29 +01:00
wxiaoguang 5bb08e2bd7
Improve QueryEscape helper function (#29768)
Make it return "template.URL" to follow Golang template's context
auto-escaping.

(cherry picked from commit 3e94ac5c7c6751919453fdb66ba3472e2793759e)
2024-03-20 08:46:29 +01:00
Gergely Nagy 3bd42e5879
Use relative links for commits, mentions, and issues in markdown (#29427) (followup)
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-20 08:46:28 +01:00
KN4CK3R 024bfb7f34
Use relative links for commits, mentions, and issues in markdown (#29427)
Fixes #29404

Use relative links for
- commits
- mentions
- issues

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 85c59d6c21e10ef9d3ccf11713548f50e47e920f)
2024-03-20 08:46:28 +01:00
silverwind e2abfdc3a4
Configure pinned JS dependencies via updates.config.js (#29696)
Split out from https://github.com/go-gitea/gitea/pull/29684. This
configures the [`updates`](https://github.com/silverwind/updates) module
to exclude these modules for reasons stated in the comments.

(cherry picked from commit 9b1a8888fa754676073bc851b783b2b8f1adecfb)
2024-03-20 08:46:28 +01:00
6543 d9103449b3
Refactor to use optional.Option for issue index search option (#29739)
Signed-off-by: 6543 <6543@obermui.de>
(cherry picked from commit 7fd0a5b276aadcf88dcc012fcd364fe160a58810)
2024-03-20 08:46:28 +01:00
silverwind f98211f13a
Fix date rendering by adding `<gitea-absolute-date>` (#29725)
Alternative to: https://github.com/go-gitea/gitea/pull/29698
Fixes: https://github.com/go-gitea/gitea/issues/29034

<img width="278" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/12ecd967-2723-410d-8a28-a1b0f41b7bba">

It also fixes a secondary issue that we were showing timestamp tooltips
over date, which makes no sense, so these are now gone as well:

<img width="284" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/a70432f3-97b6-41e6-b202-b53b76924a66">

(cherry picked from commit 857243bed7f9dccdc597c2941df41e821781cb0f)
2024-03-20 08:46:28 +01:00
JakobDev 0a88259df4
Update Chroma to v2.13.0 (#29732)
This adds new lexers and includes some fixes. See
https://github.com/alecthomas/chroma/releases/tag/v2.13.0 for the full
changelog.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 3e7ae79f99ef0e5ba3d1201c38f491121ea2a156)
2024-03-20 08:46:28 +01:00
Lunny Xiao 926367fe1d
Add more stats tables (#29730)
Add `Tags`, `Branches` and `CommitStatus` to monitor/stats

(cherry picked from commit e5e2b2fcd7e8446f99e8eb61eef9efe2790220c8)
2024-03-20 08:46:28 +01:00
Lunny Xiao fc8799f269
Use Get but not Post to get actions artifacts (#29734)
(cherry picked from commit 171d3d9a3c891d107001094b9118d93b0b00c02c)

Conflicts:
	routers/web/web.go
2024-03-20 08:46:28 +01:00
Lunny Xiao d996c5d517
Some performance optimization on dashboard and issues page (#29010)
This PR do some loading speed optimization for feeds user interface
pages.
- Load action users batchly but not one by one.
- Load action repositories batchly but not one by one.
- Load action's Repo Owners batchly but not one by one.
- Load action's possible issues batchly but not one by one.
- Load action's possible comments batchly but not one by one.

(cherry picked from commit aed3b53abdd02a3ffbf9e8eb90272ff567333073)
2024-03-20 08:46:28 +01:00
Yarden Shoham 3acb68e5e4
Remove jQuery AJAX from the issue branch reference selection (#29722)
- Replaced a single jQuery AJAX instance with our fetch wrapper
- Tested the issue branch reference selection and it works as before

# Demo using `fetch` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/7e195632-41f8-494b-b599-f6291860f330)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 75a9f61f89caada64f6398130844281e4f088a73)
2024-03-20 08:46:28 +01:00
Lunny Xiao c9d9255244
Lazy load object format with command line and don't do it in OpenRepository (#29712)
Most time, when invoking `git.OpenRepository`, `objectFormat` will not
be used, so it's a waste to invoke commandline to get the object format.
This PR make it a lazy operation, only invoke that when necessary.

(cherry picked from commit e84e5db6de0306d514b1f1a9657931fb7197a188)
2024-03-20 08:46:28 +01:00
pengqiseven e825d007b1
remove repetitive words (#29695)
Signed-off-by: pengqiseven <912170095@qq.com>
(cherry picked from commit 7f856d5d742dcb6febdb8a3f22cd9a8fecc69a4d)
2024-03-20 08:46:28 +01:00
Zettat123 2559c80bec
Add a warning for disallowed email domains (#29658)
Resolve #29660

Follow #29522 and #29609

Add a warning for disallowed email domains when admins manually add/edit
users.

Thanks @yp05327 for the
[comment](https://github.com/go-gitea/gitea/pull/29605#issuecomment-1980105119)

![image](https://github.com/go-gitea/gitea/assets/15528715/6737b221-a3a2-4180-9ef8-b846c10f96e0)

(cherry picked from commit 4129e0e79bbf30e4297efd33feb2602c40322d10)
2024-03-20 08:46:28 +01:00
yp05327 b6e480fcbb
Fix inconsistent rendering of block mathematical expressions (#29677)
Fix #28735

GitHub render `\```math\``` ` as a block now.
Add `display` class will render it as a block.

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/2a1c20c7-438e-4ab1-8c66-cf91c8343087)

![image](https://github.com/go-gitea/gitea/assets/18380374/b81b8a93-8bca-46a5-b7db-e0d2f53e1342)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 8fc1a8f0eb642c574610a346e858d42c433ebe01)
2024-03-20 08:46:28 +01:00
Lunny Xiao 69ebc2f7d8
Use repo object format name instead of detecting from git repository (#29702)
It's unnecessary to detect the repository object format from git
repository. Just use the repository's object format name.

(cherry picked from commit 3c6fc25a77c37d50686caa495d27a31dcef7f75f)

Conflicts:
	services/pull/pull.go
2024-03-20 08:46:28 +01:00
Yarden Shoham 32dd02829e
Remove jQuery AJAX from the comment edit history (#29703)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the comment edit history list, diff, and delete functionality
and it works as before

# Demo using `fetch` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/e8c557bc-f2b9-4d73-b55e-0850c1b19364)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit b5ed42864e306f22305beba50d6ff71df2aea0c6)
2024-03-20 08:46:28 +01:00
0ko 26e4af4268
Fix heatmap localization
Fixes #2552

(cherry picked from commit 708f4bc3b6)
2024-03-20 08:20:08 +01:00
Codeberg Translate cc1c000ac8 [I18N] Translations update from Weblate (#2645)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: kita <kita@users.noreply.translate.codeberg.org>
Co-authored-by: Panagiotis \"Ivory\" Vasilopoulos <git@n0toose.net>
Co-authored-by: earl-warren <earl-warren@users.noreply.translate.codeberg.org>
Co-authored-by: yeziruo <yeziruo@users.noreply.translate.codeberg.org>
Co-authored-by: Fjuro <Fjuro@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <Gusted@users.noreply.translate.codeberg.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: Zughy <Zughy@users.noreply.translate.codeberg.org>
Co-authored-by: mumulhl <mumulhl@users.noreply.translate.codeberg.org>
Co-authored-by: mondstern <mondstern@users.noreply.translate.codeberg.org>
Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: Xinayder <Xinayder@users.noreply.translate.codeberg.org>
Co-authored-by: Mumulhl <mumulhl@duck.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2645
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-03-20 06:53:53 +00:00
Earl Warren ba75514887
Revert "Fix heatmap localization"
It conflicts with unmerged translations.

This reverts commit 708f4bc3b6.
2024-03-20 07:31:23 +01:00
Earl Warren 19d7ff9c9e
[TESTS] testPullCreate do not assume the default branch is master 2024-03-20 06:52:37 +01:00
Denys Konovalov d3d0c4cbe7
add skip ci support for pull request title (#29774)
Extends #28075 to support [skip ci] inside PR titles.

Close #29265

(cherry picked from commit 7a90e5954f8515329f20ff0e391130e1ee7b8864)

Conflicts:
	services/actions/notifier_helper.go
	tests/integration/actions_trigger_test.go
	conflicts easily resolved because of
	[TESTS] Convert more tests to CreateDeclarativeRepo
	[ACTIONS] skip superflous pull request synchronized event (#2314)
2024-03-20 06:07:50 +01:00
Otto Richter 9e69ef9c51 Label stars/forks link in repo explore 2024-03-19 23:38:08 +01:00
Gusted 4c40a261d5 Merge pull request '[BUG] Fix manual merge button' (#2696) from gusted/forgejo-manual-merge into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2696
Reviewed-by: Otto <otto@codeberg.org>
2024-03-19 18:43:27 +00:00
Gusted 9551c1a6f8
[BUG] Fix manual merge button
- Add `form-fetch-action` to indicate that this form POST to an link
that returns JSON and thus should be handled by Javascript code.
- Found by @fnetx
- Regression of https://codeberg.org/forgejo/forgejo/pulls/1793
2024-03-19 18:47:09 +01:00
Gusted 17ef8145a8 Merge pull request '[PORT] Refactor code_indexer to use an SearchOptions struct for PerformSearch (gitea#29724)' (#2686) from snematoda/port-29724 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2686
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-19 17:42:50 +00:00
Gusted 7cfdd51dd9 Merge pull request 'Use separate keys for tabs on login screen' (#2630) from 0ko/forgejo:signintabs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2630
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-19 14:56:03 +00:00
Earl Warren 1b74f8a266 Merge pull request '[CI] FORGEJO_VERSION drop "g" prefix' (#2694) from oliverpool/forgejo:drop_g_prefix_from_version into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2694
Reviewed-by: Otto <otto@codeberg.org>
2024-03-19 13:25:03 +00:00
Earl Warren 2c80727e8f Merge pull request 'Plurals and translations for heatmap' (#2612) from 0ko/forgejo:oneisone into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2612
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-19 13:24:12 +00:00
Gusted 37172e792a Merge pull request 'Delete redundant snap packaging receipe' (#2693) from popey/forgejo:forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2693
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-19 11:28:24 +00:00
0ko 708f4bc3b6 Fix heatmap localization
Fixes #2552
2024-03-19 14:37:03 +05:00
oliverpool f3180fa1d6 [CI] FORGEJO_VERSION drop "g" prefix
Added by git describe, but is confusing
2024-03-19 10:36:45 +01:00
Alan Pope 0095dff5e8 Merge branch 'forgejo' into forgejo 2024-03-19 09:29:19 +00:00
Alan Pope f5e3a13f44 Delete redundant snap packaging receipe
I'm working on the snap packaging over at https://codeberg.org/forgejo-contrib/snap  which makes this snapcraft.yaml outdated, redundant and potentially confusing for other developers.

Signed-off-by: Alan Pope <popey@noreply.codeberg.org>
2024-03-19 09:16:02 +00:00
oliverpool ce6db31efe Merge pull request '[Port] Sync branches to DB immediately when handle git hook calling gitea#29493' (#2684) from oliverpool/forgejo:sync_branch into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2684
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-19 08:37:30 +00:00
Earl Warren e05396fcdd Merge pull request 'Fixes for project selector in sidebar' (#2608) from 0ko/forgejo:projectsfix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2608
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-19 08:16:42 +00:00
Earl Warren 55f81e5a2e Merge pull request '[port] Improve CSV rendering (gitea#29638)' (#2687) from algernon/forgejo:gitea/port/29638 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2687
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-19 08:14:20 +00:00
Earl Warren c16866d4a5 Merge pull request 'English fixes and improvements' (#2631) from 0ko/forgejo:english20240311 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2631
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-19 08:09:27 +00:00
Ada 41676a8634 Fix #2512 /api/forgejo/v1/version auth check (#2582)
Add the same auth check and middlewares as the /v1/ API.
It require to export some variable from /v1 API, i am not sure if is the correct way to do

Co-authored-by: oliverpool <git@olivier.pfad.fr>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2582
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Ada <ada@gnous.eu>
Co-committed-by: Ada <ada@gnous.eu>
2024-03-19 07:16:19 +00:00
Gusted 1e292e9005 Merge pull request '[BUG] Make write and preview tabs interactive' (#2681) from gusted/forgejo-a11y-tabs into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2681
Reviewed-by: Otto <otto@codeberg.org>
2024-03-18 21:57:36 +00:00
Jason Song 375222a145 Sync branches first (gitea#29714)
Follow gitea#29493.

Sync branches to DB first, then trigger push events.
2024-03-18 17:39:34 +01:00
oliverpool 66a135f6f2 [BUG] Restore deleted branches 2024-03-18 17:39:14 +01:00
oliverpool 0a53eb838d use gitRepo.GetCommit directly
and give it a commitID instead of a branchName (a bit more correct and faster)
2024-03-18 17:38:58 +01:00
Jason Song 286d09203f Sync branches to DB immediately when handle git hook calling (gitea#29493)
Unlike other async processing in the queue, we should sync branches to
the DB immediately when handling git hook calling. If it fails, users
can see the error message in the output of the git command.

It can avoid potential inconsistency issues, and help #29494.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-03-18 17:38:01 +01:00
Gusted 7db592b9fd Merge pull request 'Fix must-change-password help dialog' (#2676) from famfo/forgejo:forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2676
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-03-18 16:22:00 +00:00
Gusted 847d969a8f Merge pull request 'routers: Minor code cleanup in UsernameSubRoute' (#2685) from algernon/forgejo:cleanup/UsernameSubRoute into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2685
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-18 16:19:01 +00:00
Gergely Nagy f756c3c8d0
Do not override the background for `.repository .data-table tr`
A previous commit (via gitea#29638) changed the `.repository .data-table
.tr` CSS rule to forcibly override the background to `none`. This, in
turn, disabled the even-odd row coloring.

Doing so should be a preference of the theme used, and should not be
enforced by the core CSS rules. This patch removes the override.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-18 14:15:27 +01:00
silverwind 602a6a92c2
Improve CSV rendering (#29638)
Before:

<img width="1332" alt="Screenshot 2024-03-06 at 21 42 17"
src="https://github.com/go-gitea/gitea/assets/115237/0ea07eee-31f8-4783-bd56-37bd8396f00d">

After:
<img width="1336" alt="Screenshot 2024-03-06 at 21 41 58"
src="https://github.com/go-gitea/gitea/assets/115237/eb7f9cc9-587f-4e3b-92bd-cc67ca639963">
2024-03-18 13:52:41 +01:00
Gergely Nagy 921d1283ed
routers: Minor code cleanup in UsernameSubRoute
The `reloadParam` function already calls `context.UserAssignmentWeb`
with the same parameters, there's no need to do it again.

Change cherry picked from gitea#29751.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-18 13:28:20 +01:00
6543 d5319feb85 Refactor code_indexer to use an SearchOptions struct for PerformSearch (#29724)
similar to how it's already done for the issue_indexer

---
*Sponsored by Kithara Software GmbH*

Conflicts:
	routers/web/repo/search.go
2024-03-18 12:25:05 +00:00
Mai-Lapyst ed8e8a792e
Run make fmt 2024-03-18 06:23:12 +01:00
Mai-Lapyst db6f6281fc
Add copyright & license header to file_preview.go 2024-03-18 06:21:35 +01:00
Mai-Lapyst 10bca456a9
Remove `rel` and `id` attributes that only add the linenumber to elements 2024-03-18 06:19:27 +01:00
Gusted b90fda395a
[BUG] Make write and preview tabs interactive
- Make the 'Write' and 'Preview' tabs of the markdown editor interactive
by adding `href="#"`, this causes it to appear in the document order and
that while focused pressing `Enter` fires a click event (which isn't the
case by doing `tabindex="0"`).
- Resolves #2675
2024-03-17 23:38:10 +01:00
0ko 4c1af0d9a6 [I18N] Fix capitalization in English and reword a few strings
fixes #2551
2024-03-17 21:04:11 +05:00
famfo e9bdca5f09
Fix must-change-password help dialog 2024-03-17 12:08:27 +01:00
Mai-Lapyst 8218e80bfc
Fix linting issues 2024-03-16 08:18:47 +01:00
Mai-Lapyst d789d33229
Split filePreviewPatternProcessor into a new type FilePreview and some functions to make code more maintainable 2024-03-16 08:09:49 +01:00
Mai-Lapyst 562e5cdf32
Get locales directly from context like the other code; add translations for subtitle 2024-03-16 01:17:04 +01:00
Mai-Lapyst 6721cba75b
Fix filePreviewPattern 2024-03-16 00:37:46 +01:00
Mai-Lapyst fae8d9f70d
Accept at minimum 4 chars for the commit sha 2024-03-15 23:54:07 +01:00
Mai-Lapyst 8309f008c2
Fix some code issues 2024-03-15 23:52:38 +01:00
Mai-Lapyst 781a37fbe1
Check error in GetRepoFileContent for io.ReadAll 2024-03-15 23:49:13 +01:00
Gusted 65f9319c8f Merge pull request '[Windows] prevent ? in testdata path' (#2668) from oliverpool/forgejo:prevent_windows_incompatibles_paths into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2668
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-15 14:40:53 +00:00
Gusted 314e5188d8 Merge pull request '[FIX] Display error message if doer is unable to fork' (#2649) from snematoda/fix-2504 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2649
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-03-15 14:12:59 +00:00
Mai-Lapyst 1d3240887c
Render inline file permalinks 2024-03-15 14:00:34 +01:00
oliverpool a3cdb5f2d3 [Windows] prevent ? in testdata path 2024-03-15 13:15:46 +01:00
Gusted d1e808f803 Merge pull request '[BUG] Use correct head commit for CODEOWNER' (#2658) from gusted/forgejo-codeowners-typo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2658
Reviewed-by: Otto <otto@codeberg.org>
2024-03-15 12:09:15 +00:00
Gusted cd7cdf06ed Merge pull request 'Fix milestone sorting translation keys' (#2644) from 0ko/forgejo:fix-the-sort-milestones-bug-noone-have-noticed-in-a-half-of-a-year into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2644
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-03-14 19:06:59 +00:00
0ko 008706a438 Offer to remove WIP: prefix in sidebar
Fixes https://codeberg.org/forgejo/forgejo/issues/2654
2024-03-14 20:59:57 +05:00
Gusted a4cc37b46a
[BUG] Use correct headcommitid
Regression of #2507, which switched the HEAD from `pr.GetGitRefName()`
to `pr.HeadCommitID` but it had to be `prInfo.HeadCommitID`. Resolves #2656
I was able to reproduce this locally with _some_ pull requests, haven't
been able to get a reproducer trough integration testing.
2024-03-14 16:15:56 +01:00
Shiny Nematoda 773048afa1 fix #2501 2024-03-14 12:34:41 +00:00
oliverpool 98f1fe7944 Makefile: check git diff exit-code (#2651)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2651
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-14 10:38:58 +00:00
Earl Warren 20e3e671c6 Merge pull request 'add bucket lookup type' (#2482) from jilen/forgejo:minio_bucket_lookup into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2482
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-14 09:50:12 +00:00
Gusted fbdda5d5b0 Merge pull request '[PORT] Test /user/settings/security auth sources' (#2641) from oliverpool/forgejo:security_test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2641
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-13 21:57:14 +00:00
Gusted e9ceed2030 Merge pull request '[BUG] Packagist webhook: support all events' (#2646) from oliverpool/forgejo:packagist_webhook_all_events into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2646
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-13 21:34:33 +00:00
0ko ec5c68da4f [I18N] Use separate keys for tabs on login screen 2024-03-13 21:03:09 +05:00
oliverpool a47a1e0777 [BUG] Packagist webhook: support all events
Fixes #2329
2024-03-13 09:27:12 +01:00
Earl Warren 226fa396df Merge pull request 'Accessibility: Taborder in repo explore' (#2636) from fnetx/explore-taborder into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2636
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-13 02:31:47 +00:00
Earl Warren 0b2bae5517 Merge pull request '[gitea] Week 11 cherry-pick' (#2620) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2620
2024-03-13 00:44:21 +00:00
Codeberg Translate 6e9f6869bf [I18N] Translations update from Weblate (#2588)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Fjuro <ifjuro@proton.me>
Co-authored-by: Dirk <dirk@0x7be.de>
Co-authored-by: Panagiotis \"Ivory\" Vasilopoulos <git@n0toose.net>
Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: WithLithum <withlithum@outlook.com>
Co-authored-by: jadedctrl <jadedctrl@posteo.at>
Co-authored-by: mondstern <mondstern@monocles.de>
Co-authored-by: MatseVH <matse.vanhorebeek@gmail.com>
Co-authored-by: Fjuro <Fjuro@users.noreply.translate.codeberg.org>
Co-authored-by: mondstern <mondstern@users.noreply.translate.codeberg.org>
Co-authored-by: Dirk <Dirk@users.noreply.translate.codeberg.org>
Co-authored-by: EOWNERDEAD <eownerdead@disroot.org>
Co-authored-by: Kaede Fujisaki <ledyba@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <Gusted@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2588
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-03-13 00:41:03 +00:00
0ko e2394222b2 [BUG] Fix milestone sorting translation keys 2024-03-12 22:04:44 +05:00
oliverpool d49c116ce5 [PORT] Test /user/settings/security auth sources 2024-03-12 15:41:10 +01:00
Otto Richter 7dc453bb39 Remove inputs in dropdowns from taborder
Inputs are normally present in the taborder of a website. When they are
inside a dropdown, this means a user could theoretically also tab
through them.

With the current dropdown approach, however, this can result in the
focus being trapped, because the dropdown is closed after the focus
switches to the next element.

In this case, the focus moves to the end of the page, breaking keyword
navigation and making parts of the page inaccessible with a keyboard.

I was only able to reproduce this in Firefox.

This patch removes inputs inside dropdowns from taborder. It should be
generally safe even with potential side-effects, because *nothing*
inside dropdowns should be in the tab order.

This is a hotfix for https://codeberg.org/forgejo/forgejo/issues/2635,
but I acknowledge it is not an ideal solution.
2024-03-12 02:24:17 +01:00
Otto Richter 16a63a16b3 Playwright e2e test for taborder
This should be a failing test for Firefox (but working in Chrome?) for
the taborder in the explore page.

Tabbing through the page should ensure that certain elements are focused
at least once.
2024-03-12 02:23:29 +01:00
oliverpool 63973e2c70
add repo_settings_hook_test 2024-03-11 23:37:00 +07:00
oliverpool 12e317c198
add test for webhook migration 2024-03-11 23:37:00 +07:00
oliverpool ed6f724a5d
add test for webhook default method
https://github.com/go-gitea/gitea/pull/29690
2024-03-11 23:37:00 +07:00
Earl Warren c243323b4a
[DEADCODE] update 2024-03-11 23:37:00 +07:00
Lunny Xiao 1b8aa3ab6f
Fix broken webhooks (#29690)
Fix #29689

(cherry picked from commit 6e8762f962c5eaaee1c92e910c95c8b85b7c1e11)
2024-03-11 23:37:00 +07:00
silverwind 27beed74b5
Suppress error from monaco-editor (#29684)
Fixes: https://github.com/go-gitea/gitea/issues/29414

I see no way for us to catch this error, so downgrade it until
https://github.com/microsoft/monaco-editor/issues/4325 is fixed, which
will likely take a few weeks to propagate up from vscode.

The entries in `updates.config.js` will make
[`updates`](https://github.com/silverwind/updates) not upgrade these
anymore and I think it's good documentation as well to have the reasons
why we don't upgrade these dependencies.

(cherry picked from commit 9bf693d98ddf8efa058a5fbbb6a3da5e0c12ab27)
2024-03-11 23:37:00 +07:00
Chongyi Zheng 1b48084e59
Fix action runner offline label padding (#29691)
Before:

The `offline` padding is `calc(.833em - 1px)` from `basic` CSS class,
but `idle` padding is `6px`.

<img width="1035" alt="image"
src="https://github.com/go-gitea/gitea/assets/37034805/ccb42615-20d7-4032-a805-40cd9643012d">

After:

<img width="1035" alt="image"
src="https://github.com/go-gitea/gitea/assets/37034805/d6af99c8-76cb-4850-96d6-5289b06e1ca8">

(cherry picked from commit a192a5ed99c2a244d0f015d62088642eb5a81d75)
2024-03-11 23:37:00 +07:00
silverwind 04b79bb48b
Update allowed attachment types (#29688)
Update to match GitHub's latest.

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 6ea1c67eadaf65079958cc4ad3b014966e47dd1a)
2024-03-11 23:37:00 +07:00
silverwind 9916f3ed64
Completely style the webkit autofill (#29683)
Previously it was only partially styled, e.g. there was black text on
white background even in dark theme caused by fomantic styles.

<img width="195" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/bc5cf516-2aef-45c3-854a-c9f5497aacca">

<img width="195" alt="Screenshot 2024-03-09 at 02 09 29"
src="https://github.com/go-gitea/gitea/assets/115237/ef0af17d-6e0b-402e-b24d-bfa34dc2f4e0">

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 9b69f76e5a33788150f3abc3dee64010539c6b86)
2024-03-11 23:37:00 +07:00
silverwind 01bf3a82cf
Include go files in tailwind processing (#29686)
We need to scan `.go` files for tailwind classes. Does not seem to
affect build time much luckily.

Fixes:
https://github.com/go-gitea/gitea/pull/29678#discussion_r1518448600

Verified via `rg tw-object-contain public/assets/css/index.css`.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 1695a5ac74afc51f38fd3a1def76cff6ba8d8641)
2024-03-11 23:37:00 +07:00
Yarden Shoham 249e26fdae
Fix WebHookEditor regression from jQuery removal (#29692)
Make these calls optional

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 1dc7f5338623ec97d9ea395380270470847a0066)
2024-03-11 23:37:00 +07:00
6543 38c3cc4eb7
Patch in exact search for meilisearch (#29671)
meilisearch does not have an search option to contorl fuzzynes per query
right now:
 - https://github.com/meilisearch/meilisearch/issues/1192
 - https://github.com/orgs/meilisearch/discussions/377
 - https://github.com/meilisearch/meilisearch/discussions/1096

so we have to create a workaround by post-filter the search result in
gitea until this is addressed.

For future works I added an option in backend only atm, to enable
fuzzynes for issue indexer too.
And also refactored the code so the fuzzy option is equal in logic to
code indexer

---
*Sponsored by Kithara Software GmbH*
Conflicts:
	routers/web/repo/search.go
	trivial context confict s/isMatch/isFuzzy/
2024-03-11 23:37:00 +07:00
silverwind 299c2a1408
Use more specific selector for `name` links (#29679)
Followup https://github.com/go-gitea/gitea/pull/29305. As per discussion
in https://github.com/go-gitea/gitea/pull/29666#discussion_r1517506422,
make this selector only search in the current `.markup` document, as
there can be multiples displayed at the same time.

@DanielMatiasCarvalho maybe you can review.

(cherry picked from commit baeb2511741aa70d24a48fd46db936b52be9d9dd)
2024-03-11 23:36:59 +07:00
silverwind 0802784744
Replace more gt- with tw- (#29678)
This will conclude the trivial class replacements.

(cherry picked from commit 82e102f8b09faf1ac2786ccad36d4a20fcb392b8)
2024-03-11 23:36:59 +07:00
charles e731e0c346
Fix commit_status problem when testing (#29672)
Close #29661

fix #29656

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 0c273f12e0b5d6dc2b80e2e6b51b2deaf15608b1)
2024-03-11 23:36:59 +07:00
silverwind 4511287676
Support pasting URLs over markdown text (#29566)
Support pasting URLs over selection text in the textarea editor. Does
not work in EasyMDE and I don't intend to support it. Image paste works
as usual in both Textarea and EasyMDE.

The new `replaceTextareaSelection` function changes textarea content via
[`insertText`](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#using_inserttext)
command, which preserves history, e.g. `CTRL-Z` works and is also
demostrated below. We should later refactor the image paste code to use
the same function because it currently destroys history.

Overriding the formatting via `Shift` key is supported as well, e.g.
`Ctrl+Shift+V` will insert the URL as-is, like on GitHub.

![urlpaste](https://github.com/go-gitea/gitea/assets/115237/522b1023-6797-401c-9e4a-498570adfc88)

(cherry picked from commit a3cfe6f39ba33cea305de592a006727857014c53)
2024-03-11 23:36:59 +07:00
yp05327 18e0647c84
bump python version to 3.12 in dev container (#29670)
![image](https://github.com/go-gitea/gitea/assets/18380374/963dc021-ac9b-4713-8344-654f966c80a4)

The default version is 3.9.2, which is not supported by poetry.

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit b253463e959c44cbd212fe1d662f2520ebfe38e6)
2024-03-11 23:36:59 +07:00
DC 2e49c82f80
Fix user-defined markup links targets (#29305)
This seeks to fix the bug reported on issue #29196.

Cause:
ID's with custom characters (- , _ , etc.), were not linking correctly
in the Markdown file when rendered in the browser because the ID in the
respective destinies would be different than the one in anchor, while
for IDs with only letters, the ID would be the same.

Fix:
It was suggested that to fix this bug, it should more or less like
GitHub does it. While in gitea the anchors would be put in HTML like
this:
```
<p dir="auto"><a href="#user-content-_toc152597800" rel="nofollow">Review</a></p>
<p dir="auto"><a href="#user-content-_toc152597802" rel="nofollow">Staging</a></p>
<p dir="auto"><a href="#user-content-_toc152597803" rel="nofollow">Development</a></p>
<p dir="auto"><a href="#user-content-_toc152597828" rel="nofollow">Testing</a></p>
<p dir="auto"><a href="#user-content-_toc152597829" rel="nofollow">Unit-tests</a></p>

```
In GitHub, the same anchor's href properties would be the same without
"user-content-" trailing behind.

So my code made sure to change those anchors, so it would not include
"user-content-" and then add respective Event Listeners so it would
scroll into the supposed places.

Fixes: #29196

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit f219ea8d0e0eccd74c786202a4ddb2784a0175ad)
2024-03-11 23:36:59 +07:00
silverwind 4e5381f8ee
Don't show AbortErrors on logout (#29639)
When logging out of Gitea, a error toast can be seen for a split second.
I don't know why or how it happens but I found it it's an `AbortError`
(related to
[AbortController#abort](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)),
so let's hide it.

(cherry picked from commit 886e90aa82521d2c2ae17d3e177c056ae32e4aa6)
2024-03-11 23:36:59 +07:00
silverwind faac0a7c32
Style fomantic grey labels (#29458)
Fomantic grey labels in the dashboard repo lists were showing original
fomantic colors, fixed that. Also slightly tweaked the light theme
colors so it uses same opacity values as dark theme.

<img width="165" alt="Screenshot 2024-03-07 at 21 06 23"
src="https://github.com/go-gitea/gitea/assets/115237/72744d6f-2ee1-4e5d-8ba0-b482a446f535">
<img width="167" alt="Screenshot 2024-03-07 at 21 06 00"
src="https://github.com/go-gitea/gitea/assets/115237/1ba93775-e5a9-4b28-b90f-59c1e9199687">

(cherry picked from commit 114bb505a3b0819db683d4b586e950df6a17bff8)
2024-03-11 23:36:59 +07:00
yp05327 fb77784017
Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize (#29653)
Fix #29506

(cherry picked from commit 9dc8a6336edddca0f3f90392bbc398f4ceaeaf13)
2024-03-11 23:36:59 +07:00
silverwind 427ab550a6
Set user's 24h preference from their current OS locale (#29651)
Fixes: https://github.com/go-gitea/gitea/issues/28371

Fixed by using a JS solution that formats according to `lang`, but alters the 24h format setting as per user's locale. This will work for all tooltips:

<img width="243" alt="Screenshot 2024-03-07 at 23 03 35" src="https://github.com/go-gitea/gitea/assets/115237/6d16c71c-6786-4eda-8cdc-50ec68ba62c6">
<img width="250" alt="Screenshot 2024-03-07 at 23 03 17" src="https://github.com/go-gitea/gitea/assets/115237/4e26bbb7-12df-4b81-bd37-14705e87e8f7">
<img width="310" alt="Screenshot 2024-03-07 at 23 14 34" src="https://github.com/go-gitea/gitea/assets/115237/1ef599f0-6401-4e19-b1da-59cdfc09b0f6">

I think there is only one other place in the UI where we render such absolute dates, which is in the actions view and which I've also fixed:

<img width="275" alt="Screenshot 2024-03-07 at 23 04 00" src="https://github.com/go-gitea/gitea/assets/115237/df0fbe1f-96ee-4338-ab5e-2b10e215005d">

(cherry picked from commit f86e9a03673b70d660a4b7a1e53748757d7a45fa)
2024-03-11 23:36:59 +07:00
Lunny Xiao 3d9afe8813
Move get/set default branch from git package to gitrepo package to hide repopath (#29126)
(cherry picked from commit 25b842df261452a29570ba89ffc3a4842d73f68c)

Conflicts:
	routers/web/repo/wiki.go
	services/repository/branch.go
	services/repository/migrate.go
	services/wiki/wiki.go
	also apply to Forgejo specific usage of the refactored functions
2024-03-11 23:36:59 +07:00
sillyguodong 6cb9e8d869
Make runs-on support variable expression (#29468)
As title.
Close issue: https://gitea.com/gitea/act_runner/issues/445
Follow: https://gitea.com/gitea/act/pulls/91

Move `getSecretsOfTask` and `getVariablesOfTask` under `models` because
of circular dependency issues.

(cherry picked from commit a1f5dd767729e30d07ab42fda80c19f30a72679f)
2024-03-11 23:36:59 +07:00
Tim-Niclas Oelschläger 1090734255
Filter for default-branch selection (#29388)
Filter for default-branch selection (fixes #4751)

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/dcae266d-2e04-41bf-8739-64a85c9007f6)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/5f27c0a7-1d30-4ccd-b4bb-6c34fff1b79f)

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit c8f4897f7f5de5b391be806f4738de1f0d9c4c09)
2024-03-11 23:36:59 +07:00
charles ac2e882dbf
Fixing the issue when status check per rule matches multiple actions (#29631)
Close #29628
rule
```
Test / Build*
Test / Build *
Test / Build 2*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)
rule2
```
Test / Build*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)

rule3
```
Test / Build*
Test / Build 1*
NotExist*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c)

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 7cf7a499be80931ae34588201e9605085898e9b8)
2024-03-11 23:36:59 +07:00
Lunny Xiao 76db6d9e74
Fix 500 when deleting account with incorrect password or unsupported login type (#29579)
Fix #26210

---------

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit ce8a98f8789a7e4e9ee97ab0abac6064d78fb1f6)
2024-03-11 23:36:59 +07:00
wxiaoguang abb0294996
Partially enable MSSQL case-sensitive collation support (#29238)
Follow #28662

(cherry picked from commit 29a8c8de779924694fadad80b31cc855dd62c0f2)
2024-03-11 23:36:59 +07:00
oliverpool 53f6f62ad4
Store webhook event in database (#29145)
Refactor the webhook logic, to have the type-dependent processing happen
only in one place.

---

1. An event happens
2. It is pre-processed (depending on the webhook type) and its body is
added to a task queue
3. When the task is processed, some more logic (depending on the webhook
type as well) is applied to make an HTTP request

This means that webhook-type dependant logic is needed in step 2 and 3.
This is cumbersome and brittle to maintain.

Updated webhook flow with this PR:
1. An event happens
2. It is stored as-is and added to a task queue
3. When the task is processed, the event is processed (depending on the
webhook type) to make an HTTP request

So the only webhook-type dependent logic happens in one place (step 3)
which should be much more robust.

- the raw event must be stored in the hooktask (until now, the
pre-processed body was stored)
- to ensure that previous hooktasks are correctly sent, a
`payload_version` is added (version 1: the body has already been
pre-process / version 2: the body is the raw event)

So future webhook additions will only have to deal with creating an
http.Request based on the raw event (no need to adjust the code in
multiple places, like currently).

Moreover since this processing happens when fetching from the task
queue, it ensures that the queuing of new events (upon a `git push` for
instance) does not get slowed down by a slow webhook.

As a concrete example, the PR #19307 for custom webhooks, should be
substantially smaller:
- no need to change `services/webhook/deliver.go`
- minimal change in `services/webhook/webhook.go` (add the new webhook
to the map)
- no need to change all the individual webhook files (since with this
refactor the `*webhook_model.Webhook` is provided as argument)

(cherry picked from commit 26653b196bd1d15c532af41f60351596dd4330bd)

Conflicts:
	services/webhook/deliver_test.go
	trivial context conflict
2024-03-11 23:36:59 +07:00
wxiaoguang 7ea8993a0e
Make wiki default branch name changable (#29603) (database migration ony)
Fix #29000
Fix #28685
Fix #18568

Related: #27497

And by the way fix #24036, add a Cancel button there (one line)

(cherry picked from commit 5cddab4f74bbb307ddf13e458c7ac22f93b9283a)
2024-03-11 23:36:59 +07:00
KN4CK3R 8bf280a686
Add user blocking (#29028) (database migration ony)
Fixes #17453

This PR adds the abbility to block a user from a personal account or
organization to restrict how the blocked user can interact with the
blocker. The docs explain what's the consequence of blocking a user.

Screenshots:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/4ed884f3-e06a-4862-afd3-3b8aa2488dc6)

![grafik](https://github.com/go-gitea/gitea/assets/1666336/ae6d4981-f252-4f50-a429-04f0f9f1cdf1)

![grafik](https://github.com/go-gitea/gitea/assets/1666336/ca153599-5b0f-4b4a-90fe-18bdfd6f0b6b)

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
(cherry picked from commit c337ff0ec70618ef2ead7850f90ab2a8458db192)
2024-03-11 23:36:59 +07:00
Lunny Xiao 97c8dbf332
Fix bug hidden on CI and make ci failed if tests failure (#29254)
The tests on migration tests failed but CI reports successfully

https://github.com/go-gitea/gitea/actions/runs/7364373807/job/20044685969#step:8:141

This PR will fix the bug on migration v283 and also the CI hidden
behaviour.

The reason is on the Makefile

`GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(MIGRATE_TEST_PACKAGES)` will
return the error exit code.

But

`for pkg in $(shell $(GO) list
code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
	done`

will not work.

This also fix #29602

(cherry picked from commit 45277486c2c6213b7766b1da708a991cdb1f3565)

Conflicts:
	.github/workflows/pull-db-tests.yml
	Makefile
	models/migrations/v1_22/v283.go
	models/migrations/v1_22/v286_test.go
	models/migrations/v1_22/v287_test.go
	already in Forgejo for the Makefile & CI logic but Gitea changes
	otherwise rule
2024-03-11 23:36:59 +07:00
techknowlogick 82b7de1360
Add admin API route for managing user's badges (#23106) (database migration ony)
Fix #22785

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit cb52b17f92e2d2293f7c003649743464492bca48)

Conflicts:
	discard everything except the database migration
2024-03-11 23:36:59 +07:00
Yarden Shoham 6403d5fca7
Remove jQuery AJAX from the repo editor (#29636)
# Preview Tab
- Removed the jQuery AJAX call and replaced with our fetch wrapper
- Tested the preview tab functionality and it works as before

# Diff Tab
- Removed the jQuery AJAX call and replaced with htmx
- Tested the diff tab functionality and it works as before

## htmx Attributes
- `hx-post="{{.RepoLink}}..."`: make a POST request to the endpoint
- `hx-indicator=".tab[data-tab='diff']"`: attach the loading indicator
to the tab body
- `hx-target=".tab[data-tab='diff']"`: target the tab body for swapping
with the response
- `hx-swap="innerHTML"`: swap the target's inner HTML
- `hx-include="#edit_area"`: include the value of the textarea (content)
in the request body
- `hx-vals='{"context":"{{.BranchLink}}"}'`: include the context in the
request body
- `hx-params="context,content"`: include only these keys in the request
body

# Demo using `fetch` and `htmx` instead of jQuery AJAX

![demo](https://github.com/go-gitea/gitea/assets/20454870/585cd6e8-f329-4c9e-ab53-a540acbd7988)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit c1331d1f7ab60249ed2f080b24f3e32093fa708d)
2024-03-11 23:36:59 +07:00
wxiaoguang 32c8860769
Use strict protocol check when redirect (#29642)
(cherry picked from commit c72e1a7abbba0cca34131a86273c987c47065dd0)
2024-03-11 23:36:59 +07:00
silverwind 3bdf1e0323
Update various logos and unify their filenames (#29637)
1. Checked all logos, updated 3 of them to newer versions.
2. Remove `open-with-` infix on the editor logos to be consistent with
other files.

<img width="626" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3b2d9486-6e0a-45c6-b0e4-d38dc4c0b118">

(cherry picked from commit 9730d3a9af889f27a1026045ab650710a01841e5)

Conflicts:
	routers/web/repo/view.go
	web_src/svg/gitea-jetbrains.svg
	web_src/svg/gitea-vscodium.svg
	already in Forgejo
2024-03-11 23:36:58 +07:00
silverwind 87e7a83edf
Tweak actions color and borders (#29640)
- Increase contrast overall
- Unalias the ansi color in dark theme and copy them to light
- Add outer border
- Add border radius

<img width="1337" alt="Screenshot 2024-03-06 at 22 30 03"
src="https://github.com/go-gitea/gitea/assets/115237/11407c0f-0bb2-435e-a034-22b1f106d9b0">
<img width="1335" alt="Screenshot 2024-03-06 at 22 36 59"
src="https://github.com/go-gitea/gitea/assets/115237/267db442-0979-4acc-a79e-8579b4cb0262">

(cherry picked from commit 16f13265143ff08cb6c33e976998b262e94fe569)
2024-03-11 23:36:58 +07:00
wxiaoguang a7830e8d87
Avoid issue info panic (#29625)
Fix #29624

(cherry picked from commit 1d2548949adf6046f330d27084efce6e63330e04)
2024-03-11 23:36:58 +07:00
Lunny Xiao 95e682f104
Cache repository default branch commit status to reduce query on commit status table (#29444)
After repository commit status has been introduced on dashaboard, the
most top SQL comes from `GetLatestCommitStatusForPairs`.

This PR adds a cache for the repository's default branch's latest
combined commit status. When a new commit status updated, the cache will
be marked as invalid.

<img width="998" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/76759de7-3a83-4d54-8571-278f5422aed3">

(cherry picked from commit e308d25f1b2fe24b4735432b05e5e221879a2705)
2024-03-11 23:36:58 +07:00
wxiaoguang a8f5449cd9
Avoid unexpected panic in graceful manager (#29629)
There is a fundamental design problem of the "manager" and the "wait
group".
If nothing has started, the "Wait" just panics: sync: WaitGroup is
reused before previous Wait has returned
There is no clear solution besides a complete rewriting of the "manager"

If there are some mistakes in the app.ini, end users would just see the
"panic", but not the real error messages. A real case: #27643

This PR is just a quick fix for the annoying panic problem.

(cherry picked from commit 90a3f2d4b7ed3890d9655c0334444f86d89b7b30)
2024-03-11 23:36:58 +07:00
yp05327 ee4443c998
Fix wrong header of org project view page (#29626)
Follow #29248

The project view page still using `user/overview/header.tmpl`

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/9cb638a3-7cc6-4efa-979a-e2592007fd12)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/62b0b2ea-8cb0-459f-b27a-bad3908eb1c0)

(cherry picked from commit c6cc392b55b71ae1787e86e75b7121c3769adcbe)
2024-03-11 23:36:58 +07:00
Jason Song 963df82907
Detect broken git hooks (#29494)
Detect broken git hooks by checking if the commit id of branches in DB
is the same with the git repo.

It can help #29338 #28277 and maybe more issues.

Users could complain about actions, webhooks, and activities not
working, but they were not aware that it is caused by broken git hooks
unless they could see a warning.

<img width="1348" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2b92a46d-7f1d-4115-bef4-9f970bd695da">

It should be merged after #29493. Otherwise, users could see a ephemeral
warning after committing and opening the repo home page immediately.

And it also waits for #29495, since the doc link (the anchor part) will
be updated.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit a4bcfb8ef1d5b2b522f78c9560d53ddbdbb02218)
2024-03-11 23:36:58 +07:00
Earl Warren 60aa763c51
templates: remove superfluous SanitizeHTML
Introduced by Rename Str2html to SanitizeHTML and clarify its behavior (followup)
2024-03-11 23:36:58 +07:00
silverwind 365fec3dc7
Update Twitter Logo (#29621)
<img width="430" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/9cf7b0a3-406b-4dd6-ab3d-d31a96b9335a">

(cherry picked from commit 8d32f3cb745124a99a8948ae771bcbb68fa3f297)
2024-03-11 23:36:58 +07:00
ChristopherHX b058fb4012
Add ac claim for old docker/build-push-action@v3 / current buildx gha cache (#29584)
Also resolves a warning for current releases

```
| ##[group]GitHub Actions runtime token ACs
| ##[warning]Cannot parse GitHub Actions Runtime Token ACs: "undefined" is not valid JSON
| ##[endgroup]
====>
| ##[group]GitHub Actions runtime token ACs
| ##[endgroup]
```
\* this is an error in v3

References in the docker org:
-
831ca179d3/src/main.ts (L24)
-
7d8b4dc669/src/github.ts (L61)

No known official action of GitHub makes use of this claim.

Current releases throw an error when configure to use actions cache
```
| ERROR: failed to solve: failed to configure gha cache exporter: invalid token without access controls
| ##[error]buildx failed with: ERROR: failed to solve: failed to configure gha cache exporter: invalid token without access controls
```

(cherry picked from commit 368743baf3d904f86b553a88718583906f571c87)
2024-03-11 23:36:58 +07:00
Zettat123 e7afba21ce
Skip email domain check when admins edit user emails (#29609)
Follow #29522

Administrators should be able to set a user's email address even if the
email address is not in `EMAIL_DOMAIN_ALLOWLIST`

(cherry picked from commit 136dd99e86eea9c8bfe61b972a12b395655171e8)
2024-03-11 23:36:58 +07:00
silverwind 02384ff9ad
Fix contributor graphs mobile layout and responsiveness (#29597)
Also removed a unneeded and actually conflicting class name
`stats-table`.

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

<img width="445" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/787804ed-6ba4-437f-b314-f23cbe2edf7a">

(cherry picked from commit f14779592494d41b3ab04caaab53487f2f4ede5a)
2024-03-11 23:36:58 +07:00
Zettat123 b6057a34db
Skip email domain check when admin users adds user manually (#29522)
Fix #27457

Administrators should be able to manually create any user even if the
user's email address is not in `EMAIL_DOMAIN_ALLOWLIST`.

(cherry picked from commit 4fd9c56ed09b31e2f6164a5f534a31c6624d0478)
2024-03-11 23:36:58 +07:00
silverwind 907c3d0c20
Replace more `gt-` with `tw-`, update frontend docs (#29595)
Tested a few things, all working fine. Not sure if the chinese machine
translation is good.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 7e8c1c5ba18e1ac8861f429b825163b8210fd178)

Conflicts:
	docs/content/contributing/guidelines-frontend.zh-cn.md
	Gitea docs
2024-03-11 23:36:58 +07:00
wxiaoguang 5f65028312
Remove unnecessary ctxData for "attachments" template (#29600)
The "attachments" template never uses it

(cherry picked from commit 3e84bfdf410ec1fdf22711156d729e51d7355a8e)
2024-03-11 23:36:58 +07:00
silverwind 588104d9d1
Adjust tailwind content globs (#29596)
Tailwind content is not going to appear in `web_src/css`,
`web_src/fomantic` or `web_src/svg` or the JSON templates, so we don't
need to have tailwind scan these directories which will speed up the
build.

---------

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 72b213b00fe1aa18d082423fbc4cfffff483eb18)
2024-03-11 23:36:58 +07:00
wxiaoguang 4f66fec707
Use flex wrap to layout the PR update button (#29590)
Follow #29418

I think using "flex-wrap: wrap" here is better than hard-coding the screen width.

By using "flex-wrap: wrap", the UI layouts automatically for various
widths (even if in some languages, the sentence might be pretty long)

(cherry picked from commit ade62416917bc87810991585d7047851834ee316)
2024-03-11 23:36:58 +07:00
wxiaoguang 9482b023a8
Make "/user/login" page redirect if the current user has signed in (#29583)
Fix #29582 and maybe more.
Maybe fix #29116

(cherry picked from commit df1268ca08aaacae54c775a8eec34006dfe365e0)
2024-03-11 23:36:58 +07:00
GiteaBot f6c62cd07f
[skip ci] Updated translations via Crowdin
(cherry picked from commit 82875ae946b34e67beb3c89d0bd02a0fee9ad96e)
2024-03-11 23:36:58 +07:00
silverwind 2cb07e8415
Regenerate fomantic lockfile and build it with our browserslist (#29560)
1. Make fomantic build use [our
browserslist](e3524c63d6/package.json (L99)).
I found no other way than to sed-replace into it's js, the normal
browserlist config files do not work. The effect of this change is the
removal of some uneeded CSS vendor prefixes.
2. Regenerate `web_src/fomantic/package-lock.json`, this might shut up
some security scanners.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit da3b7f5039158faae4b617ca878061f8a4f3e489)
2024-03-11 23:36:58 +07:00
charles e7297d423f
Do not exceed display for the PR page buttons on smaller screens (#29418)
Fixes #29189.

This is the result after the fix at a width of 768 pixels.

![圖片](https://github.com/go-gitea/gitea/assets/30816317/626d06b3-fd5b-4392-84e1-1191c965aff5)

(cherry picked from commit c660149a7079c2b06d4ee6dce2a45804d6d4d7f6)
2024-03-11 23:36:58 +07:00
Lunny Xiao 145bebc829
Make admin pages wider because of left sidebar added and some tables become too narrow (#29581)
Fix #25939

screenshots

<img width="1895" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/937eb28d-bb7d-4765-b580-bc991d61f467">

(cherry picked from commit fad232054542ade88268304fea9b09f778d74a29)
2024-03-11 23:36:58 +07:00
wxiaoguang a44805e5b3
Remove unnecessary SanitizeHTML from code (#29575)
* "mail/issue/default.tmpl": the body is rendered by backend
`markdown.RenderString() HTML`, it has been already sanitized
* "repo/settings/webhook/base_list.tmpl": "Description" is prepared by
backend `ctx.Tr`, it doesn't need to be sanitized

(cherry picked from commit dae7f1ebdbe19620f40e110b285f7c0ecd0bb33b)
2024-03-11 23:36:58 +07:00
wxiaoguang 3c05986fcf
Fix incorrect package link method calls in templates (#29580)
Fix #29562
Follow  #29531

(cherry picked from commit 7ec4c65ea5d5a3765d24ee68ae421f2f911b6b5d)
2024-03-11 23:36:57 +07:00
Lunny Xiao bb09ad2b63
Allow options to disable user ssh keys configuration from the interface on app.ini (#29447)
Follow #29275
Extract from #20549
Fix #24716

---------

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 8e12ba34bab7e728ac93ccfaecbe91e053ef1c89)

Conflicts:
	custom/conf/app.example.ini
	trivial context conflict
2024-03-11 23:36:57 +07:00
silverwind eadf1d4fa3
Inline the `css-variables-parser` dependency (#29571)
Get rid of the `postcss@7` dependency by inlining this simple function.

(cherry picked from commit d769b664dedb5f63b73146b58b21c0a772c2630d)
2024-03-11 23:36:57 +07:00
silverwind 2e9ca0597d
Replace some `gt-` classes with `tw-` (#29570)
Replace 18 `gt-` prefixes with `tw-` with perl replacement. I manually
checked them all with `rg` afterwards.

(cherry picked from commit a2e90014ec20a1085449a66061389cfe0d12260f)

Conflicts:
	templates/repo/header.tmpl
	because some of the header moved to header_fork.tmpl
2024-03-11 23:36:57 +07:00
Gusted 4dbf2d7c11 Merge pull request 'Better number for UserCards pagination' (#2584) from 0ko/forgejo:its39 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2584
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-11 15:53:59 +00:00
Earl Warren c63599d5c9 Merge pull request 'Improve English names & consistency' (#2610) from 0ko/forgejo:english20240308 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2610
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-11 14:06:46 +00:00
Earl Warren 339cbc4cd0 Merge pull request '[DEPS] Bump mysql driver' (#2623) from gusted/forgejo-bump-mysql into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2623
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-10 17:16:15 +00:00
Shiny Nematoda 3b2f28ff1c [PORT] Fix wrong line number in code search result (gitea#29260) (#2619)
Port [Fix wrong line number in code search result (gitea#29260)](https://github.com/go-gitea/gitea/pull/29260)

PS: also added [`-e`](https://git-scm.com/docs/git-grep#Documentation/git-grep.txt--e) before passing the keyword (my bad)

Co-authored-by: yp05327 <576951401@qq.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2619
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
2024-03-10 15:35:30 +00:00
0ko faa6cb62f7 Fix gaps for org homepage tabs 2024-03-10 19:32:58 +05:00
0ko 671a4ff402 [I18N] Improve English names & consistency 2024-03-10 19:10:29 +05:00
Gusted 578f0b3335
[DEPS] Bump mysql driver
- Bump the SQL driver for MySQL to
[v1.8.0](https://github.com/go-sql-driver/mysql/releases/tag/v1.8.0),
which notably includes support for ed25519 authentication scheme (by
yours truly).
- Resolves #1868
2024-03-10 14:57:56 +01:00
0ko b2bc233517 Test pagination of repo stars, watchers and forks
based on code suggested in https://codeberg.org/forgejo/forgejo/pulls/2584#issuecomment-1647897 and https://codeberg.org/forgejo/forgejo/pulls/2584#issuecomment-1655289

Co-authored-by: Gusted <gusted@noreply.codeberg.org>
2024-03-10 17:15:59 +05:00
Earl Warren 79f8339c74 Merge pull request 'Fix repo unarchivation button' (#2550) from 0ko/forgejo:unarchive_btn into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2550
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-10 06:31:47 +00:00
0ko 8f8b608fd7 Add test to UI of archive/unarchive related actions 2024-03-09 13:29:23 +00:00
0ko 097eb0802a Fix repo unarchivation button 2024-03-09 13:29:23 +00:00
0ko 9b214b362d fix: indicate there are no projects to choose from 2024-03-08 09:43:27 +05:00
0ko 3a375a1de3 fix: don't hide projects from sidebar when they're disabled in repo 2024-03-08 09:33:52 +05:00
oliverpool 6313b89e53 Merge '[BUG] prevent removing session cookie when redirect_uri query contains ://' (#2590)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2590
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-07 21:38:09 +00:00
Gusted 5a1700c84b Merge pull request 'Improve English locale for admin settings' (#2583) from 0ko/forgejo:english20240306 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2583
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-07 20:48:37 +00:00
Gusted 16cd8f9b8e Merge pull request 'Port "Fix wrong test usage of AppSubURL"' (#2586) from gusted/forgejo-port-gt-29459 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2586
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-07 18:55:54 +00:00
0ko 6739b4f590 Update look of repo/org tabs on homepage 2024-03-07 19:01:11 +05:00
oliverpool 7444f9981e implement fix 2024-03-07 10:53:43 +01:00
oliverpool ecfcbcb19f [BUG] prevent removing session cookie when redirect_uri query contains :// 2024-03-07 10:52:30 +01:00
0ko 498a3f988d Better number for UserCards pagination 2024-03-07 13:30:12 +05:00
KN4CK3R 8f55cf199d
Port "Fix wrong test usage of AppSubURL"
- Port of https://github.com/go-gitea/gitea/pull/29459
- The tests use an invalid `setting.AppSubURL`. The wrong behaviour
disturbs other PRs like https://github.com/go-gitea/gitea/pull/29222
and https://github.com/go-gitea/gitea/pull/29427.
2024-03-06 21:47:44 +01:00
Gusted b9e27b64e6 Merge pull request '[BUG] Disable CODEOWNERS for forked repositories' (#2537) from gusted/forgejo-codeowner-forked into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2537
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-06 18:18:58 +00:00
0ko 23fae5ec08 [I18N] Improve English locale for admin settings 2024-03-06 22:21:19 +05:00
Gusted d759bec64f Merge pull request '[BUG] Remember topic only in repo search' (#2575) from gusted/forgejo-port-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2575
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-06 13:55:45 +00:00
Gusted e793e28f94
[BUG] Remember topic only in repo search
- Ports b4360d504c
2024-03-06 13:22:39 +01:00
Earl Warren 4565f5fbc9
[RELEASE] v1.21.7-0 release notes (cosmetic changes) 2024-03-06 18:20:27 +08:00
jilen f4fd81b5d1 Add minio bucket lookup type option 2024-03-06 09:38:02 +00:00
Earl Warren c2f4fcca5a Merge pull request '[RELEASE] v1.21.7-0 release notes' (#2572) from earl-warren/forgejo:wip-release-notes-1.21 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2572
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-06 09:14:00 +00:00
Earl Warren 025798d0f6 Merge pull request '[gitea] cherry-pick' (#2545) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2545
Reviewed-by: Otto <otto@codeberg.org>
2024-03-06 08:59:04 +00:00
Codeberg Translate d17401ac91 [I18N] Translations update from Weblate (#2556)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: Dirk <dirk@0x7be.de>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: EssGeeEich <grassia.mauro@gmail.com>
Co-authored-by: Xinayder <me+codeberg@aoalmeida.com>
Co-authored-by: mondstern <mondstern@monocles.de>
Co-authored-by: Panagiotis \"Ivory\" Vasilopoulos <git@n0toose.net>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: acioustick <acioustick@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2556
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-03-06 08:55:20 +00:00
Earl Warren 95cd619d37
[RELEASE] v1.21.7-0 release notes 2024-03-06 13:30:41 +08:00
Earl Warren a71f54654a Merge pull request 'Revert "[CI] pin go v1.21.8 version"' (#2569) from earl-warren/forgejo:wip-ci-go-action into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2569
2024-03-06 05:09:31 +00:00
Earl Warren dc354ae0f7
Revert "[CI] pin go v1.21.8 version"
This reverts commit ac0f58035f.
2024-03-06 12:14:44 +08:00
wxiaoguang de6768ed54
Add an trailing slash to dashboard links (#29555)
Fix #29533, and add some tests for "base/paginate.tmpl"

(cherry picked from commit 8553b4600e3035b6f6ad6907c37cebd013fa4d64)

Conflicts:
	services/contexttest/context_tests.go
	trivial conflict because
	"Improve user experience for outdated comments" was skipped
2024-03-06 12:10:47 +08:00
Earl Warren cfce4e089e
Partial cherry-pick: a4859dcfea Improve user experience for outdated comments (#29050) 2024-03-06 12:10:47 +08:00
6543 ff8f7a7a0d
Extend issue template yaml engine (#29274)
Add new option:

`visible`: witch can hide a specific field of the form or the created
content afterwards

It is a string array witch can contain `form` and `content`. If only
`form` is present, it wont show up in the created issue afterwards and
the other way around. By default it sets both except for markdown

As they are optional and github don't have any similar thing, it is non
breaking and also do not conflict with it.

With this you can:
- define "post issue creation" elements like a TODO list to track an
issue state
- make sure to have a checkbox that reminds the user to check for a
thing but dont have it in the created issue afterwards
- define markdown for the created issue (was the downside of using yaml
instead of md in the past)
 - ...

## Demo

```yaml
name: New Contribution
description: External Contributor creating a pull

body:
- type: checkboxes
  id: extern-todo
  visible: [form]
  attributes:
    label: Contribution Guidelines
    options:
      - label: I checked there exist no similar feature to be extended
        required: true
      - label: I did read the CONTRIBUTION.MD
        required: true
- type: checkboxes
  id: intern-todo
  visible: [content]
  attributes:
    label: Maintainer Check-List
    options:
      - label: Does this pull follow the KISS principe
      - label: Checked if internal bord was notifyed
# ....
```
[Demo
Video](https://cloud.obermui.de/s/tm34fSAbJp9qw9z/download/vid-20240220-152751.mkv)

---
*Sponsored by Kithara Software GmbH*

---------

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 77e29e0c39392f142627303bd798fb55258072b2)
2024-03-06 12:10:47 +08:00
GiteaBot ba7983aedc
[skip ci] Updated licenses and gitignores
(cherry picked from commit 2fb917f69e59f8b75825bf4fe659856b9dd02f44)
2024-03-06 12:10:47 +08:00
Earl Warren 10643f1d3a
[DEADCODE] update 2024-03-06 12:10:47 +08:00
yp05327 af19bae813
Fix workflow trigger event IssueChangeXXX bug (#29559)
Bugs from #29308
Follow #29467

partly fix #29558

(cherry picked from commit 9616dbec334aacb32c6d73b01fd749b11b1e3cdb)
2024-03-06 12:10:47 +08:00
Nanguan Lin c69a0bb506
Fix 500 when pushing release to an empty repo (#29554)
As title.
The former code directly used `ctx.Repo.GitRepo`, causing 500.

22b4f0c09f/routers/api/v1/repo/release.go (L241)
(cherry picked from commit 6e2aafd5130cb9436f02209ae90bf79a58cc13ae)
2024-03-06 12:10:47 +08:00
silverwind 006d4ce6f2
Update js and py dependencies, bump python (#29561)
- Update js and py dependencies excluding `@mcaptcha/vanilla-glue`,
`eslint-plugin-array-func`
- Update stylelint config
- Require python 3.10 and use 3.12 on CI, bump setup-python as well
- Tested markdown toolbar, charts, clipboard, swagger ui, vue

(cherry picked from commit efa631aeead094267d46ea8f86e6d568f0c731e4)

Conflicts:
	.github/workflows/pull-compliance.yml
	does not existin in Forgejo
2024-03-06 12:10:46 +08:00
Tim-Niclas Oelschläger 83e04328df
Filter Repositories by type (#29231)
Filter Repositories by type (resolves #1170, #1318)

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/74e6be62-9010-4ab4-8f9b-bd8afbebb8fb)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/e4d85ed6-7864-4150-8d72-5194dac1293f)

(cherry picked from commit e3524c63d6d42865ea8288af89b372544d35474b)
2024-03-06 12:10:46 +08:00
Earl Warren a39f69ac28
Revert "[BUG] Remember topic only in repo search"
This reverts commit b4360d504c.
2024-03-06 12:10:46 +08:00
wxiaoguang 99b1a39aef
Breaking summary for template refactoring (#29395)
https://github.com/go-gitea/gitea/pull/29395
(cherry picked from commit e71b69257c38178eed9ccd0b62a5ae47d67858d4)
2024-03-06 12:10:46 +08:00
GiteaBot fa6627fadb
[skip ci] Updated translations via Crowdin
(cherry picked from commit 22b4f0c09f1de5e581929bd10f39833d30d2c482)

Conflicts:
	options/locale/locale_ja-JP.ini
	prefer Forgejo translation
2024-03-06 12:10:46 +08:00
wxiaoguang ff7a032c74
Fix incorrect cookie path for AppSubURL (#29534)
Regression of #24107

(cherry picked from commit 44398e405ffe297997c6b9c8dbb97f966926b65a)
2024-03-06 12:10:46 +08:00
6543 318634ef74
Add option to set language in admin user view (#28449)
![image](https://github.com/go-gitea/gitea/assets/24977596/be7e3f92-af3f-4628-b4ed-abf6439687f3)
`/admin/users/<UserID>/edit`

![image](https://github.com/go-gitea/gitea/assets/24977596/906af0dd-cceb-4ed9-9cd9-32c71ae1bf71)
`/admin/users/<UserID>`

---
*Sponsored by Kithara Software GmbH*

(cherry picked from commit e3e6569c5fd8c69aa65384e6d1636cc14b23a32b)
2024-03-06 12:10:46 +08:00
Yarden Shoham 1e29bccddb
Fix elipsis button not working if the last commit loading is deferred (#29544)
Before this change, if we had more than 200 entries being deferred in
loading, the entire table would get replaced thus losing any event
listeners attached to the elements within the table, such as the elipsis
button and commit list with tippy.

With this change we remove the previous javascript code that replaced
the table and use htmx to replace the table.

htmx attributes added:
- `hx-indicator="tr.notready td.message span"`: attach the loading
spinner to the files whose last commit is still being loaded
- `hx-trigger="load"` trigger the request-replace behavior as soon as
possible
- `hx-swap="morph"`: use the idiomorph morphing algorithm, this is the
thing that makes it so the elipsis button event listener is kept during
the replacement, fixing the bug because we don't actually replace the
table, only modifying it
- `hx-post="{{.LastCommitLoaderURL}}"`: make a post request to this url
to get the table with all of the commit information

As part of this change I removed the handling of partial replacement in
the case we have less than 200 "not ready" files. The first reason is
that I couldn't make htmx replace only a subset of returned elements,
the second reason is that we have a cache implemented in the backend
already so the only cost added is that we query the cache a few times
(which is sure to be populated due to the initial request), and the last
reason is that since the last refactor of this functionality that
removed jQuery we don't properly send the "not ready" entries as the
backend expects `FormData` with `f[]` and we send a JSON with `f` so we
always query for all rows anyway.

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/482ebfec-66c5-40cc-9c1e-e3b3bfe1bbc1)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/454c517e-3a4e-4006-a49f-99cc56e0fd60)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 937e8b55149388840bbf6c4d7216495bc3dd2fe9)
2024-03-06 12:10:46 +08:00
wxiaoguang 12441d7c5c
Fix incorrect relative/absolute URL usages (#29531)
Add two "HTMLURL" methods for PackageDescriptor.
And rename "FullWebLink" to "VersionWebLink"

(cherry picked from commit bf6502a8f7a2e9a2b64b43b7733316d863c9a768)
2024-03-06 12:10:46 +08:00
KN4CK3R 47a913d40d
Add support for API blob upload of release attachments (#29507)
Fixes #29502

Our endpoint is not Github compatible.

https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 70c126e6184872a6ac63cae2f327fc745b25d1d7)
2024-03-06 12:10:46 +08:00
wxiaoguang e159297443
Fix queue worker incorrectly stopped when there are still more items in the queue (#29532)
Without `case <-t.C`, the workers would stop incorrectly, the test won't
pass. For the worse case, there might be only one running worker
processing the queue items for long time because other workers are
stopped. The root cause is related to the logic of doDispatchBatchToWorker.
It isn't a serious problem at the moment, so keep it as-is.

(cherry picked from commit 6465f94a2d26cdacc232fddc20f98d98df61ddac)
2024-03-06 12:10:46 +08:00
6543 e2371743d5
remove util.OptionalBool and related functions (#29513)
and migrate affected code

_last refactoring bits to replace **util.OptionalBool** with
**optional.Option[bool]**_

(cherry picked from commit a3f05d0d98408bb47333b19f505b21afcefa9e7c)

Conflicts:
	services/repository/branch.go
	trivial context conflict
2024-03-06 12:10:46 +08:00
wxiaoguang be9189eddc
Rename Action.GetDisplayName to GetActDisplayName (#29540)
To avoid conflicting with User.GetDisplayName, because there is no data
type in template.

And it matches other methods like GetActFullName / GetActUserName

(cherry picked from commit 3f081d4b54261c1b4ee4f1df40c610fdd9581ef2)
2024-03-06 12:10:46 +08:00
wxiaoguang 221a28436a
Make PR form use toast to show error message (#29545)
![image](https://github.com/go-gitea/gitea/assets/2114189/b7a14ed6-db89-4f21-a590-66cd33307233)

(cherry picked from commit 27deea7330f83ddb37c918afbb4159053d8847cb)
2024-03-06 12:10:46 +08:00
charles d509031e84
Add a check for when the command is canceled by the program on Window… (#29538)
Close #29509

Windows, unlike Linux, does not have signal-specified exit codes.
Therefore, we should add a Windows-specific check for Windows. If we
don't do this, the logs will always show a failed status, even though
the command actually works correctly.

If you check the Go source code in exec_windows.go, you will see that it
always returns exit code 1.

![image](https://github.com/go-gitea/gitea/assets/30816317/9dfd7c70-9995-47d9-9641-db793f58770c)

The exit code 1 does not exclusively signify a SIGNAL KILL; it can
indicate any issue that occurs when a program fails.

(cherry picked from commit 423372d84ab3d885e47d4a00cd69d6040b61cc4c)
2024-03-06 12:10:45 +08:00
wxiaoguang db19d4eb39
Fix incorrect redirection when creating a PR fails (#29537)
This is only a quick fix to make it easier to backport.

After this PR gets merged, I will propose a new PR to fix the FIXME.

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/98d1d5c4-2e79-4a75-80e9-76fd898986e0)

</details>

(cherry picked from commit e650f64d812f5ebeb4a11d2ec20f2376c6d963bc)
2024-03-06 12:10:45 +08:00
charles 5241a45cf8
Fix issue link does not support quotes (#29484) (#29487)
Close #29484

![圖片](https://github.com/go-gitea/gitea/assets/30816317/b27e6e16-67e0-469c-8e04-30180c585890)

(cherry picked from commit 90435847792d26ac3f23f1a8479706afadec6b15)
2024-03-06 12:10:45 +08:00
Yarden Shoham d1dbb1f780
Remove jQuery AJAX from the repo tag edit form (#29526)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo tag edit form functionality and it works as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/11126bc4-1666-44ae-8644-a6351da43514)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 2089b974c8bf670de5c6801fa48c229fd9291a7b)
2024-03-06 12:10:45 +08:00
ChristopherHX 66632c4958
Actions Artifacts v4 backend (#28965)
Fixes #28853

Needs both https://gitea.com/gitea/act_runner/pulls/473 and
https://gitea.com/gitea/act_runner/pulls/471 on the runner side and
patched `actions/upload-artifact@v4` / `actions/download-artifact@v4`,
like `christopherhx/gitea-upload-artifact@v4` and
`christopherhx/gitea-download-artifact@v4`, to not return errors due to
GHES not beeing supported yet.

(cherry picked from commit a53d268aca87a281aadc2246541f8749eddcebed)
2024-03-06 12:10:45 +08:00
Yarden Shoham fcd055d74b
Remove jQuery AJAX from common global functions (#29528)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the locale change functionality and it works as before
- Tested the delete button functionality and it works as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/8a024f75-c2a5-4bff-898d-ca751d2489f1)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 8a0a83a1b53f55bcc710c3b229cba1c1bcf471c6)
2024-03-06 12:10:45 +08:00
Lunny Xiao ee6ff937c0
Allow options to disable user gpg keys configuration from the interface on app.ini (#29486)
Follow #29447
Fix #29454
Extract from #20549

(cherry picked from commit 9de5e39e25009bacc5ca201ed97e9cbb623e56e9)

Conflicts:
	custom/conf/app.example.ini
	docs/content/administration/config-cheat-sheet.en-us.md
	docs/content/administration/config-cheat-sheet.zh-cn.md
	trivial context conflict
2024-03-06 12:10:45 +08:00
silverwind 85bf170ff0
Fix incorrect diff expander for deletion of last lines in a file (#29501)
Fixes: https://github.com/go-gitea/gitea/issues/29498

I don't quite understand this code, but this change does seem to fix the
issue and I tested a number of diffs with it and saw no issue. The
function gets such value if last line is an addition:

```
  LastLeftIdx: (int) 0,
  LastRightIdx: (int) 47,
  LeftIdx: (int) 47,
  RightIdx: (int) 48,
```

If it's a deletion, it gets:

```
  LastLeftIdx: (int) 47,
  LastRightIdx: (int) 0,
  LeftIdx: (int) 48,
  RightIdx: (int) 47,
```

So I think it's correct to make this check respect both left and right
side.

(cherry picked from commit 3b99066aa866e51e6a610716eaddfd1ea3645a67)
2024-03-06 12:10:45 +08:00
sillyguodong 08a4aa5ac2
Ignore `__debug_bin*` which is generated by vscode when debugging (#29524)
When debugging in VSCode now, the executable file generated will come
with a random string attached.

(cherry picked from commit 6841e58d1fae33311fa0239823def9dd8fba4c1f)
2024-03-06 12:10:45 +08:00
sillyguodong ee876797cc
Set pre-step status to `skipped` if job is skipped (#29489)
close #27496
1. Set pre-step (Set up job) status to `skipped` if job is skipped.
2. Apart from pre-step, the other steps should also be set to `skipped`.
The status of other steps are reported from the runner side. This will
be completed by this PR: https://gitea.com/gitea/act_runner/pulls/500

before:

![image](https://github.com/go-gitea/gitea/assets/33891828/4bac2ba9-66de-4679-b7ed-fbae459c0c54)

after:

![image](https://github.com/go-gitea/gitea/assets/33891828/ead4871a-4e0f-4bb1-9fb4-37f4fdb78dfc)

(cherry picked from commit cee08f634746d65ce3fb05a32dd2439f241a92e6)
2024-03-06 12:10:45 +08:00
Origami404 e7bf094578
Adding back missing options to app.example.ini (#29511)
In the refactoring of the configuration file #15807,
some lines were accidentally deleted:

DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false
ENABLE_PUSH_CREATE_USER = false
ENABLE_PUSH_CREATE_ORG = false

Fix #29510

---------

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 2ca5daf07e5816343c1018f5773e7a2c671f3777)
2024-03-06 12:10:45 +08:00
wxiaoguang 8d42de4614
Refactor the "attachments" sub-template data key to RenderedContent (#29517)
The value passed into "attachments" sub-template is from
"RedneredContent", so use the same name for consistent. And it makes
readers easy to know its data type.

(cherry picked from commit b8a598e6a43fa65db23b88d3b3b281b5f2f7c2e0)
2024-03-06 12:10:45 +08:00
Earl Warren 801792e4dc
Rename Str2html to SanitizeHTML and clarify its behavior (followup) 2024-03-06 12:10:45 +08:00
wxiaoguang 2892aaab02
Rename Str2html to SanitizeHTML and clarify its behavior (#29516)
Str2html was abused a lot. So use a proper name for it: SanitizeHTML

And add some tests to show its behavior.

(cherry picked from commit fb42972c057364a1dc99dfb528554e7a94415be7)

Conflicts:
	docs/content/administration/mail-templates.en-us.md
	docs/content/administration/mail-templates.zh-cn.md
	prefer their version always
2024-03-06 12:10:45 +08:00
Earl Warren 58bc3af08d
Refactor some Str2html code (followup)
* [BUG] Restrict when to make link absolute in markdown
2024-03-06 12:10:44 +08:00
wxiaoguang 68099f2f00
Refactor some Str2html code (#29397)
This PR touches the most interesting part of the "template refactoring".

1. Unclear variable type. Especially for "web/feed/convert.go":
sometimes it uses text, sometimes it uses HTML.
2. Assign text content to "RenderedContent" field, for example: `
project.RenderedContent = project.Description` in web/org/projects.go
3. Assign rendered content to text field, for example: `r.Note =
rendered content` in web/repo/release.go
4. (possible) Incorrectly calling `{{Str2html
.PackageDescriptor.Metadata.ReleaseNotes}}` in
package/content/nuget.tmpl, I guess the name Str2html misleads
developers to use it to "render string to html", but it only sanitizes.
if ReleaseNotes really contains HTML, then this is not a problem.

(cherry picked from commit e71eb8930a5d0f60874b038c223498b41ad65592)

Conflicts:
	modules/templates/util_string.go
	trivial context conflict
2024-03-06 12:10:44 +08:00
GiteaBot 97a0368c28
[skip ci] Updated translations via Crowdin
(cherry picked from commit a6eb298098983b7aae028fff4d80d15d5510f10b)

Conflicts:
	options/locale/locale_zh-CN.ini
	branding Gitea/Forgejo conflict
	new transations in [graphs]
2024-03-06 12:10:44 +08:00
6543 d3d70198b0
migrate some more "OptionalBool" to "Option[bool]" (#29479)
just some refactoring bits towards replacing **util.OptionalBool** with
**optional.Option[bool]**

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit f6656181e4a07d6c415927220efa2077d509f7c6)

Conflicts:
	models/repo/repo_list_test.go
	trivial shared fixture count conflicts
2024-03-06 12:10:44 +08:00
silverwind 4127fcd608
Lighten text colors on dark theme for increased contrast (#29481)
Improve contrast by lightening the text colors in dark theme by around
35%. Additionally, share some variables that had the same or similar
color, which will ease future theme creation.

(cherry picked from commit e94e2fb6c5484070d56977644213d735df9e0c10)
2024-03-06 12:10:44 +08:00
silverwind 9fc93e61f9
Improve contrast on blame timestamp, fix double border (#29482)
Before, double border on top, bad contrast on dark:
<img width="155" alt="Screenshot 2024-02-29 at 02 06 17"
src="https://github.com/go-gitea/gitea/assets/115237/fc0f1e08-a5ce-47ed-9eb6-135eed5a1abb">
<img width="126" alt="Screenshot 2024-02-29 at 02 07 28"
src="https://github.com/go-gitea/gitea/assets/115237/38ae8483-8d9b-484c-8909-d4466131ea16">

After, no double border on top, good contrast:
<img width="154" alt="Screenshot 2024-02-29 at 02 20 20"
src="https://github.com/go-gitea/gitea/assets/115237/ad91282b-e9f5-4f41-8f5e-6ba28db3beac">
<img width="147" alt="Screenshot 2024-02-29 at 02 20 38"
src="https://github.com/go-gitea/gitea/assets/115237/7ee2ec92-e72a-4981-aec3-98fc8e579bae">

(cherry picked from commit 6e1873288f86ca4de4d1943919343f342c7abcd9)
2024-03-06 12:10:44 +08:00
silverwind b295d0691f
Fix/Improve `processWindowErrorEvent` (#29407)
- `e.error` can be undefined in some cases which would raise an error
inside this error handler, fixed that.
- The displayed message mentions looking into the console, but in my
case of error from `ResizeObserver` there was nothing there, so add this
logging. I think this logging was once there but got lost during
refactoring.

(cherry picked from commit 6d9b7253a2de00b5dfc27550cf7e015e819d6fd2)
2024-03-06 12:10:44 +08:00
silverwind 9511485142
Apply compact padding to small buttons with svg icons (#29471)
The buttons on the repo release tab were larger in height than on other
tabs because one of them contained the RSS icon which stretched the
button height by 3px. Workaround this problem by applying the "compact"
padding to any such button. They are within 0.4px in height now to
non-icon buttons.

Before:

<img width="406" alt="Screenshot 2024-02-28 at 15 30 23"
src="https://github.com/go-gitea/gitea/assets/115237/805bb93a-6fe4-40a0-82d1-03001bee8ecf">

After:

<img width="407" alt="Screenshot 2024-02-28 at 15 38 43"
src="https://github.com/go-gitea/gitea/assets/115237/27707588-890f-4852-ab08-105a57eda880">

For comparison, button on issue tab:

<img width="452" alt="Screenshot 2024-02-28 at 15 31 46"
src="https://github.com/go-gitea/gitea/assets/115237/74ac13d5-d016-49ba-9dd9-40ed32a748e9">

(cherry picked from commit 850fc2516e67049ec195c72d861896b275bd09d1)
2024-03-06 12:10:44 +08:00
charles afc21e6aa7
Fix counter display number incorrectly displayed on the page (#29448)
issue : #28239

The counter number script uses the 'checkbox' attribute to determine
whether an item is selected or not.

However, the input event only increments the counter value, and when
more items are displayed, it does not update all previously loaded
items.

As a result, the display becomes incorrect because it triggers the
update counter script, but checkboxes that are selected without the
'checked' attribute are not counted

(cherry picked from commit 252047ed2e09e3f1f1ab394cd62995cf4cabe506)
2024-03-06 12:10:44 +08:00
wxiaoguang 9c5afa0b8f
Fix incorrect user location link on profile page (#29474)
Fix #29472. Regression of #29236, a "if" check was missing.

(cherry picked from commit 10cfa0879a538a470598281d7093de3555c018be)
2024-03-06 12:10:44 +08:00
Zettat123 2b23f4bdee
Fix workflow trigger event bugs (#29467)
1. Fix incorrect `HookEventType` for issue-related events in
`IssueChangeAssignee`
2. Add `case "types"` in the `switch` block in `matchPullRequestEvent`
to avoid warning logs

(cherry picked from commit 1ad4bb9eb7641a552c5b88a43eb91d59ec5c0edf)
2024-03-06 12:10:44 +08:00
silverwind 6e89eff490
Fix URL calculation in clone input box (#29470)
Ported the function as-is and added comments so we don't forget about
this in the future.

Fixes: https://github.com/go-gitea/gitea/issues/29462
(cherry picked from commit 82405f808d7b50c3580f26e5ca645e2ed6d284ab)
2024-03-06 12:10:44 +08:00
Yarden Shoham b0cadeb022
Remove jQuery from the "find file" page (#29456)
- Switched to plain JavaScript
- Tested the file searching functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/8ceef0ed-ab87-448c-8b9b-9b5c0cd8bebd)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 71e0f185f9773d1cc4909867a10c86f74d12ce8d)
2024-03-06 12:10:44 +08:00
Lunny Xiao 46fca90cfc
Move generate from module to service (#29465)
(cherry picked from commit b5188cd55c535a588492fb4e153d646ec4f3232a)
2024-03-06 12:10:44 +08:00
Zettat123 9159842b56
The job should always run when `if` is `always()` (#29464)
Fix #27906

According to GitHub's
[documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds),
a job should always run when its `if` is `always()`

> If you would like a job to run even if a job it is dependent on did
not succeed, use the `always()` conditional expression in
`jobs.<job_id>.if`.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit d0fe6ea4e101198911383058a2e121e384934a9c)
2024-03-06 12:10:44 +08:00
silverwind ff581d5a24
Recolor dark theme to blue shade (#29283)
Now uses the same primary color as light theme. The secondary colors are
shifted towards a slightly blue shade. Could maybe desaturate a bit
more, but overall I think I'm happy with it.

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

<img width="1343" alt="Screenshot 2024-02-27 at 22 21 46"
src="https://github.com/go-gitea/gitea/assets/115237/4163c393-b469-4a53-8f4b-1c33aa04f3ac">
<img width="581" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/e621f7f8-5679-4605-bf42-3d5ff1071e1e">
<img width="581" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/20e66493-2457-482b-b8f1-e5710934e189">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit d557fbc5a715a1920a2860cb04ae6c8fe2225182)
2024-03-06 12:10:44 +08:00
6543 7b23949f29
Let ctx.FormOptionalBool() return optional.Option[bool] (#29461)
just some refactoring bits towards replacing **util.OptionalBool** with
**optional.Option[bool]**

(cherry picked from commit 274c0aea2e88db9bc41690c90e13e8aedf6193d4)
2024-03-06 12:10:43 +08:00
Lunny Xiao c498c07adf
Fix missed return (#29450)
(cherry picked from commit e9f4c2db8291c54044345aebd9381ac820ed9687)
2024-03-06 12:10:43 +08:00
Lunny Xiao 15660334ba
Use tailwind instead of `gt-[wh]-` helper classes (#29423)
Follow #29357
- Replace `gt-w-*` -> `tw-w-*` and remove `gt-w-*`
- Replace `gt-h-*` -> `tw-h-*` and remove `gt-h-*`

(cherry picked from commit 9a8c90ee18095d284192476834d5d23074d136f3)

Conflicts:
	templates/base/head_navbar.tmpl
	templates/status/404.tmpl
	trivial context conflict
2024-03-06 12:10:43 +08:00
wxiaoguang 459ee98136
Only use supported sort order for "explore/users" page (#29430)
Thanks to inferenceus : some sort orders on the "explore/users" page
could list users by their lastlogintime/updatetime.

It leaks user's activity unintentionally. This PR makes that page only
use "supported" sort orders.

Removing the "sort orders" could also be a good solution, while IMO at
the moment keeping the "create time" and "name" orders is also fine, in
case some users would like to find a target user in the search result,
the "sort order" might help.

![image](https://github.com/go-gitea/gitea/assets/2114189/ce5c39c1-1e86-484a-80c3-33cac6419af8)

(cherry picked from commit eedb8f41297c343d6073a7bab46e4df6ee297a90)
2024-03-06 12:10:43 +08:00
sillyguodong 997350a68d
Not trigger all jobs any more, when re-running the first job (#29439)
Previously, it will be treated as "re-run all jobs" when `jobIndex ==
0`. So when you click re-run button on the first job, it triggers all
the jobs actually.

(cherry picked from commit bad4ad70181c747599e206c0e7a87b57c997385d)
2024-03-06 12:10:43 +08:00
Lunny Xiao 894d9b2836
Move context from modules to services (#29440)
Since `modules/context` has to depend on `models` and many other
packages, it should be moved from `modules/context` to
`services/context` according to design principles. There is no logic
code change on this PR, only move packages.

- Move `code.gitea.io/gitea/modules/context` to
`code.gitea.io/gitea/services/context`
- Move `code.gitea.io/gitea/modules/contexttest` to
`code.gitea.io/gitea/services/contexttest` because of depending on
context
- Move `code.gitea.io/gitea/modules/upload` to
`code.gitea.io/gitea/services/context/upload` because of depending on
context

(cherry picked from commit 29f149bd9f517225a3c9f1ca3fb0a7b5325af696)

Conflicts:
	routers/api/packages/alpine/alpine.go
	routers/api/v1/repo/issue_reaction.go
	routers/install/install.go
	routers/web/admin/config.go
	routers/web/passkey.go
	routers/web/repo/search.go
	routers/web/repo/setting/default_branch.go
	routers/web/user/home.go
	routers/web/user/profile.go
	tests/integration/editor_test.go
	tests/integration/integration_test.go
	tests/integration/mirror_push_test.go
	trivial context conflicts
	also modified all other occurrences in Forgejo specific files
2024-03-06 12:10:43 +08:00
silverwind 75f7be2aac
Apply tailwindcss rules with `!important` (#29437)
As per discussion in https://github.com/go-gitea/gitea/pull/29423, I
think this is the right way that does not burden developers having to
think about CSS precedence which should be irrelevant with an atomic CSS
framework.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit e55926ebfe88d6ee079842967dc7dccc2a9cdbf2)
2024-03-06 12:10:43 +08:00
wxiaoguang 8f3ef5aa71
Fix mail template error (#29410)
(cherry picked from commit eb2fc1818b00b7ca6f8c21bb490a8e8be1e62f9a)
2024-03-06 12:10:43 +08:00
Yarden Shoham ef95d1d533
Fix htmx rendering the login page in frame on session logout (#29405)
- Fix #29391

With this change, htmx will not follow the redirect in the AJAX request
but instead redirect the whole browser.

To reproduce the bug fixed by this change without waiting a long time
for the token to expire, you can logout in another tab then look in the
original tab. Just make sure to comment out both instances of
`window.location.href = appSubUrl` in the codebase so you won't be
redirected immediately on logout. This is what I did in the following
gifs.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 324626a11c041208b003ee64e33000b223994662)
2024-03-06 12:10:43 +08:00
yp05327 76070599f9
Ignore empty repo for CreateRepository in action notifier (#29416)
Fix #29415

(cherry picked from commit 403766cd81697288804fd218d68c458c6aa5b73d)
2024-03-06 12:10:43 +08:00
yp05327 480c61432a
Fix logic error from #28138 (#29417)
There's a miss in #28138:

![image](https://github.com/go-gitea/gitea/assets/18380374/b1e0c5fc-0e6e-44ab-9f6e-34bc8ffbe1cc)

https://github.com/go-gitea/gitea/pull/28138/files#diff-2556e62ad7204a230c91927a3f2115e25a2b688240d0ee1de6d34f0277f37dfeR162

@lunny
Not sure about the impact of this, but it will only effect 1.22, and
maybe we should fix it ASAP.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit f8c1efe944c539396402fb014bbfdb67ba199ef2)
2024-03-06 12:10:43 +08:00
Earl Warren d311e5c0b0
Include resource state events in Gitlab downloads (followup)
See also: [GITEA] Enable mocked HTTP responses for GitLab migration test

make GITLAB_READ_TOKEN=XXXX GO_TEST_PACKAGES='code.gitea.io/gitea/services/migrations/... -test.v' FLAGS= 'test#TestGitlabDownloadRepo'

to update the captured GitLab HTTP requests used for offline testing.
2024-03-06 12:10:43 +08:00
Sebastian Brückner bc7a247b9e
Include resource state events in Gitlab downloads (#29382)
Some specific events on Gitlab issues and merge requests are stored
separately from comments as "resource state events". With this change,
all relevant resource state events are downloaded during issue and merge
request migration, and converted to comments.

This PR also updates the template used to render comments to add support
for migrated comments of these types.

ref: https://docs.gitlab.com/ee/api/resource_state_events.html
(cherry picked from commit 17f170ee3724d8bdf2ddaad4211b12433f78ff0e)
2024-03-06 12:10:43 +08:00
GiteaBot a98d786f12
[skip ci] Updated translations via Crowdin
(cherry picked from commit f38888bc7834899777bda1a271e166d3836524cf)
2024-03-06 12:10:42 +08:00
Earl Warren e8fe5e9b0f Merge pull request '[CI] pin go v1.21.8 version' (#2567) from earl-warren/forgejo:wip-ci-go-action into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2567
2024-03-06 04:10:02 +00:00
techknowlogick 2c26b187ea
bump protobuf module (#29617)
(cherry picked from commit 06039bf0b7ec4dffe74ae323b8bbbbedec69d0c8)
2024-03-06 11:39:07 +08:00
Earl Warren ac0f58035f
[CI] pin go v1.21.8 version
Because setup-go fails to pick it up.

Refs: https://github.com/actions/setup-go/issues/462
2024-03-06 11:38:47 +08:00
Earl Warren 96f9673640
[CI] do not hardcode the Forgejo release in end-to-end testing (part 2)
The absence of origin-ref must be the empty string '', not 'false'
2024-03-06 09:09:19 +08:00
Earl Warren d2f24a5a16 Merge pull request '[CI] do not hardcode the Forgejo release in end-to-end testing' (#2564) from earl-warren/forgejo:wip-ci-end-to-end into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2564
2024-03-05 20:01:32 +00:00
Earl Warren d257fa179b
[CI] do not hardcode the Forgejo release in end-to-end testing
Now that Forgejo has its own release number, use the Makefile as a
reference.

Also document and improve support for debugging this
pull_request_target workflow by using a branch in the repository.
2024-03-06 03:15:07 +08:00
Earl Warren 7d6e43079f Merge pull request 'Add gitignore template for Janet projects' (#2557) from firefly-cpp/forgejo:gitignore-for-janet into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2557
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-05 08:08:55 +00:00
Iztok Fister Jr. 209060139d Add gitignore template for Janet projects 2024-03-04 15:13:10 +01:00
Earl Warren 21b1381e36 Merge pull request 'Move migration functions to services layer - port of gitea#29497' (#2546) from algernon/forgejo:gitea/port/29497 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2546
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-04 10:01:26 +00:00
Earl Warren c510b7a4a1 Merge pull request 'Display tag name as title for a tag with no release [gitea]' (#2547) from algernon/forgejo:gitea/port/tag-name-as-title-if-no-release into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2547
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-04 09:56:43 +00:00
Gergely Nagy f9894f4c51
A release title should always be a link
This partially reverts c41b2c73ef21d5c54c7f2658ceffaa163b135131: for the
sake of consistency, the title of a release should always be a link,
whether it's a tag-only release or not.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-04 08:29:11 +01:00
Gergely Nagy 19ff532d42
Test that tags without a release display properly
Update the `TestTagViewWithoutRelease` test case with another assert:
one that checks that the release title is properly displayed.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-03-04 08:29:11 +01:00
Lunny Xiao c41b2c73ef
Display tag name as title for a tag with no release 2024-03-04 07:41:49 +01:00
Lunny Xiao ff8cb299d1
Move migration functions to services layer (#29497) 2024-03-04 07:10:53 +01:00
Codeberg Translate 41b4884085 [I18N] Translations update from Weblate (#2521)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: TheAwiteb <a@4rs.nl>
Co-authored-by: mondstern <mondstern@monocles.de>
Co-authored-by: flactwin <flac_twin@keemail.me>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Fjuro <ifjuro@proton.me>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: zenobit <zen@osowoso.xyz>
Co-authored-by: Dirk <dirk@0x7be.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2521
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-03-04 01:58:49 +00:00
Earl Warren f0f556bee9 Merge pull request '[TESTS] enable AddFixtures in unit tests' (#2541) from earl-warren/forgejo:wip-add-fixture into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2541
2024-03-03 03:56:20 +00:00
Earl Warren ad547edf3b
[TESTS] enable AddFixtures in unit tests
Use setting.AppWorkPath instead of filepath.Dir(setting.AppPath). It
is the common denominator between:

* models/unittest/testdb.go:MainTest
* tests/test_utils.go:InitTest

which makes it usable in unit tests as well as integration tests.
2024-03-03 11:11:26 +08:00
Earl Warren 3f68525ae4 Merge pull request '[BUG] Fix header name in swagger response' (#2526) from gusted/forgejo-header into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2526
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-02 21:16:11 +00:00
Gusted 83b6e59718 Merge pull request 'Accessibility: Focus styling and fix Watch/Unwatch buttons' (#2379) from fnetx/accessibility into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2379
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-02 19:16:47 +00:00
Gusted c559dcddf0 Merge pull request '[FEAT] Show follow symlink button' (#2530) from gusted/forgejo-follow-symlink into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2530
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-02 17:23:18 +00:00
Gusted c63b52c126
[FEAT] Show follow symlink button
- When a user goes opens a symlink file in Forgejo, the file would be
rendered with the path of the symlink as content.
- Add a button that is shown when the user opens a *valid* symlink file,
which means that the symlink must have an valid path to an existent
file and after 999 follows isn't a symlink anymore.
- Return the relative path from the `FollowLink` functions, because Git
really doesn't want to tell where an file is located based on the blob ID.
- Adds integration tests.
2024-03-02 17:58:09 +01:00
Earl Warren 0bba571f5b Merge pull request '[RELEASE] publish container images tagged with the major version' (#2538) from earl-warren/forgejo:wip-release-publish into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2538
2024-03-02 14:45:18 +00:00
Otto Richter 88f68850b5 Accessibility: Watch & Star on small screens
The elements were hidden on small screens to preserve space and the
icons still conveyed the meaning for users with intact eye vision.
However, the names were no longer exposed to screen readers, and their
users usually cannot obtain the meaning from the icons.

Adding aria-labels to the affected templates results in certain
complexity due to the DOM, so instead I decided to use some accessible
CSS tricks to move the content off the screen instead of hiding it. It
should remain accessible for most screen readers.
2024-03-02 14:31:10 +01:00
Otto Richter 4d2c019b5a Add focus styling to most button types
While it might be favourable to have distinct focus and hover styling,
having no focus styling at all makes keyboard navigation very difficult.

Some people consider :focus to be equal to a keyboard-driven :hover, so
I'm moving the focus pseudo-classes from being a no-op to adding the
hover styling.
2024-03-02 14:31:10 +01:00
Otto Richter 30e0b2f851 Label and focus styling for mobile menu button 2024-03-02 14:31:10 +01:00
Gusted 92c1ff76ea Merge pull request 'Make settings tab not active when on repository "Add units" tab' (#2524) from hazy/forgejo:add-more-active into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2524
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-03-02 12:32:01 +00:00
Gusted abe3351187 Merge pull request '[BUG] Allow to select commit email for file updload/delete' (#2383) from 0ko/forgejo:fix-commit-del into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2383
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-03-02 12:00:45 +00:00
Earl Warren 9e662fe2cd
[RELEASE] publish container images tagged with the major version
Now that semantic versions are used, the major version must be used
instead of major.minor to distinguish releases with breaking changes.

Before:

Forgejo v1.21.1-0, tags 1.21.1-0 and 1.21
Forgejo v1.21.2-0, tags 1.21.2-0 and 1.21
Forgejo v1.22.1-0, tags 1.22.1-0 and 1.22

After

Forgejo v7.0.0 tags 7.0.0 and 7
Forgejo v7.0.1 tags 7.0.1 and 7
Forgejo v7.1.2 tags 7.1.2 and 7
Forgejo v8.0.1 tags 8.0.1 and 8
2024-03-02 19:48:28 +08:00
Gusted 2658d4361e
[BUG] Disable CODEOWNERS for forked repositories
- Disable the CODEOWNERS feature for forked repositories, as it would
otherwise inadvertently request reviewers when for example a pull
request is opened against a forked repository to propose changes to an
existant pull request in the original repository.
- Adds integration test.
- Resolves #2525
2024-03-01 23:19:18 +01:00
Gusted 9ce3068f36 Merge pull request '[BUG] Ensure `HasIssueContentHistory` takes into account `comment_id`' (#2518) from gusted/forgejo-default-value-sql-error into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2518
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-01 14:48:06 +00:00
Gusted eadcbcf7d1 Merge pull request '[BUG] Sort file list case insensitively' (#2522) from gusted/forgejo-sort-file-list into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2522
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-03-01 13:58:38 +00:00
Gusted 86b46085c7
[BUG] Sort file list case insensitively
- Make the sorting done on the entries list case insensitive.
- Adds integration test.
- Resolves #317
2024-02-29 21:14:06 +01:00
Gusted a4fa0f985f Merge pull request '[I18N] Improve registration / password reset emails' (#2529) from n0toose/service-email-improvements into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2529
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-29 20:07:22 +00:00
Panagiotis "Ivory" Vasilopoulos f7c26a4491 [I18N] Improve registration / password reset emails
This change does not introduce any new strings, but improves upon some
existing ones.
2024-02-29 19:53:17 +01:00
Gusted 331fa44956
[BUG] Ensure `HasIssueContentHistory` takes into account `comment_id`
- The content history table contains the content history of issues and
comments. For issues they are saved with an comment id of zero.
- If you want to check if the issue has an content history, it should
take into account that SQL has `comment_id = 0`, as it otherwise could
return incorrect results when for example the issue already has an
comment that has an content history.
- Fix the code of `HasIssueContentHistory` to take this into account, it
relied on XORM to generate the SQL from the non-default values of the
struct, this wouldn't generate the `comment_id = 0` SQL as `0` is the
default value of an integer.
- Remove an unncessary log (it's not the responsibility of `models`
code to do logging).
- Adds unit test.
- Resolves #2513
2024-02-29 18:23:06 +01:00
Earl Warren 32a0afe8b7 Merge pull request '[SEMVER] X.Y.Z+A.B.C replaced with X.Y.Z+gitea-A.B.C' (#2514) from earl-warren/forgejo:wip-semantic-gitea into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2514
2024-02-29 15:59:48 +00:00
Gusted 42ae3d3d81
[BUG] Fix header name in swagger response
- This was incorrectly copied from the `swaggerCommitList` struct, which
on the other hand does set `X-Total`, but the API handler that uses this
response only sets `X-Total-Count`.
2024-02-29 14:08:10 +01:00
hazycora 6e6ebe4857
Make settings tab not active when on repository units tab 2024-02-28 21:17:53 -06:00
Gusted d0e5af7079 Merge pull request '[UI] Actions: Link to Workflow in View' (#1866) from n0toose/forgejo:forgejo-add-workflow-link into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1866
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-28 17:28:16 +00:00
Earl Warren 07b99560cc
[SEMVER] X.Y.Z+A.B.C replaced with X.Y.Z+gitea-A.B.C
Gitea versions are

* A.B.C
* A.B.C+rc-0
* A.B.C+dev-5-g4fb9056

If Forgejo versions are:

* X.Y.Z+A.B.C
* X.Y.Z-rc0+A.B.C
* X.Y.Z-dev-1232-g4fb905687+A.B.C

It is non trivial for a client trying to sort out if the server
responding to `/api/v1/version` is Forgejo or Gitea. The Forgejo
version changes to be:

* X.Y.Z+gitea-A.B.C
* X.Y.Z-rc0+gitea-A.B.C
* X.Y.Z-dev-1232-g4fb905687+gitea-A.B.C

and a client can now:

* Split the version with +
* If the second part (the metadata) exists and contains "gitea", the
  answer server is Forgejo
* Otherwise it is Gitea
2024-02-28 15:57:48 +01:00
Earl Warren 7af1349c1d Merge pull request '[BUG] Correct changed files for codeowners' (#2507) from gusted/forgejo-codeowner-diff into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2507
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-02-28 12:15:49 +00:00
Earl Warren 7584ed6a4e Merge pull request '[CHORE] Update `connect-go` to maintained fork' (#2417) from gusted/forgejo-move-dep into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2417
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-28 11:11:26 +00:00
Codeberg Translate 1a8f579b6e [I18N] Translations update from Weblate (#2479)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: b1nar10 <amtaboada99@gmail.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: mondstern <mondstern@monocles.de>
Co-authored-by: Xinayder <me+codeberg@aoalmeida.com>
Co-authored-by: earl-warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2479
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-02-28 10:27:44 +00:00
Earl Warren 4fb9056877 Merge pull request '[RELEASE] switch to semantic versioning' (#2459) from earl-warren/forgejo:wip-release-number into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2459
Reviewed-by: Otto <otto@codeberg.org>
2024-02-28 10:18:20 +00:00
Gusted 0c4872f839
[CHORE] Update `connect-go` to maintained fork
- Update github.com/bufbuild/connect-go to
https://github.com/connectrpc/connect-go.
- This is a fork that's actively maintained and is recommend by the
original library. Looking at the recent release notes, it looks like
going in the right direction what one would expect of a library, no
strange features being added, lots of improvements.
- There's still an indirect dependency by
`code.gitea.io/actions-proto-go` on a old version of `connect-go`.
2024-02-28 09:40:56 +01:00
Gusted 64a0d61aff [BUG] Implement commit mail selection for other Git operations
- Implement the commit mail selection feature for the other supported
Git operations that can be done trough the web UI.
- Adds integration tests (goodluck reviewing this).
- Ref: #1788

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
2024-02-27 22:41:58 +00:00
Gusted fb2795b5bb
[BUG] Correct changed files for codeowners
- The CODEOWNER feature relies on the changed files to determine which
reviewers should be added according to the `CODEOWNER` file.
- The current approach was to 'diff' between the base and head branch,
which seems logical but fail in practice when the pull request is out of
date with the base branch. Therefore it should instead diff between the
head branch and the merge base of the head and base branch, so only the
actual affected files by the pull requests are used, the same approach
is used by the diff of an unmerged pull request.
- Add integration testing (for the feature as well).
- Resolves #2458
2024-02-27 23:16:00 +01:00
Earl Warren 2855727c85 Merge pull request 'Disabling Stars should disable the routes too' (#2471) from algernon/forgejo:stars/disable-routes into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2471
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-27 21:24:25 +00:00
Earl Warren 22dece5eec Merge pull request '[CI] adjust swagger version to be compatible with go1.22' (#2312) from oliverpool/forgejo:go1.22 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2312
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-27 21:23:32 +00:00
oliverpool f489341fe6 [Swagger] update to latest version 2024-02-27 20:45:57 +00:00
Earl Warren b678123de8 Merge pull request 'Fix the Fork button in repo headers' (#2495) from algernon/forgejo:b/fork-button-fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2495
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-27 18:36:37 +00:00
Gergely Nagy aef0b024b7 Fix the Fork button in repo headers
In #2445, I lifted out the fork button into its own template, but did
not update it properly. This resulted in the fork button's counter not
displaying, and pointing to the wrong place too.

This patch updates the template to account for it moving to a separate
file, and also adds test cases to verify the button is display as it
should be.

Fixes #2494.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-27 18:36:37 +00:00
Earl Warren e6f1863476 Merge pull request '[gitea] add attachment support for code review comments gitea#29220' (#2501) from oliverpool/forgejo:review_attachment_support into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2501
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-27 18:35:43 +00:00
oliverpool e154655c87 fix missing argument 2024-02-27 18:35:43 +00:00
oliverpool 3c9b176348 fix cherry-pick 2024-02-27 18:35:43 +00:00
Jimmy Praet f95fb8cc44 Add attachment support for code review comments (#29220)
Fixes #27960, #24411, #12183

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-27 18:35:43 +00:00
Earl Warren 590f86796b Merge pull request 'Allow `'s` in mentions' (#2485) from algernon/forgejo:mentions/the-book-of-aposthropes into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2485
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-27 18:26:59 +00:00
Gergely Nagy 00b24d2d9a Allow `'s` in mentions
When mentioning a user in a comment, or a similar place, sometimes one
would wish to use a possessive: `As per @user's suggestion` or somesuch.
This patch modifies the `mentionPattern` used to find mentions, to allow
- and then ignore - apostrophes and whatever comes after them.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-27 18:26:59 +00:00
Earl Warren c39321c6ca Merge pull request '[UI] Agit: Add link to docs and tooltip to label' (#2499) from n0toose/agit-add-ui-hints into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2499
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-27 17:46:58 +00:00
Panagiotis "Ivory" Vasilopoulos 5bc7b8baf8 [UI] Agit: Add link to docs and tooltip to label
Continuation of #2444, which introduced the commit
bf7fb89178 but only added
the label and the tests.

The tooltip explaining what AGit is and its advantages is not
meant to advertise AGit - it is meant to inform the reader that
is presumably not familiar with the workflow that they will not
be able to find a fork or a branch associated with the Pull Request
as a direct consequence of this workflow.

Issue #2474 mentions that we should show instructions on how to
fetch an AGit-created Pull Request, and this is the plan. However,
this may take time, so I might as well make the label a bit more
"complete" and less out-of-place for now if we do not manage to
improve these instructions until the next release (Forgejo v1.22).

Refs: https://codeberg.org/forgejo/forgejo/issues/2474
2024-02-27 17:46:58 +00:00
Earl Warren 6cbc64e0a5 Merge pull request '[I18N] Improve English strings & consistency' (#2492) from 0ko/forgejo:english20240226 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2492
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-27 17:42:59 +00:00
0ko 2e76e4fb33 [I18N] Improve English strings & consistency 2024-02-27 17:42:59 +00:00
Earl Warren d29e9374c7 Merge pull request 'Restore the ability to view tags without a release' (#2498) from algernon/forgejo:b/tag-view-fix into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2498
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-27 15:43:07 +00:00
Gergely Nagy c9b410fb35
Highlight the correct small menu item when viewing a tag
When viewing a tag that isn't associated with a release, highlight the
"N Tags" sub-menu item, rather than the "M releases" one.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-27 13:32:55 +01:00
Gergely Nagy fc635f1014
Restore the ability to view tags without a release
The `repo.SingleRelease` handler was broken by gitea#29149, as the
switch to `getReleaseInfos` stopped returning tags without an associated
release. This resulted in the web UI showing a 404 when trying to view a
tag without a release.

This restores the functionality by explicitly including tags in the
search, and also adds tests to exercise the fix.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-27 13:32:55 +01:00
Earl Warren 3fa4962a88 Merge pull request '[gitea] cherry-pick' (#2478) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2478
2024-02-27 10:39:41 +00:00
Earl Warren d9ae3717b5 Merge pull request '[BUG] Remember topic only in repo search' (#2489) from gusted/forgejo-topic-explore into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2489
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-26 22:40:34 +00:00
Earl Warren 0f098d1ad7
[DEADCODE] update 2024-02-26 22:30:27 +01:00
Earl Warren 6ed19cc00d
templates: Safe & Escape no longer exist 2024-02-26 22:30:27 +01:00
Yarden Shoham 8a25361d9a
Remove jQuery AJAX from the archive download links (#29380)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo archive download links dropdown functionality and it
works as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/db791249-bca1-4d22-ac5e-623f68023e15)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit ed3892d8430652c2bc8e2af21844d14769825e8a)
2024-02-26 22:30:27 +01:00
silverwind cfda925862
Add tailwindcss (#29357)
This will get tailwindcss working on a basic level. It provides only the
utility classes, e.g. no tailwind base which we don't need because we
have our own CSS reset. Without the base, we also do not have their CSS
variables so a small amount of features do not work and I removed the
generated classes for them.

***Note for future developers: This currently uses a `tw-` prefix, so we
use it like `tw-p-3`.***

<details>
<summary>Currently added CSS, all false-positives</summary>

```
.\!visible{

    visibility: visible !important
}

.visible{

    visibility: visible
}

.invisible{

    visibility: hidden
}

.collapse{

    visibility: collapse
}

.static{

    position: static
}

.\!fixed{

    position: fixed !important
}

.absolute{

    position: absolute
}

.relative{

    position: relative
}

.sticky{

    position: sticky
}

.left-10{

    left: 2.5rem
}

.isolate{

    isolation: isolate
}

.float-right{

    float: right
}

.float-left{

    float: left
}

.mr-2{

    margin-right: 0.5rem
}

.mr-3{

    margin-right: 0.75rem
}

.\!block{

    display: block !important
}

.block{

    display: block
}

.inline-block{

    display: inline-block
}

.inline{

    display: inline
}

.flex{

    display: flex
}

.inline-flex{

    display: inline-flex
}

.\!table{

    display: table !important
}

.inline-table{

    display: inline-table
}

.table-caption{

    display: table-caption
}

.table-cell{

    display: table-cell
}

.table-column{

    display: table-column
}

.table-column-group{

    display: table-column-group
}

.table-footer-group{

    display: table-footer-group
}

.table-header-group{

    display: table-header-group
}

.table-row-group{

    display: table-row-group
}

.table-row{

    display: table-row
}

.flow-root{

    display: flow-root
}

.inline-grid{

    display: inline-grid
}

.contents{

    display: contents
}

.list-item{

    display: list-item
}

.\!hidden{

    display: none !important
}

.hidden{

    display: none
}

.flex-shrink{

    flex-shrink: 1
}

.shrink{

    flex-shrink: 1
}

.flex-grow{

    flex-grow: 1
}

.grow{

    flex-grow: 1
}

.border-collapse{

    border-collapse: collapse
}

.select-all{

    user-select: all
}

.resize{

    resize: both
}

.flex-wrap{

    flex-wrap: wrap
}

.overflow-visible{

    overflow: visible
}

.rounded{

    border-radius: 0.25rem
}

.border{

    border-width: 1px
}

.text-justify{

    text-align: justify
}

.uppercase{

    text-transform: uppercase
}

.lowercase{

    text-transform: lowercase
}

.capitalize{

    text-transform: capitalize
}

.italic{

    font-style: italic
}

.text-red{

    color: var(--color-red)
}

.text-shadow{

    color: var(--color-shadow)
}

.underline{

    text-decoration-line: underline
}

.overline{

    text-decoration-line: overline
}

.line-through{

    text-decoration-line: line-through
}

.outline{

    outline-style: solid
}

.ease-in{

    transition-timing-function: cubic-bezier(0.4, 0, 1, 1)
}

.ease-in-out{

    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1)
}

.ease-out{

    transition-timing-function: cubic-bezier(0, 0, 0.2, 1)
}
```

</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit f4b92578b4601bc6e9b631b9a5a5f3766c27b0cb)
2024-02-26 22:30:27 +01:00
KN4CK3R 359e1a74e2
Add missing space (#29393)
(cherry picked from commit 4ccf5ab330c9ce8959aa6734c2e6fee282619ba5)
2024-02-26 22:30:27 +01:00
Tim-Niclas Oelschläger 4662f4feac
enforce maxlength in frontend (#29389)
Set maxlength attribute in frontend

to long file-name

![image](https://github.com/go-gitea/gitea/assets/72873130/15111614-55ab-4583-acb2-15c25997601d)

![image](https://github.com/go-gitea/gitea/assets/72873130/4105ddd8-4973-4da8-b3ab-4cfae1b45554)
(same for branch-name and commit-summary)

(cherry picked from commit 756b952c52f1efbb137df36d5b97b370c8a45565)
2024-02-26 22:30:27 +01:00
wxiaoguang 70f3c32b91
Remove incorrect and unnecessary Escape from templates (#29394)
Follow #29165

* some of them are incorrect, which would lead to double escaping (eg:
`(print (Escape $.RepoLink)`)
* other of them are not necessary, because `Tr` handles strings&HTML
automatically

Suggest to review by "unified view":
https://github.com/go-gitea/gitea/pull/29394/files?diff=unified&w=0

(cherry picked from commit d2f6588b66549b33adf8bac7044d03c89d668470)

Conflicts:
	templates/code/searchcombo.tmpl
	templates/mail/auth/register_notify.tmpl
	templates/mail/issue/default.tmpl
	templates/repo/code/recently_pushed_new_branches.tmpl
	templates/repo/search.tmpl
	templates/repo/settings/protected_branch.tmpl
	templates/user/auth/activate.tmpl
	templates/user/auth/forgot_passwd.tmpl
	templates/user/dashboard/feeds.tmpl
	context
2024-02-26 22:30:27 +01:00
wxiaoguang 630d3f929e
Make actions animation rotate counterclockwisely (#29378)
Because the icon is:

![image](https://github.com/go-gitea/gitea/assets/2114189/be7e78ab-bc64-46d9-8259-fd7f0037471a)

So it must rotate counterclockwisely

(cherry picked from commit ea164aba4b697aa08e4d20d896a8f318c09a6523)
2024-02-26 22:30:27 +01:00
KN4CK3R 753f9711e9
Add `io.Closer` guidelines (#29387)
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit ad0a34b492c3d41952ff4648c8bfb7b54c376151)
2024-02-26 22:30:27 +01:00
Yarden Shoham 3723caf762
Remove jQuery AJAX from the notice selection deletion button (#29381)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo notice selection deletion button functionality and it
works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 0676bf52f95b9c9ac6f5679bd263d844e6a83fa1)
2024-02-26 22:30:27 +01:00
wxiaoguang 90a62b87c0
Refactor Safe modifier (#29392)
After this PR: no need to play with the Safe/Escape tricks anymore. See
the changes for more details.

(cherry picked from commit f9207b09479df964872d68842469991042b5497f)

Conflicts:
	templates/repo/issue/view_title.tmpl
	templates/user/settings/applications.tmpl
	context
2024-02-26 22:30:27 +01:00
Yarden Shoham 30fe3d8d4c
Remove jQuery from the code diff expansion buttons (#29385)
- Removed all jQuery AJAX calls and replaced with htmx
- Tested the code diff expansion buttons functionality and it works as
before plus a loading indicator

# Demo using `htmx` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/afba7442-ed56-4d39-b764-835d1f6c3a9c)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 4e3d81e44ee3f504f7262966533305561e04101f)
2024-02-26 22:30:27 +01:00
Yarden Shoham 4a08726c96
Remove jQuery AJAX from the markdown editor preview (#29384)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the markdown editor preview button functionality and it works
as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/3fc7abb8-4fdc-46e9-95f6-087d9526bb52)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 1f6de13897fa0ac74087b2d1ec00cbef06caf2f7)
2024-02-26 22:30:27 +01:00
wxiaoguang 29517c54e6
Refactor `copy` button event handler (#29379)
Use "closest" instead of "for-loop"

(cherry picked from commit 736c98be5c2bed26cef9f7f679c49a95af8161ef)
2024-02-26 22:30:27 +01:00
Yarden Shoham 110b06f88b
Remove jQuery AJAX from the repo commit graph (#29373)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo collaborator mode dropdown functionality and it works
as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/7e2f166e-9941-4f26-9666-d00cdf3d9f60)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit b616f666b89f57f3c285b70c11693f50ba38bcaa)
2024-02-26 22:30:27 +01:00
Yarden Shoham 5362ce7a42
Remove jQuery AJAX from repo collaborator mode dropdown (#29371)
- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo collaborator mode dropdown functionality and it works
as before

# Demo using `fetch` instead of jQuery AJAX

![action](https://github.com/go-gitea/gitea/assets/20454870/04466629-19b2-4469-9231-38820ee13c36)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 15d071f4f81a0ad09f260de83cb6402875b4de27)
2024-02-26 22:30:27 +01:00
wxiaoguang f92c3de965
Remove RenderEmojiPlain from template helper (#29375)
RenderEmojiPlain(emoji.ReplaceAliases) should be called explicitly for
some contents, but not for everything.

Actually in modern days, in most cases it doesn't need such
"ReplaceAliases". So only keep it for issue/PR titles.

If anyone really needs to do ReplaceAliases for some contents, I will
propose a following fix.

(cherry picked from commit 10c7996b5a5c705964fc6cc9c1817eea1fc436ef)

Conflicts:
	templates/base/head.tmpl
	context
2024-02-26 22:30:27 +01:00
Yarden Shoham 757567d3bd
Remove jQuery from the Unicode escape button (#29369)
- Switched to plain JavaScript
- Tested the Unicode escape button functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/664f0ced-876b-4cb7-a668-bd62169fc843)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit c86d033a3ec0514efcd9524d03dce1b6551e487f)
2024-02-26 22:30:27 +01:00
Lunny Xiao 003a358949
Users with `read` permission of pull requests can be assigned too (#27263)
This PR will also keep the consistent between list assigned users and
check assigned users.

(cherry picked from commit 98ab9445d1020c515c3c789f0b27d952903a2978)
2024-02-26 22:30:27 +01:00
Zettat123 77c56e29de
Allow non-admin users to delete review requests (#29057)
Fix #14459

The following users can add/remove review requests of a PR
- the poster of the PR
- the owner or collaborators of the repository
- members with read permission on the pull requests unit

(cherry picked from commit c42083a33950be6ee9f822c6d0de3c3a79d1f51b)

Conflicts:
	models/repo/repo_list_test.go
	tests/integration/api_nodeinfo_test.go
	tests/integration/api_repo_test.go
	shared fixture counts
2024-02-26 22:30:27 +01:00
Yarden Shoham e91b948613
Remove jQuery from the issue reference context popup (#29367)
- Removed all jQuery calls
- Tested the context popup functionality and it works as before

# Demo without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/90b53de5-a8e9-4ed7-9236-1c9dfc324f38)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 267dbb4e938cc42dc09a4a893cca631b2f755557)
2024-02-26 22:30:27 +01:00
KN4CK3R 64ef7d3658
Do not double close reader (#29354)
Fixes #29346

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 553d46e6f6a144905266d58315a2b0ff2e976380)
2024-02-26 22:30:26 +01:00
Şahin Akkaya 428008ac19
Implement recent commits graph (#29210)
This is the implementation of Recent Commits page. This feature was
mentioned on #18262.

It adds another tab to Activity page called Recent Commits. Recent
Commits tab shows number of commits since last year for the repository.

(cherry picked from commit d3982bcd814bac93e3cbce1c7eb749b17e413fbd)
2024-02-26 22:30:26 +01:00
qwerty287 1608ef0ce9
Add API to get merged PR of a commit (#29243)
Adds a new API `/repos/{owner}/{repo}/commits/{sha}/pull` that allows
you to get the merged PR associated to a commit.

---------

Co-authored-by: 6543 <6543@obermui.de>
(cherry picked from commit 0a426cc575734e5eff410d6a790f40473117f753)
2024-02-26 22:30:26 +01:00
Sebastian Brückner f0acc71ba1
Properly migrate target branch change GitLab comment (#29340)
GitLab generates "system notes" whenever an event happens within the
platform. Unlike Gitea, those events are stored and retrieved as text
comments with no semantic details. The only way to tell whether a
comment was generated in this manner is the `system` flag on the note
type.

This PR adds detection for a new specific kind of event: Changing the
target branch of a PR. When detected, it is downloaded using Gitea's
type for this event, and eventually uploaded into Gitea in the expected
format, i.e. with no text content in the comment.

This PR also updates the template used to render comments to add support
for migrated comments of this type.

ref:
11bd6dc826/app/services/system_notes/merge_requests_service.rb (L102)
(cherry picked from commit 6e5966597c2d498d1a8540dad965461d44ff8e57)
2024-02-26 22:30:26 +01:00
Lunny Xiao 6905540088
Use the database object format name but not read from git repoisitory everytime and fix possible migration wrong objectformat when migrating a sha256 repository (#29294)
Now we can get object format name from git command line or from the
database repository table. Assume the column is right, we don't need to
read from git command line every time.

This also fixed a possible bug that the object format is wrong when
migrating a sha256 repository from external.

<img width="658" alt="image"
src="https://github.com/go-gitea/gitea/assets/81045/6e9a9dcf-13bf-4267-928b-6bf2c2560423">

(cherry picked from commit b79c30435f439af8243ee281310258cdf141e27b)

Conflicts:
	routers/web/repo/blame.go
	services/agit/agit.go
	context
2024-02-26 22:30:26 +01:00
Şahin Akkaya f097799953
Implement code frequency graph (#29191)
### Overview
This is the implementation of Code Frequency page. This feature was
mentioned on these issues: #18262, #7392.

It adds another tab to Activity page called Code Frequency. Code
Frequency tab shows additions and deletions over time since the
repository existed.

Before:
<img width="1296" alt="image"
src="https://github.com/go-gitea/gitea/assets/32161460/2603504f-aee7-4929-a8c4-fb3412a7a0f6">

After:
<img width="1296" alt="image"
src="https://github.com/go-gitea/gitea/assets/32161460/58c03721-729f-4536-a663-9f337f240963">

---

#### Features
- See additions deletions over time since repository existed
- Click on "Additions" or "Deletions" legend to show only one type of
contribution
- Use the same cache from Contributors page so that the loading of data
will be fast once it is cached by visiting either one of the pages

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 875f5ea6d83c8371f309df99654ca3556623004c)
2024-02-26 22:30:26 +01:00
Carlos Felgueiras fc384e494e
Fix validity of the FROM email address not being checked (#29347)
Fixes #27188.
Introduces a check on the installation that tries to parse the FROM
address. If it fails, shows a new error message to the user.

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 6f6120dfa8d549d0b866eeb9317054fea831c844)

Conflicts:
	options/locale/locale_en-US.ini
	context
2024-02-26 22:30:26 +01:00
silverwind 7143f8fcdd
Refactor generate-svg.js (#29348)
Small refactor to avoid `process` global and to sync it with
`generate-images`.

(cherry picked from commit 08c1926e1c3e2487f207b5f225d8b0f2831d0708)
2024-02-26 22:30:26 +01:00
6543 7db422d989
Make optional.Option[T] type serializable (#29282)
make the generic `Option` type de-/serializable for json and yaml

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 53c7d8908e5ef35818b72b8c3d873b509269bc1a)
2024-02-26 22:30:26 +01:00
Yarden Shoham 7bf905a43c
Remove jQuery from the stopwatch (#29351)
- Switched to plain JavaScript
- Tested the stopwatch functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/c8e9a401-45e5-4a1d-a683-0d655f1d570e)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 12d233faf786a54579a33b99b3cd56586c279f56)
2024-02-26 22:30:26 +01:00
Zettat123 826bf12bb4
Fix tarball/zipball download bug (#29342)
Fix #29249

~~Use the `/repos/{owner}/{repo}/archive/{archive}` API to download.~~

Apply #26430 to archive download URLs.

(cherry picked from commit b762a1f1b1f7941a7db2207552d7b441d868cbe9)
2024-02-26 22:30:26 +01:00
Lunny Xiao 767e9634d3
Allow options to disable user deletion from the interface on app.ini (#29275)
Extract from #20549

This PR added a new option on app.ini `[admin]USER_DISABLED_FEATURES` to
allow the site administrator to disable users visiting deletion user
interface or allow.
This options are also potentially allowed to define more features in
future PRs.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 3ef6252e06a1f3981f8b7d1717bfc581418b1dc5)

Conflicts:
	custom/conf/app.example.ini
	docs/content/administration/config-cheat-sheet.en-us.md
	modules/setting/admin.go
	context
2024-02-26 22:30:26 +01:00
6543 8ff858b94b
Start to migrate from `util.OptionalBool` to `optional.Option[bool]` (#29329)
just create transition helper and migrate two structs

(cherry picked from commit 7fbdb60fc1152acc9a040dc04b1b0f5a3475b081)
2024-02-26 22:30:26 +01:00
Tim-Nicas Oelschläger 4b494d341f
Unify organizations header (#29248)
Unify organizations header

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/74474e0d-33c3-4bbf-9324-d130ea2c62f8)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/1c65de0d-fa0f-4b17-ab8d-067de8c7113b)

---------

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 532e422027c88a4a3dc0c2968857f8d5f94d861f)

Conflicts:
	routers/web/shared/user/header.go
	templates/org/home.tmpl
	context
2024-02-26 22:30:26 +01:00
silverwind 643d66ee0e
Upgrade to fabric 6 (#29334)
Upgrade fabric to latest v6 beta. It works for our use case, even
thought it does not fix the upstream issue
https://github.com/fabricjs/fabric.js/issues/9679 that
https://github.com/go-gitea/gitea/issues/29326 relates to.

(cherry picked from commit c4b0cb4d0d527793296cf801e611f77666f86551)

Conflicts:
	public/assets/img/favicon.svg
	public/assets/img/logo.svg
2024-02-26 22:30:26 +01:00
silverwind c432f141bb
Don't show third-party JS errors in production builds (#29303)
So we don't get issues like
https://github.com/go-gitea/gitea/issues/29080 and
https://github.com/go-gitea/gitea/issues/29273 any more. Only active in
[production
builds](https://webpack.js.org/guides/production/#specify-the-mode), in
non-production the errors will still show.

(cherry picked from commit 532da5ed5ee3edb45d2ee63c6ab0fad53473691f)
2024-02-26 22:30:26 +01:00
Lunny Xiao 44f45d8b72
Ignore the linux anchor point to avoid linux migrate failure (#29295)
Fix #28843

This PR will bypass the pushUpdateTag to database failure when
syncAllTags. An error log will be recorded.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 5ed17d9895bf678374ef5227ca37870c1c170802)
2024-02-26 22:30:26 +01:00
Yarden Shoham 6db296f1cb
Remove jQuery from the repo commit functions (#29230)
- Switched to plain JavaScript
- Tested the commit ellipsis button functionality and it works as before
- Tested the commits statuses tippy functionality and it works as before
- Tested the last commit loader functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/465516f8-0ff3-438c-a17e-26cbab82750b)

![action](https://github.com/go-gitea/gitea/assets/20454870/968da210-9382-4b50-a4c2-09419dc86e07)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit eaede2de98fbe0ac2156c9f4cd8b5899d2c7cbbf)
2024-02-26 22:30:26 +01:00
wxiaoguang 60447a7097
Remove unnecessary "Safe" modifier from templates (#29318)
Follow #29165

(cherry picked from commit 7a1557d2cc893030ae900c4333eeb12d84b891dc)

Conflicts:
	templates/package/content/alpine.tmpl
	templates/package/content/cargo.tmpl
	templates/package/content/chef.tmpl
	templates/package/content/composer.tmpl
	templates/package/content/conan.tmpl
	templates/package/content/conda.tmpl
	templates/package/content/container.tmpl
	templates/package/content/cran.tmpl
	templates/package/content/debian.tmpl
	templates/package/content/generic.tmpl
	templates/package/content/go.tmpl
	templates/package/content/helm.tmpl
	templates/package/content/maven.tmpl
	templates/package/content/npm.tmpl
	templates/package/content/nuget.tmpl
	templates/package/content/pub.tmpl
	templates/package/content/pypi.tmpl
	templates/package/content/rpm.tmpl
	templates/package/content/rubygems.tmpl
	templates/package/content/swift.tmpl
	templates/package/content/vagrant.tmpl
	templates/package/shared/cargo.tmpl
	templates/package/shared/list.tmpl
	templates/repo/code/recently_pushed_new_branches.tmpl
	templates/repo/issue/view_content/comments.tmpl
	templates/status/404.tmpl
	templates/user/settings/packages.tmpl
	context
2024-02-26 22:30:26 +01:00
Yarden Shoham 01fa6fbb97
Remove jQuery from the image pasting functionality (#29324)
- Switched to plain JavaScript
- Tested the image pasting functionality and it works as before

# Demo using JavaScript without jQuery

![demo](https://github.com/go-gitea/gitea/assets/20454870/018993ff-7b09-4d5f-88e0-f276368bacd6)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit f390d5eb4f4db21eeacdf2e7a093f6bd4e87c96f)
2024-02-26 22:30:26 +01:00
Zettat123 ff5df5fc97
Improve the `issue_comment` workflow trigger event (#29277)
Fix #29175
Replace #29207

This PR makes some improvements to the `issue_comment` workflow trigger
event.

1. Fix the bug that pull requests cannot trigger `issue_comment`
workflows
2. Previously the `issue_comment` event only supported the `created`
activity type. This PR adds support for the missing `edited` and
`deleted` activity types.
3. Some events (including `issue_comment`, `issues`, etc. ) only trigger
workflows that belong to the workflow file on the default branch. This
PR introduces the `IsDefaultBranchWorkflow` function to check for these
events.

(cherry picked from commit a4fe1cdf38f9a063e44b197ef07e4260f731c919)

Conflicts:
	modules/actions/github.go
	context
2024-02-26 22:30:26 +01:00
Sebastian Brückner 542badbb76
Properly migrate automatic merge GitLab comments (#27873)
GitLab generates "system notes" whenever an event happens within the
platform. Unlike Gitea, those events are stored and retrieved as text
comments with no semantic details. The only way to tell whether a
comment was generated in this manner is the `system` flag on the note
type.

This PR adds detection for two specific kinds of events: Scheduling and
un-scheduling of automatic merges on a PR. When detected, they are
downloaded using Gitea's type for these events, and eventually uploaded
into Gitea in the expected format, i.e. with no text content in the
comment.

This PR also updates the template used to render comments to add support
for migrated comments of these two types.

ref:
11bd6dc826/app/services/system_notes/merge_requests_service.rb (L6-L17)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a70c00b80bcb5de8479e407f1b8f08dcf756019d)
2024-02-26 22:30:26 +01:00
wxiaoguang 7906838669
Refactor cmd setup and remove deadcode (#29313)
* use `setup(ctx, c.Bool("debug"))` like all other callers
* `setting.RunMode = "dev"` is a no-op.
* `if _, err := os.Stat(setting.RepoRootPath); err != nil` could be
simplified

(cherry picked from commit e9b13732f3d3b5536e43bdfdb5757dbbf484d694)
2024-02-26 22:30:25 +01:00
KN4CK3R 9debff3b71
Discard unread data of `git cat-file` (#29297)
Fixes #29101
Related #29298

Discard all read data to prevent misinterpreting existing data. Some
discard calls were missing in error cases.

---------

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit d6811baf88ca6d58b92d4dc12b1f2a292198751f)
2024-02-26 22:30:25 +01:00
silverwind 3591d9bff9
Don't install playwright twice (#29302)
1. `playwright/test` is already installed as part of `deps-frontend` on
CI which runs before, so it's better to not install it again (on a
potentially different version), and just use the version from
package.json and add the `deps-frontend` dependency.
2. `PLAYWRIGHT_DIR` is a undefined variable, so I removed it

```bash
$ git show c8ded77680 | grep PLAYWRIGHT_DIR
+playwright: $(PLAYWRIGHT_DIR)
```

(cherry picked from commit c236e64aca42b9ab0743431bc505033a0cb78b93)
2024-02-26 22:30:25 +01:00
GiteaBot 0f793ef6b9
[skip ci] Updated translations via Crowdin
(cherry picked from commit 2bd999a28b472f2909f6856740cdc712eb0ad136)

Conflicts:
	options/locale/locale_fr-FR.ini
	options/locale/locale_ja-JP.ini
	options/locale/locale_pt-PT.ini
	options/locale/locale_ru-RU.ini
	options/locale/locale_zh-CN.ini
        removal of
         runs.no_workflows.quick_start=
         runs.no_workflows.documentation=
2024-02-26 22:30:25 +01:00
KN4CK3R 5f79550a0d
Prevent double use of `git cat-file` session. (#29298)
Fixes the reason why #29101 is hard to replicate.
Related #29297

Create a repo with a file with minimum size 4097 bytes (I use 10000) and
execute the following code:
```go
gitRepo, err := gitrepo.OpenRepository(db.DefaultContext, <repo>)
assert.NoError(t, err)

commit, err := gitRepo.GetCommit(<sha>)
assert.NoError(t, err)

entry, err := commit.GetTreeEntryByPath(<file>)
assert.NoError(t, err)

b := entry.Blob()

// Create a reader
r, err := b.DataAsync()
assert.NoError(t, err)
defer r.Close()

// Create a second reader
r2, err := b.DataAsync()
assert.NoError(t, err) // Should be no error but is ErrNotExist
defer r2.Close()
```

The problem is the check in `CatFileBatch`:

79217ea63c/modules/git/repo_base_nogogit.go (L81-L87)
`Buffered() > 0` is used to check if there is a "operation" in progress
at the moment. This is a problem because we can't control the internal
buffer in the `bufio.Reader`. The code above demonstrates a sequence
which initiates an operation for which the code thinks there is no
active processing. The second call to `DataAsync()` therefore reuses the
existing instances instead of creating a new batch reader.

(cherry picked from commit f74c869221624092999097af38b6f7fae4701420)
2024-02-26 22:30:25 +01:00
Lunny Xiao c88ae2e382
Revert #28753 because UI broken. (#29293)
Revert #29255
Revert #28753

(cherry picked from commit e6e50696b83164805bec83a1b20c95a85a4dd7e5)
2024-02-26 22:30:25 +01:00
Zettat123 321aaedc4e
Fix error display when merging PRs (#29288)
Partially fix #29071, regression of Modernize merge button #28140

Fix some missing `Redirect` -> `JSONRedirect`.

Thanks @yp05327 for the help in
https://github.com/go-gitea/gitea/issues/29071#issuecomment-1931261075

(cherry picked from commit 79217ea63c1f77de7ca79813ae45950724e63d02)
2024-02-26 22:30:25 +01:00
Yarden Shoham 769db26c5a
Remove jQuery from the installation page (#29284)
- Switched to plain JavaScript
- Tested the installation page functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/286475b3-1919-4d99-b790-def10fa36e66)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 4e536edaead97d61a64508db0e93cf781a889472)
2024-02-26 22:30:25 +01:00
wxiaoguang 2c8f112c1c
Always write proc-receive hook for all git versions (#29287)
(cherry picked from commit 7f45dfb030f30a3ada58e636e3b8bfde391224bd)
2024-02-26 22:30:25 +01:00
Earl Warren d3a642a7e0
Revert "[BUG] Initalize Git for hook regeneration"
This reverts commit 815abad84c.

Redundant with:

 Always write proc-receive hook for all git versions (#29287)
2024-02-26 22:30:25 +01:00
Jason Song 52bf6bf60c
Do not use `ctx.Doer` when reset password (#29289)
Fix #29278.

Caused by a small typo in #28733

(cherry picked from commit 22b8de85ddda50725480b21c5bf6ef9c0202b5e9)
2024-02-26 21:42:15 +01:00
DC f803c5c0f4
Update Discord logo (#29285)
Fixes #27057 by changing the discord .svg file and running `make svg`.

Before:

<img width="637"
src="https://private-user-images.githubusercontent.com/85847352/267667100-1eaf5d20-b4e9-4736-bb55-7f1da04bbde7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDg0NzAwNDUsIm5iZiI6MTcwODQ2OTc0NSwicGF0aCI6Ii84NTg0NzM1Mi8yNjc2NjcxMDAtMWVhZjVkMjAtYjRlOS00NzM2LWJiNTUtN2YxZGEwNGJiZGU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjIwVDIyNTU0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIwN2Y2ODc5N2MzZDU5NzgzODRhNDIzZWY3MDk3ODhiYmIzZDU4NWVlYmFmZjc2OTIyZjE3MWM4ZDg0ODZjNTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.C6jVQLFPfq4fhGV8wiY9D-P21PUNTDMkX2d2-kU17Ug">

After:

<img width="637"
src="https://github.com/go-gitea/gitea/assets/106393991/45b197ae-e422-42f4-999e-25dc8f6b7a92">

(cherry picked from commit 3d3c3d9ee5e934c515370d98f1c552ca8ef10f8a)
2024-02-26 21:42:15 +01:00
GiteaBot 1410079b98
[skip ci] Updated translations via Crowdin
(cherry picked from commit 69dbfbe4e52845a807302a15e8d79d183acf683b)
2024-02-26 21:42:15 +01:00
silverwind 6068537f8a
Remove jQuery .map() and enable eslint rules for it (#29272)
- Use case in `repo-commit` was tested until the point where the POST
request was sent with the same payload.
- Use case in `repo-legacy` was tested completely with comment editing.
- `jquery/no-fade` was disabled as well to stay in sync with
`no-jquery/no-fade`, had no violations.

(cherry picked from commit a5c570c1e02302212a5d8f7cf7d91f24ab0578d5)
2024-02-26 21:42:15 +01:00
Yarden Shoham 0d61f3decc
Remove jQuery from repo wiki creation page (#29271)
- Switched to plain JavaScript
- Tested the wiki creation form functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/2dfc95fd-40cc-4ffb-9ae6-50f798fddd67)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit ade1110e8b7d94dc142a259854e2b73845eab8b9)
2024-02-26 21:42:15 +01:00
Zettat123 eefc4bf6f0
Do not show delete button when time tracker is disabled (#29257)
Fix #29233

The delete button of time logs won't be shown when the time tracker is disabled.

![image](https://github.com/go-gitea/gitea/assets/15528715/5cc4e0c9-d2f9-4b8f-a2f5-fe202b94c191)

(cherry picked from commit 8c21bc0d51ab22c0d05d8ce2ea8bc80d6f893800)
2024-02-26 21:42:15 +01:00
Rafael Heard 89eca88643
Left align the input labels for the link account page (#29255)
In a previous [PR](https://github.com/go-gitea/gitea/pull/28753) we
moved the labels to be above the inputs. The PR ensures that the
alignment is also on both tabs of the link account page
(`/user/link_account`).

Before
<img width="1094" alt="before"
src="https://github.com/go-gitea/gitea/assets/6152817/ac1e86bd-c4d6-4e45-87d1-87bb8a736149">

After
<img width="1094" alt="after"
src="https://github.com/go-gitea/gitea/assets/6152817/1b5fc109-f4d2-43ee-b924-0a9e53a0e391">

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
(cherry picked from commit e4e5d76932e9d5ba1f8c63213aefae1493012a81)
2024-02-26 21:42:15 +01:00
GiteaBot 445c78e09f
[skip ci] Updated translations via Crowdin
(cherry picked from commit d9268369473965fce1464325d9f4b15ed9d38046)
2024-02-26 21:42:15 +01:00
Yarden Shoham 58699d21e7
Remove jQuery from the repo migration form (#29229)
- Switched to plain JavaScript
- Tested the repo migration form functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/3496ec05-48a7-449e-8cdd-f8372ba0d589)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 100031f5f143a15c79ebbe1b77c86091e3b6d489)
2024-02-26 21:42:14 +01:00
vincent fb137d1e49
Fix content size does not match error when uploading lfs file (#29259)
![image](https://github.com/go-gitea/gitea/assets/38434877/cd726b4d-4771-4547-8aee-ae4e4b56b1d1)
When we update an lfs file by API
`api/v1/repos/{owner}/{repo}/contents/{filepath}`, there will show an
error

```json
{
  "message": "Put \"05904d6c7b16bb9b29587100ab1414\": readfrom tcp [::1]:57300->[::1]:9000: content size does not match",
  "url": "http://localhost:3000/api/swagger"
}
```

The reason of this error is
https://github.com/go-gitea/gitea/blob/main/services/repository/files/update.go,
in this file, the `file.ContentReader` been used twice. So when use
`file.ContentReader` in the second time, the `i` of this Reader has been
updated to the length of the content. it will return 0 and an `io.EOF`
error when we try to read cotent from this Reader.

(cherry picked from commit 35d5e4aea4bb02a0b4c7b38ecb2acf612151e891)
2024-02-26 21:42:14 +01:00
6543 f796548225
Workaround to clean up old reviews on creating a new one (#28554)
close  #28542

blocks  #28544

---
*Sponsored by Kithara Software GmbH*

(cherry picked from commit 217d71c48a10265e08b95cc961656b921f61f9ff)

Conflicts:
	tests/integration/api_pull_review_test.go
	context
2024-02-26 21:42:14 +01:00
Earl Warren fe8c9b74cd Merge pull request '[BUG] Fix diff patch operation in web UI' (#2449) from gusted/forgejo-fix-diffpatch into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2449
Reviewed-by: Otto <otto@codeberg.org>
2024-02-26 20:27:07 +00:00
Gergely Nagy 0b4a9c4ec2
Disabling Stars should disable the routes too
Similarly to how `[repository].DISABLE_FORKS` works, lets make
`[repository].DISABLE_STARS` disable the routes too, not just hide the
functionality from the UI.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-26 20:50:32 +01:00
Gusted 3d3196eb3c Merge pull request '[TRANSLATION] Clarify description in deletion modal' (#2488) from gusted/forgejo-clarify-translation into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2488
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-26 15:51:14 +00:00
Gusted b4360d504c
[BUG] Remember topic only in repo search
- If the user is searching repositories with an specific topic, adding
any other filter option, such as showing unrelevant repositories or
using another sort Forgejo should remember that 'topic only' was set.
- Adds integration test.
- Resolves #2461
2024-02-26 16:25:01 +01:00
Gusted 8018c2c761
[TRANSLATION] Clarify description in deletion modal
- The value is now in the form `owner/repo` since #1473, so update the
label to reflect this.
- Ref: #2412
2024-02-26 16:09:06 +01:00
Earl Warren 775956cc68 Merge pull request '[BUG] Don't overwrite protected branch accidentally' (#2473) from gusted/forgejo-error-duplicate into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2473
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-26 14:55:09 +00:00
Earl Warren f91702dd74 Merge pull request 'Split up `repo.Action` in `routers/web` into smaller functions.' (#2476) from algernon/forgejo:refactor/routes/web/repo-action into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2476
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-26 14:54:35 +00:00
Earl Warren 393f98e888 Merge pull request '[BUG] Use correct logout URL' (#2475) from gusted/forgejo-logout-url into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2475
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-26 14:51:58 +00:00
Earl Warren 5e1d7b3c82 Merge pull request 'Linguist support enhancements from gitea#29267 & bugfixes' (#2487) from algernon/forgejo:linguist/gitea-29267 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2487
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-26 14:27:07 +00:00
Gergely Nagy ae0635fd61
Correctly support linguist-documentation=false
If a documentation file is marked with a `linguist-documentation=false`
attribute, include it in language stats.

However, make sure that we do *not* include documentation languages as
fallback.

Added a new test case to exercise the formerly buggy behaviour.

Problem discovered while reviewing @KN4CK3R's tests from gitea#29267.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-26 14:18:33 +01:00
Gergely Nagy ee39c58120
Convert linguist attribute handling to optional.Option
Based on @KN4CK3R's work in gitea#29267. This drops the custom
`LinguistBoolAttrib` type, and uses `optional.Option` instead. I added
the `isTrue()` and `isFalse()` (function-local) helpers to make the code
easier to follow, because these names convey their goal better than
`v.ValueorDefault(false)` or `!v.ValueOrDefault(true)`.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-26 12:52:59 +01:00
Gergely Nagy 7e6fe41389
Add tests for the star/unstar & watch/unwatch UI
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-26 09:14:11 +01:00
Earl Warren c80406332f Merge pull request '[CI] run frontend checks' (#2477) from earl-warren/forgejo:wip-ci-frontend into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2477
2024-02-26 07:48:30 +00:00
Earl Warren 4b859fd51f Merge pull request 'Add API to get PR by base/head' (#2481) from 6543-forks/forgejo:gitea_29242 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2481
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-26 07:46:22 +00:00
Gergely Nagy 38e30f2a8f
Refactor routers/web/repo.Action
Split up `repo.Action` in `routers/web` into smaller functions.

While some of the functionality was very similar (starring / watching),
they are ultimately separate actions. Rather than collecting all of them
under a single handler (`repo.Action`), split them up into smaller,
independent functions.

This does result in a little bit of code duplication, but the
independent functions should be easier to follow and understand.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-26 08:29:13 +01:00
Gergely Nagy 02eab930c9
routers/web: Drop an unused branch from repo.Action
The "desc" action has not been used since at least 2016, probably much
earlier. It's an ancient Gogs artifact - drop it.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-26 08:29:13 +01:00
qwerty287 feb189554e
Add API to get PR by base/head (#29242)
Closes https://github.com/go-gitea/gitea/issues/16289

Add a new API `/repos/{owner}/{repo}/pulls/{base}/{head}` to get a PR by
its base and head branch.
2024-02-26 03:41:42 +01:00
Gusted c2280a2009
Fix CSS linting errors
- Trivial auto-fix applied.
- Removed CSS that was no longer needed (either was removed or upstream
already improved the CSS).
- Used existing variables for colors.
- Fix CSS selectors to match existing ones.
2024-02-26 00:40:43 +01:00
Codeberg Translate dc825acb33 [I18N] Translations update from Weblate (#2428)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: mondstern <mondstern@monocles.de>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: Application-Maker <application-maker.uinwad@erine.email>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Dirk <dirk@0x7be.de>
Co-authored-by: Squeljur <squeljur+git@gmail.com>
Co-authored-by: nebras <johndevand@tutanota.com>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2428
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-02-25 22:50:12 +00:00
Gusted c4a92ec9da
[FRONTEND] fix javascript linting errors 2024-02-25 23:43:58 +01:00
Earl Warren 9560492a84
[FRONTEND] move the gitea svg to web_src/svg
and run make svg to update the forgejo svg as well
2024-02-25 23:41:33 +01:00
Earl Warren 1424df9b71
[FRONTEND] package-lock.json is named as forgejo 2024-02-25 23:40:54 +01:00
Earl Warren 5d2c4706d0
[CI] run frontend checks 2024-02-25 23:08:09 +01:00
Gusted 1272ac4f69
[BUG] Use correct logout URL
- If a `logout` event is send the user should be redirected to the
homepage, there are three mechanism that can do this. The response of
`/user/logout` and the event listener of notifications or stopwatch.
It's essentially a race for what's processed first to determine which
mechanism takes care of redirecting the user.
- Fix that the redirection mechanism of the notification and stopwatch
event listener redirects to an absolute URL.
- Ref: #2135
2024-02-25 21:25:59 +01:00
Gusted 1bab4358ac
[BUG] Don't overwrite protected branch accidentally
- If a user tries to create another protected branching rule that
specifies a set of branches already used by another rule, do not allow
it.
- Update the translation accordingly.
- Adds integration test.
- Resolves #2455
2024-02-25 20:09:18 +01:00
Earl Warren 4b8fecd71e
[RELEASE] switch to semantic versioning
The release number displayed by the API and the CLI becomes:

7.0.0+1.22.0

instead of

1.22.0

It would otherwise be inconsistent to have different version number depending on the interface. With the current implementation `/api/forgejo/v1/version` would return `7.0.0+1.22.0` while `/api/v1/version` would return `1.22.0`. The release would be announced as `7.0.0+1.22.0` but the web API would display `1.22.0`.

It may cause some tools that are Gitea specific to not behave as they should in the future if they expect a Gitea version number and activate some features depending on what it is. They would need to be patched to strip the leading Forgejo version number before asserting the Gitea version.

Refs: https://codeberg.org/forgejo/forgejo/issues/2425
2024-02-25 17:00:26 +01:00
Earl Warren f991f107da Merge pull request 'Improve display of 404/500 error pages' (#2466) from 0ko/forgejo:errorcodes into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2466
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-25 15:53:09 +00:00
Earl Warren 649ca2b230 Merge pull request 'Allow instance-wide disabling of forking' (#2445) from algernon/forgejo:f/disable-forks into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2445
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-25 15:13:15 +00:00
Earl Warren bc2a105cbb Merge pull request '[FEAT] Check if commit is already present in target branch' (#2450) from gusted/forgejo-agit-contain-commit into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2450
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-25 15:05:33 +00:00
Earl Warren 006b2dd381 Merge pull request 'Eliminate wrapping quotes in English locale' (#2467) from 0ko/forgejo:rnd-quotes into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2467
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-25 15:03:29 +00:00
Earl Warren 39324ad005 Merge pull request '[REFACTOR] cli: prepareWorkPathAndCustomConf is not just for actions' (#2463) from earl-warren/forgejo:wip-cli-refactor into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2463
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-25 14:48:47 +00:00
Earl Warren ef1d579c41 Merge pull request '[UI] Agit: Add AGit label to AGit-created PRs' (#2444) from n0toose/agit-indicator into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2444
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-25 14:48:09 +00:00
Gusted 490b81a8ed Merge pull request 'Move permission check from ArtifactsDeleteView to the route' (#2464) from algernon/forgejo:gitea-port/artifact-deletion/refactor into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2464
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-25 14:15:03 +00:00
0ko a748ba70a8 10-year old images are gone 2024-02-25 18:13:59 +05:00
0ko e34ead7a46 [I18N] eliminate wrapping quotes 2024-02-25 17:03:09 +05:00
Gergely Nagy 0ea021c8c9
Allow instance-wide disabling of forking
For small, personal self-hosted instances with no user signups, the fork
button is just a noise. This patch allows disabling them like stars can
be disabled too.

Disabling forks does not only remove the buttons from the web UI, it
also disables the routes that could be used to create forks.

Fixes #2441.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-25 12:00:17 +01:00
0ko 186f1f5669 [THEME] refactor display of 404/500 error pages 2024-02-25 15:59:12 +05:00
Gergely Nagy 9372bdd4a3
Move permission check from ArtifactsDeleteView to the route
As suggested by @Gusted in #2431, move the permission checking from
`ArtifactsDeleteView` into the route instead, where it belongs.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-25 10:52:11 +01:00
Earl Warren 8a5a7a88be
[REFACTOR] cli: prepareWorkPathAndCustomConf is not just for actions
Split prepareWorkPathAndCustomConf out of the actions sub-command.

In the CLI prepareWorkPathAndCustomConf is a preparation step that is
needed before running the sub-command actions in the Forgejo CLI. It
is currently specific to this sub-command but it will be useful for
other sub-commands such as F3.
2024-02-25 09:54:25 +01:00
Earl Warren b7ea2ea463 Merge pull request 'Fixes #2452 - Skipping SHA256 tests if unsupported' (#2456) from lhinderberger/forgejo:2452-skip-sha256-if-unsupported into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2456
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-24 16:55:05 +00:00
Lucas Hinderberger c8ae3498e7 gofmt-ed modules/git/utils_test.go due to linter 2024-02-24 15:53:38 +01:00
Earl Warren 3471adb14a Merge pull request '[FEAT] Enable ambiguous character detection in configured contexts' (#2427) from gusted/forgejo-ambigious-characters into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2427
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-02-24 12:25:31 +00:00
Earl Warren bc8d61d12e Merge pull request '[FEAT] Restrict file size of blame operation' (#2395) from gusted/forgejo-blame-restrict into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2395
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-23 23:17:02 +00:00
Lucas Hinderberger a4b0c0edc5 Fixes #2452 - Skipping SHA256 tests if unsupported
The test suite was broken e.g. on Debian 12 due to requiring a very
recent version of Git installed on the system. This commit skips SHA256
tests in the git module, if a Git version older than 2.42 or gogit is used.
2024-02-24 00:14:24 +01:00
Gusted f0ed6de89d
[FEAT] Check if commit is already present in target branch
- Check if someone is (accidentally) trying to create a pull request via
AGit with changes already in the target branch and fail if that is the
case.
- Added integration test.
2024-02-23 21:42:15 +01:00
Panagiotis "Ivory" Vasilopoulos bf7fb89178 [UI] Agit: Add AGit label to AGit-created PRs
Adds a label to Pull Requests that were created using AGit-Flow,
in order to prevent situations where a contributor uses AGit-Flow
to push new changes - only to realize that they did not use AGit-Flow
in the first place, and that they just opened a new PR accidentally
(that was me).

Also intended to raise general awareness about the feature. Some
additional work, such as adding a tooltip, still needs to be
done.

A small typo fix for a comment and (exclusively) formatting fixes
in the copyright header are also included.

Refs: https://codeberg.org/forgejo/forgejo/issues/2433
2024-02-23 21:09:08 +01:00
Gusted f304441341
[BUG] Fix diff patch operation in web UI
- The form used by the diff patch operation requires that the value of
`tree_path` is set, even though it's not used. Set it to `patch` so this
feature can be used again.
- Regression of 08fe6f8c7e.
2024-02-23 17:40:44 +01:00
Earl Warren b8563acedb Merge pull request '[CI] name the test release after the latest v*-dev tag' (#2448) from earl-warren/forgejo:wip-release-number into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2448
2024-02-23 16:31:51 +00:00
Earl Warren 2762dd9597
[CI] name the test release after the latest v*-dev tag
Also ignore the *-test tags when figuring out the Forgejo version,
they exist in the integration repository and experimental repository
for daily releases.
2024-02-23 15:37:46 +01:00
Earl Warren 6531d765a0 Merge pull request 'Fixes & Improvements for English locale' (#2437) from 0ko/forgejo:english240222 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2437
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-23 12:22:51 +00:00
Gusted 5b3a82d621
[FEAT] Enable ambiguous character detection in configured contexts
- The ambiguous character detection is an important security feature to
combat against sourcebase attacks (https://trojansource.codes/).
- However there are a few problems with the feature as it stands
today (i) it's apparantly an big performance hitter, it's twice as slow
as syntax highlighting (ii) it contains false positives, because it's
reporting valid problems but not valid within the context of a
programming language (ambiguous charachters in code comments being a
prime example) that can lead to security issues (iii) charachters from
certain languages always being marked as ambiguous. It's a lot of effort
to fix the aforementioned issues.
- Therefore, make it configurable in which context the ambiguous
character detection should be run, this avoids running detection in all
contexts such as file views, but still enable it in commits and pull
requests diffs where it matters the most. Ideally this also becomes an
per-repository setting, but the code architecture doesn't allow for a
clean implementation of that.
- Adds unit test.
- Adds integration tests to ensure that the contexts and instance-wide
is respected (and that ambigious charachter detection actually work in
different places).
- Ref: https://codeberg.org/forgejo/forgejo/pulls/2395#issuecomment-1575547
- Ref: https://codeberg.org/forgejo/forgejo/issues/564
2024-02-23 13:12:17 +01:00
Earl Warren 894a0eff9f Merge pull request 'Artifact deletion: port of gitea#27172 and gitea#29241' (#2431) from algernon/forgejo:gitea-port/artifact-deletion into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2431
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-23 12:00:03 +00:00
Earl Warren f47c17d532 Merge pull request '[REFACTOR] Simplify converting struct to map in admin stats' (#2442) from gusted/forgejo-admin-stats into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2442
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-23 11:32:17 +00:00
Gergely Nagy 98943fdb43
tests: Add a basic test for artifact deletion
Adds a very bare-bones test for artifact deletion. It does not exercise
the functionality itself, just the presence of the functionality.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-23 09:24:43 +01:00
FuXiaoHei 7f64e4d2a3
Expire artifacts before deleting them physically (#29241)
https://github.com/go-gitea/gitea/pull/27172#discussion_r1493735466

When cleanup artifacts, it removes storage first. If storage is not
exist (maybe delete manually), it gets error and continue loop. It makes
a dead loop if there are a lot pending but non-existing artifacts.

Now it updates db record at first to avoid keep a lot of pending status
artifacts.
2024-02-23 09:06:14 +01:00
FuXiaoHei c551d3f3ab
Artifact deletion in actions ui (#27172)
Add deletion link in runs view page.
Fix #26315

![image](https://github.com/go-gitea/gitea/assets/2142787/aa65a4ab-f434-4deb-b953-21e63c212033)

When click deletion button. It marks this artifact `need-delete`.

This artifact would be deleted when actions cleanup cron task.
2024-02-23 09:06:14 +01:00
Earl Warren c47e6ceb82 Merge pull request '[FEAT] repo search using git grep' (#1594) from snematoda/forgejo:forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1594
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-22 22:21:44 +00:00
Panagiotis "Ivory" Vasilopoulos 62f3ff6074 [UI] Actions: I will always run make fmt before pushing
I will always run make fmt before pushing
I will always run make fmt before pushing
I will always run make fmt before pushing
2024-02-22 22:31:26 +01:00
Panagiotis "Ivory" Vasilopoulos 2a0a5c6ec0 [UI] Actions: Oops, forgot to lint the tests. 2024-02-22 22:26:11 +01:00
Gusted f68bc0ec6a
[REFACTOR] Simplify converting struct to map in admin stats
- Instead of relying on JSON to convert the struct to map, use
`reflect` to do this conversion. Also simplify it a bit by only passing
one variable to the template.
- This avoids issues where the conversion to JSON causes changes in
the value, for example huge numbers are converted to its scientific
notation but are consequently not converted back when being displayed.
- Adds unit tests.
- Resolves an issue where the amount of comments is being displayed in
scientific notation on Codeberg.
2024-02-22 22:25:19 +01:00
Panagiotis "Ivory" Vasilopoulos 785f336c12 [UI] Actions: Improve frontend testing 2024-02-22 22:12:44 +01:00
Earl Warren ec1b64637e Merge pull request 'Do not run e2e tests in parallel' (#2440) from maltejur/forgejo:e2e_parallel into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2440
2024-02-22 18:57:05 +00:00
Earl Warren c06af395af Merge pull request 'Enable e2e testing on Firefox' (#2439) from maltejur/forgejo:e2e_firefox into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2439
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-22 18:56:29 +00:00
Malte Jürgens 9018b4c9fe
Enable e2e testing on Firefox 2024-02-22 19:27:03 +01:00
Malte Jürgens e8585eff5c
Do not run e2e tests in parallel 2024-02-22 19:26:25 +01:00
0ko e5b5585ee2 Fixes & Improvements for English locale 2024-02-22 22:33:22 +05:00
Earl Warren e7a97a39a6 Merge pull request '[TESTS] verify sanitization of names to prevent XSS' (#2435) from earl-warren/forgejo:wip-xss into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2435
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-22 16:06:38 +00:00
Gusted ca798e4cc2
[SECURITY] Test XSS in dismissed review
It's possible for reviews to not be assiocated with users, when they
were migrated from another forge instance. In the migration code,
there's no sanitization check for author names, so they could contain
HTML tags and thus needs to be properely escaped.
2024-02-22 15:33:20 +01:00
Earl Warren 6f41188ac1 Merge pull request '[RELEASE] v1.21.6-0 release notes' (#2410) from earl-warren/forgejo:wip-release-notes-1.21 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2410
2024-02-22 14:08:00 +00:00
Gusted 565e331238
[SECURITY] Test XSS in wiki last commit information
On the wiki and revisions page, information is shown about the last
commit that modified that wiki page. This includes the time it was last
edited and by whom. Verify it is sanitized.
2024-02-22 15:03:15 +01:00
Earl Warren 704615fa65
[RELEASE] v1.21.6-0 release notes
Refs: https://codeberg.org/forgejo/forgejo/issues/2408
2024-02-22 14:22:32 +01:00
Panagiotis "Ivory" Vasilopoulos 1668904513 [UI] Actions: Link to Workflow in View 2024-02-22 13:18:06 +01:00
Earl Warren 2f5b266cca Merge pull request 'Add e2e debug server' (#2423) from maltejur/forgejo:e2e_debugserver into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2423
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-21 20:34:06 +00:00
Malte Jürgens 5c67c34ce8
Add e2e debug server
This adds the ability to run `make test-e2e-debugserver` to start a
forgejo server pupulated with the test data from `models/fixtures`. This
is particularly useful for debugging the e2e tests with a external tool,
such as the Playwright extension for VSCode [1].

[1] https://open-vsx.org/extension/ms-playwright/playwright
2024-02-21 20:47:57 +01:00
Earl Warren 3be80c9e95 Merge pull request '[THEMES] Port console colors' (#2419) from gusted/forgejo-port-css into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2419
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-21 14:39:50 +00:00
Codeberg Translate 0081e59243 [I18N] Translations update from Weblate (#2384)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: Kaede Fujisaki <psi@7io.org>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: Wuzzy <wuzzy@disroot.org>
Co-authored-by: meskobalazs <meskobalazs@fsf.hu>
Co-authored-by: Xinayder <me+codeberg@aoalmeida.com>
Co-authored-by: Anonymous <noreply@weblate.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: Dirk <dirk@0x7be.de>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: Squeljur <squeljur+git@gmail.com>
Co-authored-by: noureddin <noureddin@protonmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2384
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-02-21 13:36:00 +00:00
Earl Warren 9daf97b46e Merge pull request '[BUG] Initalize Git for hook regeneration' (#2416) from gusted/forgejo-init-git into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2416
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-21 13:29:02 +00:00
Earl Warren 726ce5e3f9 Merge pull request '[BUG] Load `AllUnitsEnabled` when necessary' (#2420) from gusted/forgejo-add-more into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2420
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-21 13:25:38 +00:00
Michael Kriese 849de07064 feat(xorm): add max idle time setting for db connections (#2418)
Add a new optional `CONN_MAX_IDLETIME`[^1]

This allows to set the `SetConnMaxIdleTime` on `database/sql`.
It's useful to allow to close more idle connections to reduce database connections, especially on postgresql.
For me i would like to use it to set a higher max idle connections but they will all be closed after being idle.
So also the last idle connection will be closed when there is no load on forgejo.
I also use it with max connection lifetime, because currently `database/sql` doesn't detect a postgresql master change[^2] and i'll get `[E] can't update runner status: pq: cannot execute UPDATE in a read-only transaction`[^3] on forgejo until the connection is closed.

[^1]: https://pkg.go.dev/database/sql#DB.SetConnMaxIdleTime
[^2]: https://stackoverflow.com/questions/51858659/how-to-safely-discard-golang-database-sql-pooled-connections-for-example-when-t
[^3]: https://matrix.to/#/!zpNKWqkiEOyljSMQDK:matrix.org/$_AJft_amsGn5hXGOYw75JoBJQnW3aKJEpb-Iw53L_TU?via=schinas.net&via=matrix.org&via=nitro.chat

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2418
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2024-02-21 12:17:16 +00:00
Gusted 6fbfe441de
[BUG] Load `AllUnitsEnabled` when necessary
- In order to determine if the "Add more..." tab should be shown, the
template has to know if the repository has all units enabled, this is
done in the repository header which can be shown for quite a lot of
pages (code, issues, projects, actions etc.)
- This was previously set in the `RepoRefByType` function, which would
be called by pages such as code, issues and releases, but it was not
being called for all pages such as actions, packages and wiki. Which
would in turn incorrectly show the "Add more..." button when it
shouldn't.
- Now call it from the template itself, so the value is 'always' loaded
when necessary.
2024-02-21 12:48:26 +01:00
Gusted c6d366e283
[THEMES] Port console colors
- Port 1fd7e3d6be to the Forgejo themes,
they are a copy paste, but have a bit darker console background color to
have better contrast and match better with the overal Forgejo dark
theme's shade.
2024-02-21 12:19:15 +01:00
Gusted 815abad84c
[BUG] Initalize Git for hook regeneration
- The hook regeneration code relies on `git.SupportProcReceive` being
set to determine if the `proc-receive` hook should be written, this
variable is set when the git module is initialized.
- Resolves #2414
2024-02-20 19:39:50 +01:00
Shiny Nematoda 51fb6f3983 [FEAT] add fallback repo search using git grep 2024-02-20 13:00:34 +00:00
Earl Warren 0533022d63 Merge pull request '[gitea] cherry-pick' (#2397) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2397
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-19 23:03:10 +00:00
Gusted f128b6efc9 Merge pull request '[BUG] Restrict when to make link absolute in markdown' (#2403) from gusted/forgejo-custom-url into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2403
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-02-19 22:16:23 +00:00
Şahin Akkaya 8125fe0634
Deduplicate translations for contributors graph (#29256)
I have implemented three graph pages
([contributors](https://github.com/go-gitea/gitea/pull/27882), [code
frequency](https://github.com/go-gitea/gitea/pull/29191) and [recent
commits](https://github.com/go-gitea/gitea/pull/29210)) and they have
all same page title as the tab name so I decided to use same
translations for them. This PR is for contributors graph. Other PR's
have their own respective commits.

(cherry picked from commit 39a77d92d9677b0a0049cb8696960d6d2ac052d6)
2024-02-19 22:58:33 +01:00
wxiaoguang c7c20ff5ab
Remove DataRaceCheck (#29258)
Since #26254, it started using `{{ctx.Locale.Tr ...}}`

Now the `ctx` seems stable enough, so the check could be removed.

(cherry picked from commit 567a68a0bf78c8d70f08c8ab948fdbb455225aa9)
2024-02-19 22:58:33 +01:00
Johan Van de Wauw 5fffab8d9d
Fix c/p error in inline documentation (#29148)
Fix small copy/paste error in inline documentation

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 740c6a226c4df26432641018fbfd9186977d573f)
2024-02-19 22:58:33 +01:00
KN4CK3R 369fe56966
Show commit status for releases (#29149)
Fixes #29082

![grafik](https://github.com/go-gitea/gitea/assets/1666336/bb2ccde1-ee99-459d-9e74-0fb8ea79e8b3)

(cherry picked from commit 7e8ff709401d09467c3eee7c69cd9600d26a97a3)
2024-02-19 22:58:33 +01:00
Markus Amshove b1d66f50fb
Disallow merge when required checked are missing (#29143)
fixes #21892

This PR disallows merging a PR when not all commit status contexts
configured in the branch protection are met.

Previously, the PR was happy to merge when one commit status was
successful and the other contexts weren't reported.

Any feedback is welcome, first time Go :-)
I'm also not sure if the changes in the template break something else

Given the following branch protection:

![branch_protection](https://github.com/go-gitea/gitea/assets/2401875/f871b4e4-138b-435a-b496-f9ad432e3dec)

This was shown before the change:

![before](https://github.com/go-gitea/gitea/assets/2401875/60424ff0-ee09-4fa0-856e-64e6e3fb0612)

With the change, it is now shown as this:

![after](https://github.com/go-gitea/gitea/assets/2401875/4e464142-efb1-4889-8166-eb3be26c8f3d)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a11ccc9fcd61fb25ffb1c37b87a0df4ee9efd84e)
2024-02-19 22:58:33 +01:00
Jason Song e96e1beded
Do not use lower tag names to find releases/tags (#29261)
Fix #26090, see
https://github.com/go-gitea/gitea/issues/26090#issuecomment-1952013206

Since `TagName` stores the original tag name and `LowerTagName` stores
the lower tag name, it doesn't make sense to use lowercase tags as
`TagNames` in `FindReleasesOptions`.

5e72526da4/services/repository/push.go (L396-L397)

While the only other usage looks correct:

5e72526da4/routers/web/repo/repo.go (L416)
(cherry picked from commit 0ea8de2d0729e1e1d0ea9de1e59fbcb673e87fd2)
2024-02-19 22:58:33 +01:00
silverwind b3f2447bc4
Downscale pasted PNG images based on metadata (#29123)
Some images like MacOS screenshots contain
[pHYs](http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.div.8)
data which we can use to downscale uploaded images so they render in the
same dppx ratio in which they were taken.

Before:

<img width="584" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/50979e3a-5d5a-40dc-a0a4-36eb6e28f14a">

After:

<img width="329" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/0690902a-f2fe-4c6b-97b3-6fdd67c21bad">

(cherry picked from commit 5e72526da4e915791f03af056890e16821bde052)
2024-02-19 22:58:33 +01:00
GiteaBot bb911b2d5f
[skip ci] Updated licenses and gitignores
(cherry picked from commit f04e71f9bc05d4930e1eff0b69ceb0e890528e30)
2024-02-19 22:58:33 +01:00
Şahin Akkaya 68cf08090d
De-duplicate contributor graph translations (#29247)
(cherry picked from commit 20f6a7c484d9dbf249d8e1dafa9a8c0a2e12127e)
2024-02-19 22:58:33 +01:00
Lunny Xiao ac3f389e29
Fix missed edit issues event for actions (#29237)
Fix #29213

(cherry picked from commit c2a8aacae5242adbeb7bc1d4002492ae1cae47b2)
2024-02-19 22:58:33 +01:00
silverwind aefc747ccb
Clean up diff header css and reduce global textarea min-height (#29232)
1. Tweak diff header and remove a numbe of unneeded CSS for it:

Before:
<img width="433" alt="Screenshot 2024-02-18 at 01 08 09"
src="https://github.com/go-gitea/gitea/assets/115237/d8b377c0-57bc-44d5-bb57-a582c7d4b3b4">

After:
<img width="463" alt="Screenshot 2024-02-18 at 01 07 56"
src="https://github.com/go-gitea/gitea/assets/115237/d08c17e7-5b86-4d07-81da-6371f4754325">

3. Reduce height of review textarea and also reduce fomantic's CSS from
12em to 8em. Now fits better on my screen:

<img width="1352" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/5c658d13-295e-4929-94da-13ade888020d">

---------

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 39f8ab591c18a65cf783ecd17ddc1a5914ceff7a)
2024-02-19 22:58:33 +01:00
wxiaoguang d611fe8d26
Improve TrHTML and add more tests (#29228)
Follow #29165.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 4345cac52971c13debfe5e6f311aef3930fe2eed)
2024-02-19 22:58:33 +01:00
Tim-Nicas Oelschläger 559afdad73
Convert visibility to number (#29226)
Don't throw error while creating user (Fixes #29218)

(cherry picked from commit 6093f507fe6f2d4802de8ec1ff5b04820e81571c)
2024-02-19 22:58:33 +01:00
yp05327 d93d963c3f
Implement some action notifier functions (#29173)
Fix #29166

Add support for the following activity types of `pull_request`
- assigned
- unassigned
- review_requested
- review_request_removed
- milestoned
- demilestoned

(cherry picked from commit 1a6e1cbada27db1e3327b0d7d331492c95e24759)
2024-02-19 22:58:32 +01:00
wxiaoguang 81925ebb0c
Refactor more code in templates (#29236)
Follow #29165.

* Introduce JSONTemplate to help to render JSON templates
* Introduce JSEscapeSafe for templates. Now only use `{{ ... |
JSEscape}}` instead of `{{ ... | JSEscape | Safe}}`
* Simplify "UserLocationMapURL" useage

(cherry picked from commit 31bb9f3247388b993c61a10190cfd512408ce57e)
2024-02-19 22:58:32 +01:00
wxiaoguang bdf470785d
Use "Safe" modifier for manually constructed safe HTML strings in templates (#29227)
Follow #29165. These HTML strings are safe to be rendered directly, to
avoid double-escaping.

(cherry picked from commit a784ed3d6c6946fd9bf95f2e910f52f549326fe2)
2024-02-19 22:58:32 +01:00
Yarden Shoham ca46f7f7e0
Remove jQuery from repo migrate page (#29219)
- Switched to plain JavaScript
- Tested the repo migrate functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/44ad134b-832e-44b8-8e77-7cc8603d95fe)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 5e1bf3efe2ad3ba6cd30db187ca59b94c3fcdafa)
2024-02-19 22:58:32 +01:00
Yarden Shoham 66bae322b4
Remove unneccesary `initUserAuthLinkAccountView` from "link account" page (#29217)
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 3da2c63354eb3804c7aec3c688b066b044f2c30e)
2024-02-19 22:58:32 +01:00
Earl Warren fc10cfeacf Merge pull request 'Port "Remove jQuery from the repo release form"' (#2402) from gusted/forgejo-port-gitea-pr-2 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2402
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-19 21:58:17 +00:00
Earl Warren fa1341ccc2 Merge pull request 'Port "Use general token signing secret"' (#2401) from gusted/forgejo-port-gitea-pr into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2401
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-19 21:56:51 +00:00
Gusted 65b9a959b8
[BUG] Restrict when to make link absolute in markdown
- In markdown, links are proccessed to be made absolute against the
relevant base in that context. Such that `./src` will be transformed
into `http://example.com/owner/repo/src/branch/main/src`.
- Don't try to make the link absolute if the link has a schema that's
defined in `[markdown].CUSTOM_URL_SCHEMES`, because they can't be made
absolute and doing so could lead to problems (see test case, double
slash was transformed to single slash).
- Adds unit test.
- Resolves https://codeberg.org/Codeberg/Community/issues/1489
2024-02-19 20:56:00 +01:00
wxiaoguang 62d3e5255f
Port "Use general token signing secret"
Port of https://github.com/go-gitea/gitea/pull/29205

Use a clearly defined "signing secret" for token signing.

(cherry picked from commit 8be198cdef0a486f417663b1fd6878458d7e5d92)
2024-02-19 20:49:37 +01:00
Yarden Shoham 6b1f660db9
Port "Remove jQuery from the repo release form"
Port of https://github.com/go-gitea/gitea/pull/29225. Reworked to not
use global click event listener.

---

- Switched to plain JavaScript
- Tested the repo release form functionality and it works as before
2024-02-19 19:54:22 +01:00
Gusted cfd6420a0e Merge pull request '[REFACTOR] Refactor the AGit code' (#2386) from gusted/fix-agit into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2386
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-19 15:59:10 +00:00
Gusted d8a267d3ab
[FEAT] Restrict file size of blame operation
- Currently there exists a restriction to not render and show files that
are larger than what's configured in `[UI].MAX_DISPLAY_FILE_SIZE`.
- Apply the same restriction to the blame operation as well, as the
blame operation can be seen as displaying a file.
- Add integration test.
- Ref: #2394
2024-02-19 16:39:39 +01:00
Earl Warren 6c9c0aca76 Merge pull request '[gitea] cherry-pick' (#2375) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2375
Reviewed-by: Otto <otto@codeberg.org>
2024-02-19 14:42:41 +00:00
Earl Warren ad79ba6a00 Merge pull request '[RELEASE] copy the release to forgejo-experimental if tests pass' (#2377) from earl-warren/forgejo:wip-test-release into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2377
2024-02-19 14:05:28 +00:00
Gusted 1a0315ad78 Merge pull request '[TRANSLATION] Clarify the description of SSH Keys' (#2393) from gusted/forgjeo-clarify-ssh into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2393
Reviewed-by: Otto <otto@codeberg.org>
2024-02-19 13:35:03 +00:00
Earl Warren 00d175701e
[RELEASE] use 0.0-test instead of forgejo-test
so that it is a valid semver version instead of not
2024-02-19 14:18:26 +01:00
Earl Warren 004b772b5c
[RELEASE] cache node_modules 2024-02-19 14:18:26 +01:00
Earl Warren aef5f44169
[RELEASE] do not limit clone depth when building a release
otherwise git describe may not produce a tag based version number
2024-02-19 14:18:25 +01:00
Earl Warren 102b3738a2
[RELEASE] copy the release to forgejo-experimental if tests pass 2024-02-19 14:18:25 +01:00
Gusted ca60f2f6f7 Merge pull request '[TRANSLATION] Remove unused key' (#2392) from gusted/forgjeo-remove-unused-translation into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2392
Reviewed-by: Otto <otto@codeberg.org>
2024-02-19 12:54:22 +00:00
Gusted 553979aef4
[TRANSLATION] Clarify the description of SSH Keys
- Clarify in the description shown in the "Manage SSH Keys" section,
that verified SSH keys can be used as verification for Git commits that
were signed with SSH keys.
- Resolves #2369
2024-02-19 13:25:48 +01:00
Gusted c58ad87513
[REFACTOR] Refactor the AGit code
TLDR: Less code, better maintainability and more comments.

- Add code comments to explain what the code does, it's quite a big
function so it definitely deserved some of that.
- Simplify some logic.
- Load the `pusher` in a single place.
- Update the error messages to be more correct, not capitlized, include
more debug info and remove 'Error:' As it's no need to indicate that,
errors are concenated with `:` seperators.
- Improve the message that a change was rejected, because a force push
was detected and the `force-push` option wasn't set.
- Avoid a second time loading `gitRepo.GetObjectFormat` and handle the
error gracefully for the other occurence.
- Adds integration test for force push detection.
2024-02-19 13:18:50 +01:00
Gusted bdb573b9d4
[TRANSLATION] Remove unused key
- It was introduced in b78c955958 and the
usage was removed in a01777fd21.
2024-02-19 12:31:15 +01:00
Gusted b604b89108 Merge pull request '[BUG] Fix relative links on orgmode' (#2385) from gusted/forgejo-orgmode-relative-links into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2385
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-19 11:12:11 +00:00
Gusted a2442793d2
[BUG] Fix relative links on orgmode
- For regular non-image nonvideo links, they should be made relative,
this was done against `r.Ctx.Links.Base`, but since 637451a45e, that
should instead be done by `SrcLink()` if there's branch information set
in the context, because branch and treepath information are no longer
set in `r.Ctx.Links.Base`.
- This is consistent with how #2166 _fixed_ relative links.
- Media is not affected, `TestRender_Media` test doesn't fail.
- Adds unit tests.
- Ref https://codeberg.org/Codeberg/Community/issues/1485
2024-02-18 21:09:35 +01:00
Earl Warren 5240e27266 Merge pull request 'GitHub-style alert blocks in Markdown (gitea#29121)' (#2348) from algernon/forgejo:f/markdown/alert-blocks-port into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2348
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-18 11:21:36 +00:00
Yarden Shoham 2685be9f95
Fix labels referencing the wrong ID in the user profile settings (#29199)
2 instances of `for` with a wrong value and 1 `for` that had a reference
to a `name` instead of `id`.

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 1d275c1748a75a01c270f5c306c5248808016aba)
2024-02-17 23:24:32 +01:00
Yarden Shoham f9c931d858
Fix label `for` pointing to a `name` instead of `id` in webhook settings (#29209)
Here's the spec for the `for` attribute:
https://html.spec.whatwg.org/multipage/forms.html#attr-label-for

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 0157db84b13203877c098a258abeb387d59f3486)
2024-02-17 23:24:32 +01:00
Yarden Shoham a46fa02d5b
Fix missing template for follow button in organization (#29215)
Leftover from https://github.com/go-gitea/gitea/pull/29005

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/24c74278-ccac-4dc6-bf26-713e90c07239)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/f91d503b-87d4-4c17-a56c-9c0a81fd9082)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit aa6f88638fb827d5c5ed7506e5fc06dad92beea7)
2024-02-17 23:24:31 +01:00
Yarden Shoham ca852519b5
Remove jQuery from the webhook editor (#29211)
- Switched to plain JavaScript
- Tested the webhook editing functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/b24c264d-d5e5-4954-8789-e72564a99027)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 27192bc321161a4e648547bd7b071065a7b18326)
2024-02-17 23:24:31 +01:00
Yarden Shoham 99080bd87d
Remove jQuery from issue reference context popup attach (#29216)
- Switched to plain JavaScript
- Tested the context popup functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/1d2f173e-e626-4f7d-82c8-d1539d38d247)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit c282d378bd1f2f11ffc884cd6d7c073b7b5745f8)
2024-02-17 23:24:31 +01:00
Robin Schoonover c0ced0f0cd
Fix debian InRelease Acquire-By-Hash newline (#29204)
There is a missing newline when generating the debian apt repo InRelease
file, which results in output like:

```
[...]
Date: Wed, 14 Feb 2024 05:03:01 UTC
Acquire-By-Hash: yesMD5Sum:
 51a518dbddcd569ac3e0cebf330c800a 3018 main-dev/binary-amd64/Packages
[...]
```

It appears this would probably result in apt ignoring the
Acquire-By-Hash setting and not using the by-hash functionality,
although I'm not sure how to confirm it.

(cherry picked from commit 33400a02d4eb35a0656fd6d20fc56801de09b959)
2024-02-17 23:24:31 +01:00
yp05327 fd3b4afa2b
Fix broken following organization (#29005)
- following organization is broken from #28908
- add login check for the follow button in organization profile page

(cherry picked from commit 68227996a7a84a240b36c304d04c5c8d82948df8)
2024-02-17 23:24:31 +01:00
GiteaBot 1ad195aa40
[skip ci] Updated translations via Crowdin
(cherry picked from commit e936d2b338859c527482d1569c92d1f8f97f4d51)
2024-02-17 23:24:31 +01:00
silverwind 59ab49a7eb
Add `eslint-plugin-github` and fix issues (#29201)
This plugin has a few useful rules. The only thing I dislike about it is
that it pulls in a rather big number of dependencies for react-related
rules we don't use, but it can't really be avoided.

Rule docs:
https://github.com/github/eslint-plugin-github?tab=readme-ov-file#rules

(cherry picked from commit 26b17537e651fe93ef9b64f961633cb4c0b8c2c3)
2024-02-17 23:24:31 +01:00
Yarden Shoham 4b69d9e46d
Remove jQuery from the "quick submit" handler (#29200)
- Switched to plain JavaScript
- Tested the quick submit functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/abbd6c49-ad0f-4f95-b4ba-e969b85a46e8)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit d8d4b33b31d959e4b600cc90a7fa1779b69cadf5)
2024-02-17 23:24:31 +01:00
Yarden Shoham 1d4ce531fd
Fix `initCompLabelEdit` not being called (#29198)
Fix broken `if` from https://github.com/go-gitea/gitea/pull/29195

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 2d8756a9607ee6029ad7a44985e9751988d5fdaa)
2024-02-17 23:24:31 +01:00
Yarden Shoham 6a4b83fb9d
Remove jQuery from username change prompt and fix its detection (#29197)
- Switched to plain JavaScript
- Tested the user rename prompt toggling functionality and it works as
before
- Fixed bug that allowed pasting with the mouse to avoid the prompt

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/aa300ad7-612b-461e-bbb2-3f74b3b83ede)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/f2b5a51b-7b39-43c7-8a4a-62f1f77acae4)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 0768842ef56758b3290406656c5ebbd605358f6e)
2024-02-17 23:24:31 +01:00
Yarden Shoham 1bf7b70118
Remove jQuery from organization rename prompt toggle (#29195)
- Switched to plain JavaScript
- Tested the organization rename prompt toggling functionality and it
works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/e6f641b0-aa46-4b85-9693-0d608cca855e)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 5902372e63db2d3f31150251dfffdb305fa9aaee)
2024-02-17 23:24:31 +01:00
Yarden Shoham 2e887067df
Reference labels by IDs instead of names in `keys` settings (#29194)
Here's the spec for the `for` attribute:
https://html.spec.whatwg.org/multipage/forms.html#attr-label-for

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 7132a0ba75d6fe734d9f950f217a5ceb81375328)
2024-02-17 23:24:31 +01:00
Yarden Shoham 2c336646f1
Remove jQuery from SSH key form parser (#29193)
- Switched to plain JavaScript
- Tested the SSH key title functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/4785c13d-8d30-448e-b74a-263935e2769f)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 236e12184404998c8edf7efa6de7fccf9d0ee814)
2024-02-17 23:24:31 +01:00
silverwind f35d468b43
Refactor request function (#29187)
- Remove and prevent use of `body` argument, it is not used anywhere
- Remove uppercasing of method, we can require it to be uppercase

(cherry picked from commit c40ee6fb7382bc2d1398dc685f98a0277d3bfb68)
2024-02-17 23:24:31 +01:00
yp05327 78f6b29248
Fix gitea-action user avatar broken on edited menu (#29190)
Fix #29178

(cherry picked from commit 8e2831611c06e84dd8fedf7a0b2cce9f98d4188f)
2024-02-17 23:24:31 +01:00
silverwind 800fa60ee5
Disable parallel Make execution (#29186)
Ref:
https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html

> If the .NOTPARALLEL special target with no prerequisites is specified
anywhere then the entire instance of make will be run serially,
regardless of the parallel setting

(cherry picked from commit 69ed1a4afbc9604cabe83041de31752dd5d101ee)

Conflicts:
	README.md
2024-02-17 23:24:31 +01:00
Yarden Shoham 4f050f358a
Auto-update the system status in admin dashboard (#29163)
- Refactor the system status list into its own template
- Change the backend to return only the system status if htmx initiated
the request
- `hx-get="{{$.Link}}/system_status`: reuse the backend handler
- `hx-swap="innerHTML"`: replace the `<div>`'s innerHTML (essentially
the new template)
- `hx-trigger="every 5s"`: call every 5 seconds
- `hx-indicator=".divider"`: the `is-loading` class shouldn't be added
to the div during the request, so set it on an element it has no effect
on
- Render "Since Last GC Time" with `<relative-time>`, so we send a
timestamp

# Auto-update in action GIF

![action](https://github.com/go-gitea/gitea/assets/20454870/c6e1f220-f0fb-4460-ac3b-59f315e30e29)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit c70f65e83bc1876fb368fd117d342573ff18a9e8)
2024-02-17 23:24:31 +01:00
silverwind 3adfb6cb72
Avoid vue warning in dev mode (#29188)
`vue` currently outputs a warning for this undefined variable during
development, which is apparently caused by a bug in `vue-cli`.
Workaround by setting this variable.

Ref: https://github.com/vuejs/vue-cli/pull/7443
Ref: https://stackoverflow.com/a/77765007/808699
(cherry picked from commit e9a1ffba2c294f74d985870e9b7b5b07e9000857)
2024-02-17 23:24:31 +01:00
silverwind 6f159f4c1c
Update JS and PY dependencies (#29184)
- Update all excluding `@mcaptcha/vanilla-glue` and
`eslint-plugin-array-func`
- Tested pdf, chart.js, swagger

(cherry picked from commit 8f9c9d3a5fa185f4a61f71e49f15b6d5e611b44a)
2024-02-17 23:24:31 +01:00
GiteaBot b16e26dbeb
[skip ci] Updated translations via Crowdin
(cherry picked from commit 6d4dc16c726dd0be8d0f56405ba396d44dfd04ac)
2024-02-17 23:24:31 +01:00
Şahin Akkaya e9be8b25ae
Implement contributors graph (#27882)
Continuation of https://github.com/go-gitea/gitea/pull/25439. Fixes #847

Before:
<img width="1296" alt="image"
src="https://github.com/go-gitea/gitea/assets/32161460/24571ac8-b254-43c9-b178-97340f0dc8a9">

----
After:
<img width="1296" alt="image"
src="https://github.com/go-gitea/gitea/assets/32161460/c60b2459-9d10-4d42-8d83-d5ef0f45bf94">

---
#### Overview
This is the implementation of a requested feature: Contributors graph
(#847)

It makes Activity page a multi-tab page and adds a new tab called
Contributors. Contributors tab shows the contribution graphs over time
since the repository existed. It also shows per user contribution graphs
for top 100 contributors. Top 100 is calculated based on the selected
contribution type (commits, additions or deletions).

---
#### Demo
(The demo is a bit old but still a good example to show off the main
features)

<video src="https://github.com/go-gitea/gitea/assets/32161460/9f68103f-8145-4cc2-94bc-5546daae7014" controls width="320" height="240">
  <a href="https://github.com/go-gitea/gitea/assets/32161460/9f68103f-8145-4cc2-94bc-5546daae7014">Download</a>
</video>

#### Features:

- Select contribution type (commits, additions or deletions)
- See overall and per user contribution graphs for the selected
contribution type
- Zoom and pan on graphs to see them in detail
- See top 100 contributors based on the selected contribution type and
selected time range
- Go directly to users' profile by clicking their name if they are
registered gitea users
- Cache the results so that when the same repository is visited again
fetching data will be faster

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: hiifong <i@hiif.ong>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 21331be30cb8f6c2d8b9dd99f1061623900632b9)
2024-02-17 23:24:31 +01:00
KN4CK3R 1f8ad34e43
Add support for action artifact serve direct (#29120)
Fixes #29093

(cherry picked from commit 07597c71a4b6642beae7589c678603f4846f7920)
2024-02-17 23:24:31 +01:00
silverwind 7474f62857
Tweak repo header (#29134)
- Tweak colors, remove link color from repo name and make text use
inherited color
- Downsize repo icon from 32px to 24px

Before:
<img width="255" alt="Screenshot 2024-02-11 at 15 31 00"
src="https://github.com/go-gitea/gitea/assets/115237/f65c1d02-d8a3-4171-ad3d-4c95871fb2ba">

After:
<img width="260" alt="Screenshot 2024-02-11 at 15 30 48"
src="https://github.com/go-gitea/gitea/assets/115237/a9b25b56-8d3f-4910-af60-2513d44f6d81">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 363b5f0b595df4c703d80878d2f2a1bafd647291)
2024-02-17 23:24:30 +01:00
Tim-Nicas Oelschläger 7263b3effe
Change webhook-type in create-view (#29114)
It's now possible to change webhook-type in create-view.

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/9ee1b9fb-843b-4f28-b8d6-6361e5d184f1)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/9dbf058f-5912-43af-9acd-487271212f2d)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 374e886f5113a996e1e927a60d1775e77262c364)

Conflicts:
	templates/repo/settings/webhook/base_list.tmpl
	templates/shared/webhook/icon.tmpl
2024-02-17 23:24:30 +01:00
Yarden Shoham c2d4c2fca7
Remove jQuery from the comment task list (#29170)
- Switched to plain JavaScript
- Tested the task list functionality and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 542480a9b0d5cdb497dbfa99752d59fd016df0d6)
2024-02-17 23:24:30 +01:00
yp05327 df439b6a98
Fix can not select team reviewers when reviewers is empty (#29174)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/b29e9c0c-f0fc-454f-b82d-ff9688d9e871)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/a982f7c6-4911-4951-91a5-4bb347e866f9)

Is this a bug? Maybe we don't need to fix this, as it only occurs when
there's only one user in the organization. 🤔

(cherry picked from commit 78c48d8fdde70a2874a7ed42b7762f797f432b03)
2024-02-17 23:24:30 +01:00
Codeberg Translate f4e1a5ae52 [I18N] Translations update from Weblate (#2350)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org>
Co-authored-by: Werenter <abelokopytov149@gmail.com>
Co-authored-by: rohandebsarkar <rohandebsarkar@protonmail.com>
Co-authored-by: Salif Mehmed <mail@salif.eu>
Co-authored-by: ivanhercaz <ivan@corujadigital.tech>
Co-authored-by: Xinayder <me+codeberg@aoalmeida.com>
Co-authored-by: 0ko <0ko@users.noreply.translate.codeberg.org>
Co-authored-by: xtex <xtexchooser@duck.com>
Co-authored-by: mondstern <mondstern@monocles.de>
Co-authored-by: sinsky <sinsky@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: rmorettibr <rafael.moretti@protonmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2350
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-02-17 22:18:04 +00:00
Earl Warren b59f50a58d Merge pull request '[BUG] Fix pull request reopen conditions' (#2373) from gusted/forgejo-reopen-pr into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2373
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-02-17 22:10:18 +00:00
Gergely Nagy cc47808b84
tests: Markdown alert block test cases
This adds a few test cases to exercise the alert block feature of the
markdown renderer, both the legacy GitHub style, and the modern one.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-17 18:35:45 +01:00
Gergely Nagy b594188623
Restore compatibility with the legacy GitHub callout syntax
Although GitHub removed support for the legacy callout syntax, we don't
have to! Restore this support via another AST transformer.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-17 18:35:45 +01:00
Gergely Nagy a177a5c4cb
modules/markup: Lift out the GitHub callout transformer
This lifts out the GitHub callout transformer from
`modules/markup/markdown/goldmark.go` to `callout/github.go`.

While there, clean up the transformer code:

- Use a map to look up supported callout types, rather than a regexp.
- Allow the callout type to be in any case, rather than just uppercase.
- Simplified `.Segment.Value()` to `.Text()`.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-17 18:04:55 +01:00
Yarden Shoham 0b3193bbbe
Add alert blocks in markdown (#29121)
- Follows https://github.com/go-gitea/gitea/pull/21711
- Closes https://github.com/go-gitea/gitea/issues/28316

Implement GitHub's alert blocks markdown feature

Docs:
-
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
- https://github.com/orgs/community/discussions/16925

### Before

![image](https://github.com/go-gitea/gitea/assets/20454870/14f7b02a-5de5-4fd0-8437-a055dadb31f2)

### After

![image](https://github.com/go-gitea/gitea/assets/20454870/ed06a869-e545-42f1-bf25-4ba20b1be196)

## ⚠️ BREAKING ⚠️

The old syntax no longer works

How to migrate:

If you used
```md
> **Note** My note
```

Switch to
```md
> [!NOTE]
> My note
```

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-02-17 18:04:55 +01:00
Earl Warren 2fb3ecc6e3 Merge pull request '[RELEASE] decouple the release name from the version number' (#2372) from earl-warren/forgejo:wip-test-release into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2372
2024-02-17 15:18:44 +00:00
Earl Warren bd2ba9f6e5 Merge pull request '[BUG] Fix Ctrl+Enter on submitting review comment' (#2370) from gusted/forgejo-review-ctrlenter into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2370
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-17 15:15:55 +00:00
Gusted f779aa79f2
[BUG] Fix pull request reopen conditions
- Move the conditions code around, such that the existence of the head
and base is first checked (so a clear error can be given, instead of a
possible server error). This makes it easier to read this code. As the
logic is now grouped together.
- Adds integration testing that simulates the deletion of the base and
head branch and ensures the pull request cannot be opened. The 'normal'
testcase also 'informally' ensures that the previous incorrect condition
is not there, because the branch `base-branch` doesn't exist on the head
repository.
- Resolves #2321
2024-02-17 15:38:16 +01:00
Earl Warren 014e533206
[RELEASE] decouple the release name from the version number
The release name, as provided by FORGEJO_RELEASE, is used to build OCI
images and binary files. Although it can be the same as the Forgejo
version, it is not a requirement.

When the FORGEJO_RELEASE environment variable is set, use it as a
default for naming the binary file instead of FORGEJO_VERSION. For
instance, when building from the forgejo branch here is what is desired:

FORGEJO_VERSION=7.0.0-g2343
GITEA_VERSION=1.22.0
VERSION=vforgejo-test

The name of the release is also displayed with forgejo --version
for sanity check purposes.

Before:

FORGEJO_VERSION is the computed version
GITEA_VERSION is set manually
VERSION defaults to FORGEJO_VERSION
forgejo --help does not display VERSION

After:

FORGEJO_VERSION is the computed version
GITEA_VERSION is set manually
RELEASE_VERSION defaults to FORGEJO_VERSION
VERSION defaults to RELEASE_VERSION
forgejo --help displays VERSION
2024-02-17 15:27:35 +01:00
Gusted 7bf93e5d1a Merge pull request 'A new test to exercise `linguist-language=`' (#2368) from algernon/tests/linguist/view-guess into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2368
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-02-17 13:46:43 +00:00
Gusted f04589defd
[BUG] Fix Ctrl+Enter on submitting review comment
- When a event is caused by `Ctrl+Enter` jQuery might not wrap the event
and in that case `originalEvent` is not defined. Check for this case.
- Log the error along with showing an toast.
- Resolves #2363
2024-02-17 12:52:11 +01:00
Earl Warren fd01298aa6 Merge pull request '[RELEASE] build test releases' (#2365) from earl-warren/forgejo:wip-test-release into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2365
2024-02-17 11:43:16 +00:00
Gusted 0c0b87ec1a Merge pull request 'Add rel="nofollow" to issue filter links' (#2367) from algernon/forgejo:b/issues/nofollow into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2367
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-17 10:56:47 +00:00
Earl Warren 3b9d39f483
[CI] mirror to forgejo-integration daily instead of each commit 2024-02-17 11:55:52 +01:00
Earl Warren 03efa900ea
[RELEASE] build test releases
* forgejo & v*/forgejo branches are mirrored to the forgejo-integration repository on every commit
* re-build a test release every time that happens
  * forogejo => vforgejo-test
  * v1.21/forgejo => v1.21-test
  * v1.22/forgejo => v1.22-test
  * etc.
2024-02-17 11:52:50 +01:00
Earl Warren 7ea1ef2c2b Merge pull request '[gitea] cherry-pick' (#2353) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2353
Reviewed-by: Otto <otto@codeberg.org>
2024-02-17 10:49:47 +00:00
Gergely Nagy ae95db12a1
A new test to exercise `linguist-language=`
Rename `repo_lang_stats_test.go` to `linguist_test.go`, and add a new
tests that exercises parts of the web UI to ensure that language
overrides in `.gitattributes` work when viewing a file source, and in
the blame view too.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-17 11:24:16 +01:00
Gergely Nagy 5143ebb507
Add rel="nofollow" to issue filter links
The issue filter links should not be crawled by search engines, because
they they only filter results, and contain nothing new, yet, they put a
considerable load on the server.

To stop - well behaving - search engines from following these links, add
a `rel="nofollow"` property to them. The same property is already
present on the archive download links, and plenty of other places.

Fixes #2361.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-17 10:42:47 +01:00
Gusted 28b5e39776 Merge pull request 'Add Zig gitignore' (#2352) from argrat/forgejo:zig-gitignore into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2352
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-02-16 21:32:38 +00:00
Earl Warren c021a5b919
templates: HasPrefix support for template.HTML
Refactor locale&string&template related code has .Title be
template.HTML and "Improve HTML title on repositories" needs to check
the prefix with StringUtils.HasPrefix
2024-02-16 15:20:52 +01:00
Rafael Heard 4af0944b26
move sign in labels to be above inputs (#28753)
There are a few inconsistencies within Gitea and this PR addresses one of them.
This PR updates the sign-in page layout, including the register and openID tabs,
to match the layout of the settings pages (`/user/settings`) for more consistency.

**Before**
<img width="968" alt="Screenshot 2024-02-05 at 8 27 24 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/fb0cb517-57c0-4eed-be1d-56f36bd1960d">

**After**
<img width="968" alt="Screenshot 2024-02-05 at 8 26 39 AM"
src="https://github.com/go-gitea/gitea/assets/6152817/428d691d-0a42-4a67-a646-05527f2a7b41">

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
(cherry picked from commit 1c14cd0c43d670fef984068e2666641ea5a062db)
2024-02-16 15:20:52 +01:00
wxiaoguang 65248945c9
Refactor locale&string&template related code (#29165)
Clarify when "string" should be used (and be escaped), and when
"template.HTML" should be used (no need to escape)

And help PRs like  #29059 , to render the error messages correctly.

(cherry picked from commit f3eb835886031df7a562abc123c3f6011c81eca8)

Conflicts:
	modules/web/middleware/binding.go
	routers/web/feed/convert.go
	tests/integration/branches_test.go
	tests/integration/repo_branch_test.go
	trivial context conflicts
2024-02-16 15:20:52 +01:00
KN4CK3R d565d85160
Extract linguist code to method (#29168)
(cherry picked from commit 94d06be035bac468129903c9f32e785baf3c1c3b)
2024-02-16 15:20:52 +01:00
KN4CK3R 52ef33b931
Remove unused `KeyID`. (#29167)
`KeyID` is never set.

(cherry picked from commit 155269fa586c41a268530c3bb56349e68e6761d7)

Conflicts:
	models/user/email_address.go
	trivial context conflict
2024-02-16 15:20:52 +01:00
KN4CK3R 6eaabb1a9d
Use ghost user if user was not found (#29161)
Fixes #29159

(cherry picked from commit 37061e8266806c0b2b66ac64138e725632b295db)
2024-02-16 15:20:52 +01:00
Yarden Shoham e52d877582
Fix Gitpod logic of setting ROOT_URL (#29162)
(cherry picked from commit 4f346916838fcc95c6d7eb574145c8b78f7ac726)
2024-02-16 15:20:52 +01:00
oliverpool 0fc61c8836 [BUG] split code conversations in diff tab (#2306)
Follow-up of #2282 and #2296 (which tried to address #2278)

One of the issue with the previous PR is that when a conversation on the Files tab was marked as "resolved", it would fetch all the comments for that line (even the outdated ones, which should not be shown on this page - except when explicitly activated).

To properly fix this, I have changed `FetchCodeCommentsByLine` to `FetchCodeConversation`. Its role is to fetch all comments related to a given (review, path, line) and reverted my changes in the template (which were based on a misunderstanding).

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2306
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2024-02-16 12:16:11 +00:00
Gusted 1e364cc21f Merge pull request 'Preview: set font-size on preview content' (#2349) from gusted/forgejo-preview-fontsize into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2349
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-15 16:14:37 +00:00
Earl Warren e3f1e85244 Merge pull request '[CI] upgrade to golangci-lint@v1.56.1' (#2354) from earl-warren/forgejo:wip-lint-upgrade into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2354
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-15 15:49:35 +00:00
Earl Warren c8b177713a
[CLEANUP] make golangci-lint@v1.56.1 happy 2024-02-15 16:19:36 +01:00
Earl Warren 79df409256
[CI] upgrade to golangci-lint@v1.56.1 2024-02-15 16:19:28 +01:00
Argo 761641cf4a Add Zig gitignore 2024-02-15 11:19:08 +00:00
Gusted b1aabbf174
Preview: set font-size on preview content
- When previewing the content in a review, no font size was set. This
resulted in the previewed content being bigger than other text and
therefor creating an noticable inconsistency.
- Set the font size of the previewed content, 14px, this is consistent
with how the content would be rendered.
- `comment-code-cloud` is the class used for the review boxes.
`.ui.tab.markup` means it only applies to the preview tab.
2024-02-14 23:02:40 +01:00
Earl Warren 56f161167a Merge pull request '[gitea] cherry-pick' (#2337) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2337
Reviewed-by: Otto <otto@codeberg.org>
2024-02-14 21:29:08 +00:00
Earl Warren 41cc9784f9 Merge pull request 'agit: Automatically fill in the description' (#2344) from algernon/f/agit/description-autofill into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2344
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-02-14 20:46:00 +00:00
6543 e9e6c6152e
Dont load Review if Comment is CommentTypeReviewRequest (#28551)
RequestReview get deleted on review.
So we don't have to try to load them on comments.

broken out #28544

(cherry picked from commit 6fad2c874438275d3f69bb1cc223708bd2d27ff6)
2024-02-14 21:44:25 +01:00
Tim-Nicas Oelschläger 27bc2b9d95
Show `View at this point in history` for every commit (#29122)
Shows the 'View at this point in history'-link (from #27354) for every
commit

before:

![image](https://github.com/go-gitea/gitea/assets/72873130/0e5cd763-e099-4bb4-9519-653fe21f85a6)

after:

![image](https://github.com/go-gitea/gitea/assets/72873130/2b57346f-51e3-4901-b85e-63a690878939)

(cherry picked from commit b85e4a64fa26e1f20321c3a7cedf9fa05640ca48)
2024-02-14 21:44:24 +01:00
GiteaBot 1662f50464
[skip ci] Updated translations via Crowdin
(cherry picked from commit 33d939096d93a1014d4961374939376260740cbc)
2024-02-14 21:44:24 +01:00
GiteaBot 9a6709869e
[skip ci] Updated translations via Crowdin
(cherry picked from commit d75708736a2189e7fdbed60444e3bbeef1c5270a)
2024-02-14 21:44:24 +01:00
Tim-Nicas Oelschläger b03af9efb2
Show more settings for empty repositories (#29130)
Shows more settings for empty repositories (Fixes #29060)

(cherry picked from commit 28db539d9c0fa0b7c9411724d8b4bf6f371651a0)
2024-02-14 21:44:24 +01:00
silverwind f7491db1c0
Update JS and PY dependencies (#29127)
- Update all excluding `@mcaptcha/vanilla-glue` and
`eslint-plugin-array-func`
- Remove deprecated and duplicate eslint rule
- Tested Monaco, Mermaid and Swagger

(cherry picked from commit 4fe37124e9ad5395b734662a7e8ab7b0025c38a3)
2024-02-14 21:44:24 +01:00
Gergely Nagy 259ad5d614
agit: Automatically fill in the description
If no `-o description=` is provided, fill it in automatically from the
first commit, just like title. Also allow filling in either, and
specifying them independently.

This means that `git push origin HEAD:refs/for/main/my-local-branch`
will fill in the PR title, *and* the description, without having to
specify additional parameters.

The description is the first commit's message without the first two
lines (the title and a newline, as customary).

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-14 21:17:55 +01:00
Earl Warren 231548ba7e Merge pull request 'Add merge style `fast-forward-only` (gitea#28954)' (#2347) from algernon/forgejo:f/repo/merge/fast-forward-only-port into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2347
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-14 19:58:54 +00:00
Gergely Nagy a3a7af5a2b
Update .deadcode-out
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-14 17:31:06 +01:00
Chris Copeland 83123b493f
Add merge style `fast-forward-only` (#28954)
With this option, it is possible to require a linear commit history with
the following benefits over the next best option `Rebase+fast-forward`:
The original commits continue existing, with the original signatures
continuing to stay valid instead of being rewritten, there is no merge
commit, and reverting commits becomes easier.

Closes #24906
2024-02-14 17:19:19 +01:00
Earl Warren 05eaf1cf3e Merge pull request 'Repository settings refactor' (#2221) from algernon/forgejo:repo-units/ui-refactor into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2221
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-02-14 13:29:04 +00:00
Codeberg Translate 6c3895638c [I18N] Translations update from Weblate (#2322)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: mondstern <mondstern@monocles.de>
Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: Kaede Fujisaki <psi@7io.org>
Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org>
Co-authored-by: noureddin <noureddin@protonmail.com>
Co-authored-by: yeziruo <i@yeziruo.com>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: nykula <nykula@ukr.net>
Co-authored-by: Werenter <abelokopytov149@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2322
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-02-14 11:01:06 +00:00
Gusted 2cf242344e Merge pull request 'Minor cleanup in ViewLatestWorkflowRun' (#2343) from algernon/b/actions/view-latest-run-for-workflow/ctx.ServerError into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2343
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-14 09:02:30 +00:00
Gergely Nagy 8075721823
Minor cleanup in ViewLatestWorkflowRun
Use `ctx.ServerError` instead of a separate `log.Error` + `ctx.Error`.
`ctx.ServerError` does essentially the same thing, but better.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-13 23:20:16 +01:00
Gergely Nagy 44424bfe60
Add tests for the previous two commits
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-13 22:42:09 +01:00
Gergely Nagy e07b0e75ff
Add a direct link from repo header to unit settings
If a repository administrator is viewing a repository, and there are
units that can be enabled, display an "Add more..." link that leads to
the repository unit settings page.

The goal here is to allow instances to configure a small set of repo
units to be enabled by default, but also highlight for repo admins that
they can add more.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-13 22:42:09 +01:00
Gergely Nagy fa73375e13
Split out repository unit settings
This splits out the repository unit settings (formerly "Advanced
settings" under the repository settings page) into their own, separate
page.

The primary reason for this is that the settings page became long and
complicated, with a structure that not always made sense. A secondary
reason is that toggling units on and off should not necessarily be an
"advanced" setting. We want to make doing that easier, and having the
units on their own page helps with that.

This is basically a refactor, there is no new functionality introduced,
just an extra pair of routes for the new page, and the supporting code.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-13 22:42:09 +01:00
Gusted 2d321d27d1 Merge pull request '[BUG] Workaround borked Git version' (#2335) from gusted/forgejo-git-workaround into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2335
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
2024-02-13 20:05:06 +00:00
Gusted f68f880974
[BUG] Workaround borked Git version
- In Git version v2.43.1, the behavior of `GIT_FLUSH` was accidentially
flipped. This causes Forgejo to hang on the `check-attr` command,
because no output was being flushed.
- Workaround this by detecting if Git v2.43.1 is used and set
`GIT_FLUSH=0` thus getting the correct behavior.
- Ref: https://lore.kernel.org/git/CABn0oJvg3M_kBW-u=j3QhKnO=6QOzk-YFTgonYw_UvFS1NTX4g@mail.gmail.com/
- Resolves #2333.
2024-02-13 18:33:18 +01:00
Gusted 91d40751c7 Merge pull request '[FEAT] Don't log context cancelled SQL errors (squash)' (#2330) from gusted/forgejo-no-db into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2330
Reviewed-by: Otto <otto@codeberg.org>
2024-02-13 07:35:25 +00:00
Gusted cbbcfdd400
[FEAT] Don't log context cancelled SQL errors
- I found this while doing some unrelated testing in Forgejo. It wasn't
my intention to log failed SQL queries if they were cancelled (which can
happen quite frequently for larger instances) as in those cases it's not
interesting to know which SQL query was run. My intentation was only to
log an SQL query if there was an error reported by the database.
- Ref #2140
2024-02-12 23:11:50 +01:00
Earl Warren c6a89b490d Merge pull request '[gitea] cherry-pick' (#2324) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2324
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-12 13:39:28 +00:00
Earl Warren 98e7753ade Merge pull request '[FEAT]: Allow forking without a repo ID' (#2310) from algernon/forgejo:f/repo/fork-route into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2310
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-12 13:36:49 +00:00
Earl Warren ba5f9f7bb4 Merge pull request '[RELEASE] Gitea version is for interoperability only' (#2327) from earl-warren/forgejo:wip-version into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2327
Reviewed-by: Otto <otto@codeberg.org>
2024-02-11 21:44:31 +00:00
Alexandre Oliveira 29007c09bd Fix Alpine Registry packages with noarch not being found (#2285)
Fixes #2173
~~Still requires a bit of work to do, I'm not 100% happy with this solution.~~

The idea is to copy the noarch package to the architectures available in the package repository.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2285
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Alexandre Oliveira <me+codeberg@aoalmeida.com>
Co-committed-by: Alexandre Oliveira <me+codeberg@aoalmeida.com>
2024-02-11 18:02:56 +00:00
Earl Warren db3b867b02
[RELEASE] Gitea version is for interoperability only
Forgejo now has its own lifecycle and its version is derived from the
tag. The Gitea tags are no longer found in the Forgejo codebase and
can no longer be used for that purpose.

When a Forgejo release is published, for interoperability with the
existing tools in the ecosystem, it advertises the supported Gitea
version via /api/v1/version. It is set in the Makefile manually and
cannot be automatically set.

https://codeberg.org/forgejo-contrib/delightful-forgejo#packaging

Existing Forgejo packages rely on the Makefile to build and the change
must be done in a way that tries to not break their assumptions. From
the point of view of a Forgejo package build, the following will
happen on the next major release:

- The package version will bump from v1.21.x to v7.0.0
- /api/v1/version will bump from v1.21.x to v1.22.0
- /api/forgejo/v1/version will bump from v6.x to v7.0.0

The Makefile uses the following variables:

GITEA_VERSION is returned by /api/v1/version
FORGEJO_VERSION is returned by /api/forgejo/v1/version
VERSION is used in the name the binary file and the source archive

Before:

GITEA_VERSION is the computed version
FORGEJO_VERSION is set manually
VERSION defaults to GITEA_VERSION

After:

FORGEJO_VERSION is the computed version
GITEA_VERSION is set manually
VERSION defaults to FORGEJO_VERSION

When the version is computed, it comes from:

- The content of the VERSION file if it exists. It is inserted in
  the source archive because it does not contain a git repository
- Otherwise the output of `git describe`
2024-02-11 15:36:58 +01:00
Earl Warren 7b4dba3aa0 [ACTIONS] skip superflous pull request synchronized event (#2314)
Skip a HookEventPullRequestSync event if it has the same CommitSHA as an existing HookEventPullRequest event in the ActionRun table. A HookEventPullRequestSync event must only create an ActionRun if the CommitSHA is different from what it was when the PR was open.

This guards against a race that can happen when the following is done in parallel:

* A commit C is pushed to a repo on branch B
* A pull request with head on branch B

it is then possible that the pull request is created first, successfully. The commit that was just pushed is not known yet but the PR only references the repository and the B branch so it is fine.

A HookEventPullRequest event is sent to the notification queue but not processed immediately.

The commit C is pushed and processed successfully. Since the PR already exists and has a head that matches the branch, the head of the PR is updated with the commit C and a HookEventPullRequestSync event is sent to the notification queue.

The HookEventPullRequest event is processed and since the head of the PR was updated to be commit C, an ActionRun with CommitSHA C is created.

The HookEventPullRequestSync event is then processed and also has a CommitSHA equal to C.

Refs: https://codeberg.org/forgejo/forgejo/issues/2009
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2314
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2024-02-11 13:06:54 +00:00
silverwind 9c4e0c26f9
[gitea] Remove obsolete border-radius on comment content (#29128)
This border-radius is obsolete since we changed the comment rendering a
few months ago and it caused incorrect display on blockquotes.

Before:
<img width="160" alt="Screenshot 2024-02-10 at 18 42 48"
src="https://github.com/go-gitea/gitea/assets/115237/ccbf4660-acf9-4268-aad9-1ad49d317a67">

After:
<img width="135" alt="Screenshot 2024-02-10 at 18 42 40"
src="https://github.com/go-gitea/gitea/assets/115237/6f588e02-3b2a-49ee-b459-81d8068b2f4e">

(cherry picked from commit 9063fa096386362f9ae602fdf8a39ae8c972b8e0)
2024-02-11 13:47:48 +01:00
Yarden Shoham 7c9387a242
[gitea] Make blockquote border size less aggressive (#29124)
It's too thick

I made it match GitHub's size

![image](https://github.com/go-gitea/gitea/assets/20454870/08c05004-acd9-485e-9219-110d93fe1226)

![image](https://github.com/go-gitea/gitea/assets/20454870/e2e32b6c-4ba8-488e-9405-95d33f80adf7)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 5f5b5ba6e3e50ba5385e6cbf5957d4b73805769b)
2024-02-11 13:47:46 +01:00
Gwyneth Morgan 9a1d5c549c
[gitea] Drop "@" from email sender to avoid spam filters (#29109)
Commit 360b3fd17c (Include username in email headers (#28981),
2024-02-03) adds usernames to the From field of notification emails in
the form of `Display Name (@username)`, to prevent spoofing. However,
some email filtering software flags "@" in the display name part of the
From field as potential spoofing, as you could set the display name part
to another email address than the one you are sending from (e.g.
`From: "apparent@email-address" <actual@email-address>`). To avoid
being flagged, instead send emails from `Display Name (username)`.

Closes: #29107

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 5b2fd0fc19a2a77414c8e2989b4794b6617221f5)
2024-02-11 13:47:44 +01:00
GiteaBot 22fd29d3b7
[gitea] [skip ci] Updated translations via Crowdin
(cherry picked from commit c1f7249056d4aa38927aebcbddc6459ee714c801)
2024-02-11 13:47:36 +01:00
Earl Warren 40b9f3996b Merge pull request '[FEAT]: New route to view latest run of specific workflows' (#2304) from algernon/forgejo:f/web/actions/workflow-latest-run-routes into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2304
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-11 07:34:08 +00:00
Earl Warren 91f2f02f09 Merge pull request '[gitea] cherry-pick' (#2320) from earl-warren/forgejo:wip-gitea-cherry-pick into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2320
2024-02-10 10:37:00 +00:00
silverwind 22c694a9e9
[gitea] add lint-spell-fix to lint-fix (#29111)
Followup to https://github.com/go-gitea/gitea/pull/29106, fix this
oversight.

(cherry picked from commit c7a21cbb0c5f8302495fa24baf218dc3462de2c5)
2024-02-10 10:53:43 +01:00
silverwind 6fcb8e652b
[gitea] Rework spellchecking, add `lint-spell` (#29106)
- Use maintained fork https://github.com/golangci/misspell
- Rename `mispell-check` to `lint-spell`, add `lint-spell-fix`
- Run `lint-spell` in separate actions step
- Lint more files, fix discovered issues
- Remove inaccurate and outdated info in docs (we do not need GOPATH for
tools anymore)

Maybe later we can add more spellchecking tools, but I have not found
any good ones yet.

(cherry picked from commit 9c39f8515fa88d644736c6773d7a05d070a02e82)

Conflicts:
	.github/workflows/pull-compliance.yml
	Makefile
2024-02-10 10:53:43 +01:00
wxiaoguang 83bb3cf86a
[gitea] Refactor parseSignatureFromCommitLine (#29054)
Replace #28849. Thanks to @yp05327 for the looking into the problem.
Fix #28840

The old behavior of newSignatureFromCommitline is not right. The new
parseSignatureFromCommitLine:

1. never fails
2. only accept one format (if there is any other, it could be easily added)

And add some tests.

(cherry picked from commit a24e1da7e9e38fc5f5c84c083d122c0cc3da4b74)
2024-02-10 10:53:43 +01:00
KN4CK3R 045bd097c6
[gitea] Display friendly error message (#29105)
`ctx.Error` only displays the text but `ctx.ServerError` renders the
usual error page.

(cherry picked from commit da2f03750f9672c5aac48209539874f2af2673f1)
2024-02-10 10:53:43 +01:00
silverwind 0d62b52f4f
[gitea] Use defaults browserslist (#29098)
IE usage has dropped enough to not be included in the defaults
browserslist anymore as per https://browsersl.ist/#q=defaults, so we can
use the defaults now.

(cherry picked from commit ce9978bfd4e035ed065b02b28e02905674320b6a)
2024-02-10 10:53:43 +01:00
Lunny Xiao b9f48332c7
[gitea] Fix push to create with capitalize repo name (#29090)
Fix #29073

(cherry picked from commit 96ad1d6340038c0c841d9cad9a440daee3241aac)
2024-02-10 10:53:43 +01:00
Lunny Xiao 1fdd8341d6
[gitea] Remove unnecessary parameter (#29092)
The parameter extraConfigs has never been used anywhere. This PR just
removed it. It can be taken back once it's needed.

(cherry picked from commit 8c6ffdac378654f9d2171ebdbc46becf1571f7fe)
2024-02-10 10:53:43 +01:00
silverwind 02b03247de
[gitea] Move vitest setup file to root (#29097)
I'm using this convention in other projects and I think it makes sense
for gitea too because the vitest setup file is loaded globally for all
tests, not just ones in web_src, so it makes sense to be in the root.

(cherry picked from commit 98e7e3a5f07b8bc620e26bc1ab6f7a86bccbb7cb)
2024-02-10 10:53:43 +01:00
CEnnis91 4b1b774ccd
[gitea] Fix incorrect link to swift doc and swift package-registry login command (#29096)
Fixes a few mistakes in the Swift package registry documentation.

Syntax for the `package-registry login` command can be found
[here](https://github.com/apple/swift-package-manager/blob/main/Documentation/PackageRegistry/PackageRegistryUsage.md#registry-authentication).
I was not sure the best way to compress all of that information, so I
just focused on making sure the incorrect `package-registry set` command
was fixed.

(cherry picked from commit eb5ddc0a78ecfe007a6e279a3c59711cdfb3f701)
2024-02-10 10:53:43 +01:00
CEnnis91 e87ab053e7
[gitea] Fix swift packages not resolving (#29095)
Fixes #29094

(cherry picked from commit 6be3fda6fc746b1285e6dee72de1118177ba429e)
2024-02-10 10:53:43 +01:00
Wiktor Kwapisiewicz 34450f7d35
[gitea] Fix missing link on outgoing new release notifications (#29079)
Outgoing new release e-mail notifications were missing links to the
actual release. An example from Codeberg.org e-mail:

    <a href=3D"">View it on Codeberg.org</a>.<br/>

This PR adds `"Link"` context property pointing to the release on the
web interface.

The change was tested using `[mailer] PROTOCOL=dummy`.

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
(cherry picked from commit 37191dcfbdbd007266a4d15a3c85cdf94cec1a7a)
2024-02-10 10:53:43 +01:00
wxiaoguang 51c6103195
[gitea] Avoid showing unnecessary JS errors when there are elements with different origin on the page (#29081)
Try to fix #29080

(cherry picked from commit f290c24d286b996ac6b512f49a30aa5aef1a2dbe)
2024-02-10 10:53:43 +01:00
silverwind 73e32eae5b
[gitea] Fix gitea-origin-url with default ports (#29085)
When setting `url.host` on a URL object with no port specified (like is
the case of default port), the resulting URL's port will not change.
Workaround this quirk in the URL standard by explicitely setting port
for the http and https protocols.

Extracted the logic to a function for the purpose of testing. Initially
I wanted to have the function in utils.js, but it turns out esbuild can
not treeshake the unused functions which would result in the
webcomponents chunk having all 2kB utils.js inlined, so it seemed not
worth.

Fixes: https://github.com/go-gitea/gitea/issues/29084
(cherry picked from commit b6bf8041d8e8ee845728687b1f358f1d482afff2)
2024-02-10 10:53:43 +01:00
dark-angel 00370f17a4
[gitea] fix: Elasticsearch: Request Entity Too Large #28117 (#29062)
Fix for gitea putting everything into one request without batching and
sending it to Elasticsearch for indexing as issued in #28117

This issue occured in large repositories while Gitea tries to
index the code using ElasticSearch.

I've applied necessary changes that takes batch length from below config
(app.ini)
```
[queue.code_indexer]
BATCH_LENGTH=<length_int>
```
and batches all requests to Elasticsearch in chunks as configured in the
above config

(cherry picked from commit 5c0fc9087211f01375f208d679a1e6de0685320c)
2024-02-10 10:53:43 +01:00
silverwind 75937b5784
[gitea] Remove lightningcss (#29070)
Remove lightningcss and minify with esbuild again. The size of output
CSS will increase by around 1.4%, but I think it's worth it to allow
building gitea in more cases like the one in the linked issue. We can
reconsider once lightningcss becomes more stable.

Fixes: https://github.com/go-gitea/gitea/issues/29058
(cherry picked from commit 5849d4fde347cd1e47f2243b3239724c73b1261d)
2024-02-10 10:53:43 +01:00
Jason Song a01777fd21
[gitea] Hide code links on release page if user cannot read code (#29064)
On the release list page, if the user doesn't have the permission to
read code, the code links will lead to 404 pages or api errors:

<img width="1297" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/a74fbc63-6dd6-43c6-853c-28acdbfdcb4e">

After this PR:

<img width="1297" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/a626373d-c2df-40a9-8fed-1b12ff6bc56f">

And this PR also removed some dead code. After #23465, the tag list page
has an independent template, and all `IsTag` in the release list
template are always false.

(cherry picked from commit f9072dbf3c558ba5d4365b551d95936a52e4c94d)
2024-02-10 10:53:42 +01:00
GiteaBot 7c1bb0626b
[gitea] [skip ci] Updated translations via Crowdin
(cherry picked from commit f69914dd0b5607861f36f89c362f4b2cc3f60403)
2024-02-10 10:53:42 +01:00
Earl Warren a4ca473d33
[CI] cascade end-to-end must not try to merge feature branches
they no longer exist as of the hard fork
2024-02-10 10:53:04 +01:00
Gergely Nagy 5f2d8be38e
[FEAT]: New route to view lates run of specific workflows
This adds a new route at `/actions/workflows/{workflow}/runs/latest`,
which will redirect to the latest run of the given workflow. It can be
further restricted by specifying an optional `?branch={branch}` query
parameter. If no branch is specified, the route defaults to using the
repo's default branch.

This route is meant to go hand in hand with the Badge route that returns
the result of the same workflow as a badge. This route can be used to
link to the run that produced that result.

Fixes #2303.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-10 09:15:58 +01:00
Gergely Nagy f8da672307
[FEAT]: Allow forking without a repo ID
Forking a repository via the web UI currently requires visiting a
`/repo/fork/{{repoid}}` URL. This makes it cumbersome to create a link
that starts a fork, because the repository ID is only available via the
API. While it *is* possible to create a link, doing so requires extra
steps.

To make it easier to have a "Fork me!"-style links, introduce the
`/{username}/{repo}/fork` route, which will start the forking process
based on the repository in context instead.

The old `/repo/fork/{repoid}` route (with a `GET` request) will remain
there for the sake of backwards compatibility, but will redirect to the
new URL instead. It's `POST` handler is removed.

Tests that used the old route are updated to use the new one, and new
tests are introduced to exercise the redirect.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-10 09:14:14 +01:00
Earl Warren cf1c57b681 Merge pull request 'Forgejo hard fork' (#2319) from earl-warren/forgejo:wip-forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2319
2024-02-10 06:33:59 +00:00
Earl Warren beff445741
Merge remote-tracking branch 'forgejo/forgejo-development' into wip-forgejo 2024-02-09 23:22:12 +01:00
Earl Warren 1c183c8031 Merge pull request '[TESTS] add manual testing instructions as a sub-module' (#2265) from earl-warren/forgejo:wip-manual-testing into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2265
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-02-09 22:21:25 +00:00
Earl Warren 7cbf05fafb
Merge remote-tracking branch 'forgejo/forgejo-dependency' into wip-forgejo
Conflicts:
	.forgejo/workflows/testing.yml
	trivial conflict
2024-02-09 19:00:54 +01:00
Earl Warren 36fc9a9f72
Merge remote-tracking branch 'forgejo/forgejo-branding' into wip-forgejo 2024-02-09 18:59:07 +01:00
Earl Warren 16794897bc
Merge remote-tracking branch 'forgejo/forgejo-development' into wip-forgejo 2024-02-09 18:58:05 +01:00
Codeberg Translate 3c31c92efb [I18N] Translations update from Weblate (#2317)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2317
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-02-09 14:53:38 +00:00
Earl Warren 12e289f6f9 Merge pull request 'CI: merge checks-backend and lint-backend' (#2315) from oliverpool/forgejo:ci_merge_steps into forgejo-dependency
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2315
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-09 14:17:35 +00:00
Codeberg Translate e71cdd05d8 [I18N] Translations update from Weblate (#2316)
Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Mormegil <mormegil@centrum.cz>
Co-authored-by: nightm4re <matthiasf.wilke@yahoo.de>
Co-authored-by: fnetX <otto@codeberg.org>
Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org>
Co-authored-by: kikocorreoso <kachine@protonmail.com>
Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: bart <bart@bartmathijssen.com>
Co-authored-by: tranzystorekk <tranzystorek.io@protonmail.com>
Co-authored-by: Xinayder <me+codeberg@aoalmeida.com>
Co-authored-by: rmorettibr <rafael.moretti@protonmail.com>
Co-authored-by: Werenter <abelokopytov149@gmail.com>
Co-authored-by: dobrvlskyi <dobrovolskyi@peremozhemo.org>
Co-authored-by: ika <ika@thewizardbay.cc>
Co-authored-by: noureddin <noureddin@protonmail.com>
Co-authored-by: esensar <dev@ensarsarajcic.com>
Co-authored-by: mondstern <mondstern@monocles.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2316
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
2024-02-09 12:43:51 +00:00
oliverpool ffc94d9463 remove debug print 2024-02-09 11:27:58 +01:00
oliverpool cab17d7a72 DEBUG: -j 2024-02-09 11:20:15 +01:00
oliverpool 01539730c0 CI: merge checks-backend and lint-backend 2024-02-09 11:08:19 +01:00
Earl Warren da12d2001c Merge pull request '[I18N] Translations update from Weblate' (#2305) from translate/forgejo:weblate-forgejo-forgejo into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2305
2024-02-09 08:30:00 +00:00
Earl Warren 95188d497d
[CI] pin go 1.21 2024-02-08 12:39:38 +01:00
Earl Warren a058770914
[TESTS] add manual testing instructions as a sub-module
Refs: https://codeberg.org/forgejo/discussions/issues/100
2024-02-08 11:43:43 +01:00
Earl Warren f7ca64d028 Merge pull request '[FEAT] support `.forgejo` dir for issue and PR templates' (#2290) from algernon/forgejo:pr/template-dirs into forgejo-dependency
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2290
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-08 10:42:23 +00:00
mondstern 4d62c5df14
Added translation using Weblate (Slovenian) 2024-02-07 19:04:37 +00:00
esensar 06842cb536
Added translation using Weblate (Bosnian) 2024-02-07 13:12:38 +00:00
Earl Warren 859020409e
[CI] pin go 1.21 2024-02-07 12:54:05 +01:00
Earl Warren b33877db5a
[CI] pin go 1.21 2024-02-07 12:53:39 +01:00
Earl Warren 548224ff47 Merge pull request '[CI] pin go 1.21' (#2311) from earl-warren/forgejo:wip-go into forgejo-dependency
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2311
2024-02-07 11:52:11 +00:00
Earl Warren a89cb638a0
[CI] pin go 1.21 2024-02-07 12:19:56 +01:00
Earl Warren ea7344e39f Merge pull request 'Improve English locale' (#2307) from 0ko/forgejo:english240206 into forgejo-development
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2307
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-02-06 20:57:00 +00:00
0ko 09e271497b Improve English locale 2024-02-06 23:45:48 +05:00
oatbiscuits e677192f5b
Translated using Weblate (Arabic)
Currently translated at 44.1% (1516 of 3437 strings)

Translation: Forgejo/forgejo
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ar/
2024-02-06 15:48:02 +00:00
0que 50c101c5f1
Translated using Weblate (Russian)
Currently translated at 98.2% (3378 of 3437 strings)

Translation: Forgejo/forgejo
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ru/
2024-02-06 15:48:02 +00:00
Werenter 54536cfc9a
Translated using Weblate (Russian)
Currently translated at 98.2% (3378 of 3437 strings)

Translation: Forgejo/forgejo
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/ru/
2024-02-06 15:48:02 +00:00
earl-warren d8cfdd2a44
Translated using Weblate (French)
Currently translated at 99.0% (3404 of 3437 strings)

Translation: Forgejo/forgejo
Translate-URL: https://translate.codeberg.org/projects/forgejo/forgejo/fr/
2024-02-06 15:48:01 +00:00
Gergely Nagy 1624ebc836
[TESTS] issue & PR templates in `.forgejo` are recognized
This adds a few tests for the previous change, to verify that issue
template configs, issue templates and pr templates are all recognized in
`.forgejo` directories.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-06 10:22:32 +01:00
Caesar Schinas 271db6ff22
[FEAT] support `.forgejo` dir for issue and PR templates 2024-02-06 10:22:32 +01:00
Gusted 599264717f Merge pull request 'Fix `/api/v1/{owner}/{repo}/issue_templates`' (#2292) from algernon/forgejo:b/api/issue_templates-fix into forgejo-dependency
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2292
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: crystal <crystal@noreply.codeberg.org>
2024-02-06 09:17:08 +00:00
Gergely Nagy be8d16438a
Fix `/api/v1/{owner}/{repo}/issue_templates`
When issue templates were moved into services in
def4956122, the code was also refactored
and simplified. Unfortunately, that simplification broke the
`/api/v1/{owner}/{repo}/issue_templates` route, because it was
previously using a helper function that ignored invalid templates, and
after the refactor, the function it called *always* returned non-nil as
the second return value. This, in turn, results in the aforementioned
end point always returning an internal server error.

This change restores the previous behaviour of ignoring invalid files
returned by `issue.GetTemplatesFromDefaultBranch`, and adds a few test
cases to exercise the endpoint.

Other users of `GetTemplatesFromDefaultBranch` already ignore the second
return value, or handle it correctly, so no changes are necessary there.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-02-05 20:58:41 +01:00
Earl Warren 094c84ed6d
Merge branch 'rebase-forgejo-dependency' into wip-forgejo 2024-02-05 18:58:23 +01:00
Earl Warren d7e1854884
Merge branch 'rebase-forgejo-branding' into wip-forgejo 2024-02-05 18:58:18 +01:00
Earl Warren c6fe41239a
Merge branch 'rebase-forgejo-moderation' into wip-forgejo 2024-02-05 18:58:11 +01:00
Earl Warren ee5a3a6401
[MODERATION] User blocking (squash) RemoveUsernameParameterSuffix 2024-02-05 17:06:02 +01:00
Earl Warren 030cdd6ae2
[GITEA] Allow changing the email address before activation (squash)
See https://codeberg.org/forgejo/forgejo/pulls/2300
2024-02-05 16:57:58 +01:00
oliverpool ecfc3cb3f0
[GITEA] always load outdated comments
(cherry picked from commit 2615dea9af)
2024-02-05 16:57:58 +01:00
Earl Warren 49b51cbdd7
Revert "Do not render empty comments (#29039)"
This reverts commit b4513f48ce.
2024-02-05 16:57:58 +01:00
Earl Warren 036f1eddc5
[GITEA] avoid superfluous synchronized pull_request run when opening a PR (#2236)
* Split TestPullRequest out of AddTestPullRequestTask
* Before scheduling the task, AddTestPullRequestTask stores the max
  index of the repository
* When the task runs, it does not take into account pull requests that
  have an index higher than the recorded max index

When AddTestPullRequestTask is called with isSync == true, it is the
direct consequence of a new commit being pushed. Forgejo knows nothing
of this new commit yet. If a PR is created later and its head
references the new commit, it will have an index that is higher and
must not be taken into account. It would be acting and triggering a
notification for a PR based on an event that happened before it
existed.

Refs: https://codeberg.org/forgejo/forgejo/issues/2009
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2236
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
(cherry picked from commit b3be895a30)
2024-02-05 16:57:58 +01:00
Gergely Nagy c335d076aa
[GITEA] admin: "Self Check" should only show for some db types
The "Self Check" menu essentially runs the collation check that is also
performed at startup, and displays the results. This is only a thing for
MariaDB/MySQL and MSSQL. As such, the menu item should only be available
for these database types.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 0ca118fdc3)
2024-02-05 16:57:56 +01:00
oliverpool 76c2f5bf92
[GITEA] add test showing bug on resolving invalidated review comment
(cherry picked from commit 5fb3b927f1)
2024-02-05 16:57:56 +01:00
Gusted 2ed825c5be
[GITEA] Fix orgmode link resolver for text descriptions
- It's possible that the description of an `Regularlink` is `Text` and not
another `Regularlink`. Therefor if it's `Text`, convert it to an
`Regularlink` trough the 'old' behavior (pass it trough `org.String` and
trim `file:` prefix).
- Adds unit tests.
- Resolves https://codeberg.org/Codeberg/Community/issues/1430

(cherry picked from commit 385fc6ee6b)
2024-02-05 16:57:56 +01:00
Gergely Nagy fde08f91fd
[GITEA] tests: A workaround for the MySQL collation tests
Because Forgejo run mysqld with `--innodb-flush-method=nosync` to speed
up the test suite, there are situations where a larger, database-wide
operation does not always fully manifest until later, not even when it
is wrapped in a transaction, nor when we use `FLUSH TABLES` and similar
methods.

In the case of the MySQL collation test, this *sometimes* results in the
database still responding with the old collation to a reader, even after
an `ALTER DATABASE ... COLLATE ...`.

In order to be able to still use the aforementioned flag and enjoy its
benefits, add a five second sleep between `db.ConvertDatabaseTable()`
and `db.CheckCollations()` in the `TestDatabaseCollation()` set of
tests.

This is not a fix - I don't think there is one possible -, but a
workaround. If it breaks again, the correct fix will be to remove the
flag from `mysqld` (it's not a supported flag to begin with).

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit af18ed2ba9)
2024-02-05 16:57:55 +01:00
Gergely Nagy 5b91430bea
[GITEA] i18n: Rename settings.transfer_form_title to .enter_repo_name
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 8438ec58f0)
2024-02-05 16:57:53 +01:00
Gergely Nagy 2ca4862f8b
[GITEA] Allow changing the repo Wiki branch to main
Previously, the repo wiki was hardcoded to use `master` as its branch,
this change makes it possible to use `main` (or something else, governed
by `[repository].DEFAULT_BRANCH`, a setting that already exists and
defaults to `main`).

The way it is done is that a new column is added to the `repository`
table: `wiki_branch`. The migration will make existing repositories
default to `master`, for compatibility's sake, even if they don't have a
Wiki (because it's easier to do that). Newly created repositories will
default to `[repository].DEFAULT_BRANCH` instead.

The Wiki service was updated to use the branch name stored in the
database, and fall back to the default if it is empty.

Old repositories with Wikis using the older `master` branch will have
the option to do a one-time transition to `main`, available via the
repository settings in the "Danger Zone". This option will only be
available for repositories that have the internal wiki enabled, it is
not empty, and the wiki branch is not `[repository].DEFAULT_BRANCH`.

When migrating a repository with a Wiki, Forgejo will use the same
branch name for the wiki as the source repository did. If that's not the
same as the default, the option to normalize it will be available after
the migration's done.

Additionally, the `/api/v1/{owner}/{repo}` endpoint was updated: it will
now include the wiki branch name in `GET` requests, and allow changing
the wiki branch via `PATCH`.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d87c526d2a)
2024-02-05 16:57:47 +01:00
Gusted 361617eea0
[GITEA] Use correct translations for pull request
- When a commit references a pull request, the detail strings should
reflect that. Add a new translation string for the pull request.
- Added integration tests.
- Resolves #2256

(cherry picked from commit 0d054cd4d9)
2024-02-05 16:54:44 +01:00
oliverpool b26d037c62
[GITEA] depguard sha256-simd
(cherry picked from commit cd1a030084)
(cherry picked from commit d5b57d41ac)
2024-02-05 16:54:44 +01:00
Earl Warren 209610075a
[TESTS] add log.Level to test.NewLogChecker
So the caller can check log events at the desired level instead of
being limited to the default level log.INFO

(cherry picked from commit 2fbf5f9555)
(cherry picked from commit e2137a3147)
2024-02-05 16:54:44 +01:00
Gusted 6fb55e9c08
[GITEA] Add slow SQL query warning (squash) Fix setting typo
- Fix typo in the slow query threshold setting, add a deprecation warning.
- Resolves #2203

(cherry picked from commit 02f6608e5f)
(cherry picked from commit 4e8f6b2ffd)
2024-02-05 16:54:44 +01:00
Gusted 464ae81a36
[GITEA] Refactor generation of JWT secret
- Remove non base64-ed version of JWT secret generation. Because all
occurences need the Base64 version.

(cherry picked from commit 6a6b5a31a8)
(cherry picked from commit 066b8ca6b4)
2024-02-05 16:54:44 +01:00
Gusted e71b5a038e
[GITEA] Fix typo in formatting error
- The `c` isn't suposse to be there, it's not a formatter.

(cherry picked from commit 94cac3b66f)
(cherry picked from commit 07e05f262e)
2024-02-05 16:54:44 +01:00
Gusted c831ff67e4
[GITEA] Simplify blame handler
- Remove unnecessary checks for `ctx.Repo.TreePath`, because it will
already early-return if it's empty.
- Simplify `performBlame` to extract the repoPath from the context.
- Don't render the topics, as they are not shown in the blame
page (there's a condition in the template for the blame page).
- Fix that `performBlame` doesn't call `NotFound`, it should instead
only return the error.
- Fix that the error handlings call `ServerError` instead of `NotFound`.
- Simplify `bypass-blame-ignore` to use `ctx.FormBool`.
- Remove `TreeLink`, `HasParentPath` and `ParentPath` as it's not used
in the blame template.
- Inline `BranchLink` and `RawFileLink` string operations.
- Move around `NumLines` to make it clear the error is handled.
- Less code, less things the code does, more readable and thus more
maintanable!

(cherry picked from commit e02baca55c)
(cherry picked from commit 74e00620ca)
2024-02-05 16:54:44 +01:00
Gergely Nagy fdda432d1e
[TESTS] Convert more tests to CreateDeclarativeRepo
These tests originate from Gitea, so may cause conflicts in the longer
run. But they use the same pattern, so transitioning them to the helper
is hopefully a benefit that offsets the risk.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 2d475af494)
(cherry picked from commit a99c17729c)
2024-02-05 16:54:44 +01:00
Gergely Nagy 48d752c630
[TESTS] Lift out CreateDeclarativeRepo()
There are a number of tests which require creating a repository on the
fly, and they each do it their own way. To reduce code duplication, lift
out this common pattern into a helper called `CreateDeclarativeRepo()`,
which lets us create a repository, set up enabled and disabled repo
units, and even add, delete, or update files.

Also convert a number of users of this pattern to the new helper - those
users that I introduced, and are in code introduced by Forgejo in the
first place.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 342b7bae3c)
(cherry picked from commit 2ece8764e9)
2024-02-05 16:54:44 +01:00
Earl Warren 403bb4bf48
[ACTIONS] on.schedule: the event is always "schedule"
handleSchedules() is called every time an event is received and will
check the content of the main branch to (re)create scheduled events.
There is no reason why intput.Event will be relevant when the schedule
workflow runs.

(cherry picked from commit 9a712bb276)
(cherry picked from commit 41af36da81)
(cherry picked from commit bb83604fa2)
(cherry picked from commit 65e4503a7a)
(cherry picked from commit e562b6f7a0)
(cherry picked from commit aca2ae2390)
(cherry picked from commit bf2b5ea507)
2024-02-05 16:54:44 +01:00
Earl Warren 540ec0751c
Revert "Fix schedule tasks bugs (#28691)" (part 2)
This function is now being used elsewhere and cannot be reverted. Only
the part that was modified in addition to being moved is deleted.

(cherry picked from commit 72954836a4)
(cherry picked from commit 86f4d1871e)
(cherry picked from commit 8089076ee2)
2024-02-05 16:54:44 +01:00
Earl Warren fe8622dae3
Revert "Fix schedule tasks bugs (#28691)"
This reverts commit 97292da960.

(cherry picked from commit 83e5eba031)
(cherry picked from commit f6ef8f3819)

Conflicts:
	services/repository/setting.go
2024-02-05 16:54:42 +01:00
Earl Warren 0fd9d08ea0
Revert "Fix schedule not trigger bug because matching full ref name with short ref name (#28874)"
This reverts commit 23efd9d278.

(cherry picked from commit b263ac67e0)
(cherry picked from commit 4699db575c)
2024-02-05 16:53:58 +01:00
Earl Warren f7fd1c7c86
Revert "Fix an actions schedule bug (#28942)"
This reverts commit adc3598a75.
2024-02-05 16:53:39 +01:00
Gergely Nagy d4396acf82
[GITEA] Don't consider orphan branches as recently pushed
When displaying the recently pushed branches banner, don't display
branches that have no common history with the default branch. These
branches are usually not meant to be merged, so the banner is just noise
in this case.

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

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit e1fba517f4)
(cherry picked from commit 2d3c81d4f2)
(cherry picked from commit 624a61b3b8)
2024-02-05 16:09:43 +01:00
voltagex 578ab6a3c9
[GITEA] API comment update routers/api/v1/shared/runners.go
Refs: https://codeberg.org/forgejo/forgejo/pulls/2191

(cherry picked from commit 1e89dd95b9)
(cherry picked from commit fecc14a16c)
(cherry picked from commit b4509aa4c7)
(cherry picked from commit 6fdf3b2ad1)
2024-02-05 16:09:43 +01:00
Gusted 938a450c9e
[GITEA] Document correct status code for creating Tag
- When there's a succesful POST operation, it should return a 201 status
code (which is the status code for succesful created) and additionally
the created object.
- Currently for the `POST /repos/{owner}/{repo}/tags` endpoint an 200
status code was documented in the OpenAPI specification, while an 201
status code was actually being returned. In this case the code is
correct and the documented status code needs to be adjusted.
- Resolves #2200

(cherry picked from commit a2939116f5)
(cherry picked from commit 22cff41585)
(cherry picked from commit b23a7f27bb)
2024-02-05 16:09:43 +01:00
Gergely Nagy 69688628f5
[GITEA] Fix misleading comparisons when comparing branches
When comparing branches, only offer those branches to use as a base
where the repository allows pull requests. Those that do not allow pull
request would result in a 404, so offering them as an option would be
misleading.

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

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 022d0e0d71)
(cherry picked from commit 957990b36a)
(cherry picked from commit 6d2df72825)
2024-02-05 16:09:43 +01:00
Gergely Nagy bc7e448d49
[GITEA] Rework when recently pushed branches are displayed
With this change, the "You pushed on branch xyz" banner will be
displayed when either the viewed repository or its base repo (if the
current one's a fork) has pull requests enabled. Previously it only
displayed if the viewed repo had PRs enabled.

Furthermore, if the viewed repository is an original repository that the
viewing user has a fork of, if the forked repository has recently pushed
branches, then the banner will appear for the original repository too.
In this case, the notification will include branches from the viewing
user's fork, and branches they pushed to the base repo, too.

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

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit a29f10661d)
(cherry picked from commit 70c5e2021d)
(cherry picked from commit 48b25be67a)
2024-02-05 16:09:43 +01:00
Gusted b020ded391
[GITEA] Adjust name of operation
- The name could be conflucted with the `GET
/user/applications/oauth2/{id}` operation, as it only differed in a
single letter being uppercase. Change it to be
userGetOAuth2Application**s**, as that's also more accurate for this function.
- Resolves #2163

(cherry picked from commit 1891dac547)
(cherry picked from commit 68fceb9b7a)
(cherry picked from commit 7335d6de54)
2024-02-05 16:09:43 +01:00
Gusted bbe5a881cc
[GITEA] Fix API inconsistencies
- Document the correct content types for Git archives. Add code that
actually sets the correct application type for `.zip` and `.tar.gz`.
- When an action (POST/PUT/DELETE method) was successful, an 204 status
code should be returned instead of status code 200.
- Add and adjust integration testing.
- Resolves #2180
- Resolves #2181

(cherry picked from commit 6c8c4512b5)
(cherry picked from commit 3f74bcb14d)
(cherry picked from commit 6ed9057fd7)
2024-02-05 16:09:43 +01:00
Earl Warren 0b503e5e86
[GITEA] DELETE /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}
* reuse deleteIssueComment by adding the commentType parameter
* ensure tests start with a PR with no random reviews from fixtures

Refs: https://codeberg.org/forgejo/forgejo/issues/2109
(cherry picked from commit 5b90ab77f6)
(cherry picked from commit 28ecd6f5a6)
(cherry picked from commit 24870cf133)
2024-02-05 16:09:43 +01:00
Gergely Nagy 8eaa8aeaf9
[GITEA] Improved Linguist compatibility
Recognise the `linguist-documentation` and `linguist-detectable`
attributes in `.gitattributes` files, and use them in
`GetLanguageStats()` to make a decision whether to include a particular
file in the stats or not.

This allows one more control over which files in their repositories
contribute toward the language statistics, so that for a project that is
mostly documentation, the language stats can reflect that.

Fixes #1672.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 6d4e02fe5f)
(cherry picked from commit ee1ead8189)
(cherry picked from commit 2dbec730e8)
2024-02-05 16:09:43 +01:00
Earl Warren bd1cea3f82
[GITEA] GET /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}
Refs: https://codeberg.org/forgejo/forgejo/issues/2109
(cherry picked from commit 69fcf26dee)
(cherry picked from commit 1296f4d115)
(cherry picked from commit 119d10d9e2)
(cherry picked from commit eb5b55b1b7)
2024-02-05 16:09:43 +01:00
Earl Warren e658a6a9cd
[GITEA] API commentAssignment() to verify the id belongs
Instead of repeating the tests that verify the ID of a comment
is related to the repository of the API endpoint, add the middleware
function commentAssignment() to assign ctx.Comment if the ID of the
comment is verified to be related to the repository.

There already are integration tests for cases of potential unrelated
comment IDs that cover some of the modified endpoints which covers the
commentAssignment() function logic.

* TestAPICommentReactions - GetIssueCommentReactions
* TestAPICommentReactions - PostIssueCommentReaction
* TestAPICommentReactions - DeleteIssueCommentReaction
* TestAPIEditComment - EditIssueComment
* TestAPIDeleteComment - DeleteIssueComment
* TestAPIGetCommentAttachment - GetIssueCommentAttachment

The other modified endpoints do not have tests to verify cases of
potential unrelated comment IDs. They no longer need to because they
no longer implement the logic to enforce this. They however all have
integration tests that verify the commentAssignment() they now rely on
does not introduce a regression.

* TestAPIGetComment - GetIssueComment
* TestAPIListCommentAttachments - ListIssueCommentAttachments
* TestAPICreateCommentAttachment - CreateIssueCommentAttachment
* TestAPIEditCommentAttachment - EditIssueCommentAttachment
* TestAPIDeleteCommentAttachment - DeleteIssueCommentAttachment

(cherry picked from commit d414376d74)
(cherry picked from commit 09db07aeae)
(cherry picked from commit f44830c3cb)

Conflicts:
	modules/context/api.go
	https://codeberg.org/forgejo/forgejo/pulls/2249
(cherry picked from commit 9d1bf7be15)
2024-02-05 16:09:43 +01:00
Gusted 2baec139fa
[GITEA] Fix test `TestWebhookProxy` with http proxy env
- Unset the http proxies environments for the `TestWebhookProxy`.
- Resolves #2132

(cherry picked from commit 244b9786fc)
(cherry picked from commit 8602dfa6a2)
(cherry picked from commit 8621449209)
(cherry picked from commit aefa77f917)
2024-02-05 16:09:43 +01:00
Gergely Nagy 2bdab5e400
[GITEA] Include a branch link in the recently pushed banner
The message telling us that we recently pushed on a branch should
include a link to said branch, not just a "New pull request" button.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d9662d03a4)
(cherry picked from commit 2527e09125)
(cherry picked from commit 0ddefdf9f4)
(cherry picked from commit e9ff354f7c)
2024-02-05 16:09:43 +01:00
Gergely Nagy 3bdfb7a7aa
[GITEA] Fix the topic search paging
When searching for repository topics, either via the API, or via
Explore, paging did not work correctly, because it only applied when the
`page` parameter was non-zero. Paging should have applied when the page
size is greater than zero, which is what this patch does.

As a result, both the API, and the Explore endpoint will return paged
results (30 by default). As such, when managing topics on the frontend,
the offered completions will also be limited to a pageful of results,
based on what the user has already typed.

This drastically reduces the amount of traffic, and also the number of
the topics to choose from, and thus, the rendering time too.

The topics will be returned by popularity, with most used topics first.
A single page will contain `[api].DEFAULT_PAGING_NUM` (30 by default)
items that match the query. That's plenty to choose from.

Fixes #132.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 64d4ff41db)
(cherry picked from commit 06b808fa2c)
(cherry picked from commit 9205c9266a)
(cherry picked from commit 47863d4f72)
2024-02-05 16:09:43 +01:00
Gusted d1cb590c78
[GITEA] Log SQL queries when the database return error
- When the database returns an error about the SQL query, the error is
logged but not the SQL query and arguments, which is just as valuable as
the vague deeply hidden documented error that the database returns.
It's possible to log the SQL query by logging **all** SQL queries. For
bigger instances such as Codeberg, this is not a viable option.
- Adds a new hook, enabled by default, to log SQL queries with their
arguments and the error returned by the database when the database
returns an error.
- This likely needs some fine tuning in the future to decide when to
enable this, as the error is already logged and if people have the
`[database].LOG_SQL` option enabled, the SQL would be logged twice. But
given that it's an rare occurence for SQL queries to error, it's fine to
leave that as-is.
- Ref: https://codeberg.org/forgejo/forgejo/issues/1998

(cherry picked from commit 866229bc32)
(cherry picked from commit 96dd3e87cf)
(cherry picked from commit e165510317)
(cherry picked from commit 1638e2b3f5)
2024-02-05 16:09:43 +01:00
Gergely Nagy 2924fcf814
[GITEA] services: Gracefully handle missing branches
services: in loadOneBranch, return if CountDivergingCommits fail

If we can't count the number of diverging commits for one reason or
another (such as the branch being in the database, but missing from
disk), rather than logging an error and continuing into a crash (because
`divergence` will be nil), return an error instead.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 8266105f24)

services: Gracefully handle missing branches

When loading branches, if loading one fails, log an error, and ignore
the branch, rather than returning and causing an internal server error.

Ideally, we would only ignore the error if it was caused by a missing
branch, and do it silently, like the respective API endpoint does.
However, veryfing that at this place is not very practical, so for the
time being, ignore any and all branch loading errors.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit e552a8fd62)

tests: Add a testcase for missing branches

This tests the scenario reported in Codeberg/Community#1408: a branch
that is recorded in the database, but missing on disk was causing
internal server errors. With recent changes, that is no longer the case,
the error is logged and then ignored.

This test case tests this behaviour, that the repo's branches page on
the web UI functions even if the git branch is missing.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit e20eb7b385)

tests: More testing in TestDatabaseMissingABranch

In the `TestDatabaseMissingABranch` testcase, make sure that the
branches are in sync between the db and git before deleting a branch via
git, then compare the branch count from the web UI, making sure that it
returns an out-of-sync value first, and the correct one after another
sync.

This is currently tested by scraping the UI, and relies on the fact that
the branch counter is out of date before syncing. If that issue gets
resolved, we'll have to adjust the test to verify the sync another way.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 8c2ccfcece)
(cherry picked from commit 439fadf563)
(cherry picked from commit 44dd80552c)
(cherry picked from commit 37b91fe6f2)
2024-02-05 16:09:42 +01:00
Gusted 2cfcd266b4
[GITEA] Fix panic in `canSoftDeleteContentHistory`
- It's possible that `canSoftDeleteContentHistory` is called without
`ctx.Doer` being set, such as an anonymous user requesting the
`/content-history/detail` endpoint.
- Add a simple condition to always set to `canSoftDelete` to false if an
anonymous user is requesting this, this avoids a panic in the code that
assumes `ctx.Doer` is set.
- Added integration testing.

(cherry picked from commit 0b5db0dcc6)
(cherry picked from commit 30d168bcc8)
(cherry picked from commit 19be82b7ef)
(cherry picked from commit 334b703b17)
2024-02-05 16:09:42 +01:00
Earl Warren 603a44edf0
[GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments
Refs: https://codeberg.org/forgejo/forgejo/issues/2109
(cherry picked from commit 8b4ba3dce7)
(cherry picked from commit 196edea0f9)

[GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments (squash) do not implicitly create a review

If a comment already exists in a review, the comment is added. If it
is the first comment added to a review, it will implicitly create a
new review instead of adding to the existing one.

The pull_service.CreateCodeComment function is responsibe for this
behavior and it will defer to createCodeComment once the review is
determined, either because it was found or because it was created.

Rename createCodeComment into CreateCodeCommentKnownReviewID to expose
it and change the API endpoint to use it instead. Since the review is
provided by the user and verified to exist already, there is no need
for the logic implemented by CreateCodeComment.

The tests are modified to remove the initial comment from the fixture
because it was creating the false positive. I was verified to fail
without this fix.

(cherry picked from commit 6a555996dc)
(cherry picked from commit b173a0ccee)
(cherry picked from commit 838ab9740a)
2024-02-05 16:09:42 +01:00
Gusted 91b5aa0e5f
[GITEA] Improve 404 screen on mobile
- Remove `container` to remove unnecessary margins being added to the
whole page.
- Specify max width for the 404 image to avoid overflow of the image.

(cherry picked from commit b1ced72ce5)
(cherry picked from commit ef5e1b01b8)
(cherry picked from commit c321af3d5f)
(cherry picked from commit d6e99436b5)
2024-02-05 16:09:42 +01:00
Gergely Nagy 639b428cf4
[FEAT] API support for repository flags
Expose the repository flags feature over the API, so the flags can be
managed by a site administrator without using the web API.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit bac9f0225d)
(cherry picked from commit e7f5c1ba14)
(cherry picked from commit 95d9fe19cf)
(cherry picked from commit 7fc51991e4)
2024-02-05 16:09:42 +01:00
Gergely Nagy 36f7c162e2
[FEAT] Repository flags
This implements "repository flags", a way for instance administrators to
assign custom flags to repositories. The idea is that custom templates
can look at these flags, and display banners based on them, Forgejo does
not provide anything built on top of it, just the foundation. The
feature is optional, and disabled by default. To enable it, set
`[repository].ENABLE_FLAGS = true`.

On the UI side, instance administrators will see a new "Manage flags"
tab on repositories, and a list of enabled tags (if any) on the
repository home page. The "Manage flags" page allows them to remove
existing flags, or add any new ones that are listed in
`[repository].SETTABLE_FLAGS`.

The model does not enforce that only the `SETTABLE_FLAGS` are present.
If the setting is changed, old flags may remain present in the database,
and anything that uses them, will still work. The repository flag
management page will allow an instance administrator to remove them, but
not set them, once removed.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit ba735ce222)
(cherry picked from commit f09f6e029b)
(cherry picked from commit 2f8b041489)
(cherry picked from commit d3186ee5f4)
2024-02-05 16:09:42 +01:00
Gergely Nagy 9809f96a4a
[GITEA] Disable the RSS feed in file view for non-branches
Files can have an RSS feed, but those only make sense when taken in the
context of a branch. There is no history to make a feed of on a tag or a
commit: they're static. Forgejo does not provide a feed for them for
this reason.

However, the file view on the web UI was offering a link to these
non-existent feeds. With this patch, it does that no longer, and only
provides a link when viewing the file in the context of a branch.

Fixes #2102.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 4b48d21ea7)
(cherry picked from commit 70cb266760)
(cherry picked from commit 69b45c3fea)

Conflicts:
	options/locale/locale_en-US.ini
	https://codeberg.org/forgejo/forgejo/pulls/2249
(cherry picked from commit 639a2c0741)
2024-02-05 16:09:42 +01:00
Earl Warren 2e172b3c9c
[GITEA] add option for banning dots in usernames (squash) set in test
(cherry picked from commit b005b586c3)
(cherry picked from commit 0077b2661e)
(cherry picked from commit c4589d1fce)
(cherry picked from commit a7f9ff982c)
2024-02-05 16:09:42 +01:00
Gergely Nagy e019eb33a2
[GITEA] Find README.md for user profiles case insensitively
When trying to find a `README.md` in a `.profile` repo, do so case
insensitively. This change does not make it possible to render readmes
in formats other than Markdown, it just removes the hard-coded
"README.md".

Also adds a few tests to make sure the change works.

Fixes #1494.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit edd219d8e9)
(cherry picked from commit 2c0105ef17)
(cherry picked from commit 3975a9f3aa)
(cherry picked from commit dee4a18423)
(cherry picked from commit 60aee6370f)
2024-02-05 16:09:42 +01:00
Gusted 159dc74ceb
[GITEA] Check for Commit in opengraph
- It's possible that `PageIsDiff` is set but not `Commit` resulting in a
NPE in the template. This can happen when the requested commit doesn't exist.
- Regression of c802c46a9b &
5743d7cb5b
- Added 'hacky' integration test.

(cherry picked from commit 8db2d5e4a7)
(cherry picked from commit 8c737a802b)
(cherry picked from commit 6b7c7d18dc)
(cherry picked from commit a2be4fab27)
(cherry picked from commit a1125268ac)
2024-02-05 16:09:42 +01:00
Gergely Nagy f90b802634
[GITEA] Add support for shields.io-based badges
Adds a new `/{username}/{repo}/badges` family of routes, which redirect
to various shields.io badges. The goal is to not reimplement badge
generation, and delegate it to shields.io (or a similar service), which
are already used by many. This way, we get all the goodies that come
with it: different styles, colors, logos, you name it.

So these routes are just thin wrappers around shields.io that make it
easier to display the information we want. The URL is configurable via
`app.ini`, and is templatable, allowing to use alternative badge
generator services with slightly different URL patterns.

Additionally, for compatibility with GitHub, there's an
`/{username}/{repo}/actions/workflows/{workflow_file}/badge.svg` route
that works much the same way as on GitHub. Change the hostname in the
URL, and done.

Fixes gitea#5633, gitea#23688, and also fixes #126.

Work sponsored by Codeberg e.V.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit fcd0f61212)
(cherry picked from commit 20d14f7844)
(cherry picked from commit 4359741431)
(cherry picked from commit 35cff45eb8)
(cherry picked from commit 2fc0d0b8a3)
2024-02-05 16:09:42 +01:00
Gergely Nagy 92f41d11dd
[GITEA] repo: Don't redirect the repo to external units
When displaying the repo home view, do not redirect to unit types that
can't be defaults (which, at the moment, are the external wiki and issue
tracker unit types).

If we'd redirect to those, that would mean that a repository with the
Code unit disabled, and an external issue tracker would immediately
redirect to the external issue tracker, making it harder to reach other,
non-external units of the repo.

Fixes #1965.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 44078e5460)
(cherry picked from commit 1868dec2e4)
(cherry picked from commit c3a8e98870)
(cherry picked from commit 9266b1916f)
(cherry picked from commit 8fa5ff65af)
2024-02-05 16:09:42 +01:00
Gusted abfc169fc8
[GITEA] Remove redundant `syncBranchToDB`
- The transaction in combination with Git push was causing deadlocks if
you had the `push_update` queue set to `immediate`. This was the root
cause of slow integration tests in CI.
- Remove the sync branch code as this is already being done in the Git
post-receive hook.
- Add tests to proof the branch models are in sync even with this code
removed.

(cherry picked from commit 90110e1f44)
(cherry picked from commit a064065cb9)
(cherry picked from commit 7713e558eb)

Conflicts:
	services/repository/branch.go
	https://codeberg.org/forgejo/forgejo/pulls/2068
(cherry picked from commit 3bb73e0813)
(cherry picked from commit c557540926)
(cherry picked from commit 986be6171a)
(cherry picked from commit 7a343877f1)
(cherry picked from commit 51425500f2)
2024-02-05 16:09:42 +01:00
Gergely Nagy 1d8bca07f3
[GITEA] Configurable clone methods
Adds `[repository].DOWNLOAD_OR_CLONE_METHODS` (defaulting to
"download-zip,download-targz,download-bundle,vscode-clone"), which lets
an instance administrator override the additional clone methods
displayed on the repository home view.

This is purely display-only, the clone methods not listed here are still
available, unless disabled elsewhere. They're just not displayed.

Fixes #710.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 2aadcf4946)
(cherry picked from commit 42ac34fbf9)
(cherry picked from commit bd231b0245)
(cherry picked from commit 3d3366dbbe)
(cherry picked from commit 0157fb9b88)
(cherry picked from commit bee88f6a83)
2024-02-05 16:09:42 +01:00
Gusted 1bae2430c0
[GITEA] Fix NPE in `ToPullReviewList`
- Add condition to ensure doer isn't nil when using it.
- Added unit test.
- Resolves #2055

(cherry picked from commit 8f1a74fb29)
(cherry picked from commit 60ac881776)
(cherry picked from commit 5fdc461ac5)
(cherry picked from commit 70623e8da1)
(cherry picked from commit 1d5153aaf6)
(cherry picked from commit 3927f0c8b2)
2024-02-05 16:09:42 +01:00
Antonin Delpeuch f3b298133e
[GITEA] pulls: "Edit File" button in "Files Changed" tab
Closes #1894.
Gitea issue: https://github.com/go-gitea/gitea/issues/23848

(cherry picked from commit 79c75164ca)
(cherry picked from commit 58c76aad8f)
(cherry picked from commit 5bdb3c6c53)
(cherry picked from commit 94e954ce22)
(cherry picked from commit 1388e7c7be)
(cherry picked from commit 6a234abff5)
2024-02-05 16:09:42 +01:00
Gusted 5c0894a588
[GITEA] Avoid `WHERE IN` for comment migration query
- Rewrite `UpdateCommentsMigrationsByType` to not use `WHERE IN` as
that's a performance diaster for MariaDB, it now use batching to query
the the relevant comment IDs via JOINs (which is not possible in a
UPDATE query for SQLite) and then update them in a seperate query.
- Add unit test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1856

(cherry picked from commit 8098ca9d2e)

Conflicts:
	models/issues/comment.go
	https://codeberg.org/forgejo/forgejo/pulls/2075
(cherry picked from commit ca65deba1c)
(cherry picked from commit 0e1e09e77d)
(cherry picked from commit 19013ba5ea)
(cherry picked from commit 23c887f97e)
(cherry picked from commit b3321d1a84)
2024-02-05 16:09:42 +01:00
Gusted be6416e990
[GITEA] Fix /issues/search endpoint
- The endpoint was moved from being an API endpoint to an web endpoint
with JSON result. However the API context isn't the same as the web
context, for example the `ctx.Error` only takes in the first two
arguments into consideration and doesn't do logging, which is not the
same behavior as the API context where there's three arguments and does
do logging and only reveal the function + error if the user is admin.
- Remove any details in the error message and do the logging seperatly,
this is somewhat consistent with how other API endpoints behave.
- Ref: https://codeberg.org/forgejo/forgejo/issues/1998

(cherry picked from commit fe71e32ace)
(cherry picked from commit c89e0735fa)
(cherry picked from commit 4c04dcfc59)
(cherry picked from commit 66eae1041c)
(cherry picked from commit 7b70fa9392)
(cherry picked from commit abf64ca0e3)
2024-02-05 16:09:42 +01:00
Gergely Nagy 5eeccecafc
[GITEA] Optionally allow anyone to edit Wikis
This is largely based on gitea#6312 by @ashimokawa, with updates and
fixes by myself, and incorporates the review feedback given in that pull
request, and more.

What this patch does is add a new "default_permissions" column to the
`repo_units` table (defaulting to read permission), adjusts the
permission checking code to take this into consideration, and then
exposes a setting that lets a repo administrator enable any user on a
Forgejo instance to edit the repo's wiki (effectively giving the wiki
unit of the repo "write" permissions by default).

By default, wikis will remain restricted to collaborators, but with the
new setting exposed, they can be turned into globally editable wikis.

Fixes Codeberg/Community#28.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 4b74439922)
(cherry picked from commit 337cf62c10)
(cherry picked from commit b6786fdb32)
(cherry picked from commit a5d2829a10)

[GITEA] Optionally allow anyone to edit Wikis (squash) AddTokenAuth

(cherry picked from commit fed50cf72e)
(cherry picked from commit 42c55e494e)
(cherry picked from commit e3463bda47)
2024-02-05 16:09:42 +01:00
Gusted f3f888ed13
[GITEA] Fix session generation for database
- If the session doesn't exist, it shouldn't be expected that the
variable is non-nil. Define the session variable instead and insert that.
- Add unit tests to test the behavior of the database sessions code .
- Regression caused by dd30d9d5c0.
- Resolves https://codeberg.org/forgejo/forgejo/issues/2042

(cherry picked from commit 90307ad200)
(cherry picked from commit 874ef1978d)
(cherry picked from commit 27d5f035fc)
(cherry picked from commit 65dbc4303b)

[GITEA] Fix session generation for database (squash) timeutil.Mock

because of e743570f65 * Refactor timeutil package (#28623)

(cherry picked from commit acc6b51be2)
(cherry picked from commit 02b74317f2)
(cherry picked from commit 63b9b624bd)
(cherry picked from commit 7752ff8baa)
(cherry picked from commit c0af4d9438)
2024-02-05 16:09:41 +01:00
Earl Warren 41871ba3af
[ACTIONS] on.schedule: create a new payload
do not reuse the payload of the event that triggered the creation of
the scheduled event. Create a new one instead that contains no other
information than the event name in the action field ("schedule").

(cherry picked from commit 0b40ca1ea5)
(cherry picked from commit f86487432b)
(cherry picked from commit 4bd5d2e9d0)
(cherry picked from commit d10830e238)
(cherry picked from commit 53f5a3aa91)
(cherry picked from commit 9ed1487b73)
(cherry picked from commit 6a39978851)
2024-02-05 16:09:41 +01:00
Gusted 33b1dec846
[GITEA] Fix NPE in `UsernameSubRoute`
- When the user is not found in `reloadparam`, early return when the
user is not found to avoid calling `IsUserVisibleToViewer` which in turn
avoids causing a NPE.
- This fixes the case that a 500 error and 404 error is shown on the
same page.
- Add integration test for non-existant user RSS.
- Regression by c6366089df

(cherry picked from commit f0e0696278)
(cherry picked from commit 75d8066908)
(cherry picked from commit 4d0a1e0637)
(cherry picked from commit 5f40a485da)
(cherry picked from commit c4cb7812e3)
(cherry picked from commit d31ce2f03d)
(cherry picked from commit cfebef4f82)
2024-02-05 16:09:41 +01:00
Earl Warren 447aa3e499
[GITEA] the ref of a scheduled action is always the default branch
Since a scheduled action is only run from the default branch, it
cannot be anything else.

Refs: https://codeberg.org/forgejo/forgejo/issues/1926
(cherry picked from commit eff0822856)
(cherry picked from commit 2b1aa50bd1)

Conflicts:
	services/actions/notifier_helper.go
	https://codeberg.org/forgejo/forgejo/pulls/2075
(cherry picked from commit 4ff3474fc0)
(cherry picked from commit 07b8887031)
(cherry picked from commit cbecdd618d)
(cherry picked from commit 5d1856717b)
(cherry picked from commit ff33556798)
2024-02-05 16:09:41 +01:00
Gusted 701882cc08
[GITEA] Add footnote testing
- This adds coverage to the most common and the edge cases of what the
footnote implementation should be capable of. This was partly done to
ensure no hidden surprises when changing the implementation, as markdown
rendering is one of the more important features of Forgejo.

(cherry picked from commit 16ecdb4170)
(cherry picked from commit 19dc5ef5e5)
(cherry picked from commit d5955efc0a)
(cherry picked from commit 2cdaf10836)
(cherry picked from commit 251b567794)

Conflicts:
	modules/markup/markdown/markdown_test.go
	https://codeberg.org/forgejo/forgejo/pulls/2153
(cherry picked from commit f863f4b005)
(cherry picked from commit f39f108934)
(cherry picked from commit 6d46f9ee40)
2024-02-05 16:09:41 +01:00
Gergely Nagy d4fc0d2c5a
[GITEA] Allow changing the email address before activation
During registration, one may be required to give their email address, to
be verified and activated later. However, if one makes a mistake, a
typo, they may end up with an account that cannot be activated due to
having a wrong email address.

They can still log in, but not change the email address, thus, no way to
activate it without help from an administrator.

To remedy this issue, lets allow changing the email address for logged
in, but not activated users.

This fixes gitea#17785.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit aaaece28e4)
(cherry picked from commit 639dafabec)
(cherry picked from commit d699c12ceb)

[GITEA] Allow changing the email address before activation (squash) cache is always active

This needs to be revisited because the MailResendLimit is not enforced
and turns out to not be tested.

See e7cb8da2a8 * Always enable caches (#28527)

(cherry picked from commit 43ded8ee30)

Rate limit pre-activation email change separately

Changing the email address before any email address is activated should
be subject to a different rate limit than the normal activation email
resending. If there's only one rate limit for both, then if a newly
signed up quickly discovers they gave a wrong email address, they'd have
to wait three minutes to change it.

With the two separate limits, they don't - but they'll have to wait
three minutes before they can change the email address again.

The downside of this setup is that a malicious actor can alternate
between resending and changing the email address (to something like
`user+$idx@domain`, delivered to the same inbox) to effectively halving
the rate limit. I do not think there's a better solution, and this feels
like such a small attack surface that I'd deem it acceptable.

The way the code works after this change is that `ActivatePost` will now
check the `MailChangeLimit_user` key rather than `MailResendLimit_user`,
and if we're within the limit, it will set `MailChangedJustNow_user`. The
`Activate` method - which sends the activation email, whether it is a
normal resend, or one following an email change - will check
`MailChangedJustNow_user`, and if it is set, it will check the rate
limit against `MailChangedLimit_user`, otherwise against
`MailResendLimit_user`, and then will delete the
`MailChangedJustNow_user` key from the cache.

Fixes #2040.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit e35d2af2e5)
(cherry picked from commit 03989418a7)
(cherry picked from commit f50e0dfe5e)
(cherry picked from commit cad9184a36)
(cherry picked from commit e2da5d7fe1)
(cherry picked from commit 3a80534d4d)
2024-02-05 16:09:41 +01:00
Earl Warren 6b5bfffe5d
[GITEA] test markdown CleanValue to prevent regression
It will determine how anchors are created and will break existing
links otherwise.

Adapted from Revert "Make `user-content-* ` consistent with github (#26388)

(cherry picked from commit 1666fba8f5)
(cherry picked from commit 48f38280e8)
(cherry picked from commit 03adb3a2b4)
(cherry picked from commit a0ad36f0ad)
(cherry picked from commit 3aac990064)
(cherry picked from commit 137daabc9b)
(cherry picked from commit b438aed4c1)
(cherry picked from commit 90b36f2e67)
2024-02-05 16:09:41 +01:00
Earl Warren 7b79294684
[GITEA] Revert "Make `user-content-* ` consistent with github (#26388)"
Refs: https://codeberg.org/forgejo/forgejo/issues/1943

This reverts commit d41aee1d1e.

(cherry picked from commit d29ec91e91)
(cherry picked from commit a0f5a9750e)
(cherry picked from commit 26bfc3bc14)
(cherry picked from commit 59f57a1bc9)
(cherry picked from commit ce3b73a033)
(cherry picked from commit 2c426c28af)
(cherry picked from commit 155a08bca7)
(cherry picked from commit 8934fd895c)
2024-02-05 16:09:41 +01:00
Earl Warren 06aae9ae72
[GITEA] GetScheduledMergeByPullID may involve a system user
Refs: https://codeberg.org/forgejo/forgejo/issues/1897
(cherry picked from commit ddc3c22558)
(cherry picked from commit a7fe969b93)
(cherry picked from commit 62bda95774)
(cherry picked from commit 8149a822c7)
(cherry picked from commit 9ed4e685eb)
(cherry picked from commit 4f072b4f80)
(cherry picked from commit ca5924037b)
(cherry picked from commit 88e2b47e29)
(cherry picked from commit 784f860cfa)
2024-02-05 16:09:41 +01:00
Gergely Nagy fa0759962b
[GITEA] allow viewing the latest Action Run on the web
Similar to how some other parts of the web UI support a `/latest` path
to directly go to the latest of a certain thing, let the Actions web UI
do the same: `/{owner}/{repo}/actions/runs/latest` will redirect to the
latest run, if there's one available.

Fixes gitea#27991.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit f67ccef1dd)

Code cleanup in the actions.ViewLatest route handler

Based on feedback received after the feature was merged, use
`ctx.NotFound` and `ctx.ServerError`, and drop the use of the
unnecessary `ctx.Written()`.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 74e42da563)
(cherry picked from commit f7535a1cef)
(cherry picked from commit 1a90cd37c3)
(cherry picked from commit d86d71340a)
(cherry picked from commit 9e5cce1afc)
(cherry picked from commit 2013fb3fab)
(cherry picked from commit 88b9d21d11)
(cherry picked from commit 72c020298e)
(cherry picked from commit 6525f730df)
2024-02-05 16:09:41 +01:00
Gusted 533c87da65
[GITEA] Make HTTPS schema default for Swagger
- Switch the supported schemas for the Swagger API around, such that
https is the first one listed. This ensures that when the Swagger API is
used it will default to the https schema, which is likely the schema you
want to use in the majority of the cases.
- Resolves #1895

BREAKING CHANGE NOTICE:
If you are using the Swagger API JSON directly to communicate with the
Forgejo API, the library you are using may be using the first schema
defined in the JSON file (e.g. https://code.forgejo.org/swagger.v1.json)
to construct the request url, this used to be `http` but has now changed
to `https`. This can cause failures if you want to send the swagger
request over `http` (and there is no HTTPS redirection configured).

(cherry picked from commit 81e5f43886)
(cherry picked from commit d847469ea2)
(cherry picked from commit 96e75e1d5c)
(cherry picked from commit 65baa64261)
(cherry picked from commit cd3e0a74e6)
(cherry picked from commit a3127e90b2)
(cherry picked from commit 2b22272dc5)
(cherry picked from commit 7363790592)
(cherry picked from commit 432b9a4451)
2024-02-05 16:09:41 +01:00
Otto Richter 274aee0bb0
[GITEA] correct default license selection
The default license choice was not working as expected,
because both the files in options/license were named differently, and
the setting string is not parsed properly.

The documentation will also be corrected.

See conversation on Matrix:
https://matrix.to/#/%23forgejo-chat%3Amatrix.org/%24ue13GJPr2d7D8fEaLx8yh1mFn3a4TVy_khkajrAYtx0?via=matrix.tu-berlin.de&via=turbo.ooo&via=matrix.org&via=catgirl.cloud

(cherry picked from commit 450a34d08d)
(cherry picked from commit 2770af7044)
(cherry picked from commit 0fadf41985)
(cherry picked from commit 9c3aa1dbbd)
(cherry picked from commit f8ecff8422)
(cherry picked from commit 1e28937546)
(cherry picked from commit e566ffbb8d)
(cherry picked from commit cf89ca48b6)
(cherry picked from commit e2897d15b4)
(cherry picked from commit 8b49f1195d)
2024-02-05 16:09:41 +01:00
Antonin Delpeuch 55306dfb24
[GITEA] fix VSCode settings
Without this change, I get the error:
> Error creating test engine: sqlite3 requires: import _ "github.com/mattn/go-sqlite3" or -tags sqlite,sqlite_unlock_notify

(cherry picked from commit 15fa4cf98e)
(cherry picked from commit 2993203093)
(cherry picked from commit f5054e4883)
(cherry picked from commit e14c5f934c)
(cherry picked from commit ed53157084)
(cherry picked from commit dc8346508b)
(cherry picked from commit e6d8e1a973)
(cherry picked from commit f3b9ca02f3)
(cherry picked from commit 3799c133b4)
2024-02-05 16:09:41 +01:00
Gergely Nagy ff00749191
[GITEA] new doctor check: fix-push-mirrors-without-git-remote (#1853)
This adds a new `doctor` check: `fix-push-mirrors-without-git-remote`. The new check looks for push mirrors that do not have their remotes configured in git. If automatic fixing is enabled, it will remove these push mirrors from the database.

The check is not run by default, and thus, must be invoked manually. It should be usable in a half-migrated state, too, and as such, fixes #1800.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1853
Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Co-committed-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 9038e07ef3)
(cherry picked from commit b15bafcbc7)
(cherry picked from commit 93ba05a2dd)
(cherry picked from commit e418ea8082)
(cherry picked from commit 321790a91e)
(cherry picked from commit f4e19d3323)
(cherry picked from commit 4d9923dee8)
(cherry picked from commit 049df69eda)

Conflicts:
	services/doctor/push_mirror_consistency.go
	https://codeberg.org/forgejo/forgejo/pulls/2214
(cherry picked from commit c79cba8d55)
(cherry picked from commit f3a3969c02)
2024-02-05 16:09:41 +01:00
Gusted 9341b37520
[GITEA] Add download URL for executable files
- Consider executable files as a valid case when returning a downloadURL
for them. They are just regular files with the difference being the
executable permission bit being set.
- Not integration testing as it's not possible without adding adjusting
the existing repositories to have a executable file.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1825

(cherry picked from commit ca32891d54)
(cherry picked from commit 72c9df8e45)
(cherry picked from commit 0eae22d429)
(cherry picked from commit d37d0773bc)
(cherry picked from commit de4532a967)
(cherry picked from commit f5b41300a8)
(cherry picked from commit d3be0480b7)
(cherry picked from commit c72307fd3b)
(cherry picked from commit 71db593057)
(cherry picked from commit 568e668fb8)
2024-02-05 16:09:41 +01:00
Gusted e1a82a15d3
[GITEA] Require Latex code to have a end sequence
- Currently the parser will look for `\[` and `$$` to detect when Latex
code starts, it will look for `\]` and `$$` respectively in order to
determine the end of the code. However if no end is found the parser
assumes the rest of the input is part of the Latex code.
- Adjust the parser's behavior to not allow the case to assume the rest
of the input is part of the Latex code and requires in order to
determine if some input is Latex code that the end sequence is also
specified.
- Example: `\[hello]` would no longer be detected as Latex code with
this patch.
- Added unit tests.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1817

(cherry picked from commit 452aef1bb1)
(cherry picked from commit 8a857c24b0)
(cherry picked from commit acd1456db9)
(cherry picked from commit 6523b45073)
(cherry picked from commit e2e1a8afe7)
(cherry picked from commit a46ef652eb)
(cherry picked from commit 54d5a8c073)
(cherry picked from commit 4a88dc6416)
(cherry picked from commit f88b58be3f)
(cherry picked from commit 316ff9767f)
2024-02-05 16:09:41 +01:00
Gusted 75ce1e2ac1
[GITEA] Allow user to select email for file operations in Web UI
- Add a dropdown to the web interface for changing files to select which
Email should be used for the commit. It only shows (and verifies) that a
activated mail can be used, while this isn't necessary, it's better to
have this already in place.
- Added integration testing.
- Resolves https://codeberg.org/forgejo/forgejo/issues/281

(cherry picked from commit 564e701f40)
(cherry picked from commit de8f2e03cc)
(cherry picked from commit 0182cff12e)
(cherry picked from commit 9c74254d46)
(cherry picked from commit 2f0b68f821)
(cherry picked from commit 079b995d49)
(cherry picked from commit 6952ea6ee3)
(cherry picked from commit 6c7d5a5d14)
(cherry picked from commit 49c39f0ed5)
(cherry picked from commit a8f9727388)
2024-02-05 16:09:41 +01:00
Antonin Delpeuch 51fab30187
[GITEA] Avoid conflicts of issue and PR numbers in GitLab migration (#1790)
Closes #1789.

The bug was due to the fact that GitLab does not guarantee that issue numbers are created sequentially: some identifiers can be skipped. Therefore, the new pull requests numbers should not be offset by the number of issues, but by the maximum issue number.

See for instance https://gitlab.com/troyengel/archbuild/-/issues/?sort=created_date&state=all&first_page_size=20, where there is only a singe issue with number "2".

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1790
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
(cherry picked from commit 2c185c39fe)
(cherry picked from commit 8f68dc4c9c)
(cherry picked from commit 7e932b7fca)
(cherry picked from commit 6bbe75ecf8)
(cherry picked from commit b18c2e8d65)

Conflicts:
	services/migrations/gitlab.go
	https://codeberg.org/forgejo/forgejo/pulls/2075
(cherry picked from commit abc129c762)
(cherry picked from commit 28884fac10)
(cherry picked from commit 5f528dd85f)

(cherry picked from commit cb9b8a31b2)
(cherry picked from commit 97f02df163)
(cherry picked from commit 4611e10e6a)
2024-02-05 16:09:41 +01:00
Antonin Delpeuch 01b0ead664
[GITEA] Enable mocked HTTP responses for GitLab migration test
Fix gitlab migration unit test

Closes #1837.

The differences in dates can be explained by commit e19b9653ea, which
changed the order in which "created_date" and "updated_date" are
considered.

(cherry picked from commit b0bba20aa4)

Mock HTTP requests in GitLab migration test

This introduces a new utility which can be added to other tests
making HTTP calls to a live service, to cache the responses of this
service in the repository.

(cherry picked from commit 52053b1389)

Enable mocked HTTP responses for GitLab migration test

(cherry picked from commit 19cefc4de2)

Simplify HTTP mocking utility in unit tests

Follow-up to https://codeberg.org/forgejo/forgejo/pulls/1841

(cherry picked from commit ca517c8bb4)
(cherry picked from commit b227e0dd6b)
(cherry picked from commit 6cc9d06556)
(cherry picked from commit f0746e648d)
(cherry picked from commit 414193341b)
(cherry picked from commit 6e93df3bbb)
(cherry picked from commit db0dbab552)
(cherry picked from commit 8f9c9c63fb)

(cherry picked from commit e74e262030)
(cherry picked from commit 2e0933edcf)
(cherry picked from commit 65060c6961)
2024-02-05 16:09:41 +01:00
Loïc Dachary 21c4d844f3
[GITEA] test GET /{owner}/{repo}/comments/{id}/attachments
Refs: https://forgejo.org/2023-11-release-v1-20-5-1/#api-and-web-endpoint-vulnerable-to-manually-crafted-identifiers

(cherry picked from commit 888dda12cf9bc95f9ef85ba5a518cf40152e07ea)
(cherry picked from commit aceeca55da)
(cherry picked from commit ab7e649668)
(cherry picked from commit 7fb8598c7d)
(cherry picked from commit fb4961e2a5)
(cherry picked from commit 9fe856a29a)
(cherry picked from commit 6db21c013d)
(cherry picked from commit 72c84eb19c)
(cherry picked from commit 07ebc9761d)
(cherry picked from commit 0c8f484002)
(cherry picked from commit 25df7d89bc)
(cherry picked from commit 0f436a0d22)
(cherry picked from commit 6109f8b6c1)
2024-02-05 16:09:41 +01:00
Loïc Dachary 3f71a0ef02
[GITEA] test POST /{username}/{reponame}/{type:issues|pulls}/move_pin
Refs: https://forgejo.org/2023-11-release-v1-20-5-1/#api-and-web-endpoint-vulnerable-to-manually-crafted-identifiers

(cherry picked from commit 52f50792606a22cbf1e144e1bd480984abf6f53f)
(cherry picked from commit 65b942fa1e)
(cherry picked from commit e140c5c983)
(cherry picked from commit 4d108fa1cf)
(cherry picked from commit 9430badc5c)
(cherry picked from commit 1e67f4665d)
(cherry picked from commit 992e0d3218)
(cherry picked from commit 0e25ca17f3)
(cherry picked from commit 3c7d9769fa)

Conflicts:
	tests/integration/issue_test.go
	https://codeberg.org/forgejo/forgejo/pulls/2119
(cherry picked from commit f6bdf76a1d)
(cherry picked from commit a5e527f872)
(cherry picked from commit be3f9a28a1)
(cherry picked from commit 836a95eab8)
2024-02-05 16:09:41 +01:00
Loïc Dachary efbe483057
[GITEA] test POST /{username}/{reponame}/{tags,release}/delete
Refs: https://forgejo.org/2023-11-release-v1-20-5-1/#api-and-web-endpoint-vulnerable-to-manually-crafted-identifiers

(cherry picked from commit 78dcbb62fe87abe044034d880c9e8c22b44c2c98)
(cherry picked from commit 6707c08c17)
(cherry picked from commit 68da5a9cd8)
(cherry picked from commit c27fb08cb0)
(cherry picked from commit f15a2c558a)
(cherry picked from commit 8eb3ae6939)
(cherry picked from commit d54d5952f2)
(cherry picked from commit ce22d57485)
(cherry picked from commit bfc110ba33)
(cherry picked from commit 1fb3d555d9)
(cherry picked from commit 859c2275db)
(cherry picked from commit b21cf2567a)
(cherry picked from commit 8b9d75974f)
2024-02-05 16:09:41 +01:00
Gusted 7022378173
[GITEA] Add cancel button to wiki
- Add a cancel button to the Edit and New wiki pages.
- Resolves https://codeberg.org/forgejo/forgejo/issues/705

(cherry picked from commit 3284f690ea)
(cherry picked from commit 9f8bf83b0e)
(cherry picked from commit bfd03a9f30)
(cherry picked from commit 6b5d5e0cf7)
(cherry picked from commit 3ef3ec0d82)
(cherry picked from commit 5ae55325ef)
(cherry picked from commit f0894ae003)
(cherry picked from commit 18564b26f6)
(cherry picked from commit 06c130fd1f)
(cherry picked from commit c7e595f903)
(cherry picked from commit 72b2e7e0d4)
2024-02-05 16:09:40 +01:00
Antonin Delpeuch 6338fe8bef
[GITEA] oauth2: use link_account page when email/username is missing (#1757)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1757
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
(cherry picked from commit 0f6e0f9035)
(cherry picked from commit 779168a572)
(cherry picked from commit 29a2457321)
(cherry picked from commit a1edc2314d)
(cherry picked from commit cd01594610)
(cherry picked from commit 74db46b0f5)
(cherry picked from commit fd98f55204)
(cherry picked from commit 3099d0e281)
(cherry picked from commit 9fbbe61364)
(cherry picked from commit 8c00565006)
(cherry picked from commit 0977a1ed75)
2024-02-05 16:09:40 +01:00
Gusted 4d76bbeda7
[GITEA] Accept shorter commit IDs in web route
- Be more liberal in what Forgejo accepts, by reducing the minimum
amount of characters for SHA to 4 characters, which is the minimum
amount that  Git needs in order to figure out which commit was meant.
- It's safe to reduce this requirements, as commits are passed to Git
which will error if the given commit ID results in more than one Git
object. Forgejo will catch this error as that the Commit doesn't exist,
which is a error that's already being handled in most places gracefully.
- Added integration testing.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1760

(cherry picked from commit 0d655c7384)
(cherry picked from commit 9b9aca2a02)
(cherry picked from commit 0d0ab1af1f)
(cherry picked from commit d3b352c854)
(cherry picked from commit d6af2094df)
(cherry picked from commit f96e55a7a9)
(cherry picked from commit bb6261f847)
(cherry picked from commit f6a4146161)
(cherry picked from commit ed02921379)

Conflicts:
	routers/web/web.go
	https://codeberg.org/forgejo/forgejo/pulls/2214
(cherry picked from commit 768377cb02)
(cherry picked from commit 2cebe3ef94)
2024-02-05 16:09:40 +01:00
Gusted 6f8fc9392c
[GITEA] Add noreply email address as verified for SSH signed Git commits
- When someone really wants to avoid sharing their email, they could
configure git to use the noreply email for git commits. However if they
also wanted to use SSH signing, it would not show up as verified as the
noreply email address was technically not an activated email address for
the user.
- Add unit tests for the `ParseCommitWithSSHSignature` function.
- Resolves https://codeberg.org/Codeberg/Community/issues/946

(cherry picked from commit 1685de7eba)
(cherry picked from commit b1e8858de9)
(cherry picked from commit 1a6bf24d28)
(cherry picked from commit 0122943345)
(cherry picked from commit cc83614853)
(cherry picked from commit 429febe0dc)
(cherry picked from commit 58a9c2ebe9)
(cherry picked from commit fef94aff1c)
(cherry picked from commit 5c6ecd7579)
(cherry picked from commit ffa33a82bf)
(cherry picked from commit a97de1d5bb)
(cherry picked from commit 57ab2b4a40)
2024-02-05 16:09:40 +01:00
Gusted 295cd6be94
[GITEA] Use existing error functionality
- There's no need to use `github.com/pkg/errors` when the standard
library already has the functionality to wrap and create errors.

(cherry picked from commit 40f603a538)
(cherry picked from commit aa68a2753f)
(cherry picked from commit 48e252d739)
(cherry picked from commit cc6f40ccd2)
(cherry picked from commit 03c4b97358)
(cherry picked from commit f25eeb7695)
(cherry picked from commit 989d8fa1cb)
(cherry picked from commit 10e890ed8e)
(cherry picked from commit 581519389d)
(cherry picked from commit 03d00b11ac)
(cherry picked from commit 04e6c853d4)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/2249
(cherry picked from commit 2c4c29f7bc)
2024-02-05 16:09:40 +01:00
Gusted 62f866de99
[GITEA] Add repo empty check for branch feed
- If you attempted to get a branch feed on a empty repository, it would
result in a panic as the code expects that the branch exists.
- `context.RepoRefByType` would normally already 404 if the branch
doesn't exist, however if a repository is empty, it would not do this
check.
- Fix bug where `/atom/branch/*` would return a RSS feed.

(cherry picked from commit d27bcd98a4)
(cherry picked from commit c58566403d)
(cherry picked from commit b8b3f6ab8b)
(cherry picked from commit 195520100b)
(cherry picked from commit 6e417087dd)
(cherry picked from commit ff91e5957a)
(cherry picked from commit 6626d5cc75)
(cherry picked from commit 62f8ab793b)
(cherry picked from commit e5bbf1a2d0)
(cherry picked from commit f5b8c8edea)
(cherry picked from commit 50948fa11b)
(cherry picked from commit 83a9f7f442)
(cherry picked from commit 679438b5d6)
(cherry picked from commit 17db07d6d0)
2024-02-05 16:09:40 +01:00
Grigory Kirillov 8c0cbd3549
[GITEA] convert feed items' titles to plain text
Refs: https://codeberg.org/forgejo/forgejo/pulls/1595

(cherry picked from commit 35b962e631)
(cherry picked from commit 1004e35b84)
(cherry picked from commit af51dd594d)
(cherry picked from commit ef10fae296)
(cherry picked from commit ff8027ed1b)
(cherry picked from commit 2540ff52ef)
(cherry picked from commit 57b4d775e1)
(cherry picked from commit c388aba9b5)
(cherry picked from commit 7a3b605c11)
(cherry picked from commit cc02354d0a)
(cherry picked from commit e11c5ce82a)
(cherry picked from commit d1e7798bb2)
(cherry picked from commit 1813af7391)
(cherry picked from commit 0d55a88945)
(cherry picked from commit bd9ac9ac6f)
(cherry picked from commit 3794698320)
(cherry picked from commit 0f22c4be84)
2024-02-05 16:09:40 +01:00
Gusted 92413041bd
[GITEA] Use maintained gziphandler
- https://github.com/NYTimes/gziphandler doesn't seems to be maintained
anymore and Forgejo already includes
https://github.com/klauspost/compress which provides a maintained and
faster gzip handler fork.
- Enables Jitter to prevent BREACH attacks, as this *seems* to be
possible in the context of Forgejo.

(cherry picked from commit cc2847241d)
(cherry picked from commit 99ba56a876)

Conflicts:
	go.sum
	https://codeberg.org/forgejo/forgejo/pulls/1581
(cherry picked from commit 711638193d)
(cherry picked from commit 9c12a37fde)
(cherry picked from commit d130653454)
(cherry picked from commit 45a16f8c3c)
(cherry picked from commit a497acb31f)
(cherry picked from commit fe87fd8289)
(cherry picked from commit 6ac12e6693)
(cherry picked from commit 981ec37e1e)
(cherry picked from commit 5d6892ec10)
(cherry picked from commit 9df7968f4f)
(cherry picked from commit 7d588d1833)

Conflicts:
	routers/web/web.go
	https://codeberg.org/forgejo/forgejo/pulls/2075
(cherry picked from commit defb101281)
(cherry picked from commit 5830f204a1)
(cherry picked from commit 029f4e9863)
(cherry picked from commit 816fe55812)

Conflicts:
	go.sum
	https://codeberg.org/forgejo/forgejo/pulls/2249
(cherry picked from commit 99866d8045)
2024-02-05 16:09:40 +01:00
Gusted 662c8ee341
[GITEA] Use existing jsonschema library
- Use the 'existing' jsonschema library for the nodeinfo integration test.

(cherry picked from commit 73864840f2)
(cherry picked from commit da36df306b)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/1581
(cherry picked from commit 2b4ab46d8e)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/1617
(cherry picked from commit 8064130344)
(cherry picked from commit 0ccefc633e)
(cherry picked from commit 19e647b531)
(cherry picked from commit 2bcc04889d)
(cherry picked from commit 2fd1932699)
(cherry picked from commit b9a3e1e525)
(cherry picked from commit 92d932d23f)
(cherry picked from commit c125217fea)
(cherry picked from commit f9801ba57b)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/2034
(cherry picked from commit 2558a8a764)
(cherry picked from commit f53b2d3112)
(cherry picked from commit c098055f0a)
(cherry picked from commit 0e1591554a)
(cherry picked from commit 876d9d5c6f)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/2249
(cherry picked from commit 7110bb6a78)
2024-02-05 16:09:40 +01:00
Gusted b896a87103
[GITEA] Make atomic ssh keys replacement robust
- After stumbling upon https://github.com/golang/go/issues/22397 and
reading the implementations I realized that Forgejo code doesn't have
`Sync()` and it doesn't properly error handle the `Close` function.
- (likely) Resolves https://codeberg.org/forgejo/forgejo/issues/1446

(cherry picked from commit 0efcb334c2)
(cherry picked from commit 04ef02c0dd)
(cherry picked from commit 85f2065c9b)
(cherry picked from commit 8d36b5cce6)
(cherry picked from commit 378dc30fb5)
(cherry picked from commit 2b28bf826e)
(cherry picked from commit d0625a001e)
(cherry picked from commit f161a4f60f)
(cherry picked from commit 7430ca43e5)
(cherry picked from commit ab6d38daf7)
(cherry picked from commit 0f703fd02e)
(cherry picked from commit 6931a8f6bb)
(cherry picked from commit 5e2065c1c0)
(cherry picked from commit 38c812acff)
(cherry picked from commit 494874e23f)
(cherry picked from commit d396b7fd47)
(cherry picked from commit 7babc6efe1)
(cherry picked from commit 2d4dbbe741)
2024-02-05 16:09:40 +01:00
Gusted fa37a211fb
[GITEA] Drop sha256-simd in favor of stdlib
- In Go 1.21 the crypto/sha256 [got a massive
improvement](https://go.dev/doc/go1.21#crypto/sha256) by utilizing the
SHA instructions for AMD64 CPUs, which sha256-simd already was doing.
The performance is now on par and I think it's preferable to use the
standard library rather than a package when possible.

```
cpu: AMD Ryzen 5 3600X 6-Core Processor
                │  simd.txt   │               go.txt                │
                │   sec/op    │    sec/op     vs base               │
Hash/8Bytes-12    63.25n ± 1%    73.38n ± 1%  +16.02% (p=0.002 n=6)
Hash/64Bytes-12   98.73n ± 1%   105.30n ± 1%   +6.65% (p=0.002 n=6)
Hash/1K-12        567.2n ± 1%    572.8n ± 1%   +0.99% (p=0.002 n=6)
Hash/8K-12        4.062µ ± 1%    4.062µ ± 1%        ~ (p=0.396 n=6)
Hash/1M-12        512.1µ ± 0%    510.6µ ± 1%        ~ (p=0.485 n=6)
Hash/5M-12        2.556m ± 1%    2.564m ± 0%        ~ (p=0.093 n=6)
Hash/10M-12       5.112m ± 0%    5.127m ± 0%        ~ (p=0.093 n=6)
geomean           13.82µ         14.27µ        +3.28%

                │   simd.txt   │               go.txt                │
                │     B/s      │     B/s       vs base               │
Hash/8Bytes-12    120.6Mi ± 1%   104.0Mi ± 1%  -13.81% (p=0.002 n=6)
Hash/64Bytes-12   618.2Mi ± 1%   579.8Mi ± 1%   -6.22% (p=0.002 n=6)
Hash/1K-12        1.682Gi ± 1%   1.665Gi ± 1%   -0.98% (p=0.002 n=6)
Hash/8K-12        1.878Gi ± 1%   1.878Gi ± 1%        ~ (p=0.310 n=6)
Hash/1M-12        1.907Gi ± 0%   1.913Gi ± 1%        ~ (p=0.485 n=6)
Hash/5M-12        1.911Gi ± 1%   1.904Gi ± 0%        ~ (p=0.093 n=6)
Hash/10M-12       1.910Gi ± 0%   1.905Gi ± 0%        ~ (p=0.093 n=6)
geomean           1.066Gi        1.032Gi        -3.18%
```

(cherry picked from commit abd94ff5b5)
(cherry picked from commit 15e81637ab)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/1581
(cherry picked from commit 325d92917f)

Conflicts:
	modules/context/context_cookie.go
	https://codeberg.org/forgejo/forgejo/pulls/1617
(cherry picked from commit 358819e895)
(cherry picked from commit 362fd7aae1)
(cherry picked from commit 4f64ee294e)
(cherry picked from commit 4bde77f7b1)
(cherry picked from commit 1311e30a81)
(cherry picked from commit 57b69e334c)
(cherry picked from commit 52dc892fad)
(cherry picked from commit 77f54f4187)
(cherry picked from commit 0d0392f3a5)

Conflicts:
	go.mod
	https://codeberg.org/forgejo/forgejo/pulls/2034
(cherry picked from commit 92798364e8)
(cherry picked from commit 43d2181277)
(cherry picked from commit 45c88b86a3)
(cherry picked from commit a1cd6f4e3a)
(cherry picked from commit 01191dc2ad)
(cherry picked from commit 151e07f37e)
2024-02-05 16:09:40 +01:00
rome-user ee70e910df
[GITEA] fix indentation in Maven package install instructions
The installation instructions of a Maven package places the `url` child
of the `repository` node in an extra indentation level. This indentation
is unnecesary since both the `id` and `url` nodes are direct children of
the `repository` node.

This commit removes the unnecessary indentation.

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

(cherry picked from commit 82f0ddad7b)
(cherry picked from commit 905e546549)
(cherry picked from commit 4e58ab82b7)
(cherry picked from commit 2f207e7deb)
(cherry picked from commit 3b8cc8ad2c)
(cherry picked from commit ca8565450c)
(cherry picked from commit df5ed97ed0)
(cherry picked from commit fc1e529894)
(cherry picked from commit ef8810c09d)
(cherry picked from commit a2d1459c4d)
(cherry picked from commit 30e0d7bff0)
(cherry picked from commit ccb9ed98b9)
(cherry picked from commit 3782794fb4)
(cherry picked from commit 9e7d5b5de9)
(cherry picked from commit 50687eaebe)
(cherry picked from commit 28ae93f18e)
(cherry picked from commit e59f467284)
(cherry picked from commit 5e24444bfa)
2024-02-05 16:09:40 +01:00
Gusted a5b1c1b0b3
[GITEA] Detect file rename and show in history
- Add a indication to the file history if the file has been renamed,
this indication contains a link to browse the history of the file
further.
- Added unit testing.
- Added integration testing.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1279

(cherry picked from commit 72c297521b)
(cherry picked from commit 283f964894)

Conflicts:
	options/locale/locale_en-US.ini
	https://codeberg.org/forgejo/forgejo/pulls/1550
(cherry picked from commit 7c30af7fde)
(cherry picked from commit f3be6eb269)
(cherry picked from commit 78e1755b94)
(cherry picked from commit 73799479e0)
(cherry picked from commit 938359b941)
(cherry picked from commit b168a9c081)

[GITEA] Detect file rename and show in history (squash) ctx.Locale

(cherry picked from commit 40447752ff)
(cherry picked from commit ea23594cdb)
(cherry picked from commit cdc473850c)
(cherry picked from commit 86e6641c29)
(cherry picked from commit 2757de586b)
(cherry picked from commit def4ae32dd)
(cherry picked from commit 6dada09329)
(cherry picked from commit 5d6d527251)

Conflicts:
	tests/integration/repo_test.go
	https://codeberg.org/forgejo/forgejo/pulls/2119
(cherry picked from commit d3c1bce7db)
(cherry picked from commit 04bcb22d5c)
(cherry picked from commit e16241fd99)
(cherry picked from commit 8e2beb3ed5)
2024-02-05 16:09:40 +01:00
Gusted 773ade3b5f
[GITEA] Skip unsupported code comment
- If there's a code comment that's received during the migration that
contains no diffhunk, skip it. This either means it was commenting on
old diffhunk or it's just a general codecomment. Forgejo supports
neither of such type of code comment.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1407

(cherry picked from commit ae463c7c55)
(cherry picked from commit bf48f02a86)
(cherry picked from commit 10c3f102fa)
(cherry picked from commit 828b4cc10c)
(cherry picked from commit 6427fa65b6)
(cherry picked from commit 5b7a43c43f)
(cherry picked from commit 4eef0fce72)
(cherry picked from commit a46192a4a6)
(cherry picked from commit 107a9b8233)
(cherry picked from commit 308251fc48)
(cherry picked from commit 017c4a53c5)
(cherry picked from commit 4534a3393b)
(cherry picked from commit 74e0c1663d)
(cherry picked from commit 9b17353f85)
(cherry picked from commit 09b6f58304)
(cherry picked from commit bc649733a1)
(cherry picked from commit f1d4c783e2)
(cherry picked from commit d6850bc308)
(cherry picked from commit 21230d2d24)
(cherry picked from commit 569b278382)
2024-02-05 16:09:40 +01:00
Gusted 23e4c19d42
[GITEA] Tidy up archive modal
- Make it consistent with the other modals of the dangerous actions.

(cherry picked from commit 576d7ec759)
(cherry picked from commit 8b1225f974)
(cherry picked from commit c2c47972ee)
(cherry picked from commit eec301806b)
(cherry picked from commit 6b5e728f0a)
(cherry picked from commit 3681691e65)
(cherry picked from commit e39dfa550d)
(cherry picked from commit 0c78c8c5ac)
(cherry picked from commit 661cf72db0)

[GITEA] Tidy up archive modal (squash) ctx.Locale

(cherry picked from commit 4bb6ee71f0)
(cherry picked from commit ddafd8fbe3)
(cherry picked from commit 9467a6915f)
(cherry picked from commit e632b10380)
(cherry picked from commit 6609d07591)
(cherry picked from commit c130b8a09a)
(cherry picked from commit 1080de5754)
(cherry picked from commit a9813744d4)
(cherry picked from commit 93232f410a)
(cherry picked from commit 1bf1c6b6c1)
(cherry picked from commit cb703ac292)
(cherry picked from commit ac48797029)
2024-02-05 16:09:40 +01:00
Aravinth Manivannan 2d06901a18
[GITEA] notifies admins on new user registration
Sends email with information on the new user (time of creation and time of last sign-in) and a link to manage the new user from the admin panel

closes: https://codeberg.org/forgejo/forgejo/issues/480

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1371
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
Co-committed-by: Aravinth Manivannan <realaravinth@batsense.net>
(cherry picked from commit c721aa828b)
(cherry picked from commit 6487efcb9d)

Conflicts:
	modules/notification/base/notifier.go
	modules/notification/base/null.go
	modules/notification/notification.go
	https://codeberg.org/forgejo/forgejo/pulls/1422
(cherry picked from commit 7ea66ee1c5)

Conflicts:
	services/notify/notifier.go
	services/notify/notify.go
	services/notify/null.go
	https://codeberg.org/forgejo/forgejo/pulls/1469
(cherry picked from commit 7d2d997011)
(cherry picked from commit 435a54f140)
(cherry picked from commit 8ec7b3e448)

[GITEA] notifies admins on new user registration (squash) performance bottleneck

Refs: https://codeberg.org/forgejo/forgejo/issues/1479
(cherry picked from commit 97ac9147ff)
(cherry picked from commit 19f295c16b)
(cherry picked from commit 3367dcb2cf)

[GITEA] notifies admins on new user registration (squash) cosmetic changes

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 9f1670e040)
(cherry picked from commit de5bb2a224)
(cherry picked from commit 8f8e52f31a)
(cherry picked from commit e0d5130312)
(cherry picked from commit f1288d6d9b)
(cherry picked from commit 1db4736fd7)
(cherry picked from commit e8dcbb6cd6)
(cherry picked from commit 09625d6476)

[GITEA] notifies admins on new user registration (squash) ctx.Locale

(cherry picked from commit dab7212fad)
(cherry picked from commit 9b7bbae8c4)
(cherry picked from commit f750b71d3d)
(cherry picked from commit f79af36679)
(cherry picked from commit e76eee334e)

[GITEA] notifies admins on new user registration (squash) fix locale

(cherry picked from commit 54cd100d8d)
(cherry picked from commit 053dbd3d50)

[GITEA] notifies admins on new user registration (squash) fix URL

1. Use absolute URL in the admin panel link sent on new registrations
2. Include absolute URL of the newly signed-up user's profile.

New email looks like this:

<details><summary>Please click to expand</summary>

```
--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

User Information: @realaravinth ( http://localhost:3000/realaravinth )
----------------------------------------------------------------------

* Created: 2023-12-13 19:36:50 +05:30

Please click here ( http://localhost:3000/admin/users/9 ) to manage the use=
r from the admin panel.
--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
	<title>New user realaravinth just signed up</title>

	<style>
		blockquote { padding-left: 1em; margin: 1em 0; border-left: 1px solid gre=
y; color: #777}
		.footer { font-size:small; color:#666;}
	</style>

</head>

<body>
	<ul>
		<h3>User Information: <a href=3D"http://localhost:3000/realaravinth">@rea=
laravinth</a></h3>
		<li>Created: <relative-time format=3D"datetime" weekday=3D"" year=3D"nume=
ric" month=3D"short" day=3D"numeric" hour=3D"numeric" minute=3D"numeric" se=
cond=3D"numeric" datetime=3D"2023-12-13T19:36:50+05:30">2023-12-13 19:36:50=
 +05:30</relative-time></li>
	</ul>
	<p> Please <a href=3D"http://localhost:3000/admin/users/9" rel=3D"nofollow=
">click here</a> to manage the user from the admin panel. </p>
</body>
</html>

--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770--
```

</details>

fixes: https://codeberg.org/forgejo/forgejo/issues/1927
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1940
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
Co-committed-by: Aravinth Manivannan <realaravinth@batsense.net>
(cherry picked from commit b8d764e36a)
(cherry picked from commit d48b84f623)

Conflicts:
	routers/web/auth/auth.go
	https://codeberg.org/forgejo/forgejo/pulls/2034
(cherry picked from commit 02d3c125cc)
(cherry picked from commit 367374ecc3)

Conflicts:
	models/user/user_test.go
	https://codeberg.org/forgejo/forgejo/pulls/2119
(cherry picked from commit 4124fa5aa4)
(cherry picked from commit 7f12610ff6)

[GITEA] notifies admins on new user registration (squash) DeleteByID

trivial conflict because of
   778ad795fd Refactor deletion (#28610)

(cherry picked from commit 05682614e5)
(cherry picked from commit 64bd374803)
(cherry picked from commit 63d086f666)
(cherry picked from commit 3cd48ef4d5)

Conflicts:
	options/locale/locale_en-US.ini
	https://codeberg.org/forgejo/forgejo/pulls/2249
(cherry picked from commit 6578ec4ed6)

Conflicts:
	routers/web/auth/auth.go
	https://codeberg.org/forgejo/forgejo/pulls/2300
2024-02-05 16:09:28 +01:00
Earl Warren 3df243ca41
[GITEA] [picture].*AVATAR_UPLOAD_PATH is legacy
(cherry picked from commit cb4cc01825)
(cherry picked from commit bef11d6131)
(cherry picked from commit 077b1c52b6)
(cherry picked from commit aff7aa0858)
(cherry picked from commit d2f8f6eacb)
(cherry picked from commit 476bd3c491)
(cherry picked from commit 2b39e973be)
(cherry picked from commit 822f25de53)
(cherry picked from commit ed941b0e60)
(cherry picked from commit ac6c5ddb2a)
(cherry picked from commit 52b8e33612)
(cherry picked from commit 1c7d1427d2)
(cherry picked from commit 1caa855c6d)
(cherry picked from commit 55a04f5a9a)
(cherry picked from commit 31124e8818)
(cherry picked from commit 9415f18e70)
(cherry picked from commit 358222a7d3)
(cherry picked from commit b6a9826552)
(cherry picked from commit bc19168948)
(cherry picked from commit eb1378b843)
(cherry picked from commit 0d85b87825)
(cherry picked from commit 80e03544ec)
2024-02-05 16:05:50 +01:00
zareck cd0ac59140
[GITEA] add GitHub repo migration test
Signed-off-by: zareck <cassiomilczareck@gmail.com>
(cherry picked from commit f48e3ff0db)

Removing comments and make command

(cherry picked from commit 7664a423a5)
(cherry picked from commit b2fb435364)
(cherry picked from commit 0a24a819a9)
(cherry picked from commit 155cc19f75)
(cherry picked from commit 223537f71a)
(cherry picked from commit ffbe2970cc)
(cherry picked from commit 836836bd73)
(cherry picked from commit 6b66fe449d)
(cherry picked from commit a3933d9c3a)
(cherry picked from commit f1a49065f2)
(cherry picked from commit 63f4935e7d)
(cherry picked from commit a1acdd76e6)
(cherry picked from commit 7f90256804)
(cherry picked from commit 73620b0e8e)
(cherry picked from commit 587540c818)
(cherry picked from commit 434d5366ac)
(cherry picked from commit e80e193af4)
(cherry picked from commit eb9be4cee6)
(cherry picked from commit f81cfdc935)
(cherry picked from commit ba69a943cb)
(cherry picked from commit ea9bc88248)
(cherry picked from commit ba02501caf)
(cherry picked from commit 53ce632aad)
2024-02-05 16:05:50 +01:00
Gusted 6bec246983
[GITEA] Use vertical tabs on issue filters
- This is actually https://github.com/go-gitea/gitea/pull/19978 &
https://github.com/go-gitea/gitea/pull/19486 but was removed in one of
the UI refactors of v1.20
- This is a very technical fix and is best explained in the CSS
comments. But the short version: When there's an overflow being set, but
you want an element to 'break out' of that overflow with `position:
absolute`, it sometimes doesn't work! You need to set some CSS to let
the browser know that the element needs to use an element outside of
that overflow as 'clip parent'.
- Resolves my internal frustration with the mobile UI constantly getting broken.

(cherry picked from commit 879f842bed)
(cherry picked from commit 6099c9b41b)
(cherry picked from commit 0749d00b16)
(cherry picked from commit ec6a5428a7)
(cherry picked from commit 9d0bee784d)
(cherry picked from commit 61d6ae4882)
(cherry picked from commit 8b3f3639b6)
(cherry picked from commit 2c600ddb2c)
(cherry picked from commit 960a9786ef)
(cherry picked from commit b194354c3b)
(cherry picked from commit 8e7915ee8c)
(cherry picked from commit ba82b0c6fe)
(cherry picked from commit b2dfb233a8)
(cherry picked from commit ff3ec7f612)
(cherry picked from commit ef01240cc7)
(cherry picked from commit 7778b5bb10)
(cherry picked from commit 5f949b1b07)
(cherry picked from commit b387209690)
(cherry picked from commit 5d7e3a542e)
(cherry picked from commit ffef2231fb)
(cherry picked from commit c74cf73ab4)
(cherry picked from commit 4aa9e9fca4)
(cherry picked from commit 6b0dab3ba0)
(cherry picked from commit 374612f61b)
2024-02-05 16:05:50 +01:00
Gusted 664192767c
[GITEA] Add slow SQL query warning
- Databases are one of the most important parts of Forgejo, every
interaction with Forgejo uses the database in one way or another.
Therefore, it is important to maintain the database and recognize when
Forgejo is not doing well with the database. Forgejo already has the
option to log *every* SQL query along with its execution time, but
monitoring becomes impractical for larger instances and takes up
unnecessary storage in the logs.
- Add a QoL enhancement that allows instance administrators to specify a
threshold value beyond which query execution time is logged as a warning
in the xorm logger. The default value is a conservative five seconds to
avoid this becoming a source of spam in the logs.
- The use case for this patch is that with an instance the size of Codeberg, monitoring SQL logs is not very fruitful and most of them are uninteresting. Recently, in the context of persistent deadlock issues (https://codeberg.org/forgejo/forgejo/issues/220), I have noticed that certain queries hold locks on tables like comment and issue for several seconds. This patch helps to identify which queries these are and when they happen.
- Added unit test.

(cherry picked from commit 24bbe7886f)
(cherry picked from commit 6e29145b3c)
(cherry picked from commit 63731e3071)
(cherry picked from commit 3ce1a09736)
(cherry picked from commit a64426907d)
(cherry picked from commit 4b19215691)
(cherry picked from commit e635674435)
(cherry picked from commit 9cf501f1af)
(cherry picked from commit 0d6b934eba)
(cherry picked from commit 4b6c273879)
(cherry picked from commit 89b1315338)
(cherry picked from commit edd8e66ce9)

[GITEA] Add slow SQL query warning (squash) document the setting

(cherry picked from commit ce38599c51)
(cherry picked from commit 794aa67c68)
(cherry picked from commit a4c2c6b004)
(cherry picked from commit 97912752bc)
(cherry picked from commit 00b5327c97)
(cherry picked from commit 1069c860e7)
(cherry picked from commit 84241f42c8)
(cherry picked from commit e4bda0e845)
(cherry picked from commit 7357fb91bf)
(cherry picked from commit a8dd7f6da2)
(cherry picked from commit e636e9f4be)
(cherry picked from commit bf04ae8603)
(cherry picked from commit 93b19e3568)
(cherry picked from commit 83f91363ad)
(cherry picked from commit e34a05bc73)
(cherry picked from commit 68569aeee9)
2024-02-05 16:05:50 +01:00
Gusted 23d32eb493
[GITEA] Improve HTML title on repositories
- The `<title>` element that lives inside the `<head>` element is an important element that gives browsers and search engine crawlers the title of the webpage, hence the element name. It's therefor important that this title is accurate.
- Currently there are three issues with titles on repositories. It doesn't use the `FullName` and instead only uses the repository name, this doesn't distinguish which user or organisation the repository is on. It doesn't show the full treepath in the title when visiting an file inside a directory and instead only uses the latest path in treepath. It can show the repository name twice if the `.Title` variable also included the repository name such as on the repository homepage.
- Use the repository's fullname (which include which user the repository is on) instead of just their name.
- Display the repository's fullname if it isn't already in `.Title`.
- Use the full treepath in the repository code view instead of just the
last path.
- Adds integration tests.
- Adds a new repository (`repo59`) that has 3 depths for folders, which
wasn't in any other fixture repository yet, so the full treepath for
could be properly tested.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1276

(cherry picked from commit ff9a6a2cda)
(cherry picked from commit 76dffc8621)
(cherry picked from commit ff0615b9d0)
(cherry picked from commit 8712eaa394)
(cherry picked from commit 0c11587582)
(cherry picked from commit 3cbd9fb792)

Conflicts:
	tests/integration/repo_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1512
(cherry picked from commit fbfdba8ae9)

Conflicts:
	models/fixtures/release.yml
	https://codeberg.org/forgejo/forgejo/pulls/1550
(cherry picked from commit 8b2bf0534c)
(cherry picked from commit d706d9e222)
(cherry picked from commit 6d46261a3f)
(cherry picked from commit f864d18ad3)
(cherry picked from commit 80f8620d0d)

[GITEA] Improve HTML title on repositories (squash) do not double escape

(cherry picked from commit 22882fe25c)
(cherry picked from commit 63e99df3d1)
(cherry picked from commit b65d777bc7)
(cherry picked from commit 2961f4f632)
(cherry picked from commit f7f723628c)
(cherry picked from commit 9ed7915826)
(cherry picked from commit 8b9ead4608)
(cherry picked from commit 50eeaf1fbc)
(cherry picked from commit ee6f32820e)
(cherry picked from commit bf337bed35)
(cherry picked from commit 6be9501ec0)
(cherry picked from commit b39860570d)
(cherry picked from commit 3f30f486d5)
(cherry picked from commit 5680ecdbe9)
(cherry picked from commit da6a19ad16)
(cherry picked from commit 5462493a77)
(cherry picked from commit 530fe57dde)
(cherry picked from commit f174f35644)

Conflicts:
	models/fixtures/repository.yml
	https://codeberg.org/forgejo/forgejo/pulls/2214
(cherry picked from commit 75212b3a59)
(cherry picked from commit 6e3c0be555)
2024-02-05 16:05:50 +01:00
Gusted c237ab9f18
[GITEA] Allow release creation on commit
- The code and tests are already there to allow releases to be created
on commits.
- This patch modifies the web code to take into account that an commitID
could've been passed as target.
- Added unit test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1196

(cherry picked from commit 90863e0ab5)
(cherry picked from commit c805aa23b5)
(cherry picked from commit cf45567ca6)
(cherry picked from commit 672a2b91e5)
(cherry picked from commit 82c930152c)
(cherry picked from commit 95ac2508b3)
(cherry picked from commit b13a81ab98)
(cherry picked from commit 9f463a7c1f)
(cherry picked from commit 758ce84dc5)

Conflicts:
	tests/integration/release_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1550
(cherry picked from commit edf0531aee)
(cherry picked from commit 44b29f3a1d)
(cherry picked from commit b851b67419)
(cherry picked from commit 37b408f5aa)
(cherry picked from commit e81dbedb88)
(cherry picked from commit d5fa6be6ec)
(cherry picked from commit b8c4be2529)
(cherry picked from commit f23ce2843c)
(cherry picked from commit 8b7bcabae2)
(cherry picked from commit 2d6e52dda9)
(cherry picked from commit 42e4f3ffdd)
(cherry picked from commit 39a1f689d8)
(cherry picked from commit 553d4872f8)
(cherry picked from commit df37433725)
(cherry picked from commit d67eac487b)
(cherry picked from commit 28cb0b1912)
(cherry picked from commit 031c04c579)
2024-02-05 16:05:50 +01:00
Gusted d3f9808151
[GITEA] Add password length check on install page
- Resolves #271
- Ensure that the adminstrator password is at least `MIN_PASSWORD_LENGTH`.

(cherry picked from commit 28cb04c3f5)
(cherry picked from commit 95371ebd92)
(cherry picked from commit a134288ab6)
(cherry picked from commit 4202f052cb)
(cherry picked from commit 510b7467d3)
(cherry picked from commit f3a6e1f121)
(cherry picked from commit f340508819)
(cherry picked from commit b891bb176d)
(cherry picked from commit 1a1bfc38cc)
(cherry picked from commit 083d5aefed)
(cherry picked from commit 4586096be9)
(cherry picked from commit 039fa20cc8)
(cherry picked from commit 3ec9cb5f59)
(cherry picked from commit 00be0eee37)
(cherry picked from commit a156603002)
(cherry picked from commit 4d305e7774)
(cherry picked from commit 51e8f21202)
(cherry picked from commit 58e354c98e)
(cherry picked from commit 20405564f5)
(cherry picked from commit 1d7f495683)
(cherry picked from commit d457b9c911)
(cherry picked from commit 72b54bc4cc)
(cherry picked from commit d7ce723e35)
(cherry picked from commit ce5f863d5d)
(cherry picked from commit 324b9318ac)
(cherry picked from commit fff11fc535)
(cherry picked from commit d3fa04aa69)
(cherry picked from commit d3b24691f3)
(cherry picked from commit 736dfab3ae)
(cherry picked from commit 8be95ef7f4)
(cherry picked from commit 0ce04d93a8)
2024-02-05 16:05:50 +01:00
Panagiotis "Ivory" Vasilopoulos ee26f86bfc
[GITEA] add option for banning dots in usernames
Refs: https://codeberg.org/forgejo/forgejo/pulls/676

Author:    Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Date:      Mon Jun 12 13:57:01 2023 +0200

Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit fabdda5c6e)
(cherry picked from commit d2c7f45621)
(cherry picked from commit dfdbaba3d6)
(cherry picked from commit a3cda092b8)
(cherry picked from commit f0fdb5905c)
(cherry picked from commit 9697e48c1f)
(cherry picked from commit 46e31009a8)
(cherry picked from commit 5bb2c54b6f)
(cherry picked from commit 682f9d24e1)
(cherry picked from commit 1863481005)
(cherry picked from commit 4f1b7c4ddb)
(cherry picked from commit 6afe70bbf1)
(cherry picked from commit 5cec1d9c2d)

Conflicts:
	templates/admin/config.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1512
(cherry picked from commit de2d172473)
(cherry picked from commit 37a3172dd9)
(cherry picked from commit 92dfca0c5a)
(cherry picked from commit a713d59b0c)
(cherry picked from commit e7bd71a618)
(cherry picked from commit 69f3e952c4)
(cherry picked from commit 83fbb7b566)
(cherry picked from commit 3196605fa9)
(cherry picked from commit e37eb8de9c)
(cherry picked from commit 8c99f59e48)
(cherry picked from commit 74aa1ac66f)
(cherry picked from commit 622440b3bd)
(cherry picked from commit 2c1ec90984)
(cherry picked from commit 24d57152e0)
(cherry picked from commit 071e9013f3)
(cherry picked from commit 27fbb726fa)
(cherry picked from commit 29eddd86ea)
(cherry picked from commit 133dc72fab)
2024-02-05 16:05:50 +01:00
Earl Warren 7a89d321c8
[GITEA] silently ignore obsolete sudo scope
Fixes: https://codeberg.org/forgejo/forgejo/issues/820
(cherry picked from commit 6a7022ebbb)
(cherry picked from commit 764eac47b5)
(cherry picked from commit 1141eb7b6f)
(cherry picked from commit 826b6509b6)
(cherry picked from commit 9990d932b8)
(cherry picked from commit 7eca570743)
(cherry picked from commit 66e1d3f082)
(cherry picked from commit 188226a8e6)
(cherry picked from commit 4cd1bff25c)
(cherry picked from commit fad6b6d2c4)
(cherry picked from commit 5b25c3d851)
(cherry picked from commit 4746ece4dd)
(cherry picked from commit 2a6f85afb3)
(cherry picked from commit c027d724ee)
(cherry picked from commit be2f1eeaeb)
(cherry picked from commit 3058a54fe9)
(cherry picked from commit 53936d38a0)
(cherry picked from commit 311983cc97)
(cherry picked from commit 1651ae757b)
(cherry picked from commit d3dd8ea24d)
(cherry picked from commit 9a80326ff3)
(cherry picked from commit 66eb33235e)
(cherry picked from commit 769e24d5a8)
(cherry picked from commit 436cc21217)
(cherry picked from commit 817faca7f0)
(cherry picked from commit 80ee08aef1)
(cherry picked from commit 15f8885d0c)
(cherry picked from commit 0944a4442c)
(cherry picked from commit 91631d41b0)
(cherry picked from commit 0fbda3386f)
(cherry picked from commit a464b0e2ba)
(cherry picked from commit 0b98d50c92)
(cherry picked from commit 6365d4b761)
(cherry picked from commit 3af5715dbc)
2024-02-05 16:05:50 +01:00
JP 56c8f98e4c
[THEME] Add colorblind theme variants
This PR adds colorblind theme variants of the forgejo themes. I duplicated the forjego light and dark themes and only changed the lines related to diff colors for added and removed rows/words.

I am not a designer, and I am also colorblind, so better suggestions of colors are most welcome. However, this is a good start as I can at least personally see the colors now. I got the colors for the dark theme from the GitHub diff colors, the light ones I couldn't get from GitHub as they use white as a plain background, which Forgejo's theme doesn't, so they were decided on after a bit of random testing.

Resolves #986

(cherry picked from commit dcdb4a372d)
2024-02-05 16:05:02 +01:00
Earl Warren 88171e0030
[BRANDING] add Forgejo Git Service and migration UI
[FEAT] add Forgejo Git Service (squash) register a Forgejo factory

If the Forgejo factory for the Forgejo service is not registered,
newDownloader will fallback to a git service and not migrate issues
etc.

Refs: https://codeberg.org/forgejo/forgejo/issues/1678
(cherry picked from commit 51938cd161)

[FEAT] add Forgero Git Service

Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
(cherry picked from commit a878adfe62)

Adding description and Forgejo SVG

(cherry picked from commit 13738c0380)

Undo reordering and tmpl redirection

(cherry picked from commit 9ae51c46f4)
(cherry picked from commit 70fffdc61d)
(cherry picked from commit c0ebfa9da3)
(cherry picked from commit 9922c92787)
(cherry picked from commit 00c0effbc7)
(cherry picked from commit e4c9525b13)
(cherry picked from commit 09d7b83211)
(cherry picked from commit bbcd5975c9)
(cherry picked from commit 55c70a0e18)
(cherry picked from commit 76596410c0)
(cherry picked from commit 1308043931)
(cherry picked from commit 919d6aedfe)

[FEAT] add Forgero Git Service (squash) more tests

Previously only Gitea service was being tested under self-hosted migrations. Since Forgejo is also self-hosted and in fact use the same downloader/migrator we can add to this suite another test that will do the same, migrating the same repository under the same local instance but for the Forgejo service (represented by 9)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1709
Co-authored-by: zareck <cassiomilczareck@gmail.com>
Co-committed-by: zareck <cassiomilczareck@gmail.com>
(cherry picked from commit 40a4b8f1a8)
(cherry picked from commit 3198b4a642)
(cherry picked from commit 4edda1f389)
(cherry picked from commit 4d91b77d29)
(cherry picked from commit afe85c52e3)
(cherry picked from commit 5ea7df79ad)
(cherry picked from commit a667182542)
(cherry picked from commit a9bebb1e71)
(cherry picked from commit 4831a89e46)
(cherry picked from commit e02a74651f)
(cherry picked from commit 05dcef59aa)
(cherry picked from commit c8bac187f9)
(cherry picked from commit c87903a0cc)
2024-02-05 16:05:02 +01:00
Gusted bdc296793e
[BRANDING] security.txt
- The [security.txt](https://securitytxt.org/) is a standardized file to
help with reporting security vulnerabilities, by having the most essential
information served at `.well-known/security.txt`.
- Brand this file to point to the Forgejo security team.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1192

(cherry picked from commit 7ca1d0ec87)
(cherry picked from commit ba974b0161)
(cherry picked from commit 966fbcdcfd)
(cherry picked from commit 8b9efebc6e)
(cherry picked from commit 91b1c84c18)
(cherry picked from commit 30ade1ea0b)
(cherry picked from commit 15ec35014e)
(cherry picked from commit a5e8bb4a93)
(cherry picked from commit 273b03888f)
(cherry picked from commit 69b6b53fe5)
(cherry picked from commit e22a512fde)
(cherry picked from commit 958b3e4877)
(cherry picked from commit d1ad5daa51)
(cherry picked from commit a4868c4d79)
(cherry picked from commit ce4692d352)
(cherry picked from commit 7cb94c23fd)
(cherry picked from commit 05fa514e14)
(cherry picked from commit be70e50114)
(cherry picked from commit 576997ac9a)
(cherry picked from commit 5ca0898717)
(cherry picked from commit 69db3def99)
(cherry picked from commit 577aec56fe)
(cherry picked from commit 1256e4f2f1)
(cherry picked from commit 98abae947e)
(cherry picked from commit 3106f876d2)
2024-02-05 16:05:02 +01:00
Rodion Borisov 7623dc05a9
[BRANDING] Replace links to GitHub with Codeberg guides about adding SSH/GPG keys
(cherry picked from commit f409deabe6)
(cherry picked from commit a62a3d0cf6)
(cherry picked from commit a28d2ddd5e)
(cherry picked from commit 2f8ac92a17)
(cherry picked from commit d43c158a2f)
(cherry picked from commit a2fc2dd1e2)
(cherry picked from commit 00e6fa60d7)
(cherry picked from commit 350f14bc8a)

Conflicts:
	templates/user/settings/keys_gpg.tmpl
	templates/user/settings/keys_ssh.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1420
(cherry picked from commit b325b2653f)
(cherry picked from commit cb5f0513f2)
(cherry picked from commit 4d0fd211e0)
(cherry picked from commit 91037812c3)
(cherry picked from commit 636c505ad4)
(cherry picked from commit f9cb937256)
(cherry picked from commit 72dd0c3cf2)
(cherry picked from commit 66bf26533d)
(cherry picked from commit 37e1d03331)
(cherry picked from commit fb04781877)
(cherry picked from commit dfe491bf09)
(cherry picked from commit 2d40c7ad85)
(cherry picked from commit d7ca25f534)
(cherry picked from commit 723deea27c)
(cherry picked from commit 8320ea3e52)
(cherry picked from commit 503c8ff3e2)
(cherry picked from commit 73036c22d3)
(cherry picked from commit cf3bbc38b3)
(cherry picked from commit d42673bbcf)
(cherry picked from commit 4625b0d9c5)
2024-02-05 16:05:02 +01:00
Loïc Dachary 5e76094b80
[BRANDING] add forgejo target to Makefile
The gitea target is kept as is, for the sake of compatibility with
build systems that rely on it. The forgejo target creates a hard link
with forgejo.

(cherry picked from commit ce156c7cb4)
(cherry picked from commit b2cb232825)
(cherry picked from commit 85543c22bd)
(cherry picked from commit 302955a20d)
(cherry picked from commit 4b1be0858e)
(cherry picked from commit afed1a6e20)
(cherry picked from commit e81304bcd1)
(cherry picked from commit 479cd51a03)
(cherry picked from commit 8baab7c0c1)
(cherry picked from commit 5d25ad9f09)
(cherry picked from commit f36942789f)
(cherry picked from commit 9abfbae8a0)
(cherry picked from commit 079e0efb01)
(cherry picked from commit 0f1b83005a)
(cherry picked from commit 3cc227aaff)
(cherry picked from commit 245310c682)
(cherry picked from commit 3f83e30c93)
(cherry picked from commit e2bdd6af3d)
(cherry picked from commit fb3ac3a20b)
(cherry picked from commit 0ffbd46032)
(cherry picked from commit 1ba9e954e2)
(cherry picked from commit d4bc10d1e7)
(cherry picked from commit e54dc7293e)
(cherry picked from commit f50e5132d4)
(cherry picked from commit 335abddaa0)
(cherry picked from commit 61e80ffb1f)
(cherry picked from commit 4832167235)
(cherry picked from commit 1bbe7816b2)
2024-02-05 16:05:02 +01:00
Earl Warren fe9659a579
[BRANDING] parse FORGEJO__* in the container environment
(cherry picked from commit b075991747)
(cherry picked from commit da3f76228e)
(cherry picked from commit 20d196e74f)
(cherry picked from commit 0bf8b1824e)
(cherry picked from commit 655bb770a7)
(cherry picked from commit d69d5c2c46)
(cherry picked from commit 00b55e5a53)
(cherry picked from commit 456121fd8a)
(cherry picked from commit 9716a158e4)
(cherry picked from commit 7d60a6f511)
(cherry picked from commit d32a6d9437)
(cherry picked from commit ee1de38527)
(cherry picked from commit 54e7799d13)
(cherry picked from commit 4f04da7ab7)
(cherry picked from commit 0d39a0a520)
(cherry picked from commit 7d8ae8279f)
(cherry picked from commit 76b6770b73)
(cherry picked from commit 9bc0d96064)

Conflicts:
	contrib/environment-to-ini/environment-to-ini.go
	https://codeberg.org/forgejo/forgejo/pulls/1769
(cherry picked from commit e21bf9b144)
(cherry picked from commit 96e501c5f0)
(cherry picked from commit 466a66a1f6)
(cherry picked from commit 7814cf700a)
(cherry picked from commit 4d12344871)
(cherry picked from commit fad4cf84c3)
(cherry picked from commit 7ad89400ee)
(cherry picked from commit ec91140447)
(cherry picked from commit 295a7f4487)
(cherry picked from commit 66163a5dcf)
(cherry picked from commit 9e06f57269)
2024-02-05 16:05:02 +01:00
Gusted 9050c1742c
[BRANDING] Use `forgejo` binary name
- Use `forgejo` binary name for migration suggestions.
- Resolves https://codeberg.org/forgejo/forgejo/issues/869#issuecomment-944501

(cherry picked from commit 418a0bed8f)
(cherry picked from commit 734579ce9b)
(cherry picked from commit 34bce5be19)
(cherry picked from commit 9c788a6ec0)
(cherry picked from commit 6cabe32311)
(cherry picked from commit eba83a2440)
(cherry picked from commit 271c4586b2)
(cherry picked from commit 60883a4d68)
(cherry picked from commit ec1f866ccb)
(cherry picked from commit 3689fbe53c)
(cherry picked from commit 8019b115b6)
(cherry picked from commit 0d565d655b)
(cherry picked from commit b3f72a1e11)
(cherry picked from commit 1bd8eab96d)
(cherry picked from commit 1b0e01e407)
(cherry picked from commit d2551dc9b7)
(cherry picked from commit cbaead8c38)
(cherry picked from commit cdab2d7a54)
(cherry picked from commit 7de165e11b)
(cherry picked from commit a3af896878)
(cherry picked from commit 886a9019c6)
(cherry picked from commit 6990c95c99)
(cherry picked from commit 7a9fc37939)
(cherry picked from commit 9fd194fdcf)
(cherry picked from commit df976e858b)
(cherry picked from commit db8dd753ed)
(cherry picked from commit 216648a104)
(cherry picked from commit 80fa4d46bd)
(cherry picked from commit 7a2998a46a)
(cherry picked from commit 40fa85df8e)
(cherry picked from commit e671021168)
(cherry picked from commit cb4b7e2b5c)
(cherry picked from commit 241a2b5242)
2024-02-05 16:05:02 +01:00
lauralani cc88c1063f
[BRANDING] adapt forgejo/contrib/upgrade.sh
Reviewed at: https://codeberg.org/forgejo/forgejo/pulls/605

(cherry picked from commit ab986185d0)
(cherry picked from commit 6068aed2a7)
(cherry picked from commit 0cbd599c0c)
(cherry picked from commit c3ef135882)
(cherry picked from commit 0ba7194fa1)
(cherry picked from commit 572a2a5125)
(cherry picked from commit dd0a7265e1)
(cherry picked from commit 06bd195f4e)
(cherry picked from commit 7f6100ab6b)
(cherry picked from commit 58af04560a)
(cherry picked from commit 67a951f726)
(cherry picked from commit 46e68309ad)
(cherry picked from commit 9002654915)
(cherry picked from commit 3f1a3a1311)
(cherry picked from commit df1716deb4)
(cherry picked from commit 8ace62b413)
(cherry picked from commit 30ab21f264)
(cherry picked from commit 7ec99bfc0d)
(cherry picked from commit 47a554c9b4)
(cherry picked from commit c5aaf49d88)
(cherry picked from commit 7fb42a78a4)
(cherry picked from commit 336fd64a1f)
(cherry picked from commit a7d590f7d7)
(cherry picked from commit b6aa4a40e4)
(cherry picked from commit fc195b0349)
(cherry picked from commit 3c6799ad04)
(cherry picked from commit 86830ae32b)
(cherry picked from commit e70eb6a277)
(cherry picked from commit b18596eb91)
(cherry picked from commit 4a54f7f860)
(cherry picked from commit a3a9885249)
(cherry picked from commit ec8bbabf34)
(cherry picked from commit 5b239033b6)
(cherry picked from commit b1fa48e260)
(cherry picked from commit 148f366431)
(cherry picked from commit 79e10923c1)
(cherry picked from commit 7aa72a9b4f)
(cherry picked from commit 5be4a1da1b)
(cherry picked from commit 2297cfcca9)
(cherry picked from commit 111f5c1044)
(cherry picked from commit baa9877bfe)
(cherry picked from commit 085050da1f)
2024-02-05 16:05:01 +01:00
Rychart Redwerkz 8ca2104118
[BRANDING] Rebrand dump log
(cherry picked from commit b92a65a23f)
(cherry picked from commit eaeb9f183f)
(cherry picked from commit cdbd0ebe5e)
(cherry picked from commit 8aaa4e3f4d)
(cherry picked from commit 6d7d3f048e)
(cherry picked from commit 1b6a2971ad)
(cherry picked from commit 4f7f35043d)
(cherry picked from commit 495a4351b1)
(cherry picked from commit 12d89b03a9)
(cherry picked from commit 476d49ff11)
(cherry picked from commit d6e95828c3)
(cherry picked from commit d043e8d69d)
(cherry picked from commit b060273442)
(cherry picked from commit 20437285c5)
(cherry picked from commit 0bc9eee5f3)
(cherry picked from commit b9f843776f)
(cherry picked from commit e6d64de500)
(cherry picked from commit 5ce2ff2f8b)
(cherry picked from commit 659677cf88)
(cherry picked from commit 648a5d944e)
(cherry picked from commit a77c8be704)
(cherry picked from commit 012cb57046)
(cherry picked from commit 2da63c976e)
(cherry picked from commit 792ce8b1b7)
(cherry picked from commit a4b3244712)
(cherry picked from commit 9ffc3571f1)
(cherry picked from commit 6aadfd0120)
(cherry picked from commit bdfc590b56)
(cherry picked from commit 6d4f25799f)
(cherry picked from commit fa39bb1b0e)
(cherry picked from commit b9f86b4dc5)
(cherry picked from commit 14a60da5b3)
(cherry picked from commit d198a93f70)
(cherry picked from commit f74a07d872)
(cherry picked from commit 50460b0925)
(cherry picked from commit 762847ef0c)
(cherry picked from commit f6ebea410d)
(cherry picked from commit b08e1dcfa9)
(cherry picked from commit e5e4f18488)
(cherry picked from commit d8c600bd79)
(cherry picked from commit cbaa08770d)
(cherry picked from commit a49d65476f)
(cherry picked from commit 2e3682d519)
(cherry picked from commit 0a45629b70)
(cherry picked from commit 6629c83725)
(cherry picked from commit ee5169a867)
2024-02-05 16:05:01 +01:00
Loïc Dachary e57504f278
[BRANDING] X-Forgejo-OTP can be used instead of X-Gitea-OTP
(cherry picked from commit 7b0549cd70)
(cherry picked from commit 13e10a65d9)
(cherry picked from commit 65bdd73cf2)
(cherry picked from commit 64eba8bb92)
(cherry picked from commit 4c49b1a759)
(cherry picked from commit 93b4d06406)
(cherry picked from commit e2bc5f36d9)
(cherry picked from commit 2bee76f9df)
(cherry picked from commit 3d8a1b4a9f)
(cherry picked from commit 99dd092cd0)
(cherry picked from commit 0fdbd02204)
(cherry picked from commit 70b277a183)
(cherry picked from commit 3eece7fbb4)
(cherry picked from commit 4838fc9e11)
(cherry picked from commit b76ed541cf)
(cherry picked from commit dcdfb5b65c)
(cherry picked from commit 377dc48cdc)
(cherry picked from commit acc862f411)
(cherry picked from commit ac75ef101f)
(cherry picked from commit 08f2d9f7c5)
(cherry picked from commit e4096f0b64)
(cherry picked from commit bf5876f062)
(cherry picked from commit 7dc60637e5)
(cherry picked from commit ef3101774b)
(cherry picked from commit ecb9e8867c)
(cherry picked from commit 64f0ae72fe)
(cherry picked from commit 8dd6ec7862)
(cherry picked from commit b36723e52b)

Conflicts:
	modules/context/api.go
	https://codeberg.org/forgejo/forgejo/pulls/1466
(cherry picked from commit 5c378e0cb8)
(cherry picked from commit 1d87602819)
(cherry picked from commit 0f72002d66)
(cherry picked from commit da2556eb13)
(cherry picked from commit c01688cd90)
(cherry picked from commit af4bba8329)
(cherry picked from commit 33ca322c2e)

Conflicts:
	modules/context/api.go
	https://codeberg.org/forgejo/forgejo/pulls/1739
(cherry picked from commit c18e374d44)
(cherry picked from commit 27c4797c9f)
(cherry picked from commit 46588e0fea)
(cherry picked from commit b8a02ef220)
(cherry picked from commit 05e2f49b78)
(cherry picked from commit e4df86d312)
(cherry picked from commit f36e06da43)
(cherry picked from commit 64d336c287)
(cherry picked from commit 2af1cbb017)
(cherry picked from commit 920741a9d6)
(cherry picked from commit 6cbb37c8c4)
(cherry picked from commit 539cceca39)
2024-02-05 16:05:01 +01:00
Loïc Dachary ec3851d5a7
[BRANDING] alias {FORGEJO,GITEA}_{CUSTOM,WORK_DIR}
FORGEJO_* environment variables are set to the corresponding GITEA_*
variable when the cli starts. This approach is intended to minimize
the conflicts on rebase. All occurences of GITEA_* are left untouched
in the codebase and they are only changed to FORGEJO_* if exposed to
the user.

(cherry picked from commit e466f9d10e)
(cherry picked from commit e33e95931b)
(cherry picked from commit 2cfc6519b7)
(cherry picked from commit af8864373a)
(cherry picked from commit a0550ff339)
(cherry picked from commit 24dc0a5191)
(cherry picked from commit e255eea2b4)
(cherry picked from commit 0c4f5afa7a)
(cherry picked from commit 42fce708d0)
(cherry picked from commit e7278c3c22)
(cherry picked from commit 0fb9ed7e0e)
(cherry picked from commit a98308aa4d)
(cherry picked from commit b8695fcbe0)
(cherry picked from commit 4aee8719f5)
(cherry picked from commit 1c503c1ba7)
(cherry picked from commit cf1ed8551e)
(cherry picked from commit c52459b088)
(cherry picked from commit 92cac277b2)
(cherry picked from commit 2c744f1118)
(cherry picked from commit 989a98a8c5)
(cherry picked from commit 9cf7052bd4)
(cherry picked from commit a13c9667e0)

Conflicts:
	main.go
	https://codeberg.org/forgejo/forgejo/pulls/1216
(cherry picked from commit a9c3cf060d)
(cherry picked from commit eb6d904b23)
(cherry picked from commit fd4878e487)
(cherry picked from commit cc2cab9241)
(cherry picked from commit be523c63db)
(cherry picked from commit 254d1a2f9a)
(cherry picked from commit 1eecf4200e)
(cherry picked from commit a01f5c3475)
(cherry picked from commit b1ba7ce321)
(cherry picked from commit eddfd96beb)
(cherry picked from commit c9c9b7e49b)
(cherry picked from commit ad7e871779)
(cherry picked from commit 9073ed215b)
(cherry picked from commit a827fdadd3)
(cherry picked from commit 39e66246cd)
(cherry picked from commit 46d1c778a2)
(cherry picked from commit a65bc0b75d)
(cherry picked from commit 5f901e9671)

Conflicts:
	cmd/main.go
	https://codeberg.org/forgejo/forgejo/pulls/1976
(cherry picked from commit a0e017d206)
(cherry picked from commit e6e24b9631)
(cherry picked from commit 00667d869b)
(cherry picked from commit a9c5bc38e9)
(cherry picked from commit 671ef86e6d)
(cherry picked from commit 5063fd6b84)
(cherry picked from commit 5c043c2aef)
2024-02-05 16:05:01 +01:00
Loïc Dachary ef25d18d9c
[BRANDING] reserve forgejo-actions username
(cherry picked from commit 2a25be788b)
(cherry picked from commit b270d5815c)
(cherry picked from commit e7382cc71e)
(cherry picked from commit 665400ea1e)
(cherry picked from commit f5b2c691f1)
(cherry picked from commit 3df97adfef)
(cherry picked from commit 494f6eafc1)
(cherry picked from commit 822e3d2c83)
(cherry picked from commit 7460f12568)
(cherry picked from commit f6cd70881e)
(cherry picked from commit c669ce8173)
(cherry picked from commit 1d5a433e02)
(cherry picked from commit c1a4dc150c)
(cherry picked from commit dd1c971c6c)
(cherry picked from commit 8d2dcd9b1e)
(cherry picked from commit b6bb8fd275)
(cherry picked from commit d4b71fe96e)
(cherry picked from commit e204ec0b23)
(cherry picked from commit 8d9f1174bd)
(cherry picked from commit e314a7d5ba)
(cherry picked from commit 48b3ad5a30)
(cherry picked from commit 71ed4b7c69)
(cherry picked from commit d63324ccb6)
(cherry picked from commit 9249e893db)
(cherry picked from commit 78f156427b)
(cherry picked from commit c3d4a1a602)
(cherry picked from commit 83b1855f55)
(cherry picked from commit 319815d9b1)
(cherry picked from commit c4fcbfd297)
(cherry picked from commit fb58c85222)
(cherry picked from commit 69c24e3e8b)
(cherry picked from commit 1e9ec4737a)
(cherry picked from commit 70439970c1)
(cherry picked from commit 7e6146c1a8)
(cherry picked from commit 7adf6d5869)
(cherry picked from commit 8985e17343)
(cherry picked from commit fd4dc3ebca)
(cherry picked from commit d31bf1639e)
(cherry picked from commit d2a9b6dea0)
(cherry picked from commit 0d9279bc85)
(cherry picked from commit 0591a15cee)
(cherry picked from commit 3ad88f1146)
(cherry picked from commit 5501f5b2e5)
(cherry picked from commit 9b9f62f774)
(cherry picked from commit dd2e5f525d)
(cherry picked from commit 9b489fd8a5)
(cherry picked from commit 60c820562a)
(cherry picked from commit 084d732317)
(cherry picked from commit e1bb077d6e)
2024-02-05 16:05:01 +01:00
Gusted 8b5941a12f
[BRANDING] Update nodeinfo branding
- Change the values for the nodeinfo API, to use branded values.
- Resolves https://codeberg.org/forgejo/forgejo/issues/257

(cherry picked from commit 4608c57688)
(cherry picked from commit e837e8a529)
(cherry picked from commit 6601328d3c)
(cherry picked from commit c6be21d487)
(cherry picked from commit 5adc6ffee2)
(cherry picked from commit 2ff8d166ac)
(cherry picked from commit b6a90e7e5a)
(cherry picked from commit d1089e706c)

Conflicts:
	tests/integration/api_nodeinfo_test.go
(cherry picked from commit 7a29df737d)
(cherry picked from commit 3655a30c60)
(cherry picked from commit c90d611410)
(cherry picked from commit 0274bd8860)
(cherry picked from commit fdb786b71d)
(cherry picked from commit 4f08f100a1)
(cherry picked from commit 56a2711822)
(cherry picked from commit 3b2cfa452d)
(cherry picked from commit 773ddcf956)
(cherry picked from commit fe8321ed4e)
(cherry picked from commit a94833643b)
(cherry picked from commit 3fdbda7639)
(cherry picked from commit 7bc63d2cd3)
(cherry picked from commit a36400d9cf)
(cherry picked from commit 2535ab4201)
(cherry picked from commit 692e72f4f6)
(cherry picked from commit 265021f3e9)
(cherry picked from commit bc833125d6)
(cherry picked from commit f1f9f88155)
(cherry picked from commit 6076461ad7)
(cherry picked from commit cd1da0aa2b)
(cherry picked from commit f4e9a251d8)
(cherry picked from commit fed4a421ac)
(cherry picked from commit cb3ef32117)
(cherry picked from commit 232eec1945)
(cherry picked from commit 1390cd433a)
(cherry picked from commit e1fed5dd7f)
(cherry picked from commit 5797dcbeb7)
(cherry picked from commit 7591d86b43)
(cherry picked from commit 96eea095f6)
(cherry picked from commit 0a29bba0fb)
(cherry picked from commit 075da8a237)
(cherry picked from commit d2a3085458)
(cherry picked from commit dd39faa96c)
(cherry picked from commit 9f15e5cc49)
(cherry picked from commit 9a7e041380)
(cherry picked from commit 798aaadeac)
(cherry picked from commit 8489bb9161)
(cherry picked from commit 0457646ca5)
(cherry picked from commit 3ca76bc33f)
(cherry picked from commit c98047aa4d)

Conflicts:
	tests/integration/api_nodeinfo_test.go
	https://codeberg.org/forgejo/forgejo/pulls/2299
2024-02-05 16:04:50 +01:00
Earl Warren e20cd83bc5
[BRANDING] add the forgejo webhook type & update webhook docs URLs
templates/swagger/v1_json.tmpl updated with `make generate-swagger`

(cherry picked from commit 88899c492e)
(cherry picked from commit 7171bd9617)
(cherry picked from commit 1a742446c1)
(cherry picked from commit d7c189d7b2)

Conflicts:
	routers/web/web.go
(cherry picked from commit cbdea868e4)
(cherry picked from commit 6cd150483b)
(cherry picked from commit 47246da8d3)
(cherry picked from commit f2aa0e6b76)
(cherry picked from commit 5a4fc69a16)
(cherry picked from commit 48e444ca09)
(cherry picked from commit 888e537811)
(cherry picked from commit 5121f493c9)
(cherry picked from commit 9394e55fdf)
(cherry picked from commit 3a2ce51768)
(cherry picked from commit 719ead3a65)
(cherry picked from commit 83e6f82e2a)
(cherry picked from commit 494a429b21)
(cherry picked from commit 4d775db6b4)
(cherry picked from commit b68f777dc2)
(cherry picked from commit 5b934023fa)
(cherry picked from commit 3b1ed8b16c)
(cherry picked from commit 6bc4a46c9f)
(cherry picked from commit 8064bb24a3)

Conflicts:
	templates/admin/hook_new.tmpl
	templates/org/settings/hook_new.tmpl
	templates/repo/settings/webhook/base_list.tmpl
	templates/repo/settings/webhook/new.tmpl
	templates/user/settings/hook_new.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1181
(cherry picked from commit 55f5588a91)
(cherry picked from commit a428bc06b3)
(cherry picked from commit d2186eceb9)
(cherry picked from commit b4e126e9af)
(cherry picked from commit e4c7a92c2d)
(cherry picked from commit a7165c8146)

Conflicts:
	templates/admin/hook_new.tmpl
	templates/repo/settings/webhook/new.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1420

[BRANDING] add the forgejo webhook type & update webhook docs URLs (squash) gitea logo for gitea webhooks

Refs: https://codeberg.org/forgejo/forgejo/issues/1367
(cherry picked from commit 2d8c1b9373)
(cherry picked from commit 9135a5e1db)
(cherry picked from commit 270f4020b0)
(cherry picked from commit 33e5e2f0d8)
(cherry picked from commit 7af8bcf479)

Conflicts:
	tests/integration/links_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1548
(cherry picked from commit ce2a434dcf)
(cherry picked from commit c2fa42b4fd)
(cherry picked from commit 3858c8d4db)
(cherry picked from commit ebb0ae4920)
(cherry picked from commit 93d354c418)
(cherry picked from commit d5b08a2a4b)
(cherry picked from commit e5e5caffaa)
(cherry picked from commit 974d405700)
(cherry picked from commit e654fbccb1)
(cherry picked from commit 85515977fb)

[BRANDING] add the forgejo webhook type & update webhook docs URLs (squash) ctx.Locale

(cherry picked from commit e192647bc0)
(cherry picked from commit 95fb1b7242)
(cherry picked from commit ea7bd8022f)
(cherry picked from commit bf8465ccd0)
(cherry picked from commit e1baa0a300)
(cherry picked from commit 01b4f4c514)
(cherry picked from commit da330b1e51)
(cherry picked from commit 7b26c27c20)
(cherry picked from commit 0c781e6f6d)
(cherry picked from commit 0f663a8414)
(cherry picked from commit 3297fd4f15)
(cherry picked from commit 2f4ef403cb)
2024-02-05 16:02:14 +01:00
Earl Warren ec8f162b33
[BRANDING] add X-Forgejo-* headers
(cherry picked from commit 0a3388f93f)
(cherry picked from commit 7eba0a440a)
(cherry picked from commit eb9646c7ef)
(cherry picked from commit f1972578f5)

Conflicts:
(cherry picked from commit 7f96222fb4)
(cherry picked from commit e3c7c9fe7b)
(cherry picked from commit 84fdead902)
(cherry picked from commit 85148e1196)
(cherry picked from commit c0086bd70d)
(cherry picked from commit d1e31ef318)
(cherry picked from commit 681d3ed5c4)
(cherry picked from commit 76a3001f5b)
(cherry picked from commit a55a9567d3)
(cherry picked from commit aa7adc167d)
(cherry picked from commit d5354cb52c)
(cherry picked from commit 472c489996)
(cherry picked from commit dc816d065b)
(cherry picked from commit 4795f9ea85)
(cherry picked from commit ddd4ae5343)
(cherry picked from commit 0e95f2a36b)
(cherry picked from commit 47a41a4e7b)
(cherry picked from commit d4416fcd3e)
(cherry picked from commit f279d153b6)
(cherry picked from commit 959f908ffd)
(cherry picked from commit 82df953101)
(cherry picked from commit 8f8c9fd9e3)
(cherry picked from commit d4a0db7706)
(cherry picked from commit 44594d6239)
(cherry picked from commit 62b1de579e)
(cherry picked from commit 507abee353)
(cherry picked from commit 8c36ac42c7)
(cherry picked from commit 72f74067f4)
(cherry picked from commit 8e5a9e187b)
(cherry picked from commit cff8f43c7e)
(cherry picked from commit 493cc93e6d)
(cherry picked from commit c94352b4d4)
(cherry picked from commit 3f622c51a7)
(cherry picked from commit 84c62ad447)
(cherry picked from commit ba186c8ee4)
(cherry picked from commit 4238ef291d)
(cherry picked from commit 3ef1bd61b9)
(cherry picked from commit f304086bb6)
(cherry picked from commit 64a2edabcb)
(cherry picked from commit 6accea6ba7)
(cherry picked from commit 2296e93a42)
(cherry picked from commit 2bf0be3b1b)
(cherry picked from commit fb4652b197)
(cherry picked from commit 7d462cf353)
(cherry picked from commit f5319660dd)
2024-02-05 16:02:14 +01:00
Gusted f7f813ab84
[BRANDING] Replace branding in Swagger
- "Gitea" is automatically being determined in Swagger and cannot be
overridden, therefor we override it after `swagger generate spec` is run.
- Resolves https://codeberg.org/forgejo/forgejo/issues/226

(cherry picked from commit 0b45380765)

[BRANDING] Change Swagger title to Forgejo API

(cherry picked from commit 79f6a70b53)
(cherry picked from commit 6cd47afe33)
(cherry picked from commit a7ae2e4c09)
(cherry picked from commit 59f837e466)
(cherry picked from commit c1c3d1f0e6)
(cherry picked from commit 4b088713fb)
(cherry picked from commit 3df1d21371)
(cherry picked from commit a4a5fdbde4)
(cherry picked from commit 57aa9ed710)
(cherry picked from commit 948b49bf94)
(cherry picked from commit be4929ab6a)
(cherry picked from commit 9ecb507457)

Conflicts:
	templates/swagger/ui.tmpl
(cherry picked from commit 8e57e68863)
(cherry picked from commit f0b3f621e3)
(cherry picked from commit 5b0a6d093e)
(cherry picked from commit 2e0f6b5de8)
(cherry picked from commit bb08076f5c)
(cherry picked from commit 5c9360e38a)
(cherry picked from commit 2f27756148)
(cherry picked from commit 6fce7eeb51)
(cherry picked from commit 8d27e7bebd)
(cherry picked from commit fda2ee2aae)
(cherry picked from commit fe0489a4d8)
(cherry picked from commit fe9479b357)
(cherry picked from commit 1deadb2f35)
(cherry picked from commit d1cb84b2f2)
(cherry picked from commit 9de15d49f8)
(cherry picked from commit 461fbe219c)
(cherry picked from commit f39bf3ba5b)
(cherry picked from commit b3f31c2f7b)
(cherry picked from commit b9f493c139)
(cherry picked from commit 83781b1641)
(cherry picked from commit 4438ee0434)
(cherry picked from commit 56b6b36833)
(cherry picked from commit dde88ed2fd)
(cherry picked from commit 96bb13ce54)
(cherry picked from commit aacc824826)
(cherry picked from commit 0db579b0b3)
(cherry picked from commit c1fd3777de)

Conflicts:
	templates/swagger/v1_json.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1832
(cherry picked from commit 5c8a6e1ca8)
(cherry picked from commit ff145b32c7)
(cherry picked from commit db9b904b84)
(cherry picked from commit a79e2b2b56)
(cherry picked from commit a5830247df)
(cherry picked from commit 9120bc4617)
(cherry picked from commit cd873945b2)
(cherry picked from commit 6a48e3ea5b)
(cherry picked from commit 489c1ac8fb)
(cherry picked from commit a1f7fd771e)
2024-02-05 16:02:14 +01:00
TomZ 743d1e34ac
[BRANDING] cosmetic s/Gitea/Forgejo/ in logs, messages, etc.
As the docs of codeberg refer to the strings printed by the Forgejo
ssh servers, this is user-facing and is nice to update to the new
product name.

(cherry picked from commit 103991d73f)
(cherry picked from commit 2a0d3f85f1)
(cherry picked from commit eb2b4ce388)
(cherry picked from commit 0998b51716)

[BRANDING] forgejo log message

(cherry picked from commit d51a046ebe)
(cherry picked from commit d66e1c7b6e)
(cherry picked from commit b5bffe4ce8)
(cherry picked from commit 3fa776d856)
(cherry picked from commit 18d064f472)
(cherry picked from commit c95094e355)
(cherry picked from commit 5784290bc4)
(cherry picked from commit aee336886b)
(cherry picked from commit ec2f60b516)
(cherry picked from commit 7af742a284)
(cherry picked from commit f279e2a264)
(cherry picked from commit fd38cfb14e)
(cherry picked from commit 64c8226618)
(cherry picked from commit b546fb2304)
(cherry picked from commit ad10202177)
(cherry picked from commit c89cab9c2b)
(cherry picked from commit 9579322ec2)
(cherry picked from commit 16b44ad18d)
(cherry picked from commit 2571ff703b)
(cherry picked from commit ad61d9ce9b)
(cherry picked from commit 9b2c45d4d3)
(cherry picked from commit ed01b79a59)
(cherry picked from commit d040b66427)
(cherry picked from commit ffe0bbea48)
(cherry picked from commit 4c1b2c409b)
(cherry picked from commit 3d8338ed10)
(cherry picked from commit a92f044ea9)

[BRANDING] link to forgejo.org/docs instead of docs.gitea.io

(cherry picked from commit 3efafd0e08)
(cherry picked from commit 148185e34b)
(cherry picked from commit 834e264698)
(cherry picked from commit e72fa6eb1e)

[BRANDING] link to forgejo.org/docs instead of docs.gitea.io

Fix the link that was 404.

(cherry picked from commit ae515d7258)
(cherry picked from commit facc2367f0)
(cherry picked from commit 25784b9f21)
(cherry picked from commit 2efc6138d9)
(cherry picked from commit b9d0871631)
(cherry picked from commit f0446e51b9)
(cherry picked from commit 1638aa67fb)
(cherry picked from commit 290db6a018)
(cherry picked from commit 89b87cf542)
(cherry picked from commit 656ed94962)
(cherry picked from commit 036f879f96)
(cherry picked from commit 69eea35f81)
(cherry picked from commit b72e3f4a92)
(cherry picked from commit af606b8574)
(cherry picked from commit 7e47f8135c)
(cherry picked from commit 0e5218cc53)
(cherry picked from commit 7c2a20a528)
(cherry picked from commit 4e94006363)
(cherry picked from commit e47cdfc43f)
(cherry picked from commit 1dcb3e1da4)
(cherry picked from commit 67367c4e0f)
(cherry picked from commit 252087d1ff)
(cherry picked from commit f5977a43e5)

Conflicts:
	templates/base/head_navbar.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1351
(cherry picked from commit 594938eb15)
(cherry picked from commit 0257d038a7)
(cherry picked from commit 72821dd140)

[BRANDING] s/gitea/forgejo/ in HTML placeholders

Replaced Gitea branding with Forgejo for input placeholders

Closes: #686
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/752

(cherry picked from commit 6160d37ca9)
(cherry picked from commit df61138c7e)
(cherry picked from commit 1f30566c3f)
(cherry picked from commit 539bb825f5)
(cherry picked from commit bee0f66c86)
(cherry picked from commit 60ad005c95)
(cherry picked from commit 282e26222e)
(cherry picked from commit f9ca551f3d)
(cherry picked from commit b2e04b04c3)
(cherry picked from commit c8f395a03c)
(cherry picked from commit 0d58ce49ae)
(cherry picked from commit c602ddf91e)
(cherry picked from commit 029e37271e)
(cherry picked from commit fdaa96b3cc)
(cherry picked from commit 515d99e27d)
(cherry picked from commit da73274ba1)
(cherry picked from commit ce90b696a0)
(cherry picked from commit b6bf98763b)
(cherry picked from commit 5b380d22d7)

[BRANDING] How to start a runner: URL to Actions admin documentation

(cherry picked from commit da91799e6f)
(cherry picked from commit 28231663b6)
(cherry picked from commit 533a90345b)
(cherry picked from commit 6a0e4e55dd)
(cherry picked from commit f47cd611c6)
(cherry picked from commit 001264b784)
(cherry picked from commit e4099e9bb9)
(cherry picked from commit 3a1885649f)
(cherry picked from commit c42802c710)
(cherry picked from commit a611ce8d6d)
(cherry picked from commit a3d7d10a80)
(cherry picked from commit 52adde671f)
(cherry picked from commit c9a3820fef)
(cherry picked from commit dce40997c9)
(cherry picked from commit 312a6b92f3)

[BRANDING] package templates & links

- Change Gitea to Forgejo where necessary.
- Point all documentation to Forgejo's documentation.
- Resolves #992

(cherry picked from commit d0b78a6ede)
(cherry picked from commit e2382f30ba)
(cherry picked from commit c41cf05a33)
(cherry picked from commit 797e598ae7)
(cherry picked from commit 970031a1c2)
(cherry picked from commit 0c1180e2e1)

Conflicts:
	templates/package/content/alpine.tmpl
	templates/package/content/cargo.tmpl
	templates/package/content/chef.tmpl
	templates/package/content/composer.tmpl
	templates/package/content/conan.tmpl
	templates/package/content/conda.tmpl
	templates/package/content/container.tmpl
	templates/package/content/cran.tmpl
	templates/package/content/debian.tmpl
	templates/package/content/generic.tmpl
	templates/package/content/go.tmpl
	templates/package/content/helm.tmpl
	templates/package/content/maven.tmpl
	templates/package/content/npm.tmpl
	templates/package/content/nuget.tmpl
	templates/package/content/pub.tmpl
	templates/package/content/pypi.tmpl
	templates/package/content/rpm.tmpl
	templates/package/content/rubygems.tmpl
	templates/package/content/swift.tmpl
	templates/package/content/vagrant.tmpl

	https://codeberg.org/forgejo/forgejo/pulls/1351
(cherry picked from commit 42ac9ff2ab)
(cherry picked from commit e390000bce)
(cherry picked from commit 56a437b29b)

Conflicts:
	templates/package/content/cargo.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1466

[BRANDING] s/Gitea/Forgejo/ in user visible help & comments

- Modify the README of the docker directory to point to the relevant
docker files and documentation for Forgejo.

(cherry picked from commit aca6371215)
(cherry picked from commit 0ba96b1bc4)
(cherry picked from commit 5c8e6b53f1)

Conflicts:
	docker/README.md
	https://codeberg.org/forgejo/forgejo/pulls/1351
(cherry picked from commit b3121c8004)
(cherry picked from commit 607f870416)
(cherry picked from commit 191d96afe4)

[BRANDING] healthcheck/check.go

(cherry picked from commit d703a236ce)
(cherry picked from commit d84ce3ff20)
(cherry picked from commit 2dbb844606)
(cherry picked from commit 14d3ae7e3a)

[BRANDING] s/Gitea/Forgejo/g in CLI output

(cherry picked from commit 7543c126bb)
(cherry picked from commit b66f422fc3)
(cherry picked from commit a81e4e46f3)

[BRANDING] Gitea->Forgejo in mailer code

(cherry picked from commit b91afea4ff)
(cherry picked from commit 5d7428167c)
(cherry picked from commit ed8101ba6c)

[BRANDING] use 'Forgejo' for Discord, Packagist, and Slack webhooks

Refs: https://codeberg.org/forgejo/forgejo/issues/1387

(cherry picked from commit 7dc3a05f5b)
(cherry picked from commit 133f2fc6cc)

[BRANDING] cmd/manager.go

(cherry picked from commit d1dba2c79d)

[BRANDING] pyproject.toml

(cherry picked from commit 7e8c868db2)
(cherry picked from commit 2395995c8b)
(cherry picked from commit dd6fbbf332)

Conflicts:
	templates/package/content/cargo.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1548
(cherry picked from commit 6f9a5d5cab)
(cherry picked from commit d0635c4a07)
(cherry picked from commit 5f9a8c5744)
(cherry picked from commit 10b96c4567)
(cherry picked from commit 717d52e928)
(cherry picked from commit 5debdb103e)
(cherry picked from commit ded1c1700e)
(cherry picked from commit 52aa23cf7a)
(cherry picked from commit 882c942b06)
(cherry picked from commit 73fc2d2ea8)

Conflicts:
	cmd/actions.go
	cmd/doctor.go
	cmd/keys.go
	https://codeberg.org/forgejo/forgejo/pulls/1976
(cherry picked from commit 6180ef24dc)
(cherry picked from commit 8970fa2bf8)

Conflicts:
	templates/package/content/debian.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/2074

Fix a typo in docker/README.md

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit 2e5df79dfb)
(cherry picked from commit 2bf6ce5b81)
(cherry picked from commit 8ec779277d)
(cherry picked from commit 6048fc66e8)
(cherry picked from commit 162538c722)
(cherry picked from commit 646bb99650)
2024-02-05 16:02:14 +01:00
Caesar Schinas 42e81f8451
[BRANDING] Rebrand default meta tags
(cherry picked from commit b1a792b635)
(cherry picked from commit ba71acccdb)
(cherry picked from commit ef58efb8e0)
(cherry picked from commit 6a1b08241e)
(cherry picked from commit 132c7a3a07)
(cherry picked from commit a1f07975d6)
(cherry picked from commit f3793598b2)
(cherry picked from commit 60f38116af)
(cherry picked from commit 88884cf283)
(cherry picked from commit 520de41aef)
(cherry picked from commit cfd5e5b95a)
(cherry picked from commit 5cf1738f0a)
(cherry picked from commit b95f9b3142)
(cherry picked from commit 0118fba970)
(cherry picked from commit ef213ec79d)
(cherry picked from commit f6794f694b)
(cherry picked from commit 639110c03b)
(cherry picked from commit 2be6eca1e1)
(cherry picked from commit eb929d0d56)
(cherry picked from commit c49dd4ed7f)
(cherry picked from commit 8ea074c4dd)
(cherry picked from commit 3145df43d6)
(cherry picked from commit d0df3e306a)
(cherry picked from commit 8f4850705e)
(cherry picked from commit 5a24d4319c)
(cherry picked from commit 756c04c6c4)
(cherry picked from commit ea627e79e3)
(cherry picked from commit c52b141902)
(cherry picked from commit 49ab0c5559)
(cherry picked from commit f14f26c940)
(cherry picked from commit 4caebbb6be)
(cherry picked from commit 7c3d0bca9e)
(cherry picked from commit 171a207006)
(cherry picked from commit 2a4a7d05fb)
(cherry picked from commit 94b1b90205)
(cherry picked from commit cd3565dbed)
(cherry picked from commit 5d02758b22)
(cherry picked from commit 5901edd111)
(cherry picked from commit 8a3abe6daf)
(cherry picked from commit eaa1a3e6ca)
(cherry picked from commit 7191d0abc4)
(cherry picked from commit 579b985d79)
(cherry picked from commit 16d7dbed87)
(cherry picked from commit c1fa9edc15)
(cherry picked from commit cdcf37ff1b)
(cherry picked from commit b0c78efb86)
(cherry picked from commit dca8fb6cf7)
(cherry picked from commit 4d08cf9f2e)
(cherry picked from commit 73be848222)
2024-02-05 16:02:14 +01:00
Caesar Schinas b5976d4243
[BRANDING] Add Forgejo light, dark, and auto themes
(cherry picked from commit faab0c670e)
(cherry picked from commit b6d59493c7)
(cherry picked from commit 837da0c1f4)
(cherry picked from commit 71ad245e1d)
(cherry picked from commit 85a7032f1b)

Conflicts:
	web_src/css/themes/theme-forgejo-auto.less
	web_src/css/themes/theme-forgejo-dark.less
	web_src/css/themes/theme-forgejo-light.less
	web_src/less/_home.less
        see https://codeberg.org/forgejo/forgejo/pulls/552
(cherry picked from commit 0c2c131bb0)

[BRANDING] Add Forgejo light, dark, and auto themes: fix import

Closes: https://codeberg.org/forgejo/forgejo/issues/562
(cherry picked from commit 2b0dc1f80f)
(cherry picked from commit 494ad6a3b7)
(cherry picked from commit 6940fc22c4)
(cherry picked from commit bd6f00656c)
(cherry picked from commit ebb506a124)
(cherry picked from commit 43d72d3781)
(cherry picked from commit 1a87adca01)
(cherry picked from commit 0704c410b4)
(cherry picked from commit 9039b47c16)
(cherry picked from commit e32bb78924)
(cherry picked from commit 053ad84f91)
(cherry picked from commit a35f1b6da7)
(cherry picked from commit 8cb94c01d5)

[BRANDING] fix invisible label in branch protection settings

(cherry picked from commit 23e5d45721)
(cherry picked from commit f02e4582e5)

[BRANDING] Fix commit label for Forgejo Dark theme (#843)

- Define the `--color-label-text` variable with a light color, which is currently used for commit's SHA

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/843
(cherry picked from commit 74c186a380)
(cherry picked from commit 7e185c5ca5)

[BRANDING] Add Forgejo light, dark, and auto themes (squash) variables

Adapt to b6bcb79987 Improve notification
icon and navbar

Refs: https://codeberg.org/forgejo/forgejo/issues/893

[BRANDING] Add Forgejo light variables

Updates the Forgejo light theme with the changes in b6bcb7998

These are the same changes as made in 2574dbcff to the dark theme

Refs: forgejo/forgejo#893
(cherry picked from commit 9e99fe4f9e)
(cherry picked from commit acbb98bd91)
(cherry picked from commit c80245ed87)

[BRANDING] fix code highlight color in Forgejo themes

(cherry picked from commit ffc49a4e99)
(cherry picked from commit c5f45a941e)
(cherry picked from commit eee5427c9d)
(cherry picked from commit 89be50ca27)
(cherry picked from commit 74e4776ef5)
(cherry picked from commit 6c4e07a6a7)

[BRANDING] more accessible text selection color in Forgejo themes

(cherry picked from commit 7407605ffdedef8fa320477a3bd7efa06df263e2)
(cherry picked from commit 5aab3872cc)
(cherry picked from commit 1ec77d8bd0)
(cherry picked from commit 964c89fce7)
(cherry picked from commit 8a8023a441)
(cherry picked from commit 1c9ffeadf5)

[BRANDING] Fix navigation hover color (squash)

- For items in the navigation bar, use different background colours for hover.
- Regression since https://github.com/go-gitea/gitea/pull/25343

(cherry picked from commit 8f3f4b219c)
(cherry picked from commit edfb0eef06)
(cherry picked from commit a6367fa48a)
(cherry picked from commit d5697abe42)
(cherry picked from commit eaf5370919)
(cherry picked from commit 58f11e7310)
(cherry picked from commit 732e1b35d5)
(cherry picked from commit 0d794ae1c9)
(cherry picked from commit ccc8aed308)

Conflicts:
	modules/setting/ui.go
	https://codeberg.org/forgejo/forgejo/pulls/1582
(cherry picked from commit 209059fbaf)
(cherry picked from commit 80ba2df4a7)
(cherry picked from commit 17b325da23)
(cherry picked from commit 3518b87c8d)
(cherry picked from commit 4042143f96)
(cherry picked from commit 07f976f9d7)
(cherry picked from commit 1bbc6b93e9)
(cherry picked from commit 8aa0bba307)
(cherry picked from commit 94c4a14ac3)

Update Forgejo theme (squash)

- Incorporate changes from 79a4c80f8d into the Forgejo themes.
- Fix that there's no focus or active coloring on primary and secondary
buttons for Forgejo themes caused by
023e937141 that moved variablse from
base.css (shared) to the themes.
- Extend hack to make red buttons darker on dark Forgejo theme to
include active styling and remove the unnecessary `!important`.

(cherry picked from commit 2e32da4419)
(cherry picked from commit a4eca09543)
(cherry picked from commit e6e452811d)
(cherry picked from commit e9a5addf3d)
(cherry picked from commit a1b8b5fa0d)

[BRANDING] Update forgejo theme

- Inlcude a103b79f60 and
1b2cd4c4e1 and
376c0e25f7 and 023e937141
into the Forgejo theme.
- Fix tooltips not being visual, due to missing background color.
- Fix labels not having a background color.
- Fix modals not having a dimmed background.
- Fix no syntax highlighting on Forgejo light due to missing imports.
- Incorporate feedback from
https://codeberg.org/forgejo/forgejo/issues/1117 to make the labels
stand out less.

(cherry picked from commit bc21dc21e1)
(cherry picked from commit 82323c09cc)
(cherry picked from commit 2da09af28d)
(cherry picked from commit 978aeb7cde)
(cherry picked from commit 984c264e19)
(cherry picked from commit 6aa7c8db38)
(cherry picked from commit 4379269a46)

Conflicts:
	modules/setting/ui.go
	https://codeberg.org/forgejo/forgejo/pulls/2116
(cherry picked from commit 9414391ec1)
(cherry picked from commit 02c9b776e8)
(cherry picked from commit 7324b417ce)
(cherry picked from commit b20aa3ed17)
2024-02-05 16:02:13 +01:00
Loïc Dachary 1a673c0ff6
[BRANDING] container images: set APP_NAME
(cherry picked from commit 12d7bc447e)
(cherry picked from commit 1335b17fc3)
(cherry picked from commit 0d7da06c47)
(cherry picked from commit 095c1ab679)
(cherry picked from commit 2220f00d09)
(cherry picked from commit f0be8bbdbf)
(cherry picked from commit 15188180a1)
(cherry picked from commit 96c471d7d3)
(cherry picked from commit 709052f1e7)
(cherry picked from commit 98cd2f5dee)
(cherry picked from commit a1014654b1)
(cherry picked from commit a16f4dc51d)
(cherry picked from commit abbed33d16)
(cherry picked from commit 4871447def)
(cherry picked from commit ea1218b237)
(cherry picked from commit 6dd67d60de)
(cherry picked from commit 71761f04af)
(cherry picked from commit 7cb28a3a06)
(cherry picked from commit d116336cb5)
(cherry picked from commit 4138a698b2)
(cherry picked from commit 38c572bc19)
(cherry picked from commit 94c759b47f)
(cherry picked from commit e1f52bf1d5)
(cherry picked from commit 8bc7000cfa)
(cherry picked from commit fa60007c34)
(cherry picked from commit 0328db39c9)
(cherry picked from commit d028010b64)
(cherry picked from commit 0283c920f0)
(cherry picked from commit f5bdf3e11f)
(cherry picked from commit e3beb52300)
(cherry picked from commit a63d5afc91)
(cherry picked from commit 7d43e1a828)
(cherry picked from commit a551fbd0fa)
(cherry picked from commit cdff0ddbb6)
(cherry picked from commit f2462ab1d0)
(cherry picked from commit 7231dcc0a7)
(cherry picked from commit 1cbe55f832)
(cherry picked from commit 483d953498)
(cherry picked from commit e0b863d2e9)
(cherry picked from commit 34dc719b4d)
(cherry picked from commit 200f1ddec3)
(cherry picked from commit 892435f00f)
(cherry picked from commit 188d1d387a)
(cherry picked from commit 8589533bfe)
(cherry picked from commit 8e7e83ffe5)
(cherry picked from commit 4f86171d68)
(cherry picked from commit ece61fd4f6)
(cherry picked from commit ff34eb0023)
(cherry picked from commit 845b0ecc8c)
2024-02-05 16:02:13 +01:00
Caesar Schinas f0835feaff
[BRANDING] Custom loading animation for Forgejo
(cherry picked from commit a3b3b8a2df)
(cherry picked from commit de0fd2d2e4)
(cherry picked from commit e1bf4de211)
(cherry picked from commit 60ffc88a47)
(cherry picked from commit 7d2beea9ca)
(cherry picked from commit 171eadb952)
(cherry picked from commit 5e81f75ed2)

Conflicts:
	templates/install.tmpl
	templates/post-install.tmpl
	templates/repo/migrate/migrating.tmpl
(cherry picked from commit 641c4a36c5)
(cherry picked from commit f1dbb2dcff)
(cherry picked from commit b66de5e531)
(cherry picked from commit eeccdf21a1)
(cherry picked from commit af37663f4d)
(cherry picked from commit ed3739dccb)
(cherry picked from commit f0036e37cf)
(cherry picked from commit 90d453898a)
(cherry picked from commit c011543238)
(cherry picked from commit a294f34165)
(cherry picked from commit cc00759140)
(cherry picked from commit abe6d83b85)
(cherry picked from commit 274d286339)
(cherry picked from commit 594aaf3c95)
(cherry picked from commit 6059a376f4)
(cherry picked from commit 676eb49a12)
(cherry picked from commit fc834fdb86)
(cherry picked from commit e1e89a4349)
(cherry picked from commit 89e0d29cdb)
(cherry picked from commit eb7fc7a27e)
(cherry picked from commit caa41ff629)
(cherry picked from commit a74b6adb6a)
(cherry picked from commit 4fc629b0d4)
(cherry picked from commit 66a3fb5dcd)
(cherry picked from commit b26ec6315a)
(cherry picked from commit 8d9d4d6f6b)
(cherry picked from commit aa8e866656)
(cherry picked from commit 78a3b95bda)
(cherry picked from commit bdeff07606)
(cherry picked from commit 47ffb47822)
(cherry picked from commit fa7dc92f2a)
(cherry picked from commit 2a7c8466a7)
(cherry picked from commit e940e6c6a4)
(cherry picked from commit b3504e3790)
(cherry picked from commit 7cc5646dcc)
(cherry picked from commit 5116eb2c66)
(cherry picked from commit 5ede0a190f)
(cherry picked from commit 0263de4160)
(cherry picked from commit 61e100f903)
(cherry picked from commit 4a3967a289)
(cherry picked from commit f43115c5cb)
(cherry picked from commit f8ced21044)
2024-02-05 16:02:13 +01:00
Caesar Schinas 95c371d1bb
[BRANDING] Rebrand default config settings for new installs (#140)
Replaces `Gitea` with `Forgejo` in the default config settings for new installs.

This will not affect existing installs.

Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/140
Co-authored-by: Caesar Schinas <caesar@noreply.codeberg.org>
Co-committed-by: Caesar Schinas <caesar@noreply.codeberg.org>
(cherry picked from commit ca1319aa16)
(cherry picked from commit 52a4d238a0)
(cherry picked from commit f63536538c)

Conflicts:
	web_src/js/features/install.js
(cherry picked from commit 861cc434e1)
(cherry picked from commit 0e6ea60c80)
(cherry picked from commit 0cbc0ec15d)
(cherry picked from commit 3cc19b0ae2)
(cherry picked from commit 50fcb885fe)
(cherry picked from commit f6039d4df4)
(cherry picked from commit 5ae5c6ba2d)
(cherry picked from commit f0b565e0ed)
(cherry picked from commit adbd4d2015)
(cherry picked from commit d26c540ffd)
(cherry picked from commit 6df6781b42)
(cherry picked from commit b6fb56e1c4)
(cherry picked from commit bb4f98a0ca)
(cherry picked from commit 6779229f27)
(cherry picked from commit c216c85aee)
(cherry picked from commit dff780bced)
(cherry picked from commit 4e036aa3b6)
(cherry picked from commit 8b3bc3e8a6)
(cherry picked from commit 1e4d852332)
(cherry picked from commit 07a15d1844)
(cherry picked from commit fb44b3e10d)
(cherry picked from commit b212d83319)
(cherry picked from commit 5754971be5)
(cherry picked from commit 0c43b4e82c)

Conflicts:
	routers/install/install.go
	https://codeberg.org/forgejo/forgejo/pulls/1351
(cherry picked from commit 2e22a7208a)
(cherry picked from commit 676b0a8a48)
(cherry picked from commit bc4a8bf9bc)
(cherry picked from commit 5e09a4e174)
(cherry picked from commit 712c52a32a)
(cherry picked from commit ba3d93cc4a)
(cherry picked from commit a5a0396abc)
(cherry picked from commit 09b205f30b)
(cherry picked from commit 52b7729e86)
(cherry picked from commit bfe78735e8)
(cherry picked from commit 915c4f7a7b)
(cherry picked from commit 3b1af856bb)
(cherry picked from commit ffe2c0a353)
(cherry picked from commit fd5cc72128)
(cherry picked from commit 95d3555e47)
(cherry picked from commit b9b853f4b0)
(cherry picked from commit 967453eb6f)
(cherry picked from commit 3298f502dd)
(cherry picked from commit 3481d1f816)
(cherry picked from commit 7508c24a0c)
(cherry picked from commit 54e97f7c35)
(cherry picked from commit 492876992f)
2024-02-05 16:02:13 +01:00
Caesar Schinas e5b68d2614
[BRANDING] Add `forgejo` emoji
(cherry picked from commit ade55ad308)
(cherry picked from commit 107f726618)
(cherry picked from commit f29cf9cfc1)
(cherry picked from commit 0761a41eee)
(cherry picked from commit 2b1fd9565f)
(cherry picked from commit 6a7c82f13b)
(cherry picked from commit 4a56d40494)
(cherry picked from commit b48e3e896d)
(cherry picked from commit bde83340cb)
(cherry picked from commit 74e0603d6b)
(cherry picked from commit 84bd1ddc08)
(cherry picked from commit 62d9acde2a)
(cherry picked from commit 5b84a90913)
(cherry picked from commit 5362f7d053)
(cherry picked from commit 65ad7d1bd9)
(cherry picked from commit 6e42d545a9)
(cherry picked from commit 24d3bb33e2)
(cherry picked from commit 704935cadd)
(cherry picked from commit 5d9fc59e17)
(cherry picked from commit 4c95df3f86)
(cherry picked from commit 1ac704762a)
(cherry picked from commit 0da9fb1318)
(cherry picked from commit bc2de51eef)
(cherry picked from commit ea897a20b9)
(cherry picked from commit 66f3f9c6ef)
(cherry picked from commit edc5c3c304)
(cherry picked from commit 11dd4f31a4)
(cherry picked from commit bf0fb77afb)
(cherry picked from commit 3a823b1001)
(cherry picked from commit e1f6cb4ed6)
(cherry picked from commit 0b3f45972f)
(cherry picked from commit a9579c9679)
(cherry picked from commit 0dea1aadf2)
(cherry picked from commit aeed23b96e)
(cherry picked from commit 72712f467d)
(cherry picked from commit b49b832899)
(cherry picked from commit a985bb8b90)
(cherry picked from commit dac4d69218)
(cherry picked from commit 4962eb361d)
(cherry picked from commit 61835639c8)
(cherry picked from commit f4e44e3b60)
(cherry picked from commit 65c5f553c1)

Conflicts:
	modules/setting/ui.go
	https://codeberg.org/forgejo/forgejo/pulls/1976
(cherry picked from commit ef2f0c1c4a)
(cherry picked from commit 4c208ef65e)
(cherry picked from commit 3386a9d6ee)

Conflicts:
	modules/setting/ui.go
	https://codeberg.org/forgejo/forgejo/pulls/2116
(cherry picked from commit 8f93b38c66)
(cherry picked from commit af49467e83)
(cherry picked from commit edef259a38)
(cherry picked from commit a46b5bbf38)
2024-02-05 16:02:13 +01:00
Caesar Schinas f9638e435b
[BRANDING] Rebrand footer "powered by" links
(cherry picked from commit 8b9237e47e)
(cherry picked from commit 47e5543f33)
(cherry picked from commit 456abff8c0)
(cherry picked from commit 2d2588187e)
(cherry picked from commit a81e4e2588)
(cherry picked from commit 70c4ee8fba)
(cherry picked from commit f12b0577e8)
(cherry picked from commit 025e6e1974)
(cherry picked from commit e051684c83)
(cherry picked from commit ee370f3f3c)
(cherry picked from commit a1b53a8b88)
(cherry picked from commit e01158af9b)
(cherry picked from commit c9f6b6c8a1)
(cherry picked from commit 6abaa468d5)
(cherry picked from commit d039148bc8)
(cherry picked from commit d3aadcac8b)
(cherry picked from commit e739f46aae)
(cherry picked from commit 228671e723)
(cherry picked from commit 8965f9bdf2)
(cherry picked from commit 5e97896da3)
(cherry picked from commit df8bdce12a)
(cherry picked from commit 33ecf86e42)
(cherry picked from commit 038ac822db)
(cherry picked from commit 6decbafd3a)
(cherry picked from commit ad2b719be5)
(cherry picked from commit d9b2f11a7b)
(cherry picked from commit 1020333462)
(cherry picked from commit c1279c7d45)
(cherry picked from commit a0dfccbba4)

Conflicts:
	templates/base/footer_content.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1420
(cherry picked from commit 9651bcf9c6)
(cherry picked from commit 73cd49d3e5)
(cherry picked from commit c4778ed2ec)
(cherry picked from commit ca0bd91ab7)
(cherry picked from commit e3720f5b13)
(cherry picked from commit 6ec65da832)
(cherry picked from commit 157cf1d929)
(cherry picked from commit 1956c751b0)
(cherry picked from commit dae4f61afa)
(cherry picked from commit 65b13516e0)
(cherry picked from commit eab31d418a)
(cherry picked from commit 53811a6455)
(cherry picked from commit cd201222d7)
(cherry picked from commit 01d522eba5)
(cherry picked from commit f319eabc92)
(cherry picked from commit ef85ae5aff)
(cherry picked from commit 5c259c0018)
(cherry picked from commit 08edee9ed1)
(cherry picked from commit b08d13df89)
(cherry picked from commit b1d0fedc76)
2024-02-05 16:02:13 +01:00
Gusted 674c579879
[BRANDING] Rebrand systemd service (#137)
- We can rebrand this quite safely, as only new installations would likely look into this file and configure the correct folders(to use forgejo instead of gitea).

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/137
(cherry picked from commit fa78e52b5d)
(cherry picked from commit e36d649989)
(cherry picked from commit 37e15a2f41)
(cherry picked from commit a09a4b3ce0)
(cherry picked from commit 3096b37c95)
(cherry picked from commit 187ad96c94)
(cherry picked from commit e15eb31c6e)
(cherry picked from commit e276abe341)
(cherry picked from commit 31223db5e3)
(cherry picked from commit 8ebffe0b71)
(cherry picked from commit 1d19836346)
(cherry picked from commit baaf749ce0)

Conflicts:
	contrib/systemd/forgejo.service
(cherry picked from commit c309b1a1f4)
(cherry picked from commit d6f57409da)
(cherry picked from commit c6e665b038)
(cherry picked from commit 8764e26c43)
(cherry picked from commit a0560e454b)
(cherry picked from commit e074e83094)
(cherry picked from commit 605b84bc77)
(cherry picked from commit 35b2332020)
(cherry picked from commit b9c396f295)
(cherry picked from commit 83a7e91bad)
(cherry picked from commit 3794ad271a)
(cherry picked from commit 818451287d)
(cherry picked from commit ec9bc9e641)
(cherry picked from commit 8434efaed8)
(cherry picked from commit 3b1a4b7f38)
(cherry picked from commit c186b5a3e5)
(cherry picked from commit e35d92de1f)
(cherry picked from commit c8bb517183)
(cherry picked from commit 9ac843d662)
(cherry picked from commit 86c723ca0a)
(cherry picked from commit c662da2a84)
(cherry picked from commit 6f9390ed43)
(cherry picked from commit 684f80f7ce)
(cherry picked from commit 0e28b2a57f)
(cherry picked from commit ded78839e4)
(cherry picked from commit 33720ba955)
(cherry picked from commit b39b88fd01)
(cherry picked from commit 666ae3c7b2)
(cherry picked from commit ac968a29b3)
(cherry picked from commit 72d83381f3)
(cherry picked from commit bb73be008b)
(cherry picked from commit 8c38bbe481)
(cherry picked from commit 9e4ff9a3df)

Conflicts:
	contrib/systemd/forgejo.service
	https://codeberg.org/forgejo/forgejo/pulls/2116
(cherry picked from commit 3a878dbefe)
(cherry picked from commit 63d014f13c)
(cherry picked from commit d231e454a5)
(cherry picked from commit 0996e3a9c9)
2024-02-05 16:02:13 +01:00
Caesar Schinas 31bfb80c03
[BRANDING] add Forgejo logo
(cherry picked from commit f42622c7d5)
(cherry picked from commit a39e7f2a79)
(cherry picked from commit afa2a31bb9)
(cherry picked from commit 276e8856e5)
(cherry picked from commit 68e3bd469f)
(cherry picked from commit af124b9ccb)
(cherry picked from commit b89ab4874d)
(cherry picked from commit 0f2a2f0d0f)
(cherry picked from commit 80999363c7)
(cherry picked from commit f8880b5463)
(cherry picked from commit 5f4cf4f6e1)
(cherry picked from commit b38e26bc1a)
(cherry picked from commit d839e00332)
(cherry picked from commit 32ffe2e4f1)
(cherry picked from commit f1fd0504ad)
(cherry picked from commit 6d77ea4d60)
(cherry picked from commit 61a0a4a276)
(cherry picked from commit a90b4126fd)
(cherry picked from commit 9a20538fb4)
(cherry picked from commit ce0fc02f0f)
(cherry picked from commit 541f7cb026)
(cherry picked from commit d6d0c2ab78)
(cherry picked from commit 2c28f5ad24)
(cherry picked from commit 9571bddb33)
(cherry picked from commit c83ba08d01)
(cherry picked from commit 30e7d567ed)
(cherry picked from commit a8b8c3eba7)
(cherry picked from commit 8e053e1ade)
(cherry picked from commit 9e3b0f7520)
(cherry picked from commit 2343b9bd09)
(cherry picked from commit 56572d4156)
(cherry picked from commit 9b09eda168)
(cherry picked from commit 86a8b7b490)
(cherry picked from commit 99a550c0e3)
(cherry picked from commit bdcf3f51e0)
(cherry picked from commit cec8f2d31e)
(cherry picked from commit 25aa22ba2b)
(cherry picked from commit 31510249a0)
(cherry picked from commit 95dc569227)
(cherry picked from commit f6caf5f1b9)
(cherry picked from commit aba34fbf70)
(cherry picked from commit 41b816fdac)
(cherry picked from commit c98e79b89f)
(cherry picked from commit d33d4f193c)
(cherry picked from commit 4e5bb41cbe)
(cherry picked from commit 3aa8ddb8cb)
(cherry picked from commit e8057040bb)
(cherry picked from commit f3bf61e51e)
(cherry picked from commit e9d08aad76)
2024-02-05 16:02:13 +01:00
Gusted 8d3fab8944
[MODERATION] Refactor excluding watchers mechanism (squash)
This solves two bugs. One bug is that due to the JOIN with the
`forgejo_blocked_users` table, duplicated users were generated if a user
had more than one user blocked, this lead to receiving more than one
entry in the actions table. The other bug is that if a user blocked more
than one user, it would still receive a action entry by a
blocked user, because the SQL query would not exclude the other
duplicated users that was generated by the JOIN.

The new solution is somewhat non-optimal in my eyes, but it's better
than rewriting the query to become a potential perfomance blocker (usage
of WHERE IN, which cannot be rewritten to a JOIN). It simply removes the
watchers after it was retrieved by the SQL query.

(cherry picked from commit c63c00b39b)
(cherry picked from commit ad3cdc5705)
2024-02-05 15:56:58 +01:00
Gusted 9bb188176e
[MODERATION] Block issue creation when blocked by repo owner (squash)
- Block the creation of a issue if the user is blocked by the repository owner.
- Fix integration tests (This should ideally in the future all be
self-created fixtures instead of relying on the existing ones as a small
condition can make the tests be inaccurate).

(cherry picked from commit 88d3ee333a)
(cherry picked from commit 146c82d232)
(cherry picked from commit d9dc25d038)
(cherry picked from commit cd1eadd923)
(cherry picked from commit 40a8584bbb)
2024-02-05 15:56:58 +01:00
Earl Warren 9db9f6732d
[MODERATION] User blocking (squash) do not use token= query param
See https://codeberg.org/forgejo/forgejo/commit/33439b733a

(cherry picked from commit 82d3e78bf7)
(cherry picked from commit 36c43dbf82)
(cherry picked from commit 52f8e06095)
(cherry picked from commit a3f44f1976)
(cherry picked from commit de2905919d)
(cherry picked from commit d6d98d001f)
2024-02-05 15:56:58 +01:00
Gusted 2da33aae2d
[MODERATION] User blocking
- Add the ability to block a user via their profile page.
- This will unstar their repositories and visa versa.
- Blocked users cannot create issues or pull requests on your the doer's repositories (mind that this is not the case for organizations).
- Blocked users cannot comment on the doer's opened issues or pull requests.
- Blocked users cannot add reactions to doer's comments.
- Blocked users cannot cause a notification trough mentioning the doer.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/540
(cherry picked from commit 687d852480)
(cherry picked from commit 0c32a4fde5)
(cherry picked from commit 1791130e3c)
(cherry picked from commit 37858b7e8f)
(cherry picked from commit a3e2bfd7e9)
(cherry picked from commit 7009b9fe87)

Conflicts: https://codeberg.org/forgejo/forgejo/pulls/1014
        routers/web/user/profile.go
        templates/user/profile.tmpl
(cherry picked from commit b2aec34791)
(cherry picked from commit e2f1b73752)

[MODERATION] organization blocking a user (#802)

- Resolves #476
- Follow up for: #540
- Ensure that the doer and blocked person cannot follow each other.
- Ensure that the block person cannot watch doer's repositories.
- Add unblock button to the blocked user list.
- Add blocked since information to the blocked user list.
- Add extra testing to moderation code.
- Blocked user will unwatch doer's owned repository upon blocking.
- Add flash messages to let the user know the block/unblock action was successful.
- Add "You haven't blocked any users" message.
- Add organization blocking a user.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/802
(cherry picked from commit 0505a10421)
(cherry picked from commit 37b4e6ef9b)
(cherry picked from commit c17c121f2c)

[MODERATION] organization blocking a user (#802) (squash)

Changes to adapt to:

  6bbccdd177 Improve AJAX link and modal confirm dialog (#25210)

Refs: https://codeberg.org/forgejo/forgejo/pulls/882/files#issuecomment-945962
Refs: https://codeberg.org/forgejo/forgejo/pulls/882#issue-330561
(cherry picked from commit 523635f83c)
(cherry picked from commit 4743eaa6a0)
(cherry picked from commit eff5b43d2e)

Conflicts: https://codeberg.org/forgejo/forgejo/pulls/1014
        routers/web/user/profile.go
(cherry picked from commit 9d359be5ed)
(cherry picked from commit b1f3069a22)

[MODERATION] add user blocking API

- Follow up for: #540, #802
- Add API routes for user blocking from user and organization
perspective.
- The new routes have integration testing.
- The new model functions have unit tests.
- Actually quite boring to write and to read this pull request.

(cherry picked from commit f3afaf15c7)
(cherry picked from commit 6d754db3e5)
(cherry picked from commit 2a89ddc0ac)
(cherry picked from commit 4a147bff7e)

Conflicts:
        routers/api/v1/api.go
        templates/swagger/v1_json.tmpl
(cherry picked from commit bb8c339185)
(cherry picked from commit 5a11569a01)
(cherry picked from commit 2373c801ee)

[MODERATION] restore redirect on unblock

 ctx.RedirectToFirst(ctx.FormString("redirect_to"), ctx.ContextUser.HomeLink())

was replaced by

 ctx.JSONOK()

in 128d77a3a Following up fixes for "Fix inconsistent user profile layout across tabs" (#25739)

thus changing the behavior (nicely spotted by the tests). This
restores it.

(cherry picked from commit 597c243707)
(cherry picked from commit cfa539e590)

[MODERATION] Add test case (squash)

- Add an test case, to test an property of the function.

(cherry picked from commit 70dadb1916)

[MODERATION] Block adding collaborators

- Ensure that the doer and blocked user cannot add each other as
collaborators to repositories.
- The Web UI gets an detailed message of the specific situation, the API
gets an generic Forbidden code.
- Unit tests has been added.
- Integration testing for Web and API has been added.
- This commit doesn't introduce removing each other as collaborators on
the block action, due to the complexity of database calls that needs to
be figured out. That deserves its own commit and test code.

(cherry picked from commit 747be949a1)

[MODERATION] move locale_en-US.ini strings to avoid conflicts

Conflicts:
        web_src/css/org.css
        web_src/css/user.css
        https://codeberg.org/forgejo/forgejo/pulls/1180

(cherry picked from commit e53f955c88)

Conflicts:
        services/issue/comments.go
        https://codeberg.org/forgejo/forgejo/pulls/1212
(cherry picked from commit b4a454b576)

Conflicts:
        models/forgejo_migrations/migrate.go
        options/locale/locale_en-US.ini
        services/pull/pull.go
        https://codeberg.org/forgejo/forgejo/pulls/1264

[MODERATION] Remove blocked user collaborations with doer

- When the doer blocks an user, who is also an collaborator on an
repository that the doer owns, remove that collaboration.
- Added unit tests.
- Refactor the unit test to be more organized.

(cherry picked from commit ec87016178)
(cherry picked from commit 313e6174d8)

[MODERATION] QoL improvements (squash)

- Ensure that organisations cannot be blocked. It currently has no
effect, as all blocked operations cannot be executed from an
organisation standpoint.
- Refactored the API route to make use of the `UserAssignmentAPI`
middleware.
- Make more use of `t.Run` so that the test code is more clear about
which block of code belongs to which test case.
- Added more integration testing (to ensure the organisations cannot be
blocked and some authorization/permission checks).

(cherry picked from commit e9d638d075)

[MODERATION] s/{{avatar/{{ctx.AvatarUtils.Avatar/

(cherry picked from commit ce8b30be13)
(cherry picked from commit f911dc4025)

Conflicts:
	options/locale/locale_en-US.ini
	https://codeberg.org/forgejo/forgejo/pulls/1354
(cherry picked from commit c1b37b7fda)
(cherry picked from commit 856a2e0903)

[MODERATION] Show graceful error on comment creation

- When someone is blocked by the repository owner or issue poster and
try to comment on that issue, they get shown a graceful error.
- Adds integration test.

(cherry picked from commit 490646302e)
(cherry picked from commit d3d88667cb)
(cherry picked from commit 6818de13a9)

[MODERATION] Show graceful error on comment creation (squash) typo

(cherry picked from commit 1588d4834a)
(cherry picked from commit d510ea52d0)
(cherry picked from commit 8249e93a14)

[MODERATION] Refactor integration testing (squash)

- Motivation for this PR is that I'd noticed that a lot of repeated
calls are happening between the test functions and that certain tests
weren't using helper functions like `GetCSRF`, therefor this refactor of
the integration tests to keep it: clean, small and hopefully more
maintainable and understandable.
- There are now three integration tests: `TestBlockUser`,
`TestBlockUserFromOrganization` and `TestBlockActions` (and has been
moved in that order in the source code).
- `TestBlockUser` is for doing blocking related actions as an user and
`TestBlockUserFromOrganization` as an organisation, even though they
execute the same kind of tests they do not share any database calls or
logic and therefor it currently doesn't make sense to merge them
together (hopefully such oppurtinutiy might be presented in the future).
- `TestBlockActions` now contain all tests for actions that should be
blocked after blocking has happened, most tests now share the same doer
and blocked users and a extra fixture has been added to make this
possible for the comment test.
- Less code, more comments and more re-use between tests.

(cherry picked from commit ffb393213d)
(cherry picked from commit 85505e0f81)
(cherry picked from commit 0f3cf17761)

[MODERATION] Fix network error (squash)

- Fix network error toast messages on user actions such as follow and
unfollow. This happened because the javascript code now expects an JSON
to be returned, but this wasn't the case due to
cfa539e590127b4953b010fba3dea21c82a1714.
- The integration testing has been adjusted to instead test for the
returned flash cookie.

(cherry picked from commit 112bc25e54)
(cherry picked from commit 1194fe4899)
(cherry picked from commit 9abb95a844)

[MODERATION] Modernize frontend (squash)

- Unify blocked users list.
- Use the new flex list classes for blocked users list to avoid using
the CSS helper classes and thereby be consistent in the design.
- Fix the modal by using the new modal class.
- Remove the icon in the modal as looks too big in the new design.
- Fix avatar not displaying as it was passing the context where the user
should've been passed.
- Don't use italics for 'Blocked since' text.
- Use namelink template to display the user's name and homelink.

(cherry picked from commit ec935a16a3)
(cherry picked from commit 67f37c8346)

Conflicts:
	models/user/follow.go
	models/user/user_test.go
	routers/api/v1/user/follower.go
	routers/web/shared/user/header.go
	routers/web/user/profile.go
	templates/swagger/v1_json.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1468
(cherry picked from commit 6a9626839c)

Conflicts:
	tests/integration/api_nodeinfo_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1508#issuecomment-1242385
(cherry picked from commit 7378b251b4)

Conflicts:
	models/fixtures/watch.yml
	models/issues/reaction.go
	models/issues/reaction_test.go
	routers/api/v1/repo/issue_reaction.go
	routers/web/repo/issue.go
	services/issue/issue.go
	https://codeberg.org/forgejo/forgejo/pulls/1547
(cherry picked from commit c2028930c1)
(cherry picked from commit d3f9134aee)
(cherry picked from commit 7afe154c5c)
(cherry picked from commit 99ac7353eb)
(cherry picked from commit a9cde00c5c)

Conflicts:
	services/user/delete.go
	https://codeberg.org/forgejo/forgejo/pulls/1736
(cherry picked from commit 008c0cc63d)

[DEADCODE] add exceptions

(cherry picked from commit 12ddd2b10e)

[MODERATION] Remove deadcode (squash)

- Remove deadcode that's no longer used by Forgejo.

(cherry picked from commit 0faeab4fa9)

[MODERATION] Add repo transfers to blocked functionality (squash)

- When someone gets blocked, remove all pending repository transfers
from the blocked user to the doer.
- Do not allow to start transferring repositories to the doer as blocked user.
- Added unit testing.
- Added integration testing.

(cherry picked from commit 8a3caac330)
(cherry picked from commit a92b4cfeb6)
(cherry picked from commit acaaaf07d9)
(cherry picked from commit 735818863c)
(cherry picked from commit f50fa43b32)
(cherry picked from commit e166836433)
(cherry picked from commit 82a0e4a381)
(cherry picked from commit ff233c19c4)
(cherry picked from commit 8ad87d215f)

[MODERATION] Fix unblock action (squash)

- Pass the whole context instead of only giving pieces.
- This fixes CSRF not correctly being inserted into the unblock buttons.

(cherry picked from commit 2aa51922ba)
(cherry picked from commit 7ee8db0f01)
(cherry picked from commit e4f8b999bc)
(cherry picked from commit 05aea60b13)
(cherry picked from commit dc0d61b012)
(cherry picked from commit f53fa583de)
(cherry picked from commit c65b89a58d)
(cherry picked from commit 69e50b9969)
(cherry picked from commit ec127440b8)

[MODERATION] cope with shared fixtures

* There is one more issue in the fixtures and this breaks some tests
* The users in the shared fixtures were renamed for clarity and that
  breaks some tests

(cherry picked from commit 707a4edbdf)

Conflicts:
	modules/indexer/issues/indexer_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1508
(cherry picked from commit 82cc044366)
(cherry picked from commit 2776aec7e8)
(cherry picked from commit 1fbde36dc7)
(cherry picked from commit 1293db3c4e)
(cherry picked from commit 6476802175)
(cherry picked from commit 5740f2fc83)
(cherry picked from commit afc12d7b6e)

[MODERATION] Fix transfer confirmation (squash)

- Fix problem caused by the clearer confirmation for dangerous actions commit.

(cherry picked from commit 3488f4a9cb)
(cherry picked from commit ed7de91f6a)
(cherry picked from commit 2d97929b9b)
(cherry picked from commit 50d035a7b0)
(cherry picked from commit 0a0c07d78a)
(cherry picked from commit 85e55c4dbc)
(cherry picked from commit d8282122ad)
(cherry picked from commit 3f0b3b6cc5)

[MODERATION] Purge issues on user deletion (squash)

(cherry picked from commit 4f529d9596)
(cherry picked from commit f0e3acadd3)
(cherry picked from commit 682c4effe6)
(cherry picked from commit e43c2d84fd)
(cherry picked from commit 9c8e53ccc7)
(cherry picked from commit a9eb7ac783)

[MODERATION] Purge issues on user deletion (squash) revert shared fixtures workarounds

(cherry picked from commit 7224653a40)
(cherry picked from commit aa6e8672f9)
(cherry picked from commit 58c7947e95)
(cherry picked from commit f1aacb1851)
(cherry picked from commit 0bf174af87)
(cherry picked from commit f9706f4335)

[MODERATION] Prepare moderation for context locale changes (squash)

- Resolves https://codeberg.org/forgejo/forgejo/issues/1711

(cherry picked from commit 2e289baea9)
(cherry picked from commit 97b16bc19a)

[MODERATION] User blocking (squash) do not use shared fixture

It conflicts with a fixtured added in the commit
Fix comment permissions (#28213) (#28216)

(cherry picked from commit ab40799dcab24e9f495d765268b791931da81684)
(cherry picked from commit 996c92cafd)
(cherry picked from commit 259912e3a6)

Conflicts:
	options/locale/locale_en-US.ini
	https://codeberg.org/forgejo/forgejo/pulls/1921
(cherry picked from commit 1e82abc032)
(cherry picked from commit a176fee160)
(cherry picked from commit 0480b76dfe)
(cherry picked from commit 4bc06b7b38)
(cherry picked from commit 073094cf72)
(cherry picked from commit ac6201c647)
(cherry picked from commit 7e0812674d)
(cherry picked from commit 068c741e56)

Conflicts:
	models/repo_transfer.go
	models/repo_transfer_test.go
	routers/web/user/profile.go
	https://codeberg.org/forgejo/forgejo/pulls/2298
2024-02-05 15:56:45 +01:00
Gusted 006291bd9c
[MODERATION] Purge issues on user deletion
- Forgejo has the option to delete users, in which all data except
issues and comments are removed, this makes sense in some cases where
users need to be removed cleanly but without removing their existing bug
reports or comments to an discussion. In the case of spammers, admins
have the option to enable purging, where comments are removed.
- Add issues to the list of things to be removed if purge is checked.
- No unit testing, as this gigantic function doesn't have one to begin
with.
- Add integration test.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1268

(cherry picked from commit 3ed381c758)
(cherry picked from commit 44d00650ce)
(cherry picked from commit 7f4da82779)
(cherry picked from commit d629314def)

Conflicts:
	models/fixtures/issue.yml
	https://codeberg.org/forgejo/forgejo/pulls/1508
(cherry picked from commit 794dcc218f)
(cherry picked from commit c433f2ecb6)
(cherry picked from commit bb23683f4b)
(cherry picked from commit 634c5604d4)
(cherry picked from commit 219073f5c5)
(cherry picked from commit 32893dbab1)
(cherry picked from commit 0ef40cfb5a)
(cherry picked from commit e535409cab3c276fd8db6b402f85934ef5127491)
(cherry picked from commit 29059f611b)
(cherry picked from commit cd480c5b8b)
(cherry picked from commit 340e657392)
(cherry picked from commit 3a7a5564d0)
(cherry picked from commit 1dbcaca726)
(cherry picked from commit c491c439e2)
(cherry picked from commit c8fe2140cc)
(cherry picked from commit c72564e3ee)
(cherry picked from commit 2084f3fa11)
(cherry picked from commit 918e65327d)
2024-02-05 15:39:02 +01:00
Gusted 6fc17ad37b
[PRIVACY] Add a DNS method to fetch new updates
- Use TXT records in order to determine the latest available version.
- This addresses a valid privacy issue, as with HTTP requests the server
can keep track(estimated) of how many instances are using Forgejo, with
DNS that's basically not possible as the server will never receive any
data, as the only ones receiving data are DNS resolvers.

(cherry picked from commit 0baefb546a)
(cherry picked from commit e8ee41880b)
(cherry picked from commit 7eca4f3bf1)
(cherry picked from commit 6dde3992dc)
(cherry picked from commit fb3a37fbfc)
(cherry picked from commit 8304af1e9d)
(cherry picked from commit 0543a7d12a)
(cherry picked from commit c3a22933b7)
(cherry picked from commit e243707694)
(cherry picked from commit 7eb6d1bcf7)
(cherry picked from commit 1d7b9535cd)
(cherry picked from commit 05920dce67)
(cherry picked from commit f173f27d7c)
(cherry picked from commit 90e1c9340e)
(cherry picked from commit de68610ea7)
(cherry picked from commit 8d5757ea04)
(cherry picked from commit c7a7fff316)
(cherry picked from commit 39ac8b8fc1)
(cherry picked from commit 9889203301)

[PRIVACY]: Adjust update checker description

- Resolves #323
- Adjust the description of the update check function on the
installation page to describe the privacy method instead of the HTTP
method by checking gitea.io

(cherry picked from commit 61eae5b105)
(cherry picked from commit 091def20a1)
(cherry picked from commit d5d11bf45a)
(cherry picked from commit 71863d4707)
(cherry picked from commit 11ece4aab1)
(cherry picked from commit afdd7e714f)
(cherry picked from commit 39170e2f1d)
(cherry picked from commit 4b3a52aab8)
(cherry picked from commit 9d763c5fc8)
(cherry picked from commit 638db15482)
(cherry picked from commit a52bfdd8e7)
(cherry picked from commit dc93d00e85)
(cherry picked from commit 0bc4b3508c)
(cherry picked from commit 3f760d85a4)
(cherry picked from commit ecc2716785)
(cherry picked from commit 6334d5677e)

Conflicts:
	modules/updatechecker/update_checker.go
	UpdateRemoteVersion now has a context argument. However, in
	the updated code from Gitea the context comes from the HTTP
	request and does not actually provide any useful context.
	Replace that with context.Background()
(cherry picked from commit ca2200767e)
(cherry picked from commit f46feca224)
(cherry picked from commit a800a66ca8)
(cherry picked from commit 21f017454e)
(cherry picked from commit 762d18e09a)
(cherry picked from commit 6d28e120c1)
(cherry picked from commit 4fcd7e7cbf)
(cherry picked from commit 9516285112)
(cherry picked from commit 0dd752a262)
(cherry picked from commit b1f1af7fe0)
(cherry picked from commit 71937deaa5)
(cherry picked from commit 93e41a7823)
(cherry picked from commit f497ed30cf)
(cherry picked from commit bff3346f7d)
(cherry picked from commit 906ae19c0f)
2024-02-05 15:38:36 +01:00
Gusted c53f802778
[PRIVACY] Disable `update_checker` cron tasks
- This is being disabled as it will weekly connect to a domain.
- This only affects existing installations, as new installations will
have a explicit value being written into app.ini due to https://github.com/go-gitea/gitea/pull/21655

(cherry picked from commit cd0b8b6852)
(cherry picked from commit 58d43867ca)
(cherry picked from commit f290b91e50)
(cherry picked from commit 5bd6d75554)
(cherry picked from commit e5d0abb592)
(cherry picked from commit 4b381ce77e)
(cherry picked from commit b6a9b1390d)
(cherry picked from commit 3674362871)
(cherry picked from commit af0f606fc1)
(cherry picked from commit 49560da6fb)
(cherry picked from commit ca06e27c5b)
(cherry picked from commit 163df86df5)
(cherry picked from commit 0391c6ae42)
(cherry picked from commit f282f2d42f)
(cherry picked from commit 68d31cf247)
(cherry picked from commit cfd4a479e9)
(cherry picked from commit add969bdf6)
(cherry picked from commit c0f3f1f1e7)
(cherry picked from commit f11dca9090)
(cherry picked from commit 283810387f)
(cherry picked from commit 08af1f0ea8)
(cherry picked from commit 1c1a6da319)
(cherry picked from commit c1444bae65)
(cherry picked from commit 6361df634b)
(cherry picked from commit cc8bb3f946)
(cherry picked from commit c7ae4411fd)
(cherry picked from commit f73f4eef02)
(cherry picked from commit 2122896e85)
(cherry picked from commit d469c99671)
(cherry picked from commit 41dbbd731e)
(cherry picked from commit e8e742b437)
(cherry picked from commit 0fa9f87b5f)
(cherry picked from commit a92c724a56)
(cherry picked from commit 6a18d153e1)
(cherry picked from commit 0dd35a13fd)
(cherry picked from commit 5ae0cbe0ae)
(cherry picked from commit 13bd3cf37b)
(cherry picked from commit a163efa6cf)
(cherry picked from commit 422a6e8329)
(cherry picked from commit 125fb33e1b)
(cherry picked from commit fd39d15a92)
(cherry picked from commit b581474513)
(cherry picked from commit 987d198523)
(cherry picked from commit f06eed025f)
(cherry picked from commit 6f9f415644)
(cherry picked from commit eb2c878deb)
(cherry picked from commit 70daffa9fe)
(cherry picked from commit 3a6ae6fa49)
(cherry picked from commit 682a564b04)
2024-02-05 15:38:36 +01:00
Codeberg Translate a485566356
[I18n] Translations update from Weblate (5 February)
[I18n] Translations update from Weblate (#2254)

Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: earl-work01 <contact+work01@earl-warren.org>
Co-authored-by: walpo <walpo@users.noreply.translate.codeberg.org>
Co-authored-by: Gusted <postmaster+codeberg@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2254
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>

Translations update from Weblate (#2258)

Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Squeljur <squeljur+git@gmail.com>
Co-authored-by: oatbiscuits <oatbiscuits@proton.me>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: jadedctrl <jadedctrl@posteo.at>
Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org>
Co-authored-by: noureddin <noureddin@protonmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2258
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>

[I18N] Translations update from Weblate (#2274)

Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org>
Co-authored-by: oatbiscuits <oatbiscuits@proton.me>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2274
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>

[I18N] Translations update from Weblate (#2280)

Translations update from [Weblate](https://translate.codeberg.org) for [Forgejo/forgejo](https://translate.codeberg.org/projects/forgejo/forgejo/).

Current translation status:

![Weblate translation status](https://translate.codeberg.org/widget/forgejo/forgejo/horizontal-auto.svg)

Co-authored-by: earl-warren <contact@earl-warren.org>
Co-authored-by: micash <micash_545@protonmail.com>
Co-authored-by: 0que <0que@users.noreply.translate.codeberg.org>
Co-authored-by: oatbiscuits <oatbiscuits@proton.me>
Co-authored-by: jadedctrl <jadedctrl@posteo.at>
Co-authored-by: Werenter <abelokopytov149@gmail.com>
Co-authored-by: bizdelnick <mikhirev@gmail.com>
Co-authored-by: Xinayder <me+codeberg@aoalmeida.com>
Co-authored-by: noureddin <noureddin@protonmail.com>
Co-authored-by: nykula <nykula@ukr.net>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2280
Co-authored-by: Codeberg Translate <translate@noreply.codeberg.org>
Co-committed-by: Codeberg Translate <translate@noreply.codeberg.org>
(cherry picked from commit 9efeca55b1)
2024-02-05 15:11:42 +01:00
Earl Warren 316d88efba
[DOCS] RELEASE-NOTES.md (squash) v1.21.5-0 (squash) go-git
(cherry picked from commit 6fc9ce83ca)
2024-02-05 15:11:35 +01:00
Earl Warren cbff4b34c0
[DOCS] RELEASE-NOTES.md (squash) v1.21.5-0
(cherry picked from commit 29bdaed6d2)
2024-02-05 15:11:27 +01:00
Earl Warren 34d21f6bc2
[I18N] add [common] as first line
To keep weblate happy as it would otherwise be duplicating the content
to all sections.

See https://github.com/WeblateOrg/weblate/issues/10831 for more information.

(cherry picked from commit 5ffc10a00e)
(cherry picked from commit 96d10e793b)
2024-02-05 15:10:55 +01:00
Earl Warren 20b5ca1e6c
[I18n] Forgejo translations
(cherry picked from commit 31378c71ef)

Conflicts:
	options/locale/locale_sk-SK.ini
	s/Gitea/Forgejo/

[I18n] Forgejo translations (squash) forgejo-branding

(cherry picked from commit c29b72ce6d)

[I18n] Forgejo translations (squash) forgejo-dependency

(cherry picked from commit 8c87dd7236)

[I18n] Forgejo translations (squash) russian from weblate

cherry-picked from https://codeberg.org/Werenter/forgejo-translation

(cherry picked from commit 7fec29809b)
(cherry picked from commit 1e3c6af5fe)

Conflicts:
	options/locale/locale_en-US.ini
	https://codeberg.org/forgejo/forgejo/pulls/2295
2024-02-05 15:10:32 +01:00
Earl Warren cb8c9d5bcf
[I18n] tooling and process
Before:

* Translations were imported from Crowdin via Gitea
* New strings were added by Forgejo in feature branches but never translated
* The build/merge-forgejo-locales.go script in the forgejo-i18n branch
  added/replaced Forgejo specific strings in the translated files at
  build time
* Conflicts arising from Gitea changes in locale_en-US.ini were resolved by moving around
  Forgejo strings

Transition:

* The build/merge-forgejo-locales.go is run once on the source
* The result is commited to the forgejo-development branch

After:

* Translation are exported and imported from translate.codeberg.org
* build/crowdin-to-weblate.sh run is run when rebasing (soft-fork)
  or cherry-picking (hard-fork) to collect new translations from
  Crowdin via Gitea
* In case of a conflict Forgejo translations are authoritative
* In the absence of a conflict Crowdin translations are uploaded to Weblate

(cherry picked from commit 9b5b714048)
(cherry picked from commit 6c7b5e322d)
2024-02-05 15:08:04 +01:00
oliverpool 9e54952a51
[WORKFLOW] issues & pr templates (squash) fix link to CONTRIBUTING.md
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2232

Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
(cherry picked from commit 8c0e5d07f8)
(cherry picked from commit 77716e7cd4)
(cherry picked from commit d0d004fe02)
2024-02-05 15:08:04 +01:00
Michael Kriese 97cc955101
[GITEA] feat(nuget): basic manifest download
Refs: https://codeberg.org/forgejo/forgejo/pulls/2222

(cherry picked from commit 5f837efc15)

fix: write xml header

(cherry picked from commit a715984a42)

fix: optional elements and xml schema

(cherry picked from commit 6ea6895a36)

fix: pass all other requests to file search

(cherry picked from commit 9bfc74833a)

test: add integration test

(cherry picked from commit b798f4ce86)

fix: use xmlResponse

(cherry picked from commit 7f76df0b24)
(cherry picked from commit e18d574ca4)
2024-02-05 15:08:04 +01:00
Cyborus bfe87e30af
[WORKFLOW] issues & pr templates (squash) allow empty issues
Refs: https://codeberg.org/forgejo/forgejo/pulls/2164

(cherry picked from commit a6f2ca8c44)
(cherry picked from commit 22933182e5)
(cherry picked from commit 9fe826605f)
(cherry picked from commit c296aeaca6)
2024-02-05 15:08:04 +01:00
Earl Warren 2625bb5fbc
[DOCS] RELEASE-NOTES.md (squash) v1.21.4-0 security
Refs: https://codeberg.org/forgejo/forgejo/issues/2158
(cherry picked from commit 7e663e496e)
(cherry picked from commit 3e5d45a2ab)
(cherry picked from commit 6c22e906fb)
2024-02-05 15:08:04 +01:00
Earl Warren df67c2926f
[DOCS] RELEASE-NOTES.md (squash) v1.21.4-0
Refs: https://codeberg.org/forgejo/forgejo/issues/2158
(cherry picked from commit 5033cd2a43)
(cherry picked from commit 6c6dba480c)
(cherry picked from commit 73a050c001)
2024-02-05 15:08:04 +01:00
Gusted 8735fcdb7d
[GITEA] Vendor rupture dependency
- The [rupture](https://github.com/ethantkoenig/rupture) dependency was
essentially outdated in the sense it was using old version of
dependencies.
- The usage by Forgejo was rather a small portion, so that portion is
now vendored (with its tests).
- Removes old dependencies from go.sum (less dependencies is better for
reviewing what the heck we're importing). Just to note that they were
likely not being used by Go's build process (according to
https://go.dev/ref/mod#minimal-version-selection), so it's really a
matter of formal cleaning up dependencies we don't use and therefor
don't want to download and be in our go.sum.

(cherry picked from commit aa72a5f009)

Conflicts:
	go.sum
	https://codeberg.org/forgejo/forgejo/pulls/2148
(cherry picked from commit fbe8d65f0b)
(cherry picked from commit e18debcb6a)

Conflicts:
	go.sum
	https://codeberg.org/forgejo/forgejo/pulls/2245
(cherry picked from commit 8c43c2ada8)
2024-02-05 15:08:04 +01:00
Earl Warren c070935f13
[SEMVER] 7.0.0+0-gitea-1.22.0
[SEMVER] 6.0.0+0-gitea-1.21.0

(cherry picked from commit 4107d99f25)
(cherry picked from commit 7e097b945c)
(cherry picked from commit 431edaac36)
(cherry picked from commit 51ecd89e31)
(cherry picked from commit 734d7f5bc7)
(cherry picked from commit f34e88d00c)
(cherry picked from commit cd882a75f9)
(cherry picked from commit 7dfa28db3f)
(cherry picked from commit 4bdaeeb686)
(cherry picked from commit a0e8285914)
(cherry picked from commit 72991a99f3)
(cherry picked from commit c99949bbf7)
(cherry picked from commit d4dd7df8e7)
(cherry picked from commit 1fe5c1e81e)
(cherry picked from commit 969b727c50)
(cherry picked from commit f2061a87c0)
(cherry picked from commit 2d75f86f0e)
(cherry picked from commit 29119a870f)
(cherry picked from commit 76dd36c9eb)
(cherry picked from commit ea761bd43c)
(cherry picked from commit 561faf9af5)

(cherry picked from commit 78e512770f)
(cherry picked from commit e16f5b02c6)
(cherry picked from commit c120212caf)
(cherry picked from commit a4807748c3)
(cherry picked from commit 78fd92eae3)
(cherry picked from commit 2f80066217)
(cherry picked from commit 598756833e)
(cherry picked from commit 93f62e9852)
2024-02-05 15:08:04 +01:00
Earl Warren a8538928f7
[DEADCODE] update deadcode-out
(cherry picked from commit ff0554a184)
(cherry picked from commit e9901814be)
(cherry picked from commit 9ff7c41d53)
(cherry picked from commit 9601dee4a3)

[DEADCODE] update deadcode-out (squash) update

(cherry picked from commit aef379c5f5)
(cherry picked from commit 75473ea87a)

[DEADCODE] update deadcode-out (squash) update

(cherry picked from commit 868b7a436f)
(cherry picked from commit 38787c8779)

[DEADCODE] update deadcode-out (squash) update again

(cherry picked from commit 91b2932907)
(cherry picked from commit 39adff772d)
(cherry picked from commit 9f76193ea4)
(cherry picked from commit 8968396cbc)
(cherry picked from commit f87e11e2eb)
2024-02-05 15:08:04 +01:00
Alex Syrnikov c28b19b953
[DEVELOPMENT] added /local/ to .gitignore
Added `/local/` folder in `.gitignore` for developer personal files (rebuild, deploy with custom config, backups, sqlite databases, test curl query scripts, custom configs).

In case of building, deploing, testing locally developer needs some folder for custom personal scripts, configs, data. `/local/` folder in project root is a good place to store all this files.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1816
Co-authored-by: Alex Syrnikov <alex19srv@gmail.com>
Co-committed-by: Alex Syrnikov <alex19srv@gmail.com>
(cherry picked from commit c8138849eb)
(cherry picked from commit 7880660738)
(cherry picked from commit cf9af01d88)
(cherry picked from commit 8d1dcc9e0e)
(cherry picked from commit 93dd605948)
(cherry picked from commit 74972ae17f)
(cherry picked from commit f76ce78578)
(cherry picked from commit eb3e46cd3b)
(cherry picked from commit 5b0125591d)
(cherry picked from commit 31d86205d2)
(cherry picked from commit c2e62c6705)
2024-02-05 15:08:04 +01:00
Gusted c2053dd076
[SHARED] make confirmation clearer for dangerous actions
[GITEA] Fix cancelled migration deletion modal

- https://codeberg.org/forgejo/forgejo/pulls/1473 made that dangerous
actions such as deletion also would need to type in the owner's name.
This was apparently not reflected to the deletion modal for migrations
that failed or were cancelled.

(cherry picked from commit c38dbd6f88)
(cherry picked from commit 7c07592d01)
(cherry picked from commit 78637af2b6)

[SHARED] make confirmation clearer for dangerous actions

- Currently the confirmation for dangerous actions such as transferring
the repository or deleting it only requires the user to ~~copy paste~~
type the repository name.
- This can be problematic when the user has a fork or another repository
with the same name as an organization's repository, and the confirmation
doesn't make clear that it could be deleting the wrong repository. While
it's mentioned in the dialog, it's better to be on the safe side and
also add the owner's name to be an element that has to be typed for
these dangerous actions.
- Added integration tests.

(cherry picked from commit bf679b24dd)
(cherry picked from commit 1963085dd9)
(cherry picked from commit fb94095d19)
(cherry picked from commit e1d1e46afe)
(cherry picked from commit 93993029e4)
(cherry picked from commit df3b058179)
(cherry picked from commit 8ccc6b9cba)
(cherry picked from commit 9fbe28fca3)
(cherry picked from commit 4ef2be6dc7)

https://codeberg.org/forgejo/forgejo/pulls/1873
  Moved test from repo_test.go to forgejo_confirmation_repo_test.go to
  avoid conflicts.
(cherry picked from commit 83cae67aa3)
(cherry picked from commit 447009ff56)
(cherry picked from commit 72c0a6150a)
(cherry picked from commit 8ee9c070b9)
(cherry picked from commit 89aba06403)
(cherry picked from commit 798407599f)
(cherry picked from commit 41c9a2606b)
(cherry picked from commit a57b214e36)
(cherry picked from commit fd287a9134)
2024-02-05 15:07:49 +01:00
Earl Warren 8cbd00592d
[TESTS] createUser via the user model helper for integration tests (squash)
See https://codeberg.org/forgejo/forgejo/pulls/2295
2024-02-05 15:06:51 +01:00
Gusted c6a53c3172
[SECURITY] Rework long-term authentication
- This is a 'front-port' of the already existing patch on v1.21 and
v1.20, but applied on top of what Gitea has done to rework the LTA
mechanism. Forgejo will stick with the reworked mechanism by the Forgejo
Security team for the time being. The removal of legacy code (AES-GCM) has been
left out.
- The current architecture is inherently insecure, because you can
construct the 'secret' cookie value with values that are available in
the database. Thus provides zero protection when a database is
dumped/leaked.
- This patch implements a new architecture that's inspired from: [Paragonie Initiative](https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence#secure-remember-me-cookies).
- Integration testing is added to ensure the new mechanism works.
- Removes a setting, because it's not used anymore.

(cherry picked from commit e3d6622a63)
(cherry picked from commit fef1a6dac5)
(cherry picked from commit b0c5165145)
(cherry picked from commit 7ad51b9f8d)
(cherry picked from commit 64f053f383)
(cherry picked from commit f5e78e4c20)

Conflicts:
	services/auth/auth_token_test.go
	https://codeberg.org/forgejo/forgejo/pulls/2069
(cherry picked from commit f69fc23d4b)
(cherry picked from commit d955ab3ab0)
(cherry picked from commit 9220088f90)
(cherry picked from commit c73ac63696)
(cherry picked from commit 747a176048)

Conflicts:
	models/user/user.go
	routers/web/user/setting/account.go
	https://codeberg.org/forgejo/forgejo/pulls/2295
2024-02-05 15:06:15 +01:00
zareck 3916357840
[TESTS] add TestAPIForkDifferentName
Refs: https://codeberg.org/forgejo/forgejo/pulls/1719

(cherry picked from commit ed34138915)
(cherry picked from commit 166d769a6e)
(cherry picked from commit 8da818646c)
(cherry picked from commit 95c9d6ede4)
(cherry picked from commit 505ffa2cc4)
(cherry picked from commit 602bf1fa7f)

[TESTS] add TestAPIForkDifferentName (squash) do not use token= query param

See https://codeberg.org/forgejo/forgejo/commit/33439b733a

(cherry picked from commit d600fabdbc)
(cherry picked from commit 40c1130c41)
(cherry picked from commit 7b254f84cf)
(cherry picked from commit af15c5a60a)
(cherry picked from commit 852b42bc7a)
(cherry picked from commit 90b3d0ca09)
2024-02-05 14:45:11 +01:00
Gusted 6f960f23e5
[CLEANUP] Reuse ForgejoVersion variable
- Resolves https://codeberg.org/forgejo/forgejo/issues/1226

(cherry picked from commit e383b70109)
(cherry picked from commit 029cfa34de)
(cherry picked from commit 81392b8c55)
(cherry picked from commit 0ebecca1e6)
(cherry picked from commit aff135418d)
(cherry picked from commit b5982f5008)
(cherry picked from commit 00f86df8f4)
(cherry picked from commit 178908c047)
(cherry picked from commit 9cc57d1b3f)
(cherry picked from commit dc80ba9a97)
(cherry picked from commit 5b2f1d7149)
(cherry picked from commit f0ab85cd06)
2024-02-05 14:45:11 +01:00
Gusted 089f51a63c
[DEADCODE] Add deadcode linter
- Add the experimental
[deacode](https://pkg.go.dev/golang.org/x/tools/internal/cmd/deadcode)
linter to Forgejo.
- To deal with false positives that can happen due to build tags or with code
that's currently only referenced by test code, the output of the tool is
compared against a known-good output.
- This commit doesn't make any attempt to remove any deadcode.

(cherry picked from commit ac462279e9)
(cherry picked from commit b5ea6e85ac)
(cherry picked from commit 5915f3643c)

[CLEANUP] Remove deadcode

- This is deadcode since https://codeberg.org/forgejo/forgejo/pulls/1802
removed the usage of it.

(cherry picked from commit d840b9923e)
(cherry picked from commit 9442bab626)
(cherry picked from commit 0de9d18863)
(cherry picked from commit 26abf78374)
(cherry picked from commit 05d3a143c3)
(cherry picked from commit 4b3d38d5e1)
(cherry picked from commit a726e71986)
(cherry picked from commit cb62ae5b98)
(cherry picked from commit 8195ba06d5)
(cherry picked from commit 4570fb591a)
(cherry picked from commit 1f4d33de2b)
2024-02-05 14:45:09 +01:00
Earl Warren c7a389f2b2
[FEAT] allow setting the update date on issues and comments
This field adds the possibility to set the update date when modifying
an issue through the API.

A 'NoAutoDate' in-memory field is added in the Issue struct.
If the update_at field is set, NoAutoDate is set to true and the
Issue's UpdatedUnix field is filled.

That information is passed down to the functions that actually updates
the database, which have been modified to not auto update dates if
requested.

A guard is added to the 'EditIssue' API call, to checks that the
udpate_at date is between the issue's creation date and the current
date (to avoid 'malicious' changes). It also limits the new feature
to project's owners and admins.

(cherry picked from commit c524d33402)

Add a SetIssueUpdateDate() function in services/issue.go

That function is used by some API calls to set the NoAutoDate and
UpdatedUnix fields of an Issue if an updated_at date is provided.

(cherry picked from commit f061caa655)

Add an updated_at field to the API calls related to Issue's Labels.

The update date is applied to the issue's comment created to inform
about the modification of the issue's labels.

(cherry picked from commit ea36cf80f5)

Add an updated_at field to the API call for issue's attachment creation

The update date is applied to the issue's comment created to inform
about the modification of the issue's content, and is set as the
asset creation date.

(cherry picked from commit 96150971ca)

Checking Issue changes, with and without providing an updated_at date

Those unit tests are added:

- TestAPIEditIssueWithAutoDate
- TestAPIEditIssueWithNoAutoDate

- TestAPIAddIssueLabelsWithAutoDate
- TestAPIAddIssueLabelsWithNoAutoDate

- TestAPICreateIssueAttachmentWithAutoDate
- TestAPICreateIssueAttachmentWithNoAutoDate

(cherry picked from commit 4926a5d7a2)

Add an updated_at field to the API call for issue's comment creation

The update date is used as the comment creation date, and is applied to
the issue as the update creation date.

(cherry picked from commit 76c8faecdc)

Add an updated_at field to the API call for issue's comment edition

The update date is used as the comment update date, and is applied to
the issue as an update date.

(cherry picked from commit cf787ad7fd)

Add an updated_at field to the API call for comment's attachment creation

The update date is applied to the comment, and is set as the asset
creation date.

(cherry picked from commit 1e4ff424d3)

Checking Comment changes, with and without providing an updated_at date

Those unit tests are added:

- TestAPICreateCommentWithAutoDate
- TestAPICreateCommentWithNoAutoDate

- TestAPIEditCommentWithAutoDate
- TestAPIEditCommentWithNoAutoDate

- TestAPICreateCommentAttachmentWithAutoDate
- TestAPICreateCommentAttachmentWithNoAutoDate

(cherry picked from commit da932152f1)

Pettier code to set the update time of comments

Now uses sess.AllCols().NoAutoToime().SetExpr("updated_unix", ...)

XORM is smart enough to compose one single SQL UPDATE which all
columns + updated_unix.

(cherry picked from commit 1f6a42808d)

Issue edition: Keep the max of the milestone and issue update dates.

When editing an issue via the API, an updated_at date can be provided.
If the EditIssue call changes the issue's milestone, the milestone's
update date is to be changed accordingly, but only with a greater
value.

This ensures that a milestone's update date is the max of all issue's
update dates.

(cherry picked from commit 8f22ea182e)

Rewrite the 'AutoDate' tests using subtests

Also add a test to check the permissions to set a date, and a test
to check update dates on milestones.

The tests related to 'AutoDate' are:
- TestAPIEditIssueAutoDate
- TestAPIAddIssueLabelsAutoDate
- TestAPIEditIssueMilestoneAutoDate
- TestAPICreateIssueAttachmentAutoDate
- TestAPICreateCommentAutoDate
- TestAPIEditCommentWithDate
- TestAPICreateCommentAttachmentAutoDate

(cherry picked from commit 961fd13c55)
(cherry picked from commit d52f4eea44)
(cherry picked from commit 3540ea2a43)

Conflicts:
	services/issue/issue.go
	https://codeberg.org/forgejo/forgejo/pulls/1415
(cherry picked from commit 56720ade00)

Conflicts:
	routers/api/v1/repo/issue_label.go
	https://codeberg.org/forgejo/forgejo/pulls/1462
(cherry picked from commit 47c78927d6)
(cherry picked from commit 2030f3b965)
(cherry picked from commit f02aeb7698)

Conflicts:
	routers/api/v1/repo/issue_attachment.go
	routers/api/v1/repo/issue_comment_attachment.go
	https://codeberg.org/forgejo/forgejo/pulls/1575
(cherry picked from commit d072525b35)
(cherry picked from commit 8424d0ab3d)
(cherry picked from commit 5cc62caec7)
(cherry picked from commit d6300d5dcd)

[FEAT] allow setting the update date on issues and comments (squash) apply the 'update_at' value to the cross-ref comments (#1676)

[this is a follow-up to PR #764]

When a comment of issue A referencing issue B is added with a forced 'updated_at' date, that date has to be applied to the comment created in issue B.

-----

Comment:

While trying my 'RoundUp migration script', I found that this case was forgotten in PR #764 - my apologies...

I'll try to write a functional test, base on models/issues/issue_xref_test.go

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1676
Co-authored-by: fluzz <fluzz@freedroid.org>
Co-committed-by: fluzz <fluzz@freedroid.org>
(cherry picked from commit ac4f727f63)
(cherry picked from commit 5110476ee9)
(cherry picked from commit 77ba6be1da)
(cherry picked from commit 9c8337b5c4)
(cherry picked from commit 1d689eb686)
(cherry picked from commit 511c519c87)
(cherry picked from commit 2f0b4a8f61)
(cherry picked from commit fdd4da111c)

[FEAT] allow setting the update date on issues and comments (squash) do not use token= query param

See https://codeberg.org/forgejo/forgejo/commit/33439b733a

(cherry picked from commit c5139a75b9)
(cherry picked from commit c7b572c35d)
(cherry picked from commit aec7503ff6)
(cherry picked from commit 87c65f2a49)
(cherry picked from commit bd47ee33c2)
(cherry picked from commit f3dbd90a74)
2024-02-05 14:44:33 +01:00
Earl Warren 563b7f8345
[UPGRADE] run sanity checks before the database is upgraded
https://codeberg.org/forgejo/forgejo/pulls/1543
(cherry picked from commit fbb71f464b)
(cherry picked from commit 650f849c84)
(cherry picked from commit 25e0d33dfe)
(cherry picked from commit 222b70e504)
(cherry picked from commit 4be04627a7)
(cherry picked from commit 64fcb25de3)
(cherry picked from commit 740943d6b0)
(cherry picked from commit 3c096abf11)
(cherry picked from commit da04dcb099)
(cherry picked from commit b881d83f1c)
(cherry picked from commit 7e7492b996)
(cherry picked from commit 869edd3b0a)
(cherry picked from commit d96fbda274)
(cherry picked from commit 09c00cbd00)
(cherry picked from commit 10a1bf8122)
(cherry picked from commit 2eb223c0f6)
(cherry picked from commit 1eaba14638)
2024-02-05 14:44:33 +01:00
Earl Warren 3518a1d4cd
[SEMVER] store SemVer in ForgejoSemVer after a database upgrade
https://codeberg.org/forgejo/forgejo/pulls/1543
(cherry picked from commit 6146ef6263)
(cherry picked from commit 45b9005ad9)
(cherry picked from commit 4622cc5cc4)
(cherry picked from commit ed39cdc54c)
(cherry picked from commit b837dbd434)
(cherry picked from commit a0abe20b1b)
(cherry picked from commit 6f5c2f902e)
(cherry picked from commit efbae03e02)
(cherry picked from commit a763b5949f)
(cherry picked from commit d611dc07ac)
(cherry picked from commit f31264ab57)
(cherry picked from commit a32a1fcd94)
(cherry picked from commit 568711e103)
(cherry picked from commit 80ef964857)
(cherry picked from commit 66af8f2ae8)
(cherry picked from commit 7a1c9fa236)
(cherry picked from commit f140388ae4)
2024-02-05 14:44:33 +01:00
Earl Warren 27ee15e86e
[TESTS] tests.AddFixtures helper loads additional per-test fixtures
(cherry picked from commit 93a844dd13)
(cherry picked from commit 6d6d1a121c)
(cherry picked from commit 8b101f2860)
(cherry picked from commit 3e56212d6d)
(cherry picked from commit 4f619bc585)
(cherry picked from commit 06a47ea56e)
(cherry picked from commit 5a4d56e77b)
(cherry picked from commit 84b9d3a0c3)
(cherry picked from commit 1eb2eca71c)
(cherry picked from commit 11d0fe5400)
(cherry picked from commit c93b8b9d3c)
(cherry picked from commit 679a7e2efa)
(cherry picked from commit e31a3abb7d)
(cherry picked from commit 72bedf68a7)
(cherry picked from commit ef139ac06f)
(cherry picked from commit 134bf83982)
(cherry picked from commit caf5780c57)
2024-02-05 14:44:33 +01:00
Gusted 52e863ba5a
[META] Add CODEOWNERS files
- As per https://codeberg.org/forgejo/discussions/issues/53#issuecomment-1070207
- Using the `CODEOWNERS` feature it should speed up the development
process for contributors as for the most common PRs the right reviewers
will be added by Forgejo automatically. They can be added very
precisely according to the changed files of the PR.
- This feature is implemented in v1.21, which means it's not available
on Codeberg.

(cherry picked from commit 1511ef1c80)
(cherry picked from commit 99999e3a03)
(cherry picked from commit 0b0dd6f7a9)
(cherry picked from commit d42940034f)
(cherry picked from commit 5be6e7d254)
(cherry picked from commit d12d6e8633)
(cherry picked from commit d3b3e691bf)
(cherry picked from commit 2a13f95551)
(cherry picked from commit 6d882ede35)
(cherry picked from commit 7c8d754ac6)
(cherry picked from commit 842000a586)
(cherry picked from commit 40d49b5107)
(cherry picked from commit b446a99335)
(cherry picked from commit 6600fa86c3)
(cherry picked from commit 1d16607db5)
(cherry picked from commit ee5da9318b)
(cherry picked from commit 49e033cec8)
(cherry picked from commit 9bca34ef03)
(cherry picked from commit 59c0454c21)
(cherry picked from commit be081bca69)
2024-02-05 14:44:33 +01:00
Caesar Schinas 6de3c938ee
[WORKFLOW] yaml issue templates
(cherry picked from commit 28c0f327cf)
(cherry picked from commit 1b532f16c7)
(cherry picked from commit 6e35d3ffb1)
(cherry picked from commit 3e6ba3b3b7)
(cherry picked from commit d47d8dd966)
(cherry picked from commit 2716166cd4)
(cherry picked from commit 50c67cb906)
(cherry picked from commit ba0049afc1)
(cherry picked from commit 09c596b3c3)
(cherry picked from commit b761117258)
(cherry picked from commit 45c9dc8f20)
(cherry picked from commit 861fb8ee61)
(cherry picked from commit aeb6f7a5fc)
(cherry picked from commit cd4759816c)
(cherry picked from commit 1d58ed60dd)
(cherry picked from commit d6e4bf1523)

[WORKFLOW] yaml issue templates (squahs) fix typo

Refs: https://codeberg.org/forgejo/forgejo/issues/1958
(cherry picked from commit a962747b40)
(cherry picked from commit df4123474b)
(cherry picked from commit 0e56506a9b)
(cherry picked from commit 7664a4c9fc)
(cherry picked from commit 5e25c46ba2)
(cherry picked from commit bc02f05346)
(cherry picked from commit 084e3b5e2f)
(cherry picked from commit e53c0314e9)
2024-02-05 14:44:33 +01:00
Earl Warren f6ba73de4c
[UPGRADE] add sanity checks for [storage*]
Refs: https://forgejo.org/2023-08-release-v1-20-3-0/
(cherry picked from commit a266dd0ce3)
(cherry picked from commit b9eb5eccd8)
(cherry picked from commit 7fc2028ede)
(cherry picked from commit 0c988e6120)
(cherry picked from commit 7ba05e8c2b)
(cherry picked from commit 2ed5068abe)
(cherry picked from commit 353913a26d)
(cherry picked from commit 4e63a01a8b)
(cherry picked from commit 99f612aed3)
(cherry picked from commit b4fe189cae)
(cherry picked from commit bd35e3b7bc)
(cherry picked from commit f59d9f7088)
(cherry picked from commit 0b2a93e044)
(cherry picked from commit 8c5d8bfea0)
(cherry picked from commit 2817ce027c)
(cherry picked from commit 162056cbcf)
(cherry picked from commit 07152a0ba6)
(cherry picked from commit 72e3777915)
(cherry picked from commit 3b1ebd95b9)
(cherry picked from commit 14fc4f3fac)
(cherry picked from commit 9052c86e8c)
(cherry picked from commit 16f1cc21ea)
(cherry picked from commit 0fef12f5d8)
(cherry picked from commit d187381f73)
(cherry picked from commit 9dda715111)
2024-02-05 14:44:33 +01:00
Earl Warren 160ae5ee23
[UPGRADE] run sanity checks before the database is upgraded
(cherry picked from commit 69741e4e66)
(cherry picked from commit 2a3c7b09cb)
(cherry picked from commit a1554c1168)
(cherry picked from commit edae2c6d2d)
(cherry picked from commit 49737cf009)
(cherry picked from commit ec53704c34)
(cherry picked from commit 7a1c5c0f32)
(cherry picked from commit e658c20c0f)
(cherry picked from commit baf575468f)
(cherry picked from commit 40cb14eff4)
(cherry picked from commit 25ab4d0713)
(cherry picked from commit 5a29005215)
(cherry picked from commit fef1260e99)
(cherry picked from commit eadbbb1afe)
(cherry picked from commit db22d61eb4)
(cherry picked from commit 9d3b0be39a)
(cherry picked from commit b3fa3c1292)
(cherry picked from commit c8300d4fe2)
(cherry picked from commit 8ba6a4c9db)
(cherry picked from commit 8b8df652c1)
(cherry picked from commit fc8fa050c6)
(cherry picked from commit bcf3faf698)
(cherry picked from commit 514a631aa6)
(cherry picked from commit 529c7a09f7)
(cherry picked from commit 0d093d76e2)
2024-02-05 14:44:33 +01:00
Earl Warren 20f022de72
[GITEA] add GetFile to config provider
(cherry picked from commit 88d1b53eea)
(cherry picked from commit f63f71afad)
(cherry picked from commit 1f774145fc)
(cherry picked from commit 53e637693b)
(cherry picked from commit 4974cbf10a)
(cherry picked from commit 554bca7fae)
(cherry picked from commit 61b8cf83b9)
(cherry picked from commit d8bcc6f68c)
(cherry picked from commit ee04c34072)
(cherry picked from commit 713153a6d6)
(cherry picked from commit 4e18c4f8bb)
(cherry picked from commit 32be9db12d)
(cherry picked from commit fd50e9b9b4)
(cherry picked from commit 11717b864b)
(cherry picked from commit b70f3e0fa5)
(cherry picked from commit 2d802b2963)
(cherry picked from commit f61e2f71e2)
(cherry picked from commit 31723651c9)
(cherry picked from commit 38f6f703a0)
(cherry picked from commit 75f6716905)
(cherry picked from commit fed2b2daf5)
(cherry picked from commit a9bafa5021)
(cherry picked from commit 8ce897b3fe)
(cherry picked from commit c806addcd0)
(cherry picked from commit e70d51bd26)
2024-02-05 14:44:33 +01:00
Earl Warren 726f3b1d84
[TESTS] verify facts for the admin storage documentation
(cherry picked from commit 57e597bf7e)
(cherry picked from commit 643a2b0e81)
(cherry picked from commit f10faffb4f)
(cherry picked from commit b440c5767e)

[TESTS] verify facts for the admin storage documentation (squash)

(cherry picked from commit d83d8ce57b)
(cherry picked from commit d8855ef27c)
(cherry picked from commit 11230466ec)
(cherry picked from commit b2cdd9d971)
(cherry picked from commit a0a5e78524)
(cherry picked from commit 846413110f)
(cherry picked from commit 72b92d5a78)
(cherry picked from commit 7e039a9427)
(cherry picked from commit 227d42a1b6)
(cherry picked from commit 6488950a9b)
(cherry picked from commit 0285c99774)
(cherry picked from commit 0527bb20db)
(cherry picked from commit b4d3fd43e3)
(cherry picked from commit b45db64300)
(cherry picked from commit 722ab37611)
(cherry picked from commit ff45632b42)
(cherry picked from commit 5144ae2aa7)
(cherry picked from commit f51438cd68)
(cherry picked from commit 5ec304e5a1)
(cherry picked from commit 440b8c1af1)
(cherry picked from commit e5bbc626c1)
(cherry picked from commit a996fe0fe4)
2024-02-05 14:44:33 +01:00
Earl Warren 081a155cc1
[SEMVER] store SemVer in ForgejoSemVer after a database upgrade
(cherry picked from commit b7fe7cf401)
(cherry picked from commit cf339eed4f)
(cherry picked from commit 4f3a16168b)
(cherry picked from commit 6f5bbc53fc)
(cherry picked from commit aca42b422e)
(cherry picked from commit 5a7f7580e5)
(cherry picked from commit 06c383c807)
(cherry picked from commit fe831dcb53)
(cherry picked from commit cd12cd0dbc)
(cherry picked from commit cc79163703)
(cherry picked from commit 0102a5715e)
(cherry picked from commit 403f7520b3)
(cherry picked from commit a3b61510a2)
(cherry picked from commit f83f0f9feb)
(cherry picked from commit fd1c3a6d09)
(cherry picked from commit f7cdc3d6f1)
(cherry picked from commit 060121b644)
(cherry picked from commit 62c847ff02)
(cherry picked from commit 4d051b51c2)
(cherry picked from commit 86e6981a93)
(cherry picked from commit c1fc9e441b)
(cherry picked from commit 8bb2f0871a)
(cherry picked from commit 0cd9fe5251)
(cherry picked from commit b0b44778b4)
(cherry picked from commit 7c2f4f749f)
2024-02-05 14:44:33 +01:00
Gusted 76c7df9630
[DB] forgejo migration v1: add blocked user migration
(cherry picked from commit 66afddd511)
(cherry picked from commit 19da0dee9d)
(cherry picked from commit 0b725af693)
(cherry picked from commit 64d4de2b66)
(cherry picked from commit 05bc9d3b7f)
(cherry picked from commit 5958553066)
(cherry picked from commit c4f77e26c9)
(cherry picked from commit 3034832c66)
(cherry picked from commit d48931ec5b)
(cherry picked from commit b1e0d53c28)
(cherry picked from commit e3de35fe15)
(cherry picked from commit 3b2712c3d6)
(cherry picked from commit 00c6940851)
(cherry picked from commit ac56c7a202)
(cherry picked from commit d957fb66de)
(cherry picked from commit 01e9125f1b)
(cherry picked from commit 71675caecb)
(cherry picked from commit 0313d02e50)
(cherry picked from commit d2952769c1)
(cherry picked from commit 63d080cdcf)
(cherry picked from commit 43ced29b28)
(cherry picked from commit e556074abd)
(cherry picked from commit 165409d8ff)
(cherry picked from commit 0a3f370162)
2024-02-05 14:44:33 +01:00
Earl Warren 40b99a5f89
[DB] forgejo migration v2: create the forgejo_sem_ver table
(cherry picked from commit 86b26436af)
(cherry picked from commit 479cba59ac)
(cherry picked from commit 4765f9a889)
(cherry picked from commit af771410bf)
(cherry picked from commit d1ea9305d8)
(cherry picked from commit f77e1bb7ab)
(cherry picked from commit 0b95f8fe89)
(cherry picked from commit 4f8fb2390a)
(cherry picked from commit 8ea0e22ff6)
(cherry picked from commit 43ac19ac59)
(cherry picked from commit 0d2f63df4f)
(cherry picked from commit d02a8036fd)
(cherry picked from commit 1fe4c7db94)
(cherry picked from commit d641cdeaf0)
(cherry picked from commit 10e8a4f8b8)
(cherry picked from commit 8097bc40b3)
(cherry picked from commit ee5cb37d7e)
(cherry picked from commit 26d93b8e49)
(cherry picked from commit bc73195e59)
(cherry picked from commit a763fa5de2)
(cherry picked from commit 4b000cb435)
(cherry picked from commit 9f6d20e73f)
(cherry picked from commit b5001edeea)
(cherry picked from commit 7632171832)
(cherry picked from commit 816c5b0c4e)
2024-02-05 14:44:33 +01:00
Earl Warren 72c1f20715
[DB] run all Forgejo migrations in integration tests
The tests at tests/integration/migration-test/migration_test.go will
not run any Forgejo migration when using the gitea-*.sql.gz files
because they do not contain a ForgejoVersion row which is interpreted
as a new Forgejo installation for which there is no need for migration.

Create a situation by which the ForgejoVersion table exists and has a
version of 0 in tests/integration/migration-test/forgejo-v1.19.0.*.sql.gz
thus ensuring all Forgejo migrations are run.

The forgejo*.sql.gz files do not have any Gitea related records, which
will be interpreted by the Gitea migrations as a new installation that
does not need any migration. As a consequence the migration tests run
when using forgejo-v1.19.0.*.sql.gz are exclusively about Forgejo
migrations.

(cherry picked from commit ec8003859c)
(cherry picked from commit 697570ff39)
(cherry picked from commit f041aec172)
(cherry picked from commit 60463e3bab)
(cherry picked from commit b2fc2a7c13)
(cherry picked from commit fb2759b6af)
(cherry picked from commit 37cfc3b227)
(cherry picked from commit 832607500a)
(cherry picked from commit 143d4007b1)
(cherry picked from commit a17e803fbf)
(cherry picked from commit 72ffd49bc3)
(cherry picked from commit 9b92a5fd72)
(cherry picked from commit 0a334d0a9b)
(cherry picked from commit 3add683c94)
(cherry picked from commit 8ed3f3f86b)
(cherry picked from commit 97dc65852b)
(cherry picked from commit e0503cbfea)
(cherry picked from commit f25e6a196b)
(cherry picked from commit cca19c7a4e)
(cherry picked from commit 2c89d7f18c)
(cherry picked from commit 4eb8695c40)
(cherry picked from commit e4c42a68ff)
(cherry picked from commit f76d5e0a82)
(cherry picked from commit c6e5a2962c)
(cherry picked from commit f9927a2253)
2024-02-05 14:44:33 +01:00
Gusted 8bb5e8b2b4
[DB] Forgejo database migrations
- Implements https://codeberg.org/forgejo/discussions/issues/32#issuecomment-918737
- Allows to add Forgejo-specific migrations that don't interfere with Gitea's migration logic. Please do note that we cannot liberally add migrations for Gitea tables, as they might do their own migrations in a future version on that table, and that could undo our migrations. Luckily,  we don't have a scenario where that's needed and thus not taken into account.

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/795
(cherry picked from commit 8ee32978c0)
(cherry picked from commit c240b34f59)
(cherry picked from commit 03936c6492)
(cherry picked from commit a20ed852f8)
(cherry picked from commit 1dfa82676f)
(cherry picked from commit c39ae0bf8a)
(cherry picked from commit cfaff08996)
(cherry picked from commit 94a458835a)
(cherry picked from commit 61a3cf77df)
(cherry picked from commit abb350fde8)
(cherry picked from commit 5194829d6b)
(cherry picked from commit 89239a60f2)
(cherry picked from commit 683cfd86ef)
(cherry picked from commit f4546cfed9)
(cherry picked from commit 86614d5826)
(cherry picked from commit e4b9c32187)
(cherry picked from commit 8c253719af)
(cherry picked from commit 857365d6c1)
(cherry picked from commit a488b3952f)
(cherry picked from commit 98313c4910)
(cherry picked from commit 430d95e824)
(cherry picked from commit 08bf9d918f)
(cherry picked from commit f8a170e2d0)
(cherry picked from commit d20e325378)
(cherry picked from commit 6c0aa7dd4f)
(cherry picked from commit 46c08c26c7)
(cherry picked from commit 9ee22153c4)

[DB] Ensure forgejo migration up to date (squash)

- Hook Forgejo's `EnsureUpToDate` to Gitea's `EnsureUpToDate`, such that
the Forgejo migrations are also being checked to be up to date.
- I'm not sure how I missed this and if this has caused any problems,
but due to the lack of any open issue about it it seems to not be a big
problem.

(cherry picked from commit 6c65b6dcf6)
(cherry picked from commit 6d45c37d84)

[DB] Add test for TestEnsureUpToDate (squash)

- Add a test for the behavior of `EnsureUpToDate`, to ensure it will
error when needed and succeed when the forgejo version is up to date.
- Add forgejo_migrations package to GO_TEST_PACKAGES, to avoid running
it with `test-unit` and instead test it with `test-*-migration`.

(cherry picked from commit b172a50691)
(cherry picked from commit d8af308820)
(cherry picked from commit e69e64a32c)
(cherry picked from commit 4e8363fad4)
(cherry picked from commit fc9ecd6c53)
(cherry picked from commit e5c446e3dc)
(cherry picked from commit 7066a15655)
(cherry picked from commit 9183cdc835)
(cherry picked from commit 5f93039e0d)

Conflicts:
	Makefile
	https://codeberg.org/forgejo/forgejo/pulls/2245
(cherry picked from commit a039b3b0c9)
2024-02-05 14:44:33 +01:00
Panagiotis "Ivory" Vasilopoulos 4df238bda0
[FEAT] Use OpenStreetMap in USER_LOCATION_MAP_URL by default
Follow-up to d58c542579 for Forgejo.

By default, Gitea does not select any map service that can be used
to introduce a 'Show this place on a map' button in the location
field of a user profile. Before I tried upstreaming this change to
Gitea, this was the case in Forgejo. This patch essentially recovers
this functionality, which is nice for public-facing instances and
communities.

Links to original PRs:
- https://codeberg.org/forgejo/forgejo/pulls/1076
- https://github.com/go-gitea/gitea/pull/26214

(cherry picked from commit bb187d5f61)
(cherry picked from commit ce02ef9078)
(cherry picked from commit 6b75c40e25)
(cherry picked from commit 6bc8e9f573)
(cherry picked from commit 063f8afdf7)
(cherry picked from commit c5cc736b72)
(cherry picked from commit 7b1bb4bedc)
(cherry picked from commit 2a022dceb4)
(cherry picked from commit a946c142d2)
(cherry picked from commit 8a4ea0c7ab)
(cherry picked from commit 37bfb05b34)
(cherry picked from commit 12fbbb1754)
(cherry picked from commit abe9de2cd9)
(cherry picked from commit 84db578717)
(cherry picked from commit 1beab7af46)
(cherry picked from commit 8779d505f2)
(cherry picked from commit 21a788f2eb)
(cherry picked from commit a7cc6d1687)
(cherry picked from commit 25f840379f)
(cherry picked from commit 0db65f1122)
(cherry picked from commit 0e08cbc854)
(cherry picked from commit 57de51db8d)
(cherry picked from commit 5ab3dcabb1)
(cherry picked from commit 7b5ad0c13b)
(cherry picked from commit adf449a115)
(cherry picked from commit 77aa18227e)
2024-02-05 14:44:33 +01:00
Gusted 32697b6a25
[META] Use correct language for .tmpl
- Upstream chosen `Handlebars` as language for the templates, presumenly
because Github doesn't have an syntax highlighter for Go.
- Forgejo does have syntax highlighting support for Go templates, so use that.

(cherry picked from commit a79718522d)
(cherry picked from commit 380d847e5c)
(cherry picked from commit 4126a9672d)
(cherry picked from commit afde0ed822)
(cherry picked from commit 6ddaca0061)
(cherry picked from commit 454b2f6b35)
(cherry picked from commit 58c10e1f93)
(cherry picked from commit 19ec0a5536)
(cherry picked from commit c3717ae4de)
(cherry picked from commit 6c74bbe575)
(cherry picked from commit 9cb48db780)
(cherry picked from commit 19cb774553)
(cherry picked from commit ac35eb83cd)
(cherry picked from commit 986a306d22)
(cherry picked from commit cd841848ee)
(cherry picked from commit 9fd13853df)
(cherry picked from commit 4fa3942c19)
(cherry picked from commit da23365e0f)
(cherry picked from commit 72d189e4c4)
(cherry picked from commit d9f2a915c2)
(cherry picked from commit d8773a323d)
(cherry picked from commit aedaafe947)
(cherry picked from commit f6ce73da17)
(cherry picked from commit f2cdb2fa66)
(cherry picked from commit 810a983f4b)
(cherry picked from commit 1550d00198)
2024-02-05 14:44:33 +01:00
Earl Warren 3fbe9c5840
[TESTS] increase test-sqlite log level to Trace
It does not pollute the output because they go to sqlite-log/gitea.log
and it may provide clues for debugging. When trying to figure out a
problem in production, Debug is likely to be used but in a development
environment a very fine grain log is the most useful. If that's really
too much noise, the lines can be trimmed by removing all those with [T].

(cherry picked from commit 666b02eb9d)
(cherry picked from commit b69e4d3058)
(cherry picked from commit 0c1aecd7ec)
(cherry picked from commit 0304e41345)
(cherry picked from commit 4bcc7e02ce)
(cherry picked from commit 98364235f2)
(cherry picked from commit ca465e97c1)
(cherry picked from commit 653045ade1)
(cherry picked from commit 9ca2e644ab)
(cherry picked from commit 47c8a05b37)
(cherry picked from commit 4235d929ed)
(cherry picked from commit 10541c4b1c)
(cherry picked from commit c1a0e1eb2f)
(cherry picked from commit 1c20bf30b2)
(cherry picked from commit d4b372db31)
(cherry picked from commit fe3e434299)
(cherry picked from commit d2b544847f)
(cherry picked from commit 059f067a98)
(cherry picked from commit 72ad3d7d7e)
(cherry picked from commit 6037e9a273)
(cherry picked from commit d63aee6921)
(cherry picked from commit 7a0d05f802)
(cherry picked from commit 9b9965b269)
(cherry picked from commit 5ca35d9753)
(cherry picked from commit 9b003f0a0e)
(cherry picked from commit d3769a6cdc)
(cherry picked from commit b84f38e71c)
(cherry picked from commit 85e687e551)
2024-02-05 14:44:33 +01:00
Earl Warren 345ceeb98f
[TESTS] coverage for SignInOAuthCallback
(cherry picked from commit f8e1619b99)
(cherry picked from commit 46d8bc9bdf)
(cherry picked from commit e0c7b7055f)
(cherry picked from commit faab747f8e)
(cherry picked from commit 46acb6a9a7)
(cherry picked from commit 22d964e744)
(cherry picked from commit 4c8a6031ac)
(cherry picked from commit 032e8c7a9a)
(cherry picked from commit 7a17a3b0fb)
(cherry picked from commit 8ea71c2a31)
(cherry picked from commit 4b027e2d37)
(cherry picked from commit d787089a5d)
(cherry picked from commit 7b9999357a)
(cherry picked from commit 80eb531c38)
(cherry picked from commit 373b198bfb)
(cherry picked from commit 15781eedf7)
(cherry picked from commit 46bdb17a2f)
(cherry picked from commit 22ec6c11ee)
(cherry picked from commit 3f94b9a111)
(cherry picked from commit a4194c29ff)
(cherry picked from commit aa80ba2ed1)
(cherry picked from commit d349f3e80e)
(cherry picked from commit ccb073f71a)
(cherry picked from commit d8a996a9c1)
(cherry picked from commit af12965737)
(cherry picked from commit 3867b17a48)
(cherry picked from commit 0c48072b2e)
(cherry picked from commit 9c5d675ded)
(cherry picked from commit 665119370f)
(cherry picked from commit 658417e7ad)
2024-02-05 14:44:32 +01:00
Earl Warren 5455605342
[TESTS] oauth2: add integration test helpers
(cherry picked from commit e11dcc60f2)

use backticks to avoid backslash

(cherry picked from commit 34212791ee)
(cherry picked from commit bde9473c69)
(cherry picked from commit d4deb43084)
(cherry picked from commit 08e91649b0)
(cherry picked from commit 2b988e5415)

[TESTS] auth LinkAccount test coverage (squash)

(cherry picked from commit a2b2e3066b)
(cherry picked from commit 841d1b5073)
(cherry picked from commit 35da630ad8)
(cherry picked from commit caf2dc4fa7)
(cherry picked from commit 6eb81e67ba)
(cherry picked from commit d59757239f)
(cherry picked from commit 38a121b688)
(cherry picked from commit 20613874ee)
(cherry picked from commit 6d2705e108)
(cherry picked from commit f177b72814)
(cherry picked from commit 75e1fc4c83)
(cherry picked from commit ba64fa9867)
(cherry picked from commit 0b8ab0893e)
(cherry picked from commit 1419d11435)
(cherry picked from commit 38766847e0)
(cherry picked from commit 6f23426a6a)
(cherry picked from commit 9e0ff9ca54)
(cherry picked from commit 353f3601c3)
(cherry picked from commit 6e4ae401d8)
(cherry picked from commit 1a7afe4153)
(cherry picked from commit f9f3e0cc02)
(cherry picked from commit 22fd0337f3)
(cherry picked from commit ee57e138d1)
(cherry picked from commit 21f9b7e73d)
(cherry picked from commit 17c548c092)
(cherry picked from commit 02d3186517)
(cherry picked from commit f02a040fa2)
(cherry picked from commit 3cf9f82b28)
(cherry picked from commit aa9d06dbac)
(cherry picked from commit 6894213154)
2024-02-05 14:44:32 +01:00
Earl Warren 34a5fe68a7
[TESTS] createUser via the user model helper for integration tests
(cherry picked from commit c1d14c5fff)
(cherry picked from commit e0e8aabc98)
(cherry picked from commit 392a415070)
(cherry picked from commit c7cf1307ca)
(cherry picked from commit 93b13d092b)

[TESTS] createUser via the user model helper for integration tests (squash)

(cherry picked from commit 6ff2383952)
(cherry picked from commit de2a6fe8c3)
(cherry picked from commit 398a6ab072)
(cherry picked from commit 16abc89780)
(cherry picked from commit 312a3ec5d9)
(cherry picked from commit 85c6d8e290)
(cherry picked from commit 79150d30a4)
(cherry picked from commit 436137962d)
(cherry picked from commit e4eb8d471e)
(cherry picked from commit a7257052f4)
(cherry picked from commit d5eba9a6dd)
(cherry picked from commit d89ef2ffa9)
(cherry picked from commit f1d25aa307)
(cherry picked from commit 60c7c07353)
(cherry picked from commit cfeff3afdb)
(cherry picked from commit 608ac6bd68)
(cherry picked from commit c64e530a13)
(cherry picked from commit 513db02971)
(cherry picked from commit 43eaaa5a61)
(cherry picked from commit 678eb49440)
(cherry picked from commit f7458dabda)
(cherry picked from commit 32568e43b4)
(cherry picked from commit 3fcbb2043d)
(cherry picked from commit 95f0b8eefa)
(cherry picked from commit f285b9469d)
(cherry picked from commit 4b8a02ad08)
(cherry picked from commit 70eb98025b)
(cherry picked from commit dc2d448705)
(cherry picked from commit e1402ca319)
(cherry picked from commit 807d587285)
2024-02-05 14:44:32 +01:00
Loïc Dachary de51b21624
[SECURITY] default to pbkdf2 with 320,000 iterations
(cherry picked from commit 3ea0b287d7)
(cherry picked from commit db8392a8ac)
(cherry picked from commit bd2a5fa292)
(cherry picked from commit 2436acb3d9)
(cherry picked from commit 62f50e1c52)
(cherry picked from commit dba1892521)
(cherry picked from commit 4b58e3b6d4)
(cherry picked from commit 1247056856)
(cherry picked from commit afbaea7009)
(cherry picked from commit dcd4813d96)
(cherry picked from commit b51dc963d1)
(cherry picked from commit 611e895efd)
(cherry picked from commit fd492a03f5)
(cherry picked from commit 2c99991f44)
(cherry picked from commit 7426c1edb4)
(cherry picked from commit 373244f8b2)
(cherry picked from commit 4f6efecdb9)
(cherry picked from commit 61d500808e)
(cherry picked from commit 65f8384b63)
(cherry picked from commit 12ed28e734)
(cherry picked from commit ec6cdc9e1a)
(cherry picked from commit 08653ba051)
(cherry picked from commit d5847c87cb)
(cherry picked from commit 640a96e19b)
(cherry picked from commit 46177814a9)
(cherry picked from commit b0098f5a80)
(cherry picked from commit ce5ddeeca9)
(cherry picked from commit 5736fa1025)
(cherry picked from commit c43ca210fc)
(cherry picked from commit 7f92906bf3)
(cherry picked from commit f726525d2d)
(cherry picked from commit db86c93b0b)
(cherry picked from commit 6751bd93c3)
(cherry picked from commit 74bb523ac9)
(cherry picked from commit 94f9045a81)
(cherry picked from commit 5297eac42d)
(cherry picked from commit 57e3c57c51)
(cherry picked from commit c5cacfee51)
(cherry picked from commit dfa31ee004)
(cherry picked from commit d7d10a76b4)
(cherry picked from commit 62bd4edd46)
(cherry picked from commit 798c211f86)
(cherry picked from commit 1f645aecea)
(cherry picked from commit 8a8b62e10e)
(cherry picked from commit d3ff4e1fdf)
(cherry picked from commit 81412571f8)
(cherry picked from commit e9faa1f4e0)
(cherry picked from commit bce1ab85f7)
2024-02-05 14:44:32 +01:00
Earl Warren c3985f05e8
[API] Forgejo API /api/forgejo/v1
(cherry picked from commit 20b5669269)
(cherry picked from commit 1574643a6a)

Update semantic version according to specification

(cherry picked from commit 22510f4130)

Mise à jour de 'Makefile'

(cherry picked from commit c3d85d8409)
(cherry picked from commit 5ea2309851)
(cherry picked from commit ec5217b9d1)
(cherry picked from commit 14f08e364b)
(cherry picked from commit b4465c67b8)

[API] [SEMVER] replace number with version

(cherry picked from commit fba48e6497)
(cherry picked from commit 532ec5d878)

[API] [SEMVER] [v1.20] less is replaced by css

(cherry picked from commit 01ca3a4f42)
(cherry picked from commit 1d928c3ab2)
(cherry picked from commit a39dc804cd)

Conflicts:
	webpack.config.js
(cherry picked from commit adc68578b3)
(cherry picked from commit 9b8d98475f)
(cherry picked from commit 2516103974)
(cherry picked from commit 18e6287963)
(cherry picked from commit e9694e67ab)
(cherry picked from commit a9763edaf0)
(cherry picked from commit e2b550f4fb)
(cherry picked from commit 2edac36701)

[API] Forgejo API /api/forgejo/v1 (squash)

Update semver as v1.20 is entering release candidate mode

(cherry picked from commit 4995098ec3)
(cherry picked from commit 578ccfdd27)
(cherry picked from commit 1bf6ac0952)
(cherry picked from commit 2fe16b2bfe)
(cherry picked from commit 7cd9d027ee)
(cherry picked from commit eaed4be2ae)
(cherry picked from commit cc94f3115f)
(cherry picked from commit d7a77e35cc)
(cherry picked from commit cd8eb68ab7)
(cherry picked from commit 68487ac95f)
(cherry picked from commit 616dceb565)
(cherry picked from commit 545fe5975b)
(cherry picked from commit c042cf8eda)
(cherry picked from commit ae5e5a7468)
(cherry picked from commit 8034ef5fa2)
(cherry picked from commit aaf0293034)
(cherry picked from commit daafa8ce58)
(cherry picked from commit 7ca3681d3e)
(cherry picked from commit 39f72cba71)
(cherry picked from commit 60a5917130)
(cherry picked from commit 4853bd9e16)

[API] Move forgejo api file (squash)

- Move the file to accommodate faa28b5a44

(cherry picked from commit bce89351d2)
(cherry picked from commit 11ae7f6e85)
(cherry picked from commit 25e96cfcb2)
(cherry picked from commit 6d8d19b391)
(cherry picked from commit 5afc5c454b)
(cherry picked from commit 86d07b4c24)
(cherry picked from commit e54d869fda)
(cherry picked from commit ab31ef1bba)
(cherry picked from commit 511cbca2f3)
(cherry picked from commit 333916fea8)
(cherry picked from commit 3802bcd7c9)
(cherry picked from commit 5d0fa034f7)
(cherry picked from commit d15627aa0d)
(cherry picked from commit ba0b21b930)
(cherry picked from commit 39ade66aac)
2024-02-05 14:44:32 +01:00
Percy Ma b331492829
[DOCS] LICENSE: add Forgejo Authors
(cherry picked from commit 7c98a4c54e)
(cherry picked from commit 1ec4a8e6cf)
(cherry picked from commit 79de60a5d8)
(cherry picked from commit e7fbfb34a9)
(cherry picked from commit 7f625d25a3)
(cherry picked from commit 9341e18427)
(cherry picked from commit a03e449c01)
(cherry picked from commit b4c7140bec)
(cherry picked from commit 685c9d4a87)
(cherry picked from commit 48b3594a7d)
(cherry picked from commit 8eefd84d38)
(cherry picked from commit d42f1028eb)
(cherry picked from commit 3bb7f7ed51)
(cherry picked from commit ac109696e7)
(cherry picked from commit d39713efb4)
(cherry picked from commit f0bc5decfb)
(cherry picked from commit 17088c4188)
(cherry picked from commit 6a97494acd)
(cherry picked from commit 261705d6a1)
(cherry picked from commit 601cb8cf6f)
(cherry picked from commit 9812c73692)
(cherry picked from commit 430b4c19a4)
(cherry picked from commit 5b5162aae7)
(cherry picked from commit 26a89ded6a)
(cherry picked from commit 1cfe396d4b)
(cherry picked from commit b9fb3d9f13)
(cherry picked from commit 476efc0063)
(cherry picked from commit 8d71e6b2f8)
(cherry picked from commit e9f1631c3d)
(cherry picked from commit c4d8eef7c5)
(cherry picked from commit 7cfd4147be)
(cherry picked from commit d8cbe27d30)
(cherry picked from commit d7b3f85db2)
(cherry picked from commit b92e54bb36)
(cherry picked from commit c12596f414)
(cherry picked from commit ea9ec0b98a)
(cherry picked from commit 6e4662fd58)
(cherry picked from commit e8d3f1cb57)
(cherry picked from commit 20a468fc68)
(cherry picked from commit 7de10195b8)
(cherry picked from commit 7fada754e8)
(cherry picked from commit 03ea6b95d8)
(cherry picked from commit b6e1b3c872)
(cherry picked from commit 9bb924cfb5)
(cherry picked from commit cd0d485395)
(cherry picked from commit ad2d7e7e5f)
(cherry picked from commit b29d432dd1)
(cherry picked from commit ee04baa5f9)
(cherry picked from commit d5b5f6ac50)
2024-02-05 14:44:32 +01:00
Loïc Dachary bbdf361393
[DOCS] RELEASE-NOTES.md
(cherry picked from commit b07123ee7b)
(cherry picked from commit ca85c880b4)
(cherry picked from commit 723ead94cb)
(cherry picked from commit ff148318da)

[DOCS] RELEASE-NOTES: 1.19.0

(cherry picked from commit e84e43887b)

[DOCS] RELEASE-NOTES: add scoped access tokens

(cherry picked from commit 688f831853)

[DOCS] RELEASE-NOTES: Scoped labels

(cherry picked from commit 747479a07b)

[DOCS] RELEASE-NOTES: OIDC groups

(cherry picked from commit 10c505fe89)

[DOCS] RELEASE-NOTES: Copy Link is broken

On firefox it fails with Uncaught TypeError: navigator.clipboard is
   undefined
On chromium it fails with Uncaught TypeError: Cannot read properties of undefined (reading 'writeText')

(cherry picked from commit 148b2ff093)

[DOCS] RELEASE-NOTES: Copy citation

(cherry picked from commit d0f217735f)

[DOCS] RELEASE-NOTES: Support org/user level projects

(cherry picked from commit de845c7bcf)

[DOCS] RELEASE-NOTES: v1.19 has a documentation

(cherry picked from commit 9a5b46da32)

[DOCS] RELEASE-NOTES: do not split webhook section

(cherry picked from commit 00ed020321)

[DOCS] RELEASE-NOTES: Incoming emails

(cherry picked from commit 06c455b33b)

[DOCS] RELEASE-NOTES: secrets are an implementation detail

(cherry picked from commit 8236dc3a57)

[DOCS] RELEASE-NOTES: Prohibit fork if user reached maximum

(cherry picked from commit 0f80b8c696)

[DOCS] RELEASE-NOTES: scoped tokens: do not duplicate the docs

(cherry picked from commit 9bc4793c07)

[DOCS] RELEASE-NOTES: rss feed for tags and releases

(cherry picked from commit 599b36fada)

[DOCS] RELEASE-NOTES: protected branches wildcard

(cherry picked from commit 2b316c4950)

[DOCS] RELEASE-NOTES: disable releases

(cherry picked from commit 9a60773f1d)

[DOCS] RELEASE-NOTES: review box

(cherry picked from commit 09867dd122)

[DOCS] RELEASE-NOTES: asciicast support

(cherry picked from commit ea9658379b)

[DOCS] RELEASE-NOTES: attention blocks

(cherry picked from commit 70b387750b)

[DOCS] RELEASE-NOTES: commit cross reference

(cherry picked from commit fe706dad13)

[DOCS] RELEASE-NOTES: strip user completion border case

(cherry picked from commit 33ca51b4b6)

[DOCS] RELEASE-NOTES: card preview

(cherry picked from commit 626cd78ca6)

[DOCS] RELEASE-NOTES: raw copy button

(cherry picked from commit edfb467d64)

[DOCS] RELEASE-NOTES: allow edits by maintainers by default

(cherry picked from commit 7006405bc6)

[DOCS] RELEASE-NOTES: database auto migration is a little arcane

(cherry picked from commit 78030fa9af)

[DOCS] RELEASE-NOTES: fix typos & minor rewording

(cherry picked from commit ae1d47f656)
(cherry picked from commit ad08ca9955)

[DOCS] RELEASE-NOTES: webhook authorization header

(cherry picked from commit c35e2c4f6f)

[DOCS] RELEASE-NOTES: video element in markdown

(cherry picked from commit bcb0bd51d2)

[DOCS] RELEASE-NOTES: move scoped labels to the documentation

(cherry picked from commit c5eedaf4f3)

[DOCS] RELEASE-NOTES: cosmetic improvements

(cherry picked from commit b93df350d9)

[DOCS] RELEASE-NOTES: 1.19.0-0 is really : 1.19.0-2

(cherry picked from commit 60d770c2c9)

[DOCS] RELEASE-NOTES: relevant repositories

(cherry picked from commit de6ed5b87f)
(cherry picked from commit 71d91fdf22)

[DOCS] RELEASE-NOTES: semantic version

(cherry picked from commit af062d77f0)

[DOCS] RELEASE-NOTES: reflogs

(cherry picked from commit 084713d8aa)
(cherry picked from commit 90ad322a56)

[DOCS] RELEASE-NOTES: fix broken link to OIDC mapping

(cherry picked from commit 802a252eb5)

[DOCS] RELEASE-NOTES: Fix spaces

(cherry picked from commit a605d36ab6)

[DOCS] RELEASE-NOTES: SemVer

(cherry picked from commit 7b29c90035)
(cherry picked from commit 82799195c9)
(cherry picked from commit 5d9c2e9ec6)

[DOCS] RELEASE-NOTES: 1.19.0-3

(cherry picked from commit c599b2947d)
(cherry picked from commit 8a37027ae7)

[DOCS] RELEASE-NOTES: v1.19.1-0

(cherry picked from commit 89b9e96cc7)
(cherry picked from commit 2b4e881a4e)

[DOCS] RELEASE-NOTES: 1.19.2-0

(cherry picked from commit 0c0d2ec46c)
(cherry picked from commit 437b8caae4)

[DOCS] RELEASE-NOTES: 1.19.3-0

(cherry picked from commit 040740917e)

[DOCS] RELEASE-NOTES: 1.19.3-0 (fix typo)

(cherry picked from commit 24516cb22a)
(cherry picked from commit 429c8e6525)
(cherry picked from commit 8247bddb45)
(cherry picked from commit d77d7b7be7)
(cherry picked from commit a64c899b1d)
(cherry picked from commit 0803eaa2e3)
(cherry picked from commit 8538f2897e)
(cherry picked from commit 45b9037d3c)
(cherry picked from commit 928705f870)
(cherry picked from commit 19e683468c)
(cherry picked from commit 5ae55e8e34)
(cherry picked from commit 7c224d84cf)

[DOCS] RELEASE-NOTES: 1.20.0

(cherry picked from commit 3fbcdd235b)
(cherry picked from commit e7a621acae)
(cherry picked from commit 70adac6d66)

[DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) rewording

(cherry picked from commit 1b79fab57d)

[DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) time

(cherry picked from commit cfd599a132)

[DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) wiki

(cherry picked from commit 6aa2ab41c6)

pick changes from #829

(cherry picked from commit f599598101)

[DOCS] RELEASE-NOTES: 1.20.0-0-rc0 (squash) ui

(cherry picked from commit 5f0aa769b1)

features

(cherry picked from commit d1e788ff4e)

typos

(cherry picked from commit 088d4b2d61)

Mirror Settings

(cherry picked from commit 161412affd)

features

(cherry picked from commit 10cb0379e2)

fix typo

(cherry picked from commit aee096b040)

TODO

(cherry picked from commit 0d4e0bb4a9)

typo

(cherry picked from commit b76a3c1a84)
(cherry picked from commit 4c354196c2)
(cherry picked from commit 6323c6d1a2)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) Woodpecker CI archive repository

(cherry picked from commit 154ee5bc9c)

[DOCS] RELEASE-NOTES: 1.20.0 (squash)

(cherry picked from commit 656f955448)

[DOCS] RELEASE-NOTES: 1.19.4-0

(cherry picked from commit 85bd997176)

[DOCS] RELEASE-NOTES: 1.19.4-0 (squash) fix typo

(cherry picked from commit e5c364c586)
(cherry picked from commit c123048e51)
(cherry picked from commit ad2fedb693)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) blog

Pick changes from https://blog.gitea.com/release-of-1.20.0/

(cherry picked from commit c8068a9d7b)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) Gitea release notes

Review https://github.com/go-gitea/gitea/releases/tag/v1.20.0

(cherry picked from commit dd58b50403)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) commits

git log --no-merges --oneline 64ed262e1..gitea/release/v1.20 . ':(exclude,glob)docs/**' ':(exclude)CONTRIBUTING.md' ':(exclude)MAINTAINERS' ':(exclude,glob).github/**' ':(exclude)CHANGELOG.md' ':(exclude,glob)options/locale/**' ':(exclude,glob)options/license/**' ':(exclude,glob)snap/**' ':(exclude).drone.yml' ':(exclude)custom/conf/app.example.ini'

9159964ad Avoid opening/closing PRs which are already merged (#25883) (#25903)
9369b3831 Skip unuseful error message in dev mode when watching local filesystem (#25919) (#25927)
6e82d0bb7 Add shutting down notice (#25920) (#25922)
36b9a86bd Fix incorrect milestone count when provide a keyword (#25880) (#25904)
de8127e78 fix incorrect repo url when changed the case of ownername (#25733) (#25881)
de8127e78 fix incorrect repo url when changed the case of ownername (#25733) (#25881)
186f07bbf Make `add line comment` buttons focusable (#25894) (#25896)
45b1f4dd3 Add support for different Maven POM encoding (#25873) (#25890)
026e745b9 Fix incorrect release count (#25879) (#25887)
c334be828 Fix empty project displayed in issue sidebar (#25802) (#25854)
353dcc5ad Fix the error message when the token is incorrect (#25701) (#25836)
abe9c641c Show correct SSL Mode on "install page" (#25818) (#25838)
052e65e63 Fix incorrect oldest sort in project list (#25806) (#25835)
c1a10be07 Fix activity type match in `matchPullRequestEvent` (#25746) (#25796)
2b79d3fd5 For API attachments, use API URL (#25639) (#25814)
b4460cf54 Make "install page" respect environment config (#25648) (#25799)
a1bc2aa05 Avoid amending the Rebase and Fast-forward merge if there is no message template (#25779) (#25809)
d713cf615 Fix WORK_DIR for docker (root) image (#25738) (#25811)
012b804a9 Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764)
372b622c2 Revert package access change from #23879 (#25707) (#25785)
06bcdfe77 Remove unused code (#25734) (#25788)
a5a3c8141 Fix notification list bugs (#25781) (#25787)
ea2c9de3c Test if container blob is accessible before mounting (#22759) (#25784)
348a6bf70 Always pass 6-digit hex color to monaco (#25780) (#25782)
91dadeddd Translate untranslated string in issues list (#25759) (#25761)
32eaba1b4 Hide `add file` button for pull mirrors (#25748) (#25751)
917ca5ded Several fixes for mobile UI (#25634) (#25689)
e595dfeec Allow/fix review (approve/reject) of empty PRs (#25690) (#25732)
03cacf971 Check `ctx.Written()` for `GetActionIssue` (#25698) (#25711)
68e0c802f Show correct naming for 1 comment (#25704) (#25712)
09668b2e2 Correct permissions for `.ssh` and `authorized_keys` (#25721) (#25730)
04eea29ec Fix tags header and pretty format numbers (#25624) (#25694)
511be9fe6 Fix position of org follow button (#25688) (#25692)
24e64fe37 Replace `interface{}` with `any` (#25686) (#25687)
4e310133f Prevent duplicate image loading (#25675) (#25684)
491f36d32 Actions list enhancements (#25601) (#25678)
5510ed34f Fix the nil pointer when assigning issues to projects (#25665) (#25677)
39fce5750 Prevent SVG shrinking (#25652) (#25669)
1f9037604 Fix show more for image on diff page (#25672) (#25673)
0af6542a3 Add unit test for repository collaboration (#25640) (#25658)
69bdcf41f Log the real reason when authentication fails (but don't show the user) (#25414) (#25660)
e610b0389 Fix UI misalignment on user setting page (#25629) (#25656)
13ffa287b  Fix bug of branches API with tests(#25578) (#25579)

(cherry picked from commit 3e9e862e5e)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) reorder breaking

(cherry picked from commit 4e4cdddc55)

address rome-user review

(cherry picked from commit 8791fe88b1)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) reword breaking

- removed the section about the changed themes: it is an internal
detail and redundant with the above warning regarding themes &
templates

(cherry picked from commit b34e9a7b19)

[DOCS] RELEASE-NOTES: 1.20.0 (squash) minor rewording

The CI & Actions sections were grouped together.

(cherry picked from commit ed236e1ee8)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash)

(cherry picked from commit 3c11eb1de5)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash) Forgejo features/optimizations

(cherry picked from commit c516fd0c7a)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash) fix typo in Alpine version

(cherry picked from commit 1c2a5b5162)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash) comment out obsoleted queue keys

(cherry picked from commit 8c0d9459c5)

[DOCS] RELEASE-NOTES: 1.20.1-0 (squash) WORK_PATH breaking change

(cherry picked from commit f4ea3b27f5)
(cherry picked from commit 0557568f61)

[DOCS] RELEASE-NOTES.md (squash) obsolete queue `app.ini` keys

(cherry picked from commit e0c943ac3b)

[DOCS] RELEASE-NOTES.md (squash) v1.20.2-0

(cherry picked from commit f2c654d1c8)

[DOCS] RELEASE-NOTES.md (squash) fix LFS issue link

(cherry picked from commit 2461355f2a)
(cherry picked from commit 750652d75a)
(cherry picked from commit 6899dbdc11)
(cherry picked from commit 88b988d084)

[DOCS] RELEASE-NOTES.md (squash) v1.20.3-0

(cherry picked from commit d566e78d68)
(cherry picked from commit 65439eafa4)
(cherry picked from commit a76cc5b8bc)
(cherry picked from commit b4e1ad6020)

[DOCS] RELEASE-NOTES.md (squash) v1.20.4-0

(cherry picked from commit 8a910c0c33)

[DOCS] RELEASE-NOTES.md (squash) link to upgrade docs

Refs: https://codeberg.org/forgejo/forgejo/issues/1199
(cherry picked from commit d4e9030873)
(cherry picked from commit 7da7b9cef4)
(cherry picked from commit 73b64ea895)

[DOCS] RELEASE-NOTES.md (squash) v1.20.4-1

[DOCS] RELEASE-NOTES.md (squash) v1.21.0-0

(cherry picked from commit e618ea55a5)
(cherry picked from commit f3ee986416)

[DOCS] RELEASE-NOTES.md (squash) 1.20.5-0

(cherry picked from commit ce5541c78b)

[DOCS] RELEASE-NOTES.md (squash) 1.20.5-0 is a security release

(cherry picked from commit 5dd66c06e3)

slug of the blog post changed

(cherry picked from commit fc5b52049f)

apply caesar rewording suggestions

(cherry picked from commit 59e9648b71)

[DOCS] RELEASE-NOTES.md (squash) typo

(cherry picked from commit e8daead2a1)
(cherry picked from commit 8af0a2007d)
(cherry picked from commit 329a04e094)
(cherry picked from commit 216a62de30)
(cherry picked from commit 855440d4b3)
(cherry picked from commit 6cb87ca0fe)
(cherry picked from commit d2bf04bfa3)

[DOCS] RELEASE-NOTES.md (squash) v1.21.0-0

[DOCS] RELEASE-NOTES.md (squash) v1.21.0-0 new features (UI split)

[DOCS] RELEASE-NOTES.md (squash) v1.21.0-0 complete release notes.

(cherry picked from commit cd0fbfc8ed)

RSA keylength 3072 is a breaking change

(cherry picked from commit ac6defb515)

new features chroma update from 2.7.0 to 2.9.1

(cherry picked from commit ffd249070a)

new features go-enry/linguist update from v7.25.0 to v7.27.0

go-enry 2.8.6

(cherry picked from commit 1e72c0608f)

add links to documentation for new features

(cherry picked from commit ab0ff5d2d0)

v1.21.0-9 will be the release number

(cherry picked from commit afed47fa40)

links to go-enry & chroma releases to measure the gap

(cherry picked from commit deb7645550)

[DOCS] RELEASE-NOTES.md (squash) v1.20.5-1

(cherry picked from commit ab1556628d)

proofread

(cherry picked from commit fd672635b2)

[DOCS] RELEASE-NOTES.md (squash) v1.20.6-0

(cherry picked from commit 90ddda3413)

[DOCS] RELEASE-NOTES.md (squash) v1.21.1-0

(cherry picked from commit 079d4fdca1)

[DOCS] RELEASE-NOTES.md (squash) v1.21.1-0

(cherry picked from commit f3d15ef97c)
(cherry picked from commit 881b438f2d)
(cherry picked from commit 6080cf05c9)

[DOCS] RELEASE-NOTES.md (squash) v1.21.2-0

(cherry picked from commit 9f4ca4cdf9)

[DOCS] RELEASE-NOTES.md (squash) v1.21.2-0

(cherry picked from commit 363477855e)

[DOCS] RELEASE-NOTES.md (squash) move customized files

make it more prominently visible

(cherry picked from commit 6c992b5d93)

[DOCS] RELEASE-NOTES.md (squash) API pull/issue breaking change

(cherry picked from commit a8cbc2deb8)
(cherry picked from commit 58657fff86)
(cherry picked from commit ecf8b1531b)

[DOCS] RELEASE-NOTES.md (squash) v1.21.2-1

(cherry picked from commit 1d24c09f49)

[DOCS] RELEASE-NOTES.md (squash) v1.20.6-1

(cherry picked from commit 8821315c33)

[DOCS] RELEASE-NOTES.md (squash) v1.20.6-1 reorder

(cherry picked from commit 9159916fa1)
(cherry picked from commit 165099c0c6)

[DOCS] RELEASE-NOTES.md (squash) v1.21.3-0

(cherry picked from commit 5e1d37b76c)

[DOCS] RELEASE-NOTES.md (squash) v1.21.3-0

Reword the security fix description.

(cherry picked from commit 142bed073d)
(cherry picked from commit cff9b5db4a)

[DOCS] RELEASE-NOTES (squash) mention addition of  `auth-required` in Cargo registry

I'm including this under bug fixes even though it was labelled as an
enhancement upstream because stabilization of private registry
authentication predates the introduction of this change. Feel free to
change the category if you don't think this assessment is appropriate.

Refs: https://codeberg.org/forgejo/forgejo/pulls/2038
(cherry picked from commit 1057df6db5)
(cherry picked from commit 566c32bdf6)
(cherry picked from commit 45f5657cdc)
(cherry picked from commit cb222316c2)
(cherry picked from commit b44dae67f3)
(cherry picked from commit f48ef0b788)
2024-02-05 14:44:32 +01:00
Earl Warren 5679773afc
[TESTS] add GOLANGCI_LINT_ARGS to control golangci calls
It is for instance useful with:

GOLANGCI_LINT_ARGS="--concurrency $(expr $(nproc) / 2)" make lint-backend

on a laptop where overcommitting the CPU degrades the UI performances.

(cherry picked from commit 76023319c4)
(cherry picked from commit 55eb05b03d)
(cherry picked from commit 49c84de3df)
(cherry picked from commit e8e26f08a6)
(cherry picked from commit 401aa12cac)
(cherry picked from commit 4ae8f663ad)
(cherry picked from commit 2d87e4953b)
(cherry picked from commit e79be7d80e)
(cherry picked from commit 65e3673998)
(cherry picked from commit 54e5a5dca2)
(cherry picked from commit 99e8725e68)
(cherry picked from commit c2048b352f)
(cherry picked from commit ad142d18a8)
(cherry picked from commit 489d42770e)
(cherry picked from commit 2de9069ed4)
(cherry picked from commit 782d8ef6df)
(cherry picked from commit 2068b26cd9)
(cherry picked from commit 1857f062dd)
(cherry picked from commit beced6a2cc)
(cherry picked from commit 538ca28ee8)
(cherry picked from commit cc25e3f35f)
2024-02-05 14:44:32 +01:00
Loïc Dachary faad9e94c1
[WORKFLOW] issues & pr templates
(cherry picked from commit 9dd224f00c)
(cherry picked from commit 710af007bc)
(cherry picked from commit 2ccd6e2bd6)
(cherry picked from commit b90dc5fc4f)
(cherry picked from commit bf25d98a98)
(cherry picked from commit d7c71e5985)

[WORKFLOW] Add Forgejo Next and reproducing to issue template

(cherry picked from commit 17a3988fe0)
(cherry picked from commit 9ee5b3a619)
(cherry picked from commit bebdd8d5f3)
(cherry picked from commit be7bb96d5c)
(cherry picked from commit 4ae659d63a)
(cherry picked from commit 82426f376d)
(cherry picked from commit 1cb28e3671)
(cherry picked from commit c6a2db94c4)
(cherry picked from commit 90d3eb2d13)
(cherry picked from commit 3c3e656f58)
(cherry picked from commit 54ece82417)
(cherry picked from commit 55a042485a)
(cherry picked from commit 4e984aeba6)
(cherry picked from commit 52ea3f32b6)
(cherry picked from commit 00b0d0621e)
(cherry picked from commit dc4acfa6db)
(cherry picked from commit 0d26574fe3)
(cherry picked from commit 81acdf5a84)
(cherry picked from commit bcb063e157)
(cherry picked from commit 3e3bd36e6d)
(cherry picked from commit 7767bafbff)
(cherry picked from commit c98e1afb4c)
(cherry picked from commit 8ebc60b949)
(cherry picked from commit 59555d146e)
(cherry picked from commit 8ec25e8838)
(cherry picked from commit 6e568c70d7)
(cherry picked from commit 5a36052803)
(cherry picked from commit c7e6dc6b13)
(cherry picked from commit 005557f7ef)
(cherry picked from commit c643b2ef58)
(cherry picked from commit 8533627ee4)
(cherry picked from commit a9ce3d681c)
(cherry picked from commit e5efb10515)
(cherry picked from commit b0d00464ef)
(cherry picked from commit f54c25fa7d)
(cherry picked from commit b686249a4a)
(cherry picked from commit a55bc0abd3)
(cherry picked from commit bcb5e34802)
(cherry picked from commit e40a2d3e15)
(cherry picked from commit 412ef602c9)
(cherry picked from commit 536922186d)
(cherry picked from commit 51c6220124)
(cherry picked from commit 28d7612b3e)
(cherry picked from commit be3adcf77b)
2024-02-05 14:44:32 +01:00
Loïc Dachary c9e0400582
[DOCS] README
(cherry picked from commit a47b474586)
(cherry picked from commit 2fcc61c1d9)
(cherry picked from commit 67debe2247)
(cherry picked from commit b90ffbb309)
(cherry picked from commit 07a7448148)
(cherry picked from commit a7fe270c08)
(cherry picked from commit 2f15389a9c)
(cherry picked from commit 16ba587f5d)
(cherry picked from commit 683a23b2ca)
(cherry picked from commit 3e5de3f656)
(cherry picked from commit 5789005c43)
(cherry picked from commit 75c0f11079)
(cherry picked from commit e78a272e11)
(cherry picked from commit 464a534a3a)
(cherry picked from commit 7c0b73ca6f)
(cherry picked from commit e66b8edbc6)
(cherry picked from commit a91864340d)
(cherry picked from commit 504905bc88)
(cherry picked from commit 650137433f)
(cherry picked from commit 3e00bdaf2a)
(cherry picked from commit 43efcc1a29)
(cherry picked from commit 4984ba13c5)
(cherry picked from commit 02b7928710)
(cherry picked from commit 0db0feaee2)
(cherry picked from commit 94d141bc7f)
(cherry picked from commit 392fb15891)
(cherry picked from commit c5699a7bb7)
(cherry picked from commit b975597a78)
(cherry picked from commit 5395e74d72)
(cherry picked from commit bc8060dee4)
(cherry picked from commit 3b64f1477a)
(cherry picked from commit d40378e1c7)
(cherry picked from commit a713f7e3f9)
(cherry picked from commit 87f65ccf78)
(cherry picked from commit 049ea571a9)
(cherry picked from commit 433d1d7baa)
(cherry picked from commit 21bed2af1d)
(cherry picked from commit fe700ca401)
(cherry picked from commit 2f5c0479a9)
(cherry picked from commit f7afcdba8a)
(cherry picked from commit 323e99d9f5)
(cherry picked from commit aa6a3edf2f)
(cherry picked from commit 754a8b4b30)
(cherry picked from commit 52f173647a)
(cherry picked from commit 559dcf0ccf)
(cherry picked from commit 393f09eaf9)
(cherry picked from commit a3eb61aef3)
(cherry picked from commit 8d5277a7e1)
(cherry picked from commit 265be677fb)
2024-02-05 14:44:32 +01:00
Loïc Dachary 1d555039c8
[DOCS] CONTRIBUTING
Refs: https://codeberg.org/forgejo/forgejo/issues/8
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/153
Refs: https://codeberg.org/forgejo/forgejo/issues/123
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/299
(cherry picked from commit 08dcef0c8c)

[DOCS] CONTRIBUTING/RELEASE: https://forgejo.org/docs/admin

Because the version is not displayed on the landing page of Forgejo,
there cannot be a link to a versionned documentation. There must exist
a link that points to the latest version on the website for the
forgejo instance to display.

Better but more complicated approaches could be to:

* Embed the documentation in Forgejo
* Allow the admin to not display the help
* Allow the admin to display a versionned help or not

(cherry picked from commit 83cc389239)
(cherry picked from commit 5df52b8a4f)
(cherry picked from commit 9a66b3d70b)

[DOCS] CONTRIBUTING/RELEASE: reminder to update FORGEJO_VERSION

(cherry picked from commit 2a4d0bd164)
(cherry picked from commit d68576ba67)

[DOCS] CONTRIBUTING: updates

* Remove obsolete description of the well being & moderation team and
  replace them with a link to the moderation email.

* Remove description of the governance process and replace with a link
  to the governance readme that did not exist at the time.

* Add links to the Forgejo documentation

(cherry picked from commit df749da272)
(cherry picked from commit 4da39128c5)
(cherry picked from commit f442ca6f40)
(cherry picked from commit 031928c447)
(cherry picked from commit 1e6ba47216)
(cherry picked from commit 8916a1f8c6)
(cherry picked from commit 663e28c412)
(cherry picked from commit d56b130baa)

[DOCS] CONTRIBUTING (squash)

(cherry picked from commit 0dc4b6e5c9)
(cherry picked from commit 52f2163807)
(cherry picked from commit 47d0ae3e10)
(cherry picked from commit 7757a5c34c)
(cherry picked from commit 5b4d25bd03)
(cherry picked from commit 78798cc25e)
(cherry picked from commit 3001fb8c7b)
(cherry picked from commit da27bf1bc5)
(cherry picked from commit 2fb13da8ed)
(cherry picked from commit ea19e0efb3)

[DOCS] Add link to build instructions in CONTRIBUTING.md

(cherry picked from commit 50d86aa4ad)

Replace 'v1.20' with 'next'

(cherry picked from commit 3e99f49fc5)
(cherry picked from commit f5c89e88cf)
(cherry picked from commit 8e70433dac)
(cherry picked from commit 31cc99588c)

fixes 404 links in CONTRIBUTING.md

(cherry picked from commit b7326919ab)
(cherry picked from commit cd88e7d177)
(cherry picked from commit 09d33f2050)
(cherry picked from commit 8ea49fc0c7)
(cherry picked from commit a434c76f4b)
(cherry picked from commit c61e1b8797)
(cherry picked from commit 1ce9dc9def)
(cherry picked from commit a90927d0b1)
(cherry picked from commit 17ca38d29a)
(cherry picked from commit 70986dddc9)
(cherry picked from commit 667b4e7407)
(cherry picked from commit dd3a380778)
(cherry picked from commit a22b8979e5)
(cherry picked from commit 87d1125ad0)
(cherry picked from commit df6ebcc40b)
(cherry picked from commit 9bac1dbf63)
(cherry picked from commit dc5e1998b3)
(cherry picked from commit 4c4878477e)
(cherry picked from commit 9adf97d004)
(cherry picked from commit 3993bd23c4)
(cherry picked from commit 1e04d81657)
(cherry picked from commit 2aa2ff63f0)
(cherry picked from commit d2326d8aa4)
(cherry picked from commit 85d91c420b)
(cherry picked from commit 69a21774e9)
2024-02-05 14:44:32 +01:00
Loïc Dachary 277dd02e70
delete Gitea specific files that need rewriting for Forgejo
Although it would be possible to modify these files, it would create
conflicts when rebasing. Instead, this commit removes them entirely
and another commit can start from scratch, borrowing content from the
original files.

The drawback of this approach is that some content updates from Gitea
that also need updating in Forgejo will have to be copy/pasted
instead of being merged.

(cherry picked from commit eb85782115)
(cherry picked from commit 34401f2004)
(cherry picked from commit ef43b1c691)
(cherry picked from commit d17fe25e2f)
(cherry picked from commit 3f65dea3e7)
(cherry picked from commit 3cacb64a1b)
(cherry picked from commit b531b014b7)
(cherry picked from commit adf6e7a840)
(cherry picked from commit 68c19d977d)
(cherry picked from commit 31aa8647ec)
(cherry picked from commit be70dd7208)
(cherry picked from commit 7f44bb60b1)
(cherry picked from commit 5098f1224b)
(cherry picked from commit dc7a859144)
(cherry picked from commit f1e78dd006)
(cherry picked from commit c41ba7a148)
(cherry picked from commit f1da66a918)
(cherry picked from commit 99194a3664)
(cherry picked from commit 52f356f6a9)
(cherry picked from commit c93ffa72ae)
(cherry picked from commit 477c7454d3)
(cherry picked from commit 413df23a40)

[DOCS] delete Gitea specific files that need rewriting for Forgejo (squash)

(cherry picked from commit df78cedd05)
(cherry picked from commit 3b9178b3e5)
(cherry picked from commit 9044dcb0e7)
(cherry picked from commit e138685bac)
(cherry picked from commit 2f1f3fd6b8)
(cherry picked from commit 0b47d02df6)
(cherry picked from commit 7625ca6c42)
(cherry picked from commit e0d720a728)
(cherry picked from commit 19aa974d12)
(cherry picked from commit bb637d398c)
(cherry picked from commit 5357fc952d)
(cherry picked from commit bee0395044)
(cherry picked from commit 5e574bfc8f)
(cherry picked from commit 9593225c5b)
(cherry picked from commit f6e5faee61)
(cherry picked from commit 02f2a9a47a)
(cherry picked from commit 68695685c1)
(cherry picked from commit 9ae53997a4)
(cherry picked from commit d87a6b4908)
(cherry picked from commit 891b628aa1)
(cherry picked from commit 0b290c23ea)
(cherry picked from commit 9cfae4f0aa)
(cherry picked from commit bd811bcc18)
(cherry picked from commit cf89915013)
(cherry picked from commit 7a519b8ba4)
(cherry picked from commit 11283e0d37)
(cherry picked from commit a1ca01f37f)
(cherry picked from commit 15fd92924a)
2024-02-05 14:44:31 +01:00
Earl Warren 1951c51c8e
Revert "Unify password changing and invalidate auth tokens (#27625)"
This reverts commit 688d4a1f71.
2024-02-05 14:43:35 +01:00
Earl Warren 80cf92bf1f
[CI] Forgejo Actions based CI (squash) all queues are immediate
There is no need to specify it again. It is misleading, lets just not
do that.

(cherry picked from commit 19259fc6af)
(cherry picked from commit ca1a0256b4)
2024-02-05 13:33:59 +01:00
Gusted e8c1bfc2e5
[CI] Fix false positive in database migration
- This also means that if one of the test fails, it will actually
propagate to make and subsequently fail the test.
- Remove the 'delete duplicates issue users' code, I checked this
against my local development database (which contains quite bizarre
cases, even some that Forgejo does not like), my local instance database
and against Codeberg production and they all yielded no results to this
query, so I'm removing it thus resolving the error that the delete code
was not compatible with Mysql.
- Sync all tables that are requires by the migration in the test.
- Resolves #2206

(cherry picked from commit 8e02be7e89)
(cherry picked from commit 006f064416)
2024-02-05 13:33:59 +01:00
Earl Warren 3f9b7cb892
[CI] Forgejo Actions based CI for PR & branches (squash) install git >= 2.42
(cherry picked from commit 2e43bd580d)
(cherry picked from commit f4a21a873c)
2024-02-05 13:33:59 +01:00
Earl Warren 6b1a57d0ef
[CI] push forgejo branches to the specified destination (squash) verbose
(cherry picked from commit 848685d68d)
(cherry picked from commit e8021f281f)
(cherry picked from commit 2a4b3a2a43)
2024-02-05 13:33:59 +01:00
Earl Warren 9b222ac391
[CI] Forgejo Actions e2e tests (squash) generate
(cherry picked from commit 9cd0b93ad2)
(cherry picked from commit ef1ddf0568)
(cherry picked from commit cd26466622)
(cherry picked from commit 22d8ed2544)
2024-02-05 13:33:59 +01:00
Earl Warren 20de330e17
[CI] push forgejo branches to the specified destination
(cherry picked from commit 22abd100cb)
(cherry picked from commit 4e2c30cb5b)
(cherry picked from commit 1ddc08747c)
(cherry picked from commit ba3df01314)
(cherry picked from commit 644f7cb733)
2024-02-05 13:33:59 +01:00
Earl Warren 86c586941a
[CI] Forgejo Actions e2e tests (squash) do not try in simulation
(cherry picked from commit f67a3f952c)
(cherry picked from commit 23502a9b9f)
(cherry picked from commit f8f345ae18)
(cherry picked from commit e00eb6d9b3)
(cherry picked from commit f5f5eb53fa)
2024-02-05 13:33:59 +01:00
Earl Warren e880f2fb6d
[CI] cascade release with end-to-end
(cherry picked from commit ab37e03bf3)
(cherry picked from commit 2b527169f1)
(cherry picked from commit 5fed32742e)
(cherry picked from commit 861c05c2f3)
(cherry picked from commit fd0ebd1a65)
2024-02-05 13:33:59 +01:00
Earl Warren 38c3d6c423
[CI] Forgejo Actions e2e tests
(cherry picked from commit 430f7d6519)
(cherry picked from commit b33f3e2fe8)
(cherry picked from commit 5d4f9e4716)
(cherry picked from commit 33b4f02d90)
(cherry picked from commit fe783424e1)
2024-02-05 13:33:59 +01:00
Earl Warren 82395a1f72
[CI] Forgejo Actions based release process (squash) refactor (#2053)
Refs: https://codeberg.org/forgejo/forgejo/issues/2051
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2053
Reviewed-by: Loïc Dachary <dachary@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
(cherry picked from commit 01abf4d505)

[CI] Forgejo Actions based release process (squash) no ownca

The private Forgejo instance trusted with the release signing keys no
longer requires the installation of the ownca certificate authority.

Refs: https://codeberg.org/forgejo/docs/pulls/338
(cherry picked from commit 72f9ae796d)
(cherry picked from commit b0ca4236d7)
(cherry picked from commit 81619cf8b5)
(cherry picked from commit 2cb32c1a2b)
(cherry picked from commit f817d97f85)
(cherry picked from commit 7499661326)
2024-02-05 13:33:59 +01:00
Earl Warren 55935657cf
[CI] upload the forgejo under test as an artifact for end-to-end
(cherry picked from commit ded1f27ebb)
(cherry picked from commit e452b18455)

[CI] upload the forgejo under test as an artifact for end-to-end (squash) use forgejo-pr

cascade a PR to https://code.forgejo.org/forgejo/end-to-end on the
forgejo-pr branch which will only run end-to-end tests relevant to a
Forgejo PR and not the entire end-to-end suite.

(cherry picked from commit 011de92174)
(cherry picked from commit 50290011b2)

[CI] upload the forgejo under test as an artifact for end-to-end (squash) after build

(cherry picked from commit ba35f42e3d)
(cherry picked from commit ddf43faecb)

[CI] upload the forgejo under test as an artifact for end-to-end (squash) do not display env

(cherry picked from commit d186ec3db4)
(cherry picked from commit 20e9d4bffb)

[CI] upload the forgejo under test as an artifact for end-to-end (squash) merge feature branches

(cherry picked from commit 83cd7a3ad9)
(cherry picked from commit 75fd819ee5)
(cherry picked from commit c6d0216929)
(cherry picked from commit 4a0ee31376)
(cherry picked from commit 5f440052fb)
(cherry picked from commit e603cd3dcf)
(cherry picked from commit f1c5e86d83)
2024-02-05 13:33:59 +01:00
Earl Warren ea5f84bf66
[CI] Forgejo Actions based CI for PR & branches (squash) lint workflows
(cherry picked from commit 074f49937e)
(cherry picked from commit 0c1c7d61e2)
(cherry picked from commit 4e4dc0e0e4)
(cherry picked from commit 95dcd5a91a)
(cherry picked from commit e260fbc445)
(cherry picked from commit 805c72c9ce)
(cherry picked from commit 92c084fd2c)
2024-02-05 13:33:59 +01:00
Earl Warren 85a79db52e
[CI] Forgejo Actions based release process (squash) lint fix
(cherry picked from commit 34513098e5)
(cherry picked from commit a87a48acfb)
(cherry picked from commit 21db8f4950)
(cherry picked from commit eb0a7e5093)
(cherry picked from commit 328fbcb706)
(cherry picked from commit 22e63701a8)
(cherry picked from commit 209bbbf1fd)
2024-02-05 13:33:59 +01:00
Gusted 40d852d12c
[CI] Switch to non-coverage unit test (squash)
- Currently the collected coverage is not being used by the CI, so use
the non-coverage variant to not have the overhead of collecting
coverage.

(cherry picked from commit 9b3032c14b)
(cherry picked from commit b0fded409d)
(cherry picked from commit 14b5efb1c4)
(cherry picked from commit 30bd28eed3)
(cherry picked from commit 54bb708ce7)
(cherry picked from commit f1664c360b)
(cherry picked from commit cd8648178d)
(cherry picked from commit 69894fbc82)
(cherry picked from commit 314ae5e183)
2024-02-05 13:33:59 +01:00
Earl Warren 3a163271f6
[CI] gitignore: emacs backups
(cherry picked from commit 5e418789d9)
(cherry picked from commit 3af6fd2ad3)
(cherry picked from commit 6926787d67)
(cherry picked from commit fe58e86a97)
(cherry picked from commit 5bf7ead625)
(cherry picked from commit 44480ea794)
(cherry picked from commit 813848cebe)
(cherry picked from commit 9c8d889e78)
(cherry picked from commit 914b1dcaf6)
(cherry picked from commit 5449933efa)
(cherry picked from commit 67f007b824)
(cherry picked from commit cf93863cd2)
(cherry picked from commit 82177a0f66)
(cherry picked from commit 3ef1fe468a)
(cherry picked from commit 305c935508)
(cherry picked from commit 268f12c53c)
(cherry picked from commit 2e6c29fb2f)
(cherry picked from commit 173aa4b3b1)
(cherry picked from commit 9112b323d1)
(cherry picked from commit 54031769ee)
(cherry picked from commit afc287c179)
(cherry picked from commit 225d6f7ab7)
(cherry picked from commit 41001442e3)
2024-02-05 13:33:59 +01:00
Earl Warren 5e6bf138af
[CI] Makefile: release: only supported platforms
(cherry picked from commit 16381262c5)
(cherry picked from commit c93f41dcef)
(cherry picked from commit cf17c69487)
(cherry picked from commit 174b8cf327)
(cherry picked from commit ae1b8dd441)
(cherry picked from commit 1b56d9049f)
(cherry picked from commit 6b00196175)
(cherry picked from commit 087b38c3f3)
(cherry picked from commit 70fcc63816)
(cherry picked from commit 81e2f27426)
(cherry picked from commit 9741a9960b)
(cherry picked from commit 0625fc7ad8)
(cherry picked from commit e7758aaa94)
(cherry picked from commit be25432687)
(cherry picked from commit 64c6d2f263)
(cherry picked from commit 3445ae53e3)
(cherry picked from commit 3e359ef3cd)
(cherry picked from commit 3c44026cc5)
(cherry picked from commit 9528250188)
(cherry picked from commit 840a307a25)
(cherry picked from commit 1c486047ac)
(cherry picked from commit 7e6ccb52ff)
(cherry picked from commit 7a1b3fef59)
2024-02-05 13:33:59 +01:00
Earl Warren 460f3c1752
[CI] lint-go-vet: do not include gitea-vet
(cherry picked from commit 8cbbab7fef)
(cherry picked from commit 51113f0f29)
(cherry picked from commit 0d061e411f)
(cherry picked from commit 1eb4e7e691)
(cherry picked from commit 3c3760f3b6)
(cherry picked from commit c11907373d)
(cherry picked from commit d990fcf446)
(cherry picked from commit 62fd8a0b39)
(cherry picked from commit 0663a25341)
(cherry picked from commit c20d4386e5)
(cherry picked from commit 5981040a19)
(cherry picked from commit b62809313f)
(cherry picked from commit 205512ef96)
(cherry picked from commit 8b923cf770)
(cherry picked from commit bdc50fff48)
(cherry picked from commit 35da9d2316)
(cherry picked from commit f185ba6d03)
(cherry picked from commit dfe5502f56)
(cherry picked from commit 193fd9bec7)
(cherry picked from commit 1e3af954ee)
(cherry picked from commit 0430ad7312)
(cherry picked from commit 5d05f7f9f6)
(cherry picked from commit 82afc7c30b)
2024-02-05 13:33:59 +01:00
oliverpool 21f168209b
[CI] update DNS on experimental release (#1298)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1298
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
(cherry picked from commit 2aebc5ab4d)
(cherry picked from commit 8d66b6e7bc)
(cherry picked from commit c782935f1b)
(cherry picked from commit 51e071da73)
(cherry picked from commit 81dbc87e16)
(cherry picked from commit 7a98204743)
(cherry picked from commit c679954950)
(cherry picked from commit 8e4a03f302)
(cherry picked from commit 5846953f61)
(cherry picked from commit ffda919030)
(cherry picked from commit f923b26d1e)
(cherry picked from commit abfe5ec45d)
(cherry picked from commit 35a7f5eb20)
(cherry picked from commit c996d51bd6)
(cherry picked from commit c9d4a3d917)
(cherry picked from commit ae22f9c34f)
(cherry picked from commit 9c4eee7aab)
(cherry picked from commit 6245948d6c)
(cherry picked from commit a286163c0b)
(cherry picked from commit 0bad00bb1c)
(cherry picked from commit 7653151793)
(cherry picked from commit 614cc71c88)
(cherry picked from commit aa3a7249f7)
(cherry picked from commit acde52ddb6)
2024-02-05 13:33:59 +01:00
Earl Warren cb786f0d40
[CI] Forgejo Actions based release process
Refs: https://codeberg.org/forgejo/website/pulls/230
(cherry picked from commit 87d56bf6c7)

[CI] Forgejo Actions based release process (squash)

base64 -w0 to avoid wrapping when the doer name is long as it creates
a broken config.json

(cherry picked from commit 9efdc27e49)

[CI] Forgejo Actions based release process (squash) generate .xz files and sources

Generate .xz files
Check .sha256
Generate the source tarbal

(cherry picked from commit 7afec520c4)

[CI] Forgejo Actions based release process (squash) release notes

(cherry picked from commit d8f4f4807b)

[CI] Forgejo Actions based release process (squash) publish and sign release

(cherry picked from commit a52778c747)
(cherry picked from commit cf2ec62740)

[CI] Forgejo Actions based release process (squash) version

use Actions environment variables in Makefile (#25319) (#25318)

uses Actions variable to determine the version. But Forgejo builds
happen in a container where they are not available. Do not use them.

Also verify the version of the binary is as expected for sanity check.

(cherry picked from commit 6decf111a1)
(cherry picked from commit 206d0b3886)

[CI] read STORED_VERSION_FILE if available

(cherry picked from commit af74085ebf)

[CI] backward compatible executable compilation

Add a new static-executable target to use in Dockerfiles and restore
the $(EXECUTABLE) target to what it was before to for backward
compatibility.

The release process now builds static executables instead of
dynamically linked ones which makes them more portable. It changes the
requirements at compile time and is not backward compatible. In
particular it may break packaging that rely on the target that
currently creates a dynamically linked executable.

(cherry picked from commit 84d02a174a)
(cherry picked from commit 854be47328)

[CI] Forgejo Actions based release process (squash) doc / ca / verbosity

- Document workflow
- Increase verbosity if VERBOSE=true
- Download the Certificate Authority if behind the VPN

(cherry picked from commit 168d5d5869)
(cherry picked from commit 8756c9a72a)
(cherry picked from commit 2dad7ef20f)

[CI] Forgejo Actions based release process (squash) add assets sources-tarbal

Refs: https://codeberg.org/forgejo/forgejo/issues/1115
(cherry picked from commit 5531d01f19)

[CI] Forgejo Actions based release process (squash) add assets sources-tarbal

bindata.go is a file, not a directory

Refs: https://codeberg.org/forgejo/forgejo/issues/1115
(cherry picked from commit bd88a44778)
(cherry picked from commit b408085138)

[CI] Forgejo Actions based release process (squash) public/assets moved

(cherry picked from commit d8c921d5a6)
(cherry picked from commit f29e50b1a09b1a22fc2dbdb77e9a1def1196175b)

[CI] Fix release notes link

- Use substitution to replace all dots with dashes.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1163

(cherry picked from commit 96783728f53a072915cace392aa269adfe9a5c73)
(cherry picked from commit c8d8bf8996)

[CI] pin go v1.20 for testing

Refs: https://codeberg.org/forgejo/forgejo/issues/1228
(cherry picked from commit fd4b5a013e)
(cherry picked from commit 00bb15f57f)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	see https://codeberg.org/forgejo/forgejo/pulls/1303
(cherry picked from commit 6e2be54a6d)
(cherry picked from commit 346c418b4a)
(cherry picked from commit 49061f8422)
(cherry picked from commit 8229d59b7e)
(cherry picked from commit 70d45d9193)

[CI] Forgejo Actions based release process (squash) need node 18

(cherry picked from commit 722b1f4590)
(cherry picked from commit a91d786169)

[CI] Forgejo Actions based release process (squash) fix indentation

(cherry picked from commit fbdf9d6abb)
(cherry picked from commit 2deff90a13)
(cherry picked from commit 5710a27fda)

[CI] Forgejo Actions based release process (squash) FQIN for docker

Refs: https://codeberg.org/forgejo/forgejo/issues/1600
(cherry picked from commit f63d38deb6)

[CI] Forgejo Actions based release process (squash) use forgejo-curl.sh

(cherry picked from commit c0c3ef506f)
(cherry picked from commit 933ca7ec5d)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	https://codeberg.org/forgejo/forgejo/pulls/1691
(cherry picked from commit 1068e48805)

[CI] Forgejo Actions based release process (squash) size optimization

(cherry picked from commit 3c653ff742)
(cherry picked from commit 398567fc0c)
(cherry picked from commit e585db9a97)
(cherry picked from commit 17e91c96e3)

[CI] Forgejo Actions based release process (squash) gitea to forgejo

(cherry picked from commit 9c06a318b8)
(cherry picked from commit 95859da3b4)
(cherry picked from commit e3a5f6c1ed)
(cherry picked from commit 7b9b259c75)
(cherry picked from commit c4a152c8dc)
(cherry picked from commit b00bf599ef)
(cherry picked from commit a7836ee2ee)
(cherry picked from commit 3ea7dcbd5b)
(cherry picked from commit 454d705e83)
(cherry picked from commit 35e06c3009)
(cherry picked from commit 904468a38f)
(cherry picked from commit 890e86815a)
(cherry picked from commit bf9f94c63d)
(cherry picked from commit d025d061d1)
(cherry picked from commit 32f209a8e1)
(cherry picked from commit 38ef6802fc)
(cherry picked from commit 8a19bbd2a8)
(cherry picked from commit f352dee786)
(cherry picked from commit b53d9fc090)
(cherry picked from commit 3dae21f4c8)
(cherry picked from commit 8b59e016c7)
(cherry picked from commit 6f54ea6a0e)
(cherry picked from commit ed8d90de6b)
(cherry picked from commit 26ffd3fcac)
(cherry picked from commit 287b3bbfb5)
(cherry picked from commit ab81378d0c)
(cherry picked from commit f6bbe7e875)
(cherry picked from commit 8968f34edf)
(cherry picked from commit d3d914bba2)
(cherry picked from commit 4e4006a990)
(cherry picked from commit edb333569b)
(cherry picked from commit 6c1a4baa15)
(cherry picked from commit 51bda3bfc7)
(cherry picked from commit 6f5f318b8f)
(cherry picked from commit e128da2362)
(cherry picked from commit 3e6735ff23)
(cherry picked from commit 938c444125)
(cherry picked from commit 67f92dc9ab)
(cherry picked from commit ee31df71fb)
(cherry picked from commit 386f232191)
(cherry picked from commit 745785cd7f)
(cherry picked from commit efa8564e76)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	https://codeberg.org/forgejo/forgejo/pulls/2029
(cherry picked from commit f3dfb14321)
(cherry picked from commit 5a0346ee95)
(cherry picked from commit 7a2a6517f2)
(cherry picked from commit 87dcc87da9)
(cherry picked from commit df4099247f)
(cherry picked from commit df23f83545)
2024-02-05 13:33:59 +01:00
Earl Warren 0dbcf3a3e8
[CI] Forgejo Actions based CI for PR & branches
(cherry picked from commit f9d75d4705)
(cherry picked from commit 64f76f4ab2)
(cherry picked from commit 5d02454155)

[CI] Forgejo Actions workflows

(cherry picked from commit 3ff59b5379)
(cherry picked from commit 8af826a6f7)
(cherry picked from commit d7c09d9cc8)

[CI] use the docker label instead of ubuntu-latest

(cherry picked from commit b6a6470db6)

[CI] all tests need compliance before proceeding

(cherry picked from commit b35c496f2c)
(cherry picked from commit 36a4148a8e)
(cherry picked from commit 7ffcffa653)
(cherry picked from commit 8a246d296e)
(cherry picked from commit dd0b6e1826)

[CI] Forgejo Actions based release process (squash) MySQL optimization

Refs: https://codeberg.org/forgejo/forgejo/issues/976
(cherry picked from commit b4b8c489e6)
(cherry picked from commit 1e861db4af)
(cherry picked from commit a6c0e00330)
(cherry picked from commit f97b336465)
(cherry picked from commit 6d65d5f0d6f798556a8f9e547896be03a5ee2f87)
(cherry picked from commit 79bfbadbed)
(cherry picked from commit e86c40a34a)
(cherry picked from commit da0c454adb)
(cherry picked from commit b49d892cda)

[CI] enable minio tests

(cherry picked from commit 4d8f438031)
(cherry picked from commit c4eeb0a61e)

[CI] Forgejo Actions based CI for PR & branches (squash) cleanup

(cherry picked from commit 80eb20e842)
(cherry picked from commit d2ff589858)
(cherry picked from commit f6eedecb67)
(cherry picked from commit cf458091e2)
(cherry picked from commit ddd322cb2d)
(cherry picked from commit f0f5729b64)

Conflicts:
	.github/workflows/pull-db-tests.yml
	https://codeberg.org/forgejo/forgejo/pulls/1573
(cherry picked from commit bb347aedd4)
(cherry picked from commit 0f5ebe8c3e)
(cherry picked from commit 9101cb4715)
(cherry picked from commit ab118fe4ef)

[CI] Forgejo Actions based CI for PR & branches (squash) use node:20-bookworm

No longer use the custom test-env image, it is unecessary technical
debt.

Also upgrade to bitnami/minio:2023.8.31 to align with what Gitea tests

(cherry picked from commit d9b77fd273)
(cherry picked from commit ef8f099f9e)
(cherry picked from commit 6d3c675d20)
(cherry picked from commit fc00ff45f2)
(cherry picked from commit b7f02b9846)
(cherry picked from commit d23d86e567)
(cherry picked from commit e68e65460c)
(cherry picked from commit 96f93a1fdb)
(cherry picked from commit 2ff3080018)
(cherry picked from commit 8ea00bcff4)
(cherry picked from commit 85be961970)
(cherry picked from commit 387b279fc3)
(cherry picked from commit 219be7aa85)
(cherry picked from commit 929b75ee39)
(cherry picked from commit dd42a30d6a)
2024-02-05 13:33:59 +01:00
Loïc Dachary be2de105f5
[CI] Search .forgejo/workflows first
(cherry picked from commit 8b11cab677)
(cherry picked from commit be59270696)
(cherry picked from commit e068f8b191)
(cherry picked from commit 7855bb0c60)
(cherry picked from commit 45c4c8f443)
(cherry picked from commit 89520d67ff)
(cherry picked from commit 15eeb417a4)
(cherry picked from commit 6db53a2643)
(cherry picked from commit 2f689b321f)
(cherry picked from commit 04dc478314c3b4927cca78c354ca46ee217f035a)
(cherry picked from commit a554624f40)
(cherry picked from commit abca05f0d1)
(cherry picked from commit dc13e7eb22)
(cherry picked from commit a161c5740e)
(cherry picked from commit 06d33e2773)
(cherry picked from commit f536275161)
(cherry picked from commit 84ac6f314a)
(cherry picked from commit 1e8126edfc)
(cherry picked from commit 0287ac3416)
(cherry picked from commit 3e5fca2aae)
(cherry picked from commit 03b220bfeb)
(cherry picked from commit 1d033f4aaf)
(cherry picked from commit 2ee9e3e9a3)
(cherry picked from commit d28c284993)
(cherry picked from commit 239df83859)
(cherry picked from commit 96ae0c2e5d)
(cherry picked from commit 49aef71b32)
(cherry picked from commit 38b56d108d)
(cherry picked from commit 30f8d9ec3a)
(cherry picked from commit d531861850)
(cherry picked from commit a75707deaa)
(cherry picked from commit b1c73918b2)
(cherry picked from commit 5391917091)
(cherry picked from commit a427f8dae5)
(cherry picked from commit 6ba6f62c7e)
2024-02-05 13:33:59 +01:00
Earl Warren c480d7fe6d
[CI] disable meilisearch/elasticsearch test, no server yet in CI
(cherry picked from commit a1381d9146fba42cb97d72d38525fa3e721bfb03)
(cherry picked from commit 74714e0246)
(cherry picked from commit 7749dbfe66)
(cherry picked from commit 4379249711)
(cherry picked from commit a69f55bebf)
(cherry picked from commit 24dd5fbfdb)
(cherry picked from commit dda856d6b8)
(cherry picked from commit bc14f4fa97)
(cherry picked from commit 78fef4f137)
(cherry picked from commit 69e013cc51)
(cherry picked from commit f173c6a273)
(cherry picked from commit 92f9d02547)
(cherry picked from commit c99d51e665)
(cherry picked from commit aa0650fd2b)
(cherry picked from commit 0a8ef91302)
(cherry picked from commit 7b54fe01c2)
(cherry picked from commit 0e154f366f)
(cherry picked from commit 02d88ee16d)
(cherry picked from commit 411924e017)
(cherry picked from commit f4e9ca6db5)
(cherry picked from commit cd80126a23)
(cherry picked from commit da626702f9)
(cherry picked from commit 4b81d0bd04)
(cherry picked from commit 53ac260669)
(cherry picked from commit 984081f08d)
(cherry picked from commit 1c39bae3ec)
2024-02-05 13:33:58 +01:00
Earl Warren d26fce3995
[CI] disable redis test, no redis server yet in CI
(cherry picked from commit e1bbfa3619)
(cherry picked from commit 91245ca917)
(cherry picked from commit 705d0558be)
(cherry picked from commit 9247594970)
(cherry picked from commit 9db1158a48)
(cherry picked from commit 3b36b77d87)
(cherry picked from commit 162fa1d8ae)
(cherry picked from commit d03d0afbb5)
(cherry picked from commit 7b8f92f787)
(cherry picked from commit 035abca969)
(cherry picked from commit a8fbf6bb56)
(cherry picked from commit 3be681d037b07880236cae1aa70245e5eb4d1497)
(cherry picked from commit 7e5d471c83)
(cherry picked from commit 323801d935)
(cherry picked from commit 3fdfe4bfea)
(cherry picked from commit 58a07421a4)
(cherry picked from commit dbb71a4c85)
(cherry picked from commit d442113520)
(cherry picked from commit d3329f01f8)
(cherry picked from commit 069a1d68b8)
(cherry picked from commit 14919e609a)
(cherry picked from commit 49b76be106)
(cherry picked from commit 0fe9f257d2)
(cherry picked from commit b583bebeab)
(cherry picked from commit 5c616e43a6)
(cherry picked from commit 854bcea905)
(cherry picked from commit c2acb181c5)
(cherry picked from commit 1cb07e71d1)
(cherry picked from commit 5d3f09e635)
(cherry picked from commit f8bf1c8d42)
(cherry picked from commit a471ed4576)
(cherry picked from commit 95c755f4e3)
(cherry picked from commit 1d8bc5215f)
(cherry picked from commit 45c1e7b8d0)
(cherry picked from commit 2eb4d93af7)
(cherry picked from commit 98dbce5e14)
(cherry picked from commit fbe2fb5861)
2024-02-05 13:33:58 +01:00
Loïc Dachary 689c48cdc0
[CI] set PASSWORD_HASH_ALGO = argon2 for integration tests
(cherry picked from commit 1d7ce2a39c)
(cherry picked from commit 3af8757583)
(cherry picked from commit 0b81815209)
(cherry picked from commit 7180a3222a)
(cherry picked from commit 069044f4a6)
(cherry picked from commit dd1438f389)
(cherry picked from commit 4ae6b5d64d)
(cherry picked from commit c572666d78)
(cherry picked from commit de0a4480bc)
(cherry picked from commit 60272ef4f7)
(cherry picked from commit a68fdde4be)
(cherry picked from commit ff448cf3a6)
(cherry picked from commit 208498caaa)
(cherry picked from commit 1abd3efad8)
(cherry picked from commit 818c7f4ca9)
(cherry picked from commit 1e552bbe44)
(cherry picked from commit 88dbd6da1d)
(cherry picked from commit b1c86fb777)
(cherry picked from commit 185b1e25b1)
(cherry picked from commit 0af35605ae)
(cherry picked from commit 350975b63f)
(cherry picked from commit 2788142515)
(cherry picked from commit b418a53717b247e10d2dda26d1d236400d423a94)
(cherry picked from commit 086cde3f10)
(cherry picked from commit 3e4818c779)
(cherry picked from commit f2bf1fe64f)
(cherry picked from commit db4eb288ee)
(cherry picked from commit f8db31821b)
(cherry picked from commit 2b13c06f49)
(cherry picked from commit 3fd0092056)
(cherry picked from commit 6f7662507f)
(cherry picked from commit 8a15e41887)

Conflicts:
	tests/mysql8.ini.tmpl
	https://codeberg.org/forgejo/forgejo/pulls/1573
(cherry picked from commit 56e67e34e2)
(cherry picked from commit 6a049a939b)
(cherry picked from commit 454fe7f5e1)
(cherry picked from commit 93fa4406b7)
(cherry picked from commit eab1c72227)
(cherry picked from commit 8228adfd26)
(cherry picked from commit ffdbe1bac8)
(cherry picked from commit 7df4407714)
(cherry picked from commit 9d8c4bc7ca)
(cherry picked from commit 6696e09b1f)
(cherry picked from commit 1bdc0e3458)
(cherry picked from commit e2d1598475)
(cherry picked from commit 6e0928ae00)
(cherry picked from commit eede74e709)
(cherry picked from commit b4fb5f64c6)
(cherry picked from commit cf05ec745a)
2024-02-05 13:33:58 +01:00
Loïc Dachary 2cee2e90dc
[CI] implementation: forgejo container images
(cherry picked from commit dd1971d4e6)
(cherry picked from commit 3981dbaf8c)
(cherry picked from commit 8dff3cc2d1)
(cherry picked from commit e7673e5d22)
(cherry picked from commit 326174064b)
(cherry picked from commit eb769dbde4)
(cherry picked from commit 335829ade2)
(cherry picked from commit 5e8e4f549d)

Conflicts:
	Dockerfile
	Dockerfile.rootless
(cherry picked from commit b777fc91d0)
(cherry picked from commit 02cda642ec)
(cherry picked from commit 96ef93f3bc)
(cherry picked from commit aa424551f2)

Conflicts:
	Dockerfile
	Dockerfile.rootless
(cherry picked from commit e54fa86e49)
(cherry picked from commit 043fa6d664)
(cherry picked from commit 805b162480)
(cherry picked from commit 86bf362a3c)
(cherry picked from commit 13e0007959)
(cherry picked from commit 00ff6f7cb3)
(cherry picked from commit 95c7d8e883)
(cherry picked from commit fb033d2bb6)
(cherry picked from commit 1147910a55)
(cherry picked from commit 6590b6e99c)
(cherry picked from commit 78938113e4)
(cherry picked from commit 57338224f172e30a72f03f565aa47876e1213e77)
(cherry picked from commit 4266cbcdd4)
(cherry picked from commit bdc766a5a2)
(cherry picked from commit 6fb9ad8504)
(cherry picked from commit c4e6383240)
(cherry picked from commit 490fa55b3a)
(cherry picked from commit 802c8e72be)
(cherry picked from commit 2b1efe2030)
(cherry picked from commit fdcdd7389a)
(cherry picked from commit b9ae491650)
(cherry picked from commit e7867c6512)
(cherry picked from commit 0a43263fa6)
(cherry picked from commit 64bb6b8982)
(cherry picked from commit dcc1fd6292)
(cherry picked from commit b0250fd533)
(cherry picked from commit 427b059996)
(cherry picked from commit b6058e28cb)
(cherry picked from commit b91a41dd79)
(cherry picked from commit b8bcb22726)
(cherry picked from commit 69ae87f11f)

Conflicts:
	Dockerfile
	Dockerfile.rootless
	https://codeberg.org/forgejo/forgejo/pulls/2029
(cherry picked from commit a4a846a8d5)
(cherry picked from commit a1a947ce03)
(cherry picked from commit 55bd48007f)
(cherry picked from commit f012eb7cb0)
(cherry picked from commit 59d0824a3d)
(cherry picked from commit 59a797db40)
2024-02-05 13:33:58 +01:00
Loïc Dachary 00c22a25e5
[CI] implementation: publish forgejo- binaries instead of gitea-
(cherry picked from commit 6d910daafb)
(cherry picked from commit d447861cc9)
(cherry picked from commit dc6e9d8799)
(cherry picked from commit ef232fa20c)
(cherry picked from commit 290c55517a)
(cherry picked from commit db48af1784)
(cherry picked from commit 85f33237a2)
(cherry picked from commit 76899ee33e)
(cherry picked from commit 148b3ee9cb)
(cherry picked from commit 1f6ad8f465)
(cherry picked from commit c330afdba3)
(cherry picked from commit b1f87075a7)
(cherry picked from commit 7da40992cc)
(cherry picked from commit 7ab19ff5e5)
(cherry picked from commit e61e44921b)
(cherry picked from commit 83646119fb)
(cherry picked from commit 20cf748e61)
(cherry picked from commit 0a99919cec)
(cherry picked from commit 21215222a6)
(cherry picked from commit 0f6c5658d7)
(cherry picked from commit 1752e43d3c)
(cherry picked from commit 2332080929)
(cherry picked from commit 590aabf2a2)
(cherry picked from commit 87d8b7b315c3e25bd3fcf9dc9c1d359bcd107281)
(cherry picked from commit ff37de38be)
(cherry picked from commit cee32c9e7a)
(cherry picked from commit 39faade524)
(cherry picked from commit 0e5ca477b6)
(cherry picked from commit 70e2730f7b)
(cherry picked from commit 2ad4003944)
(cherry picked from commit 2429de9e87)
(cherry picked from commit c133915fc1)
(cherry picked from commit c607dcaf9f)
(cherry picked from commit 00f006637f)
(cherry picked from commit 0de6646475)
(cherry picked from commit b05e83bb1e)
(cherry picked from commit cb71f139f0)
(cherry picked from commit 2a8b08ee4f)
(cherry picked from commit 3ebab73c4e)
(cherry picked from commit 07626c088c)
(cherry picked from commit 844e9bc999)
(cherry picked from commit c315e24751)
(cherry picked from commit f5f2b41f3c)
(cherry picked from commit 09134424a8)
(cherry picked from commit 6fc63d48c4)
(cherry picked from commit a0be5c783e)
(cherry picked from commit 124bad8230)
(cherry picked from commit 57069811d1)
(cherry picked from commit 8871d1aac7)
2024-02-05 13:33:58 +01:00
Earl Warren e90db3f5cc
[CLI] implement forgejo-cli
(cherry picked from commit 2555e315f7)
(cherry picked from commit 51b9c9092e)

[CLI] implement forgejo-cli (squash) support initDB

(cherry picked from commit 5c31ae602a)
(cherry picked from commit bbf76489a7)

Conflicts:
	because of d0dbe52e76
	upgrade to https://pkg.go.dev/github.com/urfave/cli/v2
(cherry picked from commit b6c1bcc008)

[CLI] implement forgejo-cli actions

(cherry picked from commit 08be2b226e)
(cherry picked from commit b6cfa88c6e)
(cherry picked from commit 59704200de)

[CLI] implement forgejo-cli actions generate-secret

(cherry picked from commit 6f7905c8ec)
(cherry picked from commit e085d6d273)

[CLI] implement forgejo-cli actions generate-secret (squash) NoInit

(cherry picked from commit 962c944eb2)

[CLI] implement forgejo-cli actions register

(cherry picked from commit 2f95143000)
(cherry picked from commit 42f2f8731e)

[CLI] implement forgejo-cli actions register (squash) no private

Do not go through the private API, directly modify the database

(cherry picked from commit 1ba7c0d39d)

[CLI] implement forgejo-cli actions

(cherry picked from commit 6f7905c8ec)
(cherry picked from commit e085d6d273)

[CLI] implement forgejo-cli actions generate-secret (squash) NoInit

(cherry picked from commit 962c944eb2)
(cherry picked from commit 4c121ef022)

Conflicts:
	cmd/forgejo/actions.go
	tests/integration/cmd_forgejo_actions_test.go
(cherry picked from commit 36997a48e3)

[CLI] implement forgejo-cli actions (squash) restore --version

Refs: https://codeberg.org/forgejo/forgejo/issues/1134
(cherry picked from commit 9739eb52d8)

[CI] implement forgejo-cli (squash) the actions subcommand needs config

(cherry picked from commit def638475122a26082ab3835842c84cd03839154)

Conflicts:
	cmd/main.go
	https://codeberg.org/forgejo/forgejo/pulls/1209
(cherry picked from commit a1758a3910)
(cherry picked from commit 935fa650c7)
(cherry picked from commit cd21026bc9)
(cherry picked from commit 1700b8973a)
(cherry picked from commit 1def42a379)
(cherry picked from commit 839d97521d)
(cherry picked from commit fd8c13be6b)
(cherry picked from commit 588e5d552f)
(cherry picked from commit 151a726620)

[v1.22] [CLI] implement forgejo-cli

https://codeberg.org/forgejo/forgejo/pulls/1541
(cherry picked from commit 46708de7b9)
(cherry picked from commit a8e5c1369e)
(cherry picked from commit c8a32aaf24)

Conflicts:
	models/actions/main_test.go
	https://codeberg.org/forgejo/forgejo/pulls/1656
(cherry picked from commit 79f4553063)
(cherry picked from commit 0379da0cf5)
(cherry picked from commit 331d58c085)
(cherry picked from commit 89705502c4)
(cherry picked from commit 4723d5febf)
(cherry picked from commit e71b260130)
(cherry picked from commit 6a376a5b48)

Conflicts:
	cmd/main.go
	https://codeberg.org/forgejo/forgejo/pulls/1969
(cherry picked from commit 6ba97cf4b5)
(cherry picked from commit e0a6ebfeca)
(cherry picked from commit 5702aeab2d)
(cherry picked from commit f919c4d6c1)
(cherry picked from commit a26799a88a)
(cherry picked from commit b6ab473395)
(cherry picked from commit cf054a0461)
2024-02-05 13:33:58 +01:00
Earl Warren 4e5bf59579
[CI] DEFAULT_ACTIONS_URL = https://code.forgejo.org
[CI] Revert "Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581)"

This reverts commit 67bd9d4f1e.

(cherry picked from commit 0547e94023)
(cherry picked from commit d21ad654ad)
(cherry picked from commit b905e9d838)
(cherry picked from commit 251a5bf235b1723bc2bc324f9e8c03a8668bb5ae)
(cherry picked from commit b370e47694)
(cherry picked from commit 2cc28d0785)
(cherry picked from commit ed870a39e9)
(cherry picked from commit 7bb0c4654e)
(cherry picked from commit bab1f552c3)

Conflicts:
	custom/conf/app.example.ini
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1413

[CI] DEFAULT_ACTIONS_URL = https://codeberg.org

(cherry picked from commit 52b364ddbd)
(cherry picked from commit 99887cd567)
(cherry picked from commit cd5788782a)
(cherry picked from commit 71c698a704)
(cherry picked from commit 71386241dd)
(cherry picked from commit b7ab05aeac)
(cherry picked from commit e78b9ca59c)
(cherry picked from commit edb3adf460)
(cherry picked from commit 3e40088197)

[BRANDING] DEFAULT_ACTIONS_URL = https://code.forgejo.org

(cherry picked from commit d0e4512c90)
(cherry picked from commit 8ba6e04709)
(cherry picked from commit 6349081044)
(cherry picked from commit e06bd44495)
(cherry picked from commit d58219d8e1)
(cherry picked from commit 052f2c2aa4)
(cherry picked from commit 29dc395386)
(cherry picked from commit 9eef3f59f3)
(cherry picked from commit d650391fed)
(cherry picked from commit c2e6e8c55d)
(cherry picked from commit e28a47741d)

[CI] DEFAULT_ACTIONS_URL support for self & github (squash)

Refs: https://codeberg.org/forgejo/forgejo/issues/1062
(cherry picked from commit 74cc25376e)
(cherry picked from commit 405430708f)
(cherry picked from commit 0274a6dee7f383bcd6b65b995b991b5ab0ee635a)
(cherry picked from commit be5cda0fd0)
(cherry picked from commit d27474849f)
(cherry picked from commit 4a5e9e2d81)
(cherry picked from commit 65b31906b2)
(cherry picked from commit 13cf0b0963)

Conflicts:
	custom/conf/app.example.ini
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1413
(cherry picked from commit 49529badce)

Conflicts:
	custom/conf/app.example.ini
	docs/content/administration/config-cheat-sheet.en-us.md
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1460
(cherry picked from commit 00327b9b1f)
(cherry picked from commit 3b322e43d5)
(cherry picked from commit 492cc52059)

Conflicts:
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1573
(cherry picked from commit 9027b655df)
(cherry picked from commit 4764383028)
(cherry picked from commit fbb00fd1cf)
(cherry picked from commit 417cd6c801)
(cherry picked from commit 6b70773ad8)
(cherry picked from commit 9ba069327d)

Conflicts:
	modules/setting/actions.go
	https://codeberg.org/forgejo/forgejo/pulls/1827
(cherry picked from commit 727edf19ee)
(cherry picked from commit 689326ce20)
(cherry picked from commit 745d60aec4)
(cherry picked from commit cb4ae4582c)
(cherry picked from commit 48d5ffe1c0)

Conflicts:
	custom/conf/app.example.ini
	https://codeberg.org/forgejo/forgejo/pulls/2068
(cherry picked from commit bbd4725bfd)
(cherry picked from commit 04eda91d10)
(cherry picked from commit d3621e4634)
(cherry picked from commit 08da63cc4d)
(cherry picked from commit dc6d291b71)
2024-02-05 13:33:58 +01:00
Earl Warren cb5448d15e
[FORGEJO] temporarily remove .github & .gitea 2024-02-05 13:31:06 +01:00
Yarden Shoham 6992ef98fc
Don't do a full page load when clicking `Watch` or `Star` (#29001)
- The watch/unwatch button and star/unstar get their own template
- The backend returns HTML instead of redirect

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2024-02-05 09:56:20 +00:00
Jason Song 0d136df3f0
Remove useless template file (#29053)
Removed `templates/repo/settings/nav.tmpl`.

I don't think it's still used.

On main branch:
<img width="521" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/c0bf958c-698a-4348-840e-3ade0312bd6e">

On commit 755eec745f (the commit that
created this file):

<img width="615" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/5156b26d-1ecd-4197-a0a6-dc2d17652ff4">
2024-02-05 09:23:08 +00:00
Wang 4bb1fcd2e7
Fix typos in the documentation (#29048)
Corrected two typos.
2024-02-05 16:19:05 +08:00
Lunny Xiao 9bb1adf8ea
Move some repository transfer functions to service layer (#28855) 2024-02-05 06:17:23 +00:00
Sergey Bugaev 2da233ad8b
Propagate install_if and provider_priority to APKINDEX (#28899)
Resolves https://github.com/go-gitea/gitea/issues/28704

Example of an entry in the generated `APKINDEX` file:

```
C:Q1xCO3H9LTTEbhKt9G1alSC87I56c=
P:hello
V:2.12-r1
A:x86_64
T:The GNU Hello program produces a familiar, friendly greeting
U:https://www.gnu.org/software/hello/
L:GPL-3.0-or-later
S:15403
I:36864
o:hello
m:
t:1705934118
D:so:libc.musl-x86_64.so.1
p:cmd:hello=2.12-r1
i:foobar=1.0 !baz
k:42
```

the `i:` and `k:` entries are new.

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-02-05 05:52:56 +00:00
GiteaBot 016c77a833 [skip ci] Updated licenses and gitignores 2024-02-05 00:25:25 +00:00
Bram Hagens 50f55f11c4
Show whether a PR is WIP inside popups (#28975)
Fixes https://codeberg.org/forgejo/forgejo/issues/2257

Draft status of a PR is currently not exposed by the API. This PR adds a
'draft' field to pull requests in the API, which is used to correctly
set the PR color/icon in a ContextPopup.

---

Before:

![image](https://github.com/go-gitea/gitea/assets/5541521/72cbd30e-1175-4338-aa97-ac99c46c5118)

After:

![image](https://github.com/go-gitea/gitea/assets/5541521/111c9eba-460e-4d57-bcca-23a151c3a4f1)
2024-02-04 22:37:45 +00:00
KN4CK3R 688d4a1f71
Unify password changing and invalidate auth tokens (#27625)
- Unify the password changing code
- Invalidate existing auth tokens when changing passwords
2024-02-04 14:05:26 +00:00
KN4CK3R f8b471ace1
Unify user update methods (#28733)
Fixes #28660
Fixes an admin api bug related to `user.LoginSource`
Fixed `/user/emails` response not identical to GitHub api

This PR unifies the user update methods. The goal is to keep the logic
only at one place (having audit logs in mind). For example, do the
password checks only in one method not everywhere a password is updated.

After that PR is merged, the user creation should be next.
2024-02-04 13:29:09 +00:00
wxiaoguang b4513f48ce
Do not render empty comments (#29039)
Follow #28654

The `comments` might be empty, so the templates shouldn't (and couldn't)
use it to render. When there is no comment, the UI should also be
updated to empty, so returning an empty body is good enough.
2024-02-04 13:05:01 +00:00
KN4CK3R 9bea276055
Add `must-change-password` cli parameter (#27626)
This PR adds a new `must-change-password` parameter to the
`change-password` cli command.
We already have the `must-change-password` command but it feels natural
to have this integrated into the `change-password` cli command.

---------

Co-authored-by: 6543 <6543@obermui.de>
2024-02-03 19:53:27 +02:00
Gwyneth Morgan 360b3fd17c
Include username in email headers (#28981)
Emails from Gitea comments do not contain the username of the commenter
anywhere, only their display name, so it is not possible to verify who
made a comment from the email itself:

	From: "Alice" <email@gitea>
	X-Gitea-Sender: Alice
	X-Gitea-Recipient: Bob
	X-GitHub-Sender: Alice
	X-GitHub-Recipient: Bob

	This comment looks like it's from @alice.

The X-Gitea/X-GitHub headers also use display names, which is not very
reliable for filtering, and inconsistent with GitHub's behavior:

	X-GitHub-Sender: lunny
	X-GitHub-Recipient: gwymor

This change includes both the display name and username in the From
header, and switches the other headers from display name to username:

	From: "Alice (@fakealice)" <email@gitea>
	X-Gitea-Sender: fakealice
	X-Gitea-Recipient: bob
	X-GitHub-Sender: fakealice
	X-GitHub-Recipient: bob

	This comment looks like it's from @alice.
2024-02-03 00:41:27 +00:00
silverwind a6cea59514
Update tool dependencies (#29030) 2024-02-02 19:11:39 -05:00
ChristopherHX a9bc590d5d
Add artifacts v4 jwt to job message and accept it (#28885)
This change allows act_runner / actions_runner to use jwt tokens for
`ACTIONS_RUNTIME_TOKEN` that are compatible with
actions/upload-artifact@v4.

The official Artifact actions are now validating and extracting the jwt
claim scp to get the runid and jobid, the old artifact backend also
needs to accept the same token jwt.

---
Related to #28853

I'm not familar with the auth system, maybe you know how to improve this

I have tested
- the jwt token is a valid token for artifact uploading
- the jwt token can be parsed by actions/upload-artifact@v4 and passes
their scp claim validation

Next steps would be a new artifacts@v4 backend.

~~I'm linking the act_runner change soonish.~~
act_runner change to make the change effective and use jwt tokens
<https://gitea.com/gitea/act_runner/pulls/471>
2024-02-02 14:25:59 +00:00
silverwind 8f9f0e4ab2
Pass es2020 to esbuild-loader as well (#29027)
Followup https://github.com/go-gitea/gitea/pull/28977. I forgot to pass
the updated option to esbuild-loader, e.g. previously it was only passed
to the minifier.
2024-02-02 15:01:32 +01:00
yp05327 3aed8ae034
Fix default avatar image size in PR diff page (#28971)
Fix #28941

ps: didn't test. The repo is too big to migrate.
2024-02-02 10:01:11 +00:00
silverwind a062725758
Update JS and PY dependencies, build for `es2020` browsers (#28977)
- Update all JS dependencies minus @mcaptcha/vanilla-glue
- Fix new lint errors
- Regenerate SVGs
- Switch to maintained stylelint stylistic plugin
- Tested Mermaid, Citation, Swagger, sorting
- Raise ESBuild target to `es2020` as dictated by `pretty-ms`
dependency.
2024-02-02 09:36:32 +00:00
delvh 71422c0e3b
Wrap contained tags and branches again (#29021)
Fixes #29016

## After

![grafik](https://github.com/go-gitea/gitea/assets/51889757/2c72ee8f-439e-4328-85df-77772e0f4aef)
2024-02-02 04:51:09 +00:00
yp05327 b9f8d75e27
Avoid sending update/delete release notice when it is draft (#29008)
Fix #27157
2024-02-02 04:18:12 +00:00
wxiaoguang e6265cf59d
Fix incorrect button CSS usages (#29015) 2024-02-01 21:28:50 +00:00
silverwind b71850ea73
Strip trailing newline in markdown code copy (#29019)
Behaviour now matches GH. Safeguard added in the for loop because
`textContent` may be null in which case it does not make sense to render
the copy button.
2024-02-01 15:01:48 -06:00
KN4CK3R c3e462921e
Improve user search display name (#29002)
I tripped over this strange method and I don't think we need that
workaround to fix the value.

old:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/c8b6797b-eb45-4dec-99db-1b0649a34ec5)

new:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/ab1a65ae-de5b-4ce4-9813-3b8b39c7922e)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-02-01 17:10:16 +00:00
Lunny Xiao 3a66762130
Revert "Speed up loading the dashboard on mysql/mariadb (#28546)" (#29006)
This reverts commit fa8c3beb26. #28546 
Because it seems performance become worse.
2024-02-01 14:25:37 +08:00
silverwind a1e0d8bd8b
Update dorny/paths-filter action (#29003) 2024-01-31 20:43:06 -05:00
GiteaBot ab45f9ee12 [skip ci] Updated translations via Crowdin 2024-02-01 00:25:05 +00:00
yp05327 64faecefe1
Fix UI Spacing Errors in mirror settings (#28990) 2024-02-01 00:04:23 +00:00
Yarden Shoham 4989ad0a9f
Add htmx guidelines (#28993)
To make sure we don't abuse it.

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2024-01-31 23:36:23 +01:00
Lunny Xiao 3b50dd95ce
Some refactor for git http (#28995)
# Purpose

This PR makes git http related functions use the same `context.Context`
so they can be maintained easier.
2024-01-31 15:23:22 +00:00
Zettat123 adc3598a75
Fix an actions schedule bug (#28942)
In #28691, schedule plans will be deleted when a repo's actions unit is
disabled. But when the unit is enabled, the schedule plans won't be
created again.

This PR fixes the bug. The schedule plans will be created again when the
actions unit is re-enabled
2024-01-31 14:55:12 +00:00
yp05327 0b1a42ce0f
Fix doc img path in profile readme (#28994)
https://gitea.com/gitea/gitea-docusaurus/actions/runs/1007/jobs/0#jobstep-9-25
2024-01-31 21:32:17 +08:00
Yarden Shoham 3e8414179c
Introduce htmx and use it to avoid full page load on `Subscribe` and `Follow` (#28908)
- Closes https://github.com/go-gitea/gitea/issues/28880

This change introduces htmx with the hope we could use it to make Gitea
more reactive while keeping our "HTML rendered on the server" approach.

- Add `htmx.js` that imports `htmx.org` and initializes error toasts
- Place `hx-headers='{"x-csrf-token": "{{.CsrfToken}}"}'` on the
`<body>` tag so every request that htmx sends is authenticated
- Place `hx-swap="outerHTML"` on the `<body>` tag so the response of
each htmx request replaces the tag it targets (as opposed to its inner
content)
- Place `hx-push-url="false"` on the `<body>` tag so no changes to the
URL happen in `<form>` tags
- Add the `is-loading` class during request

### Error toasts in action


![errors](https://github.com/go-gitea/gitea/assets/20454870/181a1beb-1cb8-4858-abe8-fa1fc3f5b8f3)

## Don't do a full page load when clicking the subscribe button
- Refactor the form around the subscribe button into its own template
- Use htmx to perform the form submission
- `hx-boost="true"` to prevent the default form submission behavior of a
full page load
- `hx-sync="this:replace"` to replace the current request (in case the
button is clicked again before the response is returned)
  - `hx-target="this"` to replace the form tag with the new form tag
- Change the backend response to return a `<form>` tag instead of a
redirect to the issue page

### Before


![subscribe_before](https://github.com/go-gitea/gitea/assets/20454870/cb2439a2-c3c0-425c-8d3c-5d646b1cdc28)

### After


![subscribe_after](https://github.com/go-gitea/gitea/assets/20454870/6fcd77d8-7b11-40b0-af4f-b152aaad787c)

## Don't do a full page load when clicking the follow button
- Use htmx to perform the button request
- `hx-post="{{.ContextUser.HomeLink}}?action=follow"` to send a POST
request to follow the user
- `hx-target="#profile-avatar-card"` to target the card div for
replacement
- `hx-indicator="#profile-avatar-card"` to place the loading indicator
on the card
- Change the backend response to return a `<div>` tag (the card) instead
of a redirect to the user page

### Before


![follow_before](https://github.com/go-gitea/gitea/assets/20454870/a210b643-6e74-4ff9-8e61-d658c62edf1f)

### After


![follow_after](https://github.com/go-gitea/gitea/assets/20454870/5bb19ae9-0d59-4ae3-b538-4c83334e4722)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-01-30 15:45:54 +01:00
KN4CK3R 27d4c11ec3
Fix joins in `db.Find(AndCount)` (#28978) 2024-01-30 02:37:24 +00:00
Mike Cifelli 8ef53c871b
Update golang links to use https (#28980)
Many of the golang links point to the old site and don't use https. This
pull request updates these outdated links to https://go.dev .

https://github.com/go-gitea/gitea/issues/28979
2024-01-30 03:11:11 +02:00
Matheus Sampaio Queiroga 37ede3197a
Fix google logo in security page (#28982)
Fix google logo in user security page: #28701

Before

![before user security
page](https://github.com/go-gitea/gitea/assets/50121801/6c058c28-8013-470a-b047-f47afecdca09)

after

![user security
page](https://github.com/go-gitea/gitea/assets/50121801/36053ee9-18c5-4ef0-a63a-8accc1d00adc)
2024-01-30 02:54:52 +02:00
cchangwen 28fe3db1fb
Also match weakly validated ETags (#28957)
https://stackoverflow.com/questions/51973120/where-does-the-w-in-an-etag-appear-from

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag#

---------

Co-authored-by: delvh <dev.lh@web.de>
2024-01-29 16:18:40 +00:00
GiteaBot 2a50d780f9 [skip ci] Updated licenses and gitignores 2024-01-29 00:24:21 +00:00
Lunny Xiao 34633d85f1
Fix bug for generated repository object format (#28969)
A repository generated from a template repository should have the same
git ObjectFormat.
2024-01-28 20:18:15 +00:00
Arnaud Morin dfc1ae15b6
Fixing small space missing in sample config file (#28967) 2024-01-28 14:58:00 +00:00
wackbyte d9b3849454
Fix inconsistent naming of OAuth 2.0 `ENABLE` setting (#28951)
Renames it to `ENABLED` to be consistent with other settings and
deprecates it.

I believe this change is necessary because other setting groups such as
`attachment`, `cors`, `mailer`, etc. have an `ENABLED` setting, but
`oauth2` is the only one with an `ENABLE` setting, which could cause
confusion for users.

This is no longer a breaking change because `ENABLE` has been set as
deprecated and as an alias to `ENABLED`.
2024-01-28 12:36:44 +00:00
6543 61f8ca4906
Add screenshot for "Profile Readmes" to docs (#28964)
introduced in #23260 ... the docs still looks to empty:
https://docs.gitea.com/usage/profile-readme

this changes it :)
2024-01-28 00:20:17 +01:00
Lunny Xiao 5f82ead13c
Simplify how git repositories are opened (#28937)
## Purpose
This is a refactor toward building an abstraction over managing git
repositories.
Afterwards, it does not matter anymore if they are stored on the local
disk or somewhere remote.

## What this PR changes
We used `git.OpenRepository` everywhere previously.
Now, we should split them into two distinct functions:

Firstly, there are temporary repositories which do not change:

```go
git.OpenRepository(ctx, diskPath)
```

Gitea managed repositories having a record in the database in the
`repository` table are moved into the new package `gitrepo`:

```go
gitrepo.OpenRepository(ctx, repo_model.Repo)
```

Why is `repo_model.Repository` the second parameter instead of file
path?
Because then we can easily adapt our repository storage strategy.
The repositories can be stored locally, however, they could just as well
be stored on a remote server.

## Further changes in other PRs
- A Git Command wrapper on package `gitrepo` could be created. i.e.
`NewCommand(ctx, repo_model.Repository, commands...)`. `git.RunOpts{Dir:
repo.RepoPath()}`, the directory should be empty before invoking this
method and it can be filled in the function only. #28940
- Remove the `RepoPath()`/`WikiPath()` functions to reduce the
possibility of mistakes.

---------

Co-authored-by: delvh <dev.lh@web.de>
2024-01-27 21:09:51 +01:00
silverwind 60e4a98ab0
Preserve BOM in web editor (#28935)
The `ToUTF8*` functions were stripping BOM, while BOM is actually valid
in UTF8, so the stripping must be optional depending on use case. This
does:

- Add a options struct to all `ToUTF8*` functions, that by default will
strip BOM to preserve existing behaviour
- Remove `ToUTF8` function, it was dead code
- Rename `ToUTF8WithErr` to `ToUTF8`
- Preserve BOM in Monaco Editor
- Remove a unnecessary newline in the textarea value. Browsers did
ignore it, it seems but it's better not to rely on this behaviour.

Fixes: https://github.com/go-gitea/gitea/issues/28743
Related: https://github.com/go-gitea/gitea/issues/6716 which seems to
have once introduced a mechanism that strips and re-adds the BOM, but
from what I can tell, this mechanism was removed at some point after
that PR.
2024-01-27 18:02:51 +00:00
Yarden Shoham 0e650dca30
Make loading animation less aggressive (#28955)
The current animation loops in a very fast manner, causing a slight
feeling of uncomfortableness. This change slows it a bit for a smoother
experience.

# Before


![before](https://github.com/go-gitea/gitea/assets/20454870/215a722d-feb4-4643-819d-c37a620c5e48)

# After


![after](https://github.com/go-gitea/gitea/assets/20454870/7acb1fab-9157-4f4d-8cc7-45fea0234b47)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-01-27 20:27:37 +08:00
KN4CK3R fc1bae00a4
Fix SSPI user creation (#28948)
Fixes #28945

Setting the avatar is wrong and creating a random password is equal to
leave it empty.
2024-01-27 09:27:34 +00:00
KN4CK3R 01acd1eea3
Strip `/` from relative links (#28932)
Fixes #28915

Restores the old behaviour:

https://github.com/go-gitea/gitea/pull/26745/files#diff-d78a9d361b1fddc12218e4dd42f42d39d6be1fda184041e06bb6fb30f0d94c59L96
2024-01-27 11:36:01 +08:00
wackbyte a240d5dfa7
Fix non-alphabetic sorting of repo topics (#28938) 2024-01-26 14:15:57 +00:00
Lunny Xiao 534917d576
Don't remove all mirror repository's releases when mirroring (#28817)
Fix #22066

# Purpose

This PR fix the releases will be deleted when mirror repository sync the
tags.

# The problem

In the previous implementation of #19125. All releases record in
databases of one mirror repository will be deleted before sync.
Ref:
https://github.com/go-gitea/gitea/pull/19125/files#diff-2aa04998a791c30e5a02b49a97c07fcd93d50e8b31640ce2ddb1afeebf605d02R481

# The Pros

This PR introduced a new method which will load all releases from
databases and all tags on git data into memory. And detect which tags
needs to be inserted, which tags need to be updated or deleted. Only
tags releases(IsTag=true) which are not included in git data will be
deleted, only tags which sha1 changed will be updated. So it will not
delete any real releases include drafts.

# The Cons

The drawback is the memory usage will be higher than before if there are
many tags on this repository. This PR defined a special release struct
to reduce columns loaded from database to memory.
2024-01-26 06:18:19 +00:00
KN4CK3R ba24e0ba61
Use new RPM constants (#28931)
https://github.com/sassoftware/go-rpmutils/pull/24 got merged.
2024-01-25 21:40:24 +00:00
John Olheiser 76bbad4e74
Check for sha256 support to use --object-format flag (#28928)
This should fix https://github.com/go-gitea/gitea/issues/28927

Technically older versions of Git would support this flag as well, but
per https://github.com/go-gitea/gitea/pull/28466 that's the version
where using it (object-format=sha256) left "experimental" state.

`sha1` is (currently) the default, so older clients should be unaffected
in either case.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2024-01-25 13:04:50 -05:00
Anthony Quéré 3084c990b0
fix: update enable_prune even if mirror_interval is not provided (#28905)
Currently, the `updateMirror` function which update the mirror interval
and enable prune properties is only executed by the `Edit` function. But
it is only triggered if `opts.MirrorInterval` is not null, even if
`opts.EnablePrune` is not null.

With this patch, it is now possible to update the enable_prune property
with a patch request without modifying the mirror_interval.

## Example request with httpie

### Currently:
**Does nothing**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" -A bearer -a $gitea_token
```

**Updates both properties**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" "mirror_interval=10m" -A bearer -a $gitea_token
```

### With the patch
**Updates enable_prune only**
```bash
http PATCH https://gitea.your-server/api/v1/repos/myOrg/myRepo "enable_prune:=false" -A bearer -a $gitea_token
```
2024-01-25 20:51:32 +08:00
Zettat123 071b7b2a03
Implement `MigrateRepository` for the actions notifier (#28920)
Fixes #28699

This PR implements the `MigrateRepository` method for `actionsNotifier`
to detect the schedules from the workflow files in the migrated
repository.
2024-01-25 20:06:29 +08:00
KN4CK3R c46316f7ae
Respect branch info for relative links (#28909)
Fix #28904

Co-authored-by: Giteabot <teabot@gitea.io>
2024-01-25 09:54:44 +01:00
GiteaBot eaab89c46b [skip ci] Updated translations via Crowdin 2024-01-25 00:25:21 +00:00
JakobDev 7ed18566e1
Show in Web UI if file is vendored and generated (#28620)
This simple shows in the Web UI is a file is vendored and/or generated.


![grafik](https://github.com/go-gitea/gitea/assets/15185051/bfe45fcc-cfec-4ba1-8d93-c0a262c3ae1c)

![grafik](https://github.com/go-gitea/gitea/assets/15185051/9f222a49-e7bf-4540-ba64-43dcc5767b76)

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-01-24 13:51:37 +08:00
Jimmy Praet ee3e83eec1
Don't reload timeline page when (un)resolving or replying conversation (#28654)
Fixes #15981
2024-01-24 03:26:28 +00:00
JakobDev 4567a3a1ad
Allow to sync tags from admin dashboard (#28045)
Inspired by #28043

This PR adds a option to the Admin Dashboard to sync all tags to the
database.


![grafik](https://github.com/go-gitea/gitea/assets/15185051/26ac51ef-82a4-4fd9-a6a6-5aefec612ff6)
2024-01-24 03:02:04 +00:00
JakobDev f3ba3e922d
Don't run push mirrors for archived repos (#27140)
Fixes https://codeberg.org/forgejo/forgejo/issues/612

At the moment push mirrors are still run if a repo is archived. This PR
fixes this.
2024-01-24 02:32:57 +00:00
JakobDev 1af45689f9
Only migrate the first 255 chars of a Github issue title (#28902)
Fixes #28846
2024-01-24 02:09:08 +00:00
wackbyte fd97613b65
Fix hardcoded GitHub icon used as migrated release avatar (#28910) 2024-01-24 01:07:13 +00:00
GiteaBot 1ca947baec [skip ci] Updated translations via Crowdin 2024-01-24 00:25:44 +00:00
wxiaoguang 82acf22d9c
Update go dependencies and fix go-git (#28893)
More details are in the comment of repo_base_gogit.go

And ref: https://github.com/go-git/go-git/issues/1006
2024-01-23 05:40:00 +00:00
Lunny Xiao c4cdebacfe
Fix sort bug on repository issues list (#28897)
Fix #28896
2024-01-23 09:17:42 +08:00
Lunny Xiao 4abd63d378
Upgrade xorm to v1.3.7 to fix a resource leak problem caused by Iterate (#28891)
Mainly fix an error https://gitea.com/xorm/xorm/issues/2393
2024-01-22 18:24:55 +08:00
Luca Zulberti 77506c6f6c
Add missing exclusive in advanced label options (#28322)
Hi, I think these changes could be useful for default labels when
creating new repos.

The PR includes the following changes:
 - Add missing exclusive flag for Kind/ scope in labels.
 - Move Breaking label into new Compat/ scope.
2024-01-22 07:56:17 +00:00
KN4CK3R 8e9b6817bc
Fix `DeleteCollaboration` transaction behaviour (#28886)
The method can't be called with an outer transaction because if the user
is not a collaborator the outer transaction will be rolled back even if
the inner transaction uses the no-error path.

`has == 0` leads to `return nil` which cancels the transaction. A
standalone call of this method does nothing but if used with an outer
transaction, that will be canceled.
2024-01-22 07:19:56 +00:00
Lunny Xiao 23efd9d278
Fix schedule not trigger bug because matching full ref name with short ref name (#28874)
Fix #28533

Caused by #28691
2024-01-22 02:13:24 +00:00
GiteaBot 692929b628 [skip ci] Updated licenses and gitignores 2024-01-22 00:26:33 +00:00
KN4CK3R caad931385
Prevent anonymous container access if `RequireSignInView` is enabled (#28877)
Fixes #28875

If `RequireSignInView` is enabled, the ghost user has no access rights.
2024-01-21 16:31:29 +00:00
yp05327 b693611b35
Don't show new pr button when page is not compare pull (#26431)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/ba69252f-3582-414a-9d62-b2b78d7035dd)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/71b8587c-b96e-48fb-b3e5-1a2a8b5d06fa)
(TestOrg:test is a tag not branch)

Problem:
In the template, we will not add `compare pull` class when
`PageIsComparePull` is false.

a370efc13f/templates/repo/diff/compare.tmpl (L2)
But in the js, we are using `.repository.compare.pull` to find the
button:

a370efc13f/web_src/js/features/repo-legacy.js (L552-L563)
So, if `PageIsComparePull` is false, the `New Pull Request` button will
be there, but has no response when we click it.
2024-01-21 15:13:00 +00:00
wxiaoguang 5d09023f13
Avoid duplicate JS error messages on UI (#28873)
Gitea treat JS errors seriously, so sometimes the JS errors caused by
3rdparty code (eg: browser extensions) would also be reported on Gitea
UI: TypeError: WeakMap key undefined (caused by extension DarkReader's
bug) #28861

To avoid fill the user's screen with a lot of error messages, this PR
merges the same error messages into one, like this:

```js
<div class="page-content">
  <div class="... js-global-error" data-global-error-msg-compact="testmsg1" data-global-error-msg-count="2">test msg 1 (2)</div>
  <div class="... js-global-error" data-global-error-msg-compact="testmsg2" data-global-error-msg-count="1">test msg 2</div>
</div>
```
2024-01-21 14:23:08 +00:00
Lunny Xiao 0e6fd0d1c1
Fix branch list bug which displayed default branch twice (#28878)
Fix #28876
2024-01-21 22:08:31 +08:00
6543 49d7663929
Revert adding htmx until we finaly decide to add it (#28879) 2024-01-21 21:42:35 +08:00
Yarden Shoham 1df06e3f39
Don't do a full page load when clicking the follow button (#28872)
- Use htmx to perform the button request
- `hx-headers='{"x-csrf-token": "{{.CsrfToken}}"}'` to authenticate (we
should probably learn to reuse this)
- `hx-post="{{.ContextUser.HomeLink}}?action=follow"` to send a POST
request to follow the user
- `hx-target="#profile-avatar-card"` to target the card div for
replacement
- `hx-swap="outerHTML"` to replace the card (as opposed to its inner
content) with the new card that shows the new follower count and button
color
- Change the backend response to return a `<div>` tag (the card) instead
of a redirect to the user page

# Before

![before](https://github.com/go-gitea/gitea/assets/20454870/86899d15-41c9-42ed-bd85-253b9caac7f8)

# After

![after](https://github.com/go-gitea/gitea/assets/20454870/59455d96-548c-4a81-a5b0-fab1dc1e87ef)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-01-20 23:37:22 +01:00
Yarden Shoham 14f6fcf448
Don't do a full page load when clicking the subscribe button (#28871)
- Refactor the form around the subscribe button into its own template
- Use htmx to perform the form submission
- `hx-boost="true"` to prevent the default form submission behavior of a
full page load
- `hx-sync="this:replace"` to replace the current request (in case the
button is clicked again before the response is returned)
  - `hx-target="this"` to replace the form tag with the new form tag
  - `hx-push-url="false"` to disable a change to the URL
  - `hx-swap="show:no-scroll"` to preserve the scroll position
- Change the backend response to return a `<form>` tag instead of a
redirect to the issue page
- Include `htmx.org` in javascript imports

This change introduces htmx with the hope we could use it to make Gitea
more reactive while keeping our "HTML rendered on the server" approach.

# Before


![before](https://github.com/go-gitea/gitea/assets/20454870/4ec3e81e-4dbf-4338-9968-b0655c276d4c)

# After


![after](https://github.com/go-gitea/gitea/assets/20454870/8c8841af-9bfe-40b2-b1cd-cd1f3c90ba4d)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-01-20 20:44:51 +01:00
sdvcrx 80d48621cd
Fix incorrect PostgreSQL connection string for Unix sockets (#28865)
Fix #28864
2024-01-20 16:04:47 +00:00
Yarden Shoham 6c771a311b
Run `npm audit fix` (#28866) 2024-01-20 15:37:32 +00:00
Lunny Xiao 7711db0a71
Fix migrate storage bug (#28830) 2024-01-20 23:27:31 +08:00
Yarden Shoham 5574968ecb
Set the `isPermaLink` attribute to `false` in the `guid` sub-element (#28860)
Our `guid` is not a valid URL so according to the RSS spec the
`isPermaLink` attribute needs to be set to `false`.

Example:
```diff
<item>
  <title>yardenshoham opened issue &lt;a href=&#34;https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2&#34;&gt;yardenshoham/test#2&lt;/a&gt;</title>
  <link>https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</link>
  <description>2#hey</description>
  <content:encoded><![CDATA[2#hey]]></content:encoded>
  <author>yardenshoham</author>
- <guid>355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
+ <guid isPermaLink="false">355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
  <pubDate>Tue, 16 Jan 2024 18:54:36 +0000</pubDate>
</item>
```

References:
-
https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt
- Fixes https://github.com/go-gitea/gitea/issues/28734
- https://github.com/gorilla/feeds/issues/78
- https://github.com/go-gitea/gitea/pull/21550
- https://github.com/gorilla/feeds/pull/107

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-01-20 02:38:16 +00:00
Mechiel Lukkien b9d91694af
In administration documentation about environment variables, point to those for the Go runtime instead of Go compiler (#28859)
The previous variables are used by the compiler and aren't too useful
for non-developers. The newly listed variables are more likely to be of
interest.

Apologies for this drive-by PR, I probably missed instructions from the
contributors guide. The patch can be regarded as a simple way to explain
the problem and solution. Feel free to close and possibly create a new
PR that does adhere to the contributors guide.
2024-01-20 10:12:20 +08:00
Lunny Xiao 62f995203a
Move doctor package from modules to services (#28856) 2024-01-20 10:07:31 +08:00
Adam Majer d68a613ba8
Add support for sha256 repositories (#23894)
Currently only SHA1 repositories are supported by Gitea. This adds
support for alternate SHA256 with the additional aim of easier support
for additional hash types in the future.

Fixes: #13794
Limited by: https://github.com/go-git/go-git/issues/899
Depend on: #28138

<img width="776" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/5448c9a7-608e-4341-a149-5dd0069c9447">

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2024-01-19 17:05:02 +01:00
yp05327 07ba4d9f87
Fix incorrect action duration time when rerun the job before executed once (#28364)
Fix #28323
Reason was mentioned here:
https://github.com/go-gitea/gitea/issues/28323#issuecomment-1841867298

### Changes: (maybe breaking)
We can rerun jobs in Gitea, so there will be some problems in
calculating duration time.
In this PR, I use the exist `Started` and `Stopped` column to record the
last run time instead of the total time,
and add a new `PreviousDuration` column to record the previous duration
time.
You can also check the cost time of last run:

![image](https://github.com/go-gitea/gitea/assets/18380374/2ca39145-2c92-401a-b78b-43164f7ae061)
2024-01-19 14:05:49 +00:00
KN4CK3R 461d8b53c2
Fix some RPM registry flaws (#28782)
Related #26984
(https://github.com/go-gitea/gitea/pull/26984#issuecomment-1889588912)

Fix admin cleanup message.
Fix models `Get` not respecting default values.
Rebuild RPM repository files after cleanup.
Do not add RPM group to package version name.
Force stable sorting of Alpine/Debian/RPM repository data.
Fix missing deferred `Close`.
Add tests for multiple RPM groups.
Removed non-cached `ReplaceAllStringRegex`.

If there are multiple groups available, it's stated in the package
installation screen:

![grafik](https://github.com/go-gitea/gitea/assets/1666336/8f132760-882c-4ab8-9678-77e47dfc4415)
2024-01-19 11:37:10 +00:00
Adam Majer 075c4c89ee
tests: missing refs/ in bare repositories (#28844)
Git 2.43.0 will not detect a git repository as valid without refs/
subdirectory present. `git gc` cleans this up and puts it in
packed-refs. We must keep refs/ non-empty.
2024-01-19 15:12:21 +08:00
Brecht Van Lommel 1167d523c4
Fix archive creating LFS hooks and breaking pull requests (#28848)
When LFS hooks are present in gitea-repositories, operations like git
push for creating a pull request fail. These repositories are not meant
to include LFS files or git push them, that is handled separately. And
so they should not have LFS hooks.

Installing git-lfs on some systems (like Debian Linux) will
automatically set up /etc/gitconfig to create LFS hooks in repositories.
For most git commands in Gitea this is not a problem, either because
they run on a temporary clone or the git command does not create LFS
hooks.

But one case where this happens is git archive for creating repository
archives. To fix that, add a GIT_CONFIG_NOSYSTEM=1 to disable using the
system configuration for that command.

According to a comment, GIT_CONFIG_NOSYSTEM is not used for all git
commands because the system configuration can be intentionally set up
for Gitea to use.

Resolves #19810, #21148
2024-01-19 05:49:18 +00:00
yp05327 b60a7c3358
Return `responseText` instead of string in some functions (#28836)
Follow
https://github.com/go-gitea/gitea/pull/28796#issuecomment-1891727591
2024-01-19 10:45:23 +08:00
yp05327 4674aea25b
Fix display latest sync time for pull mirrors on the repo page (#28841)
Follow #28712

1. Missing Locale word `mirror_sync`
2. Maybe forgot checking the conflict from #27760

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/6100d35b-7fe3-4095-9c24-7875568f7380)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/69647169-b812-45bc-a267-ab28f2df6ef6)
2024-01-18 18:27:07 +08:00
Lunny Xiao eba9c0ce48
Add testing for CalcCommitStatus (#28823) 2024-01-17 13:27:59 +00:00
Lunny Xiao c8ba17c73f
Remove duplicated checkinit on git module (#28824)
`checkInit` has been invoked in `InitSimple`. So it's unnecessary to
invoke it twice in `InitFull`.
2024-01-17 09:56:00 +00:00
Lunny Xiao 2bdab948cb
Add missing migration (#28827)
Missed from #28498
2024-01-17 17:26:45 +08:00
FuXiaoHei ad98ea63ee
Fix uploaded artifacts should be overwritten (#28726)
Fix `Uploaded artifacts should be overwritten`
https://github.com/go-gitea/gitea/issues/28549

When upload different content to uploaded artifact, it checks that
content size is not match in db record with previous artifact size, then
the new artifact is refused.

Now if it finds uploading content size is not matching db record when
receiving chunks, it updates db records to follow the latest size value.
2024-01-17 11:21:16 +08:00
Viktor Kuzmin 49eb168677
Retarget depending pulls when the parent branch is deleted (#28686)
Sometimes you need to work on a feature which depends on another (unmerged) feature.
In this case, you may create a PR based on that feature instead of the main branch.
Currently, such PRs will be closed without the possibility to reopen in case the parent feature is merged and its branch is deleted.
Automatic target branch change make life a lot easier in such cases.
Github and Bitbucket behave in such way.

Example:
$PR_1$: main <- feature1
$PR_2$: feature1 <- feature2

Currently, merging $PR_1$ and deleting its branch leads to $PR_2$ being closed without the possibility to reopen.
This is both annoying and loses the review history when you open a new PR.

With this change, $PR_2$ will change its target branch to main ($PR_2$: main <- feature2) after $PR_1$ has been merged and its branch has been deleted.

This behavior is enabled by default but can be disabled.
For security reasons, this target branch change will not be executed when merging PRs targeting another repo. 

Fixes #27062
Fixes #18408

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: delvh <dev.lh@web.de>
2024-01-17 01:44:56 +01:00
Yarden Shoham 9c869b10b5
Bump `@github/relative-time-element` to 4.3.1 (#28819)
- Fixes https://github.com/go-gitea/gitea/issues/28747

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/65d8dc84-680f-4c16-9aa1-b5986102e4e7)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/7cb288e7-ebde-4e94-a10a-cac28d6bdcfd)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-01-16 22:52:19 +01:00
Mihir Joshi b8270240bf
Fix reverting a merge commit failing (#28794)
Fixes #22236

---
Error occurring currently while trying to revert commit using read-tree
-m approach:
> 2022/12/26 16:04:43 ...rvices/pull/patch.go:240:AttemptThreeWayMerge()
[E] [63a9c61a] Unable to run read-tree -m! Error: exit status 128 -
fatal: this operation must be run in a work tree
> 	 - fatal: this operation must be run in a work tree

We need to clone a non-bare repository for `git read-tree -m` to work.

bb371aee6e
adds support to create a non-bare cloned temporary upload repository.

After cloning a non-bare temporary upload repository, we [set default
index](https://github.com/go-gitea/gitea/blob/main/services/repository/files/cherry_pick.go#L37)
(`git read-tree HEAD`).
This operation ends up resetting the git index file (see investigation
details below), due to which, we need to call `git update-index
--refresh` afterward.


Here's the diff of the index file before and after we execute
SetDefaultIndex: https://www.diffchecker.com/hyOP3eJy/

Notice the **ctime**, **mtime** are set to 0 after SetDefaultIndex.

You can reproduce the same behavior using these steps:
```bash
$ git clone https://try.gitea.io/me-heer/test.git -s -b main
$ cd test
$ git read-tree HEAD
$ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00
error: Entry '1' not uptodate. Cannot merge.
```

After which, we can fix like this:
```
$ git update-index --refresh
$ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00
```
2024-01-16 15:06:51 +00:00
JakobDev edfb57e699
Render code block in activity tab (#28816)
This is a little bugfix. Inline code is usually rendered in issue
titles, but it is missing in the activity tab.

Before:
![Screenshot 2024-01-16 at 14-20-51
Test](https://github.com/go-gitea/gitea/assets/15185051/383370f3-0fb2-49de-81cc-014e5cf86727)
After:

![grafik](https://github.com/go-gitea/gitea/assets/15185051/83eaf973-ce9a-44ce-beea-2db49fc8bd73)
2024-01-16 22:38:09 +08:00
Lunny Xiao c08d263a19
Remove trust model selection from repository creation on web page because it can be changed in settings later (#28814)
As more and more options can be set for creating the repository, I don't
think we should put all of them into the creation web page which will
make things look complicated and confusing.

And I think we need some rules about how to decide which should/should
not be put in creating a repository page. One rule I can imagine is if
this option can be changed later and it's not a MUST on the creation,
then it can be removed on the page. So I found trust model is the first
one.

This PR removed the trust model selections on creating a repository web
page and kept others as before.
This is also a preparation for #23894 which will add a choice about SHA1
or SHA256 that cannot be changed once the repository created.
2024-01-16 20:54:48 +08:00
Lunny Xiao 930e38d010
Use refname:strip-2 instead of refname:short when syncing tags (#28797)
Fix #28694 

Generally, `refname:short` should be equal to `refname:lstrip=2` except
`core.warnAmbiguousRefs is used to select the strict abbreviation mode.`

ref:
https://git-scm.com/docs/git-for-each-ref#Documentation/git-for-each-ref.txt-refname
2024-01-16 08:13:07 +01:00
crapStone 5374d29aa9
Add gist to comparison (#28809)
This PR adds a section to the documentation that links to the project
[Opengist](https://github.com/thomiceli/opengist) on GitHub.

The feature was proposed in #16670 but didn't resonate well with the
maintainers.
2024-01-15 23:37:32 +01:00
Denys Konovalov d971dfbae1
Fix links in issue card (#28806)
Fixes_
https://github.com/go-gitea/gitea/issues/23318#issuecomment-1611086747
2024-01-15 22:38:13 +02:00
JakobDev 885cc32b14
Show latest commit for file (#28067)
If you view a file, you can now see the latest commit that changed that file.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/272c3120-6db7-4f88-86e1-60080c9aabe5)

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
2024-01-15 17:42:15 +01:00
Gwyneth Morgan 2c3da59e27
Add ability to see open and closed issues at the same time (#28757)
By clicking the currently active "Open" or "Closed" filter button in the
issue list, the user can toggle that filter off in order to see all
issues regardless of state. The URL "state" parameter will be set to
"all" and the "Open"/"Closed" button will not show as active.
2024-01-15 15:07:22 +00:00
Dmitry Sharshakov 2d343f8987
Display latest sync time for pull mirrors on the repo page (#28712)
Fixes #25168

---------

Co-authored-by: delvh <dev.lh@web.de>
2024-01-15 14:37:14 +00:00
KN4CK3R 3793ec4d14
Fix `GetCommitStatuses` (#28787)
Fixes #28764.
2024-01-15 14:07:32 +00:00
wxiaoguang b0e6c25535
Caller should check the ResponseExtra.HasError() first to see whether the request fails (#28796)
`resp != nil` doesn't mean the request really succeeded. Add a comment
for requestJSONResp to clarify the behavior.
2024-01-15 11:15:31 +00:00
KN4CK3R 637451a45e
Rework markup link rendering (#26745)
Fixes #26548

This PR refactors the rendering of markup links. The old code uses
`strings.Replace` to change some urls while the new code uses more
context to decide which link should be generated.

The added tests should ensure the same output for the old and new
behaviour (besides the bug).

We may need to refactor the rendering a bit more to make it clear how
the different helper methods render the input string. There are lots of
options (resolve links / images / mentions / git hashes / emojis / ...)
but you don't really know what helper uses which options. For example,
we currently support images in the user description which should not be
allowed I think:

<details>
  <summary>Profile</summary> 

https://try.gitea.io/KN4CK3R

![grafik](https://github.com/go-gitea/gitea/assets/1666336/109ae422-496d-4200-b52e-b3a528f553e5)

</details>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-01-15 08:49:24 +00:00
yp05327 c7e4629c02
Fix nil pointer panic when exec some gitea cli command (#28791)
panic:

![image](https://github.com/go-gitea/gitea/assets/18380374/7fcde2ad-1d42-4b60-b120-3b60a8926e8e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/49d9f0ca-e590-4a35-8ca2-1317d1b7c939)
2024-01-15 07:43:53 +00:00
Jimmy Praet 5d3fdd1212
Add branch protection setting for ignoring stale approvals (#28498)
Fixes #27114.

* In Gitea 1.12 (#9532), a "dismiss stale approvals" branch protection
setting was introduced, for ignoring stale reviews when verifying the
approval count of a pull request.
* In Gitea 1.14 (#12674), the "dismiss review" feature was added.
* This caused confusion with users (#25858), as "dismiss" now means 2
different things.
* In Gitea 1.20 (#25882), the behavior of the "dismiss stale approvals"
branch protection was modified to actually dismiss the stale review.

For some users this new behavior of dismissing the stale reviews is not
desirable.

So this PR reintroduces the old behavior as a new "ignore stale
approvals" branch protection setting.

---------

Co-authored-by: delvh <dev.lh@web.de>
2024-01-15 07:20:01 +00:00
yp05327 ce0225c1b8
Forbid removing the last admin user (#28337)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-01-15 06:51:43 +00:00
yp05327 b820019fec
Fix when private user following user, private user will not be counted in his own view (#28037)
Doer: asdasasdasasdasasdasasdasasdasasdasasdas (private user)
Followed: TestUser (public user)

Before:
(From doer's view)

![image](https://github.com/go-gitea/gitea/assets/18380374/9ba16b3b-068c-43c5-a3dd-e3343b5b32f2)
(From followed user's view, can see doer)

![image](https://github.com/go-gitea/gitea/assets/18380374/dfd1b564-d689-4393-b3d3-1e6bf52c94ba)

After:
(From doer's view)

![image](https://github.com/go-gitea/gitea/assets/18380374/1c85c1d1-c9f7-40c8-948c-145f7cae9a04)
2024-01-15 05:43:14 +00:00
Chongyi Zheng fee80a1847
Update github.com/cloudflare/circl (#28789)
cloudflare/circl: https://github.com/advisories/GHSA-9763-4f94-gfch

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 11:14:26 +08:00
Lunny Xiao 70c4aad8e1
Move more functions to db.Find (#28419)
Following #28220

This PR move more functions to use `db.Find`.

---------

Co-authored-by: delvh <dev.lh@web.de>
2024-01-15 02:19:25 +00:00
Gwyneth Morgan e5313248a8
Add non-JS fallback for reaction tooltips (#28785)
When JavaScript is not loaded, fall back to displaying reaction tooltips
with the default browser `title` attribute. An element with a present
but empty `data-tooltip-content` will use the `title` attribute for its
tippy.js tooltip content, so when JavaScript is enabled, this functions
the same as the current behavior.
2024-01-15 09:42:59 +08:00
Earl Warren 3f342d6dff
Modernize merge button (#28140)
- Make use of the `form-fetch-action` for the merge button, which will
automatically prevent the action from happening multiple times and show
a nice loading indicator as user feedback while the merge request is
being processed by the server.
- Adjust the merge PR code to JSON response as this is required for the
`form-fetch-action` functionality.
- Resolves https://codeberg.org/forgejo/forgejo/issues/774
- Likely resolves the cause of
https://codeberg.org/forgejo/forgejo/issues/1688#issuecomment-1313044

(cherry picked from commit 4ec64c19507caefff7ddaad722b1b5792b97cc5a)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2024-01-15 00:00:47 +02:00
Yarden Shoham 5a7bacb005
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>
2024-01-14 21:20:18 +01:00
Lunny Xiao fa8c3beb26
Speed up loading the dashboard on mysql/mariadb (#28546)
Fixes #28155
2024-01-14 15:34:25 +01:00
Lunny Xiao 97292da960
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.
2024-01-12 21:50:38 +00:00
Jack Hay 6c6823935c
Add tests for #28765 (#28773)
Adds tests to cover changes made in #28765
2024-01-12 17:15:42 +00:00
Nanguan Lin 9b59af37e7
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)
2024-01-12 16:49:02 +00:00
Denys Konovalov 4f8f5f6e25
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)
2024-01-12 15:25:15 +00:00
wxiaoguang ad0b637d46
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)
2024-01-12 14:43:40 +00:00
wxiaoguang 34a0684397
Improve CSS helper naming (#28769)
* `gt-w-100` => `gt-w-full` to match tailwind
* clarify `gt-hidden` priority
2024-01-12 20:28:01 +08:00
Denys Konovalov 7d62615513
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)
2024-01-12 03:44:06 +00:00
Exploding Dragon ba4d0b8ffb
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)
2024-01-12 03:16:05 +00:00
Jack Hay 7c2f093e85
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`.
2024-01-12 01:57:58 +00:00
KN4CK3R 595a9291b6
Fix `convert.ToTeams` on empty input (#28426)
Fixes #28420

Don't return `nil` if the input was empty.
2024-01-11 22:12:08 +00:00
delvh abfdaef5bd
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)
2024-01-12 00:21:52 +08:00
Mihir Joshi 669bbbaf24
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
2024-01-11 11:04:45 +08:00
Lunny Xiao c65f8623e6
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
2024-01-10 11:55:59 +00:00
Mihir Joshi 839cd26b1a
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).
2024-01-10 11:28:20 +00:00
wxiaoguang 2df7563f31
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

## ⚠️ BREAKING ⚠️

It is not quite breaking, but it's highly recommended to convert the
database&table&column to a consistent and case-sensitive collation.
2024-01-10 11:03:23 +00:00
JakobDev a80debc208
Add download attribute to release attachments (#28739)
Fixes #28736
2024-01-09 16:51:20 +08:00
Earl Warren aa4d78431f
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>
2024-01-09 10:32:14 +08:00
GiteaBot f4ea8d9a6c [skip ci] Updated licenses and gitignores 2024-01-08 00:26:06 +00:00
wxiaoguang a04f8c0f81
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.
2024-01-07 15:41:46 +00:00
wxiaoguang 79da4bbc56
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)
2024-01-07 15:18:04 +00:00
wxiaoguang 9296c31ff7
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
2024-01-07 10:50:03 +00:00
wxiaoguang c5901b622d
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)
2024-01-07 18:20:22 +08:00
GiteaBot a43c7b81af [skip ci] Updated translations via Crowdin 2024-01-07 00:27:22 +00:00
wxiaoguang 7215224112
Improve frontend guideline (#28711)
It has been a consensus for long time during reviewing: "avoiding inline
styles as much as possible".
2024-01-07 01:14:10 +08:00
wxiaoguang e75e9a0e7e
Fix panic when parsing empty pgsql host (#28708)
Regression of #27723
Fix #28705
2024-01-06 17:30:03 +08:00
Kyle D e522e774ca
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)
2024-01-05 17:38:56 +00:00
yp05327 dd5693387e
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)
2024-01-05 03:34:35 +00:00
Earl Warren 92711b001e
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 8f0baefe5d)

Co-authored-by: Fl1tzi <git@fl1tzi.com>
2024-01-04 02:48:55 +00:00
Kyle D 54acf7b0d4
Normalize oauth email username (#28561) 2024-01-03 18:48:20 -06:00
Denys Konovalov 657b23d635
Fix wrapping of label list (#28684)
The label list needs to wrap the items to avoid unnecessary overflow / incorrect text wrapping.
2024-01-03 20:33:55 +08:00
wackbyte 9b418158b9
Fix grammar in `actions.variables.id_not_exist` (en-US) (#28680)
Fixes the capitalization and grammar of the key.
2024-01-03 10:43:38 +00:00
wackbyte 3ba1216b9d
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.
2024-01-03 10:42:56 +00:00
wackbyte 361839fb1c
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)
2024-01-03 06:25:19 +00:00
Brecht Van Lommel 12c0487e01
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.
2024-01-03 14:01:12 +08:00
wxiaoguang 91aa263225
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)
2024-01-02 20:09:18 +01:00
Yarden Shoham cdc33b29a0
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>
2024-01-02 09:25:30 +08:00
GiteaBot f8f394cb0e [skip ci] Updated translations via Crowdin 2024-01-01 00:27:55 +00:00
Lunny Xiao da58bb85fa
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.
2023-12-31 05:00:35 +00:00
vincent f8a1bad883
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.
2023-12-31 04:31:50 +00:00
Nanguan Lin b6e0957b9c
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?
2023-12-31 12:08:46 +08:00
Lunny Xiao cb10f2767c
Fix migration test (#28659) 2023-12-30 21:54:48 +08:00
wxiaoguang e5d8c4b8d4
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.
2023-12-30 08:48:34 +00:00
Mihir Joshi 3d474110c1
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>
2023-12-30 07:42:16 +00:00
silverwind ce55a74374
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
2023-12-30 05:29:03 +00:00
wxiaoguang 19b1b698c9
Improve document for ARTIFACT_RETENTION_DAYS (#28646)
Follow #28626
2023-12-29 06:44:58 +00:00
Denys Konovalov f10d716ff4
fix empty ref for cron workflow runs (#28640)
Fix #27678 
Please see
https://github.com/go-gitea/gitea/issues/27678#issuecomment-1871445853
for details.
2023-12-29 06:18:57 +00:00
wxiaoguang 19c45dd479
Improve 1.22 document for Database Preparation (#28643)
Fix #28247
2023-12-29 05:42:22 +00:00
GiteaBot 4995b4a057 [skip ci] Updated translations via Crowdin 2023-12-29 00:20:25 +00:00
Denys Konovalov 6c133b9fe0
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.
2023-12-28 22:08:59 +01:00
Gerd Katzenbeisser 4d1277c0cb
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.
2023-12-28 10:11:44 +00:00
wxiaoguang e743570f65
Refactor timeutil package (#28623)
1. make names more readable
2. remove unused FormatLong/FormatShort
3. use `FormatDate` instead of `Format "2006-01-02"`
2023-12-28 10:09:57 +00:00
wxiaoguang f3999888c0
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
2023-12-28 09:38:59 +00:00
Lunny Xiao 921df1cbad
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.
2023-12-28 15:28:57 +08:00
KN4CK3R 4cd666d7dc
Do not set `Accept` header twice (#28598)
Revert #28550

Don't add the `Accept` header twice.
2023-12-28 03:59:00 +00:00
GiteaBot c706b3e436 [skip ci] Updated translations via Crowdin 2023-12-28 00:24:21 +00:00
katsu 42149ff1a8
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**
2023-12-27 08:32:27 +00:00
Lunny Xiao baf0d402d9
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>
2023-12-27 07:57:54 +00:00
Lunny Xiao 4c29c75968
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.
2023-12-27 15:24:23 +08:00
GiteaBot a1dfffd723 [skip ci] Updated translations via Crowdin 2023-12-27 00:23:45 +00:00
wxiaoguang d68b9237bf
Use known issue IID to generate new PR index number when migrating from GitLab (#28616)
Fix #13884
2023-12-26 17:57:25 +00:00
Volodymyr Stelmashchuk 0e9c988373
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.
2023-12-27 00:36:11 +08:00
GiteaBot ff7383e83a [skip ci] Updated translations via Crowdin 2023-12-26 00:24:05 +00:00
delvh 778ad795fd
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>
2023-12-25 21:25:29 +01:00
wxiaoguang b41925cee3
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
2023-12-25 20:13:18 +08:00
Jean-Baptiste Gomond d0f24ff4ca
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)
2023-12-25 07:28:59 +00:00
Lunny Xiao 0407a402bb
Revert "improve possible performance bottleneck (#28547)" (#28593)
This reverts commit b35d3fddfa.

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.
2023-12-25 06:52:17 +00:00
GiteaBot 7396e3618d [skip ci] Updated licenses and gitignores 2023-12-25 00:25:23 +00:00
wxiaoguang 8989d466ed
Fix flex container width (#28603)
Fix #28489
2023-12-24 22:39:02 +08:00
wxiaoguang 8a71f7280a
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)
2023-12-24 13:08:41 +08:00
techknowlogick a1d2a152f8
bump to use alpine3.19 (#28594) 2023-12-23 21:04:58 +00:00
wxiaoguang 330aab47b3
Include heap pprof in diagnosis report to help debugging memory leaks (#28596) 2023-12-23 19:06:02 +00:00
Kyle D 33439b733a
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.
2023-12-23 11:29:51 +08:00
Yarden Shoham d9ed931c4d
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>
2023-12-22 10:53:12 -06:00
Zettat123 907c97aabb
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.


21229ed2c8/routers/web/repo/pull.go (L653-L663)
2023-12-22 13:29:50 +00:00
morphelinho 19869d1c11
Fix 405 method not allowed CORS / OIDC (#28583)
Follow #28184
Follow #28515

Fix problem with 405 method not allowed for CORS wrt OIDC
2023-12-22 12:23:24 +00:00
Jason Song 21229ed2c8
Add more ways to try (#28581) 2023-12-22 06:20:59 +00:00
KN4CK3R 838db2f891
Convert to url auth to header auth in tests (#28484)
Related #28390
2023-12-21 23:59:59 +00:00
wxiaoguang 04b235d094
Fix 500 error of searching commits (#28576)
Regression of #28454 . Now the string is escaped HTML, so it doesn't
need `| Safe`.

Fix #28575
2023-12-21 23:09:14 +00:00
Lunny Xiao b35d3fddfa
improve possible performance bottleneck (#28547)
Replace #28500

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-12-21 23:25:57 +01:00
KN4CK3R 3142693892
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.
2023-12-21 22:48:18 +01:00
Lunny Xiao 177cea7c70
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
2023-12-21 07:42:16 +00:00
FuXiaoHei fe5a616392
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.
2023-12-21 07:04:50 +00:00
Rui Chen caceb43313
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>
2023-12-21 13:31:04 +08:00
Lunny Xiao 3d98d99e27
Update actions document about comparsion as Github Actions (#28560) 2023-12-20 20:12:25 +00:00
6543 2c48733afe
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)
2023-12-20 15:19:58 +00:00
wxiaoguang e4a24d6727
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)
2023-12-20 14:11:59 +00:00
Lunny Xiao 577421691b
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
2023-12-20 12:54:34 +01:00
GiteaBot 9483ccd463 [skip ci] Updated translations via Crowdin 2023-12-20 00:20:44 +00:00
Nanguan Lin 6a725b6f9c
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`.
2023-12-19 20:12:02 +01:00
Lunny Xiao e7cb8da2a8
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.
2023-12-19 09:29:05 +00:00
Lunny Xiao 4eb2a29910
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.
2023-12-19 07:20:47 +00:00
David Øvrelid 128eac9e0b
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.
2023-12-19 04:40:05 +00:00
Bo-Yi Wu 14ffdf6173
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>
2023-12-19 02:32:45 +00:00
wxiaoguang 11f0519ad8
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.
2023-12-19 09:18:42 +08:00
Yevhen Pavlov cd2ff6e83d
Bump google/go-github to v57 (#28514) 2023-12-18 15:42:04 -06:00
yp05327 4ea522fecf
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)
2023-12-18 16:06:19 +00:00
Earl Warren e02095c5b6
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>
2023-12-18 15:32:08 +00:00
wxiaoguang bf8b082c40
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
2023-12-18 22:53:04 +08:00
GiteaBot 69f2b698c5 [skip ci] Updated translations via Crowdin 2023-12-18 00:25:45 +00:00
wxiaoguang 20929edc99
Add option to disable ambiguous unicode characters detection (#28454)
* Close #24483
* Close #28123
* Close #23682
* Close #23149

(maybe more)
2023-12-17 14:38:54 +00:00
Lunny Xiao 408a484224
Adjust object format interface (#28469)
- Remove `ObjectFormatID`
- Remove function `ObjectFormatFromID`.
- Use `Sha1ObjectFormat` directly but not a pointer because it's an
empty struct.
- Store `ObjectFormatName` in `repository` struct
2023-12-17 11:56:08 +00:00
The Magician 7fb6b51470
Remove duplicate option in admin screen and now-unused translation keys (#28492)
Resolves https://github.com/go-gitea/gitea/issues/28451.

This change follows the recommendation by wxiaoguang to remove the
"Disable Minimum Key Size Check" from the "Service Configuration"
section of the UI, because this option belongs to the "SSH
Configuration" section of the administration menu and already has a
functioning indicator in that section of the UI.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-12-17 04:33:37 +00:00
GiteaBot 72529d6e64 [skip ci] Updated translations via Crowdin 2023-12-17 00:26:56 +00:00
Earl Warren 9a15267871
Initalize stroage for orphaned repository doctor (#28487)
- When a repository is orphaned and has objects stored in any of the
storages such as repository avatar or attachments the delete function
would error, because the storage module wasn't initalized.
- Add code to initialize the storage module.

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

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-12-16 12:17:39 +00:00
Kyle D b8490d59de
Update docs for DISABLE_QUERY_AUTH_TOKEN (#28485)
As described
[here](https://github.com/go-gitea/gitea/pull/28390#issuecomment-1857553331).
2023-12-15 21:54:35 -05:00
wxiaoguang 047c69bd85
Improve CLI code and descriptions (#28482)
* Close #28444 
* Actually, it doesn't need to use that trick because it looks like it
is not necessary, no user really needs it
* Remove the hidden (legacy) "doctor" subcommand and update documents
* Fix "actions" usage


![image](https://github.com/go-gitea/gitea/assets/2114189/3c2b34a7-4f92-4a6c-96fd-9505e413d4ec)
2023-12-15 15:49:01 +00:00
yp05327 3849fd2ac2
Remove unnecessary forgot password link in delete user section (#28355)
Before:
<img width="458" alt="image"
src="https://github.com/go-gitea/gitea/assets/18380374/92815496-38cc-4bb9-9182-1509a72b07f6">

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/d96ed908-47ad-44cc-a624-4c10fa8c8c86)
2023-12-15 14:13:55 +00:00
wxiaoguang 4f04ab2586
Refactor SSH clone URL generation code (#28421)
Refactor the code and add tests, keep the old logic.
2023-12-15 06:18:12 +00:00
wxiaoguang 6632d1497c
Polyfill SubmitEvent for PaleMoon (#28441) 2023-12-15 07:26:36 +08:00
CaiCandong 8c91e31540
Fix Chinese translation of config cheat sheet[API] (#28472) 2023-12-15 00:00:04 +08:00
sebastian-sauer e08f1a9cbd
Add combined index for issue_user.uid and issue_id (#28080)
fixes #27877

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-12-14 09:26:59 +00:00
wxiaoguang e85db6c8c3
Fix documents for "custom/public/assets/" (#28465)
Fix #28463
2023-12-14 08:52:16 +00:00
wxiaoguang 9947af639c
Only use SHA256 feature when git >= 2.42 (#28466)
And fix some comments
2023-12-14 16:51:05 +08:00
nekrondev 52046b934d
Retry SSH key verification with additional CRLF if it failed (#28392)
Windows-based shells will add a CRLF when piping the token into
ssh-keygen command resulting in
verification error. This resolves #21527.

---------

Co-authored-by: Heiko Besemann <heiko.besemann@qbeyond.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-12-14 02:39:32 +00:00
Adam Majer cbf923e87b
Abstract hash function usage (#28138)
Refactor Hash interfaces and centralize hash function. This will allow
easier introduction of different hash function later on.

This forms the "no-op" part of the SHA256 enablement patch.
2023-12-13 21:02:00 +00:00
KN4CK3R 064f05204c
Add endpoint for not implemented Docker auth (#28457)
Recently Docker started to use the optional `POST /v2/token` endpoint
which should respond with a `404 Not Found` status code instead of the
current `405 Method Not Allowed`.

> Note: Not all token servers implement oauth2. If the request to the
endpoint returns 404 using the HTTP POST method, refer to Token
Documentation for using the HTTP GET method supported by all token
servers.
2023-12-13 15:23:53 -05:00
David Hulick 73047854c0
docs: Update group membership fields to match application. (#28175)
Several fields in the "Verify group membership in LDAP" docs were
confusingly titled when compared to the actual fields in the
application, this change rectifies that by matching the docs to the
fields already present in gitea.

Signed-off-by: David Hulick <dave.hulick@gmail.com>
2023-12-13 07:14:37 +00:00
GiteaBot c229e6519b [skip ci] Updated translations via Crowdin 2023-12-13 00:24:37 +00:00
KN4CK3R ff5106d700
Fix possible nil pointer access (#28428)
There could be a nil pointer exception if the file is not found because
that specific error is suppressed but not handled.
2023-12-12 13:51:33 +00:00
wxiaoguang 0a794b2bcd
Don't show unnecessary citation JS error on UI (#28433)
Fix #28226
2023-12-12 11:31:11 +00:00
Lunny Xiao 717d0f5934
Do some missing checks (#28423) 2023-12-12 05:01:17 +00:00
Jack Hay 4e879fed90
Deprecate query string auth tokens (#28390)
## Changes
- Add deprecation warning to `Token` and `AccessToken` authentication
methods in swagger.
- Add deprecation warning header to API response. Example: 
  ```
  HTTP/1.1 200 OK
  ...
  Warning: token and access_token API authentication is deprecated
  ...
  ```
- Add setting `DISABLE_QUERY_AUTH_TOKEN` to reject query string auth
tokens entirely. Default is `false`

## Next steps
- `DISABLE_QUERY_AUTH_TOKEN` should be true in a subsequent release and
the methods should be removed in swagger
- `DISABLE_QUERY_AUTH_TOKEN` should be removed and the implementation of
the auth methods in question should be removed

## Open questions
- Should there be further changes to the swagger documentation?
Deprecation is not yet supported for security definitions (coming in
[OpenAPI Spec version
3.2.0](https://github.com/OAI/OpenAPI-Specification/issues/2506))
- Should the API router logger sanitize urls that use `token` or
`access_token`? (This is obviously an insufficient solution on its own)

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-12-12 03:48:53 +00:00
GiteaBot baea205675 [skip ci] Updated translations via Crowdin 2023-12-12 00:25:05 +00:00
KN4CK3R 4b0940cb9f
Let `curl` write the content to file (#28427) 2023-12-12 07:19:30 +08:00
wxiaoguang f2a309e6c8
Improve doctor cli behavior (#28422)
1. Do not sort the "checks" slice again and again when "Register", it
just wastes CPU when the Gitea instance runs
2. If a check doesn't exist, tell the end user
3. Add some tests
2023-12-11 15:55:10 +00:00
Lunny Xiao 537fa69962
Second part of refactor `db.Find` (#28194)
Continue of #27798 and move more functions to `db.Find` and `db.Count`.
2023-12-11 16:56:48 +08:00
yp05327 0abb5633e3
Fix commit status in repo list (#28412)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/00edf23a-aee1-4177-a12c-bd03ae14e65e)

![image](https://github.com/go-gitea/gitea/assets/18380374/0663e443-682c-4a68-b14e-a0fa0e4c3716)
`TestOrg/testactions` does have commit status, but won't display in
`All`

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/7231db29-9c4e-484f-afa2-87db19be19b8)

Same to #26179.
2023-12-11 06:19:57 +00:00
GiteaBot 5b2bbf1a1f [skip ci] Updated licenses and gitignores 2023-12-11 00:25:45 +00:00
Earl Warren fab73e4a3a
Actually recover from a panic in cron task (#28409)
- Currently there's code to recover gracefully from panics that happen
within the execution of cron tasks. However this recover code wasn't
being run, because `RunWithShutdownContext` also contains code to
recover from any panic and then gracefully shutdown Forgejo. Because
`RunWithShutdownContext` registers that code as last, that would get run
first which in this case is not behavior that we want.
- Move the recover code to inside the function, so that is run first
before `RunWithShutdownContext`'s recover code (which is now a noop).

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

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-12-10 20:15:06 +00:00
Lunny Xiao 9a99c17a14
Fix missing check (#28406) 2023-12-10 21:37:10 +02:00
Lunny Xiao aeb383025f
Also sync DB branches on push if necessary (#28361)
Fix #28056 

This PR will check whether the repo has zero branch when pushing a
branch. If that, it means this repository hasn't been synced.

The reason caused that is after user upgrade from v1.20 -> v1.21, he
just push branches without visit the repository user interface. Because
all repositories routers will check whether a branches sync is necessary
but push has not such check.

For every repository, it has two states, synced or not synced. If there
is zero branch for a repository, then it will be assumed as non-sync
state. Otherwise, it's synced state. So if we think it's synced, we just
need to update branch/insert new branch. Otherwise do a full sync. So
that, for every push, there will be almost no extra load added. It's
high performance than yours.

For the implementation, we in fact will try to update the branch first,
if updated success with affect records > 0, then all are done. Because
that means the branch has been in the database. If no record is
affected, that means the branch does not exist in database. So there are
two possibilities. One is this is a new branch, then we just need to
insert the record. Another is the branches haven't been synced, then we
need to sync all the branches into database.
2023-12-09 13:30:56 +00:00
Lunny Xiao 27c05069a6
Remove stale since giteabot has similiar feature (#28401)
Replace #27447
2023-12-09 13:38:46 +02:00
GiteaBot 80baac19f2 [skip ci] Updated translations via Crowdin 2023-12-09 00:24:26 +00:00
Panagiotis "Ivory" Vasilopoulos 18ba1c6d00
Improve text in Security settings (#28393)
- en-US: Rename "Scratch Tokens" to "single-use recovery keys".
  Longer, but clearer.
- Improve titles
- TOTP: Improve description
- TOTP: Inform user about Scratch Tokens to encourage TOTP usage
- WebAuthn: Add loss of access warning
2023-12-08 00:38:55 +02:00
John Olheiser 4bf5653584
Fix Docker meta action for releases (#28232)
Should fix #28229 and #28230 for next release.

Assuming I'm reading the docs correctly for the docker meta action:

https://github.com/docker/metadata-action#flavor-input
https://github.com/docker/metadata-action#latest-tag

1. We want `latest=false` for the RCs.
2. `latest` should happen already due to `auto` mode, however there's an
extra option for the `suffix` flavor.

This PR is ready, but leaving it as draft to make sure someone
double-checks my sleuth-work.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-12-07 12:42:58 -05:00
Adam Majer d9c19899cd
Make gogit Repository.GetBranchNames consistent (#28348) 2023-12-07 12:08:17 -05:00
Lunny Xiao dd30d9d5c0
Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220)
The function `GetByBean` has an obvious defect that when the fields are
empty values, it will be ignored. Then users will get a wrong result
which is possibly used to make a security problem.

To avoid the possibility, this PR removed function `GetByBean` and all
references.
And some new generic functions have been introduced to be used.

The recommand usage like below.

```go
// if query an object according id
obj, err := db.GetByID[Object](ctx, id)
// query with other conditions
obj, err := db.Get[Object](ctx, builder.Eq{"a": a, "b":b})
```
2023-12-07 15:27:36 +08:00
Jason Song beb71f5ef6
Include public repos in doer's dashboard for issue search (#28304)
It will fix #28268 .

<img width="1313" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/cb1e07d5-7a12-4691-a054-8278ba255bfc">

<img width="1318" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/4fd60820-97f1-4c2c-a233-d3671a5039e9">

## ⚠️ BREAKING ⚠️

But need to give up some features:

<img width="1312" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/281c0d51-0e7d-473f-bbed-216e2f645610">

However, such abandonment may fix #28055 .

## Backgroud

When the user switches the dashboard context to an org, it means they
want to search issues in the repos that belong to the org. However, when
they switch to themselves, it means all repos they can access because
they may have created an issue in a public repo that they don't own.

<img width="286" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/182dcd5b-1c20-4725-93af-96e8dfae5b97">

It's a confusing design. Think about this: What does "In your
repositories" mean when the user switches to an org? Repos belong to the
user or the org?

Whatever, it has been broken by #26012 and its following PRs. After the
PR, it searches for issues in repos that the dashboard context user owns
or has been explicitly granted access to, so it causes #28268.

## How to fix it

It's not really difficult to fix it. Just extend the repo scope to
search issues when the dashboard context user is the doer. Since the
user may create issues or be mentioned in any public repo, we can just
set `AllPublic` to true, which is already supported by indexers. The DB
condition will also support it in this PR.

But the real difficulty is how to count the search results grouped by
repos. It's something like "search issues with this keyword and those
filters, and return the total number and the top results. **Then, group
all of them by repo and return the counts of each group.**"

<img width="314" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/5206eb20-f8f5-49b9-b45a-1be2fcf679f4">

Before #26012, it was being done in the DB, but it caused the results to
be incomplete (see the description of #26012).

And to keep this, #26012 implement it in an inefficient way, just count
the issues by repo one by one, so it cannot work when `AllPublic` is
true because it's almost impossible to do this for all public repos.


1bfcdeef4c/modules/indexer/issues/indexer.go (L318-L338)

## Give up unnecessary features

We may can resovle `TODO: use "group by" of the indexer engines to
implement it`, I'm sure it can be done with Elasticsearch, but IIRC,
Bleve and Meilisearch don't support "group by".

And the real question is, does it worth it? Why should we need to know
the counts grouped by repos?

Let me show you my search dashboard on gitea.com.

<img width="1304" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/2bca2d46-6c71-4de1-94cb-0c9af27c62ff">

I never think the long repo list helps anything.

And if we agree to abandon it, things will be much easier. That is this
PR.

## TODO

I know it's important to filter by repos when searching issues. However,
it shouldn't be the way we have it now. It could be implemented like
this.

<img width="1316" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/99ee5f21-cbb5-4dfe-914d-cb796cb79fbe">

The indexers support it well now, but it requires some frontend work,
which I'm not good at. So, I think someone could help do that in another
PR and merge this one to fix the bug first.

Or please block this PR and help to complete it.

Finally, "Switch dashboard context" is also a design that needs
improvement. In my opinion, it can be accomplished by adding filtering
conditions instead of "switching".
2023-12-07 13:26:18 +08:00
Panagiotis "Ivory" Vasilopoulos dac7728e9d
Issue fixes for RSS feed improvements (#28380)
Follow-up for #28368

- Just replace button with an a-element with the button class
- Remove useless link-action class from template/org/home.tmpl
2023-12-07 03:01:32 +00:00
Lauris BH bfacb5c501
Fix margin in server signed signature verification view (#28379)
Before:

![image](https://github.com/go-gitea/gitea/assets/165205/e2e2256d-03c5-4ab8-8ed9-08ef68571a43)

After:

![image](https://github.com/go-gitea/gitea/assets/165205/804132ef-18f9-4ab8-949d-f6c71e7f4d24)
2023-12-07 01:51:39 +00:00
GiteaBot ceedd90bf2 [skip ci] Updated translations via Crowdin 2023-12-07 00:24:32 +00:00
yp05327 f4561c44b1
Fix incorrect run order of action jobs (#28367)
When we pick up a job, all waiting jobs should firstly be ordered by
update time,
otherwise when there's a running job, if I rerun an older job, the older
job will run first, as it's id is smaller.
2023-12-06 22:10:05 +00:00
Panagiotis "Ivory" Vasilopoulos 22cb5b0c17
Improve RSS feed icons (#28368)
- The RSS Feed icons were placed in a proper button, so that it does
  not look "inconsistent". This also makes the problem of the button
  being improperly aligned go away.
- The icon that shows on user profiles has not been modified because
  of a lack of better implementation ideas.
- Where applicable, the RSS Feed icon was put directly next to the
  Follow button (right menu), as both functionalities effectively
  share the same purpose.
- Despite the attempt at achieving less inconsistency, a conscious
  decision to not add any text to those buttons was made, opting for
  tooltips instead. "Make it present, but not too annoying."
- A special exception was made for the Releases pages (which contains
  text, not a tooltip), where an RSS feed would be particularly
  beneficial to users.

The fact that the RSS functionality is explicitly optional was taken
into account, and these improvements were made with public-facing
instances (where the feature works best) in mind.
2023-12-06 20:29:26 +00:00
wxiaoguang 1e512b800c
Use `filepath` instead of `path` to create SQLite3 database file (#28374) 2023-12-06 16:57:52 +00:00
capvor c1b86ecdab
Fix incorrect default value of `[attachment].MAX_SIZE` (#28373) 2023-12-06 10:59:56 -05:00
yp05327 ec90ee61ef
Fix object does not exist error when checking citation file (#28314)
Fix #28264

`DataAsync()` will be called twice.
Caused by https://github.com/go-gitea/gitea/pull/27958.
I'm sorry, I didn't completely remove all unnecessary codes.
2023-12-06 16:51:01 +08:00
Lunny Xiao 09d5028442
Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) 2023-12-06 01:13:59 +00:00
GiteaBot c81255ba4e [skip ci] Updated translations via Crowdin 2023-12-06 00:25:02 +00:00
Earl Warren 876a0cb3d6
Render PyPi long description as document (#28272)
Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-12-05 15:02:01 +00:00
Nate Levesque f891172ef4
handle repository.size column being NULL in migration v263 (#28336)
This resolves a problem I encountered while updating gitea from 1.20.4
to 1.21. For some reason (correct or otherwise) there are some values in
`repository.size` that are NULL in my gitea database which cause this
migration to fail due to the NOT NULL constraints.

Log snippet (excuse the escape characters)
```
ESC[36mgitea                |ESC[0m 2023-12-04T03:52:28.573122395Z 2023/12/04 03:52:28 ...ations/migrations.go:641:Migrate() [I] Migration[263]: Add git_size and lfs_size columns to repository table
ESC[36mgitea                |ESC[0m 2023-12-04T03:52:28.608705544Z 2023/12/04 03:52:28 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: migrate: migration[263]: Add git_size and lfs_size columns to repository table failed: NOT NULL constraint failed: repository.git_size
```

I assume this should be reasonably safe since `repository.git_size` has
a default value of 0 but I don't know if that value being 0 in the odd
situation where `repository.size == NULL` has any problematic
consequences.
2023-12-05 14:31:13 +00:00
Nanguan Lin 49b98e45bc
Fix migration panic due to an empty review comment diff (#28334)
Fix #28328 
```
func (p *PullRequestComment) GetDiffHunk() string {
	if p == nil || p.DiffHunk == nil {
		return ""
	}
	return *p.DiffHunk
}
```
This function in the package `go-github` may return an empty diff. When
it's empty, the following code will panic because it access `ss[1]`

ec1feedbf5/services/migrations/gitea_uploader.go (L861-L867)

ec1feedbf5/modules/git/diff.go (L97-L101)
2023-12-05 08:29:43 +00:00
KN4CK3R a95d5b7702
Add `HEAD` support for rpm repo files (#28309)
Fixes https://codeberg.org/forgejo/forgejo/issues/1810

zypper uses HEAD requests to check file existence.

https://github.com/openSUSE/libzypp/blob/HEAD/zypp/RepoManager.cc#L2549

https://github.com/openSUSE/libzypp/blob/HEAD/zypp-curl/ng/network/private/downloaderstates/basicdownloader_p.cc#L116

@ExplodingDragon fyi
2023-12-05 08:01:02 +00:00
Nanguan Lin 0aab2d38a7
Remove deprecated query condition in ListReleases (#28339)
close #24057 
call stack: 

25faee3c5f/routers/api/v1/repo/release.go (L154)

ec1feedbf5/routers/api/v1/utils/page.go (L13-L18)

ec1feedbf5/services/convert/utils.go (L15-L22)

## ⚠️ Breaking   ⚠️ (though it's not caused by this PR)
Do not use `per_page` to specify pagination; use `limit` instead
2023-12-05 07:30:43 +00:00
darrinsmart 38a93a0665
Convert git commit summary to valid UTF8. (#28356)
The summary string ends up in the database, and (at least) MySQL &
PostgreSQL require valid UTF8 strings.

Fixes #28178

Co-authored-by: Darrin Smart <darrin@filmlight.ltd.uk>
2023-12-05 14:34:24 +08:00
KN4CK3R dfa77ac020
Fix RPM/Debian signature key creation (#28352)
Fixes #28324

The name parameter can't contain some characters
(https://github.com/keybase/go-crypto/blob/master/openpgp/keys.go#L680)
but is optional. Therefore just use an empty string.
2023-12-05 00:48:01 +00:00
KN4CK3R b3c258828f
Refactor template empty checks (#28351) 2023-12-04 15:48:42 -06:00
GiteaBot ec1feedbf5 [skip ci] Updated licenses and gitignores 2023-12-04 00:25:15 +00:00
Brecht Van Lommel bffbf08f26
Fix missing issue search index update when changing status (#28325)
Changing an issue status, assignee, labels or milestone without also
adding a comment would not update the index, resulting in wrong search
results.
2023-12-03 12:22:44 +01:00
JakobDev 6ad145f5bd
Keep profile tab when clicking on Language (#28320)
Fixes https://codeberg.org/Codeberg/Community/issues/1355
2023-12-01 22:31:40 +02:00
yp05327 004ab3758c
Fix wrong link in `protect_branch_name_pattern_desc` (#28313)
The current href will link to
`https://domain/owner/repo/settings/branches/github.com/gobwas/glob`
2023-12-01 19:45:04 +08:00
yp05327 1ae33e0bad
Fix links in docs (#28302)
Close #28287

## How to test it in local
convert Makefile L34 into:
```
cd .tmp/upstream-docs && git clean -f && git reset --hard && git fetch origin pull/28302/head:pr28302 && git switch pr28302
```
2023-12-01 19:42:42 +08:00
KN4CK3R 14354e4f8e
Read `previous` info from git blame (#28306)
Fixes #28280

Reads the `previous` info from the `git blame` output instead of
calculating it afterwards.
2023-12-01 01:26:52 +00:00
JakobDev 3618715fab
Add missing variable in tag list (#28305)
This fixes a regression from #25859

If a tag has no Release, Gitea will show a Link to create a Release for
the Tag if the User has the Permission to do this, but the variable to
indicate that is no longer set.

Used here:

1bfcdeef4c/templates/repo/tag/list.tmpl (L39-L41)
2023-11-30 16:26:56 +01:00
Earl Warren 1bfcdeef4c
Make pushUpdate error verbose (#28263)
- Push commits updates are run in a queue and updates can come from less
traceable places such as Git over SSH, therefor add more information
about on which repository the pushUpdate failed.

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

(cherry picked from commit 37ab946039)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-11-30 00:46:51 +00:00
Brecht Van Lommel a7de14e493
Meilisearch: require all query terms to be matched (#28293)
Previously only the first term had to be matched. That default
Meilisearch behavior makes sense for e.g. some kind of autocomplete to
find and select a single result. But for filtering issues it means you
can't narrow down results by adding more terms.

This is also more consistent with other indexers and GitHub.

---

Reference:
https://www.meilisearch.com/docs/reference/api/search#matching-strategy
2023-11-29 23:00:59 +08:00
wxiaoguang b348424c64
Ignore "non-existing" errors when getDirectorySize calculates the size (#28276)
The git command may operate the git directory (add/remove) files in any
time.

So when the code iterates the directory, some files may disappear during
the "walk". All "IsNotExist" errors should be ignored.

Fix #26765
2023-11-29 13:08:58 +08:00
Earl Warren 64cd6e8df5
Fix required error for token name (#28267)
- Say to the binding middleware which locale should be used for the
required error.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1683

(cherry picked from commit 5a2d796612)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-11-29 03:47:05 +00:00
Earl Warren 8b45a4d366
Use appSubUrl for OAuth2 callback URL tip (#28266)
- When crafting the OAuth2 callbackURL take into account `appSubUrl`,
which is quite safe given that its strictly formatted.
- No integration testing as this is all done in Javascript.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1795

(cherry picked from commit 27cb6b7956)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-11-29 01:37:12 +00:00
Earl Warren cb8298b717
Ignore temporary files for directory size (#28265)
Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-11-28 21:53:21 +00:00
John Olheiser 05b8023667
Check for v prefix on tags for release clean name (#28257) 2023-11-28 15:18:01 -06:00
Denys Konovalov 4d7c063f9e
Use full width for project boards (#28225)
Inspired by #28182
2023-11-27 17:43:52 +00:00
wxiaoguang a6aed0fee6
Increase "version" when update the setting value to a same value as before (#28243)
Setting the same value should not trigger DuplicateKey error, and the
"version" should be increased
2023-11-27 17:15:40 +00:00
yp05327 8572e71a7f
Fix issue will be detected as pull request when checking `First-time contributor` (#28237)
Fix #28224
2023-11-27 10:46:55 +00:00
JakobDev 709a376c51
Fix link to `Code` tab on wiki commits (#28041)
Fixes https://codeberg.org/forgejo/forgejo/issues/1759

If you are bowing another branch than the default branch and click n the
Code tab, it will take you to the root of the branch. The `BranchName`
variable is also set when viewing a Wiki commit, so we also need to
check if we are on a Wiki.
2023-11-27 05:59:56 +00:00
yp05327 0a0e8200ec
Fix links in docs (#28234)
Follow #28191

Changes:
- `(doc/administration/config-cheat-sheet.md` is incorrect:

![image](https://github.com/go-gitea/gitea/assets/18380374/1c417dd7-61a0-49ba-8d50-871fd4c9bf20)
- remove `../../`
2023-11-27 00:34:40 -05:00
Lunny Xiao 763938e889
Fix actions when tagging (#28061)
close https://github.com/go-gitea/gitea/issues/28053

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-11-25 13:45:31 -05:00
Lunny Xiao 882e502327
Fix comment permissions (#28213)
This PR will fix some missed checks for private repositories' data on
web routes and API routes.
2023-11-25 17:21:21 +00:00
CodeShakingSheep 80217cacfc
Docs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup (#28205)
In the [docs for email
setup](https://docs.gitea.com/administration/email-setup)
`mailer.IS_TLS_ENABLED` is mentioned which was replaced by
`mailer.PROTOCOL` in release 1.18.0 according to
https://blog.gitea.com/release-of-1.18.0/ . This change wasn't reflected
in the docs for email setup. I just replaced the deprecated mailer
setting.
2023-11-25 10:16:29 +08:00
pitpalme eacce14546
Fix delete-orphaned-repos (#28200)
gitea doctor failed at checking and fixing 'delete-orphaned-repos',
because table name 'user' needs quoting to be correctly recognized by at
least PostgreSQL.

fixes #28199
2023-11-24 14:46:19 +00:00
wxiaoguang 2ac2796a4c
Refactor graceful manager to use shared code (#28073)
Make "windows" and "unix" share as much code as possible. No logic
change.
2023-11-24 14:21:46 +00:00
yp05327 ad9aac3975
Fix some incorrect links in docs (#28191)
https://gitea.com/gitea/gitea-docusaurus/actions/runs/661/jobs/0#jobstep-9-39
I noticed that there are many warning logs in building docs.
It is causing 404 in docs.gitea.com now, so we need to fix it.
And there are also some other problems in v1.19 which can not be done in
this PR.

ps: Are there any good methods to test this in local?
2023-11-24 13:57:09 +00:00
Nanguan Lin 6c7744370f
Remove workaround in disk-clean.yml (#28195)
According to https://github.com/jlumbroso/free-disk-space/issues/17, the
issue has been fixed in the main branch.
2023-11-24 13:25:01 +01:00
Lunny Xiao df1e7d0067
Use db.Find instead of writing methods for every object (#28084)
For those simple objects, it's unnecessary to write the find and count
methods again and again.
2023-11-24 03:49:41 +00:00
NintenHero d24a8223ce
Edit Discord Badge (#28188)
Use white Discord icon. Label the badge as "Discord". Use the official
Discord logo's color value of 5865F2.
2023-11-23 19:58:12 -05:00
Earl Warren 1075ff74b5
Use restricted sanitizer for repository description (#28141)
- Currently the repository description uses the same sanitizer as a
normal markdown document. This means that element such as heading and
images are allowed and can be abused.
- Create a minimal restricted sanitizer for the repository description,
which only allows what the postprocessor currently allows, which are
links and emojis.
- Added unit testing.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1202
- Resolves https://codeberg.org/Codeberg/Community/issues/1122

(cherry picked from commit 631c87cc23)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-11-23 16:34:25 +00:00
Nanguan Lin 7d1933717d
Use full width for PR comparison (#28182)
Follow-up #22844 
close #28142 
Before 

![ksnip_20231123-183906](https://github.com/go-gitea/gitea/assets/70063547/78428a22-b0a0-45f9-9458-7fd5ec73aa29)
After

![full](https://github.com/go-gitea/gitea/assets/70063547/047242cf-9d6c-4b3a-9f92-54102740c27e)

Co-authored-by: Giteabot <teabot@gitea.io>
2023-11-23 15:52:57 +00:00
wxiaoguang 7c0ab8b974
Make CORS work for oauth2 handlers (#28184)
Fix #25473

Although there was `m.Post("/login/oauth/access_token", CorsHandler()...`,
it never really worked, because it still lacks the "OPTIONS" handler.
2023-11-23 21:19:26 +08:00
Nanguan Lin 778d604346
Fix missing buttons (#28179)
fix #28173 
regression #25948 
That PR is supposed to only change the style but somehow delete a code
snippet. See the
diff(https://github.com/go-gitea/gitea/pull/25948/files#diff-7c36d66fe058f4ff9f2beaac73cf710dca45b350d0dd98daf806828a4745fe62L125-L129)
for details.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-11-23 11:36:52 +01:00
Nanguan Lin 37ed92d6fd
Revert "Fix EOL handling in web editor" (#28101)
Reverts go-gitea/gitea#27141
close #28097
2023-11-22 09:14:16 +00:00
yp05327 4d0eba8e0a
Fix swagger title (#28164)
![image](https://github.com/go-gitea/gitea/assets/18380374/380859b2-a643-42fd-b53e-78c93c05c826)
Don't know why there's a `.` behind. 🤔
2023-11-22 08:09:19 +00:00
yp05327 2d9b91aa24
Fix the description about the default setting for action in quick start document (#28160)
Since #27054, Actions are enabled by default. so we should also edit the
document. 😃

ps: I think this should be backport to 1.21.0.
2023-11-22 02:11:22 +00:00
yp05327 d1acd7e9de
Do not display search box when there's no packages yet (#28146)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/3012f544-7ff5-4ccb-ac80-ce24d50abe97)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/4084312a-9ac0-4103-8c93-ea178ae24493)

![image](https://github.com/go-gitea/gitea/assets/18380374/3c47d175-0735-476d-8979-da2bc0a4fc95)

![image](https://github.com/go-gitea/gitea/assets/18380374/033c6a81-d1f7-4426-8063-5793d0b47462)
2023-11-21 20:03:19 +00:00
yp05327 a6a674e26a
Add guide page to actions when there's no workflows (#28145)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/599d40c1-9b8d-4189-9286-c9c36fb780dd)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/848a73d1-aaec-478f-93a7-adcc7ee18907)
2023-11-21 08:27:33 +00:00
yp05327 976a9926d7
Fix no ActionTaskOutput table waring (#28149)
Reproduce:
- Create a new Gitea instance
- Register a runner
- Create a repo and add a workflow
- Check the log, you will see warnings:

![image](https://github.com/go-gitea/gitea/assets/18380374/5f1278e0-114b-48bc-8113-8ba1404d9975)
It comes from:

![image](https://github.com/go-gitea/gitea/assets/18380374/c2807831-e137-4229-9536-87f6114c8a5b)

The reason is that we forgot registering `ActionTaskOutput` model.
So `action_table_output` table will be missing in your db.
2023-11-21 08:02:51 +00:00
Lunny Xiao 0c0d17f17e
Fix empty action run title (#28113)
Fix #27901
2023-11-21 03:00:59 +00:00
wxiaoguang 247927a9b5
Use "is-loading" to avoid duplicate form submit for code comment (#28143)
When the form is going to be submitted, add the "is-loading" class to
show an indicator and avoid user UI events.

When the request finishes (success / error), remove the "is-loading"
class to make user can interact the UI.
2023-11-21 02:12:31 +00:00
Jason Song 0c72256ab4
Fix typo in `packages.cleanup.success` (#28133)
Follow
https://github.com/go-gitea/gitea/pull/28129#discussion_r1398971596
2023-11-20 15:41:10 +02:00
JakobDev 08552f0076
Add edit option for README.md (#28071)
Fix #28059


![grafik](https://github.com/go-gitea/gitea/assets/15185051/07adc216-954e-486b-bfda-df3bc15f2089)
2023-11-20 11:47:55 +00:00
yp05327 eae555ff23
Remove autofocus in search box (#28033)
Mentioned here:
https://github.com/go-gitea/gitea/pull/27982#issuecomment-1807923026
2023-11-20 08:57:46 +00:00
Jason Song 0e1b381ff6
Add missing `packages.cleanup.success` (#28129)
Used at
a3348bfc4d/routers/web/admin/packages.go (L111)

<img width="1325" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/60edc1fa-eea8-4d74-a7ec-96bd5461a53f">
2023-11-20 08:33:58 +00:00
John Olheiser 30b46fb6fa
Update docs for docusaurus v3 (#28125)
Updates the docs for usage with docusaurus v3

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-11-20 00:25:47 -05:00
GiteaBot a3348bfc4d [skip ci] Updated translations via Crowdin 2023-11-20 00:25:03 +00:00
silverwind 06dcb251f3
Update JS and PY dependencies (#28120)
- Update all JS and PY dependencies minus `@mcaptcha/vanilla-glue`
- Adapt to eslint rule rename
- Regenerate all SVGs because of [new
optimizations](https://github.com/svg/svgo/releases/tag/v3.0.4) from
svgo.
- Tested mentions, mermaid, vue, api docs
2023-11-20 01:02:57 +01:00
KazzmanK 2de05f9432
Decrease issue font size in project template (#28054)
I propose to decrease font size. 18 is too big and looks ugly, on
windows. 14 is on par with other elements and save a bit of space.

![image](https://github.com/go-gitea/gitea/assets/13328513/bc41f65d-8f48-4fd9-8e3b-d7a73967b0aa)

![image](https://github.com/go-gitea/gitea/assets/13328513/70e78919-9b9b-4f57-a491-d746ea59c048)

Co-authored-by: Nikolay Kobzarev <n.kobzarev@aeronavigator.ru>
2023-11-19 02:02:26 +00:00
delvh 0bf021d7c6
Require clear descriptions both for feature and breaking PRs prior to the merge (#28112)
When writing the release blog, it is really annoying and time-consuming
to re-discover and write down how a feature behaves and capture a
screenshot of it, for every single feature merged since the last
release.
This should not be the responsibility of maintainers, but rather of the
person implementing a feature in the first place.
They know best how to use the feature and how to gather screenshots for
it.
Similarly for breaking changes and their effects.

As such, let's require everything to be up-to-date and easily
understandable before merging features or breaking changes.
2023-11-19 09:53:31 +08:00
Denys Konovalov 816e46ee7c
add skip ci functionality (#28075)
Adds the possibility to skip workflow execution if the commit message
contains a string like [skip ci] or similar.

The default strings are the same as on GitHub, users can also set custom
ones in app.ini

Reference:
https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs

Close #28020
2023-11-18 13:37:08 +02:00
yp05327 e88377470a
Fix project counter in organization/individual profile (#28068)
Fix #28052
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/5f299983-4b38-4d68-ac0e-4be3c62c0558)

![image](https://github.com/go-gitea/gitea/assets/18380374/f0e12afd-483b-4882-80e9-0261beb3fe0c)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/47cccb7b-bb35-4a7d-9c5b-83133be0323a)

![image](https://github.com/go-gitea/gitea/assets/18380374/77825c0c-4bf2-4762-83a2-1a5a173cc22d)
2023-11-18 11:02:42 +08:00
sebastian-sauer e31c6cfe6e
Fix Show/hide filetree button on small displays (#27881)
the gt-df's display:flex !important did override the display:none on small displays

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-11-17 18:35:51 +00:00
Nanguan Lin f63b116697
Change default size of attachments and repo files (#28100)
https://github.com/go-gitea/gitea/pull/27946 forgets to change them in
code. Sorry about that.
2023-11-17 11:42:00 +00:00
KN4CK3R 58f5fa6536
Fix Matrix and MSTeams nil dereference (#28089)
Fixes #28088 
Fixes #28094

Added missing tests.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-11-17 12:17:33 +01:00
wxiaoguang 17d246cdcc
Fix incorrect pgsql conn builder behavior (#28085)
Fix #28083 and fix the tests
2023-11-17 02:30:57 +00:00
wxiaoguang fce1d5d7dc
Fix system config cache expiration timing (#28072)
To avoid unnecessary database access, the `cacheTime` should always be
set if the revision has been checked.

Fix #28057
2023-11-16 12:53:42 +00:00
sebastian-sauer 49dddd87b1
Improve PR diff view on mobile (#27883)
1. Show diff stats only on large screens

these are already shown in tabs, so no need for this duplicate
information on small screens


![image](https://github.com/go-gitea/gitea/assets/1135157/1287839d-7490-42eb-a17e-d526dc0bfd9e)

![image](https://github.com/go-gitea/gitea/assets/1135157/e9dcd89d-ed4d-4945-a7aa-4e6fc6d9c3a2)


2. Hide viewed files information on small screens

Github does the same and this gives us more free space on small screens


![image](https://github.com/go-gitea/gitea/assets/1135157/e90b042f-fffb-4f79-a5ae-cd480c9d8334)

![image](https://github.com/go-gitea/gitea/assets/1135157/d2480ffe-58f2-4694-8ae1-a2ab0aae14d4)


3. Review bar now doesn't wrap so we don't need the 77px even on very
small screens

(the sticky headers are still working)


![image](https://github.com/go-gitea/gitea/assets/1135157/42b19b2b-73ef-4b88-8680-c555879b363b)
2023-11-16 11:58:53 +08:00
wxiaoguang 79394b340d
Improve graceful manager code/comment (#28063)
The graceful manager has some bugs (#27643, #28062). This is a
preparation for further fixes.
2023-11-15 22:02:46 +08:00
Lunny Xiao f65977df3a
Revert "packages: Calculate package size quota using package creator ID instead of owner ID (#28007)" (#28049)
This reverts commit #28007 60522fc96f.
2023-11-14 16:03:56 +01:00
6543 5ab3782f11
Restricted users only see repos in orgs which their team was assigned to (#28025)
---
*Sponsored by Kithara Software GmbH*
2023-11-14 15:23:04 +01:00
6543 d4d05f9f1b
Fix release link in changelog for v1.21.0 2023-11-14 15:03:49 +01:00
Denys Konovalov 58b2779986
Add v1.21.0 changelog (#28005)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
2023-11-14 14:55:16 +01:00
JakobDev 48b9d98593
Fix viewing wiki commit on empty repo (#28040)
Fixes https://codeberg.org/forgejo/forgejo/issues/1758

For some weird reason we need to cast this nil.
2023-11-14 19:42:23 +08:00
yp05327 83c30634a4
Add word break to the repo list in admin settings page (#28034)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/ed464937-e20d-4f5b-b997-e86c2d96469d)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/471e77b3-516e-4ae9-b901-0cf8745eb9aa)
2023-11-14 04:58:01 +00:00
Anudeep Reddy 5380fd5d6d
fixed duplicate attachments on dump on windows (#28019)
Hi,

This PR fixes #27988. The use of `path.join`(which uses `/` as the file
separator) to construct paths and comparing them with paths constructed
using `filepath.join`(which uses platform specific file separator) is
the root cause of this issue.

The desired behavior is to ignore attachments when dumping data
directory. Due to the what's mentioned above, the function
`addRecursiveExclude` is not actually ignoring the attachments directory
and is being written to the archive. The attachment directory is again
added to the archive (with different file separator as mentioned in the
issue) causing a duplicate entry on windows.

The solution is to use `filepath.join` in `addResursiveExclude` to
construct `currentAbsPath`.
2023-11-14 02:15:45 +01:00
GiteaBot f586937297 [skip ci] Updated translations via Crowdin 2023-11-14 00:23:48 +00:00
Danila Fominykh 60522fc96f
packages: Calculate package size quota using package creator ID instead of owner ID (#28007)
Changed behavior to calculate package quota limit using package `creator
ID` instead of `owner ID`.

Currently, users are allowed to create an unlimited number of
organizations, each of which has its own package limit quota, resulting
in the ability for users to have unlimited package space in different
organization scopes. This fix will calculate package quota based on
`package version creator ID` instead of `package version owner ID`
(which might be organization), so that users are not allowed to take
more space than configured package settings.

Also, there is a side case in which users can publish packages to a
specific package version, initially published by different user, taking
that user package size quota. Version in fix should be better because
the total amount of space is limited to the quota for users sharing the
same organization scope.
2023-11-14 00:38:50 +01:00
6543 c6366089df
Dont leak private users via extensions (#28023) 2023-11-13 16:30:24 -06:00
yp05327 089ac06969
Improve profile for Organizations (#27982)
Fixes some problems in #27955:
- autofocus of the search box
before:
if access the home page will jump to the search box

![image](https://github.com/go-gitea/gitea/assets/18380374/7f100e8d-2bd6-4563-85ba-d6008ffc71d7)
after:
will not jump to the search box

![image](https://github.com/go-gitea/gitea/assets/18380374/9aab382c-8ebe-4d18-b990-4adbb6c341ad)

- incorrect display of overview tab
before:

![image](https://github.com/go-gitea/gitea/assets/18380374/b24c79e8-9b79-4576-9276-43bd19172043)
after:

![image](https://github.com/go-gitea/gitea/assets/18380374/7aab5827-f086-4874-bd84-39bd81b872f3)

- improve the permission check to the private profile repo
In #26295, we simply added access control to the private profile.
But if user have access to the private profile repo , we should also
display the profile.

- add a button which can jump to the repo list?
I agree @wxiaoguang 's opinion here:
https://github.com/go-gitea/gitea/pull/27955#issuecomment-1803178239
But it seems that this feature is sponsored. 
So can we add a button which can quickly jump to the repo list or just
move profile to the `overview` page?

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-11-13 15:33:22 +01:00
Earl Warren 340055ab6c
Enable system users search via the API (#28013)
Refs: https://codeberg.org/forgejo/forgejo/issues/1403

(cherry picked from commit dd4d17c159)
2023-11-13 15:31:38 +01:00
Earl Warren f2ea31de36
Enable system users for comment.LoadPoster (#28014)
System users (Ghost, ActionsUser, etc) have a negative id and may be the
author of a comment, either because it was created by a now deleted user
or via an action using a transient token.

The GetPossibleUserByID function has special cases related to system
users and will not fail if given a negative id.

Refs: https://codeberg.org/forgejo/forgejo/issues/1425 

(cherry picked from commit 6a2d2fa243)
2023-11-13 15:30:08 +01:00
Nanguan Lin 0678c82265
Change default size of issue/pr attachments and repo file (#27946)
As title. Some attachments and file sizes can easily be larger than
these limits
2023-11-13 14:19:22 +00:00
KN4CK3R 3081e7e153
Fix missing mail reply address (#27997)
Fixes https://codeberg.org/forgejo/forgejo/issues/1458

Some mails such as issue creation mails are missing the reply-to-comment
address. This PR fixes that and specifies which comment types should get
a reply-possibility.
2023-11-13 03:20:34 +00:00
GiteaBot 024fe11cd3 [skip ci] Updated licenses and gitignores 2023-11-13 00:24:40 +00:00
Nanguan Lin d95102d650
Fix wrong xorm Delete usage (#27995)
## Bug in Gitea
I ran into this bug when I accidentally used the wrong redirect URL for
the oauth2 provider when using mssql. But the oauth2 provider still got
added.
Most of the time, we use `Delete(&some{id: some.id})` or
`In(condition).Delete(&some{})`, which specify the conditions. But the
function uses `Delete(source)` when `source.Cfg` is a `TEXT` field and
not empty. This will cause xorm `Delete` function not working in mssql.

61ff91f960/models/auth/source.go (L234-L240)

## Reason
Because the `TEXT` field can not be compared in mssql, xorm doesn't
support it according to [this
PR](https://gitea.com/xorm/xorm/pulls/2062)
[related
code](b23798dc98/internal/statements/statement.go (L552-L558))
in xorm
```go
if statement.dialect.URI().DBType == schemas.MSSQL && (col.SQLType.Name == schemas.Text ||
   col.SQLType.IsBlob() || col.SQLType.Name == schemas.TimeStampz) {
   if utils.IsValueZero(fieldValue) {
     continue
   }
   return nil, fmt.Errorf("column %s is a TEXT type with data %#v which cannot be as compare condition", col.Name, fieldValue.Interface())
   }
}
```
When using the `Delete` function in xorm, the non-empty fields will
auto-set as conditions(perhaps some special fields are not?). If `TEXT`
field is not empty, xorm will return an error. I only found this usage
after searching, but maybe there is something I missing.

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-11-12 07:38:45 +00:00
wxiaoguang f860fe31d9
Move some JS code from `fomantic.js` to standalone files (#27994)
To improve maintainability, this PR: 

1. Rename `web_src/js/modules/aria` to `web_src/js/modules/fomantic`
(the code there are all for aria of fomantic)
2. Move api/transition related code to
`web_src/js/modules/fomantic/api.js` and
`web_src/js/modules/fomantic/transition.js`

No logic is changed.
2023-11-12 07:15:00 +00:00
Lunny Xiao 61ff91f960
Fix the wrong oauth2 name (#27993)
Fix #27989 
Regression #27798
2023-11-11 11:27:02 +01:00
Yarden Shoham 1c0566f66d
Render email addresses as such if followed by punctuation (#27987)
Added the following characters to the regular expression for the email:

- ,
- ;
- ?
- !

Also added a test case.

- Fixes #27616 

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/c57eac26-f281-43ef-a51d-9c9a81b63efa)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/fc7d5c08-4350-4af0-a7f0-d1444d2d75af)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2023-11-11 05:08:19 +01:00
Nanguan Lin 6c9e196e54
Show error toast when file size exceeds the limits (#27985)
As title.
Before that, there was no alert at all.
After:

![error_toast](https://github.com/go-gitea/gitea/assets/70063547/c54ffeed-76f8-4c3a-b5dc-b9b3e0f8fc76)
2023-11-10 19:43:18 +08:00
KN4CK3R 481e738e7f
Remove `title` from elements on Org mode (#27968)
The Org mode rendering has some problems:
1.  `[[https://example.com][pre https://example.com/example.mp4 post]]`
 renders as
`<p><a href="https://example.com" title="pre <video
src="https://example.com/example.mp4"
title="https://example.com/example.mp4">https://example.com/example.mp4</video>
post">pre <video src="https://example.com/example.mp4"
title="https://example.com/example.mp4">https://example.com/example.mp4</video>
post</a></p>`
As you can see, the `title` attribute contains the inner html in
unescaped form. I removed the `title` attribute because it is of little
value.
3. The `title` attribute on `img` and `video` is of little value.
4. The inner elements of `video` are different depending on the `if`.
2023-11-10 01:45:13 +00:00
6543 603573366a
Add Profile Readme for Organisations (#27955)
https://blog.gitea.com/release-of-1.20.0/#-user-profile-readme-23260
(#23260) did introduce Profile Readme for Users.

This makes it usable for Organisations:


![image](https://github.com/go-gitea/gitea/assets/24977596/464ab58b-a952-414b-8a34-6deaeb4f7d35)

---
*Sponsored by Kithara Software GmbH*

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-11-09 14:05:52 +00:00
6543 16ba16dbe9
Allow to set explore page default sort (#27951)
as title


---
*Sponsored by Kithara Software GmbH*
2023-11-09 10:11:45 +00:00
Lunny Xiao 69d98f83f9
Fix format error (#27963) 2023-11-08 21:50:20 +08:00
yp05327 f48a863b99
Fix citation error when the file size is larger than 1024 bytes (#27958)
Mentioned in:
https://github.com/go-gitea/gitea/pull/27931#issuecomment-1798016960

Same to #25131, so use the same method to fix this problem.
2023-11-08 06:40:12 +00:00
silverwind 6447b3e6b2
Use flex-container on user dashboard (#27956)
Same as https://github.com/go-gitea/gitea/pull/26046 but for user
dashboard, the sidebar got a bit smaller and there is less padding
between sections.

<img width="1265" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/0c8d2faa-03ec-4515-a4f2-0a106ef2a928">
2023-11-08 02:30:39 +00:00
6543 8ef169a173
Document REACTION_MAX_USER_NUM setting option (#27954)
4a0103fa29/modules/setting/ui.go (L24)

4a0103fa29/modules/setting/ui.go (L77)

---
*Sponsored by Kithara Software GmbH*
2023-11-08 01:50:31 +01:00
yp05327 4a0103fa29
Add word-break to repo description in home page (#27924)
In #25315, @denyskon fixed UI on mobile view.
But for the repo description, on desktop view there's no word-break. 
So maybe we can just add `gt-word-break` to fix it on both mobile view
and desktop view.

Before:
desktop view:

![image](https://github.com/go-gitea/gitea/assets/18380374/a7659f5b-fbe9-400a-8cc2-cca44778556e)
mobile view:

![image](https://github.com/go-gitea/gitea/assets/18380374/611f1b81-58ac-4213-b165-5c73e24ca79e)

After:
desktop view:

![image](https://github.com/go-gitea/gitea/assets/18380374/f21bf3a7-f6aa-457d-9bfa-5c57659c68b1)
mobile view(almost same?)

![image](https://github.com/go-gitea/gitea/assets/18380374/ad2d1a4d-1172-402c-b5fc-5e910657847d)

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-11-07 23:52:08 +00:00
silverwind 2e6af43a06
Remove go versions from .golangci.yml (#27953)
1. `linter.lang-version` is deprecated in favor of `run.go`
2. `run.go` defaults to the version in `go.mod` as per
[docs](https://golangci-lint.run/usage/configuration/#run-configuration):

```yaml
  # Define the Go version limit.
  # Mainly related to generics support since go1.18.
  # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18
  go: '1.19'
```

So in summary, we don't need these versions in the file as long as we
keep the version in go.mod bumped.
2023-11-07 22:03:27 +01:00
wxiaoguang 10a6ebb3fd
Fix the overflow style for "Hide all checks" (#27932)
Fix #27928

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-11-07 18:53:35 +00:00
Sebastian Brückner e80f446d3a
Fix rendering assignee changed comments without assignee (#27927)
When an assignee changed event comment is rendered, most of it is
guarded behind the assignee ID not being 0. However, if it is 0, that
results in quite broken rendering for that comment and the next one.
This can happen, for example, when repository data imported from outside
of Gitea is incomplete.

This PR makes sure comments with an assignee ID of 0 are not rendered at
all.

---

Screenshot before:
<img width="272" alt="Bildschirm­foto 2023-11-05 um 20 12 18"
src="https://github.com/go-gitea/gitea/assets/42910/7d629d76-fee4-4fe5-9e3a-bf524050cead">
The comments in this screenshot are:
1. A regular text comment
2. A user being unassigned
3. A user being assigned
4. The title of the PR being changed

Comments 2 and 3 are rendered without any text, which indents the next
comment and does not leave enough vertical space.

Co-authored-by: Giteabot <teabot@gitea.io>
2023-11-07 19:45:06 +01:00
yp05327 3a924fdc83
Add word break to release title (#27942)
Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/74c925e0-15ae-4602-8b56-0b69f54a5e7a)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/027c34ef-0cbc-4156-a198-44bf5dd924e2)
2023-11-07 10:53:04 +00:00
silverwind abd79ddebf
Update JS dependencies (#27922)
- Update all JS dependencies minus @mcaptcha/vanilla-glue (unsolved
error, see https://github.com/mCaptcha/glue/issues/65)
- Migrate deprecated eslint rules to `@stylistic/eslint-plugin-js`
- Enable and autofix `@stylistic/js/no-multiple-empty-lines`
- Regenerate poetry.lock with latest poetry
- Tested Mermaid, Swagger, Citation, Vue
2023-11-06 21:14:32 +00:00
Folke c823af26db
Update environment-to-ini flag parsing (#27914)
This Fixes #27913 

This commit updates `environment-to-ini` to be compatible with update
urfave/cli/v2

Doc: <https://cli.urfave.org/v2/examples/combining-short-options/>
2023-11-06 21:36:58 +01:00
silverwind 0999721c7b
Add `--no-root` to `update-py` (#27937)
Missed this command in https://github.com/go-gitea/gitea/pull/27919.
2023-11-06 15:44:04 +00:00
Nanguan Lin 1e25c15d98
Remove `known issue` section in Gitea Actions Doc (#27930)
The bug has been fixed for several months in the
`docker/build-push-action`
The fix commit is
[d8823bfaed](d8823bfaed)
as the Gitea Actions Doc mentioned too.
2023-11-06 22:45:37 +08:00
yp05327 7a2ff6c162
Fix edit topic UI (#27925)
Before:
desktop view:

![image](https://github.com/go-gitea/gitea/assets/18380374/c04d8730-5dac-4318-9643-72801da0ca16)
mobile view:

![image](https://github.com/go-gitea/gitea/assets/18380374/187220d3-1fcc-4db8-9cf8-ee88fe92d989)
after click `Save` btn:

![image](https://github.com/go-gitea/gitea/assets/18380374/c3242470-7e6f-4ddc-a2ac-d896bbd39529)

![image](https://github.com/go-gitea/gitea/assets/18380374/82e03ba5-a6d2-4437-b074-387e7ad5b6ba)
refresh the page, you will see that `gt-m-0` is missing after save
topic:

![image](https://github.com/go-gitea/gitea/assets/18380374/26914820-9363-483c-af70-78b76de47523)


After:
desktop view:

![image](https://github.com/go-gitea/gitea/assets/18380374/12d878e1-351e-4983-b3d9-5216e9f30a19)
mobile view:

![image](https://github.com/go-gitea/gitea/assets/18380374/4adf9b0f-977b-4bbc-a42f-b9bfb2d648dd)
after click `Save` btn:

![image](https://github.com/go-gitea/gitea/assets/18380374/064c911e-d074-4432-8a55-8ff8ddb93989)
2023-11-06 09:23:50 +00:00
KN4CK3R 4f4fea734c
Unify two factor check (#27915)
Fixes #27819

We have support for two factor logins with the normal web login and with
basic auth. For basic auth the two factor check was implemented at three
different places and you need to know that this check is necessary. This
PR moves the check into the basic auth itself.
2023-11-06 08:22:39 +00:00
KN4CK3R 8557a9455b
Revert #27870 (#27917)
Now that we have #27798 we don't need the check from #27870 anymore.
With the check it's not possible to remove an inactive auth source from
the user.
2023-11-06 06:09:34 +00:00
delvh 1f501dae9e
Fix JS NPE when viewing specific range of PR commits (#27912)
This should be the easiest fix.
While other solutions might be possible that exterminate the root cause,
they will not be as trivial.
2023-11-06 02:05:24 +00:00
silverwind 1ccdb546f0
Install poetry dependencies with --no-root (#27919)
Poetry 1.7.0 or higher will print a warning otherwise, see discussions:

https://github.com/python-poetry/poetry/pull/8369
https://github.com/python-poetry/poetry/issues/1132

> --no-root Do not install the root package (the current project).
2023-11-06 00:11:34 +00:00
sebastian-sauer 37a7c551d4
Show correct commit sha when viewing single commit diff (#27916)
Show the correct sha when viewing a single commit.


![image](https://github.com/go-gitea/gitea/assets/1135157/5f39a84e-11ed-4700-b40b-eb9da6e91bec)
2023-11-06 00:39:32 +01:00
Nanguan Lin 966dcb99e3
Fix 500 when deleting a dismissed review (#27903)
Fix #27767 
Add a test to ensure its behavior
2023-11-05 13:25:40 +00:00
Earl Warren 59f9ef9fee
Remove action runners on user deletion (#27902)
- On user deletion, delete action runners that the user has created.
- Add a database consistency check to remove action runners that have
nonexistent belonging owner.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1720

(cherry picked from commit 009ca7223d)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-11-05 13:48:32 +01:00
Earl Warren da0c4b8d10
Remove SSH workaround (#27893)
Revert the workaround of #26409 and fix #26411, update github.com/gliderlabs/ssh to include 02f9d57300
2023-11-03 15:21:05 +00:00
Earl Warren c46080bc9d
Remove "tabindex" from some form buttons (#27892)
Remove the "tabindex" from some form buttons on the "diff box" / "issue view content" page, let the browser use the default tab order.

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-11-03 14:40:48 +00:00
Lunny Xiao d1dc9cb334
Refactor the function RemoveOrgUser (#27582)
This PR is a small refactor to merge removeOrgUser into RemoveOrgUser.
2023-11-03 14:01:45 +00:00
Zettat123 ae396ac7c0
Fix DownloadFunc when migrating releases (#27887)
We should not use `asset.ID` in DownloadFunc because DownloadFunc is a
closure.

1bf5527eac/services/migrations/gitea_downloader.go (L284-L295)

A similar bug when migrating from GitHub has been fixed in #14703. This
PR fixes the bug when migrating from Gitea and GitLab.
2023-11-03 15:56:53 +08:00
Lunny Xiao 1bf5527eac
Refactor Find Sources and fix bug when view a user who belongs to an unactive auth source (#27798)
The steps to reproduce it.

First, create a new oauth2 source.
Then, a user login with this oauth2 source.
Disable the oauth2 source.
Visit users -> settings -> security, 500 will be displayed.
This is because this page only load active Oauth2 sources but not all
Oauth2 sources.
2023-11-03 01:41:00 +00:00
GiteaBot 80715ae5c7 [skip ci] Updated translations via Crowdin 2023-11-03 00:23:16 +00:00
yp05327 dcb648ee71
Add `Hide/Show all checks` button to commit status check (#26284)
Step one for a GitHub like commit status check ui:

![image](https://github.com/go-gitea/gitea/assets/18380374/22953b88-1f91-4d19-bc57-ad92d33fa11f)

![image](https://github.com/go-gitea/gitea/assets/18380374/78572a49-c9b0-472b-86a8-8293197e807b)

![image](https://github.com/go-gitea/gitea/assets/18380374/bc5c8d1c-2ab5-4b03-b8c6-20c34b86d856)

Step two:

![image](https://github.com/go-gitea/gitea/assets/18380374/938b359e-8823-4192-b82d-55fa40b986fd)

![image](https://github.com/go-gitea/gitea/assets/18380374/2de5bb8f-40f5-462a-8d6d-bac13a32bc2a)

The design now will list all commit status checks which takes too much
space.
This is a pre-improve for #26247

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-11-02 14:49:02 +00:00
Lunny Xiao 0ba4ecc3bd
Fix http protocol auth (#27875) 2023-11-02 22:14:33 +08:00
KN4CK3R 4776fde9e1
Display issue task list on project cards (#27865)
Display the issue task list on project cards.


![grafik](https://github.com/go-gitea/gitea/assets/1666336/e6cb3196-8980-403c-9795-3a7b03fbfb3c)

Co-authored-by: Giteabot <teabot@gitea.io>
2023-11-02 11:42:02 +01:00
silverwind dc52f26d46
Reduce margin/padding on flex-list items and divider (#27872)
Small CSS tweak, reduces margin/padding from 14px to 10px, which I think
looks better
2023-11-02 12:30:38 +08:00
KN4CK3R e378545f30
Filter inactive auth sources (#27870)
Fix nil access for inactive auth sources.

> Render failed, failed to render template:
user/settings/security/security, error: template error:
builtin(static):user/settings/security/accountlinks:32:20 : executing
"user/settings/security/accountlinks" at <$providerData.IconHTML>: nil
pointer evaluating oauth2.Provider.IconHTML

Code tries to access the auth source of an `ExternalLoginUser` but the
list contains only the active auth sources.
2023-11-02 01:46:26 +02:00
Moritz Poldrack 9b6e77c489
refactor postgres connection string building (#27723)
This patchset changes the connection string builder to use net.URL and
the host/port parser to use the stdlib function for splitting host from
port. It also adds a footnote about a potentially required portnumber
for postgres UNIX sockets.

Fixes: #24552
2023-11-01 18:00:20 +00:00
nodiscc 665d12cf84
doc: actions/act-runner: document running as a systemd service (#27844)
This documents running `act-runner` as a systemd service under a
dedicated user account.
2023-11-01 23:14:40 +08:00
Lunny Xiao d519a39302
Support storage base path as prefix (#27827)
This PR adds a prefix path for all minio storage and override base path
will override the path.
The previous behavior is undefined officially, so it will be marked as
breaking.
2023-11-01 19:17:18 +08:00
wxiaoguang a4b242ae7a
Clean up template locale usage (#27856)
After many refactoring PRs for the "locale" and "template context
function", now the ".locale" is not needed for web templates any more.

This PR does a clean up for:

1. Remove `ctx.Data["locale"]` for web context.
2. Use `ctx.Locale` in `500.tmpl`, for consistency.
3. Add a test check for `500 page` locale usage.
4. Remove the `Str2html` and `DotEscape` from mail template context
data, they are copy&paste errors introduced by #19169 and #16200 . These
functions are template functions (provided by the common renderer), but
not template data variables.
5. Make email `SendAsync` function mockable (I was planning to add more
tests but it would make this PR much too complex, so the tests could be
done in another PR)
2023-10-31 22:11:48 +08:00
Lunny Xiao 16d15ce087
Fix package webhook (#27839)
Fix #23742

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-10-31 04:43:38 +00:00
Jean-Baptiste Gomond 9106514e51
Add user secrets API integration tests (#27832)
Adds the missing user secrets API integration tests so #27829 does not
happen again
2023-10-31 11:46:09 +08:00
Lunny Xiao 6ca234a356
Fix wrong relative path on obtain token from command line (#27850)
Caused by #27845
2023-10-30 23:31:09 -04:00
nodiscc a18ecaed61
doc: actions/act-runner: document obtaining a runner registration token from gitea CLI (#27845) 2023-10-30 19:28:02 -04:00
FuXiaoHei ec0c6829d4
Fix/upload artifact error windows (#27802)
From issue https://github.com/go-gitea/gitea/issues/27314

When act_runner in `host` mode on Windows. `upload_artifact@v3` actions
use `path.join` to generate `itemPath` params when uploading artifact
chunk. `itemPath` is encoded as `${artifact_name}\${artifact_path}`.

<del>It's twice query escaped from ${artifact_name}/${artifact_path}
that joined by Windows slash \.</del>

**So we need convert Windows slash to linux**.

In https://github.com/go-gitea/gitea/issues/27314, runner shows logs
from `upload_artifact@v3` like with `%255C`:

```
[artifact-cases/test-artifact-cases]   | ::error::Unexpected response. Unable to upload chunk to http://192.168.31.230:3000/api/actions_pipeline/_apis/pipelines/workflows/6/artifacts/34d628a422db9367c869d3fb36be81f5/upload?itemPath=more-files%255Css.json
```

But in gitea server at the same time, But shows `%5C`

```
2023/10/27 19:29:51 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /api/actions_pipeline/_apis/pipelines/workflows/6/artifacts/34d628a422db9367c869d3fb36be81f5/upload?itemPath=more-files%5Css.json for 192.168.31.230:55340, 400 Bad Request in 17.6ms @ <autogenerated>:1(actions.artifactRoutes.uploadArtifact-fm)
```

I found `%255C` is escaped by
`https://github.com/actions/upload-artifact/blob/main/dist/index.js#L2329`.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-30 10:40:05 +00:00
Denys Konovalov e5f19dd317
Always use whole user name as link (#27815)
Starting from #25790 this shared template only linked the username of
the user if both display name and username were shown. I experienced
myself always trying to click on the display name - I think it is
annoying for others too.

After:


![grafik](https://github.com/go-gitea/gitea/assets/47871822/a0e82127-b773-4ca4-890f-d18422a7bef2)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/79efcf93-2f50-4fc4-ba15-afc6174be48c)
2023-10-30 09:53:16 +00:00
yp05327 0e021cd33e
Fix display member unit in the menu bar if there are no hidden members in public org (#27795)
Follow #26363.
I missed that org templates also using
`templates/user/overview/header.tmpl`.
You can confirm this problem in https://gitea.com/gitea/-/projects with
anonymous access.

Before: (no login)

![image](https://github.com/go-gitea/gitea/assets/18380374/e285565c-ca65-4b18-9ff7-434c6367c13a)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/81e7532a-c458-4552-8d75-6896538e42cb)
2023-10-30 09:11:16 +00:00
JakobDev c8602a8dfa
Add Index to pull_auto_merge.doer_id (#27811)
Reported at https://codeberg.org/forgejo/forgejo/issues/1677

This column is used by
[deleteUser](f089be91da/services/user/delete.go (L90)).

Note: This PR contains a Migration, so we can't backport it to 1.21.
2023-10-30 08:39:29 +00:00
Chongyi Zheng 0a710133cd
Bump workflows in github actions (#27836)
All major version upgrades are related to using Node v20 as default
runtime
2023-10-30 15:56:43 +08:00
Brecht Van Lommel 1756e30e10
Allow pull requests Manually Merged option to be used by non-admins (#27780)
Currently this feature is only available to admins, but there is no
clear reason why. If a user can actually merge pull requests, then this
seems fine as well.

This is useful in situations where direct pushes to the repository are
commonly done by developers.

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-10-30 11:13:06 +08:00
KN4CK3R b36e2ca419
List all Debian package versions in `Packages` (#27786)
Closes #27783

This PR lists all and not only the latest package versions in the
`Packages` index.
2023-10-29 14:14:47 +00:00
Sebastian Brückner 02dae3f84b
Fix merge base commit for fast-forwarded GitLab PRs (#27825)
Due to a bug in the GitLab API, the diff_refs field is populated in the
response when fetching an individual merge request, but not when
fetching a list of them. That field is used to populate the merge base
commit SHA.
While there is detection for the merge base even when not populated by
the downloader, that detection is not flawless. Specifically, when a
GitLab merge request has a single commit, and gets merged with the
squash strategy, the base branch will be fast-forwarded instead of a
separate squash or merge commit being created. The merge base detection
attempts to find the last commit on the base branch that is also on the
PR branch, but in the fast-forward case that is the PR's only commit.
Assuming the head commit is also the merge base results in the import of
a PR with 0 commits and no diff.

This PR uses the individual merge request endpoint to fetch merge
request data with the diff_refs field. With its data, the base merge
commit can be properly set, which—by not relying on the detection
mentioned above—correctly imports PRs that were "merged" by
fast-forwarding the base branch.

ref: https://gitlab.com/gitlab-org/gitlab/-/issues/29620
2023-10-29 21:29:33 +08:00
Jean-Baptiste Gomond 641e8165c7
Fix bad method call when deleting user secrets via API (#27829)
Fixed a little mistake when you deleting user secrets via the API. Found
it when working on #27725.
It should be backported to 1.21 I think.
2023-10-29 13:19:57 +01:00
KN4CK3R 3c78cb832d
Change katex limits (#27823)
Fixes #27812

Use higher defaults again but limit the input size.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/23cdf572-de30-4799-b9cf-ef386b1623b9)
2023-10-29 01:52:02 +00:00
Patryk Krawaczyński 319414dd82
Dockerfile small refactor (#27757)
- Size and layer optimization,
- Maintaining consistency in definitions (comments, apk etc.),
2023-10-29 09:44:06 +08:00
Sebastian Brückner 8faa38568b
Use GitLab's squash_commit_sha when available (#27824)
Before this PR, the PR migration code populates Gitea's MergedCommitID
field by using GitLab's merge_commit_sha field. However, that field is
only populated when the PR was merged using a merge strategy. When a
squash strategy is used, squash_commit_sha is populated instead.

Given that Gitea does not keep track of merge and squash commits
separately, this PR simply populates Gitea's MergedCommitID by using
whichever field is present in the GitLab API response.
2023-10-29 00:54:58 +00:00
GiteaBot 5a76759c9c [skip ci] Updated translations via Crowdin 2023-10-28 00:22:03 +00:00
Nanguan Lin e75b89ea6e
Upgrade xorm to 1.3.4 (#27807)
Noticeable change: 
Remove the `OrderBy("1") `
[patch](https://github.com/go-gitea/gitea/pull/27673#issuecomment-1768570142)
for mssql since xorm has [fixed
it](0f085408af).
2023-10-27 13:28:53 +02:00
GiteaBot f089be91da [skip ci] Updated translations via Crowdin 2023-10-27 00:22:31 +00:00
Danila Fominykh 0c21af3728
Package repository/documentation link unification (#27804)
Some translations are duplicated for the same package fields; it should
be possible to use the same approach. Checked packages to use the same
forms in templates.

1. Removed repeated translations for the same fields
2. Linked template files to the same translation fields
3. Added repository site link for nuget packages
2023-10-27 00:16:12 +00:00
bt90 8d6577dabd
Chroma v2.10.0 (#27803)
Bump the chroma version to v2.10.0:
https://github.com/alecthomas/chroma/releases/tag/v2.10.0

This release includes a better Java lexer
https://github.com/alecthomas/chroma/pull/873
2023-10-26 23:42:24 +02:00
853 4f4ddcf3c5
Add link to members and repositories at teams page (#27744)
![image](https://github.com/go-gitea/gitea/assets/8389962/123e4ca7-dd10-44e7-9702-4b8e9e0882a7)
The members and repositories text now can be click.

like Org home page:

cab7b7f59c/templates/org/home.tmpl (L81-L82)
2023-10-26 02:50:43 +00:00
silverwind 05aa91e6da
Add dedicated class for empty placeholders (#27788)
Fixes: https://github.com/go-gitea/gitea/issues/27784

<img width="1033" alt="Screenshot 2023-10-25 at 19 07 15"
src="https://github.com/go-gitea/gitea/assets/115237/1a363851-1a86-48cb-99ec-0a573371bb6e">
<img width="1051" alt="Screenshot 2023-10-25 at 19 07 41"
src="https://github.com/go-gitea/gitea/assets/115237/add4b606-2264-430a-af35-249ef005817f">

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-10-25 23:42:14 +02:00
KN4CK3R ab3f6c1bac
Close all hashed buffers (#27787)
Add missing `.Close()` calls. The current code does not delete the
temporary files if the data grows over 32mb.
2023-10-25 21:24:24 +02:00
Joel Wetzell 46dd02702d
Fix typo when updating email address (#27789)
- correct text that is shown when attempting to change an email address
2023-10-25 19:21:23 +02:00
Brecht Van Lommel 7a286e4753
Improve pull request command line instructions (#27778)
* Show checkout instructions also when there is no permission to push,
for anyone who wants to locally test the changes.
* First checkout the branch exactly as is, without immediately having to
solve merge conflicts. Leave this to the merge step, since it's often
convenient to test a change without worrying about this.
* Use `git fetch -u`, so an existing local branch is updated when
re-testing the same pull request. But not the more risky `git fetch -f`
in to handle force pushes, as we don't want to accidentally overwrite
important local changes.
* Show different merge command depending on the chosen merge style,
interactively updated.
2023-10-25 15:01:31 +00:00
Nanguan Lin 1eae2aadae
Fix issue not showing on default board and add test (#27720)
See https://github.com/go-gitea/gitea/pull/27718#issuecomment-1773743014
. Add a test to ensure its behavior.
Why this test uses `ProjectBoardID=0`? Because in `SearchOptions`,
`ProjectBoardID=0` means what it is. But in `IssueOptions`,
`ProjectBoardID=0` means there is no condition, and
`ProjectBoardID=db.NoConditionID` means the board ID = 0.
It's really confusing. Probably it's better to separate the db search
engine and the other issue search code. It's really two different
systems. As far as I can see, `IssueOptions` is not necessary for most
of the code, which has very simple issue search conditions.
2023-10-25 11:51:49 +00:00
Gerd Katzenbeisser 31f8880bc2
Show placeholder email in privacy popup (#27770)
This PR will show the _noreply_ address in the privacy popup
_keep_email_private_popup_.

I had to look into the source code to figure out which E-Mail Adress I
had to use on gitea.com to hide it from public access.

According to the contribution guidelines I only updated the en-US
translation file.

Co-authored-by: Hakito <hakito@git.example.com>
2023-10-25 11:12:36 +00:00
yp05327 f39256f035
Add word-break to organization name and description (#26624)
Fix #24318

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/38282e5e-0b4d-4568-a853-59352798e826)

![image](https://github.com/go-gitea/gitea/assets/18380374/79d89ee6-61f6-45a7-af0b-d1c23fead25a)

![image](https://github.com/go-gitea/gitea/assets/18380374/39b45fae-52e2-4697-b83a-7cd10f76ac43)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/09e8cfcf-0150-494e-9f63-0868f529da65)

![image](https://github.com/go-gitea/gitea/assets/18380374/d2c348d3-fe03-466a-a5f4-878b7a93a318)

![image](https://github.com/go-gitea/gitea/assets/18380374/7f75b807-300c-42d5-b2c3-bae9e45e3c08)

![image](https://github.com/go-gitea/gitea/assets/18380374/06eca901-f5cf-4100-bb65-92457ad106e3)
2023-10-25 10:40:39 +00:00
Nanguan Lin 3602a1987d
Add border to file tree 'sub-items' and add padding to 'item-file' (#27593)
## Add border to file tree 'sub-items'
close #24766 
view in `gitea-light` 
<img width="275" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/f1bf8736-2db3-454f-86f5-d050a2fae3eb">
view in `gitea-dark`
<img width="296" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/053e2e6e-28f7-41d2-a139-1dae4df45929">
## Change the 'item-file' padding 
Before that the 'item-file' only have padding when they in
'item-directory', which is too compact when 'item-file' after
'item-directory'
<details>

![)RW`SDJ_UQL@$}0
PL(3DS7](https://github.com/go-gitea/gitea/assets/70063547/5fa523a4-44c3-4cb9-a882-a3ea6d944673)

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-10-25 18:00:53 +08:00
853 e544a277fe
Fix the missing repo count in new team page and edit team page (#27743)
Follow #26942
Before:

![image](https://github.com/go-gitea/gitea/assets/8389962/ffe3e914-c71c-493f-965b-369f27c70b4b)


![image](https://github.com/go-gitea/gitea/assets/8389962/eaad4f07-b8ce-4564-b883-97938de5ed79)

After:


![image](https://github.com/go-gitea/gitea/assets/8389962/353aeabe-caf4-4449-8330-d3a29f9bd326)


![image](https://github.com/go-gitea/gitea/assets/8389962/baf59bb6-2c74-4a56-a28c-1519bc3d2594)
2023-10-25 13:55:56 +08:00
silverwind 572f0963ed
Only show diff file tree when more than one file changed (#27775)
When 0 or 1 files changed in a diff, we don't need to show a file tree.
This behaviour matches GitHub. Single-file diff after this change, note
absence of button:

<img width="1234" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3618438b-e655-42a3-989f-f299267b2b8b">

Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-25 05:09:18 +02:00
silverwind fba4ee7efc
Add gap between diff boxes (#27776)
Before (almost no gap between files):
<img width="1240" alt="Screenshot 2023-10-24 at 19 43 32"
src="https://github.com/go-gitea/gitea/assets/115237/30cdbdbc-d102-479c-89ce-3f68837ae0cd">

After (with 8px gap):
<img width="1241" alt="Screenshot 2023-10-24 at 19 43 22"
src="https://github.com/go-gitea/gitea/assets/115237/72b26a30-8730-4a36-8de9-be143b684b98">
2023-10-25 00:47:17 +02:00
merlleu 796ff26e0e
Do not force creation of _cargo-index repo on publish (#27266)
Hello there,
Cargo Index over HTTP is now prefered over git for package updates: we
should not force users who do not need the GIT repo to have the repo
created/updated on each publish (it can still be created in the packages
settings).

The current behavior when publishing is to check if the repo exist and
create it on the fly if not, then update it's content.
Cargo HTTP Index does not rely on the repo itself so this will be
useless for everyone not using the git protocol for cargo registry.

This PR only disable the creation on the fly of the repo when publishing
a crate.

This is linked to #26844 (error 500 when trying to publish a crate if
user is missing write access to the repo) because it's now optional.

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-10-24 03:26:38 +00:00
silverwind ce83609ff6
Upgrade to golangci-lint@v1.55.0 (#27756)
https://github.com/golangci/golangci-lint/releases/tag/v1.55.0
2023-10-24 02:54:59 +00:00
wxiaoguang def907de7b
Fix incorrect "tab" parameter for repo search sub-template (#27755)
![image](https://github.com/go-gitea/gitea/assets/2114189/c546824e-4824-4f4d-bd33-e558c6ddf0ef)


![image](https://github.com/go-gitea/gitea/assets/2114189/713eb72c-22fb-412b-a867-9cccbf7548ec)
2023-10-24 02:00:06 +00:00
Earl Warren 6352114a77
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 e2bc2c9a1f)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-10-23 23:02:00 +00:00
Nanguan Lin 51d1dc22ff
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.
2023-10-23 12:40:33 +00:00
Nanguan Lin 61d94b247a
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>
2023-10-23 20:34:17 +08:00
wxiaoguang f3956fcb28
Fix incorrect ctx usage in defer function (#27740) 2023-10-22 14:12:27 +00:00
silverwind d8c09c25d1
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.
2023-10-22 13:06:04 +00:00
tomholford e3afe4a248
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>
2023-10-22 12:34:16 +00:00
Denys Konovalov 16cfa17844
fix issues in translation file (#27699)
- use correct comment sign for INI (`;`)
- remove duplicated `repo.branch.search` key
- remove duplicated spaces & similar
2023-10-22 11:59:31 +00:00
HoshinoRei 9b991f2947
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.
2023-10-22 19:37:56 +08:00
GiteaBot a5bdcfc863 [skip ci] Updated translations via Crowdin 2023-10-22 00:24:59 +00:00
Nanguan Lin 1859bbbf91
Fix org team endpoint (#27721)
Fix #27711
2023-10-22 01:40:59 +02:00
silverwind b39bb958cc
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>
2023-10-21 10:38:19 +00:00
6543 b2f828db5e
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)
2023-10-21 10:05:29 +08:00
MrDevil 510d07506e
[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">
2023-10-20 17:33:05 +00:00
silverwind 4539a7b0b4
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">
2023-10-20 14:56:19 +00:00
Nanguan Lin 881806a50b
Replace -1 with GhostUserID (#27703) 2023-10-20 14:43:08 +00:00
Nanguan Lin eb1478791f
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.
2023-10-20 14:01:25 +02:00
delvh cab7b7f59c
Adapt `.changelog.yml` to new labeling system (#27701)
Otherwise, it is not possible anymore to generate changelogs.
2023-10-20 00:22:00 +02:00
silverwind bd58266957
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)
2023-10-19 21:51:56 +02:00
6543 adbc995c34
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*
2023-10-19 14:08:31 +00:00
6543 e83f2cbbac
Add doctor dbconsistency fix to delete repos with no owner (#27290)
to address #27273
replace #24873
2023-10-19 15:20:52 +02:00
JakobDev 3dc0c962bf
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.
2023-10-19 13:16:11 +00:00
JakobDev 398eccb322
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)
2023-10-19 11:43:15 +00:00
Nanguan Lin e91d4f106b
Upgrade xorm (#27673)
Related to https://gitea.com/xorm/xorm/pulls/2341
2023-10-19 10:25:57 +00:00
MiloCubed 2f2ca8c940
[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)
2023-10-19 16:14:46 +08:00
techknowlogick 60fce1568e
Remove network call on `make clean` (#27689)
fix #27653

credit to silverwind for finding issue
2023-10-19 08:02:22 +00:00
Nanguan Lin 80a0ab350b
Add unit tests for action runner token (#27670)
In case the behavior of the register token changes.
2023-10-19 07:24:24 +00:00
SandeshPyakurel 776b092863
Typos fixed in documentation files (#27687)
Typos fixed in multiple docs files.
2023-10-19 02:46:26 -04:00
GiteaBot 63e391ed17 [skip ci] Updated translations via Crowdin 2023-10-19 00:23:11 +00:00
sebastian-sauer 7210f23fa0
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)
2023-10-18 17:59:46 -05:00
Jason Song 0a2b93d411
Fix typo "GetLatestRunnerToken" (#27680) 2023-10-18 15:52:44 +00:00
silverwind 0b654fa8dc
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>
2023-10-18 15:16:06 +00:00
Lunny Xiao 9852c92e9a
Remove unnecessary parameter (#27671) 2023-10-18 15:03:10 +00:00
KN4CK3R 83186eca80
Always delete existing scheduled action tasks (#27662)
Fixes #27650
2023-10-18 10:34:39 +00:00
Jason Song 4e98224a45
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.
2023-10-18 09:44:36 +00:00
yp05327 8abc1aae4a
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>
2023-10-18 00:03:42 +00:00
Lunny Xiao eeb1e0242b
Fix poster is not loaded in get default merge message (#27657) 2023-10-17 15:07:23 +00:00
puni9869 4adc2a828d
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>
2023-10-17 16:10:45 +02:00
Yevhen Pavlov d98c863884
actions/setup-go use go-version-file (#27651)
These changes will allow not to specify the version of go in every
pipeline.
2023-10-17 10:24:54 +00:00
Sandro Santilli 0f3ea4e1b1
Update agit-support.en-us.md (#27652)
Clarify Agit PR creation documentation

See https://github.com/go-gitea/gitea/issues/27579
2023-10-17 17:53:36 +08:00
Denys Konovalov 0271114e64
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.
2023-10-16 23:06:15 +02:00
wxiaoguang 6c501b1498
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
2023-10-16 07:26:08 +00:00
GiteaBot d1f85525d0 [skip ci] Updated licenses and gitignores 2023-10-16 00:24:20 +00:00
Jason Song 1be49fdda6
Improve retrying index issues (#27554)
Fix #27540
2023-10-15 18:56:57 +00:00
Lunny Xiao cddf245c12
Replace more db.DefaultContext (#27628)
Target #27065
2023-10-15 17:46:06 +02:00
Nanguan Lin 7480aacdad
Fix 404 when there is an internal version of package (#27615)
close #27601
The Docker registry has an internal version, which leads to 404
2023-10-15 09:22:10 +00:00
GiteaBot 4f6043f554 [skip ci] Updated translations via Crowdin 2023-10-15 00:25:13 +00:00
Earl Warren 89c9a498fd
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 1741a5f1fe)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
2023-10-14 16:13:59 -05:00
Nanguan Lin 02d4e4d412
Update readme to remove drone svg (#27624) 2023-10-14 16:11:54 +00:00
Nanguan Lin e29e40d128
Change the default branch in the agit docs (#27621) 2023-10-14 09:50:23 -04:00
JakobDev 76a85a4ce9
Final round of `db.DefaultContext` refactor (#27587)
Last part of #27065
2023-10-14 08:37:24 +00:00
Evan Tobin ae419fa494
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
2023-10-14 08:04:44 +00:00
KN4CK3R c6c829fe3f
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`.
2023-10-14 00:56:41 +00:00
GiteaBot ee6a390675 [skip ci] Updated translations via Crowdin 2023-10-14 00:22:28 +00:00
techknowlogick c573d96b70
rm outdated docs from some languages (#27530)
related to #27499
2023-10-13 19:29:18 +00:00
Chongyi Zheng b5a4ec0fb1
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>
2023-10-13 16:11:15 +00:00
Sergey Zolotarev cf74f5fc40
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. ```
2023-10-13 15:38:27 +00:00
silverwind 532f166c4d
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);
```
2023-10-13 08:19:21 +00:00
GiteaBot 3e9a379d38 [skip ci] Updated translations via Crowdin 2023-10-13 00:23:41 +00:00
silverwind c37f95fc56
Make disk clean action a bit more robust (#27590) 2023-10-12 00:24:13 -04:00
GiteaBot d020343269 [skip ci] Updated translations via Crowdin 2023-10-12 00:21:30 +00:00
JakobDev bf24852b20
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>
2023-10-11 22:10:51 +00:00
JakobDev 328da56a28
Don't show Link to TOTP if not set up (#27585) 2023-10-11 20:12:54 +00:00
wxiaoguang 1d155a43ad
Fix data-race bug when accessing task.LastRun (#27584) 2023-10-11 14:51:20 +00:00
Lunny Xiao fb74fe99d6
Fix template bug (#27581)
Regression from #27414
2023-10-11 14:02:15 +00:00
silverwind 73b63d9311
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>
2023-10-11 12:34:21 +00:00
Nanguan Lin dc04044716
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.
2023-10-11 11:02:24 +00:00
Lunny Xiao dca195e9bd
Fix the robots.txt path 2023-10-11 18:01:52 +08:00
Earl Warren 1050d7a78f
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 fd34fdac14)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: silverwind <me@silverwind.io>
2023-10-11 07:28:16 +00:00
techknowlogick dc7cf7a984
fully replace drone with actions (#27556)
this builds binaries and docker images for tags
2023-10-11 06:39:32 +00:00
zeripath 4378f9dfff
Revert "Simplify `contrib/backport` (#27520)" (#27566)
This reverts #27520 commit 79e8865aae
which breaks `--continue` functionality.
2023-10-11 05:55:17 +00:00
Nanguan Lin 248b7ee850
Align ISSUE_TEMPLATE with the new label system (#27573)
As title
2023-10-11 13:25:31 +08:00
JakobDev ebe803e514
Penultimate round of `db.DefaultContext` refactor (#27414)
Part of #27065

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-10-11 04:24:07 +00:00
GiteaBot 50166d1f7c [skip ci] Updated translations via Crowdin 2023-10-11 00:22:56 +00:00
Lunny Xiao 5c9fbcca00
Fix attachment download bug (#27486) 2023-10-10 15:33:56 +00:00
Lunny Xiao 7ff1f2527c
Make actions default enabled for newly created repository if global configuraion enabled (#27482) 2023-10-10 14:45:31 +00:00
Nanguan Lin 5b6258a0b9
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>
2023-10-10 15:39:58 +02:00
Jason Song 2c7b6c378e
Increase queue length (#27555) 2023-10-10 18:47:49 +08:00
Sebastian Grabowski 3c131307ac
Respect SSH.KeygenPath option when calculating ssh key fingerprints (#27536)
Fixes #27535
2023-10-10 00:01:46 +00:00
Kyle D ac4ae35542
Remove max-width and add hide text overflow (#27359)
Closes https://github.com/go-gitea/gitea/issues/27358
2023-10-09 19:04:31 -04:00
wxiaoguang e2e0280108
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.
2023-10-10 01:10:37 +08:00
Nanguan Lin 28ead9ea62
Improve docs about register/run as a service (#27461)
As title
2023-10-09 13:20:16 +00:00
Michael Santos 5283ce9650
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>
2023-10-09 11:22:12 +00:00
techknowlogick 65eea1d536
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
2023-10-09 10:12:19 +00:00
wxiaoguang d1527dac3d
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)
2023-10-09 07:19:23 +00:00
wxiaoguang 43632d9d34
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.
2023-10-09 06:48:51 +00:00
silverwind 79e8865aae
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 08efeb5cdc
* 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>
2023-10-09 06:16:16 +00:00
KN4CK3R e94a4ad28d
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>
2023-10-09 12:45:41 +08:00
delvh ae2794c958
Document our new labeling strategy (#27523) 2023-10-09 09:16:05 +08:00
GiteaBot 4aae15af7a [skip ci] Updated translations via Crowdin 2023-10-09 00:23:39 +00:00
silverwind 5bf367f904
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>
2023-10-08 22:16:06 +00:00
Denys Konovalov 0c2a3f4cdc
Update labeler to match new labeling system (#27525) 2023-10-08 12:16:56 -04:00
Gary Wang 4335c332ba
Apply to become a maintainer (#27522) 2023-10-08 10:36:40 -04:00
Lunny Xiao f40538e667
Remove unnecessary desc for openssh key cron task (#27515) 2023-10-08 14:23:39 +00:00
silverwind ab074c9b98
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).
2023-10-08 13:11:26 +00:00
Gary Wang abe8fe3527
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)
2023-10-08 10:07:55 +00:00
mohammed ahmed 551dc8bb4d
[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)
2023-10-08 14:35:20 +08:00
M Hickford a825cc0f34
Pre-register OAuth application for tea (#27509)
It remains to implement OAuth login in tea
https://gitea.com/gitea/tea/issues/598

Fixes #27510
2023-10-08 03:51:08 +00:00
silverwind 08efeb5cdc
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">
2023-10-08 03:20:12 +00:00
techknowlogick e96e440b8b
add a shortcut to user's profile page to admin user details (#27299) 2023-10-08 02:48:32 +00:00
silverwind 7065944ac7
Fix actionlint (#27513)
`make lint-actions` is currently failing because of undeclared runner
name.
2023-10-07 20:42:32 -04:00
GiteaBot 4bde16e1ba [skip ci] Updated translations via Crowdin 2023-10-08 00:25:56 +00:00
silverwind 0bccf078c9
Update JS and PY dependencies (#27501)
- 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>
2023-10-08 00:16:20 +00:00
silverwind 3b139fa3a3
Improve feed icons and feed merge text color (#27498)
1. Improve various feed icons
2. Fix merge message color


<img width="763" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/3f5bcb23-6d90-4c63-85f2-46bd7e1c96d6">
<img width="769" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/466c37b4-e2f4-42bb-922d-b86596cdc6d0">


Fixes: https://github.com/go-gitea/gitea/issues/27495
Continues: https://github.com/go-gitea/gitea/pull/27356
2023-10-07 23:26:27 +00:00
silverwind e51f96829f
Downgrade `go-co-op/gocron` to v1.31.1 (#27511) 2023-10-07 18:54:02 -04:00
silverwind 56ea9a4225
Enable markdownlint `no-duplicate-header` (#27500)
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
2023-10-07 15:30:21 +02:00
techknowlogick e3229c8e9b
bump go-deps (#27489) 2023-10-07 05:55:08 +00:00
Kerwin Bryant 47258fad63
Apply to became a maintainer (#27491) 2023-10-07 13:24:17 +08:00
techknowlogick 72b66032e4
change runner for binary 2023-10-07 00:14:45 -04:00
GiteaBot 68b3fe88d5 [skip ci] Updated translations via Crowdin 2023-10-07 00:22:38 +00:00
Sergey Zolotarev 6acce16ee3
Remove .exe suffix when cross-compiling on Windows (#27448)
When compiling GItea for Linux on Windows, you get a `gitea.exe` file as
output, but because it's a Linux executable, the `.exe` extension is
unnecessary.

This PR adds a check for `GOOS` environment variable in addition to
`OS`.
2023-10-06 16:39:21 -04:00
techknowlogick e820d9966d
move re-useable workflow 2023-10-06 15:22:10 -04:00
techknowlogick bab41dd3a3
add checkout to disk-clean 2023-10-06 15:16:56 -04:00
techknowlogick 1683f1587c
use hosted runners for nightly actions (#27485)
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: silverwind <me@silverwind.io>
2023-10-06 15:13:47 -04:00
yp05327 5a7ab86b98
Avoid run change title process when the title is same (#27467)
If user only changed the target branch or just did nothing and clicked
the `Save` button, you will see the change log as following:

![image](https://github.com/go-gitea/gitea/assets/18380374/d30927dd-9227-4653-8fac-b890ef0b3f88)

This makes no sense, so we should check whether the title is surely
changed before run the `ChangeTitle`.
2023-10-06 18:00:53 +00:00
Sergey Zolotarev 7b79be24ca
Fix panic in storageHandler (#27446)
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 (?)
2023-10-06 13:23:14 +00:00
silverwind 023e937141
Rename the default themes to gitea-light, gitea-dark, gitea-auto (#27419)
Part of https://github.com/go-gitea/gitea/issues/27097:

- `gitea` theme is renamed to `gitea-light`
- `arc-green` theme is renamed to `gitea-dark`
- `auto` theme is renamed to `gitea-auto`

I put both themes in separate CSS files, removing all colors from the
base CSS. Existing users will be migrated to the new theme names. The
dark theme recolor will follow in a separate PR.

## ⚠️ BREAKING ⚠️

1. If there are existing custom themes with the names `gitea-light` or
`gitea-dark`, rename them before this upgrade and update the `theme`
column in the `user` table for each affected user.
2. The theme in `<html>` has moved from `class="theme-name"` to
`data-theme="name"`, existing customizations that depend on should be
updated.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-06 09:46:36 +02:00
Andrew Imeson 04e88e6ca5
Rephrase template documentation to be more clear about .gitea/template (#27450)
Closes #27336

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-10-06 14:51:33 +08:00
Eng Zer Jun 13d5d2e711
Remove redundant `len` check around loop (#27464)
This pull request is a minor code cleanup.

From the Go specification (https://go.dev/ref/spec#For_range):

> "1. For a nil slice, the number of iterations is 0."
> "3. If the map is nil, the number of iterations is 0."

`len` returns 0 if the slice or map is nil
(https://pkg.go.dev/builtin#len). Therefore, checking `len(v) > 0`
before a loop is unnecessary.

---

At the time of writing this pull request, there wasn't a lint rule that
catches these issues. The closest I could find is
https://staticcheck.dev/docs/checks/#S103

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-10-06 14:49:37 +08:00
GiteaBot 6cdeb7798b [skip ci] Updated translations via Crowdin 2023-10-06 00:23:05 +00:00
Nuyube 33fba5874d
fix wording in SECURITY.md (#27463) 2023-10-06 05:17:29 +08:00
Nanguan Lin 7014ee0e39
Fix `Installation from package` doc (#27459)
Fix the title size and add notes to the Gitea snap package.
Related issue #27424, #27423, #27422, #27420
2023-10-05 21:57:28 +08:00
JakobDev f2b2608a86
Don't let API add 2 exclusive labels from same scope (#27433)
Fixes #27380
2023-10-05 03:37:36 +00:00
wxiaoguang 9f8d59858a
Refactor system setting (#27000)
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.
2023-10-05 09:08:19 +08:00
GiteaBot 976d1760ac [skip ci] Updated translations via Crowdin 2023-10-05 00:23:21 +00:00
Lunny Xiao fe68bbeea0
When comparing with an non-exist repository, return 404 but 500 (#27437) 2023-10-04 13:59:03 +00:00
Lunny Xiao dd221b9aec
Fix pr template (#27436)
Fix #27431
2023-10-04 12:28:25 +00:00
Lunny Xiao 74763f50ae
Use minimal required version on CI and remove unnecessary services (#27429) 2023-10-04 11:42:02 +00:00
CaiCandong df56b1bf92
Fix missing `ctx` in new_form.tmpl (#27434)
Fix  #27432
Regression of #27265
2023-10-04 12:12:17 +02:00
silverwind cbc0b7307d
Use flex-container for repo and org settings (#27418)
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: Giteabot <teabot@gitea.io>
2023-10-04 08:47:54 +02:00
delvh 112f37c546
Fix yet another `ctx` template bug (#27417)
Fixes #27416
2023-10-04 02:11:01 +00:00
JakobDev 4636f56e7b
Add Index to `action.user_id` (#27403)
Another Column that needs a Index. Found at
https://codeberg.org/forgejo/discussions/issues/61#issuecomment-1258744.

Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-03 21:41:25 -04:00
GiteaBot b37f3332f1 [skip ci] Updated translations via Crowdin 2023-10-04 00:23:10 +00:00
silverwind e94f9fcafd
Require MySQL 8.0, PostgreSQL 12, MSSQL 2012 (#27337)
- MySQL 5.7 support and testing is dropped
- MySQL tests now execute against 8.1, up from 5.7 and 8.0
- PostgreSQL 10 and 11 support ist dropped
- PostgreSQL tests now execute against 16, up from 15
- MSSQL 2008 support is dropped
- MSSQL tests now run against locked 2022 version

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

Ref: https://endoflife.date/mysql
Ref: https://endoflife.date/postgresql
Ref: https://endoflife.date/mssqlserver

## ⚠️ BREAKING ⚠️

Support for MySQL 5.7, PostgreSQL 10 and 11, and MSSQL 2008 is dropped.
You are encouraged to upgrade to supported versions.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-10-03 13:27:57 -04:00
Lunny Xiao 1c9990c16f
Add 1.20.5 changelog (#27404) (#27411)
frontport #27404

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-10-03 14:22:03 +00:00
Earl Warren 2ec0bf3878
verify MinIO works with bitnami/minio:2023.8.31 (#27022) 2023-10-03 14:21:14 +00:00
JakobDev cc5df26680
Even more `db.DefaultContext` refactor (#27352)
Part of #27065

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2023-10-03 10:30:41 +00:00
JakobDev 08507e2760
Don't use subselect in `DeleteIssuesByRepoID` (#27332)
Part of https://codeberg.org/forgejo/discussions/issues/61

This is workaround for a bug in MariaDB
2023-10-03 08:17:28 +00:00
Kirill Sorokin 2b06c106ef
Add support for HEAD ref in /src/branch and /src/commit routes (#27384)
Add support for HEAD in paths:
```
/src/branch/HEAD/README.md
/src/commit/HEAD/README.md
```

Closes #26920
2023-10-03 15:37:06 +08:00
Francesco Antognazza bc21723717
Make Actions tasks/jobs timeouts configurable by the user (#27400)
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-02 23:09:26 +02:00
wxiaoguang dfa4e5857f
Fix git 2.11 error when checking IsEmpty (again) (#27399)
Follow  #27393

Sorry that I made a mistake in #27393. The `errbuf` is not empty when
the err is `exit status 129`.
2023-10-02 15:59:39 +00:00
delvh e709bc199f
Differentiate between `push` and `pull` `mirror sync in progress` (#27390)
Previously, if you had both a push and a pull mirror, the message did
not clarify if you've accidentally synchronized the wrong one.
Additionally fixed two typos that were encountered while debugging.

## Screenshots

![grafik](https://github.com/go-gitea/gitea/assets/51889757/164d5d20-728d-4365-9cb5-c37e95857cdf)

![grafik](https://github.com/go-gitea/gitea/assets/51889757/90bfffd2-abd4-4847-b8e2-db4231700a6d)
2023-10-02 14:52:18 +00:00
wxiaoguang caef9f9503
Fix git 2.11 error when checking IsEmpty (#27393)
Fix #27389
2023-10-02 22:05:21 +08:00
24601 624c0ba920
fix: comment typo (#27388)
fix a typo in the comment
2023-10-02 08:31:03 +00:00
Lunny Xiao 439a0cca2c
Test more templates for if they contain an error (#27367) 2023-10-02 07:56:55 +00:00
wxiaoguang e4313feefd
Document the line-number counting behavior (#27386)
Ref #27377
2023-10-02 07:23:18 +00:00
Lunny Xiao 4999d909a6
Remove upgrade from Gogs doc because the diverse has been 7 years and the code base changed totally (#27387)
The documentation becomes no help since that but make people confusing.
2023-10-02 14:53:55 +08:00
Ayaka 79e1f27eda
Fix incorrect Chinese translation of linked-references.zh-cn.md (#27382)
---

The original text "To address this" should be translated to "为了解决这个问题".
"工单" looks like corresponds to "issue".
2023-10-02 06:13:08 +00:00
Denys Konovalov 33de64cb21
link to file from its history (#27354)
Fixes #3852
Fixes https://github.com/go-gitea/gitea/issues/26707

Add a button on file history which directs you to the file at the
selected commit.

Co-authored-by: silverwind <me@silverwind.io>
2023-10-02 04:04:32 +00:00
Earl Warren cb68e01e22
simplify issue deletion query (#27312)
- There's no need for `In` to be used, as it's a single parameter that's
being passed.

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

(cherry picked from commit 4a4955f43a)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-10-02 02:30:10 +00:00
GiteaBot c9cc57f130 [skip ci] Updated licenses and gitignores 2023-10-02 00:23:46 +00:00
merlleu a112cf34d3
Cargo package - Fix missing domain in cargo sparse url (#27370)
Hello, it seems that one my previous PR (adding the sparse index to the
cargo package content page), did not worked as expected: the
gitea-origin-url does not add the AppURL because of the `sparse+` prefix
in the url.
Currently the rendered page gives the following:
```toml
[registry]
default = "gitea"

[registries.gitea]
index = "sparse+/api/packages/ownername/cargo/" # Sparse index
# index = "https://git.example.com/ownername/_cargo-index.git" # Git

[net]
git-fetch-with-cli = true
```
2023-10-01 13:43:15 +00:00
puni9869 50070550a8
Hide archived labels when filtering by labels on the issue list (#27115)
Followup  https://github.com/go-gitea/gitea/pull/26820
## Archived labels UI for issue filter and issue filter actions for
issues/pull request pages.

Changed:
* Enhanced the Issue filter and Issue filter actions UI page to
seamlessly incorporate a list of archived labels.
* Pagination functionality is same as before. If archived label checkbox
is checked then we are adding a query string`archived=true` in the url
to save the state of page.
* Issue filter actions menu is separated into different template.
* Adding the archived flag in issue url labels.
* Pull Request page is also work the same.

Outsourced:
* Defer the implementation of specialized handling for archived labels
to upcoming pull requests. This step will be undertaken subsequent to
the successful merge of this pull request.

Screenshots
### Issue page
<img width="1360" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/d7efb2ef-5b2b-449d-83f0-d430a32ec432">

### Issue page with label filter on archived label checkbox when not
checked --> No archived label is there in list
<img width="1249" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/ceea68ef-91f2-4693-910f-2e25e236bfc9">

### Issue page with label filter on archived label checkbox when checked
--> Show archived label in the list.
<img width="710" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2414d26b-2079-4c3c-bd9e-f2f5411bcabf">

### Issue page with label filter on issue action menu on archived label
checkbox when checked --> Show archived label in the list.
<img width="409" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/259cac87-3e21-4778-99a2-a6a0b8c81178">


### Applied the archived=true in Issue labels when archived checkbox is
checked.
<img width="984" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/657ce3db-c0ae-402e-b12d-3b580d3c2ed0">

---




Part of https://github.com/go-gitea/gitea/issues/25237

---------

Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-10-01 09:04:39 -04:00
CaiCandong 87aa552531
Fix unexpected context canceled when migrating repository (#27368)
Fix #27363

Regression of #27089
2023-10-01 12:04:35 +00:00
CaiCandong 7ad31567cd
Fix ldap admin privileges update bug (#27051)
When the user does not set a username lookup condition, LDAP will get an
empty string `""` for the user, hence the following code
```
if isExist, err := user_model.IsUserExist(db.DefaultContext, 0, sr.Username)
```
The user presence determination will always be nonexistent, so updates
to user information will never be performed.


Fix #27049
2023-10-01 11:32:12 +00:00
Lunny Xiao 6e87a44034
Allow get release download files and lfs files with oauth2 token format (#26430)
Fix #26165
Fix #25257
2023-10-01 10:41:52 +00:00
CaiCandong 6b65c41ebf
Fix missing ctx for GetRepoLink in dashboard (#27372)
As title
Fix #27369
Regression of #27265
2023-10-01 09:26:28 +00:00
Denys Konovalov 4ab597f479
highlight user details link (#26998)
This PR adds a separated column in the users table for operations. The
username link now redirects back to user page.


![grafik](https://github.com/go-gitea/gitea/assets/47871822/df8c8b30-3da6-443c-ae0f-6e3cac7dd9bb)

Resolves
https://github.com/go-gitea/gitea/pull/26713#pullrequestreview-1603001285

Co-authored-by: silverwind <me@silverwind.io>
2023-10-01 11:58:24 +08:00
silverwind 83f571628d
Feed UI Improvements (#27356)
Various improvements related to feeds:

- Fix markdown rendering
- Increase font size from 13px to default 14px via `flex-item`
- Add style to hashes
- Move the timestamp to title line. I realize it's not optimal for
translation, we may need to change all these translations

Before:
<img width="768" alt="Screenshot 2023-09-29 at 22 52 58"
src="https://github.com/go-gitea/gitea/assets/115237/edda8b84-23cf-4a43-90ad-a892798f4e6c">

After:
<img width="781" alt="Screenshot 2023-09-29 at 22 58 09"
src="https://github.com/go-gitea/gitea/assets/115237/7097474d-efcf-4f22-a2ab-834a4e25c4e8">
2023-09-30 15:48:34 +00:00
Rafael Heard 4cb51cb985
Absolute positioned checkboxes overlay floated elements (#26870)
Currently, checkboxes are positioned as absolute. This positioning
causes the input to overlay an element that has been floated within the
editor. Floated elements are useful if you want your text to wrap around
this element. This PR fixes the overlaying of checkboxes by removing the
absolute positioning, updating the `ul` padding, and
displaying`.task-list-item` `flex` to ensure inputs and the associated
label are on the same line.

Screenshots:

Before:
<img width="762" alt="Screenshot 2023-09-01 at 3 40 59 PM"
src="https://github.com/go-gitea/gitea/assets/6152817/570247c7-7f5c-4697-bfc9-ad4655e37991">

After:
<img width="762" alt="Screenshot 2023-09-01 at 3 42 20 PM"
src="https://github.com/go-gitea/gitea/assets/6152817/db53df45-1294-4eee-84c0-b21ac4fdf805">

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
2023-09-30 09:30:44 +00:00
Lunny Xiao 7d14aa062f
Fix template bug (#27362)
Fix #27361
2023-09-30 17:03:04 +08:00
GiteaBot 4f169e4b47 [skip ci] Updated translations via Crowdin 2023-09-30 00:22:01 +00:00
yp05327 393193a3e0
Fix repo count in org action settings (#27245)
Only in org action settings, repo count is missing

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/4a74c090-c55f-4f06-810a-c390337efa9d)

![image](https://github.com/go-gitea/gitea/assets/18380374/e234f7e7-178c-4186-bbc0-0f291192b011)

![image](https://github.com/go-gitea/gitea/assets/18380374/c1db70cd-973b-40d5-ba17-1f354aed9149)
In other setting page:

![image](https://github.com/go-gitea/gitea/assets/18380374/43bfec6b-a1a4-48a9-8280-ab6f967b7ec4)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/9a697bd8-ce9f-40e2-8749-b46726d68d84)

![image](https://github.com/go-gitea/gitea/assets/18380374/3b6d1e59-64dd-4655-953b-064718e6aa7a)

![image](https://github.com/go-gitea/gitea/assets/18380374/5604c063-556c-4252-8778-4e5a5e23b7e1)
2023-09-29 15:46:07 +00:00
Panagiotis "Ivory" Vasilopoulos 65e09a303e
Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803)
This change introduces a fix for the PR #26214 to set the UserLocationMapURL correctly.
2023-09-29 14:57:06 +00:00
Lunny Xiao c3b7231966
Add protected branch name description (#27257)
Co-authored-by: delvh <dev.lh@web.de>
2023-09-29 14:02:35 +00:00
6543 2a2b0cb1d2
rename TotalTimes() to TotalTimesForEachUser() (#27261)
make function name more descriptive as it would otherwise imply it could
be used for e.g. #26672 too ...

---
*Sponsored by Kithara Software GmbH*
2023-09-29 13:04:14 +00:00
JakobDev cf0df023be
More `db.DefaultContext` refactor (#27265)
Part of #27065

This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.
2023-09-29 12:12:54 +00:00
yp05327 3945c26722
Improve tree not found page (#26570)
Before:

![before](https://github.com/go-gitea/gitea/assets/18380374/383822d5-7d77-4ec3-b49b-4ab1e8b167ce)

After:

![after](https://github.com/go-gitea/gitea/assets/18380374/32afa0a3-fa05-4087-b96e-7d067f0ed756)

In Github:
https://github.com/yp05327/test/blob/main/test.drawio

Updated:
UI changed

![image](https://github.com/go-gitea/gitea/assets/18380374/41ed07ff-b815-4b4e-9779-5ab36b5f3980)

![image](https://github.com/go-gitea/gitea/assets/18380374/5d7b28d6-a2fc-4d4c-8d6d-d93f9c9a270b)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-09-29 07:42:39 +00:00
Marcin Kuźmiński 89fa8f9896
Update comparison page with RhodeCode CE & EE (#27329)
Update RhodeCode features and add EE version
2023-09-29 13:31:54 +08:00
Lunny Xiao 968be05bcc
Add logs for data broken of comment review (#27326)
Fix #27306
2023-09-29 02:31:36 +00:00
Dmitry Sharshakov 5e02e3b7ee
Add support for forking single branch (#25821)
Fixes #25117

Add UI for choosing branch to fork

Change default branch on single-branch forks


![image](https://github.com/go-gitea/gitea/assets/19504461/28505f69-a9a2-43a8-8b19-a0cdac3ddc5a)

---------

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-09-29 09:48:39 +08:00
GiteaBot e8840e7e2b [skip ci] Updated translations via Crowdin 2023-09-29 00:23:01 +00:00
Nanguan Lin 15a504cb9f
Fix the approval count of PR when there is no protection branch rule (#27272)
As title

![ksnip_20230926-115158](https://github.com/go-gitea/gitea/assets/70063547/a60be44a-06ad-421e-ba27-e4e0adfa5db7)
2023-09-28 23:24:36 +00:00
JakobDev 9d9cebc5e7
Add Index to `comment.dependent_issue_id` (#27325)
This Column is missing index. It is used by
[issue_service.deleteIssue](7ea2a910ce/services/issue/issue.go (L300)).

Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-28 22:58:35 +02:00
Zettat123 3fcad582c9
Improvements of releases list and tags list (#25859)
Follow #23465 and #25624

This PR introduces the following improvements:
- We do not need to call `GetTags` to get tags because tags have been
loaded by `RepoAssignment`

ef90fdbd1d/modules/context/repo.go (L663-L668)
- Similarly, the number of tags and releases also have been loaded by
`RepoAssignment`, so the related code has been removed from the
handlers. The query condition of `GetReleaseCountByRepoID` in
`RepoAssignment` has been changed to include draft releases.

ef90fdbd1d/modules/context/repo.go (L538-L551)
- `releasesOrTags` function has been removed. The code for rendering
releases list and tags list moved to `Releases` and `TagList`
respectively.
2023-09-28 13:21:47 +00:00
JakobDev 1c039b4e1e
Fix Bug in Issue Config when only contact links are set (#26521)
Blank Issues should be enabled if they are not explicit disabled through
the `blank_issues_enabled` field of the Issue Config. The Implementation
has currently a Bug: If you create a Issue Config file with only
`contact_links` and without a `blank_issues_enabled` field,
`blank_issues_enabled` is set to false by default.

The fix is only one line, but I decided to also improve the tests to
make sure there are no other problems with the Implementation.

This is a bugfix, so it should be backported to 1.20.
2023-09-28 20:16:40 +08:00
wxiaoguang 1f00bc44b2
Fix review UI (#27322)
Close #26730


1. The `diff-detail-box` was abused, it shouldn't be used for
"DiffFileList/DiffFileTree".
2. Fix the sticky position for various screens.



![image](https://github.com/go-gitea/gitea/assets/2114189/558a5c06-c94c-4e5c-8395-d38473dd21c2)


![image](https://github.com/go-gitea/gitea/assets/2114189/3390fb0e-7dc7-457f-bd0c-398fdb6d24c0)


![image](https://github.com/go-gitea/gitea/assets/2114189/d19dd350-aecf-4909-8ef9-73b09d94560e)
2023-09-28 10:00:26 +00:00
wxiaoguang 72c68177ab
Improve issue history dialog and make poster can delete their own history (#27323)
Fix #27313 (see the comment)

And some UI improvements:

### Before


![image](https://github.com/go-gitea/gitea/assets/2114189/420a314d-8f34-4e30-a557-f41cf4f0d2f2)


![image](https://github.com/go-gitea/gitea/assets/2114189/60ca0be4-b55e-4e65-be73-fd53e0d4fc36)


### After


![image](https://github.com/go-gitea/gitea/assets/2114189/d354f815-5a0c-4e63-8d59-d03ed344dbea)


![image](https://github.com/go-gitea/gitea/assets/2114189/6ef437a4-aa6f-4917-a260-00625ee71e79)


![image](https://github.com/go-gitea/gitea/assets/2114189/9d88a36c-616b-4dc9-8c6b-76adaad8acf6)
2023-09-28 08:43:20 +00:00
wxiaoguang 7ea2a910ce
Improve branch list UI (#27319)
1. Put the `"octicon-shield-lock"` into the flex container, then it
doesn't need a separate flex box
2. Remove some unnecessary `gt-df` helpers
3. Make `btn` button has the same flex behavior as `ui button`


![image](https://github.com/go-gitea/gitea/assets/2114189/60ce75f7-7fac-4157-9c42-91c7dee9300e)



![image](https://github.com/go-gitea/gitea/assets/2114189/ea606baf-6f52-41e1-b964-c4840d3b1529)
2023-09-28 04:04:32 +00:00
6543 15fa0383fb
doctor: delete action entries without existing user (#27292)
just extend doctor with a usefully check :)

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-09-28 03:03:08 +00:00
Earl Warren 98f02203f9
fix orphan check for deleted branch (#27310)
- Modify the deleted branch orphan check to check for the new table
instead.
- Regression from 6e19484f4d
- Resolves https://codeberg.org/forgejo/forgejo/issues/1522

(cherry picked from commit c1d888686f)

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-09-28 02:07:33 +00:00
Lunny Xiao 673cf6af76
make writing main test easier (#27270)
This PR removed `unittest.MainTest` the second parameter
`TestOptions.GiteaRoot`. Now it detects the root directory by current
working directory.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-09-28 01:38:53 +00:00
GiteaBot e74a3b18af [skip ci] Updated translations via Crowdin 2023-09-28 00:22:57 +00:00
yp05327 e5e1d842c0
Fix protected branch icon location (#26576) 2023-09-27 22:21:31 +00:00
Nanguan Lin 70f8d10fc5
move the `gitea admin` subcommands into separate files (#27307)
As title.
Probably it's better to put those sub cmd to different dirs. Will do
that in the future.
2023-09-27 12:25:38 +00:00
Lunny Xiao 5600504eed
Fix chinese translation (#27296)
Fix translation from #27291 
Source Map will be kept as English in Chinese usage habit.
2023-09-27 08:15:12 +00:00
techknowlogick 9e446dbf04
bump bleve (#27300)
Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-09-27 07:10:58 +00:00
Lunny Xiao 3b2da7e4ae
Redefine the meaning of column is_active to make Actions Registration Token generation easier (#27143)
Partially Fix #25041

This PR redefined the meaning of column `is_active` in table
`action_runner_token`.
Before this PR, `is_active` means whether it has been used by any
runner. If it's true, other runner cannot use it to register again.

In this PR, `is_active` means whether it's validated to be used to
register runner. And if it's true, then it can be used to register
runners until it become false. When creating a new `is_active` register
token, any previous tokens will be set `is_active` to false.
2023-09-27 05:37:48 +00:00
silverwind ee27b94b2c
Use vitest globals (#27102)
Enable [globals](https://vitest.dev/config/#globals) in vitest, reducing
the noise in test files.
2023-09-27 04:37:13 +00:00
yp05327 5ef5a0ade6
Fix divider in subscription page (#27298)
the divider should always display in the subscription page.

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2023-09-27 04:00:57 +00:00
Lunny Xiao e59c9e3ecd
Fix yaml test (#27297) 2023-09-26 23:30:03 -04:00
silverwind c5247eff73
Enable production source maps for index.js, fix CSS sourcemaps (#27291)
Previously, the production build never output sourcemaps. Now we emit
one file for `index.js` because it is the most likely one where we need
to be able to better debug reported issues like
https://github.com/go-gitea/gitea/issues/27213. This will currently
increase the binary size of gitea by around 700kB which is what the
gzipped source map file has.

Also, I fixed the CSS sourcemap generation which was broken since the
introduction of lightningcss.
2023-09-26 22:05:49 -04:00
wxiaoguang 6967c13ad2
Fix some animation bugs (#27287)
Fix #27286
Replace #27279
2023-09-27 01:15:58 +00:00
silverwind 709c2fad8a
Add missed return to actions view fetch (#27289)
Should fix: #27213
2023-09-27 08:34:52 +08:00
Lunny Xiao eab20cb6bd
Fix more yaml lint errors (#27284)
Fix #27268
2023-09-26 12:56:42 -04:00
delvh 1f89a45926
Fix incorrect change from #27231 (#27275) 2023-09-26 13:10:29 +00:00
wxiaoguang 939d410a93
Add missing IconHTML size (#27269)
Fix #27223

Regression of #27122
2023-09-26 19:59:04 +08:00
wxiaoguang d0012c8806
Document the queue item's marshaling behavior (#27271)
Close #26843
2023-09-26 13:58:57 +08:00
GiteaBot 3f82ca38af [skip ci] Updated translations via Crowdin 2023-09-26 00:23:08 +00:00
JakobDev 7047df36d4
Another round of `db.DefaultContext` refactor (#27103)
Part of #27065

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-09-25 13:17:37 +00:00
wxiaoguang 93bd4351bf
Fix more "locale" usages (#27259) 2023-09-25 20:42:40 +08:00
delvh 7960ba7e2b
Always use `ctx.Locale.Tr` inside templates (#27231) 2023-09-25 08:56:50 +00:00
Yarden Shoham e6d8b14620
Disable `Test Delivery` and `Replay` webhook buttons when webhook is inactive (#27211)
These buttons are now disabled when the webhook is not active.

The buttons were always enabled before this change.

- Fixes #26824
- Replaces #26814

# Before


![image](https://github.com/go-gitea/gitea/assets/20454870/e783d0d8-b433-440e-b95f-50d7c42613d3)


![image](https://github.com/go-gitea/gitea/assets/20454870/b4886151-9f32-4e83-8001-dd3f20c23d70)

# After


![image](https://github.com/go-gitea/gitea/assets/20454870/74b76a72-0818-4143-8548-5d42c4119a05)


![image](https://github.com/go-gitea/gitea/assets/20454870/d5ae4e5c-c1ac-4751-a072-e6f7511b1e07)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2023-09-25 07:33:00 +00:00
yp05327 65d0b7c13a
Add missing public user visibility in user details page (#27246)
It seems that `Public` user visibility is missing in the template.

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/a8e7f3e0-1b77-41a0-921a-10adba90211e)

After:

![image](https://github.com/go-gitea/gitea/assets/18380374/b0bffe13-0ca6-453e-95d7-0794528d5733)
2023-09-25 08:27:03 +02:00
silverwind 6af34c09a7
Use mask-based fade-out effect for `.new-menu` (#27181)
The `.new-menu` was using a pseudo-element based fade-out effect.
Replace this with a more modern mask-based effect which in this case
required a child element to avoid fading out the background as well, so
I applied it to child `new-menu-inner` which was present on all these
menus except explore where I added it.

There is no visual difference except that the items on the explore page
have no `gap` between them any longer, making it consistent with other
menus. Before and after:

<img width="221" alt="Screenshot 2023-09-21 at 21 13 19"
src="https://github.com/go-gitea/gitea/assets/115237/b4a38ce2-cee1-4c54-84a5-e1d0bfd79e29">
<img width="222" alt="Screenshot 2023-09-21 at 21 32 36"
src="https://github.com/go-gitea/gitea/assets/115237/bb6b1335-d935-4ad4-bb85-3b0fc3027c2b">

Also, this cleans up the related CSS vars:

- `--color-header-wrapper-transparent` is removed, no longer needed
- `--color-header-wrapper` is defined in base theme as well, was
previously unset and therefor transparent.

[no whitespace
diff](https://github.com/go-gitea/gitea/pull/27181/files?diff=unified&w=1)
[demo of mask fade](https://jsfiddle.net/silverwind/tsfadb3u/)
2023-09-25 01:03:00 +00:00
GiteaBot c2eed61329 [skip ci] Updated translations via Crowdin 2023-09-25 00:24:48 +00:00
silverwind a50002c75c
Fix z-index on markdown completion (#27237)
Fixes: https://github.com/go-gitea/gitea/issues/27230
2023-09-25 01:29:36 +02:00
techknowlogick 0816463cf4
Update database-preparation and add note re: MariaDB (#27232)
update DB docs per feedback.
https://gitea.com/gitea/gitea-docusaurus/issues/69
2023-09-24 21:24:17 +00:00
Denys Konovalov 2325fe777d
cleanup locale function usage (#27227) 2023-09-24 20:31:58 +00:00
silverwind 3a187eace5
Fix EOL handling in web editor (#27141)
Fixes https://github.com/go-gitea/gitea/issues/27136.

This does the following for Monaco's EOL setting:

1. Use editorconfig setting if present
2. Use the file's dominant line ending as detected by monaco, which uses
LF for empty file
2023-09-24 19:51:02 +00:00
Nabapadma-sarker 8e23524b18
Fix PushEvent NullPointerException jenkinsci/github-plugin (#27203)
Fixes #27202
2023-09-24 19:02:47 +00:00
Denys Konovalov 63b25e816d
fix issues on action runners page (#27226)
- switch from some weird status badge to label
- translate untranslated `Reset registration token` string
- change documentation link from act_runner README to Gitea Docs site
- fix "No runners available" message width
- use `ctx.Locale.Tr` where possible


![grafik](https://github.com/go-gitea/gitea/assets/47871822/65547228-f9ed-4f80-9cfd-df5e55513a44)
2023-09-24 14:12:21 -04:00
wxiaoguang efd5176278
Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225)
Fix #27224

And add the case to the devtest page.
2023-09-24 21:07:57 +08:00
delvh da0467e3b6
Update go-enry to 2.8.5 (#27215)
Fixes #27214
2023-09-23 13:09:01 -04:00
silverwind 6e2888ce27
Update nodejs installation method in release container (#27207) 2023-09-23 13:18:47 +00:00
KN4CK3R bcb78e70ca
Quote table `release` in sql queries (#27205)
Fixes #27174

`release` is a reserved keyword in MySql. I can't reproduce the issue on
my setup and we have a test for that code but it seems there can be
setups where it fails.


a101dbaa79/tests/integration/repo_activity_test.go (L45-L46)
2023-09-23 12:57:39 +00:00
Daniel Kilimnik 0ee7cbf725
Fix push mirror, wrong timestamp format (#27153)
I noticed, that the push mirrors endpoint, is the only endpoint which
returns the times in long format rather than as time.Time().

I think the behavior should be consistent across the project.

----

## ⚠️ BREAKING ⚠️

This PR changes the time format used in API responses for all
push_mirror endpoints which return a push mirror.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-23 12:15:05 +00:00
JakobDev 5f7388e586
Allow copying issue comment link on archived repos and when not logged in (#27193)
Fixes https://codeberg.org/Codeberg/Community/issues/1303
2023-09-23 11:31:54 +00:00
metiftikci 6c563a302a
fix: text decorator on issue sidebar menu label (#27206)
fix underline for label on issue sidebar
2023-09-23 18:51:23 +08:00
silverwind a101dbaa79
Update JS and Poetry dependencies and eslint (#27200)
- Update all JS and Poetry dependencies
- Remove deprecated `eslint-plugin-custom-elements` and replace it with
rules from `eslint-plugin-wc`
- Add a convenience `make update` to update both js and py dependencies
- Tested markdown toolbar, swagger and citation
2023-09-22 22:51:48 +02:00
wxiaoguang c0ed26f987
Remove some dead code (#27196)
Some code is not in use any more, remove them.
2023-09-22 23:30:31 +08:00
GiteaBot 383edf2fd7 [skip ci] Updated translations via Crowdin 2023-09-22 00:22:57 +00:00
JakobDev 28f9b313ba
Updates to the API for archived repos (#27149) 2023-09-21 23:43:29 +00:00
John Olheiser 7520cd678c
Fix release URL in webhooks (#27182) 2023-09-21 17:55:09 -05:00
wxiaoguang 1f026bcb7e
Fix dropdown icon position (#27175)
According to https://fomantic-ui.com/modules/dropdown.html and our
"devtest" page, many dropdown elements has incorrect "icon" position.

This PR fixes all of them. Fix #27173
2023-09-21 15:54:26 +00:00
wxiaoguang c2cabe7b28
Fix repo sub menu (#27169)
Fix #27166
2023-09-21 21:16:14 +08:00
Nanguan Lin 2f8e1604f8
Fix review request number and add more tests (#27104)
fix #27019 
## testfixture yml
1. add issue20(a pr issue) in repo 23, org 17
2. add user15 to team 9
3. add four reviews about issue20
## test case
add two tests that are described with code comments
the code before pr #26784 failed the first test
<img width="479" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/1d9b5787-11b4-4c4d-931f-6a9869547f35">
current code failed the second test(as mentioned in #27019)
<img width="484" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/05608055-7587-43d1-bae1-92c688270819">
Any advice is appreciated.

---------

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-09-21 13:59:50 +02:00
Nanguan Lin 218e719ea8
Fix the variable regexp pattern on web page (#27161)
same as (https://github.com/go-gitea/gitea/pull/26910)
2023-09-21 09:03:13 +00:00
Dionysios Kakouris e46274b5b4
Fix organization field being null in POST /orgs/{orgid}/teams (#27150)
Similarly to the fix in https://github.com/go-gitea/gitea/pull/24694,
this addresses the team creation not returning the organization
information in the response.

This fix is connected to the
[issue](https://gitea.com/gitea/terraform-provider-gitea/issues/27)
discovered in the terraform provider.
Moreover, the
[documentation](https://docs.gitea.com/api/1.20/#tag/organization/operation/orgCreateTeam)
suggests that the response body should include the `organization` field
(currently being `null`).
2023-09-21 08:09:59 +00:00
JakobDev 14731a34ff
Add index to `issue_user.issue_id` (#27154)
This fixes a performance bottleneck. It was discovered by Codeberg.
Every where query on that table (which has grown big over time) uses
this column, but there is no index on it.

See this part of the log which was posted on Matrix:
```
2023/09/10 00:52:01 ...rs/web/repo/issue.go:1446:ViewIssue() [W] [Slow SQL Query] UPDATE `issue_user` SET is_read=? WHERE uid=? AND issue_id=? [true x y] - 51.395434887s
2023/09/10 00:52:01 ...rs/web/repo/issue.go:1447:ViewIssue() [E] ReadBy: Error 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
2023/09/10 00:52:01 ...eb/routing/logger.go:102:func1() [I] router: completed GET /Codeberg/Community/issues/1201 for [::ffff:xxx]:0, 500 Internal Server Error in 52384.2ms @ repo/issue.go:1256(repo.ViewIssue)
```
2023-09-21 01:30:48 +00:00
GiteaBot 2001ffee3f [skip ci] Updated translations via Crowdin 2023-09-21 00:22:27 +00:00
delvh d7f73a1334
Start development on Gitea 1.22 (#27155) 2023-09-20 22:18:53 +01:00
3600 changed files with 144990 additions and 105482 deletions

View File

@ -2,12 +2,25 @@ root = "."
tmp_dir = ".air"
[build]
pre_cmd = ["killall -9 gitea 2>/dev/null || true"] # kill off potential zombie processes from previous runs
cmd = "make --no-print-directory backend"
bin = "gitea"
delay = 1000
delay = 2000
include_ext = ["go", "tmpl"]
include_file = ["main.go"]
include_dir = ["cmd", "models", "modules", "options", "routers", "services"]
exclude_dir = ["modules/git/tests", "services/gitdiff/testdata", "modules/avatar/testdata", "models/fixtures", "models/migrations/fixtures", "modules/migration/file_format_testdata", "modules/avatar/identicon/testdata"]
exclude_dir = [
"models/fixtures",
"models/migrations/fixtures",
"modules/avatar/identicon/testdata",
"modules/avatar/testdata",
"modules/git/tests",
"modules/migration/file_format_testdata",
"modules/markup/tests/repo/repo1_filepreview",
"routers/private/tests",
"services/gitdiff/testdata",
"services/migrations/testdata",
"services/webhook/sourcehut/testdata",
]
exclude_regex = ["_test.go$", "_gen.go$"]
stop_on_error = true

View File

@ -1,61 +0,0 @@
# The full repository name
repo: go-gitea/gitea
# Service type (gitea or github)
service: github
# Base URL for Gitea instance if using gitea service type (optional)
# Default: https://gitea.com
base-url:
# Changelog groups and which labeled PRs to add to each group
groups:
-
name: BREAKING
labels:
- kind/breaking
-
name: SECURITY
labels:
- kind/security
-
name: FEATURES
labels:
- kind/feature
-
name: API
labels:
- kind/api
-
name: ENHANCEMENTS
labels:
- kind/enhancement
- kind/refactor
- kind/ui
-
name: BUGFIXES
labels:
- kind/bug
-
name: TESTING
labels:
- kind/testing
-
name: TRANSLATION
labels:
- kind/translation
-
name: BUILD
labels:
- kind/build
- kind/lint
-
name: DOCS
labels:
- kind/docs
-
name: MISC
default: true
# regex indicating which labels to skip for the changelog
skip-labels: skip-changelog|backport\/.+

353
.deadcode-out Normal file
View File

@ -0,0 +1,353 @@
package "code.gitea.io/gitea/cmd"
func NoMainListener
package "code.gitea.io/gitea/cmd/forgejo"
func ContextSetNoInit
func ContextSetNoExit
func ContextSetStderr
func ContextGetStderr
func ContextSetStdout
func ContextSetStdin
package "code.gitea.io/gitea/models"
func IsErrUpdateTaskNotExist
func (ErrUpdateTaskNotExist).Error
func (ErrUpdateTaskNotExist).Unwrap
func IsErrSHANotFound
func IsErrMergeDivergingFastForwardOnly
func GetYamlFixturesAccess
package "code.gitea.io/gitea/models/actions"
func (ScheduleList).GetUserIDs
func (ScheduleList).GetRepoIDs
func (ScheduleList).LoadTriggerUser
func (ScheduleList).LoadRepos
package "code.gitea.io/gitea/models/asymkey"
func (ErrGPGKeyAccessDenied).Error
func (ErrGPGKeyAccessDenied).Unwrap
func HasDeployKey
package "code.gitea.io/gitea/models/auth"
func GetSourceByName
func GetWebAuthnCredentialByID
func WebAuthnCredentials
package "code.gitea.io/gitea/models/db"
func TruncateBeans
func InTransaction
func DumpTables
package "code.gitea.io/gitea/models/dbfs"
func (*file).renameTo
func Create
func Rename
package "code.gitea.io/gitea/models/forgefed"
func GetFederationHost
package "code.gitea.io/gitea/models/forgejo/semver"
func GetVersion
func SetVersionString
func SetVersion
package "code.gitea.io/gitea/models/git"
func RemoveDeletedBranchByID
package "code.gitea.io/gitea/models/issues"
func IsErrUnknownDependencyType
func (ErrNewIssueInsert).Error
func IsErrIssueWasClosed
func ChangeMilestoneStatus
package "code.gitea.io/gitea/models/migrations/base"
func removeAllWithRetry
func newXORMEngine
func deleteDB
func PrepareTestEnv
func MainTest
package "code.gitea.io/gitea/models/organization"
func GetTeamNamesByID
func UpdateTeamUnits
func (SearchMembersOptions).ToConds
func UsersInTeamsCount
package "code.gitea.io/gitea/models/perm/access"
func GetRepoWriters
package "code.gitea.io/gitea/models/project"
func UpdateBoardSorting
func ChangeProjectStatus
package "code.gitea.io/gitea/models/repo"
func DeleteAttachmentsByIssue
func (*releaseSorter).Len
func (*releaseSorter).Less
func (*releaseSorter).Swap
func SortReleases
func FindReposMapByIDs
func (SearchOrderBy).String
func IsErrTopicNotExist
func (ErrTopicNotExist).Error
func (ErrTopicNotExist).Unwrap
func GetTopicByName
func WatchRepoMode
package "code.gitea.io/gitea/models/unittest"
func CheckConsistencyFor
func checkForConsistency
func GetXORMEngine
func OverrideFixtures
func InitFixtures
func LoadFixtures
func Copy
func CopyDir
func NewMockWebServer
func NormalizedFullPath
func FixturesDir
func fatalTestError
func InitSettings
func MainTest
func CreateTestEngine
func PrepareTestDatabase
func PrepareTestEnv
func Cond
func OrderBy
func LoadBeanIfExists
func BeanExists
func AssertExistsAndLoadBean
func GetCount
func AssertNotExistsBean
func AssertExistsIf
func AssertSuccessfulInsert
func AssertCount
func AssertInt64InRange
package "code.gitea.io/gitea/models/user"
func IsErrPrimaryEmailCannotDelete
func (ErrUserInactive).Error
func (ErrUserInactive).Unwrap
func IsErrExternalLoginUserAlreadyExist
func IsErrExternalLoginUserNotExist
func NewFederatedUser
func IsErrUserSettingIsNotExist
func GetUserAllSettings
func DeleteUserSetting
func GetUserEmailsByNames
func GetUserNamesByIDs
package "code.gitea.io/gitea/modules/activitypub"
func (*Client).Post
package "code.gitea.io/gitea/modules/assetfs"
func Bindata
package "code.gitea.io/gitea/modules/auth/password/hash"
func (*DummyHasher).HashWithSaltBytes
func NewDummyHasher
package "code.gitea.io/gitea/modules/auth/password/pwn"
func WithHTTP
package "code.gitea.io/gitea/modules/base"
func SetupGiteaRoot
package "code.gitea.io/gitea/modules/cache"
func GetInt
func WithNoCacheContext
func RemoveContextData
package "code.gitea.io/gitea/modules/charset"
func (*BreakWriter).Write
package "code.gitea.io/gitea/modules/emoji"
func ReplaceCodes
package "code.gitea.io/gitea/modules/eventsource"
func (*Event).String
package "code.gitea.io/gitea/modules/forgefed"
func NewForgeLike
func GetItemByType
func JSONUnmarshalerFn
func NotEmpty
func ToRepository
func OnRepository
package "code.gitea.io/gitea/modules/git"
func AllowLFSFiltersArgs
func AddChanges
func AddChangesWithArgs
func CommitChanges
func CommitChangesWithArgs
func IsErrExecTimeout
func (ErrExecTimeout).Error
func (ErrUnsupportedVersion).Error
func SetUpdateHook
func openRepositoryWithDefaultContext
func IsTagExist
func ToEntryMode
func (*LimitedReaderCloser).Read
func (*LimitedReaderCloser).Close
package "code.gitea.io/gitea/modules/gitgraph"
func (*Parser).Reset
package "code.gitea.io/gitea/modules/gitrepo"
func GetBranchCommitID
func GetWikiDefaultBranch
package "code.gitea.io/gitea/modules/graceful"
func (*Manager).TerminateContext
func (*Manager).Err
func (*Manager).Value
func (*Manager).Deadline
package "code.gitea.io/gitea/modules/hcaptcha"
func WithHTTP
package "code.gitea.io/gitea/modules/json"
func (StdJSON).Marshal
func (StdJSON).Unmarshal
func (StdJSON).NewEncoder
func (StdJSON).NewDecoder
func (StdJSON).Indent
package "code.gitea.io/gitea/modules/markup"
func IsSameDomain
func GetRendererByType
func RenderString
func IsMarkupFile
package "code.gitea.io/gitea/modules/markup/console"
func Render
func RenderString
package "code.gitea.io/gitea/modules/markup/markdown"
func IsDetails
func IsSummary
func IsTaskCheckBoxListItem
func IsIcon
func RenderRawString
package "code.gitea.io/gitea/modules/markup/markdown/math"
func WithInlineDollarParser
func WithBlockDollarParser
package "code.gitea.io/gitea/modules/markup/mdstripper"
func StripMarkdown
package "code.gitea.io/gitea/modules/markup/orgmode"
func RenderString
package "code.gitea.io/gitea/modules/private"
func ActionsRunnerRegister
package "code.gitea.io/gitea/modules/process"
func (*Manager).ExecTimeout
package "code.gitea.io/gitea/modules/queue"
func newBaseChannelSimple
func newBaseChannelUnique
func newBaseRedisSimple
func newBaseRedisUnique
func newWorkerPoolQueueForTest
package "code.gitea.io/gitea/modules/queue/lqinternal"
func QueueItemIDBytes
func QueueItemKeyBytes
func ListLevelQueueKeys
package "code.gitea.io/gitea/modules/setting"
func NewConfigProviderFromData
func (*GitConfigType).GetOption
func InitLoggersForTest
package "code.gitea.io/gitea/modules/storage"
func (ErrInvalidConfiguration).Error
func IsErrInvalidConfiguration
package "code.gitea.io/gitea/modules/structs"
func ParseCreateHook
func ParsePushHook
package "code.gitea.io/gitea/modules/sync"
func (*StatusTable).Start
func (*StatusTable).IsRunning
package "code.gitea.io/gitea/modules/testlogger"
func (*testLoggerWriterCloser).pushT
func (*testLoggerWriterCloser).Log
func (*testLoggerWriterCloser).recordError
func (*testLoggerWriterCloser).printMsg
func (*testLoggerWriterCloser).popT
func (*testLoggerWriterCloser).Reset
func PrintCurrentTest
func Printf
func NewTestLoggerWriter
func (*TestLogEventWriter).Base
func (*TestLogEventWriter).GetLevel
func (*TestLogEventWriter).GetWriterName
func (*TestLogEventWriter).GetWriterType
func (*TestLogEventWriter).Run
package "code.gitea.io/gitea/modules/timeutil"
func GetExecutableModTime
func MockSet
func MockUnset
package "code.gitea.io/gitea/modules/translation"
func (MockLocale).Language
func (MockLocale).TrString
func (MockLocale).Tr
func (MockLocale).TrN
func (MockLocale).TrSize
func (MockLocale).PrettyNumber
package "code.gitea.io/gitea/modules/util/filebuffer"
func CreateFromReader
package "code.gitea.io/gitea/modules/validation"
func IsErrNotValid
package "code.gitea.io/gitea/modules/web"
func RouteMock
func RouteMockReset
package "code.gitea.io/gitea/modules/web/middleware"
func DeleteLocaleCookie
package "code.gitea.io/gitea/routers/web"
func NotFound
package "code.gitea.io/gitea/routers/web/org"
func MustEnableProjects
package "code.gitea.io/gitea/services/context"
func GetPrivateContext
package "code.gitea.io/gitea/services/convert"
func ToSecret
package "code.gitea.io/gitea/services/forms"
func (*DeadlineForm).Validate
package "code.gitea.io/gitea/services/pull"
func IsCommitStatusContextSuccess
package "code.gitea.io/gitea/services/repository"
func IsErrForkAlreadyExist
package "code.gitea.io/gitea/services/repository/archiver"
func ArchiveRepository
package "code.gitea.io/gitea/services/repository/files"
func (*ContentType).String
func GetFileResponseFromCommit
func (*TemporaryUploadRepository).GetLastCommit
func (*TemporaryUploadRepository).GetLastCommitByRef
package "code.gitea.io/gitea/services/webhook"
func NewNotifier

View File

@ -1,14 +1,16 @@
{
"name": "Gitea DevContainer",
"image": "mcr.microsoft.com/devcontainers/go:1.21-bullseye",
"image": "mcr.microsoft.com/devcontainers/go:1.22-bullseye",
"features": {
// installs nodejs into container
"ghcr.io/devcontainers/features/node:1": {
"version":"20"
"version": "20"
},
"ghcr.io/devcontainers/features/git-lfs:1.1.0": {},
"ghcr.io/devcontainers/features/git-lfs:1.2.0": {},
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
"ghcr.io/devcontainers/features/python:1": {}
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
}
},
"customizations": {
"vscode": {
@ -22,7 +24,7 @@
"DavidAnson.vscode-markdownlint",
"Vue.volar",
"ms-azuretools.vscode-docker",
"zixuanchen.vitest-explorer",
"vitest.explorer",
"qwtel.sqlite-viewer",
"GitHub.vscode-pull-request-github"
]

View File

@ -14,7 +14,7 @@ _test
# MS VSCode
.vscode
__debug_bin
__debug_bin*
# Architecture specific extensions/prefixes
*.[568vq]
@ -62,7 +62,6 @@ cpu.out
/data
/indexers
/log
/public/img/avatar
/tests/integration/gitea-integration-*
/tests/integration/indexers-*
/tests/e2e/gitea-e2e-*
@ -71,14 +70,13 @@ cpu.out
/tests/e2e/test-artifacts
/tests/e2e/test-snapshots
/tests/*.ini
/node_modules
/yarn.lock
/yarn-error.log
/npm-debug.log*
/public/assets/js
/public/assets/css
/public/assets/fonts
/public/assets/img/webpack
/public/assets/img/avatar
/vendor
/web_src/fomantic/node_modules
/web_src/fomantic/build/*
@ -96,6 +94,9 @@ cpu.out
/.air
/.go-licenses
# Files and folders that were previously generated
/public/assets/img/webpack
# Snapcraft
snap/.snapcraft/
parts/

View File

@ -1,425 +0,0 @@
---
kind: pipeline
name: release-version
platform:
os: linux
arch: amd64
workspace:
base: /source
path: /
trigger:
event:
- tag
volumes:
- name: deps
temp: {}
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: deps-frontend
image: node:20
pull: always
commands:
- make deps-frontend
- name: deps-backend
image: gitea/test_env:linux-1.20-amd64
pull: always
commands:
- make deps-backend
volumes:
- name: deps
path: /go
- name: static
image: techknowlogick/xgo:go-1.21.x
pull: always
commands:
- curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get -qqy install nodejs
- export PATH=$PATH:$GOPATH/bin
- make release
environment:
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
TAGS: bindata sqlite sqlite_unlock_notify
DEBIAN_FRONTEND: noninteractive
depends_on: [fetch-tags]
volumes:
- name: deps
path: /go
- name: gpg-sign
image: plugins/gpgsign:1
pull: always
settings:
detach_sign: true
excludes:
- "dist/release/*.sha256"
files:
- "dist/release/*"
environment:
GPGSIGN_KEY:
from_secret: gpgsign_key
GPGSIGN_PASSPHRASE:
from_secret: gpgsign_passphrase
depends_on: [static]
- name: release-tag
image: woodpeckerci/plugin-s3:latest
pull: always
settings:
acl:
from_secret: aws_s3_acl
region:
from_secret: aws_s3_region
bucket:
from_secret: aws_s3_bucket
endpoint:
from_secret: aws_s3_endpoint
path_style:
from_secret: aws_s3_path_style
source: "dist/release/*"
strip_prefix: dist/release/
target: "/gitea/${DRONE_TAG##v}"
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
depends_on: [gpg-sign]
- name: github
image: plugins/github-release:latest
pull: always
settings:
files:
- "dist/release/*"
file_exists: overwrite
environment:
GITHUB_TOKEN:
from_secret: github_token
depends_on: [gpg-sign]
---
kind: pipeline
type: docker
name: docker-linux-amd64-release-version
platform:
os: linux
arch: amd64
trigger:
ref:
include:
- "refs/tags/**"
exclude:
- "refs/tags/**-rc*"
paths:
exclude:
- "docs/**"
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: publish
image: plugins/docker:latest
pull: always
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
- name: publish-rootless
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: true
auto_tag_suffix: linux-amd64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-linux-amd64-release-candidate-version
platform:
os: linux
arch: amd64
trigger:
ref:
- "refs/tags/**-rc*"
paths:
exclude:
- "docs/**"
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: publish
image: plugins/docker:latest
pull: always
settings:
tags: ${DRONE_TAG##v}-linux-amd64
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
- name: publish-rootless
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
tags: ${DRONE_TAG##v}-linux-amd64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-linux-arm64-release-version
platform:
os: linux
arch: arm64
trigger:
ref:
include:
- "refs/tags/**"
exclude:
- "refs/tags/**-rc*"
paths:
exclude:
- "docs/**"
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: publish
image: plugins/docker:latest
pull: always
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
- name: publish-rootless
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
auto_tag: true
auto_tag_suffix: linux-arm64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-linux-arm64-release-candidate-version
platform:
os: linux
arch: arm64
trigger:
ref:
- "refs/tags/**-rc*"
paths:
exclude:
- "docs/**"
steps:
- name: fetch-tags
image: docker:git
pull: always
commands:
- git fetch --tags --force
- name: publish
image: plugins/docker:latest
pull: always
settings:
tags: ${DRONE_TAG##v}-linux-arm64
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
- name: publish-rootless
image: plugins/docker:latest
settings:
dockerfile: Dockerfile.rootless
tags: ${DRONE_TAG##v}-linux-arm64-rootless
repo: gitea/gitea
build_args:
- GOPROXY=https://goproxy.io
password:
from_secret: docker_password
username:
from_secret: docker_username
environment:
PLUGIN_MIRROR:
from_secret: plugin_mirror
DOCKER_BUILDKIT: 1
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: docker-manifest-version
platform:
os: linux
arch: amd64
steps:
- name: manifest-rootless
image: plugins/manifest
pull: always
settings:
auto_tag: true
ignore_missing: true
spec: docker/manifest.rootless.tmpl
password:
from_secret: docker_password
username:
from_secret: docker_username
- name: manifest
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
spec: docker/manifest.tmpl
password:
from_secret: docker_password
username:
from_secret: docker_username
trigger:
ref:
- "refs/tags/**"
paths:
exclude:
- "docs/**"
depends_on:
- docker-linux-amd64-release-version
- docker-linux-amd64-release-candidate-version
- docker-linux-arm64-release-version
- docker-linux-arm64-release-candidate-version

View File

@ -9,7 +9,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{go,tmpl,html}]
[{*.{go,tmpl,html},Makefile,go.mod}]
indent_style = tab
[templates/custom/*.tmpl]
@ -21,8 +21,8 @@ indent_style = space
[templates/user/auth/oidc_wellknown.tmpl]
indent_style = space
[Makefile]
indent_style = tab
[*.svg]
insert_final_newline = false
[options/locale/locale_*.ini]
insert_final_newline = false

View File

@ -3,6 +3,8 @@ reportUnusedDisableDirectives: true
ignorePatterns:
- /web_src/js/vendor
- /web_src/fomantic
- /public/assets/js
parserOptions:
sourceType: module
@ -10,15 +12,18 @@ parserOptions:
plugins:
- "@eslint-community/eslint-plugin-eslint-comments"
- "@stylistic/eslint-plugin-js"
- eslint-plugin-array-func
- eslint-plugin-custom-elements
- eslint-plugin-import
- eslint-plugin-github
- eslint-plugin-i
- eslint-plugin-jquery
- eslint-plugin-no-jquery
- eslint-plugin-no-use-extend-native
- eslint-plugin-regexp
- eslint-plugin-sonarjs
- eslint-plugin-unicorn
- eslint-plugin-vitest
- eslint-plugin-vitest-globals
- eslint-plugin-wc
env:
@ -39,13 +44,62 @@ overrides:
worker: true
rules:
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
- files: ["build/generate-images.js"]
rules:
import/no-unresolved: [0]
import/no-extraneous-dependencies: [0]
- files: ["*.config.*"]
rules:
import/no-unused-modules: [0]
i/no-unused-modules: [0]
- files: ["**/*.test.*", "web_src/js/test/setup.js"]
env:
vitest-globals/env: true
rules:
vitest/consistent-test-filename: [0]
vitest/consistent-test-it: [0]
vitest/expect-expect: [0]
vitest/max-expects: [0]
vitest/max-nested-describe: [0]
vitest/no-alias-methods: [0]
vitest/no-commented-out-tests: [0]
vitest/no-conditional-expect: [0]
vitest/no-conditional-in-test: [0]
vitest/no-conditional-tests: [0]
vitest/no-disabled-tests: [0]
vitest/no-done-callback: [0]
vitest/no-duplicate-hooks: [0]
vitest/no-focused-tests: [0]
vitest/no-hooks: [0]
vitest/no-identical-title: [2]
vitest/no-interpolation-in-snapshots: [0]
vitest/no-large-snapshots: [0]
vitest/no-mocks-import: [0]
vitest/no-restricted-matchers: [0]
vitest/no-restricted-vi-methods: [0]
vitest/no-standalone-expect: [0]
vitest/no-test-prefixes: [0]
vitest/no-test-return-statement: [0]
vitest/prefer-called-with: [0]
vitest/prefer-comparison-matcher: [0]
vitest/prefer-each: [0]
vitest/prefer-equality-matcher: [0]
vitest/prefer-expect-resolves: [0]
vitest/prefer-hooks-in-order: [0]
vitest/prefer-hooks-on-top: [2]
vitest/prefer-lowercase-title: [0]
vitest/prefer-mock-promise-shorthand: [0]
vitest/prefer-snapshot-hint: [0]
vitest/prefer-spy-on: [0]
vitest/prefer-strict-equal: [0]
vitest/prefer-to-be: [0]
vitest/prefer-to-be-falsy: [0]
vitest/prefer-to-be-object: [0]
vitest/prefer-to-be-truthy: [0]
vitest/prefer-to-contain: [0]
vitest/prefer-to-have-length: [0]
vitest/prefer-todo: [0]
vitest/require-hook: [0]
vitest/require-to-throw-message: [0]
vitest/require-top-level-describe: [0]
vitest/valid-describe-callback: [2]
vitest/valid-expect: [2]
vitest/valid-title: [2]
- files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"]
rules:
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
@ -60,11 +114,74 @@ rules:
"@eslint-community/eslint-comments/no-unused-enable": [2]
"@eslint-community/eslint-comments/no-use": [0]
"@eslint-community/eslint-comments/require-description": [0]
"@stylistic/js/array-bracket-newline": [0]
"@stylistic/js/array-bracket-spacing": [2, never]
"@stylistic/js/array-element-newline": [0]
"@stylistic/js/arrow-parens": [2, always]
"@stylistic/js/arrow-spacing": [2, {before: true, after: true}]
"@stylistic/js/block-spacing": [0]
"@stylistic/js/brace-style": [2, 1tbs, {allowSingleLine: true}]
"@stylistic/js/comma-dangle": [2, always-multiline]
"@stylistic/js/comma-spacing": [2, {before: false, after: true}]
"@stylistic/js/comma-style": [2, last]
"@stylistic/js/computed-property-spacing": [2, never]
"@stylistic/js/dot-location": [2, property]
"@stylistic/js/eol-last": [2]
"@stylistic/js/function-call-spacing": [2, never]
"@stylistic/js/function-call-argument-newline": [0]
"@stylistic/js/function-paren-newline": [0]
"@stylistic/js/generator-star-spacing": [0]
"@stylistic/js/implicit-arrow-linebreak": [0]
"@stylistic/js/indent": [2, 2, {ignoreComments: true, SwitchCase: 1}]
"@stylistic/js/key-spacing": [2]
"@stylistic/js/keyword-spacing": [2]
"@stylistic/js/linebreak-style": [2, unix]
"@stylistic/js/lines-around-comment": [0]
"@stylistic/js/lines-between-class-members": [0]
"@stylistic/js/max-len": [0]
"@stylistic/js/max-statements-per-line": [0]
"@stylistic/js/multiline-ternary": [0]
"@stylistic/js/new-parens": [2]
"@stylistic/js/newline-per-chained-call": [0]
"@stylistic/js/no-confusing-arrow": [0]
"@stylistic/js/no-extra-parens": [0]
"@stylistic/js/no-extra-semi": [2]
"@stylistic/js/no-floating-decimal": [0]
"@stylistic/js/no-mixed-operators": [0]
"@stylistic/js/no-mixed-spaces-and-tabs": [2]
"@stylistic/js/no-multi-spaces": [2, {ignoreEOLComments: true, exceptions: {Property: true}}]
"@stylistic/js/no-multiple-empty-lines": [2, {max: 1, maxEOF: 0, maxBOF: 0}]
"@stylistic/js/no-tabs": [2]
"@stylistic/js/no-trailing-spaces": [2]
"@stylistic/js/no-whitespace-before-property": [2]
"@stylistic/js/nonblock-statement-body-position": [2]
"@stylistic/js/object-curly-newline": [0]
"@stylistic/js/object-curly-spacing": [2, never]
"@stylistic/js/object-property-newline": [0]
"@stylistic/js/one-var-declaration-per-line": [0]
"@stylistic/js/operator-linebreak": [2, after]
"@stylistic/js/padded-blocks": [2, never]
"@stylistic/js/padding-line-between-statements": [0]
"@stylistic/js/quote-props": [0]
"@stylistic/js/quotes": [2, single, {avoidEscape: true, allowTemplateLiterals: true}]
"@stylistic/js/rest-spread-spacing": [2, never]
"@stylistic/js/semi": [2, always, {omitLastInOneLineBlock: true}]
"@stylistic/js/semi-spacing": [2, {before: false, after: true}]
"@stylistic/js/semi-style": [2, last]
"@stylistic/js/space-before-blocks": [2, always]
"@stylistic/js/space-before-function-paren": [2, {anonymous: ignore, named: never, asyncArrow: always}]
"@stylistic/js/space-in-parens": [2, never]
"@stylistic/js/space-infix-ops": [2]
"@stylistic/js/space-unary-ops": [2]
"@stylistic/js/spaced-comment": [2, always]
"@stylistic/js/switch-colon-spacing": [2]
"@stylistic/js/template-curly-spacing": [2, never]
"@stylistic/js/template-tag-spacing": [2, never]
"@stylistic/js/wrap-iife": [2, inside]
"@stylistic/js/wrap-regex": [0]
"@stylistic/js/yield-star-spacing": [2, after]
accessor-pairs: [2]
array-bracket-newline: [0]
array-bracket-spacing: [2, never]
array-callback-return: [2, {checkForEach: true}]
array-element-newline: [0]
array-func/avoid-reverse: [2]
array-func/from-map: [2]
array-func/no-unnecessary-this-arg: [2]
@ -72,117 +189,112 @@ rules:
array-func/prefer-flat-map: [0] # handled by unicorn/prefer-array-flat-map
array-func/prefer-flat: [0] # handled by unicorn/prefer-array-flat
arrow-body-style: [0]
arrow-parens: [2, always]
arrow-spacing: [2, {before: true, after: true}]
block-scoped-var: [2]
brace-style: [2, 1tbs, {allowSingleLine: true}]
camelcase: [0]
capitalized-comments: [0]
class-methods-use-this: [0]
comma-dangle: [2, only-multiline]
comma-spacing: [2, {before: false, after: true}]
comma-style: [2, last]
complexity: [0]
computed-property-spacing: [2, never]
consistent-return: [0]
consistent-this: [0]
constructor-super: [2]
curly: [0]
custom-elements/expose-class-on-global: [0]
custom-elements/extends-correct-class: [2]
custom-elements/file-name-matches-element: [2]
custom-elements/no-constructor: [2]
custom-elements/no-customized-built-in-elements: [2]
custom-elements/no-dom-traversal-in-attributechangedcallback: [2]
custom-elements/no-dom-traversal-in-connectedcallback: [2]
custom-elements/no-exports-with-element: [2]
custom-elements/no-method-prefixed-with-on: [2]
custom-elements/no-unchecked-define: [0]
custom-elements/one-element-per-file: [0]
custom-elements/tag-name-matches-class: [2]
custom-elements/valid-tag-name: [2]
default-case-last: [2]
default-case: [0]
default-param-last: [0]
dot-location: [2, property]
dot-notation: [0]
eol-last: [2]
eqeqeq: [2]
for-direction: [2]
func-call-spacing: [2, never]
func-name-matching: [2]
func-names: [0]
func-style: [0]
function-call-argument-newline: [0]
function-paren-newline: [0]
generator-star-spacing: [0]
getter-return: [2]
github/a11y-aria-label-is-well-formatted: [0]
github/a11y-no-title-attribute: [0]
github/a11y-no-visually-hidden-interactive-element: [0]
github/a11y-role-supports-aria-props: [0]
github/a11y-svg-has-accessible-name: [0]
github/array-foreach: [0]
github/async-currenttarget: [2]
github/async-preventdefault: [2]
github/authenticity-token: [0]
github/get-attribute: [0]
github/js-class-name: [0]
github/no-blur: [0]
github/no-d-none: [0]
github/no-dataset: [2]
github/no-dynamic-script-tag: [2]
github/no-implicit-buggy-globals: [2]
github/no-inner-html: [0]
github/no-innerText: [2]
github/no-then: [2]
github/no-useless-passive: [2]
github/prefer-observers: [2]
github/require-passive-events: [2]
github/unescaped-html-literal: [0]
grouped-accessor-pairs: [2]
guard-for-in: [0]
id-blacklist: [0]
id-length: [0]
id-match: [0]
implicit-arrow-linebreak: [0]
import/consistent-type-specifier-style: [0]
import/default: [0]
import/dynamic-import-chunkname: [0]
import/export: [2]
import/exports-last: [0]
import/extensions: [2, always, {ignorePackages: true}]
import/first: [2]
import/group-exports: [0]
import/max-dependencies: [0]
import/named: [2]
import/namespace: [0]
import/newline-after-import: [0]
import/no-absolute-path: [0]
import/no-amd: [2]
import/no-anonymous-default-export: [0]
import/no-commonjs: [2]
import/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
import/no-default-export: [0]
import/no-deprecated: [0]
import/no-dynamic-require: [0]
import/no-empty-named-blocks: [2]
import/no-extraneous-dependencies: [2]
import/no-import-module-exports: [0]
import/no-internal-modules: [0]
import/no-mutable-exports: [0]
import/no-named-as-default-member: [0]
import/no-named-as-default: [2]
import/no-named-default: [0]
import/no-named-export: [0]
import/no-namespace: [0]
import/no-nodejs-modules: [0]
import/no-relative-packages: [0]
import/no-relative-parent-imports: [0]
import/no-restricted-paths: [0]
import/no-self-import: [2]
import/no-unassigned-import: [0]
import/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/]}]
import/no-unused-modules: [2, {unusedExports: true}]
import/no-useless-path-segments: [2, {commonjs: true}]
import/no-webpack-loader-syntax: [2]
import/order: [0]
import/prefer-default-export: [0]
import/unambiguous: [0]
indent: [2, 2, {SwitchCase: 1}]
i/consistent-type-specifier-style: [0]
i/default: [0]
i/dynamic-import-chunkname: [0]
i/export: [2]
i/exports-last: [0]
i/extensions: [2, always, {ignorePackages: true}]
i/first: [2]
i/group-exports: [0]
i/max-dependencies: [0]
i/named: [2]
i/namespace: [0]
i/newline-after-import: [0]
i/no-absolute-path: [0]
i/no-amd: [2]
i/no-anonymous-default-export: [0]
i/no-commonjs: [2]
i/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
i/no-default-export: [0]
i/no-deprecated: [0]
i/no-dynamic-require: [0]
i/no-empty-named-blocks: [2]
i/no-extraneous-dependencies: [2]
i/no-import-module-exports: [0]
i/no-internal-modules: [0]
i/no-mutable-exports: [0]
i/no-named-as-default-member: [0]
i/no-named-as-default: [2]
i/no-named-default: [0]
i/no-named-export: [0]
i/no-namespace: [0]
i/no-nodejs-modules: [0]
i/no-relative-packages: [0]
i/no-relative-parent-imports: [0]
i/no-restricted-paths: [0]
i/no-self-import: [2]
i/no-unassigned-import: [0]
i/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$", ^vitest/]}]
i/no-unused-modules: [2, {unusedExports: true}]
i/no-useless-path-segments: [2, {commonjs: true}]
i/no-webpack-loader-syntax: [2]
i/order: [0]
i/prefer-default-export: [0]
i/unambiguous: [0]
init-declarations: [0]
jquery/no-ajax-events: [2]
jquery/no-ajax: [0]
jquery/no-ajax: [2]
jquery/no-animate: [2]
jquery/no-attr: [0]
jquery/no-attr: [2]
jquery/no-bind: [2]
jquery/no-class: [0]
jquery/no-clone: [2]
jquery/no-closest: [0]
jquery/no-css: [0]
jquery/no-css: [2]
jquery/no-data: [0]
jquery/no-deferred: [2]
jquery/no-delegate: [2]
jquery/no-each: [0]
jquery/no-extend: [2]
jquery/no-fade: [0]
jquery/no-fade: [2]
jquery/no-filter: [0]
jquery/no-find: [0]
jquery/no-global-eval: [2]
@ -193,23 +305,23 @@ rules:
jquery/no-in-array: [2]
jquery/no-is-array: [2]
jquery/no-is-function: [2]
jquery/no-is: [0]
jquery/no-is: [2]
jquery/no-load: [2]
jquery/no-map: [0]
jquery/no-map: [2]
jquery/no-merge: [2]
jquery/no-param: [2]
jquery/no-parent: [0]
jquery/no-parents: [0]
jquery/no-parents: [2]
jquery/no-parse-html: [2]
jquery/no-prop: [0]
jquery/no-prop: [2]
jquery/no-proxy: [2]
jquery/no-ready: [2]
jquery/no-serialize: [2]
jquery/no-show: [2]
jquery/no-size: [2]
jquery/no-sizzle: [0]
jquery/no-slide: [0]
jquery/no-submit: [0]
jquery/no-slide: [2]
jquery/no-submit: [2]
jquery/no-text: [0]
jquery/no-toggle: [2]
jquery/no-trigger: [0]
@ -217,27 +329,17 @@ rules:
jquery/no-val: [0]
jquery/no-when: [2]
jquery/no-wrap: [2]
key-spacing: [2]
keyword-spacing: [2]
line-comment-position: [0]
linebreak-style: [2, unix]
lines-around-comment: [0]
lines-between-class-members: [0]
logical-assignment-operators: [0]
max-classes-per-file: [0]
max-depth: [0]
max-len: [0]
max-lines-per-function: [0]
max-lines: [0]
max-nested-callbacks: [0]
max-params: [0]
max-statements-per-line: [0]
max-statements: [0]
multiline-comment-style: [2, separate-lines]
multiline-ternary: [0]
new-cap: [0]
new-parens: [2]
newline-per-chained-call: [0]
no-alert: [0]
no-array-constructor: [2]
no-async-promise-executor: [0]
@ -249,7 +351,6 @@ rules:
no-class-assign: [2]
no-compare-neg-zero: [2]
no-cond-assign: [2, except-parens]
no-confusing-arrow: [0]
no-console: [1, {allow: [debug, info, warn, error]}]
no-const-assign: [2]
no-constant-binary-expression: [2]
@ -279,10 +380,7 @@ rules:
no-extra-bind: [2]
no-extra-boolean-cast: [2]
no-extra-label: [0]
no-extra-parens: [0]
no-extra-semi: [2]
no-fallthrough: [2]
no-floating-decimal: [0]
no-func-assign: [2]
no-global-assign: [2]
no-implicit-coercion: [2]
@ -296,12 +394,12 @@ rules:
no-irregular-whitespace: [2]
no-iterator: [2]
no-jquery/no-ajax-events: [2]
no-jquery/no-ajax: [0]
no-jquery/no-ajax: [2]
no-jquery/no-and-self: [2]
no-jquery/no-animate-toggle: [2]
no-jquery/no-animate: [2]
no-jquery/no-append-html: [0]
no-jquery/no-attr: [0]
no-jquery/no-append-html: [2]
no-jquery/no-attr: [2]
no-jquery/no-bind: [2]
no-jquery/no-box-model: [2]
no-jquery/no-browser: [2]
@ -313,7 +411,7 @@ rules:
no-jquery/no-constructor-attributes: [2]
no-jquery/no-contains: [2]
no-jquery/no-context-prop: [2]
no-jquery/no-css: [0]
no-jquery/no-css: [2]
no-jquery/no-data: [0]
no-jquery/no-deferred: [2]
no-jquery/no-delegate: [2]
@ -344,14 +442,14 @@ rules:
no-jquery/no-is-numeric: [2]
no-jquery/no-is-plain-object: [2]
no-jquery/no-is-window: [2]
no-jquery/no-is: [0]
no-jquery/no-is: [2]
no-jquery/no-jquery-constructor: [0]
no-jquery/no-live: [2]
no-jquery/no-load-shorthand: [2]
no-jquery/no-load: [2]
no-jquery/no-map-collection: [0]
no-jquery/no-map-util: [2]
no-jquery/no-map: [0]
no-jquery/no-map: [2]
no-jquery/no-merge: [2]
no-jquery/no-node-name: [2]
no-jquery/no-noop: [2]
@ -361,12 +459,12 @@ rules:
no-jquery/no-other-utils: [2]
no-jquery/no-param: [2]
no-jquery/no-parent: [0]
no-jquery/no-parents: [0]
no-jquery/no-parents: [2]
no-jquery/no-parse-html-literal: [0]
no-jquery/no-parse-html: [2]
no-jquery/no-parse-json: [2]
no-jquery/no-parse-xml: [2]
no-jquery/no-prop: [0]
no-jquery/no-prop: [2]
no-jquery/no-proxy: [2]
no-jquery/no-ready-shorthand: [2]
no-jquery/no-ready: [2]
@ -387,7 +485,7 @@ rules:
no-jquery/no-visibility: [2]
no-jquery/no-when: [2]
no-jquery/no-wrap: [2]
no-jquery/variable-pattern: [0]
no-jquery/variable-pattern: [2]
no-label-var: [2]
no-labels: [0] # handled by no-restricted-syntax
no-lone-blocks: [2]
@ -396,10 +494,7 @@ rules:
no-loss-of-precision: [2]
no-magic-numbers: [0]
no-misleading-character-class: [2]
no-mixed-operators: [0]
no-mixed-spaces-and-tabs: [2]
no-multi-assign: [0]
no-multi-spaces: [2, {ignoreEOLComments: true, exceptions: {Property: true}}]
no-multi-str: [2]
no-negated-condition: [0]
no-nested-ternary: [0]
@ -433,19 +528,17 @@ rules:
no-shadow-restricted-names: [2]
no-shadow: [0]
no-sparse-arrays: [2]
no-tabs: [2]
no-template-curly-in-string: [2]
no-ternary: [0]
no-this-before-super: [2]
no-throw-literal: [2]
no-trailing-spaces: [2]
no-undef-init: [2]
no-undef: [2, {typeof: true}]
no-undefined: [0]
no-underscore-dangle: [0]
no-unexpected-multiline: [2]
no-unmodified-loop-condition: [2]
no-unneeded-ternary: [0]
no-unneeded-ternary: [2]
no-unreachable-loop: [2]
no-unreachable: [2]
no-unsafe-finally: [2]
@ -468,33 +561,25 @@ rules:
no-var: [2]
no-void: [2]
no-warning-comments: [0]
no-whitespace-before-property: [2]
no-with: [0] # handled by no-restricted-syntax
nonblock-statement-body-position: [2]
object-curly-newline: [0]
object-curly-spacing: [2, never]
object-shorthand: [2, always]
one-var-declaration-per-line: [0]
one-var: [0]
operator-assignment: [2, always]
operator-linebreak: [2, after]
padded-blocks: [2, never]
padding-line-between-statements: [0]
prefer-arrow-callback: [2, {allowNamedFunctions: true, allowUnboundThis: true}]
prefer-const: [2, {destructuring: all, ignoreReadBeforeAssign: true}]
prefer-destructuring: [0]
prefer-exponentiation-operator: [2]
prefer-named-capture-group: [0]
prefer-numeric-literals: [2]
prefer-object-has-own: [0]
prefer-object-has-own: [2]
prefer-object-spread: [2]
prefer-promise-reject-errors: [2, {allowEmptyReject: false}]
prefer-regex-literals: [2]
prefer-rest-params: [2]
prefer-spread: [2]
prefer-template: [2]
quote-props: [0]
quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}]
radix: [2, as-needed]
regexp/confusing-quantifier: [2]
regexp/control-character-escape: [2]
@ -511,6 +596,7 @@ rules:
regexp/no-empty-character-class: [0]
regexp/no-empty-group: [2]
regexp/no-empty-lookarounds-assertion: [2]
regexp/no-empty-string-literal: [2]
regexp/no-escape-backspace: [2]
regexp/no-extra-lookaround-assertions: [0]
regexp/no-invalid-regexp: [2]
@ -541,6 +627,8 @@ rules:
regexp/no-useless-non-capturing-group: [2]
regexp/no-useless-quantifier: [2]
regexp/no-useless-range: [2]
regexp/no-useless-set-operand: [2]
regexp/no-useless-string-literal: [2]
regexp/no-useless-two-nums-quantifier: [2]
regexp/no-zero-quantifier: [2]
regexp/optimal-lookaround-quantifier: [2]
@ -560,10 +648,12 @@ rules:
regexp/prefer-regexp-exec: [2]
regexp/prefer-regexp-test: [2]
regexp/prefer-result-array-groups: [0]
regexp/prefer-set-operation: [2]
regexp/prefer-star-quantifier: [2]
regexp/prefer-unicode-codepoint-escapes: [2]
regexp/prefer-w: [0]
regexp/require-unicode-regexp: [0]
regexp/simplify-set-operations: [2]
regexp/sort-alternatives: [0]
regexp/sort-character-class-elements: [0]
regexp/sort-flags: [0]
@ -574,10 +664,6 @@ rules:
require-await: [0]
require-unicode-regexp: [0]
require-yield: [2]
rest-spread-spacing: [2, never]
semi-spacing: [2, {before: false, after: true}]
semi-style: [2, last]
semi: [2, always, {omitLastInOneLineBlock: true}]
sonarjs/cognitive-complexity: [0]
sonarjs/elseif-without-else: [0]
sonarjs/max-switch-cases: [0]
@ -613,16 +699,8 @@ rules:
sort-imports: [0]
sort-keys: [0]
sort-vars: [0]
space-before-blocks: [2, always]
space-in-parens: [2, never]
space-infix-ops: [2]
space-unary-ops: [2]
spaced-comment: [2, always]
strict: [0]
switch-colon-spacing: [2]
symbol-description: [2]
template-curly-spacing: [2, never]
template-tag-spacing: [2, never]
unicode-bom: [2, never]
unicorn/better-regex: [0]
unicorn/catch-error-name: [0]
@ -639,12 +717,14 @@ rules:
unicorn/import-style: [0]
unicorn/new-for-builtins: [2]
unicorn/no-abusive-eslint-disable: [0]
unicorn/no-anonymous-default-export: [0]
unicorn/no-array-callback-reference: [0]
unicorn/no-array-for-each: [2]
unicorn/no-array-method-this-argument: [2]
unicorn/no-array-push-push: [2]
unicorn/no-array-reduce: [2]
unicorn/no-await-expression-member: [0]
unicorn/no-await-in-promise-methods: [2]
unicorn/no-console-spaces: [0]
unicorn/no-document-cookie: [2]
unicorn/no-empty-file: [2]
@ -661,11 +741,13 @@ rules:
unicorn/no-null: [0]
unicorn/no-object-as-default-parameter: [0]
unicorn/no-process-exit: [0]
unicorn/no-single-promise-in-promise-methods: [2]
unicorn/no-static-only-class: [2]
unicorn/no-thenable: [2]
unicorn/no-this-assignment: [2]
unicorn/no-typeof-undefined: [2]
unicorn/no-unnecessary-await: [2]
unicorn/no-unnecessary-polyfills: [2]
unicorn/no-unreadable-array-destructuring: [0]
unicorn/no-unreadable-iife: [2]
unicorn/no-unused-properties: [2]
@ -740,15 +822,25 @@ rules:
valid-typeof: [2, {requireStringLiterals: true}]
vars-on-top: [0]
wc/attach-shadow-constructor: [2]
wc/define-tag-after-class-definition: [0]
wc/expose-class-on-global: [0]
wc/file-name-matches-element: [2]
wc/guard-define-call: [0]
wc/guard-super-call: [2]
wc/max-elements-per-file: [0]
wc/no-child-traversal-in-attributechangedcallback: [2]
wc/no-child-traversal-in-connectedcallback: [2]
wc/no-closed-shadow-root: [2]
wc/no-constructor-attributes: [2]
wc/no-constructor-params: [2]
wc/no-invalid-element-name: [0] # covered by custom-elements/valid-tag-name
wc/no-constructor: [2]
wc/no-customized-built-in-elements: [2]
wc/no-exports-with-element: [0]
wc/no-invalid-element-name: [2]
wc/no-invalid-extends: [2]
wc/no-method-prefixed-with-on: [2]
wc/no-self-class: [2]
wc/no-typos: [2]
wc/require-listener-teardown: [2]
wrap-iife: [2, inside]
wrap-regex: [0]
yield-star-spacing: [2, after]
wc/tag-name-matches-class: [2]
yoda: [2, never]

View File

@ -0,0 +1,33 @@
#!/bin/bash
set -ex
end_to_end=$1
end_to_end_pr=$2
forgejo=$3
forgejo_pr_or_ref=$4
cd $forgejo
full_version=$(make show-version-full)
minor_version=$(make show-version-minor)
cd $end_to_end
if ! test -f forgejo/sources/$minor_version ; then
echo "FAIL: forgejo/sources/$minor_version does not exist in the end-to-end repository"
false
fi
date > last-upgrade
if test -f "$forgejo_pr_or_ref" ; then
forgejo_pr=$forgejo_pr_or_ref
head_url=$(jq --raw-output .head.repo.html_url < $forgejo_pr)
test "$head_url" != null
branch=$(jq --raw-output .head.ref < $forgejo_pr)
test "$branch" != null
echo $head_url $branch $full_version > forgejo/sources/$minor_version
else
forgejo_ref=$forgejo_pr_or_ref
echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY ${forgejo_ref#refs/heads/} $full_version > forgejo/sources/$minor_version
fi

View File

@ -0,0 +1,22 @@
#!/bin/bash
set -ex
end_to_end=$1
end_to_end_pr=$2
forgejo=$3
forgejo_ref=$4
cd $end_to_end
date > last-upgrade
organizations=lib/ORGANIZATIONS
if ! test -f $organizations ; then
echo "$organizations file not found"
false
fi
#
# do not include forgejo-experimental so that 7.0-test is found
# in forgejo-integration where it was just built instead of
# forgejo-experimental which was published by the previous build
#
echo forgejo forgejo-integration > $organizations

View File

@ -0,0 +1,6 @@
FROM code.forgejo.org/oci/alpine:3.20
ARG RELEASE_VERSION=unkown
LABEL maintainer="contact@forgejo.org" \
org.opencontainers.image.version="${RELEASE_VERSION}"
RUN mkdir -p /app/gitea
RUN ( echo '#!/bin/sh' ; echo "echo forgejo v$RELEASE_VERSION" ) > /app/gitea/gitea ; chmod +x /app/gitea/gitea

View File

@ -0,0 +1,5 @@
VERSION ?= $(shell cat VERSION 2>/dev/null)
sources-tarbal:
mkdir -p dist/release
echo $(VERSION) > VERSION
sources=forgejo-src-$(VERSION).tar.gz ; tar --transform 's|^./|forgejo-src-$(VERSION)/|' -czf dist/release/forgejo-src-$(VERSION).tar.gz . ; cd dist/release ; shasum -a 256 $$sources > $$sources.sha256

View File

@ -0,0 +1,57 @@
# Copyright 2024 The Forgejo Authors
# SPDX-License-Identifier: MIT
#
# To modify this workflow:
#
# - change pull_request_target: to pull_request:
# so that it runs from a pull request instead of the default branch
#
# - push it to the wip-ci-backport branch on the forgejo repository
# otherwise it will not have access to the secrets required to push
# the PR
#
# - open a pull request targetting wip-ci-backport that includes a change
# that can be backported without conflict in v1.21 and set the
# `backport/v1.21` label.
#
# - once it works, open a pull request for the sake of keeping track
# of the change even if the PR won't run it because it will use
# whatever is in the default branch instead
#
# - after it is merged, double check it works by setting a
# `backport/v1.21` label on a merged pull request that can be backported
# without conflict.
#
on:
pull_request_target:
types:
- closed
- labeled
jobs:
backporting:
if: >
!startsWith(vars.ROLE, 'forgejo-') && (
github.event.pull_request.merged
&&
contains(toJSON(github.event.pull_request.labels), 'backport/v')
)
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- name: event info
run: |
cat <<'EOF'
${{ toJSON(github) }}
EOF
- uses: https://code.forgejo.org/actions/git-backporting@v4.8.0
with:
target-branch-pattern: "^backport/(?<target>(v.*))$"
strategy: ort
strategy-option: find-renames
cherry-pick-options: -x
auth: ${{ secrets.BACKPORT_TOKEN }}
pull-request: ${{ github.event.pull_request.url }}
auto-no-squash: true
enable-err-notification: true

View File

@ -0,0 +1,135 @@
name: Integration tests for the release process
on:
push:
paths:
- Makefile
- Dockerfile
- Dockerfile.rootless
- docker/**
- .forgejo/workflows/build-release.yml
- .forgejo/workflows/build-release-integration.yml
branches-ignore:
- renovate/**
pull_request:
paths:
- Makefile
- Dockerfile
- Dockerfile.rootless
- docker/**
- .forgejo/workflows/build-release.yml
- .forgejo/workflows/build-release-integration.yml
jobs:
release-simulation:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v1
with:
user: root
password: admin1234
image-version: 1.21
lxc-ip-prefix: 10.0.9
- name: publish the forgejo release
shell: bash
run: |
set -x
cat > /etc/docker/daemon.json <<EOF
{
"insecure-registries" : ["${{ steps.forgejo.outputs.host-port }}"]
}
EOF
systemctl restart docker
apt-get install -qq -y xz-utils
dir=$(mktemp -d)
trap "rm -fr $dir" EXIT
url=http://root:admin1234@${{ steps.forgejo.outputs.host-port }}
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
function sanity_check() {
local url=$1 version=$2
#
# Minimal sanity checks. Since the binary
# is a script shell it does not test the sanity of the cross
# build, only the sanity of the naming of the binaries.
#
for arch in amd64 arm64 arm-6 ; do
local binary=forgejo-$version-linux-$arch
for suffix in '' '.xz' ; do
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix > $binary$suffix
if test "$suffix" = .xz ; then
unxz --keep $binary$suffix
fi
chmod +x $binary
./$binary --version | grep $version
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$binary$suffix.sha256 > $binary$suffix.sha256
shasum -a 256 --check $binary$suffix.sha256
rm $binary$suffix
done
done
local sources=forgejo-src-$version.tar.gz
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources > $sources
curl --fail -L -sS $url/root/forgejo/releases/download/v$version/$sources.sha256 > $sources.sha256
shasum -a 256 --check $sources.sha256
docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version
docker pull ${{ steps.forgejo.outputs.host-port }}/root/forgejo:$version-rootless
}
#
# Create a new project with a fake forgejo and the release workflow only
#
cp -a .forgejo/testdata/build-release/* $dir
mkdir -p $dir/.forgejo/workflows
cp .forgejo/workflows/build-release.yml $dir/.forgejo/workflows
cp $dir/Dockerfile $dir/Dockerfile.rootless
forgejo-test-helper.sh push $dir $url root forgejo
forgejo-curl.sh api_json -X PUT --data-raw '{"data":"${{ steps.forgejo.outputs.token }}"}' $url/api/v1/repos/root/forgejo/actions/secrets/TOKEN
forgejo-curl.sh api_json -X PUT --data-raw '{"data":"root"}' $url/api/v1/repos/root/forgejo/actions/secrets/DOER
forgejo-curl.sh api_json -X PUT --data-raw '{"data":"true"}' $url/api/v1/repos/root/forgejo/actions/secrets/VERBOSE
#
# Push a tag to trigger the release workflow and wait for it to complete
#
version=1.2.3
sha=$(forgejo-test-helper.sh branch_tip $url root/forgejo main)
forgejo-curl.sh api_json --data-raw '{"tag_name": "v'$version'", "target": "'$sha'"}' $url/api/v1/repos/root/forgejo/tags
LOOPS=180 forgejo-test-helper.sh wait_success "$url" root/forgejo $sha
sanity_check $url $version
#
# Push a commit to a branch that triggers the build of a test release
#
version=1.2-test
(
git clone $url/root/forgejo /tmp/forgejo
cd /tmp/forgejo
date > DATE
git config user.email root@example.com
git config user.name username
git add .
git commit -m 'update'
git push $url/root/forgejo main:forgejo
)
sha=$(forgejo-test-helper.sh branch_tip $url root/forgejo forgejo)
LOOPS=180 forgejo-test-helper.sh wait_success "$url" root/forgejo $sha
sanity_check $url $version
- name: full logs
if: always()
run: |
sed -e 's/^/[RUNNER LOGS] /' ${{ steps.forgejo.outputs.runner-logs }}
docker logs forgejo | sed -e 's/^/[FORGEJO LOGS]/'
sleep 5 # hack to avoid mixing outputs in Forgejo v1.21

View File

@ -0,0 +1,232 @@
#
# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process
#
# https://codeberg.org/forgejo-integration/forgejo
#
# Builds a release from a codeberg.org/forgejo-integration tag
#
# vars.ROLE: forgejo-integration
#
# secrets.DOER: forgejo-experimental-ci
# secrets.TOKEN: <generated from codeberg.org/forgejo-experimental-ci> scope read:user, write:repository, write:package
#
# secrets.CASCADE_ORIGIN_TOKEN: <generated from codeberg.org/forgejo-experimental-ci> scope read:user, write:repository, write:issue
# secrets.CASCADE_DESTINATION_TOKEN: <generated from code.forgejo.org/forgejo-ci> scope read:user, write:repository, write:issue
# vars.CASCADE_DESTINATION_DOER: forgejo-ci
#
on:
push:
tags: 'v[0-9]+.[0-9]+.*'
branches:
- 'forgejo'
- 'v*/forgejo'
jobs:
release:
runs-on: self-hosted
# root is used for testing, allow it
if: vars.ROLE == 'forgejo-integration' || github.repository_owner == 'root'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Sanitize the name of the repository
id: repository
run: |
repository="${{ github.repository }}"
echo "value=${repository##*/}" >> "$GITHUB_OUTPUT"
- uses: https://code.forgejo.org/actions/setup-node@v3
with:
node-version: 20
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true
- name: version from ref
id: release-info
shell: bash
run: |
set -x
ref="${{ github.ref }}"
if [[ $ref =~ ^refs/heads/ ]] ; then
if test "$ref" = "refs/heads/forgejo" ; then
version=$(git tag -l --sort=version:refname --merged | grep -v -e '-test$' | tail -1 | sed -E -e 's/^(v[0-9]+\.[0-9]+).*/\1/')-test
else
version=${ref#refs/heads/}
version=${version%/forgejo}-test
fi
override=true
fi
if [[ $ref =~ ^refs/tags/ ]] ; then
version=${ref#refs/tags/}
override=false
fi
if test -z "$version" ; then
echo failed to figure out the release version from the reference=$ref
exit 1
fi
version=${version#v}
git describe --exclude '*-test' --tags --always
echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "override=$override" >> "$GITHUB_OUTPUT"
- name: release notes
id: release-notes
run: |
anchor=${{ steps.release-info.outputs.version }}
anchor=${anchor//./-}
cat >> "$GITHUB_OUTPUT" <<EOF
value<<ENDVAR
See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#$anchor
ENDVAR
EOF
- name: cache node_modules
id: node
uses: https://code.forgejo.org/actions/cache@v3
with:
path: |
node_modules
key: node-${{ steps.release-info.outputs.version }}
- name: skip if node cache hit
if: steps.node.outputs.cache-hit != 'true'
run: echo no hit
- name: Build sources
run: |
set -x
apt-get -qq install -y make
version=${{ steps.release-info.outputs.version }}
#
# Make sure all files are owned by the current user.
# When run as root `npx webpack` will assume the identity
# of the owner of the current working directory and may
# fail to create files if some sub-directories are not owned
# by the same user.
#
# Binaries:
# Node: 18.17.0 - /usr/local/node-v18.17.0-linux-x64/bin/node
# npm: 9.6.7 - /usr/local/node-v18.17.0-linux-x64/bin/npm
# Packages:
# add-asset-webpack-plugin: 2.0.1 => 2.0.1
# css-loader: 6.8.1 => 6.8.1
# esbuild-loader: 3.0.1 => 3.0.1
# license-checker-webpack-plugin: 0.2.1 => 0.2.1
# monaco-editor-webpack-plugin: 7.0.1 => 7.0.1
# vue-loader: 17.2.2 => 17.2.2
# webpack: 5.87.0 => 5.87.0
# webpack-cli: 5.1.4 => 5.1.4
#
chown -R $(id -u) .
make VERSION=$version TAGS=bindata sources-tarbal
mv dist/release release
(
tmp=$(mktemp -d)
tar --directory $tmp -zxvf release/*$version*.tar.gz
cd $tmp/*
#
# Verify `make frontend` files are available
#
test -d public/assets/css
test -d public/assets/fonts
test -d public/assets/js
#
# Verify `make generate` files are available
#
test -f modules/public/bindata.go
#
# Sanity check to verify that the source tarbal knows the
# version and is able to rebuild itself from it.
#
# When in sources the version is determined with git.
# When in the tarbal the version is determined from a VERSION file.
#
make sources-tarbal
tarbal=$(echo dist/release/*$version*.tar.gz)
if ! test -f $tarbal ; then
echo $tarbal does not exist
find dist release
exit 1
fi
)
- name: build container & release
if: ${{ secrets.TOKEN != '' }}
uses: https://code.forgejo.org/forgejo/forgejo-build-publish/build@v5.1.1
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: "${{ secrets.DOER }}"
release-version: "${{ steps.release-info.outputs.version }}"
sha: "${{ steps.release-info.outputs.sha }}"
token: "${{ secrets.TOKEN }}"
platforms: linux/amd64,linux/arm64,linux/arm/v6
release-notes: "${{ steps.release-notes.outputs.value }}"
binary-name: forgejo
binary-path: /app/gitea/gitea
override: "${{ steps.release-info.outputs.override }}"
verify-labels: "maintainer=contact@forgejo.org,org.opencontainers.image.version=${{ steps.release-info.outputs.version }}"
verbose: ${{ vars.VERBOSE || secrets.VERBOSE || 'false' }}
- name: build rootless container
if: ${{ secrets.TOKEN != '' }}
uses: https://code.forgejo.org/forgejo/forgejo-build-publish/build@v5.1.1
with:
forgejo: "${{ env.GITHUB_SERVER_URL }}"
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: "${{ secrets.DOER }}"
release-version: "${{ steps.release-info.outputs.version }}"
sha: "${{ steps.release-info.outputs.sha }}"
token: "${{ secrets.TOKEN }}"
platforms: linux/amd64,linux/arm64,linux/arm/v6
suffix: -rootless
dockerfile: Dockerfile.rootless
override: "${{ steps.release-info.outputs.override }}"
verify-labels: "maintainer=contact@forgejo.org,org.opencontainers.image.version=${{ steps.release-info.outputs.version }}"
verbose: ${{ vars.VERBOSE || secrets.VERBOSE || 'false' }}
- name: end-to-end tests
if: ${{ secrets.TOKEN != '' && vars.ROLE == 'forgejo-integration' }}
uses: https://code.forgejo.org/actions/cascading-pr@v2
with:
origin-url: ${{ env.GITHUB_SERVER_URL }}
origin-repo: ${{ github.repository }}
origin-token: ${{ secrets.CASCADE_ORIGIN_TOKEN }}
origin-ref: refs/heads/forgejo
destination-url: https://code.forgejo.org
destination-fork-repo: ${{ vars.CASCADE_DESTINATION_DOER }}/end-to-end
destination-repo: forgejo/end-to-end
destination-branch: main
destination-token: ${{ secrets.CASCADE_DESTINATION_TOKEN }}
update: .forgejo/cascading-release-end-to-end
- name: copy to experimental
if: vars.ROLE == 'forgejo-integration' && secrets.TOKEN != ''
run: |
if test "${{ vars.VERBOSE }}" = true ; then
set -x
fi
tag=v${{ steps.release-info.outputs.version }}
url=https://any:${{ secrets.TOKEN }}@codeberg.org
if test "${{ steps.release-info.outputs.override }}" = "true" ; then
curl -sS -X DELETE $url/api/v1/repos/forgejo-experimental/forgejo/releases/tags/$tag > /dev/null
curl -sS -X DELETE $url/api/v1/repos/forgejo-experimental/forgejo/tags/$tag > /dev/null
fi
# actions/checkout@v3 sets http.https://codeberg.org/.extraheader with the automatic token.
# Get rid of it so it does not prevent using the token that has write permissions
git config --local --unset http.https://codeberg.org/.extraheader
if test -f .git/shallow ; then
echo "unexptected .git/shallow file is present"
echo "it suggests a checkout --depth X was used which may prevent pushing the commit"
echo "it happens when actions/checkout is called without depth: 0"
fi
git push $url/forgejo-experimental/forgejo ${{ steps.release-info.outputs.sha }}:refs/tags/$tag

View File

@ -0,0 +1,74 @@
# Copyright 2024 The Forgejo Authors
# SPDX-License-Identifier: MIT
#
# To modify this workflow:
#
# - push it to the wip-ci-end-to-end branch on the forgejo repository
# otherwise it will not have access to the secrets required to push
# the cascading PR
#
# - once it works, open a pull request for the sake of keeping track
# of the change even if the PR won't run it because it will use
# whatever is in the default branch instead
#
# - after it is merged, double check it works by setting the
# run-end-to-end-test on a pull request (any pull request will doe
#
on:
push:
branches:
- 'wip-ci-end-to-end'
pull_request_target:
types:
- labeled
jobs:
info:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: docker
container:
image: node:20-bookworm
steps:
- name: event
run: |
echo github.event.pull_request.head.repo.fork = ${{ github.event.pull_request.head.repo.fork }}
echo github.event.action = ${{ github.event.action }}
echo github.event.pull_request.merged = ${{ github.event.pull_request.merged }}
echo github.event.pull_request.labels.*.name
cat <<'EOF'
${{ toJSON(github.event.pull_request.labels.*.name) }}
EOF
cat <<'EOF'
${{ toJSON(github.event) }}
EOF
cascade:
if: >
!startsWith(vars.ROLE, 'forgejo-') && (
github.event_name == 'push' ||
(
github.event.action == 'label_updated' && contains(github.event.pull_request.labels.*.name, 'run-end-to-end-tests')
)
)
runs-on: docker
container:
image: node:20-bookworm
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
show-progress: 'false'
- uses: actions/cascading-pr@v2
with:
origin-url: ${{ env.GITHUB_SERVER_URL }}
origin-repo: ${{ github.repository }}
origin-token: ${{ secrets.END_TO_END_CASCADING_PR_ORIGIN }}
origin-pr: ${{ github.event.pull_request.number }}
origin-ref: ${{ github.event_name == 'push' && github.event.ref || '' }}
destination-url: https://code.forgejo.org
destination-fork-repo: cascading-pr/end-to-end
destination-repo: forgejo/end-to-end
destination-branch: main
destination-token: ${{ secrets.END_TO_END_CASCADING_PR_DESTINATION }}
close-merge: true
update: .forgejo/cascading-pr-end-to-end

View File

@ -0,0 +1,37 @@
name: e2e
on:
pull_request:
paths:
- Makefile
- .forgejo/workflows/e2e.yml
- tests/e2e/**
jobs:
test-e2e:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true
- run: |
apt-get -qq update
apt-get -qq install -q sudo
sed -i -e 's/%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
adduser forgejo sudo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-frontend frontend deps-backend'
- run: |
su forgejo -c 'make generate test-e2e-sqlite'
timeout-minutes: 40
env:
DEPS_PLAYWRIGHT: 1
USE_REPO_TEST_DIR: 1

View File

@ -0,0 +1,25 @@
name: mirror
on:
schedule:
- cron: '@daily'
jobs:
mirror:
if: ${{ secrets.MIRROR_TOKEN != '' }}
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- name: git push {v*/,}forgejo
run: |
git init --bare .
git remote add origin ${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY }}
git fetch origin refs/heads/forgejo:refs/mirror/forgejo
git ls-remote origin refs/heads/v*/forgejo | while read sha full_ref ; do
ref=${full_ref#refs/heads/}
echo git fetch origin $full_ref:refs/mirror/$ref
git fetch origin $full_ref:refs/mirror/$ref
done
echo git push --force https://${{ vars.MIRROR_DESTINATION }} refs/mirror/*:refs/heads/*
git push --force https://any:${{ secrets.MIRROR_TOKEN }}@${{ vars.MIRROR_DESTINATION }} refs/mirror/*:refs/heads/*

View File

@ -0,0 +1,79 @@
# SPDX-License-Identifier: MIT
#
# See also https://forgejo.org/docs/next/developer/RELEASE/#release-process
#
# https://codeberg.org/forgejo-experimental/forgejo
#
# Copies a release from codeberg.org/forgejo-integration to codeberg.org/forgejo-experimental
#
# vars.ROLE: forgejo-experimental
# vars.FORGEJO: https://codeberg.org
# vars.FROM_OWNER: forgejo-integration
# vars.TO_OWNER: forgejo-experimental
# vars.REPO: forgejo
# vars.DOER: forgejo-experimental-ci
# secrets.TOKEN: <generated from codeberg.org/forgejo-experimental-ci>
#
# http://private.forgejo.org/forgejo/forgejo
#
# Copies & sign a release from codeberg.org/forgejo-integration to codeberg.org/forgejo
#
# vars.ROLE: forgejo-release
# vars.FORGEJO: https://codeberg.org
# vars.FROM_OWNER: forgejo-integration
# vars.TO_OWNER: forgejo
# vars.REPO: forgejo
# vars.DOER: release-team
# secrets.TOKEN: <generated from codeberg.org/release-team>
# secrets.GPG_PRIVATE_KEY: <XYZ>
# secrets.GPG_PASSPHRASE: <ABC>
#
name: Pubish release
on:
push:
tags: 'v*'
jobs:
publish:
runs-on: self-hosted
if: vars.DOER != '' && vars.FORGEJO != '' && vars.TO_OWNER != '' && vars.FROM_OWNER != '' && secrets.TOKEN != ''
steps:
- uses: actions/checkout@v3
- name: copy & sign
uses: https://code.forgejo.org/forgejo/forgejo-build-publish/publish@v5
with:
from-forgejo: ${{ vars.FORGEJO }}
to-forgejo: ${{ vars.FORGEJO }}
from-owner: ${{ vars.FROM_OWNER }}
to-owner: ${{ vars.TO_OWNER }}
repo: ${{ vars.REPO }}
release-notes: "See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#{ANCHOR}"
ref-name: ${{ github.ref_name }}
sha: ${{ github.sha }}
from-token: ${{ secrets.TOKEN }}
to-doer: ${{ vars.DOER }}
to-token: ${{ secrets.TOKEN }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
verbose: ${{ vars.VERBOSE }}
- name: set up go for the DNS update below
if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != ''
uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true
- name: update the _release.experimental DNS record
if: vars.ROLE == 'forgejo-experimental' && secrets.OVH_APP_KEY != ''
uses: https://code.forgejo.org/actions/ovh-dns-update@v1
with:
subdomain: _release.experimental
domain: forgejo.com # there is a CNAME from .org to .com (for security reasons)
record-id: 5283602601
value: v=${{ github.ref_name }}
ovh-app-key: ${{ secrets.OVH_APP_KEY }}
ovh-app-secret: ${{ secrets.OVH_APP_SECRET }}
ovh-consumer-key: ${{ secrets.OVH_CON_KEY }}

View File

@ -0,0 +1,68 @@
#
# Runs every 2 hours, but Renovate is limited to create new PR before 4am.
# See renovate.json for more settings.
# Automerge is enabled for Renovate PR's but need to be approved before.
#
name: renovate
on:
push:
branches:
- 'renovate/**' # self-test updates
schedule:
- cron: '0 0/2 * * *'
env:
RENOVATE_DRY_RUN: ${{ (github.event_name != 'schedule' && github.ref_name != github.event.repository.default_branch) && 'full' || '' }}
RENOVATE_REPOSITORIES: ${{ github.repository }}
jobs:
renovate:
if: ${{ secrets.RENOVATE_TOKEN != '' }}
runs-on: docker
container:
image: ghcr.io/visualon/renovate:37.382.4
steps:
- name: Load renovate repo cache
uses: https://code.forgejo.org/actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
.tmp/cache/renovate/repository
.tmp/cache/renovate/renovate-cache-sqlite
.tmp/osv
key: repo-cache-${{ github.run_id }}
restore-keys: |
repo-cache-
- name: Run renovate
run: renovate
env:
GITHUB_COM_TOKEN: ${{ secrets.RENOVATE_GITHUB_COM_TOKEN }}
LOG_LEVEL: debug
RENOVATE_BASE_DIR: ${{ github.workspace }}/.tmp
RENOVATE_ENDPOINT: ${{ github.server_url }}
RENOVATE_PLATFORM: gitea
RENOVATE_REPOSITORY_CACHE: 'enabled'
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
RENOVATE_GIT_AUTHOR: 'Renovate Bot <forgejo-renovate-action@forgejo.org>'
RENOVATE_X_SQLITE_PACKAGE_CACHE: true
GIT_AUTHOR_NAME: 'Renovate Bot'
GIT_AUTHOR_EMAIL: 'forgejo-renovate-action@forgejo.org'
GIT_COMMITTER_NAME: 'Renovate Bot'
GIT_COMMITTER_EMAIL: 'forgejo-renovate-action@forgejo.org'
OSV_OFFLINE_ROOT_DIR: ${{ github.workspace }}/.tmp/osv
- name: Save renovate repo cache
if: always() && env.RENOVATE_DRY_RUN != 'full'
uses: https://code.forgejo.org/actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
.tmp/cache/renovate/repository
.tmp/cache/renovate/renovate-cache-sqlite
.tmp/osv
key: repo-cache-${{ github.run_id }}

View File

@ -0,0 +1,222 @@
name: testing
on:
pull_request:
push:
branches:
- 'forgejo*'
- 'v*/forgejo*'
jobs:
backend-checks:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- name: event info
run: |
cat <<'EOF'
${{ toJSON(github) }}
EOF
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true
- run: make deps-backend deps-tools
- run: make --always-make -j$(nproc) lint-backend checks-backend # ensure the "go-licenses" make target runs
frontend-checks:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: docker
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- run: make deps-frontend
- run: make lint-frontend
- run: make checks-frontend
- run: make test-frontend
- run: make frontend
test-unit:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: docker
needs: [backend-checks, frontend-checks]
container:
image: 'docker.io/node:20-bookworm'
services:
minio:
image: bitnami/minio:2024.3.30
options: >-
--hostname gitea.minio
env:
MINIO_DOMAIN: minio
MINIO_ROOT_USER: 123456
MINIO_ROOT_PASSWORD: 12345678
redis:
image: redis:7.2
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.22"
- run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- name: install git >= 2.42
run: |
export DEBIAN_FRONTEND=noninteractive
echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
apt-get update -qq
apt-get -q install -qq -y git
rm /etc/apt/sources.list.d/testing.list
apt-get update -qq
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make test-backend test-check'
timeout-minutes: 50
env:
RACE_ENABLED: 'true'
TAGS: bindata
TEST_REDIS_SERVER: redis:6379
test-mysql:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: docker
needs: [backend-checks, frontend-checks]
container:
image: 'docker.io/node:20-bookworm'
services:
mysql:
image: 'docker.io/mysql:8-debian'
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: testgitea
#
# See also https://codeberg.org/forgejo/forgejo/issues/976
#
cmd: ['mysqld', '--innodb-adaptive-flushing=OFF', '--innodb-buffer-pool-size=4G', '--innodb-log-buffer-size=128M', '--innodb-flush-log-at-trx-commit=0', '--innodb-flush-log-at-timeout=30', '--innodb-flush-method=nosync', '--innodb-fsync-threshold=1000000000']
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.22"
- name: install dependencies & git >= 2.42
run: |
export DEBIAN_FRONTEND=noninteractive
echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
apt-get update -qq
apt-get install --no-install-recommends -qq -y git git-lfs
rm /etc/apt/sources.list.d/testing.list
apt-get update -qq
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make test-mysql-migration test-mysql'
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1
test-pgsql:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: docker
needs: [backend-checks, frontend-checks]
container:
image: 'docker.io/node:20-bookworm'
services:
minio:
image: bitnami/minio:2024.3.30
env:
MINIO_ROOT_USER: 123456
MINIO_ROOT_PASSWORD: 12345678
ldap:
image: docker.io/gitea/test-openldap:latest
pgsql:
image: 'docker.io/postgres:15'
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: postgres
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.22"
- name: install dependencies & git >= 2.42
run: |
export DEBIAN_FRONTEND=noninteractive
echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
apt-get update -qq
apt-get install --no-install-recommends -qq -y git git-lfs
rm /etc/apt/sources.list.d/testing.list
apt-get update -qq
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata
- run: |
su forgejo -c 'make test-pgsql-migration test-pgsql'
timeout-minutes: 50
env:
TAGS: bindata
RACE_ENABLED: true
USE_REPO_TEST_DIR: 1
TEST_LDAP: 1
test-sqlite:
if: ${{ !startsWith(vars.ROLE, 'forgejo-') }}
runs-on: docker
needs: [backend-checks, frontend-checks]
container:
image: 'docker.io/node:20-bookworm'
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- uses: https://code.forgejo.org/actions/setup-go@v4
with:
go-version: "1.22"
- name: install dependencies & git >= 2.42
run: |
export DEBIAN_FRONTEND=noninteractive
echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
apt-get update -qq
apt-get install --no-install-recommends -qq -y git git-lfs
rm /etc/apt/sources.list.d/testing.list
apt-get update -qq
- name: setup user and permissions
run: |
git config --add safe.directory '*'
adduser --quiet --comment forgejo --disabled-password forgejo
chown -R forgejo:forgejo .
- run: |
su forgejo -c 'make deps-backend'
- run: |
su forgejo -c 'make backend'
env:
TAGS: bindata sqlite sqlite_unlock_notify
- run: |
su forgejo -c 'make test-sqlite-migration test-sqlite'
timeout-minutes: 50
env:
TAGS: bindata sqlite sqlite_unlock_notify
RACE_ENABLED: true
TEST_TAGS: sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR: 1

3
.gitattributes vendored
View File

@ -1,5 +1,6 @@
* text=auto eol=lf
*.tmpl linguist-language=Handlebars
*.tmpl linguist-language=go-html-template
*.pb.go linguist-generated
/assets/*.json linguist-generated
/public/assets/img/svg/*.svg linguist-generated
/templates/swagger/v1_json.tmpl linguist-generated

View File

@ -1,42 +0,0 @@
<!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue -->
<!--
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your issue doesn't already exist.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
5. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
-->
- Gitea version (or commit ref):
- Git version:
- Operating system:
<!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package -->
<!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. --->
<!-- If you are using a package or systemd tell us what distribution you are using -->
- Database (use `[x]`):
- [ ] PostgreSQL
- [ ] MySQL
- [ ] MSSQL
- [ ] SQLite
- Can you reproduce the bug at https://try.gitea.io:
- [ ] Yes (provide example URL)
- [ ] No
- Log gist:
<!-- It really is important to provide pertinent logs -->
<!-- Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help -->
<!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini -->
## Description
<!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please
disable the proxy/CDN fully and connect to gitea directly to confirm
the issue still persists without those services. -->
...
## Screenshots
<!-- **If this issue involves the Web Interface, please include a screenshot** -->

View File

@ -0,0 +1,63 @@
name: 🦋 Bug Report (web interface / frontend)
description: Something doesn't look quite as it should? Report it here!
title: "[BUG] "
labels: ["bug/new-report", "forgejo/ui"]
body:
- type: markdown
attributes:
value: |
**NOTE: If your issue is a security concern, please email <security@forgejo.org> (GPG: `A4676E79`) instead of opening a public issue.**
- type: markdown
attributes:
value: |
- Please speak English, as this is the language all maintainers can speak and write.
- Be as clear and concise as possible. A very verbose report is harder to interpret in a concrete way.
- Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct).
- Please make sure you are using the latest release of Forgejo and take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137).
- Please give all relevant information below for bug reports, as incomplete details may result in the issue not being considered.
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below).
If you think this is a JavaScript error, show us the JavaScript console.
If the error appears to relate to Forgejo the server, please also give us `DEBUG` level logs. (See https://forgejo.org/docs/latest/admin/logging-documentation/)
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: Please provide at least one screenshot showing the issue.
validations:
required: true
- type: input
id: forgejo-ver
attributes:
label: Forgejo Version
description: Forgejo version (or commit reference) your instance is running
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on Forgejo Next?
description: |
Please try reproducing your issue at [Forgejo Next](https://next.forgejo.org).
If you can reproduce it, please provide a URL in the Description field.
options:
- "Yes"
- "No"
validations:
required: true
- type: input
id: browser-ver
attributes:
label: Browser Version
description: The browser and version that you are using to access Forgejo
validations:
required: true
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to access Forgejo

View File

@ -0,0 +1,89 @@
name: 🐛 Bug Report (server / backend)
description: Found something you weren't expecting? Report it here!
title: "[BUG] "
labels: bug/new-report
body:
- type: markdown
attributes:
value: |
**NOTE: If your issue is a security concern, please email <security@forgejo.org> (GPG: `A4676E79`) instead of opening a public issue.**
- type: markdown
attributes:
value: |
- Please speak English, as this is the language all maintainers can speak and write.
- Be as clear and concise as possible. A very verbose report is harder to interpret in a concrete way.
- Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct).
- Please make sure you are using the latest release of Forgejo and take a moment to [check that your issue hasn't been reported before](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78137).
- Please give all relevant information below for bug reports, as incomplete details may result in the issue not being considered.
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below).
validations:
required: true
- type: input
id: forgejo-ver
attributes:
label: Forgejo Version
description: Forgejo version (or commit reference) of your instance
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on Forgejo Next?
description: |
Please try reproducing your issue at [Forgejo Next](https://next.forgejo.org).
If you can reproduce it, please provide a URL in the Description field.
options:
- "Yes"
- "No"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: |
It's really important to provide pertinent logs. You must give us `DEBUG` level logs.
Please read https://forgejo.org/docs/latest/admin/logging-documentation/.
In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of `app.ini`.
Please copy and paste your logs here, with any sensitive information (e.g. API keys) removed/hidden.
You can wrap your logs in `<details>...</details>` tags so it doesn't take up too much space in the issue.
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If this issue involves the Web Interface, please provide one or more screenshots
- type: input
id: git-ver
attributes:
label: Git Version
description: The version of git running on the server
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to run Forgejo
- type: textarea
id: run-info
attributes:
label: How are you running Forgejo?
description: |
Please include information on whether you built Forgejo yourself, used one of our downloads, or are using some other package.
Please also tell us how you are running Forgejo, e.g. if it is being run from docker, a command-line, systemd etc.
If you are using a package or systemd tell us what distribution you are using.
validations:
required: true
- type: dropdown
id: database
attributes:
label: Database
description: What database system are you running?
options:
- SQLite
- PostgreSQL
- MySQL

View File

@ -0,0 +1,16 @@
contact_links:
- name: 🔓 Security Reports
url: mailto:security@forgejo.org
about: "Please email <security@forgejo.org> (GPG: `A4676E79`) instead of opening a public issue."
- name: 💬 Matrix Chat Room
url: https://matrix.to/#/#forgejo-chat:matrix.org
about: Please ask questions and discuss configuration or deployment problems here.
- name: 💬 Matrix Space
url: https://matrix.to/#/#forgejo:matrix.org
about: A collection of Matrix rooms relating to Forgejo in addition to the main chat room.
- name: 📚 Documentation
url: https://forgejo.org/docs/latest/
about: Documentation about Forgejo.
- name: ❓ Frequently Asked Questions
url: https://forgejo.org/faq/
about: Please check if your question is mentioned here.

View File

@ -0,0 +1,31 @@
name: 💡 Feature Request
description: Got an idea for a feature that Forgejo doesn't have yet? Suggest it here!
title: "[FEAT] "
labels: ["enhancement/feature"]
body:
- type: markdown
attributes:
value: |
- Please speak English, as this is the language all maintainers can speak and write.
- Be as clear and concise as possible. A very verbose request is harder to interpret in a concrete way.
- Be civil, and follow the [Forgejo Code of Conduct](https://codeberg.org/forgejo/code-of-conduct).
- Please make sure you are using the latest release of Forgejo and take a moment to [check that your feature hasn't already been suggested](https://codeberg.org/forgejo/forgejo/issues?q=&type=all&labels=78139).
- type: textarea
id: needs-benefits
attributes:
label: Needs and benefits
description: As concisely as possible, describe the benefits your feature request will provide or the problems it will try to solve.
validations:
required: true
- type: textarea
id: description
attributes:
label: Feature Description
description: As concisely as possible, describe the feature you would like to see added or the changes you would like to see made to Forgejo.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If you can, provide screenshots of an implementation on another site, e.g. GitHub.

View File

@ -0,0 +1,13 @@
---
name: "Pull Request Template"
about: "Template for all Pull Requests"
labels:
- test/needed
---
<!--
Before submitting a PR, please read the contributing guidelines:
https://codeberg.org/forgejo/forgejo/src/branch/forgejo/CONTRIBUTING.md
-->

2
.github/FUNDING.yml vendored
View File

@ -1,2 +0,0 @@
open_collective: gitea
custom: https://www.bountysource.com/teams/gitea

View File

@ -1,91 +0,0 @@
name: Bug Report
description: Found something you weren't expecting? Report it here!
labels: ["kind/bug"]
body:
- type: markdown
attributes:
value: |
NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue.
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Make sure you are using the latest release and
take a moment to check that your issue hasn't been reported before.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
5. It's really important to provide pertinent details and logs (https://docs.gitea.com/help/support),
incomplete details will be handled as an invalid report.
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below)
If you are using a proxy or a CDN (e.g. Cloudflare) in front of Gitea, please disable the proxy/CDN fully and access Gitea directly to confirm the issue still persists without those services.
- type: input
id: gitea-ver
attributes:
label: Gitea Version
description: Gitea version (or commit reference) of your instance
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on the Gitea demo site?
description: |
If so, please provide a URL in the Description field
URL of Gitea demo: https://try.gitea.io
options:
- "Yes"
- "No"
validations:
required: true
- type: markdown
attributes:
value: |
It's really important to provide pertinent logs
Please read https://docs.gitea.com/administration/logging-config#collecting-logs-for-help
In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini
- type: input
id: logs
attributes:
label: Log Gist
description: Please provide a gist URL of your logs, with any sensitive information (e.g. API keys) removed/hidden
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If this issue involves the Web Interface, please provide one or more screenshots
- type: input
id: git-ver
attributes:
label: Git Version
description: The version of git running on the server
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to run Gitea
- type: textarea
id: run-info
attributes:
label: How are you running Gitea?
description: |
Please include information on whether you built Gitea yourself, used one of our downloads, are using https://try.gitea.io or are using some other package
Please also tell us how you are running Gitea, e.g. if it is being run from docker, a command-line, systemd etc.
If you are using a package or systemd tell us what distribution you are using
validations:
required: true
- type: dropdown
id: database
attributes:
label: Database
description: What database system are you running?
options:
- PostgreSQL
- MySQL/MariaDB
- MSSQL
- SQLite

View File

@ -1,17 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Security Concern
url: https://tinyurl.com/security-gitea
about: For security concerns, please send a mail to security@gitea.io instead of opening a public issue.
- name: Discord Server
url: https://discord.gg/Gitea
about: Please ask questions and discuss configuration or deployment problems here.
- name: Discourse Forum
url: https://discourse.gitea.io
about: Questions and configuration or deployment problems can also be discussed on our forum.
- name: Frequently Asked Questions
url: https://docs.gitea.com/help/faq
about: Please check if your question isn't mentioned here.
- name: Crowdin Translations
url: https://crowdin.com/project/gitea
about: Translations are managed here.

View File

@ -1,24 +0,0 @@
name: Feature Request
description: Got an idea for a feature that Gitea doesn't have currently? Submit your idea here!
labels: ["kind/proposal"]
body:
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your feature hasn't already been suggested.
- type: textarea
id: description
attributes:
label: Feature Description
placeholder: |
I think it would be great if Gitea had...
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If you can, provide screenshots of an implementation on another site e.g. GitHub

View File

@ -1,66 +0,0 @@
name: Web Interface Bug Report
description: Something doesn't look quite as it should? Report it here!
labels: ["kind/bug", "kind/ui"]
body:
- type: markdown
attributes:
value: |
NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue.
- type: markdown
attributes:
value: |
1. Please speak English, this is the language all maintainers can speak and write.
2. Please ask questions or configuration/deploy problems on our Discord
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
3. Please take a moment to check that your issue doesn't already exist.
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
5. Please give all relevant information below for bug reports, because
incomplete details will be handled as an invalid report.
6. In particular it's really important to provide pertinent logs. If you are certain that this is a javascript
error, show us the javascript console. If the error appears to relate to Gitea the server you must also give us
DEBUG level logs. (See https://docs.gitea.com/administration/logging-config#collecting-logs-for-help)
- type: textarea
id: description
attributes:
label: Description
description: |
Please provide a description of your issue here, with a URL if you were able to reproduce the issue (see below)
If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services.
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: Please provide at least 1 screenshot showing the issue.
validations:
required: true
- type: input
id: gitea-ver
attributes:
label: Gitea Version
description: Gitea version (or commit reference) your instance is running
validations:
required: true
- type: dropdown
id: can-reproduce
attributes:
label: Can you reproduce the bug on the Gitea demo site?
description: |
If so, please provide a URL in the Description field
URL of Gitea demo: https://try.gitea.io
options:
- "Yes"
- "No"
validations:
required: true
- type: input
id: os-ver
attributes:
label: Operating System
description: The operating system you are using to access Gitea
- type: input
id: browser-ver
attributes:
label: Browser Version
description: The browser and version that you are using to access Gitea
validations:
required: true

View File

@ -1,4 +0,0 @@
self-hosted-runner:
labels:
- actuated-4cpu-8gb
- actuated-4cpu-16gb

35
.github/labeler.yml vendored
View File

@ -1,35 +0,0 @@
kind/docs:
- "**/*.md"
- "docs/**"
kind/ui:
- "web_src/**/*"
- all: ["templates/**", "!templates/swagger/v1_json.tmpl"]
kind/api:
- "templates/swagger/v1_json.tmpl"
- "routers/api/**"
kind/build:
- "Makefile"
- "Dockerfile"
- "Dockerfile.rootless"
- "docker/**"
- "webpack.config.js"
theme/package-registry:
- "modules/packages/**"
- "services/packages/**"
- "routers/api/packages/**"
- "routers/web/shared/packages/**"
kind/cli:
- "cmd/**"
kind/lint:
- ".eslintrc.yaml"
- ".golangci.yml"
- ".markdownlint.yaml"
- ".spectral.yaml"
- ".stylelintrc.yaml"
- ".yamllint.yaml"

View File

@ -1,9 +0,0 @@
<!-- start tips -->
Please check the following:
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for backports.
2. Make sure you have read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md .
3. Describe what your pull request does and which issue you're targeting (if any).
4. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
5. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
6. Delete all these tips before posting.
<!-- end tips -->

54
.github/stale.yml vendored
View File

@ -1,54 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 14
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- status/blocked
- kind/security
- lgtm/done
- reviewed/confirmed
- priority/critical
- kind/proposal
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had recent activity.
I am here to help clear issues left open even if solved or waiting for more insight.
This issue will be closed if no further activity occurs during the next 2 weeks.
If the issue is still valid just add a comment to keep it alive.
Thank you for your contributions.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed because of inactivity.
You can re-open it if needed.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
pulls:
daysUntilStale: 60
daysUntilClose: 60
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you
for your contributions.
closeComment: >
This pull request has been automatically closed because of inactivity.
You can re-open it if needed.

View File

@ -1,29 +0,0 @@
name: cron-licenses
on:
schedule:
- cron: "7 0 * * 1" # every Monday at 00:07 UTC
workflow_dispatch:
jobs:
cron-licenses:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make generate-license generate-gitignore
timeout-minutes: 40
- name: push translations to repo
uses: appleboy/git-push-action@v0.0.2
with:
author_email: "teabot@gitea.io"
author_name: GiteaBot
branch: main
commit: true
commit_message: "[skip ci] Updated licenses and gitignores"
remote: "git@github.com:go-gitea/gitea.git"
ssh_key: ${{ secrets.DEPLOY_KEY }}

View File

@ -1,22 +0,0 @@
name: cron-lock
on:
schedule:
- cron: "0 0 * * *" # every day at 00:00 UTC
workflow_dispatch:
permissions:
issues: write
pull-requests: write
concurrency:
group: lock
jobs:
action:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: dessant/lock-threads@v4
with:
issue-inactive-days: 45

View File

@ -1,49 +0,0 @@
name: cron-translations
on:
schedule:
- cron: "7 0 * * *" # every day at 00:07 UTC
workflow_dispatch:
jobs:
crowdin-pull:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v4
- name: download from crowdin
uses: docker://jonasfranz/crowdin
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
PLUGIN_DOWNLOAD: true
PLUGIN_EXPORT_DIR: options/locale/
PLUGIN_IGNORE_BRANCH: true
PLUGIN_PROJECT_IDENTIFIER: gitea
- name: update locales
run: ./build/update-locales.sh
- name: push translations to repo
uses: appleboy/git-push-action@v0.0.2
with:
author_email: "teabot@gitea.io"
author_name: GiteaBot
branch: main
commit: true
commit_message: "[skip ci] Updated translations via Crowdin"
remote: "git@github.com:go-gitea/gitea.git"
ssh_key: ${{ secrets.DEPLOY_KEY }}
crowdin-push:
runs-on: ubuntu-latest
if: github.repository == 'go-gitea/gitea'
steps:
- uses: actions/checkout@v4
- name: push translations to crowdin
uses: docker://jonasfranz/crowdin
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
PLUGIN_UPLOAD: true
PLUGIN_EXPORT_DIR: options/locale/
PLUGIN_IGNORE_BRANCH: true
PLUGIN_PROJECT_IDENTIFIER: gitea
PLUGIN_FILES: |
locale_en-US.ini: options/locale/locale_en-US.ini
PLUGIN_BRANCH: main

View File

@ -1,97 +0,0 @@
name: files-changed
on:
workflow_call:
outputs:
backend:
value: ${{ jobs.detect.outputs.backend }}
frontend:
value: ${{ jobs.detect.outputs.frontend }}
docs:
value: ${{ jobs.detect.outputs.docs }}
actions:
value: ${{ jobs.detect.outputs.actions }}
templates:
value: ${{ jobs.detect.outputs.templates }}
docker:
value: ${{ jobs.detect.outputs.docker }}
swagger:
value: ${{ jobs.detect.outputs.swagger }}
yaml:
value: ${{ jobs.detect.outputs.yaml }}
jobs:
detect:
runs-on: ubuntu-latest
timeout-minutes: 3
outputs:
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
docs: ${{ steps.changes.outputs.docs }}
actions: ${{ steps.changes.outputs.actions }}
templates: ${{ steps.changes.outputs.templates }}
docker: ${{ steps.changes.outputs.docker }}
swagger: ${{ steps.changes.outputs.swagger }}
yaml: ${{ steps.changes.outputs.yaml }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
backend:
- "**/*.go"
- "templates/**/*.tmpl"
- "assets/emoji.json"
- "go.mod"
- "go.sum"
- "Makefile"
- ".golangci.yml"
- ".editorconfig"
frontend:
- "**/*.js"
- "web_src/**"
- "assets/emoji.json"
- "package.json"
- "package-lock.json"
- "Makefile"
- ".eslintrc.yaml"
- ".stylelintrc.yaml"
- ".npmrc"
docs:
- "**/*.md"
- "docs/**"
- ".markdownlint.yaml"
- "package.json"
- "package-lock.json"
actions:
- ".github/workflows/*"
- "Makefile"
templates:
- "templates/**/*.tmpl"
- "pyproject.toml"
- "poetry.lock"
docker:
- "Dockerfile"
- "Dockerfile.rootless"
- "docker/**"
- "Makefile"
swagger:
- "templates/swagger/v1_json.tmpl"
- "Makefile"
- "package.json"
- "package-lock.json"
- ".spectral.yaml"
yaml:
- "**/*.yml"
- "**/*.yaml"
- ".yamllint.yaml"
- "pyproject.toml"
- "poetry.lock"

View File

@ -1,179 +0,0 @@
name: compliance
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
lint-backend:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-backend
env:
TAGS: bindata sqlite sqlite_unlock_notify
lint-templates:
if: needs.files-changed.outputs.templates == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install poetry
- run: make deps-py
- run: make lint-templates
lint-yaml:
if: needs.files-changed.outputs.yaml == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install poetry
- run: make deps-py
- run: make lint-yaml
lint-swagger:
if: needs.files-changed.outputs.swagger == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-swagger
lint-go-windows:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-go-windows lint-go-vet
env:
TAGS: bindata sqlite sqlite_unlock_notify
GOOS: windows
GOARCH: amd64
lint-go-gogit:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make lint-go
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
checks-backend:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend deps-tools
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
frontend:
if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-frontend
- run: make checks-frontend
- run: make test-frontend
- run: make frontend
backend:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
# no frontend build here as backend should be able to build
# even without any frontend files
- run: make deps-backend
- run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
- name: build-backend-arm64
run: make backend # test cross compile
env:
GOOS: linux
GOARCH: arm64
TAGS: bindata gogit
- name: build-backend-windows
run: go build -o gitea_windows
env:
GOOS: windows
GOARCH: amd64
TAGS: bindata gogit
- name: build-backend-386
run: go build -o gitea_linux_386 # test if compatible with 32 bit
env:
GOOS: linux
GOARCH: 386
docs:
if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend
- run: make lint-md
- run: make docs
actions:
if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- run: make lint-actions

View File

@ -1,259 +0,0 @@
name: db-tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
test-pgsql:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
pgsql:
image: postgres:15
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
ldap:
image: gitea/test-openldap:latest
ports:
- "389:389"
- "636:636"
minio:
# as github actions doesn't support "entrypoint", we need to use a non-official image
# that has a custom entrypoint set to "minio server /data"
image: bitnami/minio:2021.3.17
env:
MINIO_ACCESS_KEY: 123456
MINIO_SECRET_KEY: 12345678
ports:
- "9000:9000"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-pgsql-migration test-pgsql
timeout-minutes: 50
env:
TAGS: bindata gogit
RACE_ENABLED: true
TEST_TAGS: gogit
TEST_LDAP: 1
USE_REPO_TEST_DIR: 1
test-sqlite:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- run: make deps-backend
- run: make backend
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
- run: make test-sqlite-migration test-sqlite
timeout-minutes: 50
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED: true
TEST_TAGS: gogit sqlite sqlite_unlock_notify
USE_REPO_TEST_DIR: 1
test-unit:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: test
ports:
- "3306:3306"
elasticsearch:
image: elasticsearch:7.5.0
env:
discovery.type: single-node
ports:
- "9200:9200"
meilisearch:
image: getmeili/meilisearch:v1.2.0
env:
MEILI_ENV: development # disable auth
ports:
- "7700:7700"
smtpimap:
image: tabascoterrier/docker-imap-devel:latest
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
redis:
image: redis
options: >- # wait until redis has started
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
ports:
- 6379:6379
minio:
image: bitnami/minio:2021.3.17
env:
MINIO_ACCESS_KEY: 123456
MINIO_SECRET_KEY: 12345678
ports:
- "9000:9000"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- name: unit-tests
run: make unit-test-coverage test-check
env:
TAGS: bindata
RACE_ENABLED: true
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
- name: unit-tests-gogit
run: make unit-test-coverage test-check
env:
TAGS: bindata gogit
RACE_ENABLED: true
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
test-mysql5:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: test
ports:
- "3306:3306"
elasticsearch:
image: elasticsearch:7.5.0
env:
discovery.type: single-node
ports:
- "9200:9200"
smtpimap:
image: tabascoterrier/docker-imap-devel:latest
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- name: run tests
run: make test-mysql-migration integration-test-coverage
env:
TAGS: bindata
RACE_ENABLED: true
USE_REPO_TEST_DIR: 1
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
test-mysql8:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mysql8:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: testgitea
ports:
- "3306:3306"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-mysql8-migration test-mysql8
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1
test-mssql:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:latest
env:
ACCEPT_EULA: Y
MSSQL_PID: Standard
SA_PASSWORD: MwantsaSecurePassword1
ports:
- "1433:1433"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- name: Add hosts to /etc/hosts
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
TAGS: bindata
- run: make test-mssql-migration test-mssql
timeout-minutes: 50
env:
TAGS: bindata
USE_REPO_TEST_DIR: 1

View File

@ -1,35 +0,0 @@
name: docker-dryrun
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
regular:
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
push: false
tags: gitea/gitea:linux-amd64
rootless:
if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
push: false
file: Dockerfile.rootless
tags: gitea/gitea:linux-amd64

View File

@ -1,32 +0,0 @@
name: e2e-tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
test-e2e:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend frontend deps-backend
- run: npx playwright install --with-deps
- run: make test-e2e-sqlite
timeout-minutes: 40
env:
USE_REPO_TEST_DIR: 1

View File

@ -1,21 +0,0 @@
name: labeler
on:
pull_request_target:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v4
with:
dot: true
sync-labels: true

View File

@ -1,132 +0,0 @@
name: release-nightly-assets
on:
push:
branches: [ main, release/v* ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nightly-binary:
runs-on: actuated-4cpu-16gb
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- uses: actions/setup-node@v3
with:
node-version: 20
- run: make deps-frontend deps-backend
# xgo build
- run: make release
env:
TAGS: bindata sqlite sqlite_unlock_notify
- name: import gpg key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
- name: sign binaries
run: |
for f in dist/release/*; do
echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f"
done
# clean branch name to get the folder name in S3
- name: Get cleaned branch name
id: clean_name
run: |
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
echo "Cleaned name is ${REF_NAME}"
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
- name: upload binaries to s3
uses: jakejarvis/s3-sync-action@master
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: dist/release
DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }}
nightly-docker-rootful:
runs-on: actuated-4cpu-16gb
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Get cleaned branch name
id: clean_name
run: |
# if main then say nightly otherwise cleanup name
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "branch=nightly" >> "$GITHUB_OUTPUT"
exit 0
fi
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: fetch go modules
run: make vendor
- name: build rootful docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
nightly-docker-rootless:
runs-on: actuated-4cpu-16gb
steps:
- uses: actions/checkout@v4
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
- run: git fetch --unshallow --quiet --tags --force
- uses: actions/setup-go@v4
with:
go-version: "~1.21"
check-latest: true
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Get cleaned branch name
id: clean_name
run: |
# if main then say nightly otherwise cleanup name
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "branch=nightly" >> "$GITHUB_OUTPUT"
exit 0
fi
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: fetch go modules
run: make vendor
- name: build rootless docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
file: Dockerfile.rootless
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless

16
.gitignore vendored
View File

@ -1,3 +1,6 @@
# Emacs
*~
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
@ -11,10 +14,11 @@ _test
.idea
# Goland's output filename can not be set manually
/go_build_*
/gitea_*
# MS VSCode
.vscode
__debug_bin
__debug_bin*
*.cgo1.go
*.cgo2.c
@ -24,6 +28,9 @@ _cgo_export.*
_testmain.go
# folder for project related local files
/local/
*.exe
*.test
*.prof
@ -57,7 +64,7 @@ cpu.out
/data
/indexers
/log
/public/img/avatar
/public/assets/img/avatar
/tests/integration/gitea-integration-*
/tests/integration/indexers-*
/tests/e2e/gitea-e2e-*
@ -76,7 +83,6 @@ cpu.out
/public/assets/css
/public/assets/fonts
/public/assets/licenses.txt
/public/assets/img/webpack
/vendor
/web_src/fomantic/node_modules
/web_src/fomantic/build/*
@ -93,6 +99,10 @@ cpu.out
/VERSION
/.air
/.go-licenses
/.cur-deadcode-out
# Files and folders that were previously generated
/public/assets/img/webpack
# Snapcraft
/gitea_a*.txt

View File

@ -10,10 +10,19 @@ tasks:
- name: Run backend
command: |
gp sync-await setup
if [ ! -f custom/conf/app.ini ]
then
# Get the URL and extract the domain
url=$(gp url 3000)
domain=$(echo $url | awk -F[/:] '{print $4}')
if [ -f custom/conf/app.ini ]; then
sed -i "s|^ROOT_URL =.*|ROOT_URL = ${url}/|" custom/conf/app.ini
sed -i "s|^DOMAIN =.*|DOMAIN = ${domain}|" custom/conf/app.ini
sed -i "s|^SSH_DOMAIN =.*|SSH_DOMAIN = ${domain}|" custom/conf/app.ini
sed -i "s|^NO_REPLY_ADDRESS =.*|SSH_DOMAIN = noreply.${domain}|" custom/conf/app.ini
else
mkdir -p custom/conf/
echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini
echo -e "[server]\nROOT_URL = ${url}/" > custom/conf/app.ini
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
fi
export TAGS="sqlite sqlite_unlock_notify"
@ -33,7 +42,7 @@ vscode:
- DavidAnson.vscode-markdownlint
- Vue.volar
- ms-azuretools.vscode-docker
- zixuanchen.vitest-explorer
- vitest.explorer
- qwtel.sqlite-viewer
- GitHub.vscode-pull-request-github

View File

@ -1,13 +1,14 @@
linters:
enable-all: false
disable-all: true
fast: false
enable:
- bidichk
# - deadcode # deprecated - https://github.com/golangci/golangci-lint/issues/1841
- depguard
- dupl
- errcheck
- forbidigo
- gocritic
# - gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
- gofmt
- gofumpt
- gosimple
@ -17,25 +18,24 @@ linters:
- nolintlint
- revive
- staticcheck
# - structcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841
- stylecheck
- typecheck
- unconvert
- unused
# - varcheck # deprecated - https://github.com/golangci/golangci-lint/issues/1841
- wastedassign
enable-all: false
disable-all: true
fast: false
run:
go: "1.21"
timeout: 10m
skip-dirs:
- node_modules
- public
- web_src
output:
sort-results: true
sort-order: [file]
show-stats: true
linters-settings:
stylecheck:
checks: ["all", "-ST1005", "-ST1003"]
@ -46,36 +46,41 @@ linters-settings:
- ifElseChain
- singleCaseSwitch # Every time this occurred in the code, there was no other way.
revive:
ignore-generated-header: false
severity: warning
confidence: 0.8
errorCode: 1
warningCode: 1
severity: error
rules:
- name: atomic
- name: bare-return
- name: blank-imports
- name: constant-logical-expr
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: duplicated-imports
- name: empty-lines
- name: error-naming
- name: error-return
- name: error-strings
- name: error-naming
- name: errorf
- name: exported
- name: identical-branches
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: indent-error-flow
- name: modifies-value-receiver
- name: package-comments
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: string-of-int
- name: superfluous-else
- name: time-naming
- name: unconditional-recursion
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: duplicated-imports
- name: modifies-value-receiver
- name: unreachable-code
- name: var-declaration
- name: var-naming
gofumpt:
extra-rules: true
lang-version: "1.21"
depguard:
rules:
main:
@ -92,12 +97,18 @@ linters-settings:
desc: do not use the internal package, use AddXxx function instead
- pkg: gopkg.in/ini.v1
desc: do not use the ini package, use gitea's config system instead
- pkg: github.com/minio/sha256-simd
desc: use crypto/sha256 instead, see https://codeberg.org/forgejo/forgejo/pulls/1528
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-dirs: [node_modules, public, web_src]
exclude-case-sensitive: true
exclude-rules:
# Exclude some linters from running on tests files.
- path: models/db/sql_postgres_with_schema.go
linters:
- nolintlint
- path: _test\.go
linters:
- gocyclo
@ -115,19 +126,19 @@ issues:
- path: cmd
linters:
- forbidigo
- linters:
- text: "webhook"
linters:
- dupl
text: "webhook"
- linters:
- text: "`ID' should not be capitalized"
linters:
- gocritic
text: "`ID' should not be capitalized"
- linters:
- text: "swagger"
linters:
- unused
- deadcode
text: "swagger"
- linters:
- text: "argument x is overwritten before first use"
linters:
- staticcheck
text: "argument x is overwritten before first use"
- text: "commentFormatting: put a space between `//` and comment text"
linters:
- gocritic

View File

@ -4,6 +4,8 @@
/modules/options/bindata.go
/modules/public/bindata.go
/modules/templates/bindata.go
/vendor
/options/gitignore
/options/license
/public/assets
/vendor
node_modules

View File

@ -1,13 +1,12 @@
commands-show-output: false
fenced-code-language: false
first-line-h1: false
header-increment: false
heading-increment: false
line-length: {code_blocks: false, tables: false, stern: true, line_length: -1}
no-alt-text: false
no-bare-urls: false
no-blanks-blockquote: false
no-duplicate-header: {allow_different_nesting: true}
no-emphasis-as-header: false
no-emphasis-as-heading: false
no-empty-links: false
no-hard-tabs: {code_blocks: false}
no-inline-html: false

View File

@ -1,221 +0,0 @@
plugins:
- stylelint-declaration-strict-value
- stylelint-declaration-block-no-ignored-properties
- stylelint-stylistic
ignoreFiles:
- "**/*.go"
overrides:
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console.css", "font_i18n.css"]
rules:
scale-unlimited/declaration-strict-value: null
- files: ["**/chroma/*", "**/codemirror/*"]
rules:
block-no-empty: null
- files: ["**/*.vue"]
customSyntax: postcss-html
rules:
alpha-value-notation: null
annotation-no-unknown: true
at-rule-allowed-list: null
at-rule-disallowed-list: null
at-rule-empty-line-before: null
at-rule-no-unknown: true
at-rule-no-vendor-prefix: true
at-rule-property-required-list: null
block-no-empty: true
color-function-notation: null
color-hex-alpha: null
color-hex-length: null
color-named: null
color-no-hex: null
color-no-invalid-hex: true
comment-empty-line-before: null
comment-no-empty: true
comment-pattern: null
comment-whitespace-inside: null
comment-word-disallowed-list: null
custom-media-pattern: null
custom-property-empty-line-before: null
custom-property-no-missing-var-function: true
custom-property-pattern: null
declaration-block-no-duplicate-custom-properties: true
declaration-block-no-duplicate-properties: [true, {ignore: [consecutive-duplicates-with-different-values]}]
declaration-block-no-redundant-longhand-properties: null
declaration-block-no-shorthand-property-overrides: null
declaration-block-single-line-max-declarations: null
declaration-empty-line-before: null
declaration-no-important: null
declaration-property-max-values: null
declaration-property-unit-allowed-list: null
declaration-property-unit-disallowed-list: {line-height: [em]}
declaration-property-value-allowed-list: null
declaration-property-value-disallowed-list: null
declaration-property-value-no-unknown: true
font-family-name-quotes: always-where-recommended
font-family-no-duplicate-names: true
font-family-no-missing-generic-family-keyword: true
font-weight-notation: null
function-allowed-list: null
function-calc-no-unspaced-operator: true
function-disallowed-list: null
function-linear-gradient-no-nonstandard-direction: true
function-name-case: lower
function-no-unknown: null
function-url-no-scheme-relative: null
function-url-quotes: always
function-url-scheme-allowed-list: null
function-url-scheme-disallowed-list: null
hue-degree-notation: null
import-notation: string
keyframe-block-no-duplicate-selectors: true
keyframe-declaration-no-important: true
keyframe-selector-notation: null
keyframes-name-pattern: null
length-zero-no-unit: true
max-nesting-depth: null
media-feature-name-allowed-list: null
media-feature-name-disallowed-list: null
media-feature-name-no-unknown: true
media-feature-name-no-vendor-prefix: true
media-feature-name-unit-allowed-list: null
media-feature-name-value-allowed-list: null
media-feature-name-value-no-unknown: true
media-feature-range-notation: null
media-query-no-invalid: true
named-grid-areas-no-invalid: true
no-descending-specificity: null
no-duplicate-at-import-rules: true
no-duplicate-selectors: true
no-empty-source: true
no-invalid-double-slash-comments: true
no-invalid-position-at-import-rule: null
no-irregular-whitespace: true
no-unknown-animations: null
no-unknown-custom-properties: null
number-max-precision: null
plugin/declaration-block-no-ignored-properties: true
property-allowed-list: null
property-disallowed-list: null
property-no-unknown: true
property-no-vendor-prefix: null
rule-empty-line-before: null
rule-selector-property-disallowed-list: null
scale-unlimited/declaration-strict-value: [[color, background-color, border-color, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true}]
selector-attribute-name-disallowed-list: null
selector-attribute-operator-allowed-list: null
selector-attribute-operator-disallowed-list: null
selector-attribute-quotes: always
selector-class-pattern: null
selector-combinator-allowed-list: null
selector-combinator-disallowed-list: null
selector-disallowed-list: null
selector-id-pattern: null
selector-max-attribute: null
selector-max-class: null
selector-max-combinators: null
selector-max-compound-selectors: null
selector-max-id: null
selector-max-pseudo-class: null
selector-max-specificity: null
selector-max-type: null
selector-max-universal: null
selector-nested-pattern: null
selector-no-qualifying-type: null
selector-no-vendor-prefix: true
selector-not-notation: null
selector-pseudo-class-allowed-list: null
selector-pseudo-class-disallowed-list: null
selector-pseudo-class-no-unknown: true
selector-pseudo-element-allowed-list: null
selector-pseudo-element-colon-notation: double
selector-pseudo-element-disallowed-list: null
selector-pseudo-element-no-unknown: true
selector-type-case: lower
selector-type-no-unknown: [true, {ignore: [custom-elements]}]
shorthand-property-no-redundant-values: true
string-no-newline: true
stylistic/at-rule-name-case: null
stylistic/at-rule-name-newline-after: null
stylistic/at-rule-name-space-after: null
stylistic/at-rule-semicolon-newline-after: null
stylistic/at-rule-semicolon-space-before: null
stylistic/block-closing-brace-empty-line-before: null
stylistic/block-closing-brace-newline-after: null
stylistic/block-closing-brace-newline-before: null
stylistic/block-closing-brace-space-after: null
stylistic/block-closing-brace-space-before: null
stylistic/block-opening-brace-newline-after: null
stylistic/block-opening-brace-newline-before: null
stylistic/block-opening-brace-space-after: null
stylistic/block-opening-brace-space-before: null
stylistic/color-hex-case: lower
stylistic/declaration-bang-space-after: never
stylistic/declaration-bang-space-before: null
stylistic/declaration-block-semicolon-newline-after: null
stylistic/declaration-block-semicolon-newline-before: null
stylistic/declaration-block-semicolon-space-after: null
stylistic/declaration-block-semicolon-space-before: never
stylistic/declaration-block-trailing-semicolon: null
stylistic/declaration-colon-newline-after: null
stylistic/declaration-colon-space-after: null
stylistic/declaration-colon-space-before: never
stylistic/function-comma-newline-after: null
stylistic/function-comma-newline-before: null
stylistic/function-comma-space-after: null
stylistic/function-comma-space-before: null
stylistic/function-max-empty-lines: 0
stylistic/function-parentheses-newline-inside: never-multi-line
stylistic/function-parentheses-space-inside: null
stylistic/function-whitespace-after: null
stylistic/indentation: 2
stylistic/linebreaks: null
stylistic/max-empty-lines: 1
stylistic/max-line-length: null
stylistic/media-feature-colon-space-after: null
stylistic/media-feature-colon-space-before: never
stylistic/media-feature-name-case: null
stylistic/media-feature-parentheses-space-inside: null
stylistic/media-feature-range-operator-space-after: always
stylistic/media-feature-range-operator-space-before: always
stylistic/media-query-list-comma-newline-after: null
stylistic/media-query-list-comma-newline-before: null
stylistic/media-query-list-comma-space-after: null
stylistic/media-query-list-comma-space-before: null
stylistic/no-empty-first-line: null
stylistic/no-eol-whitespace: true
stylistic/no-extra-semicolons: true
stylistic/no-missing-end-of-source-newline: null
stylistic/number-leading-zero: null
stylistic/number-no-trailing-zeros: null
stylistic/property-case: lower
stylistic/selector-attribute-brackets-space-inside: null
stylistic/selector-attribute-operator-space-after: null
stylistic/selector-attribute-operator-space-before: null
stylistic/selector-combinator-space-after: null
stylistic/selector-combinator-space-before: null
stylistic/selector-descendant-combinator-no-non-space: null
stylistic/selector-list-comma-newline-after: null
stylistic/selector-list-comma-newline-before: null
stylistic/selector-list-comma-space-after: always-single-line
stylistic/selector-list-comma-space-before: never-single-line
stylistic/selector-max-empty-lines: 0
stylistic/selector-pseudo-class-case: lower
stylistic/selector-pseudo-class-parentheses-space-inside: never
stylistic/selector-pseudo-element-case: lower
stylistic/string-quotes: double
stylistic/unicode-bom: null
stylistic/unit-case: lower
stylistic/value-list-comma-newline-after: null
stylistic/value-list-comma-newline-before: null
stylistic/value-list-comma-space-after: null
stylistic/value-list-comma-space-before: null
stylistic/value-list-max-empty-lines: 0
time-min-milliseconds: null
unit-allowed-list: null
unit-disallowed-list: null
unit-no-unknown: true
value-keyword-case: null
value-no-vendor-prefix: [true, {ignoreValues: [box, inline-box]}]

View File

@ -24,8 +24,6 @@ rules:
document-start:
level: error
present: false
ignore: |
/.drone.yml
document-end:
present: false
@ -44,5 +42,3 @@ rules:
ignore: |
.venv
node_modules
/models/fixtures
/models/migrations/fixtures

View File

@ -42,13 +42,13 @@ GARGS = "--no-print-directory"
# The GNU convention is to use the lowercased `prefix` variable/macro to
# specify the installation directory. Humor them.
GPREFIX = ""
GPREFIX =
.if defined(PREFIX) && ! defined(prefix)
GPREFIX = 'prefix = "$(PREFIX)"'
.endif
.BEGIN: .SILENT
which $(GMAKE) || printf "Error: GNU Make is required!\n\n" 1>&2 && false
which $(GMAKE) || (printf "Error: GNU Make is required!\n\n" 1>&2 && false)
.PHONY: FRC
$(.TARGETS): FRC

File diff suppressed because it is too large Load Diff

40
CODEOWNERS Normal file
View File

@ -0,0 +1,40 @@
# This file describes the expected reviewers for a PR based on the changed
# files. Unlike what the name of the file suggests they don't own the code, but
# merely have a good understanding of that area of the codebase and therefore
# are usually suited as a reviewer.
# Please mind the alphabetic order of reviewers.
# Files related to the CI of the Forgejo project.
.forgejo/.* @dachary @earl-warren
# Files related to frontend development.
# Javascript and CSS code.
web_src/.* @caesar @crystal @gusted
# HTML templates used by the backend.
templates/.* @caesar @crystal @gusted
## the issue sidebar was touched by fnetx
templates/repo/issue/view_content/sidebar.* @fnetx
# Files related to Go development.
# The modules usually don't require much knowledge about Forgejo and could
# be reviewed by Go developers.
modules/.* @dachary @earl-warren @gusted
# Models has code related to SQL queries, general database knowledge and XORM.
models/.* @dachary @earl-warren @gusted
# The routers directory contains the most amount code that requires a good grasp
# of how Forgejo comes together. It's tedious to write good integration testing
# for code that lives in here.
routers/.* @dachary @earl-warren @gusted
# Let new strings be checked by the translation team.
options/locale/locale_en-US.ini @0ko
# Personal interest
.*/webhook.* @oliverpool

View File

@ -1,96 +0,0 @@
# Gitea Community Code of Conduct
## About
Online communities include people from many different backgrounds. The Gitea contributors are committed to providing a friendly, safe and welcoming environment for all, regardless of gender identity and expression, sexual orientation, disabilities, neurodiversity, physical appearance, body size, ethnicity, nationality, race, age, religion, or similar personal characteristics.
The first goal of the Code of Conduct is to specify a baseline standard of behavior so that people with different social values and communication styles can talk about Gitea effectively, productively, and respectfully.
The second goal is to provide a mechanism for resolving conflicts in the community when they arise.
The third goal of the Code of Conduct is to make our community welcoming to people from different backgrounds. Diversity is critical to the project; for Gitea to be successful, it needs contributors and users from all backgrounds.
We believe that healthy debate and disagreement are essential to a healthy project and community. However, it is never ok to be disrespectful. We value diverse opinions, but we value respectful behavior more.
## Community values
These are the values to which people in the Gitea community should aspire.
- **Be friendly and welcoming.**
- **Be patient.**
- Remember that people have varying communication styles and that not everyone is using their native language. (Meaning and tone can be lost in translation.)
- **Be thoughtful.**
- Productive communication requires effort. Think about how your words will be interpreted.
- Remember that sometimes it is best to refrain entirely from commenting.
- **Be respectful.**
- In particular, respect differences of opinion.
- **Be charitable.**
- Interpret the arguments of others in good faith, do not seek to disagree.
- When we do disagree, try to understand why.
- **Be constructive.**
- Avoid derailing: stay on topic; if you want to talk about something else, start a new conversation.
- Avoid unconstructive criticism: don't merely decry the current state of affairs; offer—or at least solicit—suggestions as to how things may be improved.
- Avoid snarking (pithy, unproductive, sniping comments)
- Avoid discussing potentially offensive or sensitive issues; this all too often leads to unnecessary conflict.
- Avoid microaggressions (brief and commonplace verbal, behavioral and environmental indignities that communicate hostile, derogatory or negative slights and insults to a person or group).
- **Be responsible.**
- What you say and do matters. Take responsibility for your words and actions, including their consequences, whether intended or otherwise.
People are complicated. You should expect to be misunderstood and to misunderstand others; when this inevitably occurs, resist the urge to be defensive or assign blame. Try not to take offense where no offense was intended. Give people the benefit of the doubt. Even if the intent was to provoke, do not rise to it. It is the responsibility of all parties to de-escalate conflict when it arises.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject: comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, as well as to ban (temporarily or permanently) any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
This Code of Conduct also applies outside the project spaces when the Project Stewards have a reasonable belief that an individuals behavior may have a negative impact on the project or its community.
### Conflict Resolution
We do not believe that all conflict is bad; healthy debate and disagreement often yield positive results. However, it is never okay to be disrespectful or to engage in behavior that violates the projects code of conduct.
If you see someone violating the code of conduct, you are encouraged to address the behavior directly with those involved. Many issues can be resolved quickly and easily, and this gives people more control over the outcome of their dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe.
Reports should be directed to the Gitea Project Stewards at conduct@gitea.com. It is the Project Stewards duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the technical-oversight-committee.
We will investigate every complaint, but you may not receive a direct response. We will use our discretion in determining when and how to follow up on reported incidents, which may range from not taking action to permanent expulsion from the project and project-sponsored spaces. Under normal circumstances, we will notify the accused of the report and provide them an opportunity to discuss it before any action is taken. If there is a consensus between maintainers that such an endeavor would be useless (i.e. in case of an obvious spammer), we reserve the right to take action without notifying the accused first. The identity of the reporter will be omitted from the details of the report supplied to the accused. In potentially harmful situations, such as ongoing harassment or threats to anyones safety, we may take action without notice.
### Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
## Summary
- Treat everyone with respect and kindness.
- Be thoughtful in how you communicate.
- Dont be destructive or inflammatory.
- If you encounter an issue, please mail conduct@gitea.com.

View File

@ -1,563 +1,7 @@
# Contribution Guidelines
# Forgejo Contributor Guide
<details><summary>Table of Contents</summary>
The Forgejo project is run by a community of people who are expected to follow this guide when cooperating on a simple bug fix as well as when changing the governance. For more information about the project, take a look at [the documentation explaining what Forgejo provides](README.md).
- [Contribution Guidelines](#contribution-guidelines)
- [Introduction](#introduction)
- [Issues](#issues)
- [How to report issues](#how-to-report-issues)
- [Types of issues](#types-of-issues)
- [Discuss your design before the implementation](#discuss-your-design-before-the-implementation)
- [Building Gitea](#building-gitea)
- [Dependencies](#dependencies)
- [Backend](#backend)
- [Frontend](#frontend)
- [Design guideline](#design-guideline)
- [Styleguide](#styleguide)
- [Copyright](#copyright)
- [Testing](#testing)
- [Translation](#translation)
- [Code review](#code-review)
- [Pull request format](#pull-request-format)
- [PR title and summary](#pr-title-and-summary)
- [Milestone](#milestone)
- [Labels](#labels)
- [Breaking PRs](#breaking-prs)
- [What is a breaking PR?](#what-is-a-breaking-pr)
- [How to handle breaking PRs?](#how-to-handle-breaking-prs)
- [Maintaining open PRs](#maintaining-open-prs)
- [Getting PRs merged](#getting-prs-merged)
- [Final call](#final-call)
- [Commit messages](#commit-messages)
- [PR Co-authors](#pr-co-authors)
- [PRs targeting `main`](#prs-targeting-main)
- [Backport PRs](#backport-prs)
- [Documentation](#documentation)
- [API v1](#api-v1)
- [GitHub API compatibility](#github-api-compatibility)
- [Adding/Maintaining API routes](#addingmaintaining-api-routes)
- [When to use what HTTP method](#when-to-use-what-http-method)
- [Requirements for API routes](#requirements-for-api-routes)
- [Backports and Frontports](#backports-and-frontports)
- [What is backported?](#what-is-backported)
- [How to backport?](#how-to-backport)
- [Format of backport PRs](#format-of-backport-prs)
- [Frontports](#frontports)
- [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco)
- [Release Cycle](#release-cycle)
- [Maintainers](#maintainers)
- [Technical Oversight Committee (TOC)](#technical-oversight-committee-toc)
- [Current TOC members](#current-toc-members)
- [Previous TOC/owners members](#previous-tocowners-members)
- [Governance Compensation](#governance-compensation)
- [TOC \& Working groups](#toc--working-groups)
- [Roadmap](#roadmap)
- [Versions](#versions)
- [Releasing Gitea](#releasing-gitea)
Sensitive security-related issues should be reported to [security@forgejo.org](mailto:security@forgejo.org) using [encryption](https://keyoxide.org/security@forgejo.org).
</details>
## Introduction
This document explains how to contribute changes to the Gitea project. \
It assumes you have followed the [installation instructions](https://docs.gitea.com/category/installation). \
Sensitive security-related issues should be reported to [security@gitea.io](mailto:security@gitea.io).
For configuring IDEs for Gitea development, see the [contributed IDE configurations](contrib/ide/).
## Issues
### How to report issues
Please search the issues on the issue tracker with a variety of related keywords to ensure that your issue has not already been reported.
If your issue has not been reported yet, [open an issue](https://github.com/go-gitea/gitea/issues/new)
and answer the questions so we can understand and reproduce the problematic behavior. \
Please write clear and concise instructions so that we can reproduce the behavior — even if it seems obvious. \
The more detailed and specific you are, the faster we can fix the issue. \
It is really helpful if you can reproduce your problem on a site running on the latest commits, i.e. <https://try.gitea.io>, as perhaps your problem has already been fixed on a current version. \
Please follow the guidelines described in [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html) for your report.
Please be kind, remember that Gitea comes at no cost to you, and you're getting free help.
### Types of issues
Typically, issues fall in one of the following categories:
- `bug`: Something in the frontend or backend behaves unexpectedly
- `security issue`: bug that has serious implications such as leaking another users data. Please do not file such issues on the public tracker and send a mail to security@gitea.io instead
- `feature`: Completely new functionality. You should describe this feature in enough detail that anyone who reads the issue can understand how it is supposed to be implemented
- `enhancement`: An existing feature should get an upgrade
- `refactoring`: Parts of the code base don't conform with other parts and should be changed to improve Gitea's maintainability
### Discuss your design before the implementation
We welcome submissions. \
If you want to change or add something, please let everyone know what you're working on — [file an issue](https://github.com/go-gitea/gitea/issues/new) or comment on an existing one before starting your work!
Significant changes such as new features must go through the change proposal process before they can be accepted. \
This is mainly to save yourself the trouble of implementing it, only to find out that your proposed implementation has some potential problems. \
Furthermore, this process gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits inside
the goals for the project and tools.
Pull requests should not be the place for architecture discussions.
## Building Gitea
See the [development setup instructions](https://docs.gitea.com/development/hacking-on-gitea).
## Dependencies
### Backend
Go dependencies are managed using [Go Modules](https://golang.org/cmd/go/#hdr-Module_maintenance). \
You can find more details in the [go mod documentation](https://go.dev/ref/mod) and the [Go Modules Wiki](https://github.com/golang/go/wiki/Modules).
Pull requests should only modify `go.mod` and `go.sum` where it is related to your change, be it a bugfix or a new feature. \
Apart from that, these files should only be modified by Pull Requests whose only purpose is to update dependencies.
The `go.mod`, `go.sum` update needs to be justified as part of the PR description,
and must be verified by the reviewers and/or merger to always reference
an existing upstream commit.
### Frontend
For the frontend, we use [npm](https://www.npmjs.com/).
The same restrictions apply for frontend dependencies as for backend dependencies, with the exceptions that the files for it are `package.json` and `package-lock.json`, and that new versions must always reference an existing version.
## Design guideline
Depending on your change, please read the
- [backend development guideline](https://docs.gitea.com/contributing/guidelines-backend)
- [frontend development guideline](https://docs.gitea.com/contributing/guidelines-frontend)
- [refactoring guideline](https://docs.gitea.com/contributing/guidelines-refactoring)
## Styleguide
You should always run `make fmt` before committing to conform to Gitea's styleguide.
## Copyright
New code files that you contribute should use the standard copyright header:
```
// Copyright <current year> The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
```
Afterwards, copyright should only be modified when the copyright author changes.
## Testing
Before submitting a pull request, run all tests to make sure your changes don't cause a regression elsewhere.
Here's how to run the test suite:
- code lint
| | |
| :-------------------- | :---------------------------------------------------------------- |
|``make lint`` | lint everything (not needed if you only change the front- **or** backend) |
|``make lint-frontend`` | lint frontend files |
|``make lint-backend`` | lint backend files |
- run tests (we suggest running them on Linux)
| Command | Action | |
| :------------------------------------- | :----------------------------------------------- | ------------ |
|``make test[\#SpecificTestName]`` | run unit test(s) |
|``make test-sqlite[\#SpecificTestName]``| run [integration](tests/integration) test(s) for SQLite |[More details](tests/integration/README.md) |
|``make test-e2e-sqlite[\#SpecificTestName]``| run [end-to-end](tests/e2e) test(s) for SQLite |[More details](tests/e2e/README.md) |
## Translation
All translation work happens on [Crowdin](https://crowdin.com/project/gitea).
The only translation that is maintained in this repository is [the English translation](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini).
It is synced regularly with Crowdin. \
Other locales on main branch **should not** be updated manually as they will be overwritten with each sync. \
Once a language has reached a **satisfactory percentage** of translated keys (~25%), it will be synced back into this repo and included in the next released version.
The tool `go run build/backport-locale.go` can be used to backport locales from the main branch to release branches that were missed.
## Code review
### Pull request format
Please try to make your pull request easy to review for us. \
For that, please read the [*Best Practices for Faster Reviews*](https://github.com/kubernetes/community/blob/261cb0fd089b64002c91e8eddceebf032462ccd6/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) guide. \
It has lots of useful tips for any project you may want to contribute to. \
Some of the key points:
- Make small pull requests. \
The smaller, the faster to review and the more likely it will be merged soon.
- Don't make changes unrelated to your PR. \
Maybe there are typos on some comments, maybe refactoring would be welcome on a function... \
but if that is not related to your PR, please make *another* PR for that.
- Split big pull requests into multiple small ones. \
An incremental change will be faster to review than a huge PR.
- Allow edits by maintainers. This way, the maintainers will take care of merging the PR later on instead of you.
### PR title and summary
In the PR title, describe the problem you are fixing, not how you are fixing it. \
Use the first comment as a summary of your PR. \
In the PR summary, you can describe exactly how you are fixing this problem. \
Keep this summary up-to-date as the PR evolves. \
If your PR changes the UI, you must add **after** screenshots in the PR summary. \
If you are not implementing a new feature, you should also post **before** screenshots for comparison. \
If your PR closes some issues, you must note that in a way that both GitHub and Gitea understand, i.e. by appending a paragraph like
```text
Fixes/Closes/Resolves #<ISSUE_NR_X>.
Fixes/Closes/Resolves #<ISSUE_NR_Y>.
```
to your summary. \
Each issue that will be closed must stand on a separate line.
### Milestone
A PR should only be assigned to a milestone if it will likely be merged into the given version. \
As a rule of thumb, assume that a PR will stay open for an additional month for every 100 added lines. \
PRs without a milestone may not be merged.
### Labels
Every PR should be labeled correctly with every label that applies. \
This includes especially the distinction between `bug` (fixing existing functionality), `feature` (new functionality), `enhancement` (upgrades for existing functionality), and `refactoring` (improving the internal code structure without changing the output (much)). \
Furthermore,
- the amount of pending required approvals
- whether this PR is `blocked`, a `backport` or `breaking`
- if it targets the `ui` or `api`
- if it increases the application `speed`
- reduces `memory usage`
are oftentimes notable labels.
### Breaking PRs
#### What is a breaking PR?
A PR is breaking if it meets one of the following criteria:
- It changes API output in an incompatible way for existing users
- It removes a setting that an admin could previously set (i.e. via `app.ini`)
- An admin must do something manually to restore the old behavior
In particular, this means that adding new settings is not breaking.\
Changing the default value of a setting or replacing the setting with another one is breaking, however.
#### How to handle breaking PRs?
If your PR has a breaking change, you must add a `BREAKING` section to your PR summary, e.g.
```
## :warning: BREAKING :warning:
```
To explain how this will affect users and how to mitigate these changes.
### Maintaining open PRs
The moment you create a non-draft PR or the moment you convert a draft PR to a non-draft PR is the moment code review starts for it. \
Once that happens, do not rebase or squash your branch anymore as it makes it difficult to review the new changes. \
Merge the base branch into your branch only when you really need to, i.e. because of conflicting changes in the mean time. \
This reduces unnecessary CI runs. \
Don't worry about merge commits messing up your commit history as every PR will be squash merged. \
This means that all changes are joined into a single new commit whose message is as described below.
### Getting PRs merged
Changes to Gitea must be reviewed before they are accepted — no matter who
makes the change, even if they are an owner or a maintainer. \
The only exception are critical bugs that prevent Gitea from being compiled or started. \
Specifically, we require two approvals from maintainers for every PR. \
Once this criteria has been met, your PR receives the `lgtm/done` label. \
From this point on, your only responsibility is to fix merge conflicts or respond to/implement requests by maintainers. \
It is the responsibility of the maintainers from this point to get your PR merged.
If a PR has the `lgtm/done` label and there are no open discussions or merge conflicts anymore, any maintainer can add the `reviewed/wait-merge` label. \
This label means that the PR is part of the merge queue and will be merged as soon as possible. \
The merge queue will be cleared in the order of the list below:
<https://github.com/go-gitea/gitea/pulls?q=is%3Apr+label%3Areviewed%2Fwait-merge+sort%3Acreated-asc+is%3Aopen>
Gitea uses it's own tool, the <https://github.com/GiteaBot/gitea-backporter> to automate parts of the review process. \
This tool does the things listed below automatically:
- create a backport PR if needed once the initial PR was merged
- remove the PR from the merge queue after the PR merged
- keep the oldest branch in the merge queue up to date with merges
### Final call
If a PR has been ignored for more than 7 days with no comments or reviews, and the author or any maintainer believes it will not survive a long wait (such as a refactoring PR), they can send "final call" to the TOC by mentioning them in a comment.
After another 7 days, if there is still zero approval, this is considered a polite refusal, and the PR will be closed to avoid wasting further time. Therefore, the "final call" has a cost, and should be used cautiously.
However, if there are no objections from maintainers, the PR can be merged with only one approval from the TOC (not the author).
### Commit messages
Mergers are able and required to rewrite the PR title and summary (the first comment of a PR) so that it can produce an easily understandable commit message if necessary. \
The final commit message should no longer contain any uncertainty such as `hopefully, <x> won't happen anymore`. Replace uncertainty with certainty.
#### PR Co-authors
A person counts as a PR co-author the moment they (co-)authored a commit that is not simply a `Merge base branch into branch` commit. \
Mergers are required to remove such "false-positive" co-authors when writing the commit message. \
The true co-authors must remain in the commit message.
#### PRs targeting `main`
The commit message of PRs targeting `main` is always
```bash
$PR_TITLE ($PR_INDEX)
$REWRITTEN_PR_SUMMARY
```
#### Backport PRs
The commit message of backport PRs is always
```bash
$PR_TITLE ($INITIAL_PR_INDEX) ($BACKPORT_PR_INDEX)
$REWRITTEN_PR_SUMMARY
```
## Documentation
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated in the same PR.
## API v1
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [the GitHub API](https://docs.github.com/en/rest).
### GitHub API compatibility
Gitea's API should use the same endpoints and fields as the GitHub API as far as possible, unless there are good reasons to deviate. \
If Gitea provides functionality that GitHub does not, a new endpoint can be created. \
If information is provided by Gitea that is not provided by the GitHub API, a new field can be used that doesn't collide with any GitHub fields. \
Updating an existing API should not remove existing fields unless there is a really good reason to do so. \
The same applies to status responses. If you notice a problem, feel free to leave a comment in the code for future refactoring to API v2 (which is currently not planned).
### Adding/Maintaining API routes
All expected results (errors, success, fail messages) must be documented ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L319-L327)). \
All JSON input types must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L76-L91)) \
and referenced in [routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/options.go). \
They can then be used like [this example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L318). \
All JSON responses must be defined as a struct in [modules/structs/](modules/structs/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L36-L68)) \
and referenced in its category in [routers/api/v1/swagger/](routers/api/v1/swagger/) ([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/issue.go#L11-L16)) \
They can be used like [this example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L277-L279).
### When to use what HTTP method
In general, HTTP methods are chosen as follows:
- **GET** endpoints return the requested object(s) and status **OK (200)**
- **DELETE** endpoints return the status **No Content (204)** and no content either
- **POST** endpoints are used to **create** new objects (e.g. a User) and return the status **Created (201)** and the created object
- **PUT** endpoints are used to **add/assign** existing Objects (e.g. a user to a team) and return the status **No Content (204)** and no content either
- **PATCH** endpoints are used to **edit/change** an existing object and return the changed object and the status **OK (200)**
### Requirements for API routes
All parameters of endpoints changing/editing an object must be optional (except the ones to identify the object, which are required).
Endpoints returning lists must
- support pagination (`page` & `limit` options in query)
- set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))
## Backports and Frontports
### What is backported?
We backport PRs given the following circumstances:
1. Feature freeze is active, but `<version>-rc0` has not been released yet. Here, we backport as much as possible. <!-- TODO: Is that our definition with the new backport bot? -->
2. `rc0` has been released. Here, we only backport bug- and security-fixes, and small enhancements. Large PRs such as refactors are not backported anymore. <!-- TODO: Is that our definition with the new backport bot? -->
3. We never backport new features.
4. We never backport breaking changes except when
1. The breaking change has no effect on the vast majority of users
2. The component triggering the breaking change is marked as experimental
### How to backport?
In the past, it was necessary to manually backport your PRs. \
Now, that's not a requirement anymore as our [backport bot](https://github.com/GiteaBot) tries to create backports automatically once the PR is merged when the PR
- does not have the label `backport/manual`
- has the label `backport/<version>`
The `backport/manual` label signifies either that you want to backport the change yourself, or that there were conflicts when backporting, thus you **must** do it yourself.
### Format of backport PRs
The title of backport PRs should be
```
<original PR title> (#<original pr number>)
```
The first two lines of the summary of the backporting PR should be
```
Backport #<original pr number>
```
with the rest of the summary and labels matching the original PR.
### Frontports
Frontports behave exactly as described above for backports.
## Developer Certificate of Origin (DCO)
We consider the act of contributing to the code by submitting a Pull Request as the "Sign off" or agreement to the certifications and terms of the [DCO](DCO) and [MIT license](LICENSE). \
No further action is required. \
You can also decide to sign off your commits by adding the following line at the end of your commit messages:
```
Signed-off-by: Joe Smith <joe.smith@email.com>
```
If you set the `user.name` and `user.email` Git config options, you can add the line to the end of your commits automatically with `git commit -s`.
We assume in good faith that the information you provide is legally binding.
## Release Cycle
We adopted a release schedule to streamline the process of working on, finishing, and issuing releases. \
The overall goal is to make a major release every three or four months, which breaks down into two or three months of general development followed by one month of testing and polishing known as the release freeze. \
All the feature pull requests should be
merged before feature freeze. And, during the frozen period, a corresponding
release branch is open for fixes backported from main branch. Release candidates
are made during this period for user testing to
obtain a final version that is maintained in this branch.
During a development cycle, we may also publish any necessary minor releases
for the previous version. For example, if the latest, published release is
v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are
still possible.
## Maintainers
To make sure every PR is checked, we have [maintainers](MAINTAINERS). \
Every PR **must** be reviewed by at least two maintainers (or owners) before it can get merged. \
For refactoring PRs after a week and documentation only PRs, the approval of only one maintainer is enough. \
A maintainer should be a contributor of Gitea and contributed at least
4 accepted PRs. A contributor should apply as a maintainer in the
[Discord](https://discord.gg/Gitea) `#develop` channel. The team maintainers may invite the contributor. A maintainer
should spend some time on code reviews. If a maintainer has no
time to do that, they should apply to leave the maintainers team
and we will give them the honor of being a member of the [advisors
team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if
an advisor has time to code review, we will gladly welcome them back
to the maintainers team. If a maintainer is inactive for more than 3
months and forgets to leave the maintainers team, the owners may move
him or her from the maintainers team to the advisors team.
For security reasons, Maintainers should use 2FA for their accounts and
if possible provide GPG signed commits.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
https://help.github.com/articles/signing-commits-with-gpg/
## Technical Oversight Committee (TOC)
At the start of 2023, the `Owners` team was dissolved. Instead, the governance charter proposed a technical oversight committee (TOC) which expands the ownership team of the Gitea project from three elected positions to six positions. Three positions would be elected as it has been over the past years, and the other three would consist of appointed members from the Gitea company.
https://blog.gitea.com/quarterly-23q1/
When the new community members have been elected, the old members will give up ownership to the newly elected members. For security reasons, TOC members or any account with write access (like a bot) must use 2FA.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
### Current TOC members
- 2023-01-01 ~ 2023-12-31 - https://blog.gitea.com/quarterly-23q1/
- Company
- [Jason Song](https://gitea.com/wolfogre) <i@wolfogre.com>
- [Lunny Xiao](https://gitea.com/lunny) <xiaolunwen@gmail.com>
- [Matti Ranta](https://gitea.com/techknowlogick) <techknowlogick@gitea.io>
- Community
- [6543](https://gitea.com/6543) <6543@obermui.de>
- [Andrew Thornton](https://gitea.com/zeripath) <art27@cantab.net>
- [John Olheiser](https://gitea.com/jolheiser) <john.olheiser@gmail.com>
### Previous TOC/owners members
Here's the history of the owners and the time they served:
- [Lunny Xiao](https://gitea.com/lunny) - 2016, 2017, [2018](https://github.com/go-gitea/gitea/issues/3255), [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
- [Kim Carlbäcker](https://github.com/bkcsoft) - 2016, 2017
- [Thomas Boerger](https://gitea.com/tboerger) - 2016, 2017
- [Lauris Bukšis-Haberkorns](https://gitea.com/lafriks) - [2018](https://github.com/go-gitea/gitea/issues/3255), [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801)
- [Matti Ranta](https://gitea.com/techknowlogick) - [2019](https://github.com/go-gitea/gitea/issues/5572), [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
- [Andrew Thornton](https://gitea.com/zeripath) - [2020](https://github.com/go-gitea/gitea/issues/9230), [2021](https://github.com/go-gitea/gitea/issues/13801), [2022](https://github.com/go-gitea/gitea/issues/17872)
## Governance Compensation
Each member of the community elected TOC will be granted $500 each month as compensation for their work.
Furthermore, any community release manager for a specific release or LTS will be compensated $500 for the delivery of said release.
These funds will come from community sources like the OpenCollective rather than directly from the company.
Only non-company members are eligible for this compensation, and if a member of the community TOC takes the responsibility of release manager, they would only be compensated for their TOC duties.
Gitea Ltd employees are not eligible to receive any funds from the OpenCollective unless it is reimbursement for a purchase made for the Gitea project itself.
## TOC & Working groups
With Gitea covering many projects outside of the main repository, several groups will be created to help focus on specific areas instead of requiring maintainers to be a jack-of-all-trades. Maintainers are of course more than welcome to be part of multiple groups should they wish to contribute in multiple places.
The currently proposed groups are:
- **Core Group**: maintain the primary Gitea repository
- **Integration Group**: maintain the Gitea ecosystem's related tools, including go-sdk/tea/changelog/bots etc.
- **Documentation Group**: maintain related documents and repositories
- **Translation Group**: coordinate with translators and maintain translations
- **Security Group**: managed by TOC directly, members are decided by TOC, maintains security patches/responsible for security items
## Roadmap
Each year a roadmap will be discussed with the entire Gitea maintainers team, and feedback will be solicited from various stakeholders.
TOC members need to review the roadmap every year and work together on the direction of the project.
When a vote is required for a proposal or other change, the vote of community elected TOC members count slightly more than the vote of company elected TOC members. With this approach, we both avoid ties and ensure that changes align with the mission statement and community opinion.
You can visit our roadmap on the wiki.
## Versions
Gitea has the `main` branch as a tip branch and has version branches
such as `release/v1.19`. `release/v1.19` is a release branch and we will
tag `v1.19.0` for binary download. If `v1.19.0` has bugs, we will accept
pull requests on the `release/v1.19` branch and publish a `v1.19.1` tag,
after bringing the bug fix also to the main branch.
Since the `main` branch is a tip version, if you wish to use Gitea
in production, please download the latest release tag version. All the
branches will be protected via GitHub, all the PRs to every branch must
be reviewed by two maintainers and must pass the automatic tests.
## Releasing Gitea
- Let $vmaj, $vmin and $vpat be Major, Minor and Patch version numbers, $vpat should be rc1, rc2, 0, 1, ...... $vmaj.$vmin will be kept the same as milestones on github or gitea in future.
- Before releasing, confirm all the version's milestone issues or PRs has been resolved. Then discuss the release on Discord channel #maintainers and get agreed with almost all the owners and mergers. Or you can declare the version and if nobody against in about serval hours.
- If this is a big version first you have to create PR for changelog on branch `main` with PRs with label `changelog` and after it has been merged do following steps:
- Create `-dev` tag as `git tag -s -F release.notes v$vmaj.$vmin.0-dev` and push the tag as `git push origin v$vmaj.$vmin.0-dev`.
- When CI has finished building tag then you have to create a new branch named `release/v$vmaj.$vmin`
- If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
- Add a tag as `git tag -s -F release.notes v$vmaj.$vmin.$`, release.notes file could be a temporary file to only include the changelog this version which you added to `CHANGELOG.md`.
- And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically create a release and upload all the compiled binary. (But currently it doesn't add the release notes automatically. Maybe we should fix that.)
- If needed send a frontport PR for the changelog to branch `main` and update the version in `docs/config.yaml` to refer to the new version.
- Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.
- Verify all release assets were correctly published through CI on dl.gitea.com and GitHub releases. Once ACKed:
- bump the version of https://dl.gitea.com/gitea/version.json
- merge the blog post PR
- announce the release in discord `#announcements`
You can find links to the different aspects of Developer documentation on this page: [Forgejo developer guide](https://forgejo.org/docs/next/developer/).

View File

@ -1,30 +1,68 @@
#Build stage
FROM docker.io/library/golang:1.21-alpine3.18 AS build-env
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.22-alpine3.19 as build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
ARG GITEA_VERSION
ARG RELEASE_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS
#Build deps
#
# Transparently cross compile for the target platform
#
COPY --from=xx / /
ARG TARGETPLATFORM
RUN apk --no-cache add clang lld
RUN xx-apk --no-cache add gcc musl-dev
ENV CGO_ENABLED=1
RUN xx-go --wrap
#
# for go generate and binfmt to find
# without it the generate phase will fail with
# #19 25.04 modules/public/public_bindata.go:8: running "go": exit status 1
# #19 25.39 aarch64-binfmt-P: Could not open '/lib/ld-musl-aarch64.so.1': No such file or directory
# why exactly is it needed? where is binfmt involved?
#
RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
RUN apk --no-cache add build-base git nodejs npm
#Setup repo
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
#Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean-all build
RUN make clean
RUN make frontend
RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini
RUN make RELEASE_VERSION=$RELEASE_VERSION go-check generate-backend static-executable && xx-verify gitea
# Begin env-to-ini build
RUN go build contrib/environment-to-ini/environment-to-ini.go
# Copy local files
COPY docker/root /tmp/local
FROM docker.io/library/alpine:3.18
LABEL maintainer="maintainers@gitea.io"
# Set permissions
RUN chmod 755 /tmp/local/usr/bin/entrypoint \
/tmp/local/usr/local/bin/gitea \
/tmp/local/etc/s6/gitea/* \
/tmp/local/etc/s6/openssh/* \
/tmp/local/etc/s6/.s6-svscan/* \
/go/src/code.gitea.io/gitea/gitea \
/go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
FROM code.forgejo.org/oci/golang:1.22-alpine3.19
ARG RELEASE_VERSION
LABEL maintainer="contact@forgejo.org" \
org.opencontainers.image.authors="Forgejo" \
org.opencontainers.image.url="https://forgejo.org" \
org.opencontainers.image.documentation="https://forgejo.org/download/#container-image" \
org.opencontainers.image.source="https://codeberg.org/forgejo/forgejo" \
org.opencontainers.image.version="${RELEASE_VERSION}" \
org.opencontainers.image.vendor="Forgejo" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.title="Forgejo. Beyond coding. We forge." \
org.opencontainers.image.description="Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job."
EXPOSE 22 3000
@ -39,7 +77,8 @@ RUN apk --no-cache add \
s6 \
sqlite \
su-exec \
gnupg
gnupg \
&& rm -rf /var/cache/apk/*
RUN addgroup \
-S -g 1000 \
@ -61,10 +100,8 @@ VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
COPY docker/root /
COPY --from=build-env /tmp/local /
RUN cd /usr/local/bin ; ln -s gitea forgejo
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh

View File

@ -1,30 +1,65 @@
#Build stage
FROM docker.io/library/golang:1.21-alpine3.18 AS build-env
FROM --platform=$BUILDPLATFORM docker.io/tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.22-alpine3.19 as build-env
ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
ARG GITEA_VERSION
ARG RELEASE_VERSION
ARG TAGS="sqlite sqlite_unlock_notify"
ENV TAGS "bindata timetzdata $TAGS"
ARG CGO_EXTRA_CFLAGS
#Build deps
#
# Transparently cross compile for the target platform
#
COPY --from=xx / /
ARG TARGETPLATFORM
RUN apk --no-cache add clang lld
RUN xx-apk --no-cache add gcc musl-dev
ENV CGO_ENABLED=1
RUN xx-go --wrap
#
# for go generate and binfmt to find
# without it the generate phase will fail with
# #19 25.04 modules/public/public_bindata.go:8: running "go": exit status 1
# #19 25.39 aarch64-binfmt-P: Could not open '/lib/ld-musl-aarch64.so.1': No such file or directory
# why exactly is it needed? where is binfmt involved?
#
RUN cp /*-alpine-linux-musl*/lib/ld-musl-*.so.1 /lib || true
RUN apk --no-cache add build-base git nodejs npm
#Setup repo
COPY . ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
#Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean-all build
RUN make clean
RUN make frontend
RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini
RUN make RELEASE_VERSION=$RELEASE_VERSION go-check generate-backend static-executable && xx-verify gitea
# Begin env-to-ini build
RUN go build contrib/environment-to-ini/environment-to-ini.go
# Copy local files
COPY docker/rootless /tmp/local
FROM docker.io/library/alpine:3.18
LABEL maintainer="maintainers@gitea.io"
# Set permissions
RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
/tmp/local/usr/local/bin/docker-setup.sh \
/tmp/local/usr/local/bin/gitea \
/go/src/code.gitea.io/gitea/gitea \
/go/src/code.gitea.io/gitea/environment-to-ini
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
FROM code.forgejo.org/oci/golang:1.22-alpine3.19
LABEL maintainer="contact@forgejo.org" \
org.opencontainers.image.authors="Forgejo" \
org.opencontainers.image.url="https://forgejo.org" \
org.opencontainers.image.documentation="https://forgejo.org/download/#container-image" \
org.opencontainers.image.source="https://codeberg.org/forgejo/forgejo" \
org.opencontainers.image.version="${RELEASE_VERSION}" \
org.opencontainers.image.vendor="Forgejo" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.title="Forgejo. Beyond coding. We forge." \
org.opencontainers.image.description="Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job."
EXPOSE 2222 3000
@ -35,7 +70,8 @@ RUN apk --no-cache add \
gettext \
git \
curl \
gnupg
gnupg \
&& rm -rf /var/cache/apk/*
RUN addgroup \
-S -g 1000 \
@ -51,12 +87,11 @@ RUN addgroup \
RUN mkdir -p /var/lib/gitea /etc/gitea
RUN chown git:git /var/lib/gitea /etc/gitea
COPY docker/rootless /
COPY --from=build-env /tmp/local /
RUN cd /usr/local/bin ; ln -s gitea forgejo
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-setup.sh /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
RUN chmod 644 /etc/profile.d/gitea_bash_autocomplete.sh
#git:git
USER 1000:1000
@ -65,8 +100,11 @@ ENV GITEA_CUSTOM /var/lib/gitea/custom
ENV GITEA_TEMP /tmp/gitea
ENV TMPDIR /tmp/gitea
#TODO add to docs the ability to define the ini to load (useful to test and revert a config)
ENV GITEA_APP_INI /etc/gitea/app.ini
# Legacy config file for backwards compatibility
# TODO: remove on next major version release
ENV GITEA_APP_INI_LEGACY /etc/gitea/app.ini
ENV GITEA_APP_INI ${GITEA_CUSTOM}/conf/app.ini
ENV HOME "/var/lib/gitea/git"
VOLUME ["/var/lib/gitea", "/etc/gitea"]
WORKDIR /var/lib/gitea

View File

@ -1,3 +1,4 @@
Copyright (c) 2022 The Forgejo Authors
Copyright (c) 2016 The Gitea Authors
Copyright (c) 2015 The Gogs Authors

View File

@ -1,59 +0,0 @@
Alexey Makhov <amakhov@avito.ru> (@makhov)
Bo-Yi Wu <appleboy.tw@gmail.com> (@appleboy)
Ethan Koenig <ethantkoenig@gmail.com> (@ethantkoenig)
Kees de Vries <bouwko@gmail.com> (@Bwko)
Kim Carlbäcker <kim.carlbacker@gmail.com> (@bkcsoft)
LefsFlare <nobody@nobody.tld> (@LefsFlarey)
Lunny Xiao <xiaolunwen@gmail.com> (@lunny)
Rachid Zarouali <nobody@nobody.tld> (@xinity)
Rémy Boulanouar <admin@dblk.org> (@DblK)
Sandro Santilli <strk@kbt.io> (@strk)
Thibault Meyer <meyer.thibault@gmail.com> (@0xbaadf00d)
Thomas Boerger <thomas@webhippie.de> (@tboerger)
Patrick G <geek1011@outlook.com> (@geek1011)
Antoine Girard <sapk@sapk.fr> (@sapk)
Lauris Bukšis-Haberkorns <lauris@nix.lv> (@lafriks)
Jonas Östanbäck <jonas.ostanback@gmail.com> (@cez81)
David Schneiderbauer <dschneiderbauer@gmail.com> (@daviian)
Peter Žeby <morlinest@gmail.com> (@morlinest)
Matti Ranta <techknowlogick@gitea.io> (@techknowlogick)
Jonas Franz <info@jonasfranz.software> (@jonasfranz)
Alexey Terentyev <axifnx@gmail.com> (@axifive)
Lanre Adelowo <yo@lanre.wtf> (@adelowo)
Konrad Langenberg <k@knt.li> (@kolaente)
He-Long Zhang <outman99@hotmail.com> (@BetaCat0)
Andrew Thornton <art27@cantab.net> (@zeripath)
John Olheiser <john.olheiser@gmail.com> (@jolheiser)
Richard Mahn <rich.mahn@unfoldingword.org> (@richmahn)
Mrsdizzie <info@mrsdizzie.com> (@mrsdizzie)
silverwind <me@silverwind.io> (@silverwind)
Gary Kim <gary@garykim.dev> (@gary-kim)
Guillermo Prandi <gitea.maint@mailfilter.com.ar> (@guillep2k)
Mura Li <typeless@ctli.io> (@typeless)
6543 <6543@obermui.de> (@6543)
jaqra <jaqra@hotmail.com> (@jaqra)
David Svantesson <davidsvantesson@gmail.com> (@davidsvantesson)
a1012112796 <1012112796@qq.com> (@a1012112796)
Karl Heinz Marbaise <kama@soebes.de> (@khmarbaise)
Norwin Roosen <git@nroo.de> (@noerw)
Kyle Dumont <kdumontnu@gmail.com> (@kdumontnu)
Patrick Schratz <patrick.schratz@gmail.com> (@pat-s)
Janis Estelmann <admin@oldschoolhack.me> (@KN4CK3R)
Steven Kriegler <sk.bunsenbrenner@gmail.com> (@justusbunsi)
Jimmy Praet <jimmy.praet@telenet.be> (@jpraet)
Leon Hofmeister <dev.lh@web.de> (@delvh)
Wim <wim@42.be> (@42wim)
Jason Song <i@wolfogre.com> (@wolfogre)
Yarden Shoham <git@yardenshoham.com> (@yardenshoham)
Yu Tian <zettat123@gmail.com> (@Zettat123)
Eddie Yang <576951401@qq.com> (@yp05327)
Dong Ge <gedong_1994@163.com> (@sillyguodong)
Xinyi Gong <hestergong@gmail.com> (@HesterG)
wxiaoguang <wxiaoguang@gmail.com> (@wxiaoguang)
Gary Moon <gary@garymoon.net> (@garymoon)
Philip Peterson <philip.c.peterson@gmail.com> (@philip-peterson)
Denys Konovalov <kontakt@denyskon.de> (@denyskon)
Punit Inani <punitinani1@gmail.com> (@puni9869)
CaiCandong <1290147055@qq.com> (@caicandong)
Rui Chen <rui@chenrui.dev> (@chenrui333)
Nanguan Lin <nanguanlin6@gmail.com> (@lng2020)

455
Makefile
View File

@ -22,37 +22,41 @@ GO ?= go
SHASUM ?= shasum -a 256
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
COMMA := ,
DIFF ?= diff --unified
XGO_VERSION := go-1.21.x
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.44.0
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.7.0
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.5.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.1
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5
AIR_PACKAGE ?= github.com/cosmtrek/air@v1 # renovate: datasource=go
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v2/cmd/editorconfig-checker@2.8.0 # renovate: datasource=go
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.6.0 # renovate: datasource=go
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0 # renovate: datasource=go
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11 # renovate: datasource=go
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.5.1 # renovate: datasource=go
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # renovate: datasource=go
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1.0.1
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.6.25
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0 # renovate: datasource=go
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 # renovate: datasource=go
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.6.27 # renovate: datasource=go
DEADCODE_PACKAGE ?= golang.org/x/tools/internal/cmd/deadcode@v0.14.0 # renovate: datasource=go
GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.4.0 # renovate: datasource=go
DOCKER_IMAGE ?= gitea/gitea
DOCKER_TAG ?= latest
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
ifeq ($(HAS_GO), yes)
GOPATH ?= $(shell $(GO) env GOPATH)
export PATH := $(GOPATH)/bin:$(PATH)
CGO_EXTRA_CFLAGS := -DSQLITE_MAX_VARIABLE_NUMBER=32766
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
endif
ifeq ($(OS), Windows_NT)
GOFLAGS := -v -buildmode=exe
EXECUTABLE ?= gitea.exe
else ifeq ($(OS), Windows)
ifeq ($(GOOS),windows)
IS_WINDOWS := yes
else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
ifeq ($(GOOS),)
IS_WINDOWS := yes
endif
endif
ifeq ($(IS_WINDOWS),yes)
GOFLAGS := -v -buildmode=exe
EXECUTABLE ?= gitea.exe
else
@ -79,45 +83,54 @@ endif
STORED_VERSION_FILE := VERSION
HUGO_VERSION ?= 0.111.3
GITHUB_REF_TYPE ?= branch
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
GITEA_COMPATIBILITY ?= gitea-1.22.0
ifneq ($(GITHUB_REF_TYPE),branch)
VERSION ?= $(subst v,,$(GITHUB_REF_NAME))
GITEA_VERSION ?= $(VERSION)
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
ifneq ($(STORED_VERSION),)
FORGEJO_VERSION ?= $(STORED_VERSION)
else
ifneq ($(GITHUB_REF_NAME),)
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))
else
VERSION ?= main
endif
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
ifneq ($(STORED_VERSION),)
GITEA_VERSION ?= $(STORED_VERSION)
else
GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
endif
ifneq ($(GITEA_VERSION),)
FORGEJO_VERSION ?= $(GITEA_VERSION)
FORGEJO_VERSION_API ?= $(GITEA_VERSION)+${GITEA_COMPATIBILITY}
else
# drop the "g" prefix prepended by git describe to the commit hash
FORGEJO_VERSION ?= $(shell git describe --exclude '*-test' --tags --always | sed 's/^v//' | sed 's/\-g/-/')+${GITEA_COMPATIBILITY}
endif
endif
FORGEJO_VERSION_MAJOR=$(shell echo $(FORGEJO_VERSION) | sed -e 's/\..*//')
FORGEJO_VERSION_MINOR=$(shell echo $(FORGEJO_VERSION) | sed -E -e 's/^([0-9]+\.[0-9]+).*/\1/')
# if version = "main" then update version to "nightly"
ifeq ($(VERSION),main)
VERSION := main-nightly
endif
show-version-full:
@echo ${FORGEJO_VERSION}
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
show-version-major:
@echo ${FORGEJO_VERSION_MAJOR}
show-version-minor:
@echo ${FORGEJO_VERSION_MINOR}
RELEASE_VERSION ?= ${FORGEJO_VERSION}
VERSION ?= ${RELEASE_VERSION}
FORGEJO_VERSION_API ?= ${FORGEJO_VERSION}
show-version-api:
@echo ${FORGEJO_VERSION_API}
LDFLAGS := $(LDFLAGS) -X "main.ReleaseVersion=$(RELEASE_VERSION)" -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(FORGEJO_VERSION)" -X "main.Tags=$(TAGS)" -X "main.ForgejoVersion=$(FORGEJO_VERSION_API)"
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
ifeq ($(HAS_GO), yes)
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) $(shell $(GO) list code.gitea.io/gitea/models/forgejo_migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
endif
FOMANTIC_WORK_DIR := web_src/fomantic
WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
WEBPACK_CONFIGS := webpack.config.js
WEBPACK_CONFIGS := webpack.config.js tailwind.config.js
WEBPACK_DEST := public/assets/js/index.js public/assets/css/index.css
WEBPACK_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts public/assets/img/webpack
WEBPACK_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))
@ -142,11 +155,19 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMAN
GO_DIRS := build cmd models modules routers services tests
WEB_DIRS := web_src/js web_src/css
ESLINT_FILES := web_src/js tools *.js tests/e2e
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(wildcard *.go *.js *.md *.yml *.yaml *.toml)
GO_SOURCES := $(wildcard *.go)
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" ! -path modules/options/bindata.go ! -path modules/public/bindata.go ! -path modules/templates/bindata.go)
GO_SOURCES += $(GENERATED_GO_DEST)
GO_SOURCES_NO_BINDATA := $(GO_SOURCES)
ifeq ($(HAS_GO), yes)
MIGRATION_PACKAGES := $(shell $(GO) list code.gitea.io/gitea/models/migrations/... code.gitea.io/gitea/models/forgejo_migrations/...)
endif
ifeq ($(filter $(TAGS_SPLIT),bindata),bindata)
GO_SOURCES += $(BINDATA_DEST)
GENERATED_GO_DEST += $(BINDATA_DEST)
@ -157,29 +178,24 @@ ifdef DEPS_PLAYWRIGHT
PLAYWRIGHT_FLAGS += --with-deps
endif
FORGEJO_API_SPEC := public/assets/forgejo/api.v1.yml
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|g
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape \| Safe}}/api/v1"|"basePath": "/api/v1"|g
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl \| JSEscape}}/api/v1"|g
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl \| JSEscape}}/api/v1"|"basePath": "/api/v1"|g
SWAGGER_EXCLUDE := code.gitea.io/sdk
SWAGGER_NEWLINE_COMMAND := -e '$$a\'
SWAGGER_SPEC_BRANDING := s|Gitea API|Forgejo API|g
TEST_MYSQL_HOST ?= mysql:3306
TEST_MYSQL_DBNAME ?= testgitea
TEST_MYSQL_USERNAME ?= root
TEST_MYSQL_PASSWORD ?=
TEST_MYSQL8_HOST ?= mysql8:3306
TEST_MYSQL8_DBNAME ?= testgitea
TEST_MYSQL8_USERNAME ?= root
TEST_MYSQL8_PASSWORD ?=
TEST_PGSQL_HOST ?= pgsql:5432
TEST_PGSQL_DBNAME ?= testgitea
TEST_PGSQL_USERNAME ?= postgres
TEST_PGSQL_PASSWORD ?= postgres
TEST_PGSQL_SCHEMA ?= gtestschema
TEST_MSSQL_HOST ?= mssql:1433
TEST_MSSQL_DBNAME ?= gitea
TEST_MSSQL_USERNAME ?= sa
TEST_MSSQL_PASSWORD ?= MwantsaSecurePassword1
.PHONY: all
all: build
@ -208,6 +224,9 @@ help:
@echo " - lint-frontend-fix lint frontend files and fix issues"
@echo " - lint-backend lint backend files"
@echo " - lint-backend-fix lint backend files and fix issues"
@echo " - lint-codespell lint typos"
@echo " - lint-codespell-fix lint typos and fix them automatically"
@echo " - lint-codespell-fix-i lint typos and fix them interactively"
@echo " - lint-go lint go files"
@echo " - lint-go-fix lint go files and fix issues"
@echo " - lint-go-vet lint go files with vet"
@ -219,13 +238,18 @@ help:
@echo " - lint-swagger lint swagger files"
@echo " - lint-templates lint template files"
@echo " - lint-yaml lint yaml files"
@echo " - lint-spell lint spelling"
@echo " - lint-spell-fix lint spelling and fix issues"
@echo " - checks run various consistency checks"
@echo " - checks-frontend check frontend files"
@echo " - checks-backend check backend files"
@echo " - test test everything"
@echo " - show-version-full show the same version as the API endpoint"
@echo " - show-version-major show major release number only"
@echo " - test-frontend test frontend files"
@echo " - test-backend test backend files"
@echo " - test-e2e[\#TestSpecificName] test end to end using playwright"
@echo " - test-e2e-sqlite[\#name.test.e2e] test end to end using playwright and sqlite"
@echo " - update update js and py dependencies"
@echo " - update-js update js dependencies"
@echo " - update-py update py dependencies"
@echo " - webpack build webpack files"
@ -236,6 +260,9 @@ help:
@echo " - generate-license update license files"
@echo " - generate-gitignore update gitignore files"
@echo " - generate-manpage generate manpage"
@echo " - generate-gomock generate gomock files"
@echo " - generate-forgejo-api generate the forgejo API from spec"
@echo " - forgejo-api-validate check if the forgejo API matches the specs"
@echo " - generate-swagger generate the swagger spec from code comments"
@echo " - swagger-validate check if the swagger spec is valid"
@echo " - go-licenses regenerate go licenses"
@ -277,20 +304,19 @@ clean-all: clean
.PHONY: clean
clean:
$(GO) clean -i ./...
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) $(BINDATA_HASH) \
integrations*.test \
e2e*.test \
tests/integration/gitea-integration-pgsql/ tests/integration/gitea-integration-mysql/ tests/integration/gitea-integration-mysql8/ tests/integration/gitea-integration-sqlite/ \
tests/integration/gitea-integration-mssql/ tests/integration/indexers-mysql/ tests/integration/indexers-mysql8/ tests/integration/indexers-pgsql tests/integration/indexers-sqlite \
tests/integration/indexers-mssql tests/mysql.ini tests/mysql8.ini tests/pgsql.ini tests/mssql.ini man/ \
tests/e2e/gitea-e2e-pgsql/ tests/e2e/gitea-e2e-mysql/ tests/e2e/gitea-e2e-mysql8/ tests/e2e/gitea-e2e-sqlite/ \
tests/e2e/gitea-e2e-mssql/ tests/e2e/indexers-mysql/ tests/e2e/indexers-mysql8/ tests/e2e/indexers-pgsql/ tests/e2e/indexers-sqlite/ \
tests/e2e/indexers-mssql/ tests/e2e/reports/ tests/e2e/test-artifacts/ tests/e2e/test-snapshots/
tests/integration/gitea-integration-* \
tests/integration/indexers-* \
tests/mysql.ini tests/pgsql.ini man/ \
tests/e2e/gitea-e2e-*/ \
tests/e2e/indexers-*/ \
tests/e2e/reports/ tests/e2e/test-artifacts/ tests/e2e/test-snapshots/
.PHONY: fmt
fmt:
GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
@GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
$(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl'))
@# strip whitespace after '{{' or '(' and before '}}' or ')' unless there is only
@# whitespace before it
@ -301,16 +327,8 @@ fmt:
.PHONY: fmt-check
fmt-check: fmt
@diff=$$(git diff --color=always $(GO_SOURCES) templates $(WEB_DIRS)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi
.PHONY: misspell-check
misspell-check:
go run $(MISSPELL_PACKAGE) -error $(GO_DIRS) $(WEB_DIRS)
@git diff --exit-code --color=always $(GO_SOURCES) templates $(WEB_DIRS) \
|| (code=$$?; echo "Please run 'make fmt' and commit the result"; exit $${code})
.PHONY: $(TAGS_EVIDENCE)
$(TAGS_EVIDENCE):
@ -321,6 +339,23 @@ ifneq "$(TAGS)" "$(shell cat $(TAGS_EVIDENCE) 2>/dev/null)"
TAGS_PREREQ := $(TAGS_EVIDENCE)
endif
OAPI_CODEGEN_PACKAGE ?= github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.12.4
KIN_OPENAPI_CODEGEN_PACKAGE ?= github.com/getkin/kin-openapi/cmd/validate@v0.114.0
FORGEJO_API_SERVER = routers/api/forgejo/v1/generated.go
.PHONY: generate-forgejo-api
generate-forgejo-api: $(FORGEJO_API_SPEC)
$(GO) run $(OAPI_CODEGEN_PACKAGE) -package v1 -generate chi-server,types $< > $(FORGEJO_API_SERVER)
.PHONY: forgejo-api-check
forgejo-api-check: generate-forgejo-api
@git diff --exit-code --color=always $(FORGEJO_API_SERVER) \
|| (code=$$?; echo "Please run 'make generate-forgejo-api' and commit the result"; exit $${code})
.PHONY: forgejo-api-validate
forgejo-api-validate:
$(GO) run $(KIN_OPENAPI_CODEGEN_PACKAGE) $(FORGEJO_API_SPEC)
.PHONY: generate-swagger
generate-swagger: $(SWAGGER_SPEC)
@ -328,15 +363,12 @@ $(SWAGGER_SPEC): $(GO_SOURCES_NO_BINDATA)
$(GO) run $(SWAGGER_PACKAGE) generate spec -x "$(SWAGGER_EXCLUDE)" -o './$(SWAGGER_SPEC)'
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
$(SED_INPLACE) '$(SWAGGER_SPEC_BRANDING)' './$(SWAGGER_SPEC)'
.PHONY: swagger-check
swagger-check: generate-swagger
@diff=$$(git diff --color=always '$(SWAGGER_SPEC)'); \
if [ -n "$$diff" ]; then \
echo "Please run 'make generate-swagger' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi
@git diff --exit-code --color=always '$(SWAGGER_SPEC)' \
|| (code=$$?; echo "Please run 'make generate-swagger' and commit the result"; exit $${code})
.PHONY: swagger-validate
swagger-validate:
@ -351,13 +383,13 @@ checks: checks-frontend checks-backend
checks-frontend: lockfile-check svg-check
.PHONY: checks-backend
checks-backend: tidy-check swagger-check fmt-check misspell-check swagger-validate security-check
checks-backend: tidy-check swagger-check fmt-check swagger-validate security-check
.PHONY: lint
lint: lint-frontend lint-backend
lint: lint-frontend lint-backend lint-spell
.PHONY: lint-fix
lint-fix: lint-frontend-fix lint-backend-fix
lint-fix: lint-frontend-fix lint-backend-fix lint-spell-fix
.PHONY: lint-frontend
lint-frontend: lint-js lint-css
@ -371,21 +403,33 @@ lint-backend: lint-go lint-go-vet lint-editorconfig
.PHONY: lint-backend-fix
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
.PHONY: lint-codespell
lint-codespell:
codespell
.PHONY: lint-codespell-fix
lint-codespell-fix:
codespell -w
.PHONY: lint-codespell-fix-i
lint-codespell-fix-i:
codespell -w -i 3 -C 2
.PHONY: lint-js
lint-js: node_modules
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js tests/e2e
npx eslint --color --max-warnings=0 --ext js,vue $(ESLINT_FILES)
.PHONY: lint-js-fix
lint-js-fix: node_modules
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js tests/e2e --fix
npx eslint --color --max-warnings=0 --ext js,vue $(ESLINT_FILES) --fix
.PHONY: lint-css
lint-css: node_modules
npx stylelint --color --max-warnings=0 web_src/css web_src/js/components/*.vue
npx stylelint --color --max-warnings=0 $(STYLELINT_FILES)
.PHONY: lint-css-fix
lint-css-fix: node_modules
npx stylelint --color --max-warnings=0 web_src/css web_src/js/components/*.vue --fix
npx stylelint --color --max-warnings=0 $(STYLELINT_FILES) --fix
.PHONY: lint-swagger
lint-swagger: node_modules
@ -395,13 +439,25 @@ lint-swagger: node_modules
lint-md: node_modules
npx markdownlint docs *.md
.PHONY: lint-spell
lint-spell: lint-codespell
@go run $(MISSPELL_PACKAGE) -error $(SPELLCHECK_FILES)
.PHONY: lint-spell-fix
lint-spell-fix: lint-codespell-fix
@go run $(MISSPELL_PACKAGE) -w $(SPELLCHECK_FILES)
.PHONY: lint-go
lint-go:
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS)
$(GO) run $(DEADCODE_PACKAGE) -generated=false -test code.gitea.io/gitea > .cur-deadcode-out
@$(DIFF) .deadcode-out .cur-deadcode-out \
|| (code=$$?; echo "Please run 'make lint-go-fix' and commit the result"; exit $${code})
.PHONY: lint-go-fix
lint-go-fix:
$(GO) run $(GOLANGCI_LINT_PACKAGE) run --fix
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix
$(GO) run $(DEADCODE_PACKAGE) -generated=false -test code.gitea.io/gitea > .deadcode-out
# workaround step for the lint-go-windows CI task because 'go run' can not
# have distinct GOOS/GOARCH for its build and run steps
@ -413,19 +469,19 @@ lint-go-windows:
.PHONY: lint-go-vet
lint-go-vet:
@echo "Running go vet..."
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
@$(GO) vet -vettool=gitea-vet $(GO_PACKAGES)
@$(GO) vet ./...
.PHONY: lint-editorconfig
lint-editorconfig:
$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates .github/workflows
$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates .forgejo/workflows
.PHONY: lint-actions
lint-actions:
$(GO) run $(ACTIONLINT_PACKAGE)
.PHONY: lint-templates
lint-templates: .venv
lint-templates: .venv node_modules
@node tools/lint-templates-svg.js
@poetry run djlint $(shell find templates -type f -iname '*.tmpl')
.PHONY: lint-yaml
@ -434,7 +490,7 @@ lint-yaml: .venv
.PHONY: watch
watch:
@bash build/watch.sh
@bash tools/watch.sh
.PHONY: watch-frontend
watch-frontend: node-check node_modules
@ -497,12 +553,8 @@ vendor: go.mod go.sum
.PHONY: tidy-check
tidy-check: tidy
@diff=$$(git diff --color=always go.mod go.sum $(GO_LICENSE_FILE)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make tidy' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi
@git diff --exit-code --color=always go.mod go.sum $(GO_LICENSE_FILE) \
|| (code=$$?; echo "Please run 'make tidy' and commit the result"; exit $${code})
.PHONY: go-licenses
go-licenses: $(GO_LICENSE_FILE)
@ -550,27 +602,6 @@ test-mysql\#%: integrations.mysql.test generate-ini-mysql
.PHONY: test-mysql-migration
test-mysql-migration: migrations.mysql.test migrations.individual.mysql.test
generate-ini-mysql8:
sed -e 's|{{TEST_MYSQL8_HOST}}|${TEST_MYSQL8_HOST}|g' \
-e 's|{{TEST_MYSQL8_DBNAME}}|${TEST_MYSQL8_DBNAME}|g' \
-e 's|{{TEST_MYSQL8_USERNAME}}|${TEST_MYSQL8_USERNAME}|g' \
-e 's|{{TEST_MYSQL8_PASSWORD}}|${TEST_MYSQL8_PASSWORD}|g' \
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \
-e 's|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \
tests/mysql8.ini.tmpl > tests/mysql8.ini
.PHONY: test-mysql8
test-mysql8: integrations.mysql8.test generate-ini-mysql8
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./integrations.mysql8.test
.PHONY: test-mysql8\#%
test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./integrations.mysql8.test -test.run $(subst .,/,$*)
.PHONY: test-mysql8-migration
test-mysql8-migration: migrations.mysql8.test migrations.individual.mysql8.test
generate-ini-pgsql:
sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
-e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \
@ -593,30 +624,8 @@ test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql
.PHONY: test-pgsql-migration
test-pgsql-migration: migrations.pgsql.test migrations.individual.pgsql.test
generate-ini-mssql:
sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \
-e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
-e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
-e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \
-e 's|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \
tests/mssql.ini.tmpl > tests/mssql.ini
.PHONY: test-mssql
test-mssql: integrations.mssql.test generate-ini-mssql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./integrations.mssql.test
.PHONY: test-mssql\#%
test-mssql\#%: integrations.mssql.test generate-ini-mssql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./integrations.mssql.test -test.run $(subst .,/,$*)
.PHONY: test-mssql-migration
test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test
.PHONY: playwright
playwright: $(PLAYWRIGHT_DIR)
npm install --no-save @playwright/test
playwright: deps-frontend
npx playwright install $(PLAYWRIGHT_FLAGS)
.PHONY: test-e2e%
@ -629,43 +638,36 @@ test-e2e: test-e2e-sqlite
.PHONY: test-e2e-sqlite
test-e2e-sqlite: playwright e2e.sqlite.test generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./e2e.sqlite.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./e2e.sqlite.test -test.run TestE2e
.PHONY: test-e2e-sqlite\#%
test-e2e-sqlite\#%: playwright e2e.sqlite.test generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./e2e.sqlite.test -test.run TestE2e/$*
.PHONY: test-e2e-sqlite-firefox\#%
test-e2e-sqlite-firefox\#%: playwright e2e.sqlite.test generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini PLAYWRIGHT_PROJECT=firefox ./e2e.sqlite.test -test.run TestE2e/$*
.PHONY: test-e2e-mysql
test-e2e-mysql: playwright e2e.mysql.test generate-ini-mysql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./e2e.mysql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./e2e.mysql.test -test.run TestE2e
.PHONY: test-e2e-mysql\#%
test-e2e-mysql\#%: playwright e2e.mysql.test generate-ini-mysql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./e2e.mysql.test -test.run TestE2e/$*
.PHONY: test-e2e-mysql8
test-e2e-mysql8: playwright e2e.mysql8.test generate-ini-mysql8
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./e2e.mysql8.test
.PHONY: test-e2e-mysql8\#%
test-e2e-mysql8\#%: playwright e2e.mysql8.test generate-ini-mysql8
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./e2e.mysql8.test -test.run TestE2e/$*
.PHONY: test-e2e-pgsql
test-e2e-pgsql: playwright e2e.pgsql.test generate-ini-pgsql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./e2e.pgsql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./e2e.pgsql.test -test.run TestE2e
.PHONY: test-e2e-pgsql\#%
test-e2e-pgsql\#%: playwright e2e.pgsql.test generate-ini-pgsql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./e2e.pgsql.test -test.run TestE2e/$*
.PHONY: test-e2e-mssql
test-e2e-mssql: playwright e2e.mssql.test generate-ini-mssql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./e2e.mssql.test
.PHONY: test-e2e-mssql\#%
test-e2e-mssql\#%: playwright e2e.mssql.test generate-ini-mssql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./e2e.mssql.test -test.run TestE2e/$*
.PHONY: test-e2e-debugserver
test-e2e-debugserver: e2e.sqlite.test generate-ini-sqlite
sed -i s/3003/3000/g tests/sqlite.ini
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./e2e.sqlite.test -test.run TestDebugserver -test.timeout 24h
.PHONY: bench-sqlite
bench-sqlite: integrations.sqlite.test generate-ini-sqlite
@ -675,10 +677,6 @@ bench-sqlite: integrations.sqlite.test generate-ini-sqlite
bench-mysql: integrations.mysql.test generate-ini-mysql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./integrations.mysql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
.PHONY: bench-mssql
bench-mssql: integrations.mssql.test generate-ini-mssql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./integrations.mssql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
.PHONY: bench-pgsql
bench-pgsql: integrations.pgsql.test generate-ini-pgsql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./integrations.pgsql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
@ -694,15 +692,9 @@ integration-test-coverage-sqlite: integrations.cover.sqlite.test generate-ini-sq
integrations.mysql.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test
integrations.mysql8.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql8.test
integrations.pgsql.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test
integrations.mssql.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mssql.test
integrations.sqlite.test: git-check $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)'
@ -717,21 +709,11 @@ migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./migrations.mysql.test
.PHONY: migrations.mysql8.test
migrations.mysql8.test: $(GO_SOURCES) generate-ini-mysql8
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql8.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./migrations.mysql8.test
.PHONY: migrations.pgsql.test
migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./migrations.pgsql.test
.PHONY: migrations.mssql.test
migrations.mssql.test: $(GO_SOURCES) generate-ini-mssql
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mssql.test
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./migrations.mssql.test
.PHONY: migrations.sqlite.test
migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
@ -739,45 +721,28 @@ migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
.PHONY: migrations.individual.mysql.test
migrations.individual.mysql.test: $(GO_SOURCES)
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
for pkg in $(MIGRATION_PACKAGES); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1; \
done
.PHONY: migrations.individual.mysql8.test
migrations.individual.mysql8.test: $(GO_SOURCES)
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
done
.PHONY: migrations.individual.mysql8.test\#%
.PHONY: migrations.individual.sqlite.test\#%
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
.PHONY: migrations.individual.pgsql.test
migrations.individual.pgsql.test: $(GO_SOURCES)
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
for pkg in $(MIGRATION_PACKAGES); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1;\
done
.PHONY: migrations.individual.pgsql.test\#%
migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
.PHONY: migrations.individual.mssql.test
migrations.individual.mssql.test: $(GO_SOURCES) generate-ini-mssql
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg -test.failfast; \
done
.PHONY: migrations.individual.mssql.test\#%
migrations.individual.mssql.test\#%: $(GO_SOURCES) generate-ini-mssql
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
.PHONY: migrations.individual.sqlite.test
migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
for pkg in $(MIGRATION_PACKAGES); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1; \
done
.PHONY: migrations.individual.sqlite.test\#%
@ -787,15 +752,9 @@ migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
e2e.mysql.test: $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test
e2e.mysql8.test: $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql8.test
e2e.pgsql.test: $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test
e2e.mssql.test: $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mssql.test
e2e.sqlite.test: $(GO_SOURCES)
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)'
@ -825,7 +784,11 @@ generate-backend: $(TAGS_PREREQ) generate-go
.PHONY: generate-go
generate-go: $(TAGS_PREREQ)
@echo "Running go generate..."
@CC= GOOS= GOARCH= $(GO) generate -tags '$(TAGS)' $(GO_PACKAGES)
@CC= GOOS= GOARCH= CGO_ENABLED=0 $(GO) generate -tags '$(TAGS)' ./...
.PHONY: merge-locales
merge-locales:
@echo "NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY"
.PHONY: security-check
security-check:
@ -834,8 +797,17 @@ security-check:
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
forgejo: $(EXECUTABLE)
ln -f $(EXECUTABLE) forgejo
static-executable: $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE)
.PHONY: release
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-docs release-check
release: frontend generate release-linux release-copy release-compress vendor release-sources release-check
# just the sources, with all assets builtin and frontend resources generated
sources-tarbal: frontend generate vendor release-sources release-check
$(DIST_DIRS):
mkdir -p $(DIST_DIRS)
@ -849,7 +821,10 @@ endif
.PHONY: release-linux
release-linux: | $(DIST_DIRS)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) .
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out forgejo-$(VERSION) .
ifeq ($(CI),true)
cp /build/* $(DIST)/binaries
endif
.PHONY: release-darwin
release-darwin: | $(DIST_DIRS)
@ -877,18 +852,14 @@ release-sources: | $(DIST_DIRS)
# bsdtar needs a ^ to prevent matching subdirectories
$(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./)
# use transform to a add a release-folder prefix; in bsdtar the transform parameter equivalent is -s
$(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'" || echo "--transform 's|^./|gitea-src-$(VERSION)/|'"))
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
$(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./forgejo-src-$(VERSION)/'" || echo "--transform 's|^./|forgejo-src-$(VERSION)/|'"))
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/forgejo-src-$(VERSION).tar.gz .
rm -f $(STORED_VERSION_FILE)
.PHONY: release-docs
release-docs: | $(DIST_DIRS) docs
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs .
.PHONY: docs
docs:
cd docs; bash scripts/trans-copy.sh;
.PHONY: deps
deps: deps-frontend deps-backend deps-tools deps-py
@ -915,15 +886,19 @@ deps-tools:
$(GO) install $(GO_LICENSES_PACKAGE)
$(GO) install $(GOVULNCHECK_PACKAGE)
$(GO) install $(ACTIONLINT_PACKAGE)
$(GO) install $(GOMOCK_PACKAGE)
node_modules: package-lock.json
npm install --no-save
@touch node_modules
.venv: poetry.lock
poetry install
poetry install --no-root
@touch .venv
.PHONY: update
update: update-js update-py
.PHONY: update-js
update-js: node-check | node_modules
npx updates -u -f package.json
@ -935,7 +910,7 @@ update-js: node-check | node_modules
update-py: node-check | node_modules
npx updates -u -f pyproject.toml
rm -rf .venv poetry.lock
poetry install
poetry install --no-root
@touch .venv
.PHONY: fomantic
@ -944,6 +919,7 @@ fomantic:
cd $(FOMANTIC_WORK_DIR) && npm install --no-save
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
$(SED_INPLACE) -e 's/ overrideBrowserslist\r/ overrideBrowserslist: ["defaults"]\r/g' $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/tasks/config/tasks.js
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
# fomantic uses "touchstart" as click event for some browsers, it's not ideal, so we force fomantic to always use "click" as click event
$(SED_INPLACE) -e 's/clickEvent[ \t]*=/clickEvent = "click", unstableClickEvent =/g' $(FOMANTIC_WORK_DIR)/build/semantic.js
@ -955,35 +931,27 @@ webpack: $(WEBPACK_DEST)
$(WEBPACK_DEST): $(WEBPACK_SOURCES) $(WEBPACK_CONFIGS) package-lock.json
@$(MAKE) -s node-check node_modules
rm -rf $(WEBPACK_DEST_ENTRIES)
npx webpack
@rm -rf $(WEBPACK_DEST_ENTRIES)
@echo "Running webpack..."
@BROWSERSLIST_IGNORE_OLD_DATA=true npx webpack
@touch $(WEBPACK_DEST)
.PHONY: svg
svg: node-check | node_modules
rm -rf $(SVG_DEST_DIR)
node build/generate-svg.js
node tools/generate-svg.js
.PHONY: svg-check
svg-check: svg
@git add $(SVG_DEST_DIR)
@diff=$$(git diff --color=always --cached $(SVG_DEST_DIR)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make svg' and 'git add $(SVG_DEST_DIR)' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi
@git diff --exit-code --color=always --cached $(SVG_DEST_DIR) \
|| (code=$$?; echo "Please run 'make svg' and commit the result"; exit $${code})
.PHONY: lockfile-check
lockfile-check:
npm install --package-lock-only
@diff=$$(git diff --color=always package-lock.json); \
if [ -n "$$diff" ]; then \
echo "package-lock.json is inconsistent with package.json"; \
echo "Please run 'npm install --package-lock-only' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi
@git diff --exit-code --color=always package-lock.json \
|| (code=$$?; echo "Please run 'npm install --package-lock-only' and commit the result"; exit $${code})
.PHONY: update-translations
update-translations:
@ -1003,10 +971,14 @@ generate-license:
generate-gitignore:
$(GO) run build/generate-gitignores.go
.PHONY: generate-gomock
generate-gomock:
$(GO) run $(GOMOCK_PACKAGE) -package mock -destination ./modules/queue/mock/redisuniversalclient.go github.com/redis/go-redis/v9 UniversalClient
.PHONY: generate-images
generate-images: | node_modules
npm install --no-save --no-package-lock fabric@5 imagemin-zopfli@7
node build/generate-images.js $(TAGS)
npm install --no-save fabric@6.0.0-beta20 imagemin-zopfli@7
node tools/generate-images.js $(TAGS)
.PHONY: generate-manpage
generate-manpage:
@ -1023,3 +995,8 @@ docker:
# This endif closes the if at the top of the file
endif
# Disable parallel execution because it would break some targets that don't
# specify exact dependencies like 'backend' which does currently not depend
# on 'frontend' to enable Node.js-less builds from source tarballs.
.NOTPARALLEL:

201
README.md
View File

@ -1,177 +1,46 @@
<p align="center">
<a href="https://gitea.io/">
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/assets/img/gitea.svg" width="220"/>
</a>
</p>
<h1 align="center">Gitea - Git with a cup of tea</h1>
<div align="center">
<img src="./assets/logo.svg" alt="" width="192" align="center" />
<h1 align="center">Welcome to Forgejo</h1>
</div>
<p align="center">
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
</a>
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
<img src="https://img.shields.io/discord/322538954119184384.svg">
</a>
<a href="https://app.codecov.io/gh/go-gitea/gitea" title="Codecov">
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
</a>
<a href="https://goreportcard.com/report/code.gitea.io/gitea" title="Go Report Card">
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
</a>
<a href="https://pkg.go.dev/code.gitea.io/gitea" title="GoDoc">
<img src="https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg">
</a>
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
</a>
<a href="https://www.codetriage.com/go-gitea/gitea" title="Help Contribute to Open Source">
<img src="https://www.codetriage.com/go-gitea/gitea/badges/users.svg">
</a>
<a href="https://opencollective.com/gitea" title="Become a backer/sponsor of gitea">
<img src="https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen">
</a>
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
</a>
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
<img
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
alt="Contribute with Gitpod"
/>
</a>
<a href="https://crowdin.com/project/gitea" title="Crowdin">
<img src="https://badges.crowdin.net/gitea/localized.svg">
</a>
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
</a>
<a href="https://app.bountysource.com/teams/gitea" title="Bountysource">
<img src="https://img.shields.io/bountysource/team/gitea/activity">
</a>
</p>
Hi there! Tired of big platforms playing monopoly?
Providing Git hosting for your project, friends, company or community?
**Forgejo** (/for'd&#865;ʒe.jo/ inspired by forĝejo the Esperanto word for *forge*) has you covered with its intuitive interface,
light and easy hosting and a lot of builtin functionality.
<p align="center">
<a href="README_ZH.md">View this document in Chinese</a>
</p>
Forgejo was [created in 2022](https://forgejo.org/2022-12-15-hello-forgejo/)
because we think that the project should be owned by an independent community.
If you second that, then Forgejo is for you!
Our promise: **Independent Free/Libre Software forever!**
## Purpose
## What does Forgejo offer?
The goal of this project is to make the easiest, fastest, and most
painless way of setting up a self-hosted Git service.
<!-- If you want to know what Forgejo is like,
you can check out public instances,
e.g. [Codeberg.org](https://codeberg.org).
-->
As Gitea is written in Go, it works across **all** the platforms and
architectures that are supported by Go, including Linux, macOS, and
Windows on x86, amd64, ARM and PowerPC architectures.
You can try it out using [the online demo](https://try.gitea.io/).
This project has been
[forked](https://blog.gitea.com/welcome-to-gitea/) from
[Gogs](https://gogs.io) since November of 2016, but a lot has changed.
If you like any of the following, Forgejo is literally meant for you:
## Building
- Lightweight: Forgejo can easily be hosted on nearly **every machine**.
Running on a Raspberry? Small cloud instance? No problem!
- Project management: Besides Git hosting, Forgejo offers issues,
pull requests, wikis, kanban boards and much more to **coordinate with your team**.
- Publishing: Have something to share? Use **releases** to host your software for download,
or use the **package registry** to publish it for docker, npm and many other package managers.
- Customizable: Want to change your look? Change some settings?
There are many **config switches** to make Forgejo work exactly like you want.
- Powerful: Organizations & team permissions, CI integration, Code Search, LDAP, OAuth and much more.
If you have **advanced needs**, Forgejo has you covered.
- Privacy: From update checker to default settings: Forgejo is built to be **privacy first** for you and your crew.
- Federation: (WIP) We are actively working to connect software forges with each other through **ActivityPub**,
and create a collaborative network of personal instances.
From the root of the source tree, run:
## Learn more
TAGS="bindata" make build
Dive into the [documentation](https://forgejo.org/docs/latest/), subscribe to releases and blog post on [our website](https://forgejo.org), <a href="https://floss.social/@forgejo" rel="me">find us on the Fediverse</a> or hop into [our Matrix room](https://matrix.to/#/#forgejo-chat:matrix.org) if you have any questions or want to get involved.
or if SQLite support is required:
TAGS="bindata sqlite sqlite_unlock_notify" make build
## Get involved
The `build` target is split into two sub-targets:
- `make backend` which requires [Go Stable](https://go.dev/dl/), the required version is defined in [go.mod](/go.mod).
- `make frontend` which requires [Node.js LTS](https://nodejs.org/en/download/) or greater.
Internet connectivity is required to download the go and npm modules. When building from the official source tarballs which include pre-built frontend files, the `frontend` target will not be triggered, making it possible to build without Node.js.
Parallelism (`make -j <num>`) is not supported.
More info: https://docs.gitea.com/installation/install-from-source
## Using
./gitea web
NOTE: If you're interested in using our APIs, we have experimental
support with [documentation](https://try.gitea.io/api/swagger).
## Contributing
Expected workflow is: Fork -> Patch -> Push -> Pull Request
NOTES:
1. **YOU MUST READ THE [CONTRIBUTORS GUIDE](CONTRIBUTING.md) BEFORE STARTING TO WORK ON A PULL REQUEST.**
2. If you have found a vulnerability in the project, please write privately to **security@gitea.io**. Thanks!
## Translating
Translations are done through Crowdin. If you want to translate to a new language ask one of the managers in the Crowdin project to add a new language there.
You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope to fill it as questions pop up.
https://docs.gitea.com/contributing/localization
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
## Further information
For more information and instructions about how to install Gitea, please look at our [documentation](https://docs.gitea.com/).
If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://discourse.gitea.io/).
We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea).
The official Gitea CLI is developed at [gitea/tea](https://gitea.com/gitea/tea).
## Authors
- [Maintainers](https://github.com/orgs/go-gitea/people)
- [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
- [Translators](options/locale/TRANSLATORS)
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/gitea#backer)]
<a href="https://opencollective.com/gitea#backers" target="_blank"><img src="https://opencollective.com/gitea/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/gitea#sponsor)]
<a href="https://opencollective.com/gitea/sponsor/0/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/1/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/2/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/3/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/4/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/5/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/6/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
## FAQ
**How do you pronounce Gitea?**
Gitea is pronounced [/ɡɪti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea" with a hard g.
**Why is this not hosted on a Gitea instance?**
We're [working on it](https://github.com/go-gitea/gitea/issues/1029).
## License
This project is licensed under the MIT License.
See the [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) file
for the full license text.
## Screenshots
Looking for an overview of the interface? Check it out!
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
|:---:|:---:|:---:|
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|
If you are interested in making Forgejo better, either by reporting a bug or by changing the governance, please [take a look at the contribution guide](CONTRIBUTING.md).

View File

@ -1,98 +0,0 @@
<p align="center">
<a href="https://gitea.io/">
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/assets/img/gitea.svg" width="220"/>
</a>
</p>
<h1 align="center">Gitea - Git with a cup of tea</h1>
<p align="center">
<a href="https://drone.gitea.io/go-gitea/gitea" title="Build Status">
<img src="https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg?ref=refs/heads/main">
</a>
<a href="https://discord.gg/Gitea" title="Join the Discord chat at https://discord.gg/Gitea">
<img src="https://img.shields.io/discord/322538954119184384.svg">
</a>
<a href="https://app.codecov.io/gh/go-gitea/gitea" title="Codecov">
<img src="https://codecov.io/gh/go-gitea/gitea/branch/main/graph/badge.svg">
</a>
<a href="https://goreportcard.com/report/code.gitea.io/gitea" title="Go Report Card">
<img src="https://goreportcard.com/badge/code.gitea.io/gitea">
</a>
<a href="https://pkg.go.dev/code.gitea.io/gitea" title="GoDoc">
<img src="https://pkg.go.dev/badge/code.gitea.io/gitea?status.svg">
</a>
<a href="https://github.com/go-gitea/gitea/releases/latest" title="GitHub release">
<img src="https://img.shields.io/github/release/go-gitea/gitea.svg">
</a>
<a href="https://www.codetriage.com/go-gitea/gitea" title="Help Contribute to Open Source">
<img src="https://www.codetriage.com/go-gitea/gitea/badges/users.svg">
</a>
<a href="https://opencollective.com/gitea" title="Become a backer/sponsor of gitea">
<img src="https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen">
</a>
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
</a>
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
<img
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
alt="Contribute with Gitpod"
/>
</a>
<a href="https://crowdin.com/project/gitea" title="Crowdin">
<img src="https://badges.crowdin.net/gitea/localized.svg">
</a>
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
</a>
<a href="https://app.bountysource.com/teams/gitea" title="Bountysource">
<img src="https://img.shields.io/bountysource/team/gitea/activity">
</a>
</p>
<p align="center">
<a href="README.md">View this document in English</a>
</p>
## 目标
Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了 x86amd64还包括 ARM 和 PowerPC。
如果您想试用一下,请访问 [在线Demo](https://try.gitea.io/)
## 提示
1. **开始贡献代码之前请确保你已经看过了 [贡献者向导(英文)](CONTRIBUTING.md)**.
2. 所有的安全问题,请私下发送邮件给 **security@gitea.io**。谢谢!
3. 如果你要使用API请参见 [API 文档](https://godoc.org/code.gitea.io/sdk/gitea).
## 文档
关于如何安装请访问我们的 [文档站](https://docs.gitea.com/zh-cn/category/installation),如果没有找到对应的文档,你也可以通过 [Discord - 英文](https://discord.gg/gitea) 和 QQ群 328432459 来和我们交流。
## 贡献流程
Fork -> Patch -> Push -> Pull Request
## 翻译
多语言翻译是基于Crowdin进行的.
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
## 作者
* [Maintainers](https://github.com/orgs/go-gitea/people)
* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
* [Translators](options/locale/TRANSLATORS)
## 授权许可
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) 文件中。
## 截图
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
|:---:|:---:|:---:|
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|

2391
RELEASE-NOTES.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,85 +0,0 @@
# Reporting security issues
The Gitea maintainers take security seriously.
If you discover a security issue, please bring it to their attention right away!
Previous vulnerabilities are listed at https://about.gitea.com/security.
## Reporting a Vulnerability
Please **DO NOT** file a public issue, instead send your report privately to `security@gitea.io`.
## Protecting Security Information
Due to the sensitive nature of security information, you can use below GPG public key encrypt your mail body.
The PGP key is valid until June 24, 2024.
```
Key ID: 6FCD2D5B
Key Type: RSA
Expires: 6/24/2024
Key Size: 4096/4096
Fingerprint: 3DE0 3D1E 144A 7F06 9359 99DC AAFD 2381 6FCD 2D5B
```
UserID: Gitea Security <security@gitea.io>
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGK1Z/4BEADFMqXA9DeeChmSxUjF0Be5sq99ZUhgrZjcN/wOzz0wuCJZC0l8
4uC+d6mfv7JpJYlzYzOK97/x5UguKHkYNZ6mm1G9KHaXmoIBDLKDzfPdJopVNv2r
OajijaE0uMCnMjadlg5pbhMLRQG8a9J32yyaz7ZEAw72Ab31fvvcA53NkuqO4j2w
k7dtFQzhbNOYV0VffQT90WDZdalYHB1JHyEQ+70U9OjVD5ggNYSzX98Eu3Hjn7V7
kqFrcAxr5TE1elf0IXJcuBJtFzQSTUGlQldKOHtGTGgGjj9r/FFAE5ioBgVD05bV
rEEgIMM/GqYaG/nbNpWE6P3mEc2Mnn3pZaRJL0LuF26TLjnqEcMMDp5iIhLdFzXR
3tMdtKgQFu+Mtzs3ipwWARYgHyU09RJsI2HeBx7RmZO/Xqrec763Z7zdJ7SpCn0Z
q+pHZl24JYR0Kf3T/ZiOC0cGd2QJqpJtg5J6S/OqfX9NH6MsCczO8pUC1N/aHH2X
CTme2nF56izORqDWKoiICteL3GpYsCV9nyCidcCmoQsS+DKvE86YhIhVIVWGRY2F
lzpAjnN9/KLtQroutrm+Ft0mdjDiJUeFVl1cOHDhoyfCsQh62HumoyZoZvqzQd6e
AbN11nq6aViMe2Q3je1AbiBnRnQSHxt1Tc8X4IshO3MQK1Sk7oPI6LA5oQARAQAB
tCJHaXRlYSBTZWN1cml0eSA8c2VjdXJpdHlAZ2l0ZWEuaW8+iQJXBBMBCABBFiEE
PeA9HhRKfwaTWZncqv0jgW/NLVsFAmK1Z/4CGwMFCQPCZwAFCwkIBwICIgIGFQoJ
CAsCBBYCAwECHgcCF4AACgkQqv0jgW/NLVvnyxAAhxyNnWzw/rQO2qhzqicmZM94
njSbOg+U2qMBvCdaqCQQeC+uaMmMzkDPanUUmLcyCkWqfCjPNjeSXAkE9npepVJI
4HtmgxZQ94OU/h3CLbft+9GVRzUkVI29TSYGdvNtV2/BkNGoFFnKWQr119um0o6A
bgha2Uy5uY8o3ZIoiKkiHRaEoWIjjeBxJxYAojsZY4YElUmsQ3ik2joG6rhFesTa
ofVt/bL8G2xzpOG26WGIxBbqf2qjV6OtZ0hu/vtTPHeIWMLq0Mz0V3PEDQWfkGPE
i2RYxxYDs2xzJhSQWqTNVLSq0m5xTJnbHhQPfdCX4C2jvFKgLdfmytQq49S7jiJb
Z03HVOZ/PsyBlQfH9xJi06R5yQCMEA8h8Z5r3/NXW09kQ6OFRe6xshoTcxZGRPTo
srhwr3uPbmCRh+YEl7qBLU6+BC5k8IRTZXqhrj/aPJu3MxgbgwV8u3vLoFSXM2lb
a61FgeCQ0O7lkgVswwF0RppCaH9Ul3ZDapet/vCRg4NVwm9zOI/8q/Vj0FKA1GDR
JhRu8+Ce8zlFL65D34t+PprAzSeTlbv9um3x/ZIjCco7EEKSBylt+AZj/VyA6+e5
kjOQwRRc6dFJWBcorsSI2dG+H+QMF7ZabzmeCcz1v9HjLOPzYHoZAHhCmSppWTvX
AJy6+lhfW2OUTqQeYSi5Ag0EYrVn/gEQALrFLQjCR3GjuHSindz0rd3Fnx/t7Sen
T+p07yCSSoSlmnJHCQmwh4vfg1blyz0zZ4vkIhtpHsEgc+ZAG+WQXSsJ2iRz+eSN
GwoOQl4XC3n+QWkc1ws+btr48+6UqXIQU+F8TPQyx/PIgi2nZXJB7f5+mjCqsk46
XvH4nTr4kJjuqMSR/++wvre2qNQRa/q/dTsK0OaN/mJsdX6Oi+aGNaQJUhIG7F+E
ZDMkn/O6xnwWNzy/+bpg43qH/Gk0eakOmz5NmQLRkV58SZLiJvuCUtkttf6CyhnX
03OcWaajv5W8qA39dBYQgDrrPbBWUnwfO3yMveqhwV4JjDoe8sPAyn1NwzakNYqP
RzsWyLrLS7R7J9s3FkZXhQw/QQcsaSMcGNQO047dm1P83N8JY5aEpiRo9zSWjoiw
qoExANj5lUTZPe8M50lI182FrcjAN7dClO3QI6pg7wy0erMxfFly3j8UQ91ysS9T
s+GsP9I3cmWWQcKYxWHtE8xTXnNCVPFZQj2nwhJzae8ypfOtulBRA3dUKWGKuDH/
axFENhUsT397aOU3qkP/od4a64JyNIEo4CTTSPVeWd7njsGqli2U3A4xL2CcyYvt
D/MWcMBGEoLSNTswwKdom4FaJpn5KThnK/T0bQcmJblJhoCtppXisbexZnCpuS0x
Zdlm2T14KJ3LABEBAAGJAjwEGAEIACYWIQQ94D0eFEp/BpNZmdyq/SOBb80tWwUC
YrVn/gIbDAUJA8JnAAAKCRCq/SOBb80tWyTBD/9AGpW6QoDF7zYjHAozH9S5RGCA
Y7E82dG/0xmFUwPprAG0BKmmgU6TiipyVGmKIXGYYYU92pMnbvXkYQMoa+WJNncN
D3fY52UeXeffTf4cFpStlzi9xgYtOLhFamzYu/4xhkjOX+xhOSXscCiFRyT8cF3B
O6c5BHU+Zj0/rGPgOyPUbx7l7B9MubB/41nNX35k08e+8T3wtWDb4XF+15HnRfva
6fblO8wgU25Orv2Rm1jnKGa9DxJ8nE40IMrqDapENtDuL+zKJsvR0+ptWvEyL56U
GtJJG5un6mXiLKuRQT0DEv4MdZRHDgDstDnqcbEiazVEbUuvhZZob6lRY2A19m1+
7zfnDxkhqCA1RCnv4fdvcPdCMMFHwLpdhjgW0aI/uwgwrvsEz5+JRlnLvdQHlPAg
q7l2fGcBSpz9U0ayyfRPjPntsNCtZl1UDxGLeciPkZhyG84zEWQbk/j52ZpRN+Ik
ALpRLa8RBFmFSmXDUmwQrmm1EmARyQXwweKU31hf8ZGbCp2lPuRYm1LuGiirXSVP
GysjRAJgW+VRpBKOzFQoUAUbReVWSaCwT8s17THzf71DdDb6CTj31jMLLYWwBpA/
i73DgobDZMIGEZZC1EKqza8eh11xfyHFzGec03tbh+lIen+5IiRtWiEWkDS9ll0G
zgS/ZdziCvdAutqnGA==
=gZWO
-----END PGP PUBLIC KEY BLOCK-----
```
Security reports are greatly appreciated and we will publicly thank you for it, although we keep your name confidential if you request it.

View File

@ -1,31 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
<g>
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
<g>
<g>
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
C343.2,346.5,335,363.3,326.8,380.1z"/>
</g>
</g>
</g>
<svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
circle {
fill: none;
stroke: #000;
stroke-width: 15;
}
path {
fill: none;
stroke: #000;
stroke-width: 25;
}
.orange {
stroke:#ff6600;
}
.red {
stroke:#d40000;
}
</style>
<g transform="translate(6,6)">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
<circle cx="142" cy="20" r="18" class="orange" />
<circle cx="142" cy="88" r="18" class="red" />
<circle cx="58" cy="180" r="18" class="red" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 677 B

127
assets/go-licenses.json generated

File diff suppressed because one or more lines are too long

View File

@ -1,31 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="main_outline" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve">
<g>
<path id="teabag" style="fill:#FFFFFF" d="M395.9,484.2l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5,21.2-17.9,33.8-11.8
c17.2,8.3,27.1,13,27.1,13l-0.1-109.2l16.7-0.1l0.1,117.1c0,0,57.4,24.2,83.1,40.1c3.7,2.3,10.2,6.8,12.9,14.4
c2.1,6.1,2,13.1-1,19.3l-61,126.9C423.6,484.9,408.4,490.3,395.9,484.2z"/>
<g>
<g>
<path style="fill:#609926" d="M622.7,149.8c-4.1-4.1-9.6-4-9.6-4s-117.2,6.6-177.9,8c-13.3,0.3-26.5,0.6-39.6,0.7c0,39.1,0,78.2,0,117.2
c-5.5-2.6-11.1-5.3-16.6-7.9c0-36.4-0.1-109.2-0.1-109.2c-29,0.4-89.2-2.2-89.2-2.2s-141.4-7.1-156.8-8.5
c-9.8-0.6-22.5-2.1-39,1.5c-8.7,1.8-33.5,7.4-53.8,26.9C-4.9,212.4,6.6,276.2,8,285.8c1.7,11.7,6.9,44.2,31.7,72.5
c45.8,56.1,144.4,54.8,144.4,54.8s12.1,28.9,30.6,55.5c25,33.1,50.7,58.9,75.7,62c63,0,188.9-0.1,188.9-0.1s12,0.1,28.3-10.3
c14-8.5,26.5-23.4,26.5-23.4s12.9-13.8,30.9-45.3c5.5-9.7,10.1-19.1,14.1-28c0,0,55.2-117.1,55.2-231.1
C633.2,157.9,624.7,151.8,622.7,149.8z M125.6,353.9c-25.9-8.5-36.9-18.7-36.9-18.7S69.6,321.8,60,295.4
c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5,38.5-30c13.8-3.7,31-3.1,31-3.1s7.1,59.4,15.7,94.2c7.2,29.2,24.8,77.7,24.8,77.7
S142.5,359.9,125.6,353.9z M425.9,461.5c0,0-6.1,14.5-19.6,15.4c-5.8,0.4-10.3-1.2-10.3-1.2s-0.3-0.1-5.3-2.1l-112.9-55
c0,0-10.9-5.7-12.8-15.6c-2.2-8.1,2.7-18.1,2.7-18.1L322,273c0,0,4.8-9.7,12.2-13c0.6-0.3,2.3-1,4.5-1.5c8.1-2.1,18,2.8,18,2.8
l110.7,53.7c0,0,12.6,5.7,15.3,16.2c1.9,7.4-0.5,14-1.8,17.2C474.6,363.8,425.9,461.5,425.9,461.5z"/>
<path style="fill:#609926" d="M326.8,380.1c-8.2,0.1-15.4,5.8-17.3,13.8c-1.9,8,2,16.3,9.1,20c7.7,4,17.5,1.8,22.7-5.4
c5.1-7.1,4.3-16.9-1.8-23.1l24-49.1c1.5,0.1,3.7,0.2,6.2-0.5c4.1-0.9,7.1-3.6,7.1-3.6c4.2,1.8,8.6,3.8,13.2,6.1
c4.8,2.4,9.3,4.9,13.4,7.3c0.9,0.5,1.8,1.1,2.8,1.9c1.6,1.3,3.4,3.1,4.7,5.5c1.9,5.5-1.9,14.9-1.9,14.9
c-2.3,7.6-18.4,40.6-18.4,40.6c-8.1-0.2-15.3,5-17.7,12.5c-2.6,8.1,1.1,17.3,8.9,21.3c7.8,4,17.4,1.7,22.5-5.3
c5-6.8,4.6-16.3-1.1-22.6c1.9-3.7,3.7-7.4,5.6-11.3c5-10.4,13.5-30.4,13.5-30.4c0.9-1.7,5.7-10.3,2.7-21.3
c-2.5-11.4-12.6-16.7-12.6-16.7c-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3c4.7-9.7,9.4-19.3,14.1-29
c-4.1-2-8.1-4-12.2-6.1c-4.8,9.8-9.7,19.7-14.5,29.5c-6.7-0.1-12.9,3.5-16.1,9.4c-3.4,6.3-2.7,14.1,1.9,19.8
C343.2,346.5,335,363.3,326.8,380.1z"/>
</g>
</g>
</g>
<svg viewBox="0 0 212 212" xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
circle {
fill: none;
stroke: #000;
stroke-width: 15;
}
path {
fill: none;
stroke: #000;
stroke-width: 25;
}
.orange {
stroke:#ff6600;
}
.red {
stroke:#d40000;
}
</style>
<g transform="translate(6,6)">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" class="orange" />
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" class="red" />
<circle cx="142" cy="20" r="18" class="orange" />
<circle cx="142" cy="88" r="18" class="red" />
<circle cx="58" cy="180" r="18" class="red" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 677 B

View File

@ -18,8 +18,8 @@ import (
func main() {
if len(os.Args) != 2 {
println("usage: backport-locales <to-ref>")
println("eg: backport-locales release/v1.19")
fmt.Println("usage: backport-locales <to-ref>")
fmt.Println("eg: backport-locales release/v1.19")
os.Exit(1)
}

View File

@ -69,6 +69,7 @@ func newFileCollector(fileFilter string, batchSize int) (*fileCollector, error)
co.includePatterns = append(co.includePatterns, regexp.MustCompile(`.*\.go$`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`.*\bbindata\.go$`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`\.pb\.go$`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`tests/gitea-repositories-meta`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`tests/integration/migration-test`))
co.excludePatterns = append(co.excludePatterns, regexp.MustCompile(`modules/git/tests`))
@ -203,17 +204,6 @@ Example:
`, "file-batch-exec")
}
func getGoVersion() string {
goModFile, err := os.ReadFile("go.mod")
if err != nil {
log.Fatalf(`Faild to read "go.mod": %v`, err)
os.Exit(1)
}
goModVersionRegex := regexp.MustCompile(`go \d+\.\d+`)
goModVersionLine := goModVersionRegex.Find(goModFile)
return string(goModVersionLine[3:])
}
func newFileCollectorFromMainOptions(mainOptions map[string]string) (fc *fileCollector, err error) {
fileFilter := mainOptions["file-filter"]
if fileFilter == "" {
@ -278,7 +268,8 @@ func main() {
log.Print("the -d option is not supported by gitea-fmt")
}
cmdErrors = append(cmdErrors, giteaFormatGoImports(files, containsString(subArgs, "-w")))
cmdErrors = append(cmdErrors, passThroughCmd("go", append([]string{"run", os.Getenv("GOFUMPT_PACKAGE"), "-extra", "-lang", getGoVersion()}, substArgs...)))
cmdErrors = append(cmdErrors, passThroughCmd("gofmt", append([]string{"-w", "-r", "interface{} -> any"}, substArgs...)))
cmdErrors = append(cmdErrors, passThroughCmd("go", append([]string{"run", os.Getenv("GOFUMPT_PACKAGE"), "-extra"}, substArgs...)))
default:
log.Fatalf("unknown cmd: %s %v", subCmd, subArgs)
}

View File

@ -142,7 +142,7 @@ func generate() ([]byte, error) {
}
}
// gitea customizations
// Forgejo customizations
i, ok := aliasMap["tada"]
if ok {
data[i].Aliases = append(data[i].Aliases, "hooray")

View File

@ -0,0 +1,15 @@
// Copyright 2024 The Forgejo Authors c/o Codeberg e.V.. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
//go:build ignore
package main
import (
"fmt"
)
func main() {
fmt.Println("NOT NEEDED: THIS IS A NOOP AS OF Forgejo 7.0 BUT KEPT FOR BACKWARD COMPATIBILITY")
}

View File

@ -15,9 +15,8 @@ import (
var (
// CmdActions represents the available actions sub-commands.
CmdActions = &cli.Command{
Name: "actions",
Usage: "",
Description: "Commands for managing Gitea Actions",
Name: "actions",
Usage: "Manage Forgejo Actions",
Subcommands: []*cli.Command{
subcmdActionsGenRunnerToken,
},
@ -51,6 +50,6 @@ func runGenerateActionsRunnerToken(c *cli.Context) error {
if extra.HasError() {
return handleCliResponseExtra(extra)
}
_, _ = fmt.Printf("%s\n", respText)
_, _ = fmt.Printf("%s\n", respText.Text)
return nil
}

View File

@ -6,26 +6,14 @@ package cmd
import (
"context"
"errors"
"fmt"
"net/url"
"os"
"strings"
"text/tabwriter"
asymkey_model "code.gitea.io/gitea/models/asymkey"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/gitrepo"
"code.gitea.io/gitea/modules/log"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/util"
auth_service "code.gitea.io/gitea/services/auth"
"code.gitea.io/gitea/services/auth/source/oauth2"
"code.gitea.io/gitea/services/auth/source/smtp"
repo_service "code.gitea.io/gitea/services/repository"
"github.com/urfave/cli/v2"
)
@ -34,7 +22,7 @@ var (
// CmdAdmin represents the available admin sub-command.
CmdAdmin = &cli.Command{
Name: "admin",
Usage: "Command line interface to perform common administrative operations",
Usage: "Perform common administrative operations",
Subcommands: []*cli.Command{
subcmdUser,
subcmdRepoSyncReleases,
@ -59,28 +47,16 @@ var (
},
}
microcmdRegenHooks = &cli.Command{
Name: "hooks",
Usage: "Regenerate git-hooks",
Action: runRegenerateHooks,
}
microcmdRegenKeys = &cli.Command{
Name: "keys",
Usage: "Regenerate authorized_keys file",
Action: runRegenerateKeys,
}
subcmdAuth = &cli.Command{
Name: "auth",
Usage: "Modify external auth providers",
Subcommands: []*cli.Command{
microcmdAuthAddOauth,
microcmdAuthUpdateOauth,
cmdAuthAddLdapBindDn,
cmdAuthUpdateLdapBindDn,
cmdAuthAddLdapSimpleAuth,
cmdAuthUpdateLdapSimpleAuth,
microcmdAuthAddLdapBindDn,
microcmdAuthUpdateLdapBindDn,
microcmdAuthAddLdapSimpleAuth,
microcmdAuthUpdateLdapSimpleAuth,
microcmdAuthAddSMTP,
microcmdAuthUpdateSMTP,
microcmdAuthList,
@ -88,170 +64,6 @@ var (
},
}
microcmdAuthList = &cli.Command{
Name: "list",
Usage: "List auth sources",
Action: runListAuth,
Flags: []cli.Flag{
&cli.IntFlag{
Name: "min-width",
Usage: "Minimal cell width including any padding for the formatted table",
Value: 0,
},
&cli.IntFlag{
Name: "tab-width",
Usage: "width of tab characters in formatted table (equivalent number of spaces)",
Value: 8,
},
&cli.IntFlag{
Name: "padding",
Usage: "padding added to a cell before computing its width",
Value: 1,
},
&cli.StringFlag{
Name: "pad-char",
Usage: `ASCII char used for padding if padchar == '\\t', the Writer will assume that the width of a '\\t' in the formatted output is tabwidth, and cells are left-aligned independent of align_left (for correct-looking results, tabwidth must correspond to the tab width in the viewer displaying the result)`,
Value: "\t",
},
&cli.BoolFlag{
Name: "vertical-bars",
Usage: "Set to true to print vertical bars between columns",
},
},
}
idFlag = &cli.Int64Flag{
Name: "id",
Usage: "ID of authentication source",
}
microcmdAuthDelete = &cli.Command{
Name: "delete",
Usage: "Delete specific auth source",
Flags: []cli.Flag{idFlag},
Action: runDeleteAuth,
}
oauthCLIFlags = []cli.Flag{
&cli.StringFlag{
Name: "name",
Value: "",
Usage: "Application Name",
},
&cli.StringFlag{
Name: "provider",
Value: "",
Usage: "OAuth2 Provider",
},
&cli.StringFlag{
Name: "key",
Value: "",
Usage: "Client ID (Key)",
},
&cli.StringFlag{
Name: "secret",
Value: "",
Usage: "Client Secret",
},
&cli.StringFlag{
Name: "auto-discover-url",
Value: "",
Usage: "OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider)",
},
&cli.StringFlag{
Name: "use-custom-urls",
Value: "false",
Usage: "Use custom URLs for GitLab/GitHub OAuth endpoints",
},
&cli.StringFlag{
Name: "custom-tenant-id",
Value: "",
Usage: "Use custom Tenant ID for OAuth endpoints",
},
&cli.StringFlag{
Name: "custom-auth-url",
Value: "",
Usage: "Use a custom Authorization URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
Name: "custom-token-url",
Value: "",
Usage: "Use a custom Token URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
Name: "custom-profile-url",
Value: "",
Usage: "Use a custom Profile URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
Name: "custom-email-url",
Value: "",
Usage: "Use a custom Email URL (option for GitHub)",
},
&cli.StringFlag{
Name: "icon-url",
Value: "",
Usage: "Custom icon URL for OAuth2 login source",
},
&cli.BoolFlag{
Name: "skip-local-2fa",
Usage: "Set to true to skip local 2fa for users authenticated by this source",
},
&cli.StringSliceFlag{
Name: "scopes",
Value: nil,
Usage: "Scopes to request when to authenticate against this OAuth2 source",
},
&cli.StringFlag{
Name: "required-claim-name",
Value: "",
Usage: "Claim name that has to be set to allow users to login with this source",
},
&cli.StringFlag{
Name: "required-claim-value",
Value: "",
Usage: "Claim value that has to be set to allow users to login with this source",
},
&cli.StringFlag{
Name: "group-claim-name",
Value: "",
Usage: "Claim name providing group names for this source",
},
&cli.StringFlag{
Name: "admin-group",
Value: "",
Usage: "Group Claim value for administrator users",
},
&cli.StringFlag{
Name: "restricted-group",
Value: "",
Usage: "Group Claim value for restricted users",
},
&cli.StringFlag{
Name: "group-team-map",
Value: "",
Usage: "JSON mapping between groups and org teams",
},
&cli.BoolFlag{
Name: "group-team-map-removal",
Usage: "Activate automatic team membership removal depending on groups",
},
}
microcmdAuthUpdateOauth = &cli.Command{
Name: "update-oauth",
Usage: "Update existing Oauth authentication source",
Action: runUpdateOauth,
Flags: append(oauthCLIFlags[:1], append([]cli.Flag{idFlag}, oauthCLIFlags[1:]...)...),
}
microcmdAuthAddOauth = &cli.Command{
Name: "add-oauth",
Usage: "Add new Oauth authentication source",
Action: runAddOauth,
Flags: oauthCLIFlags,
}
subcmdSendMail = &cli.Command{
Name: "sendmail",
Usage: "Send a message to all users",
@ -275,75 +87,9 @@ var (
},
}
smtpCLIFlags = []cli.Flag{
&cli.StringFlag{
Name: "name",
Value: "",
Usage: "Application Name",
},
&cli.StringFlag{
Name: "auth-type",
Value: "PLAIN",
Usage: "SMTP Authentication Type (PLAIN/LOGIN/CRAM-MD5) default PLAIN",
},
&cli.StringFlag{
Name: "host",
Value: "",
Usage: "SMTP Host",
},
&cli.IntFlag{
Name: "port",
Usage: "SMTP Port",
},
&cli.BoolFlag{
Name: "force-smtps",
Usage: "SMTPS is always used on port 465. Set this to force SMTPS on other ports.",
Value: true,
},
&cli.BoolFlag{
Name: "skip-verify",
Usage: "Skip TLS verify.",
Value: true,
},
&cli.StringFlag{
Name: "helo-hostname",
Value: "",
Usage: "Hostname sent with HELO. Leave blank to send current hostname",
},
&cli.BoolFlag{
Name: "disable-helo",
Usage: "Disable SMTP helo.",
Value: true,
},
&cli.StringFlag{
Name: "allowed-domains",
Value: "",
Usage: "Leave empty to allow all domains. Separate multiple domains with a comma (',')",
},
&cli.BoolFlag{
Name: "skip-local-2fa",
Usage: "Skip 2FA to log on.",
Value: true,
},
&cli.BoolFlag{
Name: "active",
Usage: "This Authentication Source is Activated.",
Value: true,
},
}
microcmdAuthAddSMTP = &cli.Command{
Name: "add-smtp",
Usage: "Add new SMTP authentication source",
Action: runAddSMTP,
Flags: smtpCLIFlags,
}
microcmdAuthUpdateSMTP = &cli.Command{
Name: "update-smtp",
Usage: "Update existing SMTP authentication source",
Action: runUpdateSMTP,
Flags: append(smtpCLIFlags[:1], append([]cli.Flag{idFlag}, smtpCLIFlags[1:]...)...),
idFlag = &cli.Int64Flag{
Name: "id",
Usage: "ID of authentication source",
}
)
@ -377,7 +123,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
log.Trace("Processing next %d repos of %d", len(repos), count)
for _, repo := range repos {
log.Trace("Synchronizing repo %s with path %s", repo.FullName(), repo.RepoPath())
gitRepo, err := git.OpenRepository(ctx, repo.RepoPath())
gitRepo, err := gitrepo.OpenRepository(ctx, repo)
if err != nil {
log.Warn("OpenRepository: %v", err)
continue
@ -389,7 +135,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
}
log.Trace(" currentNumReleases is %d, running SyncReleasesWithTags", oldnum)
if err = repo_module.SyncReleasesWithTags(repo, gitRepo); err != nil {
if err = repo_module.SyncReleasesWithTags(ctx, repo, gitRepo); err != nil {
log.Warn(" SyncReleasesWithTags: %v", err)
gitRepo.Close()
continue
@ -412,359 +158,11 @@ func runRepoSyncReleases(_ *cli.Context) error {
}
func getReleaseCount(ctx context.Context, id int64) (int64, error) {
return repo_model.GetReleaseCountByRepoID(
return db.Count[repo_model.Release](
ctx,
id,
repo_model.FindReleasesOptions{
RepoID: id,
IncludeTags: true,
},
)
}
func runRegenerateHooks(_ *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
return repo_service.SyncRepositoryHooks(graceful.GetManager().ShutdownContext())
}
func runRegenerateKeys(_ *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
return asymkey_model.RewriteAllPublicKeys()
}
func parseOAuth2Config(c *cli.Context) *oauth2.Source {
var customURLMapping *oauth2.CustomURLMapping
if c.IsSet("use-custom-urls") {
customURLMapping = &oauth2.CustomURLMapping{
TokenURL: c.String("custom-token-url"),
AuthURL: c.String("custom-auth-url"),
ProfileURL: c.String("custom-profile-url"),
EmailURL: c.String("custom-email-url"),
Tenant: c.String("custom-tenant-id"),
}
} else {
customURLMapping = nil
}
return &oauth2.Source{
Provider: c.String("provider"),
ClientID: c.String("key"),
ClientSecret: c.String("secret"),
OpenIDConnectAutoDiscoveryURL: c.String("auto-discover-url"),
CustomURLMapping: customURLMapping,
IconURL: c.String("icon-url"),
SkipLocalTwoFA: c.Bool("skip-local-2fa"),
Scopes: c.StringSlice("scopes"),
RequiredClaimName: c.String("required-claim-name"),
RequiredClaimValue: c.String("required-claim-value"),
GroupClaimName: c.String("group-claim-name"),
AdminGroup: c.String("admin-group"),
RestrictedGroup: c.String("restricted-group"),
GroupTeamMap: c.String("group-team-map"),
GroupTeamMapRemoval: c.Bool("group-team-map-removal"),
}
}
func runAddOauth(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
config := parseOAuth2Config(c)
if config.Provider == "openidConnect" {
discoveryURL, err := url.Parse(config.OpenIDConnectAutoDiscoveryURL)
if err != nil || (discoveryURL.Scheme != "http" && discoveryURL.Scheme != "https") {
return fmt.Errorf("invalid Auto Discovery URL: %s (this must be a valid URL starting with http:// or https://)", config.OpenIDConnectAutoDiscoveryURL)
}
}
return auth_model.CreateSource(&auth_model.Source{
Type: auth_model.OAuth2,
Name: c.String("name"),
IsActive: true,
Cfg: config,
})
}
func runUpdateOauth(c *cli.Context) error {
if !c.IsSet("id") {
return fmt.Errorf("--id flag is missing")
}
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
source, err := auth_model.GetSourceByID(c.Int64("id"))
if err != nil {
return err
}
oAuth2Config := source.Cfg.(*oauth2.Source)
if c.IsSet("name") {
source.Name = c.String("name")
}
if c.IsSet("provider") {
oAuth2Config.Provider = c.String("provider")
}
if c.IsSet("key") {
oAuth2Config.ClientID = c.String("key")
}
if c.IsSet("secret") {
oAuth2Config.ClientSecret = c.String("secret")
}
if c.IsSet("auto-discover-url") {
oAuth2Config.OpenIDConnectAutoDiscoveryURL = c.String("auto-discover-url")
}
if c.IsSet("icon-url") {
oAuth2Config.IconURL = c.String("icon-url")
}
if c.IsSet("scopes") {
oAuth2Config.Scopes = c.StringSlice("scopes")
}
if c.IsSet("required-claim-name") {
oAuth2Config.RequiredClaimName = c.String("required-claim-name")
}
if c.IsSet("required-claim-value") {
oAuth2Config.RequiredClaimValue = c.String("required-claim-value")
}
if c.IsSet("group-claim-name") {
oAuth2Config.GroupClaimName = c.String("group-claim-name")
}
if c.IsSet("admin-group") {
oAuth2Config.AdminGroup = c.String("admin-group")
}
if c.IsSet("restricted-group") {
oAuth2Config.RestrictedGroup = c.String("restricted-group")
}
if c.IsSet("group-team-map") {
oAuth2Config.GroupTeamMap = c.String("group-team-map")
}
if c.IsSet("group-team-map-removal") {
oAuth2Config.GroupTeamMapRemoval = c.Bool("group-team-map-removal")
}
// update custom URL mapping
customURLMapping := &oauth2.CustomURLMapping{}
if oAuth2Config.CustomURLMapping != nil {
customURLMapping.TokenURL = oAuth2Config.CustomURLMapping.TokenURL
customURLMapping.AuthURL = oAuth2Config.CustomURLMapping.AuthURL
customURLMapping.ProfileURL = oAuth2Config.CustomURLMapping.ProfileURL
customURLMapping.EmailURL = oAuth2Config.CustomURLMapping.EmailURL
customURLMapping.Tenant = oAuth2Config.CustomURLMapping.Tenant
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-token-url") {
customURLMapping.TokenURL = c.String("custom-token-url")
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-auth-url") {
customURLMapping.AuthURL = c.String("custom-auth-url")
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-profile-url") {
customURLMapping.ProfileURL = c.String("custom-profile-url")
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-email-url") {
customURLMapping.EmailURL = c.String("custom-email-url")
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-tenant-id") {
customURLMapping.Tenant = c.String("custom-tenant-id")
}
oAuth2Config.CustomURLMapping = customURLMapping
source.Cfg = oAuth2Config
return auth_model.UpdateSource(source)
}
func parseSMTPConfig(c *cli.Context, conf *smtp.Source) error {
if c.IsSet("auth-type") {
conf.Auth = c.String("auth-type")
validAuthTypes := []string{"PLAIN", "LOGIN", "CRAM-MD5"}
if !util.SliceContainsString(validAuthTypes, strings.ToUpper(c.String("auth-type"))) {
return errors.New("Auth must be one of PLAIN/LOGIN/CRAM-MD5")
}
conf.Auth = c.String("auth-type")
}
if c.IsSet("host") {
conf.Host = c.String("host")
}
if c.IsSet("port") {
conf.Port = c.Int("port")
}
if c.IsSet("allowed-domains") {
conf.AllowedDomains = c.String("allowed-domains")
}
if c.IsSet("force-smtps") {
conf.ForceSMTPS = c.Bool("force-smtps")
}
if c.IsSet("skip-verify") {
conf.SkipVerify = c.Bool("skip-verify")
}
if c.IsSet("helo-hostname") {
conf.HeloHostname = c.String("helo-hostname")
}
if c.IsSet("disable-helo") {
conf.DisableHelo = c.Bool("disable-helo")
}
if c.IsSet("skip-local-2fa") {
conf.SkipLocalTwoFA = c.Bool("skip-local-2fa")
}
return nil
}
func runAddSMTP(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
if !c.IsSet("name") || len(c.String("name")) == 0 {
return errors.New("name must be set")
}
if !c.IsSet("host") || len(c.String("host")) == 0 {
return errors.New("host must be set")
}
if !c.IsSet("port") {
return errors.New("port must be set")
}
active := true
if c.IsSet("active") {
active = c.Bool("active")
}
var smtpConfig smtp.Source
if err := parseSMTPConfig(c, &smtpConfig); err != nil {
return err
}
// If not set default to PLAIN
if len(smtpConfig.Auth) == 0 {
smtpConfig.Auth = "PLAIN"
}
return auth_model.CreateSource(&auth_model.Source{
Type: auth_model.SMTP,
Name: c.String("name"),
IsActive: active,
Cfg: &smtpConfig,
})
}
func runUpdateSMTP(c *cli.Context) error {
if !c.IsSet("id") {
return fmt.Errorf("--id flag is missing")
}
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
source, err := auth_model.GetSourceByID(c.Int64("id"))
if err != nil {
return err
}
smtpConfig := source.Cfg.(*smtp.Source)
if err := parseSMTPConfig(c, smtpConfig); err != nil {
return err
}
if c.IsSet("name") {
source.Name = c.String("name")
}
if c.IsSet("active") {
source.IsActive = c.Bool("active")
}
source.Cfg = smtpConfig
return auth_model.UpdateSource(source)
}
func runListAuth(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
authSources, err := auth_model.Sources()
if err != nil {
return err
}
flags := tabwriter.AlignRight
if c.Bool("vertical-bars") {
flags |= tabwriter.Debug
}
padChar := byte('\t')
if len(c.String("pad-char")) > 0 {
padChar = c.String("pad-char")[0]
}
// loop through each source and print
w := tabwriter.NewWriter(os.Stdout, c.Int("min-width"), c.Int("tab-width"), c.Int("padding"), padChar, flags)
fmt.Fprintf(w, "ID\tName\tType\tEnabled\n")
for _, source := range authSources {
fmt.Fprintf(w, "%d\t%s\t%s\t%t\n", source.ID, source.Name, source.Type.String(), source.IsActive)
}
w.Flush()
return nil
}
func runDeleteAuth(c *cli.Context) error {
if !c.IsSet("id") {
return fmt.Errorf("--id flag is missing")
}
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
source, err := auth_model.GetSourceByID(c.Int64("id"))
if err != nil {
return err
}
return auth_service.DeleteSource(source)
}

111
cmd/admin_auth.go Normal file
View File

@ -0,0 +1,111 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package cmd
import (
"errors"
"fmt"
"os"
"text/tabwriter"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
auth_service "code.gitea.io/gitea/services/auth"
"github.com/urfave/cli/v2"
)
var (
microcmdAuthDelete = &cli.Command{
Name: "delete",
Usage: "Delete specific auth source",
Flags: []cli.Flag{idFlag},
Action: runDeleteAuth,
}
microcmdAuthList = &cli.Command{
Name: "list",
Usage: "List auth sources",
Action: runListAuth,
Flags: []cli.Flag{
&cli.IntFlag{
Name: "min-width",
Usage: "Minimal cell width including any padding for the formatted table",
Value: 0,
},
&cli.IntFlag{
Name: "tab-width",
Usage: "width of tab characters in formatted table (equivalent number of spaces)",
Value: 8,
},
&cli.IntFlag{
Name: "padding",
Usage: "padding added to a cell before computing its width",
Value: 1,
},
&cli.StringFlag{
Name: "pad-char",
Usage: `ASCII char used for padding if padchar == '\\t', the Writer will assume that the width of a '\\t' in the formatted output is tabwidth, and cells are left-aligned independent of align_left (for correct-looking results, tabwidth must correspond to the tab width in the viewer displaying the result)`,
Value: "\t",
},
&cli.BoolFlag{
Name: "vertical-bars",
Usage: "Set to true to print vertical bars between columns",
},
},
}
)
func runListAuth(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
authSources, err := db.Find[auth_model.Source](ctx, auth_model.FindSourcesOptions{})
if err != nil {
return err
}
flags := tabwriter.AlignRight
if c.Bool("vertical-bars") {
flags |= tabwriter.Debug
}
padChar := byte('\t')
if len(c.String("pad-char")) > 0 {
padChar = c.String("pad-char")[0]
}
// loop through each source and print
w := tabwriter.NewWriter(os.Stdout, c.Int("min-width"), c.Int("tab-width"), c.Int("padding"), padChar, flags)
fmt.Fprintf(w, "ID\tName\tType\tEnabled\n")
for _, source := range authSources {
fmt.Fprintf(w, "%d\t%s\t%s\t%t\n", source.ID, source.Name, source.Type.String(), source.IsActive)
}
w.Flush()
return nil
}
func runDeleteAuth(c *cli.Context) error {
if !c.IsSet("id") {
return errors.New("--id flag is missing")
}
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
source, err := auth_model.GetSourceByID(ctx, c.Int64("id"))
if err != nil {
return err
}
return auth_service.DeleteSource(ctx, source)
}

View File

@ -17,9 +17,9 @@ import (
type (
authService struct {
initDB func(ctx context.Context) error
createAuthSource func(*auth.Source) error
updateAuthSource func(*auth.Source) error
getAuthSourceByID func(id int64) (*auth.Source, error)
createAuthSource func(context.Context, *auth.Source) error
updateAuthSource func(context.Context, *auth.Source) error
getAuthSourceByID func(ctx context.Context, id int64) (*auth.Source, error)
}
)
@ -132,10 +132,10 @@ var (
ldapSimpleAuthCLIFlags = append(commonLdapCLIFlags,
&cli.StringFlag{
Name: "user-dn",
Usage: "The users DN.",
Usage: "The user's DN.",
})
cmdAuthAddLdapBindDn = &cli.Command{
microcmdAuthAddLdapBindDn = &cli.Command{
Name: "add-ldap",
Usage: "Add new LDAP (via Bind DN) authentication source",
Action: func(c *cli.Context) error {
@ -144,7 +144,7 @@ var (
Flags: ldapBindDnCLIFlags,
}
cmdAuthUpdateLdapBindDn = &cli.Command{
microcmdAuthUpdateLdapBindDn = &cli.Command{
Name: "update-ldap",
Usage: "Update existing LDAP (via Bind DN) authentication source",
Action: func(c *cli.Context) error {
@ -153,7 +153,7 @@ var (
Flags: append([]cli.Flag{idFlag}, ldapBindDnCLIFlags...),
}
cmdAuthAddLdapSimpleAuth = &cli.Command{
microcmdAuthAddLdapSimpleAuth = &cli.Command{
Name: "add-ldap-simple",
Usage: "Add new LDAP (simple auth) authentication source",
Action: func(c *cli.Context) error {
@ -162,7 +162,7 @@ var (
Flags: ldapSimpleAuthCLIFlags,
}
cmdAuthUpdateLdapSimpleAuth = &cli.Command{
microcmdAuthUpdateLdapSimpleAuth = &cli.Command{
Name: "update-ldap-simple",
Usage: "Update existing LDAP (simple auth) authentication source",
Action: func(c *cli.Context) error {
@ -289,12 +289,12 @@ func findLdapSecurityProtocolByName(name string) (ldap.SecurityProtocol, bool) {
// getAuthSource gets the login source by its id defined in the command line flags.
// It returns an error if the id is not set, does not match any source or if the source is not of expected type.
func (a *authService) getAuthSource(c *cli.Context, authType auth.Type) (*auth.Source, error) {
func (a *authService) getAuthSource(ctx context.Context, c *cli.Context, authType auth.Type) (*auth.Source, error) {
if err := argsSet(c, "id"); err != nil {
return nil, err
}
authSource, err := a.getAuthSourceByID(c.Int64("id"))
authSource, err := a.getAuthSourceByID(ctx, c.Int64("id"))
if err != nil {
return nil, err
}
@ -332,7 +332,7 @@ func (a *authService) addLdapBindDn(c *cli.Context) error {
return err
}
return a.createAuthSource(authSource)
return a.createAuthSource(ctx, authSource)
}
// updateLdapBindDn updates a new LDAP via Bind DN authentication source.
@ -344,7 +344,7 @@ func (a *authService) updateLdapBindDn(c *cli.Context) error {
return err
}
authSource, err := a.getAuthSource(c, auth.LDAP)
authSource, err := a.getAuthSource(ctx, c, auth.LDAP)
if err != nil {
return err
}
@ -354,7 +354,7 @@ func (a *authService) updateLdapBindDn(c *cli.Context) error {
return err
}
return a.updateAuthSource(authSource)
return a.updateAuthSource(ctx, authSource)
}
// addLdapSimpleAuth adds a new LDAP (simple auth) authentication source.
@ -383,7 +383,7 @@ func (a *authService) addLdapSimpleAuth(c *cli.Context) error {
return err
}
return a.createAuthSource(authSource)
return a.createAuthSource(ctx, authSource)
}
// updateLdapBindDn updates a new LDAP (simple auth) authentication source.
@ -395,7 +395,7 @@ func (a *authService) updateLdapSimpleAuth(c *cli.Context) error {
return err
}
authSource, err := a.getAuthSource(c, auth.DLDAP)
authSource, err := a.getAuthSource(ctx, c, auth.DLDAP)
if err != nil {
return err
}
@ -405,5 +405,5 @@ func (a *authService) updateLdapSimpleAuth(c *cli.Context) error {
return err
}
return a.updateAuthSource(authSource)
return a.updateAuthSource(ctx, authSource)
}

View File

@ -210,15 +210,15 @@ func TestAddLdapBindDn(t *testing.T) {
initDB: func(context.Context) error {
return nil
},
createAuthSource: func(authSource *auth.Source) error {
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
createdAuthSource = authSource
return nil
},
updateAuthSource: func(authSource *auth.Source) error {
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
assert.FailNow(t, "case %d: should not call updateAuthSource", n)
return nil
},
getAuthSourceByID: func(id int64) (*auth.Source, error) {
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
assert.FailNow(t, "case %d: should not call getAuthSourceByID", n)
return nil, nil
},
@ -226,7 +226,7 @@ func TestAddLdapBindDn(t *testing.T) {
// Create a copy of command to test
app := cli.NewApp()
app.Flags = cmdAuthAddLdapBindDn.Flags
app.Flags = microcmdAuthAddLdapBindDn.Flags
app.Action = service.addLdapBindDn
// Run it
@ -441,15 +441,15 @@ func TestAddLdapSimpleAuth(t *testing.T) {
initDB: func(context.Context) error {
return nil
},
createAuthSource: func(authSource *auth.Source) error {
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
createdAuthSource = authSource
return nil
},
updateAuthSource: func(authSource *auth.Source) error {
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
assert.FailNow(t, "case %d: should not call updateAuthSource", n)
return nil
},
getAuthSourceByID: func(id int64) (*auth.Source, error) {
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
assert.FailNow(t, "case %d: should not call getAuthSourceByID", n)
return nil, nil
},
@ -457,7 +457,7 @@ func TestAddLdapSimpleAuth(t *testing.T) {
// Create a copy of command to test
app := cli.NewApp()
app.Flags = cmdAuthAddLdapSimpleAuth.Flags
app.Flags = microcmdAuthAddLdapSimpleAuth.Flags
app.Action = service.addLdapSimpleAuth
// Run it
@ -896,15 +896,15 @@ func TestUpdateLdapBindDn(t *testing.T) {
initDB: func(context.Context) error {
return nil
},
createAuthSource: func(authSource *auth.Source) error {
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
assert.FailNow(t, "case %d: should not call createAuthSource", n)
return nil
},
updateAuthSource: func(authSource *auth.Source) error {
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
updatedAuthSource = authSource
return nil
},
getAuthSourceByID: func(id int64) (*auth.Source, error) {
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
if c.id != 0 {
assert.Equal(t, c.id, id, "case %d: wrong id", n)
}
@ -920,7 +920,7 @@ func TestUpdateLdapBindDn(t *testing.T) {
// Create a copy of command to test
app := cli.NewApp()
app.Flags = cmdAuthUpdateLdapBindDn.Flags
app.Flags = microcmdAuthUpdateLdapBindDn.Flags
app.Action = service.updateLdapBindDn
// Run it
@ -1286,15 +1286,15 @@ func TestUpdateLdapSimpleAuth(t *testing.T) {
initDB: func(context.Context) error {
return nil
},
createAuthSource: func(authSource *auth.Source) error {
createAuthSource: func(ctx context.Context, authSource *auth.Source) error {
assert.FailNow(t, "case %d: should not call createAuthSource", n)
return nil
},
updateAuthSource: func(authSource *auth.Source) error {
updateAuthSource: func(ctx context.Context, authSource *auth.Source) error {
updatedAuthSource = authSource
return nil
},
getAuthSourceByID: func(id int64) (*auth.Source, error) {
getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) {
if c.id != 0 {
assert.Equal(t, c.id, id, "case %d: wrong id", n)
}
@ -1310,7 +1310,7 @@ func TestUpdateLdapSimpleAuth(t *testing.T) {
// Create a copy of command to test
app := cli.NewApp()
app.Flags = cmdAuthUpdateLdapSimpleAuth.Flags
app.Flags = microcmdAuthUpdateLdapSimpleAuth.Flags
app.Action = service.updateLdapSimpleAuth
// Run it

299
cmd/admin_auth_oauth.go Normal file
View File

@ -0,0 +1,299 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package cmd
import (
"errors"
"fmt"
"net/url"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/services/auth/source/oauth2"
"github.com/urfave/cli/v2"
)
var (
oauthCLIFlags = []cli.Flag{
&cli.StringFlag{
Name: "name",
Value: "",
Usage: "Application Name",
},
&cli.StringFlag{
Name: "provider",
Value: "",
Usage: "OAuth2 Provider",
},
&cli.StringFlag{
Name: "key",
Value: "",
Usage: "Client ID (Key)",
},
&cli.StringFlag{
Name: "secret",
Value: "",
Usage: "Client Secret",
},
&cli.StringFlag{
Name: "auto-discover-url",
Value: "",
Usage: "OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider)",
},
&cli.StringFlag{
Name: "use-custom-urls",
Value: "false",
Usage: "Use custom URLs for GitLab/GitHub OAuth endpoints",
},
&cli.StringFlag{
Name: "custom-tenant-id",
Value: "",
Usage: "Use custom Tenant ID for OAuth endpoints",
},
&cli.StringFlag{
Name: "custom-auth-url",
Value: "",
Usage: "Use a custom Authorization URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
Name: "custom-token-url",
Value: "",
Usage: "Use a custom Token URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
Name: "custom-profile-url",
Value: "",
Usage: "Use a custom Profile URL (option for GitLab/GitHub)",
},
&cli.StringFlag{
Name: "custom-email-url",
Value: "",
Usage: "Use a custom Email URL (option for GitHub)",
},
&cli.StringFlag{
Name: "icon-url",
Value: "",
Usage: "Custom icon URL for OAuth2 login source",
},
&cli.BoolFlag{
Name: "skip-local-2fa",
Usage: "Set to true to skip local 2fa for users authenticated by this source",
},
&cli.StringSliceFlag{
Name: "scopes",
Value: nil,
Usage: "Scopes to request when to authenticate against this OAuth2 source",
},
&cli.StringFlag{
Name: "required-claim-name",
Value: "",
Usage: "Claim name that has to be set to allow users to login with this source",
},
&cli.StringFlag{
Name: "required-claim-value",
Value: "",
Usage: "Claim value that has to be set to allow users to login with this source",
},
&cli.StringFlag{
Name: "group-claim-name",
Value: "",
Usage: "Claim name providing group names for this source",
},
&cli.StringFlag{
Name: "admin-group",
Value: "",
Usage: "Group Claim value for administrator users",
},
&cli.StringFlag{
Name: "restricted-group",
Value: "",
Usage: "Group Claim value for restricted users",
},
&cli.StringFlag{
Name: "group-team-map",
Value: "",
Usage: "JSON mapping between groups and org teams",
},
&cli.BoolFlag{
Name: "group-team-map-removal",
Usage: "Activate automatic team membership removal depending on groups",
},
}
microcmdAuthAddOauth = &cli.Command{
Name: "add-oauth",
Usage: "Add new Oauth authentication source",
Action: runAddOauth,
Flags: oauthCLIFlags,
}
microcmdAuthUpdateOauth = &cli.Command{
Name: "update-oauth",
Usage: "Update existing Oauth authentication source",
Action: runUpdateOauth,
Flags: append(oauthCLIFlags[:1], append([]cli.Flag{idFlag}, oauthCLIFlags[1:]...)...),
}
)
func parseOAuth2Config(c *cli.Context) *oauth2.Source {
var customURLMapping *oauth2.CustomURLMapping
if c.IsSet("use-custom-urls") {
customURLMapping = &oauth2.CustomURLMapping{
TokenURL: c.String("custom-token-url"),
AuthURL: c.String("custom-auth-url"),
ProfileURL: c.String("custom-profile-url"),
EmailURL: c.String("custom-email-url"),
Tenant: c.String("custom-tenant-id"),
}
} else {
customURLMapping = nil
}
return &oauth2.Source{
Provider: c.String("provider"),
ClientID: c.String("key"),
ClientSecret: c.String("secret"),
OpenIDConnectAutoDiscoveryURL: c.String("auto-discover-url"),
CustomURLMapping: customURLMapping,
IconURL: c.String("icon-url"),
SkipLocalTwoFA: c.Bool("skip-local-2fa"),
Scopes: c.StringSlice("scopes"),
RequiredClaimName: c.String("required-claim-name"),
RequiredClaimValue: c.String("required-claim-value"),
GroupClaimName: c.String("group-claim-name"),
AdminGroup: c.String("admin-group"),
RestrictedGroup: c.String("restricted-group"),
GroupTeamMap: c.String("group-team-map"),
GroupTeamMapRemoval: c.Bool("group-team-map-removal"),
}
}
func runAddOauth(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
config := parseOAuth2Config(c)
if config.Provider == "openidConnect" {
discoveryURL, err := url.Parse(config.OpenIDConnectAutoDiscoveryURL)
if err != nil || (discoveryURL.Scheme != "http" && discoveryURL.Scheme != "https") {
return fmt.Errorf("invalid Auto Discovery URL: %s (this must be a valid URL starting with http:// or https://)", config.OpenIDConnectAutoDiscoveryURL)
}
}
return auth_model.CreateSource(ctx, &auth_model.Source{
Type: auth_model.OAuth2,
Name: c.String("name"),
IsActive: true,
Cfg: config,
})
}
func runUpdateOauth(c *cli.Context) error {
if !c.IsSet("id") {
return errors.New("--id flag is missing")
}
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
source, err := auth_model.GetSourceByID(ctx, c.Int64("id"))
if err != nil {
return err
}
oAuth2Config := source.Cfg.(*oauth2.Source)
if c.IsSet("name") {
source.Name = c.String("name")
}
if c.IsSet("provider") {
oAuth2Config.Provider = c.String("provider")
}
if c.IsSet("key") {
oAuth2Config.ClientID = c.String("key")
}
if c.IsSet("secret") {
oAuth2Config.ClientSecret = c.String("secret")
}
if c.IsSet("auto-discover-url") {
oAuth2Config.OpenIDConnectAutoDiscoveryURL = c.String("auto-discover-url")
}
if c.IsSet("icon-url") {
oAuth2Config.IconURL = c.String("icon-url")
}
if c.IsSet("scopes") {
oAuth2Config.Scopes = c.StringSlice("scopes")
}
if c.IsSet("required-claim-name") {
oAuth2Config.RequiredClaimName = c.String("required-claim-name")
}
if c.IsSet("required-claim-value") {
oAuth2Config.RequiredClaimValue = c.String("required-claim-value")
}
if c.IsSet("group-claim-name") {
oAuth2Config.GroupClaimName = c.String("group-claim-name")
}
if c.IsSet("admin-group") {
oAuth2Config.AdminGroup = c.String("admin-group")
}
if c.IsSet("restricted-group") {
oAuth2Config.RestrictedGroup = c.String("restricted-group")
}
if c.IsSet("group-team-map") {
oAuth2Config.GroupTeamMap = c.String("group-team-map")
}
if c.IsSet("group-team-map-removal") {
oAuth2Config.GroupTeamMapRemoval = c.Bool("group-team-map-removal")
}
// update custom URL mapping
customURLMapping := &oauth2.CustomURLMapping{}
if oAuth2Config.CustomURLMapping != nil {
customURLMapping.TokenURL = oAuth2Config.CustomURLMapping.TokenURL
customURLMapping.AuthURL = oAuth2Config.CustomURLMapping.AuthURL
customURLMapping.ProfileURL = oAuth2Config.CustomURLMapping.ProfileURL
customURLMapping.EmailURL = oAuth2Config.CustomURLMapping.EmailURL
customURLMapping.Tenant = oAuth2Config.CustomURLMapping.Tenant
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-token-url") {
customURLMapping.TokenURL = c.String("custom-token-url")
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-auth-url") {
customURLMapping.AuthURL = c.String("custom-auth-url")
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-profile-url") {
customURLMapping.ProfileURL = c.String("custom-profile-url")
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-email-url") {
customURLMapping.EmailURL = c.String("custom-email-url")
}
if c.IsSet("use-custom-urls") && c.IsSet("custom-tenant-id") {
customURLMapping.Tenant = c.String("custom-tenant-id")
}
oAuth2Config.CustomURLMapping = customURLMapping
source.Cfg = oAuth2Config
return auth_model.UpdateSource(ctx, source)
}

200
cmd/admin_auth_stmp.go Normal file
View File

@ -0,0 +1,200 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package cmd
import (
"errors"
"strings"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/auth/source/smtp"
"github.com/urfave/cli/v2"
)
var (
smtpCLIFlags = []cli.Flag{
&cli.StringFlag{
Name: "name",
Value: "",
Usage: "Application Name",
},
&cli.StringFlag{
Name: "auth-type",
Value: "PLAIN",
Usage: "SMTP Authentication Type (PLAIN/LOGIN/CRAM-MD5) default PLAIN",
},
&cli.StringFlag{
Name: "host",
Value: "",
Usage: "SMTP Host",
},
&cli.IntFlag{
Name: "port",
Usage: "SMTP Port",
},
&cli.BoolFlag{
Name: "force-smtps",
Usage: "SMTPS is always used on port 465. Set this to force SMTPS on other ports.",
Value: true,
},
&cli.BoolFlag{
Name: "skip-verify",
Usage: "Skip TLS verify.",
Value: true,
},
&cli.StringFlag{
Name: "helo-hostname",
Value: "",
Usage: "Hostname sent with HELO. Leave blank to send current hostname",
},
&cli.BoolFlag{
Name: "disable-helo",
Usage: "Disable SMTP helo.",
Value: true,
},
&cli.StringFlag{
Name: "allowed-domains",
Value: "",
Usage: "Leave empty to allow all domains. Separate multiple domains with a comma (',')",
},
&cli.BoolFlag{
Name: "skip-local-2fa",
Usage: "Skip 2FA to log on.",
Value: true,
},
&cli.BoolFlag{
Name: "active",
Usage: "This Authentication Source is Activated.",
Value: true,
},
}
microcmdAuthAddSMTP = &cli.Command{
Name: "add-smtp",
Usage: "Add new SMTP authentication source",
Action: runAddSMTP,
Flags: smtpCLIFlags,
}
microcmdAuthUpdateSMTP = &cli.Command{
Name: "update-smtp",
Usage: "Update existing SMTP authentication source",
Action: runUpdateSMTP,
Flags: append(smtpCLIFlags[:1], append([]cli.Flag{idFlag}, smtpCLIFlags[1:]...)...),
}
)
func parseSMTPConfig(c *cli.Context, conf *smtp.Source) error {
if c.IsSet("auth-type") {
conf.Auth = c.String("auth-type")
validAuthTypes := []string{"PLAIN", "LOGIN", "CRAM-MD5"}
if !util.SliceContainsString(validAuthTypes, strings.ToUpper(c.String("auth-type"))) {
return errors.New("Auth must be one of PLAIN/LOGIN/CRAM-MD5")
}
conf.Auth = c.String("auth-type")
}
if c.IsSet("host") {
conf.Host = c.String("host")
}
if c.IsSet("port") {
conf.Port = c.Int("port")
}
if c.IsSet("allowed-domains") {
conf.AllowedDomains = c.String("allowed-domains")
}
if c.IsSet("force-smtps") {
conf.ForceSMTPS = c.Bool("force-smtps")
}
if c.IsSet("skip-verify") {
conf.SkipVerify = c.Bool("skip-verify")
}
if c.IsSet("helo-hostname") {
conf.HeloHostname = c.String("helo-hostname")
}
if c.IsSet("disable-helo") {
conf.DisableHelo = c.Bool("disable-helo")
}
if c.IsSet("skip-local-2fa") {
conf.SkipLocalTwoFA = c.Bool("skip-local-2fa")
}
return nil
}
func runAddSMTP(c *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
if !c.IsSet("name") || len(c.String("name")) == 0 {
return errors.New("name must be set")
}
if !c.IsSet("host") || len(c.String("host")) == 0 {
return errors.New("host must be set")
}
if !c.IsSet("port") {
return errors.New("port must be set")
}
active := true
if c.IsSet("active") {
active = c.Bool("active")
}
var smtpConfig smtp.Source
if err := parseSMTPConfig(c, &smtpConfig); err != nil {
return err
}
// If not set default to PLAIN
if len(smtpConfig.Auth) == 0 {
smtpConfig.Auth = "PLAIN"
}
return auth_model.CreateSource(ctx, &auth_model.Source{
Type: auth_model.SMTP,
Name: c.String("name"),
IsActive: active,
Cfg: &smtpConfig,
})
}
func runUpdateSMTP(c *cli.Context) error {
if !c.IsSet("id") {
return errors.New("--id flag is missing")
}
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
source, err := auth_model.GetSourceByID(ctx, c.Int64("id"))
if err != nil {
return err
}
smtpConfig := source.Cfg.(*smtp.Source)
if err := parseSMTPConfig(c, smtpConfig); err != nil {
return err
}
if c.IsSet("name") {
source.Name = c.String("name")
}
if c.IsSet("active") {
source.IsActive = c.Bool("active")
}
source.Cfg = smtpConfig
return auth_model.UpdateSource(ctx, source)
}

46
cmd/admin_regenerate.go Normal file
View File

@ -0,0 +1,46 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package cmd
import (
asymkey_model "code.gitea.io/gitea/models/asymkey"
"code.gitea.io/gitea/modules/graceful"
repo_service "code.gitea.io/gitea/services/repository"
"github.com/urfave/cli/v2"
)
var (
microcmdRegenHooks = &cli.Command{
Name: "hooks",
Usage: "Regenerate git-hooks",
Action: runRegenerateHooks,
}
microcmdRegenKeys = &cli.Command{
Name: "keys",
Usage: "Regenerate authorized_keys file",
Action: runRegenerateKeys,
}
)
func runRegenerateHooks(_ *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
return repo_service.SyncRepositoryHooks(graceful.GetManager().ShutdownContext())
}
func runRegenerateKeys(_ *cli.Context) error {
ctx, cancel := installSignals()
defer cancel()
if err := initDB(ctx); err != nil {
return err
}
return asymkey_model.RewriteAllPublicKeys(ctx)
}

View File

@ -4,13 +4,14 @@
package cmd
import (
"context"
"errors"
"fmt"
user_model "code.gitea.io/gitea/models/user"
pwd "code.gitea.io/gitea/modules/auth/password"
"code.gitea.io/gitea/modules/auth/password"
"code.gitea.io/gitea/modules/optional"
"code.gitea.io/gitea/modules/setting"
user_service "code.gitea.io/gitea/services/user"
"github.com/urfave/cli/v2"
)
@ -32,6 +33,11 @@ var microcmdUserChangePassword = &cli.Command{
Value: "",
Usage: "New password to set for user",
},
&cli.BoolFlag{
Name: "must-change-password",
Usage: "User must change password",
Value: true,
},
},
}
@ -46,31 +52,27 @@ func runChangePassword(c *cli.Context) error {
if err := initDB(ctx); err != nil {
return err
}
if len(c.String("password")) < setting.MinPasswordLength {
return fmt.Errorf("Password is not long enough. Needs to be at least %d", setting.MinPasswordLength)
}
if !pwd.IsComplexEnough(c.String("password")) {
return errors.New("Password does not meet complexity requirements")
}
pwned, err := pwd.IsPwned(context.Background(), c.String("password"))
user, err := user_model.GetUserByName(ctx, c.String("username"))
if err != nil {
return err
}
if pwned {
return errors.New("The password you chose is on a list of stolen passwords previously exposed in public data breaches. Please try again with a different password.\nFor more details, see https://haveibeenpwned.com/Passwords")
}
uname := c.String("username")
user, err := user_model.GetUserByName(ctx, uname)
if err != nil {
return err
}
if err = user.SetPassword(c.String("password")); err != nil {
return err
}
if err = user_model.UpdateUserCols(ctx, user, "passwd", "passwd_hash_algo", "salt"); err != nil {
return err
opts := &user_service.UpdateAuthOptions{
Password: optional.Some(c.String("password")),
MustChangePassword: optional.Some(c.Bool("must-change-password")),
}
if err := user_service.UpdateAuth(ctx, user, opts); err != nil {
switch {
case errors.Is(err, password.ErrMinLength):
return fmt.Errorf("password is not long enough, needs to be at least %d characters", setting.MinPasswordLength)
case errors.Is(err, password.ErrComplexity):
return errors.New("password does not meet complexity requirements")
case errors.Is(err, password.ErrIsPwned):
return errors.New("the password is in a list of stolen passwords previously exposed in public data breaches, please try again with a different password, to see more details: https://haveibeenpwned.com/Passwords")
default:
return err
}
}
fmt.Printf("%s's password has been successfully updated!\n", user.Name)

View File

@ -8,10 +8,11 @@ import (
"fmt"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
pwd "code.gitea.io/gitea/modules/auth/password"
"code.gitea.io/gitea/modules/optional"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"github.com/urfave/cli/v2"
)
@ -46,8 +47,10 @@ var microcmdUserCreate = &cli.Command{
Usage: "Generate a random password for the user",
},
&cli.BoolFlag{
Name: "must-change-password",
Usage: "Set this option to false to prevent forcing the user to change their password after initial login, (Default: true)",
Name: "must-change-password",
Usage: "Set this option to false to prevent forcing the user to change their password after initial login",
Value: true,
DisableDefaultText: true,
},
&cli.IntFlag{
Name: "random-password-length",
@ -71,10 +74,10 @@ func runCreateUser(c *cli.Context) error {
}
if c.IsSet("name") && c.IsSet("username") {
return errors.New("Cannot set both --name and --username flags")
return errors.New("cannot set both --name and --username flags")
}
if !c.IsSet("name") && !c.IsSet("username") {
return errors.New("One of --name or --username flags must be set")
return errors.New("one of --name or --username flags must be set")
}
if c.IsSet("password") && c.IsSet("random-password") {
@ -110,23 +113,27 @@ func runCreateUser(c *cli.Context) error {
return errors.New("must set either password or random-password flag")
}
// always default to true
changePassword := true
// If this is the first user being created.
// Take it as the admin and don't force a password update.
if n := user_model.CountUsers(ctx, nil); n == 0 {
changePassword = false
}
isAdmin := c.Bool("admin")
mustChangePassword := true // always default to true
if c.IsSet("must-change-password") {
changePassword = c.Bool("must-change-password")
// if the flag is set, use the value provided by the user
mustChangePassword = c.Bool("must-change-password")
} else {
// check whether there are users in the database
hasUserRecord, err := db.IsTableNotEmpty(&user_model.User{})
if err != nil {
return fmt.Errorf("IsTableNotEmpty: %w", err)
}
if !hasUserRecord {
// if this is the first admin being created, don't force to change password (keep the old behavior)
mustChangePassword = false
}
}
restricted := util.OptionalBoolNone
restricted := optional.None[bool]()
if c.IsSet("restricted") {
restricted = util.OptionalBoolOf(c.Bool("restricted"))
restricted = optional.Some(c.Bool("restricted"))
}
// default user visibility in app.ini
@ -136,13 +143,13 @@ func runCreateUser(c *cli.Context) error {
Name: username,
Email: c.String("email"),
Passwd: password,
IsAdmin: c.Bool("admin"),
MustChangePassword: changePassword,
IsAdmin: isAdmin,
MustChangePassword: mustChangePassword,
Visibility: visibility,
}
overwriteDefault := &user_model.CreateUserOverwriteOptions{
IsActive: util.OptionalBoolTrue,
IsActive: optional.Some(true),
IsRestricted: restricted,
}

View File

@ -4,6 +4,7 @@
package cmd
import (
"errors"
"fmt"
"strings"
@ -42,7 +43,7 @@ var microcmdUserDelete = &cli.Command{
func runDeleteUser(c *cli.Context) error {
if !c.IsSet("id") && !c.IsSet("username") && !c.IsSet("email") {
return fmt.Errorf("You must provide the id, username or email of a user to delete")
return errors.New("You must provide the id, username or email of a user to delete")
}
ctx, cancel := installSignals()

View File

@ -4,6 +4,7 @@
package cmd
import (
"errors"
"fmt"
auth_model "code.gitea.io/gitea/models/auth"
@ -42,7 +43,7 @@ var microcmdUserGenerateAccessToken = &cli.Command{
func runGenerateAccessToken(c *cli.Context) error {
if !c.IsSet("username") {
return fmt.Errorf("You must provide a username to generate a token for")
return errors.New("You must provide a username to generate a token for")
}
ctx, cancel := installSignals()
@ -68,7 +69,7 @@ func runGenerateAccessToken(c *cli.Context) error {
return err
}
if exist {
return fmt.Errorf("access token name has been used already")
return errors.New("access token name has been used already")
}
// make sure the scopes are valid

View File

@ -136,7 +136,7 @@ func runCert(c *cli.Context) error {
SerialNumber: serialNumber,
Subject: pkix.Name{
Organization: []string{"Acme Co"},
CommonName: "Gitea",
CommonName: "Forgejo",
},
NotBefore: notBefore,
NotAfter: notAfter,

View File

@ -15,7 +15,7 @@ import (
var CmdDocs = &cli.Command{
Name: "docs",
Usage: "Output CLI documentation",
Description: "A command to output Gitea's CLI documentation, optionally to a file.",
Description: "A command to output Forgejo's CLI documentation, optionally to a file.",
Action: runDocs,
Flags: []cli.Flag{
&cli.BoolFlag{

View File

@ -14,18 +14,32 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/migrations"
migrate_base "code.gitea.io/gitea/models/migrations/base"
"code.gitea.io/gitea/modules/doctor"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/services/doctor"
"github.com/urfave/cli/v2"
"xorm.io/xorm"
)
// CmdDoctor represents the available doctor sub-command.
var CmdDoctor = &cli.Command{
Name: "doctor",
Usage: "Diagnose and optionally fix problems, convert or re-create database tables",
Description: "A command to diagnose problems with the current Forgejo instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Subcommands: []*cli.Command{
cmdDoctorCheck,
cmdRecreateTable,
cmdDoctorConvert,
},
}
var cmdDoctorCheck = &cli.Command{
Name: "check",
Usage: "Diagnose and optionally fix problems",
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Description: "A command to diagnose problems with the current Forgejo instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Action: runDoctorCheck,
Flags: []cli.Flag{
&cli.BoolFlag{
@ -60,19 +74,6 @@ var cmdDoctorCheck = &cli.Command{
},
}
// CmdDoctor represents the available doctor sub-command.
var CmdDoctor = &cli.Command{
Name: "doctor",
Usage: "Diagnose and optionally fix problems",
Description: "A command to diagnose problems with the current Gitea instance according to the given configuration. Some problems can optionally be fixed by modifying the database or data storage.",
Subcommands: []*cli.Command{
cmdDoctorCheck,
cmdRecreateTable,
cmdDoctorConvert,
},
}
var cmdRecreateTable = &cli.Command{
Name: "recreate-table",
Usage: "Recreate tables from XORM definitions and copy the data.",
@ -83,7 +84,7 @@ var cmdRecreateTable = &cli.Command{
Usage: "Print SQL commands sent",
},
},
Description: `The database definitions Gitea uses change across versions, sometimes changing default values and leaving old unused columns.
Description: `The database definitions Forgejo uses change across versions, sometimes changing default values and leaving old unused columns.
This command will cause Xorm to recreate tables, copying over the data and deleting the old table.
@ -177,6 +178,7 @@ func runDoctorCheck(ctx *cli.Context) error {
if ctx.IsSet("list") {
w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0)
_, _ = w.Write([]byte("Default\tName\tTitle\n"))
doctor.SortChecks(doctor.Checks)
for _, check := range doctor.Checks {
if check.IsDefault {
_, _ = w.Write([]byte{'*'})
@ -192,26 +194,20 @@ func runDoctorCheck(ctx *cli.Context) error {
var checks []*doctor.Check
if ctx.Bool("all") {
checks = doctor.Checks
checks = make([]*doctor.Check, len(doctor.Checks))
copy(checks, doctor.Checks)
} else if ctx.IsSet("run") {
addDefault := ctx.Bool("default")
names := ctx.StringSlice("run")
for i, name := range names {
names[i] = strings.ToLower(strings.TrimSpace(name))
}
runNamesSet := container.SetOf(ctx.StringSlice("run")...)
for _, check := range doctor.Checks {
if addDefault && check.IsDefault {
if (addDefault && check.IsDefault) || runNamesSet.Contains(check.Name) {
checks = append(checks, check)
continue
}
for _, name := range names {
if name == check.Name {
checks = append(checks, check)
break
}
runNamesSet.Remove(check.Name)
}
}
if len(runNamesSet) > 0 {
return fmt.Errorf("unknown checks: %q", strings.Join(runNamesSet.Values(), ","))
}
} else {
for _, check := range doctor.Checks {
if check.IsDefault {
@ -219,6 +215,5 @@ func runDoctorCheck(ctx *cli.Context) error {
}
}
}
return doctor.RunChecks(stdCtx, colorize, ctx.Bool("fix"), checks)
}

View File

@ -17,7 +17,7 @@ import (
var cmdDoctorConvert = &cli.Command{
Name: "convert",
Usage: "Convert the database",
Description: "A command to convert an existing MySQL database from utf8 to utf8mb4 or MSSQL database from varchar to nvarchar",
Description: "A command to convert an existing MySQL database from utf8 to utf8mb4",
Action: runDoctorConvert,
}
@ -35,21 +35,14 @@ func runDoctorConvert(ctx *cli.Context) error {
log.Info("Log path: %s", setting.Log.RootPath)
log.Info("Configuration file: %s", setting.CustomConf)
switch {
case setting.Database.Type.IsMySQL():
if err := db.ConvertUtf8ToUtf8mb4(); err != nil {
log.Fatal("Failed to convert database from utf8 to utf8mb4: %v", err)
if setting.Database.Type.IsMySQL() {
if err := db.ConvertDatabaseTable(); err != nil {
log.Fatal("Failed to convert database & table: %v", err)
return err
}
fmt.Println("Converted successfully, please confirm your database's character set is now utf8mb4")
case setting.Database.Type.IsMSSQL():
if err := db.ConvertVarcharToNVarchar(); err != nil {
log.Fatal("Failed to convert database from varchar to nvarchar: %v", err)
return err
}
fmt.Println("Converted successfully, please confirm your database's all columns character is NVARCHAR now")
default:
fmt.Println("This command can only be used with a MySQL or MSSQL database")
} else {
fmt.Println("This command can only be used with a MySQL database")
}
return nil

33
cmd/doctor_test.go Normal file
View File

@ -0,0 +1,33 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package cmd
import (
"context"
"testing"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/services/doctor"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli/v2"
)
func TestDoctorRun(t *testing.T) {
doctor.Register(&doctor.Check{
Title: "Test Check",
Name: "test-check",
Run: func(ctx context.Context, logger log.Logger, autofix bool) error { return nil },
SkipDatabaseInitialization: true,
})
app := cli.NewApp()
app.Commands = []*cli.Command{cmdDoctorCheck}
err := app.Run([]string{"./gitea", "check", "--run", "test-check"})
assert.NoError(t, err)
err = app.Run([]string{"./gitea", "check", "--run", "no-such"})
assert.ErrorContains(t, err, `unknown checks: "no-such"`)
err = app.Run([]string{"./gitea", "check", "--run", "test-check,no-such"})
assert.ErrorContains(t, err, `unknown checks: "no-such"`)
}

View File

@ -98,15 +98,15 @@ var outputTypeEnum = &outputType{
// CmdDump represents the available dump sub-command.
var CmdDump = &cli.Command{
Name: "dump",
Usage: "Dump Gitea files and database",
Usage: "Dump Forgejo files and database",
Description: `Dump compresses all related files and database into zip file.
It can be used for backup and capture Gitea server image to send to maintainer`,
It can be used for backup and capture Forgejo server image to send to maintainer`,
Action: runDump,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "file",
Aliases: []string{"f"},
Value: fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix()),
Value: fmt.Sprintf("forgejo-dump-%d.zip", time.Now().Unix()),
Usage: "Name of the dump file which will be created. Supply '-' for stdout. See type for available types.",
},
&cli.BoolFlag{
@ -128,7 +128,7 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
&cli.StringFlag{
Name: "database",
Aliases: []string{"d"},
Usage: "Specify the database SQL syntax: sqlite3, mysql, mssql, postgres",
Usage: "Specify the database SQL syntax: sqlite3, mysql, postgres",
},
&cli.BoolFlag{
Name: "skip-repository",
@ -209,7 +209,7 @@ func runDump(ctx *cli.Context) error {
if !setting.InstallLock {
log.Error("Is '%s' really the right config path?\n", setting.CustomConf)
return fmt.Errorf("gitea is not initialized")
return fmt.Errorf("forgejo is not initialized")
}
setting.LoadSettings() // cannot access session settings otherwise
@ -288,7 +288,7 @@ func runDump(ctx *cli.Context) error {
fatal("Path does not exist: %s", tmpDir)
}
dbDump, err := os.CreateTemp(tmpDir, "gitea-db.sql")
dbDump, err := os.CreateTemp(tmpDir, "forgejo-db.sql")
if err != nil {
fatal("Failed to create tmp file: %v", err)
}
@ -310,8 +310,8 @@ func runDump(ctx *cli.Context) error {
fatal("Failed to dump database: %v", err)
}
if err := addFile(w, "gitea-db.sql", dbDump.Name(), verbose); err != nil {
fatal("Failed to include gitea-db.sql: %v", err)
if err := addFile(w, "forgejo-db.sql", dbDump.Name(), verbose); err != nil {
fatal("Failed to include forgejo-db.sql: %v", err)
}
if len(setting.CustomConf) > 0 {
@ -452,16 +452,20 @@ func addRecursiveExclude(w archiver.Writer, insidePath, absPath string, excludeA
return err
}
for _, file := range files {
currentAbsPath := path.Join(absPath, file.Name())
currentAbsPath := filepath.Join(absPath, file.Name())
currentInsidePath := path.Join(insidePath, file.Name())
if util.SliceContainsString(excludeAbsPath, currentAbsPath) {
log.Debug("Skipping %q because matched an excluded path.", currentAbsPath)
continue
}
if file.IsDir() {
if !util.SliceContainsString(excludeAbsPath, currentAbsPath) {
if err := addFile(w, currentInsidePath, currentAbsPath, false); err != nil {
return err
}
if err = addRecursiveExclude(w, currentInsidePath, currentAbsPath, excludeAbsPath, verbose); err != nil {
return err
}
if err := addFile(w, currentInsidePath, currentAbsPath, false); err != nil {
return err
}
if err = addRecursiveExclude(w, currentInsidePath, currentAbsPath, excludeAbsPath, verbose); err != nil {
return err
}
} else {
// only copy regular files and symlink regular files, skip non-regular files like socket/pipe/...

117
cmd/dump_test.go Normal file
View File

@ -0,0 +1,117 @@
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package cmd
import (
"io"
"os"
"testing"
"github.com/mholt/archiver/v3"
"github.com/stretchr/testify/assert"
)
type mockArchiver struct {
addedFiles []string
}
func (mockArchiver) Create(out io.Writer) error {
return nil
}
func (m *mockArchiver) Write(f archiver.File) error {
m.addedFiles = append(m.addedFiles, f.Name())
return nil
}
func (mockArchiver) Close() error {
return nil
}
func TestAddRecursiveExclude(t *testing.T) {
t.Run("Empty", func(t *testing.T) {
dir := t.TempDir()
archiver := &mockArchiver{}
err := addRecursiveExclude(archiver, "", dir, []string{}, false)
assert.NoError(t, err)
assert.Empty(t, archiver.addedFiles)
})
t.Run("Single file", func(t *testing.T) {
dir := t.TempDir()
err := os.WriteFile(dir+"/example", nil, 0o666)
assert.NoError(t, err)
t.Run("No exclude", func(t *testing.T) {
archiver := &mockArchiver{}
err = addRecursiveExclude(archiver, "", dir, nil, false)
assert.NoError(t, err)
assert.Len(t, archiver.addedFiles, 1)
assert.EqualValues(t, "example", archiver.addedFiles[0])
})
t.Run("With exclude", func(t *testing.T) {
archiver := &mockArchiver{}
err = addRecursiveExclude(archiver, "", dir, []string{dir + "/example"}, false)
assert.NoError(t, err)
assert.Empty(t, archiver.addedFiles)
})
})
t.Run("File inside directory", func(t *testing.T) {
dir := t.TempDir()
err := os.MkdirAll(dir+"/deep/nested/folder", 0o750)
assert.NoError(t, err)
err = os.WriteFile(dir+"/deep/nested/folder/example", nil, 0o666)
assert.NoError(t, err)
err = os.WriteFile(dir+"/deep/nested/folder/another-file", nil, 0o666)
assert.NoError(t, err)
t.Run("No exclude", func(t *testing.T) {
archiver := &mockArchiver{}
err = addRecursiveExclude(archiver, "", dir, nil, false)
assert.NoError(t, err)
assert.Len(t, archiver.addedFiles, 5)
assert.EqualValues(t, "deep", archiver.addedFiles[0])
assert.EqualValues(t, "deep/nested", archiver.addedFiles[1])
assert.EqualValues(t, "deep/nested/folder", archiver.addedFiles[2])
assert.EqualValues(t, "deep/nested/folder/example", archiver.addedFiles[3])
assert.EqualValues(t, "deep/nested/folder/another-file", archiver.addedFiles[4])
})
t.Run("Exclude first directory", func(t *testing.T) {
archiver := &mockArchiver{}
err = addRecursiveExclude(archiver, "", dir, []string{dir + "/deep"}, false)
assert.NoError(t, err)
assert.Empty(t, archiver.addedFiles)
})
t.Run("Exclude nested directory", func(t *testing.T) {
archiver := &mockArchiver{}
err = addRecursiveExclude(archiver, "", dir, []string{dir + "/deep/nested/folder"}, false)
assert.NoError(t, err)
assert.Len(t, archiver.addedFiles, 2)
assert.EqualValues(t, "deep", archiver.addedFiles[0])
assert.EqualValues(t, "deep/nested", archiver.addedFiles[1])
})
t.Run("Exclude file", func(t *testing.T) {
archiver := &mockArchiver{}
err = addRecursiveExclude(archiver, "", dir, []string{dir + "/deep/nested/folder/example"}, false)
assert.NoError(t, err)
assert.Len(t, archiver.addedFiles, 4)
assert.EqualValues(t, "deep", archiver.addedFiles[0])
assert.EqualValues(t, "deep/nested", archiver.addedFiles[1])
assert.EqualValues(t, "deep/nested/folder", archiver.addedFiles[2])
assert.EqualValues(t, "deep/nested/folder/another-file", archiver.addedFiles[3])
})
})
}

View File

@ -157,9 +157,9 @@ func runViewDo(c *cli.Context) error {
}
if len(matchedAssetFiles) == 0 {
return fmt.Errorf("no files matched the given pattern")
return errors.New("no files matched the given pattern")
} else if len(matchedAssetFiles) > 1 {
return fmt.Errorf("too many files matched the given pattern, try to be more specific")
return errors.New("too many files matched the given pattern, try to be more specific")
}
data, err := matchedAssetFiles[0].fs.ReadFile(matchedAssetFiles[0].name)
@ -180,7 +180,7 @@ func runExtractDo(c *cli.Context) error {
}
if c.NArg() == 0 {
return fmt.Errorf("a list of pattern of files to extract is mandatory (e.g. '**' for all)")
return errors.New("a list of pattern of files to extract is mandatory (e.g. '**' for all)")
}
destdir := "."

Some files were not shown because too many files have changed in this diff Show More