1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-09-01 14:56:30 +00:00
Commit Graph

14928 Commits

Author SHA1 Message Date
HesterG
c23ab427e1
Change branch name from master to main in some documents' links () ()
Backport 

As title. And needs to backport to 1.19
2023-06-08 04:31:55 -04:00
sillyguodong
e3cdb050fa
add zh-cn for Upgrade from old Gitea in v1.19 ()
as title

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-06-06 11:39:53 -04:00
techknowlogick
8df6713a6e
update labels link to correct location in 1.19 docs () 2023-06-06 11:29:16 -04:00
Giteabot
3ef97932d5
Fix parallelly generating index failure with Mysql () ()
Backport  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 

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-06-05 11:05:52 -04:00
Giteabot
15adec19e7
improve permission documentation () () 2023-06-05 18:04:59 +08:00
Giteabot
8e94b715cc
GitLab migration: Sanitize response for reaction list () ()
Backport  by @6543

Co-authored-by: 6543 <6543@obermui.de>
2023-06-02 17:13:33 -04:00
HesterG
b2ec116c60
Add oauth Chinese document for v1.19 () 2023-06-02 10:52:53 -04:00
HesterG
edfa2c5b78
Port Chinese document for localization to v1.19 () 2023-06-02 10:49:33 -04:00
Giteabot
73ae6b21d1
Fix users cannot visit issue attachment bug () ()
Backport  by @lunny

Caused by 

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2023-06-01 19:22:26 +02:00
silverwind
b83e4f295d
Run markdownlint on drone, fix lint issue ()
It currently does not run on 1.19 branch, resulting in lint error having
landed in https://github.com/go-gitea/gitea/pull/25016.
2023-06-01 10:34:40 -05:00
sillyguodong
95bf09fca0
Add chinese documentations for Packages () ()
backport: 
2023-05-31 15:55:01 +08:00
sillyguodong
3b5cc02345
Add chinese documentations for installation () ()
backport 
2023-05-31 14:17:19 +08:00
HesterG
37b73b3337
Add Chinese docs for help, contribution and development () ()
Backport , partially backport 
(`docs/content/doc/help/faq.zh-cn.md` file)

Part of backport has already done by 

Also backport  to avoid "deadlock"

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-05-31 14:12:37 +08:00
HesterG
d2c9fb02dd
Unify doc links to use paths relative to doc folder () ()
Backport  

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.
2023-05-30 18:08:32 +08:00
HesterG
cdeb55f6e5
Remove unnecessary content on docs () ()
Backport 
2023-05-30 17:21:03 +08:00
Giteabot
0ef7b66018
Update from-binary.en-us.md () ()
Backport  by @team-epk

Fixed link to the creating a systemd service in Ubuntu document.
2023-05-30 14:01:06 +08:00
sillyguodong
826b7b979c
Fix missing reference prefix of commits when sync mirror repository ()
replace 
just a patch to fix  in v1.19.4
The reference name of commits when synchronizing should also has prefix
like refs/heads/<branch-name>.
2023-05-30 13:12:21 +08:00
Amos (LFlare) Ng
7dc46ffbaa
Match unqualified references when syncing pulls as well ()
It seems that `opts.RefFullName` may occassionally be set
to just the branch name, without the `refs/heads/` prefixing.
2023-05-29 11:32:32 +02:00
Giteabot
3a7e0953c1
zh-cn translation for usage docs () ()
Backport  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>
2023-05-29 11:53:11 +08:00
Giteabot
9da84a36eb
simple docs fixes: 'pull request' page (en-us & zh-tw) link path to 'issue-pull-request-templates' () ()
Backport  by @jonkeim

Co-authored-by: Jon Keim <jon@windless.org>
Co-authored-by: silverwind <me@silverwind.io>
2023-05-28 21:51:53 -04:00
Giteabot
8a6a1143a4
Remove reference to caddy v1 in docs () ()
Backport  by @techknowlogick

caddy v1 is loong eol. v2 should be used.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-05-28 05:34:50 -04:00
HesterG
b4cd1028d9
Fix doc for 1.19 backend guideline ()
Port the file change in
https://github.com/go-gitea/gitea/pull/24925/files from `main` to
`v1.19` to fix docs
2023-05-26 17:22:38 +08:00
Giteabot
d1af0a3e4c
Merge two translation contributing documents () ()
Backport  by @lunny

This PR also adjusts the weights.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2023-05-25 12:07:25 -04:00
wxiaoguang
a83d597989
Merge different languages for language stats () ()
Backport 

Fix 

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`
2023-05-25 07:12:21 +02:00
Paweł Bogusławski
c5dee8823c
Hiding Secrets options when Actions feature is disabled ()
`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>
2023-05-24 18:01:11 +08:00
Giteabot
275abd6593
Only validate changed columns when update user () ()
Backport  by @lunny

Fix 
Replace 

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-05-24 04:24:02 -04:00
wxiaoguang
d19d5bc5b8
Make DeleteIssue use correct context ()
Fix  , the `ctx.Repo.GitRepo` might be nil.
2023-05-23 13:11:19 -04:00
Lunny Xiao
e7757aa4be
Remove unnecessary prefix usage ()
Since now all articles have a class, the `Usage:` is unnecessary. This
PR will remove them.
2023-05-24 00:34:31 +08:00
silverwind
e81d38b0f6
Set --font-weight-bold to 600 ()
Backport of https://github.com/go-gitea/gitea/pull/24827 to 1.19, just
the font weight reduction.
2023-05-22 10:56:41 +08:00
Giteabot
f29c52a169
Return 404 in the API if the requested webhooks were not found () ()
Backport  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>
2023-05-21 14:05:58 -04:00
Giteabot
04f9ab1aa9
Fix topics deleted via API not being deleted in org page () ()
Backport  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 
2023-05-21 20:48:54 +08:00
Giteabot
b369ed579d
Fix Actions being enabled accidentally () ()
Backport  by @wolfogre

Regression of . 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>
2023-05-19 15:17:48 +02:00
wxiaoguang
64cc691b7f
Fix safari cookie session bug ()
Partically backport 

Related: 

Maybe fix 
2023-05-18 09:10:23 +08:00
Giteabot
1bad05da3d
Fix missed table name on iterate lfs meta objects () ()
Backport  by @lunny

Fix 

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-05-17 20:35:20 +02:00
Giteabot
57f520e7e5
Make mailer SMTP check have timed context () ()
Backport  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>
2023-05-17 06:08:39 -04:00
Giteabot
e4f200e616
Respect original content when creating secrets () ()
Backport  by @wolfogre

Fix .

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>
2023-05-16 03:33:47 -04:00
wxiaoguang
6ecd2e782f
Fix Pull Mirror out-of-sync bugs () ()
Backport  

Bug-fix only
2023-05-15 20:30:21 +02:00
Giteabot
2fea93b2d3
Fix run list broken when trigger user deleted () ()
Backport  by @lunny

Fix 

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-05-14 04:55:58 -04:00
Giteabot
0ee51a5221
Add test for api team organization () ()
Backport  by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-05-13 18:08:53 -04:00
Giteabot
da1c38dd47
Fix organization field being null in GET /api/v1/teams/{id} () ()
Backport  by @yardenshoham

Enabled the organization loading flag.

- Fixes  

# 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>
2023-05-13 21:01:54 +02:00
Giteabot
aa984f21fa
Fix docs documenting invalid @every for OLDER_THAN cron settings () ()
Backport  by @yardenshoham

Looks like a copy-paste leftover

- Fixes 

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
2023-05-13 23:47:56 +08:00
Giteabot
8f722012f6
Fix issues list page multiple selection update milestones () ()
Backport  by @lunny

Fix 

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-05-12 14:58:46 -04:00
oliverpool
cb7ba8969d
fix: release page for empty or non-existing target ()
Backport 

Fixes 

---

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_
2023-05-12 14:14:41 -04:00
Giteabot
7eaf7aacde
Do not select line numbers when selecting text from the action run logs () ()
Backport  by @yardenshoham

- Fixes 

# Before

![image](https://user-images.githubusercontent.com/20454870/236873942-26e97f28-6595-4be9-88fa-158870eda253.png)

# After

![image](https://user-images.githubusercontent.com/20454870/236874171-8f0182a5-e953-4740-b875-f3542dee8325.png)

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
2023-05-08 15:56:53 -04:00
Giteabot
b390b439e1
Fix close org projects () ()
Backport  by @yp05327

A part of 
We can not close org projects now. This PR will fix it.

Co-authored-by: yp05327 <576951401@qq.com>
2023-05-08 20:50:27 +02:00
Giteabot
306b7b5d1d
Refresh the refernce of the closed PR when reopening () ()
Backport  by @sillyguodong

Close  
Replace 

#### Cause

- Before, in order to making PR can get latest commit after reopening,
the `ref`(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR
will be updated when pushing commits to the `head branch` of the closed
PR.

#### Changes

- For closed PR , won't perform these behavior: insert`comment`, push
`notification` (UI and email), exectue
[pushToBaseRepo](7422503341/services/pull/pull.go (L409))
function and trigger `action` any more when pushing to the `head branch`
of the closed PR.
- Refresh the reference of the PR when reopening the closed PR (**even
if the head branch has been deleted before**). Make the reference of PR
consistent with the `head branch`.

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
2023-05-08 12:48:06 +02:00
wxiaoguang
4498a26222
Improve decryption failure message () ()
Backport 

Help some users like  

There are many users reporting similar problem: if the SECRET_KEY
mismatches, some operations (like 2FA login) only reports unclear 500
error and unclear "base64 decode error" log (some maintainers ever spent
a lot of time on debugging such problem)

The SECRET_KEY was not well-designed and it is also a kind of technical
debt. Since it couldn't be fixed easily, it's good to add clearer error
messages, then at least users could know what the real problem is.
2023-05-07 22:12:32 +08:00
Giteabot
6f57be0025
Makefile: Use portable !, not GNUish -not, with find(1). () ()
Backport  by @riastradh

fix https://github.com/go-gitea/gitea/issues/24564

Co-authored-by: Taylor R Campbell <campbell+gitea@mumble.net>
2023-05-07 19:30:13 +08:00
Giteabot
257287954c
Fix the permission of team's Actions unit issue () ()
Backport  by @sillyguodong

close 

The unit of `Actions` should be contorlled not only by
`repository.DISABLED_REPO_UNITS` but also by `actions.ENABLED`
in the `app.ini`.
Previously, the permission of the team's `Actions` unit was not
controlled by `actions.Enabled`. So, even if the user sets
`actions.Enabled` to false, he can still select the permission of the
`Actions` unit for the team.

This PR makes the permissions of the team's `Actions` unit also
controlled by `actions.Enabled`. Just append`TypeActions` into
`DisabledRepoUnits` slice when initializing if `actions.Enabled` is
false.


### Changes:

If `Actions` is set disbaled in `app.ini`, like below:
```yaml
[actions]
ENABLED = false
```

1. If user try to create/edit a team, will prompt user that `Actions` is
disbaled.
 

![image](https://user-images.githubusercontent.com/33891828/236370415-961082b2-82d2-4d9e-8025-83872ad08cbb.png)

2. `actions` is not displayed in the sidebar on the team details page


![image](https://user-images.githubusercontent.com/33891828/236371817-f39f9bc9-5926-4b88-b5e6-d93617fcfb07.png)

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
2023-05-05 15:07:02 +02:00
Lunny Xiao
7a74957c19
Fix new wiki page mirror ()
backport 

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-05-04 16:30:47 -04:00