Skip to content

Commit 9c3cd58

Browse files
committed
Merge remote-tracking branch 'giteaoffical/main'
* giteaoffical/main: (23 commits) Add Cargo package registry (go-gitea#21888) Add new captcha: cloudflare turnstile (go-gitea#22369) add default user visibility to cli command "admin user create" (go-gitea#22750) Show all projects, not just repo projects and open/closed projects (go-gitea#22640) Remove ONLY_SHOW_RELEVANT_REPOS setting (go-gitea#21962) Escape path for the file list (go-gitea#22741) Repositories: by default disable all units except code and pulls on forks (go-gitea#22541) Fix color of tertiary button on dark theme (go-gitea#22739) Refactor git command package to improve security and maintainability (go-gitea#22678) Improve trace logging for pulls and processes (go-gitea#22633) Remove 'primary' class from tab counter labels (go-gitea#22687) Use native error checking with `exec.ErrDot` (go-gitea#22735) update to build with go1.20 (go-gitea#22732) Add missed reverse proxy authentication documentation (go-gitea#22250) Update button is shown when a Pull Request is marked WIP - Issue go-gitea#21740 (go-gitea#22683) Do not overwrite empty DefaultBranch (go-gitea#22708) Improve error report when user passes a private key (go-gitea#22726) Add some comments for recent code (go-gitea#22725) Fix actions workflow branches match bug (go-gitea#22724) Fix group filter for ldap source sync (go-gitea#22506) ...
2 parents 365b4aa + df789d9 commit 9c3cd58

File tree

137 files changed

+2988
-940
lines changed

Some content is hidden

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

137 files changed

+2988
-940
lines changed

.drone.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ steps:
2525
- make deps-frontend
2626

2727
- name: deps-backend
28-
image: golang:1.19
28+
image: golang:1.20
2929
pull: always
3030
commands:
3131
- make deps-backend
@@ -88,7 +88,7 @@ steps:
8888
depends_on: [deps-frontend]
8989

9090
- name: checks-backend
91-
image: golang:1.19
91+
image: golang:1.20
9292
commands:
9393
- make --always-make checks-backend # ensure the 'go-licenses' make target runs
9494
depends_on: [deps-backend]
@@ -109,7 +109,7 @@ steps:
109109
depends_on: [deps-frontend]
110110

111111
- name: build-backend-no-gcc
112-
image: golang:1.18 # this step is kept as the lowest version of golang that we support
112+
image: golang:1.19 # this step is kept as the lowest version of golang that we support
113113
pull: always
114114
environment:
115115
GO111MODULE: on
@@ -122,7 +122,7 @@ steps:
122122
path: /go
123123

124124
- name: build-backend-arm64
125-
image: golang:1.19
125+
image: golang:1.20
126126
environment:
127127
GO111MODULE: on
128128
GOPROXY: https://goproxy.io
@@ -138,7 +138,7 @@ steps:
138138
path: /go
139139

140140
- name: build-backend-windows
141-
image: golang:1.19
141+
image: golang:1.20
142142
environment:
143143
GO111MODULE: on
144144
GOPROXY: https://goproxy.io
@@ -153,7 +153,7 @@ steps:
153153
path: /go
154154

155155
- name: build-backend-386
156-
image: golang:1.19
156+
image: golang:1.20
157157
environment:
158158
GO111MODULE: on
159159
GOPROXY: https://goproxy.io
@@ -247,7 +247,7 @@ steps:
247247
- pull_request
248248

249249
- name: deps-backend
250-
image: golang:1.19
250+
image: golang:1.20
251251
pull: always
252252
commands:
253253
- make deps-backend
@@ -364,7 +364,7 @@ steps:
364364
path: /go
365365

366366
- name: generate-coverage
367-
image: golang:1.19
367+
image: golang:1.20
368368
commands:
369369
- make coverage
370370
environment:
@@ -440,7 +440,7 @@ steps:
440440
- pull_request
441441

442442
- name: deps-backend
443-
image: golang:1.19
443+
image: golang:1.20
444444
pull: always
445445
commands:
446446
- make deps-backend
@@ -557,7 +557,7 @@ steps:
557557
- name: test-e2e
558558
image: mcr.microsoft.com/playwright:v1.29.2-focal
559559
commands:
560-
- curl -sLO https://go.dev/dl/go1.19.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
560+
- curl -sLO https://go.dev/dl/go1.20.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
561561
- groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea
562562
- apt-get -qq update && apt-get -qqy install build-essential
563563
- export TEST_PGSQL_SCHEMA=''
@@ -656,7 +656,7 @@ trigger:
656656

657657
steps:
658658
- name: download
659-
image: golang:1.19
659+
image: golang:1.20
660660
pull: always
661661
commands:
662662
- timeout -s ABRT 40m make generate-license generate-gitignore
@@ -720,7 +720,7 @@ steps:
720720
- make deps-frontend
721721

722722
- name: deps-backend
723-
image: golang:1.19
723+
image: golang:1.20
724724
pull: always
725725
commands:
726726
- make deps-backend
@@ -729,7 +729,7 @@ steps:
729729
path: /go
730730

731731
- name: static
732-
image: techknowlogick/xgo:go-1.19.x
732+
image: techknowlogick/xgo:go-1.20.x
733733
pull: always
734734
commands:
735735
# Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
@@ -841,7 +841,7 @@ steps:
841841
- make deps-frontend
842842

843843
- name: deps-backend
844-
image: golang:1.19
844+
image: golang:1.20
845845
pull: always
846846
commands:
847847
- make deps-backend
@@ -850,7 +850,7 @@ steps:
850850
path: /go
851851

852852
- name: static
853-
image: techknowlogick/xgo:go-1.19.x
853+
image: techknowlogick/xgo:go-1.20.x
854854
pull: always
855855
commands:
856856
# Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
@@ -932,7 +932,7 @@ trigger:
932932

933933
steps:
934934
- name: build-docs
935-
image: golang:1.19
935+
image: golang:1.20
936936
commands:
937937
- cd docs
938938
- make trans-copy clean build

.golangci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ linters:
2828
fast: false
2929

3030
run:
31-
go: 1.19
31+
go: 1.20
3232
timeout: 10m
3333
skip-dirs:
3434
- node_modules
@@ -74,7 +74,7 @@ linters-settings:
7474
- name: modifies-value-receiver
7575
gofumpt:
7676
extra-rules: true
77-
lang-version: "1.19"
77+
lang-version: "1.20"
7878
depguard:
7979
list-type: denylist
8080
# Check the list against standard lib.
@@ -84,6 +84,7 @@ linters-settings:
8484
- github.com/unknwon/com: "use gitea's util and replacements"
8585
- io/ioutil: "use os or io instead"
8686
- golang.org/x/exp: "it's experimental and unreliable."
87+
- code.gitea.io/gitea/modules/git/internal: "do not use the internal package, use AddXxx function instead"
8788

8889
issues:
8990
max-issues-per-linter: 0

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.19-alpine3.17 AS build-env
2+
FROM golang:1.20-alpine3.17 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}

Dockerfile.rootless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.19-alpine3.17 AS build-env
2+
FROM golang:1.20-alpine3.17 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ SHASUM ?= shasum -a 256
2323
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
2424
COMMA := ,
2525

26-
XGO_VERSION := go-1.19.x
26+
XGO_VERSION := go-1.20.x
2727

2828
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.40.4
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.6.0
3030
ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.2
3131
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.4.0
32-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
32+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0
3333
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10
3434
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
3535
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.3

cmd/admin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,16 @@ func runCreateUser(c *cli.Context) error {
578578
restricted = util.OptionalBoolOf(c.Bool("restricted"))
579579
}
580580

581+
// default user visibility in app.ini
582+
visibility := setting.Service.DefaultUserVisibilityMode
583+
581584
u := &user_model.User{
582585
Name: username,
583586
Email: c.String("email"),
584587
Passwd: password,
585588
IsAdmin: c.Bool("admin"),
586589
MustChangePassword: changePassword,
590+
Visibility: visibility,
587591
}
588592

589593
overwriteDefault := &user_model.CreateUserOverwriteOptions{

custom/conf/app.example.ini

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ ROUTER = console
765765
;; Enable this to require captcha validation for login
766766
;REQUIRE_CAPTCHA_FOR_LOGIN = false
767767
;;
768-
;; Type of captcha you want to use. Options: image, recaptcha, hcaptcha, mcaptcha.
768+
;; Type of captcha you want to use. Options: image, recaptcha, hcaptcha, mcaptcha, cfturnstile.
769769
;CAPTCHA_TYPE = image
770770
;;
771771
;; Change this to use recaptcha.net or other recaptcha service
@@ -787,6 +787,10 @@ ROUTER = console
787787
;MCAPTCHA_SECRET =
788788
;MCAPTCHA_SITEKEY =
789789
;;
790+
;; Go to https://dash.cloudflare.com/?to=/:account/turnstile to sign up for a key
791+
;CF_TURNSTILE_SITEKEY =
792+
;CF_TURNSTILE_SECRET =
793+
;;
790794
;; Default value for KeepEmailPrivate
791795
;; Each new user will get the value of this setting copied into their profile
792796
;DEFAULT_KEEP_EMAIL_PRIVATE = false
@@ -927,14 +931,18 @@ ROUTER = console
927931
;USE_COMPAT_SSH_URI = false
928932
;;
929933
;; Close issues as long as a commit on any branch marks it as fixed
930-
;; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects
934+
;; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages
931935
;DISABLED_REPO_UNITS =
932936
;;
933-
;; Comma separated list of default repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects.
937+
;; Comma separated list of default new repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages.
934938
;; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility.
935939
;; External wiki and issue tracker can't be enabled by default as it requires additional settings.
936940
;; Disabled repo units will not be added to new repositories regardless if it is in the default list.
937-
;DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects
941+
;DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages
942+
;;
943+
;; Comma separated list of default forked repo units.
944+
;; The set of allowed values and rules are the same as DEFAULT_REPO_UNITS.
945+
;DEFAULT_FORK_REPO_UNITS = repo.code,repo.pulls
938946
;;
939947
;; Prefix archive files by placing them in a directory named after the repository
940948
;PREFIX_ARCHIVE_FILES = true
@@ -1218,10 +1226,6 @@ ROUTER = console
12181226
;;
12191227
;; Whether to enable a Service Worker to cache frontend assets
12201228
;USE_SERVICE_WORKER = false
1221-
;;
1222-
;; Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used.
1223-
;; A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic).
1224-
;ONLY_SHOW_RELEVANT_REPOS = false
12251229

12261230
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12271231
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2454,6 +2458,8 @@ ROUTER = console
24542458
;LIMIT_TOTAL_OWNER_COUNT = -1
24552459
;; Maximum size of packages a single owner can use (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
24562460
;LIMIT_TOTAL_OWNER_SIZE = -1
2461+
;; Maximum size of a Cargo upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
2462+
;LIMIT_SIZE_CARGO = -1
24572463
;; Maximum size of a Composer upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
24582464
;LIMIT_SIZE_COMPOSER = -1
24592465
;; Maximum size of a Conan upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)

docs/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ params:
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
2121
version: 1.18.1
22-
minGoVersion: 1.18
23-
goVersion: 1.19
22+
minGoVersion: 1.19
23+
goVersion: 1.20
2424
minNodeVersion: 16
2525
search: nav
2626
repo: "https://github.com/go-gitea/gitea"

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ In addition there is _`StaticRootPath`_ which can be set as a built-in at build
104104
- `ENABLE_PUSH_CREATE_USER`: **false**: Allow users to push local repositories to Gitea and have them automatically created for a user.
105105
- `ENABLE_PUSH_CREATE_ORG`: **false**: Allow users to push local repositories to Gitea and have them automatically created for an org.
106106
- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects\]
107-
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects**: Comma separated list of default repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list.
107+
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list.
108+
- `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: Comma separated list of default forked repo units. The set of allowed values and rules is the same as `DEFAULT_REPO_UNITS`.
108109
- `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository.
109110
- `DISABLE_MIGRATIONS`: **false**: Disable migrating feature.
110111
- `DISABLE_STARS`: **false**: Disable stars feature.
@@ -230,8 +231,6 @@ The following configuration set `Content-Type: application/vnd.android.package-a
230231
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
231232
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
232233
- `USE_SERVICE_WORKER`: **false**: Whether to enable a Service Worker to cache frontend assets.
233-
- `ONLY_SHOW_RELEVANT_REPOS`: **false** Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used.
234-
A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic).
235234

236235
### UI - Admin (`ui.admin`)
237236

@@ -644,7 +643,7 @@ Certain queues have defaults that override the defaults set in `[queue]` (this o
644643
- `REQUIRE_CAPTCHA_FOR_LOGIN`: **false**: Enable this to require captcha validation for login. You also must enable `ENABLE_CAPTCHA`.
645644
- `REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA`: **false**: Enable this to force captcha validation
646645
even for External Accounts (i.e. GitHub, OpenID Connect, etc). You also must enable `ENABLE_CAPTCHA`.
647-
- `CAPTCHA_TYPE`: **image**: \[image, recaptcha, hcaptcha, mcaptcha\]
646+
- `CAPTCHA_TYPE`: **image**: \[image, recaptcha, hcaptcha, mcaptcha, cfturnstile\]
648647
- `RECAPTCHA_SECRET`: **""**: Go to https://www.google.com/recaptcha/admin to get a secret for recaptcha.
649648
- `RECAPTCHA_SITEKEY`: **""**: Go to https://www.google.com/recaptcha/admin to get a sitekey for recaptcha.
650649
- `RECAPTCHA_URL`: **https://www.google.com/recaptcha/**: Set the recaptcha url - allows the use of recaptcha net.
@@ -653,6 +652,8 @@ Certain queues have defaults that override the defaults set in `[queue]` (this o
653652
- `MCAPTCHA_SECRET`: **""**: Go to your mCaptcha instance to get a secret for mCaptcha.
654653
- `MCAPTCHA_SITEKEY`: **""**: Go to your mCaptcha instance to get a sitekey for mCaptcha.
655654
- `MCAPTCHA_URL` **https://demo.mcaptcha.org/**: Set the mCaptcha URL.
655+
- `CF_TURNSTILE_SECRET` **""**: Go to https://dash.cloudflare.com/?to=/:account/turnstile to get a secret for cloudflare turnstile.
656+
- `CF_TURNSTILE_SITEKEY` **""**: Go to https://dash.cloudflare.com/?to=/:account/turnstile to get a sitekey for cloudflare turnstile.
656657
- `DEFAULT_KEEP_EMAIL_PRIVATE`: **false**: By default set users to keep their email address private.
657658
- `DEFAULT_ALLOW_CREATE_ORGANIZATION`: **true**: Allow new users to create organizations by default.
658659
- `DEFAULT_USER_IS_RESTRICTED`: **false**: Give new users restricted permissions by default
@@ -1212,6 +1213,7 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
12121213
- `CHUNKED_UPLOAD_PATH`: **tmp/package-upload**: Path for chunked uploads. Defaults to `APP_DATA_PATH` + `tmp/package-upload`
12131214
- `LIMIT_TOTAL_OWNER_COUNT`: **-1**: Maximum count of package versions a single owner can have (`-1` means no limits)
12141215
- `LIMIT_TOTAL_OWNER_SIZE`: **-1**: Maximum size of packages a single owner can use (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
1216+
- `LIMIT_SIZE_CARGO`: **-1**: Maximum size of a Cargo upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
12151217
- `LIMIT_SIZE_COMPOSER`: **-1**: Maximum size of a Composer upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
12161218
- `LIMIT_SIZE_CONAN`: **-1**: Maximum size of a Conan upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)
12171219
- `LIMIT_SIZE_CONDA`: **-1**: Maximum size of a Conda upload (`-1` means no limits, format `1000`, `1 MB`, `1 GiB`)

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@ menu:
147147
- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: 允许通过反向认证做自动注册。
148148
- `ENABLE_CAPTCHA`: **false**: 注册时使用图片验证码。
149149
- `REQUIRE_CAPTCHA_FOR_LOGIN`: **false**: 登录时需要图片验证码。需要同时开启 `ENABLE_CAPTCHA`
150+
- `CAPTCHA_TYPE`: **image**: \[image, recaptcha, hcaptcha, mcaptcha, cfturnstile\],人机验证类型,分别表示图片认证、 recaptcha 、 hcaptcha 、mcaptcha 、和 cloudlfare 的 turnstile。
151+
- `RECAPTCHA_SECRET`: **""**: recaptcha 服务的密钥,可在 https://www.google.com/recaptcha/admin 获取。
152+
- `RECAPTCHA_SITEKEY`: **""**: recaptcha 服务的网站密钥 ,可在 https://www.google.com/recaptcha/admin 获取。
153+
- `RECAPTCHA_URL`: **https://www.google.com/recaptcha/**: 设置 recaptcha 的 url 。
154+
- `HCAPTCHA_SECRET`: **""**: hcaptcha 服务的密钥,可在 https://www.hcaptcha.com/ 获取。
155+
- `HCAPTCHA_SITEKEY`: **""**: hcaptcha 服务的网站密钥,可在 https://www.hcaptcha.com/ 获取。
156+
- `MCAPTCHA_SECRET`: **""**: mCaptcha 服务的密钥。
157+
- `MCAPTCHA_SITEKEY`: **""**: mCaptcha 服务的网站密钥。
158+
- `MCAPTCHA_URL` **https://demo.mcaptcha.org/**: 设置 remCaptchacaptcha 的 url 。
159+
- `CF_TURNSTILE_SECRET` **""**: cloudlfare turnstile 服务的密钥,可在 https://dash.cloudflare.com/?to=/:account/turnstile 获取。
160+
- `CF_TURNSTILE_SITEKEY` **""**: cloudlfare turnstile 服务的网站密钥 ,可在 https://www.google.com/recaptcha/admin 获取。
150161

151162
### Service - Expore (`service.explore`)
152163

docs/content/doc/features/authentication.en-us.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,22 @@ Before activating SSPI single sign-on authentication (SSO) you have to prepare y
329329
- You have added the URL of the web app to the `Local intranet zone`
330330
- The clocks of the server and client should not differ with more than 5 minutes (depends on group policy)
331331
- `Integrated Windows Authentication` should be enabled in Internet Explorer (under `Advanced settings`)
332+
333+
## Reverse Proxy
334+
335+
Gitea supports Reverse Proxy Header authentication, it will read headers as a trusted login user name or user email address. This hasn't been enabled by default, you can enable it with
336+
337+
```ini
338+
[service]
339+
ENABLE_REVERSE_PROXY_AUTHENTICATION = true
340+
```
341+
342+
The default login user name is in the `X-WEBAUTH-USER` header, you can change it via changing `REVERSE_PROXY_AUTHENTICATION_USER` in app.ini. If the user doesn't exist, you can enable automatic registration with `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION=true`.
343+
344+
The default login user email is `X-WEBAUTH-EMAIL`, you can change it via changing `REVERSE_PROXY_AUTHENTICATION_EMAIL` in app.ini, this could also be disabled with `ENABLE_REVERSE_PROXY_EMAIL`
345+
346+
If set `ENABLE_REVERSE_PROXY_FULL_NAME=true`, a user full name expected in `X-WEBAUTH-FULLNAME` will be assigned to the user when auto creating the user. You can also change the header name with `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`.
347+
348+
You can also limit the reverse proxy's IP address range with `REVERSE_PROXY_TRUSTED_PROXIES` which default value is `127.0.0.0/8,::1/128`. By `REVERSE_PROXY_LIMIT`, you can limit trusted proxies level.
349+
350+
Notice: Reverse Proxy Auth doesn't support the API. You still need an access token or basic auth to make API requests.

0 commit comments

Comments
 (0)