Commit graph

14986 commits

Author SHA1 Message Date
Giteabot
a87c620d99
Add WithPullRequest for actionsNotifier (#25144) (#25196)
Backport #25144 by @Zettat123

Fix #25093

If
[`WithPullRequest`](679b1f7949/services/actions/notifier_helper.go (L90-L96))
is not called, the `Ref` in
[`notifyInput`](679b1f7949/services/actions/notifier_helper.go (L55-L65))
will be empty, so the workflows in the head branch will not be found and
triggered.

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit de6ac4bf2a445a7854bbd9a603accf3d8118a719)
2023-06-12 23:23:43 +02:00
Lauris BH
a259a928ad
Fix open redirect check for more cases (#25143) (#25155)
Backport https://github.com/go-gitea/gitea/pull/25143

If redirect_to parameter has set value starting with \\example.com
redirect will be created with header Location: /\\example.com that will
redirect to example.com domain.

(cherry picked from commit a9030052a7b92bdfa1a6be0cdb540050a16ba31e)
2023-06-12 23:23:43 +02:00
HesterG
719dddd7b4
Fix broken links in documents v1.19 (#25142)
Partially port #24630

(cherry picked from commit ed78711e469865c378a295d00156e92b62f33105)
2023-06-12 23:23:43 +02:00
sillyguodong
5cc5a2000e
add zh-cn for Upgrade from old Gitea in v1.19 (#25022)
as title

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit e3cdb050fa24fdd9f5fd211260d087c05356a521)
2023-06-12 23:23:38 +02:00
techknowlogick
05cb2f2ddb
update labels link to correct location in 1.19 docs (#25105)
(cherry picked from commit 8df6713a6e3c83b7b86f355346f39190d6c4de32)
2023-06-12 23:23:38 +02:00
Giteabot
4cd188e9c6
Fix parallelly generating index failure with Mysql (#24567) (#25081)
Backport #24567 by @lunny

- Fix possible parallel creating commit status index problem and
creating issues/pull request index problem work with Mysql5/Mysql8
- Add parallel tests
- Reenable TestRepoCommitsStatusParallel on CI

Fix #22109

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 3ef97932d5b8d34decba3c7592b868f05773faf3)
2023-06-12 23:23:37 +02:00
Earl Warren
5dea2e272a
[BRANDING] How to start a runner: URL to Actions admin documentation
(cherry picked from commit da91799e6f06ac3c91c1cfc763f4ec0b5cc3cf21)
2023-06-11 10:30:44 +02:00
Giteabot
101cb5f4a4
improve permission documentation (#23942) (#25078)
(cherry picked from commit 15adec19e77d85fcd9cb798765d8b25373cdc28f)
2023-06-05 15:44:19 +02:00
Giteabot
700e5603be
GitLab migration: Sanitize response for reaction list (#25054) (#25059)
Backport #25054 by @6543

Co-authored-by: 6543 <6543@obermui.de>
(cherry picked from commit 8e94b715cc27fcdf28bc3c5d1420ceba74e7ddfd)
2023-06-05 15:44:19 +02:00
HesterG
c1ea975369
Add oauth Chinese document for v1.19 (#25020)
(cherry picked from commit b2ec116c605286b8eef2321d76d4c9006327aede)
2023-06-05 15:44:19 +02:00
HesterG
80c87c390d
Port Chinese document for localization to v1.19 (#25021)
(cherry picked from commit edfa2c5b78729797c5ee74ae63126c716fe23302)
2023-06-05 15:44:19 +02:00
Giteabot
05a3e8572c
Fix users cannot visit issue attachment bug (#25019) (#25027)
Backport #25019 by @lunny

Caused by #24362

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
(cherry picked from commit 73ae6b21d1b993e9936224b79b0bc743dbf382fc)
2023-06-05 15:44:19 +02:00
silverwind
c5245fabe4
Run markdownlint on drone, fix lint issue (#25040)
It currently does not run on 1.19 branch, resulting in lint error having
landed in https://github.com/go-gitea/gitea/pull/25016.

(cherry picked from commit b83e4f295d91b4d480d925b411a93e9e151790d1)
2023-06-05 15:44:19 +02:00
sillyguodong
e030d90f07
Add chinese documentations for Packages (#24914) (#25016)
backport: #24914
(cherry picked from commit 95bf09fca0361ce25517c41c396b447c7f544e14)
2023-06-05 15:44:19 +02:00
sillyguodong
ba2c902092
Add chinese documentations for installation (#24904) (#25015)
backport #24904

(cherry picked from commit 3b5cc02345cd64f9179b8c4d47effa2dc4948867)
2023-06-05 15:44:19 +02:00
HesterG
3f4a67eef8
Add Chinese docs for help, contribution and development (#24925) (#25011)
Backport #24925, partially backport #24934
(`docs/content/doc/help/faq.zh-cn.md` file)

Part of backport has already done by #24942

Also backport #24881 to avoid "deadlock"

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 37b73b333707d0e002c2074d59c0c60cc02658a3)
2023-06-05 15:44:19 +02:00
HesterG
35c503f1ca
Unify doc links to use paths relative to doc folder (#24979) (#25000)
Backport #24979

Changes:

1. Use uniform links types relative to doc folder (start with `doc/`)
2. According to [docusaurus
links](https://docusaurus.io/docs/markdown-features/links), if `<a>` is
used, the `href` is resolved as URL location, but not file location. So
need to use `[text]({{< relref "path" >}})` instead.

(cherry picked from commit d2c9fb02dd209079a660734f1b920bc1045362ff)
2023-06-05 15:44:19 +02:00
HesterG
442a13b98a
Remove unnecessary content on docs (#24976) (#25001)
Backport #24976

(cherry picked from commit cdeb55f6e53ac9bb8dcfc2d2aa6a84e4391ec6c5)
2023-06-05 15:44:19 +02:00
Giteabot
18b1ae2e72
Update from-binary.en-us.md (#24975) (#24999)
Backport #24975 by @team-epk

Fixed link to the creating a systemd service in Ubuntu document.

(cherry picked from commit 0ef7b6601835ff91902393d53e8fb7511f9c91fa)
2023-06-05 15:44:19 +02:00
sillyguodong
58bdcae613
Fix missing reference prefix of commits when sync mirror repository (#24994)
replace #24868
just a patch to fix #24824 in v1.19.4
The reference name of commits when synchronizing should also has prefix
like refs/heads/<branch-name>.

(cherry picked from commit 826b7b979c5e514f056836aebf6fd5422fbcd843)
2023-05-30 08:11:45 +02:00
Amos (LFlare) Ng
8d4d6f9b22
Match unqualified references when syncing pulls as well (#23070)
It seems that `opts.RefFullName` may occassionally be set
to just the branch name, without the `refs/heads/` prefixing.

(cherry picked from commit 7dc46ffbaa307d28db2ca7a0431d76ef900565bc)
2023-05-30 08:11:45 +02:00
Giteabot
7f3cc1446a
zh-cn translation for usage docs (#24897) (#24977)
Backport #24897 by @Zettat123

- [x] agit-support
- [x] clone-filter
- [x] incoming-email
- [x] labels
- [x] linked-references
- [x] merge-message-templates
- [x] permissions
- [x] profile-readme
- [x] protected-tags
- [x] push
- [x] repo-mirror
- [x] secrets
- [x] template-repositories
- [x] webhooks

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 3a7e0953c1c44931e47b1bf2f5f1909c58011095)
2023-05-30 08:11:45 +02:00
Giteabot
9cabf76a09
simple docs fixes: 'pull request' page (en-us & zh-tw) link path to 'issue-pull-request-templates' (#24961) (#24970)
Backport #24961 by @jonkeim

Co-authored-by: Jon Keim <jon@windless.org>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 9da84a36ebded41aa77943c3e4e3ce9ab50b2423)
2023-05-30 08:11:45 +02:00
Giteabot
6f76c659ea
Remove reference to caddy v1 in docs (#24962) (#24964)
Backport #24962 by @techknowlogick

caddy v1 is loong eol. v2 should be used.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 8a6a1143a4a03b587164cac93049a34c7b2dd47c)
2023-05-30 08:11:45 +02:00
HesterG
7f45886f05
Fix doc for 1.19 backend guideline (#24942)
Port the file change in
https://github.com/go-gitea/gitea/pull/24925/files from `main` to
`v1.19` to fix docs

(cherry picked from commit b4cd1028d90ba600c7da0ce4e13e83de94b10e80)
2023-05-30 08:11:45 +02:00
Giteabot
788ffdb328
Merge two translation contributing documents (#23939) (#24933)
Backport #23939 by @lunny

This PR also adjusts the weights.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit d1af0a3e4c111a819fee0718fc7e0d755335fe14)
2023-05-30 08:11:45 +02:00
wxiaoguang
6d3b3af57d
Merge different languages for language stats (#24900) (#24921)
Backport #24900

Fix #24896

If users set different languages by `linguist-language`, the `stats` map
could be: `java: 100, Java: 200`.

Language stats are stored as case-insensitive in database and there is a
unique key.

So, the different language names should be merged to one unique name:
`Java: 300`

(cherry picked from commit a83d597989bbfa6d7c10a1737bc40faa83224342)
2023-05-30 08:11:45 +02:00
Paweł Bogusławski
5fdac0d46a
Hiding Secrets options when Actions feature is disabled (#24792)
`Secrets` options should be hidden if `Actions` feature is disabled.

This fixes in release/v1.19. In main probably fixed in
63a401ac40 (didn't check).

Fixes: 659055138b
Author-Change-Id: IB#1134011

Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>
(cherry picked from commit c5dee8823c55bd691994844868ffbb70e4b6a019)
2023-05-30 08:11:45 +02:00
Giteabot
75122edc97
Only validate changed columns when update user (#24867) (#24903)
Backport #24867 by @lunny

Fix #23211
Replace #23496

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 275abd65935216c05aa2d1238d8d8a7cfc739a35)
2023-05-30 08:11:45 +02:00
wxiaoguang
936eb64ebf
Make DeleteIssue use correct context (#24885)
Fix #24884 , the `ctx.Repo.GitRepo` might be nil.

(cherry picked from commit d19d5bc5b89ef2e46fc3b8f6c55551ce935d05bc)
2023-05-30 08:11:44 +02:00
Lunny Xiao
a28fd056e5
Remove unnecessary prefix usage (#24888)
Since now all articles have a class, the `Usage:` is unnecessary. This
PR will remove them.

(cherry picked from commit e7757aa4be3ecb067749df226043e61a12b62d82)
2023-05-30 08:11:44 +02:00
Earl Warren
24b6efc2fb
Revert "[API] fix deleting an issue when the git repo does not exist"
replaced by d00af6130 Remove unnecessary prefix usage (#24888)

This reverts commit 985e378272.
2023-05-30 08:10:44 +02:00
silverwind
a1776ee351
Set --font-weight-bold to 600 (#24840)
Backport of https://github.com/go-gitea/gitea/pull/24827 to 1.19, just
the font weight reduction.

(cherry picked from commit e81d38b0f620bdd65643eb48b25341ed854ccf27)
2023-05-23 07:42:34 +02:00
Giteabot
16bcceeff7
Return 404 in the API if the requested webhooks were not found (#24823) (#24830)
Backport #24823 by @sonjek

Should resolve first point of the issue
https://github.com/go-gitea/gitea/issues/24574

Co-authored-by: Yevhen Pavlov <yevhen.pavlov.ua@gmail.com>
(cherry picked from commit f29c52a1691656531db44404ba59d27bd0a1760a)
2023-05-23 07:42:34 +02:00
Giteabot
5dc29fdeb1
Fix topics deleted via API not being deleted in org page (#24825) (#24829)
Backport #24825 by @yardenshoham

The topics are saved in the repo_topic table with a repoID key. They are
also saved directly in the repository table.

Before this PR, only `AddTopic` and `SaveTopics` made sure the `topics`
field in the repository field was synced with the repo_topic table.

This PR makes sure `GenerateTopics` and `DeleteTopic` also sync the
`topics` in the repository table.

`RemoveTopicsFromRepo` doesn't need to sync the data as it is only used
to delete a repository.

- Fixes #24820

(cherry picked from commit 04f9ab1aa95a9a7f228791af36fe484ec793682f)
2023-05-23 07:42:34 +02:00
Giteabot
88bde31515
Fix Actions being enabled accidentally (#24802) (#24810)
Backport #24802 by @wolfogre

Regression of #24536. If the user doesn't explicitly disable Actions, it
will be enabled.

1. Gitea will call `loadRepositoryFrom` before `loadActionsFrom`.

25d4f95df2/modules/setting/setting.go (L234-L237)
2. In `loadRepositoryFrom`,
`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` will set
`actions.ENABLED` with `true`.

25d4f95df2/modules/setting/repository.go (L313-L315)
3. In `loadActionsFrom`, `rootCfg.Section("actions")` will get a section
with Actions enabled.

25d4f95df2/modules/setting/actions.go (L23-L26)

Although the cause of the problem was using `true` by copy-paste
mistake, it also surprised me that
**`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` doesn't
only read, but also write.**

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit b369ed579d438ee3b06ee23eee9fada1d08b49cc)
2023-05-23 07:42:34 +02:00
wxiaoguang
9bc4887cb7
Fix safari cookie session bug (#24772)
Partically backport #24330

Related: #24176

Maybe fix #24770

(cherry picked from commit 64cc691b7f5977915b686bdf85e4c6ffe9692a35)
2023-05-23 07:42:34 +02:00
Giteabot
b261f44478
Fix missed table name on iterate lfs meta objects (#24768) (#24774)
Backport #24768 by @lunny

Fix #24763

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 1bad05da3d5a35e20f5f36d41f9bfaa4617e550d)
2023-05-23 07:42:34 +02:00
Giteabot
9cf864c36d
Make mailer SMTP check have timed context (#24751) (#24759)
Backport #24751 by @wxiaoguang

Make mailer SMTP check have timed context

Otherwise Gitea may block for long time if the DNS request blocks.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 57f520e7e5259a5e220ec8cdaccf6973dcde0f81)
2023-05-23 07:42:34 +02:00
Giteabot
f6919e3e53
Respect original content when creating secrets (#24745) (#24746)
Backport #24745 by @wolfogre

Fix #24721.

Follow what GitHub does:
- Don't trim spaces for secrets.
- Newline should be `\n` instead of `\r\n`.

Did some tests with:

```yaml
name: secrets
on: push
jobs:
  show_secrets:
    runs-on: ubuntu-latest
    steps:
      - name: Dump secrets context
        run: echo '${{ toJSON(secrets) }}' | base64
```

`AAAAAA`:
```text
   AAAAAA
AAAAAA

```
`BBBBBB`:
```text

BBBBBB
BBBBBB
```

On GitHub:

<img width="675" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/0ec60652-c2a3-47bb-9f9d-7e81665355a8">

On Gitea (before):

<img width="673" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/cce818bf-5edc-4656-86e1-2c81c304cdb2">

On Gitea (after):

<img width="673" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/0b3b15af-4d48-4bab-a334-4738a1b0eb4a">

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit e4f200e616e79cdea7f1c50b5dbb3f3ed2fe84db)
2023-05-23 07:42:33 +02:00
wxiaoguang
f37fba567a
Fix Pull Mirror out-of-sync bugs (#24732) (#24733)
Backport #24732

Bug-fix only

(cherry picked from commit 6ecd2e782f850fe4f27d32bf4b69137f07a8f254)
2023-05-16 07:42:23 +02:00
Giteabot
f9bf040a5a
Fix run list broken when trigger user deleted (#24706) (#24709)
Backport #24706 by @lunny

Fix #24682

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 2fea93b2d38149db50c4ac999f952bacf10b5b0b)
2023-05-16 07:42:23 +02:00
Giteabot
e12f550fed
Add test for api team organization (#24699) (#24702)
Backport #24699 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 0ee51a5221b14e6a944556381367db149ab55c4e)
2023-05-16 07:42:23 +02:00
Giteabot
bfa368adbe
Fix organization field being null in GET /api/v1/teams/{id} (#24694) (#24696)
Backport #24694 by @yardenshoham

Enabled the organization loading flag.

- Fixes #20399

# Before
```json
{
  ...
  "description": "",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

# After
```json
{
  ...
  "description": "",
  "organization": {
    "id": 2,
    "name": "bigorg",
    "full_name": "",
    "avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9",
    "description": "",
    "website": "",
    "location": "",
    "visibility": "public",
    "repo_admin_change_team_access": true,
    "username": "bigorg"
  },
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit da1c38dd477afc555fd428441c6582b8ea1468e2)
2023-05-16 07:42:22 +02:00
Giteabot
5df83525da
Fix docs documenting invalid @every for OLDER_THAN cron settings (#24695) (#24698)
Backport #24695 by @yardenshoham

Looks like a copy-paste leftover

- Fixes #20868

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit aa984f21fa293cc43a9b3abcea5aedeb58d64282)
2023-05-16 07:42:22 +02:00
Giteabot
55d062003c
Fix issues list page multiple selection update milestones (#24660) (#24663)
Backport #24660 by @lunny

Fix #24651

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 8f722012f6b3a5cbc0b1af667547ee28aa8d4670)
2023-05-16 07:42:22 +02:00
oliverpool
937b8e8184
fix: release page for empty or non-existing target (#24659)
Backport #24470

Fixes #24145

---

To solve the bug, I added a "computed" `TargetBehind` field to the
`Release` model, which indicates the target branch of a release. This is
particularly useful if the target branch was deleted in the meantime (or
is empty).

I also did a micro-optimization in `calReleaseNumCommitsBehind`. Instead
of checking that a branch exists and then call `GetBranchCommit`, I
immediately call `GetBranchCommit` and handle the `git.ErrNotExist`
error.

This optimization is covered by the added unit test.

_contributed in the context of @forgejo_

(cherry picked from commit cb7ba8969db3b6750221fa955e4e8b2968a7eaed)
2023-05-16 07:42:22 +02:00
Earl Warren
3e8f99287a
Merge remote-tracking branch 'forgejo/v1.19/forgejo-i18n' into v1.19/forgejo 2023-05-10 18:53:07 +02:00
Earl Warren
b2289c52f9
Merge remote-tracking branch 'forgejo/v1.19/forgejo-branding' into v1.19/forgejo 2023-05-10 18:53:01 +02:00
Caesar Schinas
82cd82d89f
[BRANDING] Rebrand footer "powered by" links
(cherry picked from commit 8b9237e47e067db4cb8b1d477865d75b258bee1e)
(cherry picked from commit 47e5543f33a9dafac5517cb5cb29d0fe6d266e2a)
(cherry picked from commit 456abff8c0567168b1a6c0d02d6830404d1b0dd3)
(cherry picked from commit 2d2588187ec20cb2f552cd3ee2b04a541909dc5c)
(cherry picked from commit f4a4975333)
(cherry picked from commit 4d116d61df103ce6aee1fdaf4d886a44df0cd809)
(cherry picked from commit dcc054471e)
(cherry picked from commit 5146f47867)
(cherry picked from commit 7ffe74685a)
2023-05-10 11:05:22 +02:00