Skip to content

Commit ba7d8ee

Browse files
committed
Merge branch 'main' into blender-scoped-labels
2 parents 6978e0b + 9057a00 commit ba7d8ee

File tree

184 files changed

+3235
-1197
lines changed

Some content is hidden

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

184 files changed

+3235
-1197
lines changed

.drone.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -763,10 +763,16 @@ steps:
763763
image: woodpeckerci/plugin-s3:latest
764764
pull: always
765765
settings:
766-
acl: public-read
767-
bucket: gitea-artifacts
768-
endpoint: https://ams3.digitaloceanspaces.com
769-
path_style: true
766+
acl:
767+
from_secret: aws_s3_acl
768+
region:
769+
from_secret: aws_s3_region
770+
bucket:
771+
from_secret: aws_s3_bucket
772+
endpoint:
773+
from_secret: aws_s3_endpoint
774+
path_style:
775+
from_secret: aws_s3_path_style
770776
source: "dist/release/*"
771777
strip_prefix: dist/release/
772778
target: "/gitea/${DRONE_BRANCH##release/v}"
@@ -784,10 +790,16 @@ steps:
784790
- name: release-main
785791
image: woodpeckerci/plugin-s3:latest
786792
settings:
787-
acl: public-read
788-
bucket: gitea-artifacts
789-
endpoint: https://ams3.digitaloceanspaces.com
790-
path_style: true
793+
acl:
794+
from_secret: aws_s3_acl
795+
region:
796+
from_secret: aws_s3_region
797+
bucket:
798+
from_secret: aws_s3_bucket
799+
endpoint:
800+
from_secret: aws_s3_endpoint
801+
path_style:
802+
from_secret: aws_s3_path_style
791803
source: "dist/release/*"
792804
strip_prefix: dist/release/
793805
target: /gitea/main
@@ -886,10 +898,16 @@ steps:
886898
image: woodpeckerci/plugin-s3:latest
887899
pull: always
888900
settings:
889-
acl: public-read
890-
bucket: gitea-artifacts
891-
endpoint: https://ams3.digitaloceanspaces.com
892-
path_style: true
901+
acl:
902+
from_secret: aws_s3_acl
903+
region:
904+
from_secret: aws_s3_region
905+
bucket:
906+
from_secret: aws_s3_bucket
907+
endpoint:
908+
from_secret: aws_s3_endpoint
909+
path_style:
910+
from_secret: aws_s3_path_style
893911
source: "dist/release/*"
894912
strip_prefix: dist/release/
895913
target: "/gitea/${DRONE_TAG##v}"

assets/go-licenses.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/admin.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ var (
308308
Value: "false",
309309
Usage: "Use custom URLs for GitLab/GitHub OAuth endpoints",
310310
},
311+
cli.StringFlag{
312+
Name: "custom-tenant-id",
313+
Value: "",
314+
Usage: "Use custom Tenant ID for OAuth endpoints",
315+
},
311316
cli.StringFlag{
312317
Name: "custom-auth-url",
313318
Value: "",
@@ -367,6 +372,15 @@ var (
367372
Value: "",
368373
Usage: "Group Claim value for restricted users",
369374
},
375+
cli.StringFlag{
376+
Name: "group-team-map",
377+
Value: "",
378+
Usage: "JSON mapping between groups and org teams",
379+
},
380+
cli.BoolFlag{
381+
Name: "group-team-map-removal",
382+
Usage: "Activate automatic team membership removal depending on groups",
383+
},
370384
}
371385

372386
microcmdAuthUpdateOauth = cli.Command{
@@ -829,6 +843,7 @@ func parseOAuth2Config(c *cli.Context) *oauth2.Source {
829843
AuthURL: c.String("custom-auth-url"),
830844
ProfileURL: c.String("custom-profile-url"),
831845
EmailURL: c.String("custom-email-url"),
846+
Tenant: c.String("custom-tenant-id"),
832847
}
833848
} else {
834849
customURLMapping = nil
@@ -847,6 +862,8 @@ func parseOAuth2Config(c *cli.Context) *oauth2.Source {
847862
GroupClaimName: c.String("group-claim-name"),
848863
AdminGroup: c.String("admin-group"),
849864
RestrictedGroup: c.String("restricted-group"),
865+
GroupTeamMap: c.String("group-team-map"),
866+
GroupTeamMapRemoval: c.Bool("group-team-map-removal"),
850867
}
851868
}
852869

@@ -929,6 +946,12 @@ func runUpdateOauth(c *cli.Context) error {
929946
if c.IsSet("restricted-group") {
930947
oAuth2Config.RestrictedGroup = c.String("restricted-group")
931948
}
949+
if c.IsSet("group-team-map") {
950+
oAuth2Config.GroupTeamMap = c.String("group-team-map")
951+
}
952+
if c.IsSet("group-team-map-removal") {
953+
oAuth2Config.GroupTeamMapRemoval = c.Bool("group-team-map-removal")
954+
}
932955

933956
// update custom URL mapping
934957
customURLMapping := &oauth2.CustomURLMapping{}
@@ -938,6 +961,7 @@ func runUpdateOauth(c *cli.Context) error {
938961
customURLMapping.AuthURL = oAuth2Config.CustomURLMapping.AuthURL
939962
customURLMapping.ProfileURL = oAuth2Config.CustomURLMapping.ProfileURL
940963
customURLMapping.EmailURL = oAuth2Config.CustomURLMapping.EmailURL
964+
customURLMapping.Tenant = oAuth2Config.CustomURLMapping.Tenant
941965
}
942966
if c.IsSet("use-custom-urls") && c.IsSet("custom-token-url") {
943967
customURLMapping.TokenURL = c.String("custom-token-url")
@@ -955,6 +979,10 @@ func runUpdateOauth(c *cli.Context) error {
955979
customURLMapping.EmailURL = c.String("custom-email-url")
956980
}
957981

982+
if c.IsSet("use-custom-urls") && c.IsSet("custom-tenant-id") {
983+
customURLMapping.Tenant = c.String("custom-tenant-id")
984+
}
985+
958986
oAuth2Config.CustomURLMapping = customURLMapping
959987
source.Cfg = oAuth2Config
960988

custom/conf/app.example.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,6 +2460,8 @@ ROUTER = console
24602460
;LIMIT_TOTAL_OWNER_SIZE = -1
24612461
;; Maximum size of a Cargo upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
24622462
;LIMIT_SIZE_CARGO = -1
2463+
;; Maximum size of a Chef upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2464+
;LIMIT_SIZE_CHEF = -1
24632465
;; Maximum size of a Composer upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
24642466
;LIMIT_SIZE_COMPOSER = -1
24652467
;; Maximum size of a Conan upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
12141214
- `LIMIT_TOTAL_OWNER_COUNT`: **-1**: Maximum count of package versions a single owner can have (`-1` means no limits)
12151215
- `LIMIT_TOTAL_OWNER_SIZE`: **-1**: Maximum size of packages a single owner can use (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
12161216
- `LIMIT_SIZE_CARGO`: **-1**: Maximum size of a Cargo upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
1217+
- `LIMIT_SIZE_CHEF`: **-1**: Maximum size of a Chef upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
12171218
- `LIMIT_SIZE_COMPOSER`: **-1**: Maximum size of a Composer upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
12181219
- `LIMIT_SIZE_CONAN`: **-1**: Maximum size of a Conan upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
12191220
- `LIMIT_SIZE_CONDA`: **-1**: Maximum size of a Conda upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)

docs/content/doc/help/faq.en-us.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,3 +449,14 @@ It is highly recommended to back-up your database before running these commands.
449449
If you are using Cloudflare, turn off the auto-minify option in the dashboard.
450450

451451
`Speed` -> `Optimization` -> Uncheck `HTML` within the `Auto-Minify` settings.
452+
453+
## How to adopt repositories from disk
454+
455+
- Add your (bare) repositories to the correct spot for your configuration (`repository.ROOT`), ensuring they are in the correct layout `<REPO_ROOT>/[user]/[repo].git`.
456+
- **Note:** the directory names must be lowercase.
457+
- You can also check `<ROOT_URL>/admin/config` for the repository root path.
458+
- Ensure that the user/org exists that you want to adopt repositories for.
459+
- As an admin, go to `<ROOT_URL>/admin/repos/unadopted` and search.
460+
- Users can also be given similar permissions via config [`ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#repository" >}}).
461+
- If the above steps are done correctly, you should be able to select repositories to adopt.
462+
- If no repositories are found, enable [debug logging]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#repository" >}}) to check for any specific errors.

docs/content/doc/installation/with-docker-rootless.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Gitea provides automatically updated Docker images within its Docker Hub organiz
1919
possible to always use the latest stable tag or to use another service that handles updating
2020
Docker images.
2121

22-
The rootless image use Gitea internal SSH to provide Git protocol and doesn't support OpenSSH.
22+
The rootless image uses Gitea internal SSH to provide Git protocol and doesn't support OpenSSH.
2323

2424
This reference setup guides users through the setup based on `docker-compose`, but the installation
2525
of `docker-compose` is out of scope of this documentation. To install `docker-compose` itself, follow
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
date: "2023-01-20T00:00:00+00:00"
3+
title: "Chef Packages Repository"
4+
slug: "packages/chef"
5+
draft: false
6+
toc: false
7+
menu:
8+
sidebar:
9+
parent: "packages"
10+
name: "Chef"
11+
weight: 5
12+
identifier: "chef"
13+
---
14+
15+
# Chef Packages Repository
16+
17+
Publish [Chef](https://chef.io/) cookbooks for your user or organization.
18+
19+
**Table of Contents**
20+
21+
{{< toc >}}
22+
23+
## Requirements
24+
25+
To work with the Chef package registry, you have to use [`knife`](https://docs.chef.io/workstation/knife/).
26+
27+
## Authentication
28+
29+
The Chef package registry does not use an username:password authentication but signed requests with a private:public key pair.
30+
Visit the package owner settings page to create the necessary key pair.
31+
Only the public key is stored inside Gitea. if you loose access to the private key you must re-generate the key pair.
32+
[Configure `knife`](https://docs.chef.io/workstation/knife_setup/) to use the downloaded private key with your Gitea username as `client_name`.
33+
34+
## Configure the package registry
35+
36+
To [configure `knife`](https://docs.chef.io/workstation/knife_setup/) to use the Gitea package registry add the url to the `~/.chef/config.rb` file.
37+
38+
```
39+
knife[:supermarket_site] = 'https://gitea.example.com/api/packages/{owner}/chef'
40+
```
41+
42+
| Parameter | Description |
43+
| --------- | ----------- |
44+
| `owner` | The owner of the package. |
45+
46+
## Publish a package
47+
48+
To publish a Chef package execute the following command:
49+
50+
```shell
51+
knife supermarket share {package_name}
52+
```
53+
54+
| Parameter | Description |
55+
| -------------- | ----------- |
56+
| `package_name` | The package name. |
57+
58+
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
59+
60+
## Install a package
61+
62+
To install a package from the package registry, execute the following command:
63+
64+
```shell
65+
knife supermarket install {package_name}
66+
```
67+
68+
Optional you can specify the package version:
69+
70+
```shell
71+
knife supermarket install {package_name} {package_version}
72+
```
73+
74+
| Parameter | Description |
75+
| ----------------- | ----------- |
76+
| `package_name` | The package name. |
77+
| `package_version` | The package version. |
78+
79+
## Delete a package
80+
81+
If you want to remove a package from the registry, execute the following command:
82+
83+
```shell
84+
knife supermarket unshare {package_name}
85+
```
86+
87+
Optional you can specify the package version:
88+
89+
```shell
90+
knife supermarket unshare {package_name}/versions/{package_version}
91+
```
92+
93+
| Parameter | Description |
94+
| ----------------- | ----------- |
95+
| `package_name` | The package name. |
96+
| `package_version` | The package version. |

docs/content/doc/packages/overview.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The following package managers are currently supported:
2727
| Name | Language | Package client |
2828
| ---- | -------- | -------------- |
2929
| [Cargo]({{< relref "doc/packages/cargo.en-us.md" >}}) | Rust | `cargo` |
30+
| [Chef]({{< relref "doc/packages/chef.en-us.md" >}}) | - | `knife` |
3031
| [Composer]({{< relref "doc/packages/composer.en-us.md" >}}) | PHP | `composer` |
3132
| [Conan]({{< relref "doc/packages/conan.en-us.md" >}}) | C++ | `conan` |
3233
| [Conda]({{< relref "doc/packages/conda.en-us.md" >}}) | - | `conda` |

docs/content/doc/upgrade/from-gogs.en-us.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ Then repeat the procedure, but this time using the [latest release](https://dl.g
8585

8686
## Upgrading from a more recent version of Gogs
8787

88-
Upgrading from a more recent version of Gogs is also possible, but requires a bit more work.
89-
See [#4286](https://github.com/go-gitea/gitea/issues/4286).
88+
Upgrading from a more recent version of Gogs (up to `0.11.x`) may also be possible, but will require a bit more work.
89+
See [#4286](https://github.com/go-gitea/gitea/issues/4286), which includes various Gogs `0.11.x` versions.
90+
91+
Upgrading from Gogs `0.12.x` and above will be increasingly more difficult as the projects diverge further apart in configuration and schema.
9092

9193
## Troubleshooting
9294

docs/content/doc/usage/command-line.en-us.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Admin operations:
124124
- `--secret`: Client Secret.
125125
- `--auto-discover-url`: OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider).
126126
- `--use-custom-urls`: Use custom URLs for GitLab/GitHub OAuth endpoints.
127+
- `--custom-tenant-id`: Use custom Tenant ID for OAuth endpoints.
127128
- `--custom-auth-url`: Use a custom Authorization URL (option for GitLab/GitHub).
128129
- `--custom-token-url`: Use a custom Token URL (option for GitLab/GitHub).
129130
- `--custom-profile-url`: Use a custom Profile URL (option for GitLab/GitHub).
@@ -136,6 +137,8 @@ Admin operations:
136137
- `--group-claim-name`: Claim name providing group names for this source. (Optional)
137138
- `--admin-group`: Group Claim value for administrator users. (Optional)
138139
- `--restricted-group`: Group Claim value for restricted users. (Optional)
140+
- `--group-team-map`: JSON mapping between groups and org teams. (Optional)
141+
- `--group-team-map-removal`: Activate automatic team membership removal depending on groups. (Optional)
139142
- Examples:
140143
- `gitea admin auth add-oauth --name external-github --provider github --key OBTAIN_FROM_SOURCE --secret OBTAIN_FROM_SOURCE`
141144
- `update-oauth`:
@@ -147,6 +150,7 @@ Admin operations:
147150
- `--secret`: Client Secret.
148151
- `--auto-discover-url`: OpenID Connect Auto Discovery URL (only required when using OpenID Connect as provider).
149152
- `--use-custom-urls`: Use custom URLs for GitLab/GitHub OAuth endpoints.
153+
- `--custom-tenant-id`: Use custom Tenant ID for OAuth endpoints.
150154
- `--custom-auth-url`: Use a custom Authorization URL (option for GitLab/GitHub).
151155
- `--custom-token-url`: Use a custom Token URL (option for GitLab/GitHub).
152156
- `--custom-profile-url`: Use a custom Profile URL (option for GitLab/GitHub).

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ require (
8282
github.com/niklasfasching/go-org v1.6.5
8383
github.com/oliamb/cutter v0.2.2
8484
github.com/olivere/elastic/v7 v7.0.32
85+
github.com/opencontainers/go-digest v1.0.0
86+
github.com/opencontainers/image-spec v1.1.0-rc2
8587
github.com/pkg/errors v0.9.1
8688
github.com/pquerna/otp v1.4.0
8789
github.com/prometheus/client_golang v1.14.0

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,10 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
10091009
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
10101010
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
10111011
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
1012+
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
1013+
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
1014+
github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034=
1015+
github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ=
10121016
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis=
10131017
github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74=
10141018
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=

0 commit comments

Comments
 (0)