Skip to content

Commit ffbb40d

Browse files
committed
* 'main' of https://github.com/go-gitea/gitea: Enable partial clone by default (go-gitea#18195) Add option to convert CRLF to LF line endings for sendmail (go-gitea#18075) Add replay of webhooks. (go-gitea#18191) Load EasyMDE/CodeMirror dynamically, remove RequireEasyMDE (go-gitea#18069) refactoring nits (go-gitea#18188) slight optimization for default avatar (go-gitea#18187) code.gitea.io/sdk/gitea v0.14.0 -> v0.15.1 (go-gitea#18186) Team permission allow different unit has different permission (go-gitea#17811) Integration test for migration (go-gitea#18124) Update `TODOs` badge to reflect new default branch (go-gitea#18182) Increase Salt randomness (go-gitea#18179)
2 parents 6cd8019 + 4b3bfd7 commit ffbb40d

File tree

100 files changed

+1946
-621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1946
-621
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<a href="https://crowdin.com/project/gitea" title="Crowdin">
3737
<img src="https://badges.crowdin.net/gitea/localized.svg">
3838
</a>
39-
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea" title="TODOs">
40-
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea">
39+
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
40+
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
4141
</a>
4242
<a href="https://www.bountysource.com/teams/gitea" title="Bountysource">
4343
<img src="https://img.shields.io/bountysource/team/gitea/activity">

README_ZH.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<a href="https://crowdin.com/project/gitea" title="Crowdin">
3737
<img src="https://badges.crowdin.net/gitea/localized.svg">
3838
</a>
39-
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea" title="TODOs">
40-
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea">
39+
<a href="https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main" title="TODOs">
40+
<img src="https://badgen.net/https/api.tickgit.com/badgen/github.com/go-gitea/gitea/main">
4141
</a>
4242
<a href="https://img.shields.io/bountysource/team/gitea" title="Bountysource">
4343
<img src="https://img.shields.io/bountysource/team/gitea/activity">

custom/conf/app.example.ini

+6-1
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,8 @@ PATH =
592592
;LARGE_OBJECT_THRESHOLD = 1048576
593593
;; Set to true to forcibly set core.protectNTFS=false
594594
;DISABLE_CORE_PROTECT_NTFS=false
595+
;; Disable the usage of using partial clones for git.
596+
;DISABLE_PARTIAL_CLONE = false
595597

596598
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
597599
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -790,7 +792,7 @@ PATH =
790792
;PREFERRED_LICENSES = Apache License 2.0,MIT License
791793
;;
792794
;; Disable the ability to interact with repositories using the HTTP protocol
793-
;;DISABLE_HTTP_GIT = false
795+
;DISABLE_HTTP_GIT = false
794796
;;
795797
;; Value for Access-Control-Allow-Origin header, default is not to present
796798
;; WARNING: This may be harmful to your website if you do not give it a right value.
@@ -1494,6 +1496,9 @@ PATH =
14941496
;;
14951497
;; Timeout for Sendmail
14961498
;SENDMAIL_TIMEOUT = 5m
1499+
;;
1500+
;; convert \r\n to \n for Sendmail
1501+
;SENDMAIL_CONVERT_CRLF = true
14971502

14981503
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14991504
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/doc/advanced/clone-filter.en-us.md

+2-29
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,9 @@ on the client is at least the same as on the server (or later). Login to
2727
Gitea server as admin and head to Site Administration -> Configuration to
2828
see Git version of the server.
2929

30-
By default, clone filters are disabled, which cause the server to ignore
31-
`--filter` option.
30+
By default, clone filters are enabled, unless `DISABLE_PARTIAL_CLONE` under
31+
`[git]` is set to `true`.
3232

33-
To enable clone filters on per-repo basis, edit the repo's `config` on
34-
repository location. Consult `ROOT` option on `repository` section of
35-
Gitea configuration (`app.ini`) for the exact location. For example, to
36-
enable clone filters for `some-repo`, edit
37-
`/var/gitea/data/gitea-repositories/some-user/some-repo.git/config` and add:
38-
39-
```ini
40-
[uploadpack]
41-
allowfilter = true
42-
```
43-
44-
To enable clone filters globally, add that config above to `~/.gitconfig`
45-
of user that run Gitea (for example `git`).
46-
47-
Alternatively, you can use `git config` to set the option.
48-
49-
To enable for a specific repo:
50-
51-
```bash
52-
cd /var/gitea/data/gitea-repositories/some-user/some-repo.git
53-
git config --local uploadpack.allowfilter true
54-
```
55-
To enable globally, login as user that run Gitea and:
56-
57-
```bash
58-
git config --global uploadpack.allowfilter true
59-
```
6033

6134
See [GitHub blog post: Get up to speed with partial clone](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/)
6235
for common use cases of clone filters (blobless and treeless clones), and

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+3
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
667667
command or full path).
668668
- `SENDMAIL_ARGS`: **_empty_**: Specify any extra sendmail arguments.
669669
- `SENDMAIL_TIMEOUT`: **5m**: default timeout for sending email through sendmail
670+
- `SENDMAIL_CONVERT_CRLF`: **true**: Most versions of sendmail prefer LF line endings rather than CRLF line endings. Set this to false if your version of sendmail requires CRLF line endings.
670671
- `SEND_BUFFER_LEN`: **100**: Buffer length of mailing queue. **DEPRECATED** use `LENGTH` in `[queue.mailer]`
671672

672673
## Cache (`cache`)
@@ -932,6 +933,8 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
932933
- `VERBOSE_PUSH_DELAY`: **5s**: Only print verbose information if push takes longer than this delay.
933934
- `LARGE_OBJECT_THRESHOLD`: **1048576**: (Go-Git only), don't cache objects greater than this in memory. (Set to 0 to disable.)
934935
- `DISABLE_CORE_PROTECT_NTFS`: **false** Set to true to forcibly set `core.protectNTFS` to false.
936+
- `DISABLE_PARTIAL_CLONE`: **false** Disable the usage of using partial clones for git.
937+
935938
## Git - Timeout settings (`git.timeout`)
936939
- `DEFAUlT`: **360**: Git operations default timeout seconds.
937940
- `MIGRATE`: **600**: Migrate external repositories timeout seconds.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
date: "2021-12-13:10:10+08:00"
3+
title: "Permissions"
4+
slug: "permissions"
5+
weight: 14
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "usage"
11+
name: "Permissions"
12+
weight: 14
13+
identifier: "permissions"
14+
---
15+
16+
# Permissions
17+
18+
**Table of Contents**
19+
20+
{{< toc >}}
21+
22+
Gitea supports permissions for repository so that you can give different access for different people. At first, we need to know about `Unit`.
23+
24+
## Unit
25+
26+
In Gitea, we call a sub module of a repository `Unit`. Now we have following units.
27+
28+
| Name | Description | Permissions |
29+
| --------------- | ---------------------------------------------------- | ----------- |
30+
| Code | Access source code, files, commits and branches. | Read Write |
31+
| Issues | Organize bug reports, tasks and milestones. | Read Write |
32+
| PullRequests | Enable pull requests and code reviews. | Read Write |
33+
| Releases | Track project versions and downloads. | Read Write |
34+
| Wiki | Write and share documentation with collaborators. | Read Write |
35+
| ExternalWiki | Link to an external wiki | Read |
36+
| ExternalTracker | Link to an external issue tracker | Read |
37+
| Projects | The URL to the template repository | Read Write |
38+
| Settings | Manage the repository | Admin |
39+
40+
With different permissions, people could do different things with these units.
41+
42+
| Name | Read | Write | Admin |
43+
| --------------- | ------------------------------------------------- | ---------------------------- | ------------------------- |
44+
| Code | View code trees, files, commits, branches and etc. | Push codes. | - |
45+
| Issues | View issues and create new issues. | Add labels, assign, close | - |
46+
| PullRequests | View pull requests and create new pull requests. | Add labels, assign, close | - |
47+
| Releases | View releases and download files. | Create/Edit releases | - |
48+
| Wiki | View wiki pages. Clone the wiki repository. | Create/Edit wiki pages, push | - |
49+
| ExternalWiki | Link to an external wiki | - | - |
50+
| ExternalTracker | Link to an external issue tracker | - | - |
51+
| Projects | View the boards | Change issues across boards | - |
52+
| Settings | - | - | Manage the repository |
53+
54+
And there are some differences for permissions between individual repositories and organization repositories.
55+
56+
## Individual Repository
57+
58+
For individual repositories, the creators are the only owners of repositories and have no limit to change anything of this
59+
repository or delete it. Repositories owners could add collaborators to help maintain the repositories. Collaborators could have `Read`, `Write` and `Admin` permissions.
60+
61+
## Organization Repository
62+
63+
Different from individual repositories, the owner of organization repositories are the owner team of this organization.
64+
65+
### Team
66+
67+
A team in an organization has unit permissions settings. It can have members and repositories scope. A team could access all the repositories in this organization or special repositories changed by the owner team. A team could also be allowed to create new
68+
repositories.
69+
70+
The owner team will be created when the organization created and the creator will become the first member of the owner team.
71+
Notice Gitea will not allow a people is a member of organization but not in any team. The owner team could not be deleted and only
72+
members of owner team could create a new team. Admin team could be created to manage some of repositories, members of admin team
73+
could do anything with these repositories. Generate team could be created by the owner team to do the permissions allowed operations.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.16
55
require (
66
cloud.google.com/go v0.78.0 // indirect
77
code.gitea.io/gitea-vet v0.2.1
8-
code.gitea.io/sdk/gitea v0.14.0
8+
code.gitea.io/sdk/gitea v0.15.1
99
gitea.com/go-chi/binding v0.0.0-20211013065440-d16dc407c2be
1010
gitea.com/go-chi/cache v0.0.0-20211013020926-78790b11abf1
1111
gitea.com/go-chi/captcha v0.0.0-20211013065431-70641c1a35d5

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
3838
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
3939
code.gitea.io/gitea-vet v0.2.1 h1:b30by7+3SkmiftK0RjuXqFvZg2q4p68uoPGuxhzBN0s=
4040
code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
41-
code.gitea.io/sdk/gitea v0.14.0 h1:m4J352I3p9+bmJUfS+g0odeQzBY/5OXP91Gv6D4fnJ0=
42-
code.gitea.io/sdk/gitea v0.14.0/go.mod h1:89WiyOX1KEcvjP66sRHdu0RafojGo60bT9UqW17VbWs=
41+
code.gitea.io/sdk/gitea v0.15.1 h1:WJreC7YYuxbn0UDaPuWIe/mtiNKTvLN8MLkaw71yx/M=
42+
code.gitea.io/sdk/gitea v0.15.1/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA=
4343
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
4444
gitea.com/go-chi/binding v0.0.0-20211013065440-d16dc407c2be h1:IzSwPVzd2hE6e67ujY8ReBCrQ5IFNd0uiBmC7Ux5IaY=
4545
gitea.com/go-chi/binding v0.0.0-20211013065440-d16dc407c2be/go.mod h1:/vR0YjlusOYvosKYW7QKcSnrY0nPLe4RQ/DGi3+i/Do=

integrations/api_repo_teams_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import (
1010
"testing"
1111

1212
repo_model "code.gitea.io/gitea/models/repo"
13+
"code.gitea.io/gitea/models/unit"
1314
"code.gitea.io/gitea/models/unittest"
1415
user_model "code.gitea.io/gitea/models/user"
1516
api "code.gitea.io/gitea/modules/structs"
17+
"code.gitea.io/gitea/modules/util"
1618

1719
"github.com/stretchr/testify/assert"
1820
)
@@ -36,7 +38,7 @@ func TestAPIRepoTeams(t *testing.T) {
3638
if assert.Len(t, teams, 2) {
3739
assert.EqualValues(t, "Owners", teams[0].Name)
3840
assert.False(t, teams[0].CanCreateOrgRepo)
39-
assert.EqualValues(t, []string{"repo.code", "repo.issues", "repo.pulls", "repo.releases", "repo.wiki", "repo.ext_wiki", "repo.ext_issues"}, teams[0].Units)
41+
assert.True(t, util.IsEqualSlice(unit.AllUnitKeyNames(), teams[0].Units), fmt.Sprintf("%v == %v", unit.AllUnitKeyNames(), teams[0].Units))
4042
assert.EqualValues(t, "owner", teams[0].Permission)
4143

4244
assert.EqualValues(t, "test_team", teams[1].Name)

0 commit comments

Comments
 (0)