Skip to content

Commit 6572f6f

Browse files
authored
Merge branch 'master' into feature-image-diff
2 parents 95f80a4 + b56c19d commit 6572f6f

File tree

447 files changed

+22174
-6772
lines changed

Some content is hidden

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

447 files changed

+22174
-6772
lines changed

.github/issue_template.md

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini -->
3131

3232
## Description
33+
<!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please
34+
disable the proxy/CDN fully and connect to gitea directly to confirm
35+
the issue still persists without those services. -->
3336

3437
...
3538

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ release-windows: | $(DIST_DIRS)
573573
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
574574
GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
575575
fi
576-
@echo "Warning: windows version is built using golang 1.14"
577576
CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -buildmode exe -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
578577
ifeq ($(CI),drone)
579578
cp /build/* $(DIST)/binaries
@@ -709,7 +708,7 @@ pr\#%: clean-all
709708
golangci-lint:
710709
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
711710
export BINARY="golangci-lint"; \
712-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.35.2; \
711+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.37.0; \
713712
fi
714713
golangci-lint run --timeout 10m
715714

custom/conf/app.example.ini

+5-1
Original file line numberDiff line numberDiff line change
@@ -556,14 +556,16 @@ IMPORT_LOCAL_PATHS = false
556556
; It also enables them to access other resources available to the user on the operating system that is running the Gitea instance and perform arbitrary actions in the name of the Gitea OS user.
557557
; WARNING: This maybe harmful to you website or your operating system.
558558
DISABLE_GIT_HOOKS = true
559+
; Set to true to disable webhooks feature.
560+
DISABLE_WEBHOOKS = false
559561
; Set to false to allow pushes to gitea repositories despite having an incomplete environment - NOT RECOMMENDED
560562
ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET = true
561563
;Comma separated list of character classes required to pass minimum complexity.
562564
;If left empty or no valid values are specified, the default is off (no checking)
563565
;Classes include "lower,upper,digit,spec"
564566
PASSWORD_COMPLEXITY = off
565567
; Password Hash algorithm, either "argon2", "pbkdf2", "scrypt" or "bcrypt"
566-
PASSWORD_HASH_ALGO = argon2
568+
PASSWORD_HASH_ALGO = pbkdf2
567569
; Set false to allow JavaScript to read CSRF cookie
568570
CSRF_COOKIE_HTTP_ONLY = true
569571
; Validate against https://haveibeenpwned.com/Passwords to see if a password has been exposed
@@ -615,6 +617,8 @@ REGISTER_MANUAL_CONFIRM = false
615617
; List of domain names that are allowed to be used to register on a Gitea instance
616618
; gitea.io,example.com
617619
EMAIL_DOMAIN_WHITELIST =
620+
; Comma-separated list of domain names that are not allowed to be used to register on a Gitea instance
621+
EMAIL_DOMAIN_BLOCKLIST =
618622
; Disallow registration, only allow admins to create accounts.
619623
DISABLE_REGISTRATION = false
620624
; Allow registration only using third-party services, it works only when DISABLE_REGISTRATION is false

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,12 @@ relation to port exhaustion.
396396
It also enables them to access other resources available to the user on the operating system that is running the
397397
Gitea instance and perform arbitrary actions in the name of the Gitea OS user.
398398
This maybe harmful to you website or your operating system.
399+
- `DISABLE_WEBHOOKS`: **false**: Set to `true` to disable webhooks feature.
399400
- `ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET`: **true**: Set to `false` to allow local users to push to gitea-repositories without setting up the Gitea environment. This is not recommended and if you want local users to push to gitea repositories you should set the environment appropriately.
400401
- `IMPORT_LOCAL_PATHS`: **false**: Set to `false` to prevent all users (including admin) from importing local path on server.
401402
- `INTERNAL_TOKEN`: **\<random at every install if no uri set\>**: Secret used to validate communication within Gitea binary.
402403
- `INTERNAL_TOKEN_URI`: **<empty>**: Instead of defining internal token in the configuration, this configuration option can be used to give Gitea a path to a file that contains the internal token (example value: `file:/etc/gitea/internal_token`)
403-
- `PASSWORD_HASH_ALGO`: **argon2**: The hash algorithm to use \[argon2, pbkdf2, scrypt, bcrypt\].
404+
- `PASSWORD_HASH_ALGO`: **pbkdf2**: The hash algorithm to use \[argon2, pbkdf2, scrypt, bcrypt\], argon2 will spend more memory than others.
404405
- `CSRF_COOKIE_HTTP_ONLY`: **true**: Set false to allow JavaScript to read CSRF cookie.
405406
- `MIN_PASSWORD_LENGTH`: **6**: Minimum password length for new users.
406407
- `PASSWORD_COMPLEXITY`: **off**: Comma separated list of character classes required to pass minimum complexity. If left empty or no valid values are specified, checking is disabled (off):
@@ -465,6 +466,7 @@ relation to port exhaustion.
465466
- `DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME`: **true**: Only allow users with write permissions to track time.
466467
- `EMAIL_DOMAIN_WHITELIST`: **\<empty\>**: If non-empty, list of domain names that can only be used to register
467468
on this instance.
469+
- `EMAIL_DOMAIN_BLOCKLIST`: **\<empty\>**: If non-empty, list of domain names that cannot be used to register on this instance
468470
- `SHOW_REGISTRATION_BUTTON`: **! DISABLE\_REGISTRATION**: Show Registration Button
469471
- `SHOW_MILESTONES_DASHBOARD_PAGE`: **true** Enable this to show the milestones dashboard page - a view of all the user's milestones
470472
- `AUTO_WATCH_NEW_REPOS`: **true**: Enable this to let all organisation users watch new repos when they are created
@@ -549,7 +551,7 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
549551

550552
## Session (`session`)
551553

552-
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, mysql, couchbase, memcache, postgres\].
554+
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, db, mysql, couchbase, memcache, postgres\].
553555
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for others, the connection string.
554556
- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
555557
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@ For more information, refer to Gitea's [API docs]({{< relref "doc/developers/api
120120

121121
There are multiple things you can combine to prevent spammers.
122122

123-
1. By only whitelisting certain domains with OpenID (see below)
124-
2. Setting `ENABLE_CAPTCHA` to `true` in your `app.ini` and properly configuring `RECAPTCHA_SECRET` and `RECAPTCHA_SITEKEY`
125-
3. Settings `DISABLE_REGISTRATION` to `true` and creating new users via the [CLI]({{< relref "doc/usage/command-line.en-us.md" >}}), [API]({{< relref "doc/developers/api-usage.en-us.md" >}}), or Gitea's Admin UI
123+
1. By whitelisting or blocklisting certain email domains
124+
2. By only whitelisting certain domains with OpenID (see below)
125+
3. Setting `ENABLE_CAPTCHA` to `true` in your `app.ini` and properly configuring `RECAPTCHA_SECRET` and `RECAPTCHA_SITEKEY`
126+
4. Settings `DISABLE_REGISTRATION` to `true` and creating new users via the [CLI]({{< relref "doc/usage/command-line.en-us.md" >}}), [API]({{< relref "doc/developers/api-usage.en-us.md" >}}), or Gitea's Admin UI
126127

127-
### Only allow certain email domains
128+
### Only allow/block certain email domains
128129

129-
You can configure `EMAIL_DOMAIN_WHITELIST` in your app.ini under `[service]`
130+
You can configure `EMAIL_DOMAIN_WHITELIST` or `EMAIL_DOMAIN_BLOCKLIST` in your app.ini under `[service]`
130131

131132
### Only allow/block certain OpenID providers
132133

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in
232232
directory and will overwrite any existing files.
233233

234234
- Options:
235-
- `--host value`: Comma seperated hostnames and ips which this certificate is valid for.
235+
- `--host value`: Comma separated hostnames and ips which this certificate is valid for.
236236
Wildcards are supported. Required.
237237
- `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options
238238
are P224, P256, P384, P521.

go.mod

+11-9
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ require (
3535
github.com/go-git/go-billy/v5 v5.0.0
3636
github.com/go-git/go-git/v5 v5.2.0
3737
github.com/go-ldap/ldap/v3 v3.2.4
38-
github.com/go-redis/redis/v7 v7.4.0
38+
github.com/go-redis/redis/v8 v8.5.0
3939
github.com/go-sql-driver/mysql v1.5.0
4040
github.com/go-swagger/go-swagger v0.26.0
4141
github.com/go-testfixtures/testfixtures/v3 v3.4.1
@@ -46,6 +46,8 @@ require (
4646
github.com/google/go-github/v32 v32.1.0
4747
github.com/google/uuid v1.2.0
4848
github.com/gorilla/context v1.1.1
49+
github.com/gorilla/sessions v1.2.1 // indirect
50+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
4951
github.com/hashicorp/go-retryablehttp v0.6.8 // indirect
5052
github.com/hashicorp/go-version v1.2.1
5153
github.com/huandu/xstrings v1.3.2
@@ -57,7 +59,7 @@ require (
5759
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
5860
github.com/klauspost/compress v1.11.7
5961
github.com/klauspost/pgzip v1.2.5 // indirect
60-
github.com/lafriks/xormstore v1.3.2
62+
github.com/lafriks/xormstore v1.4.0
6163
github.com/lib/pq v1.9.0
6264
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
6365
github.com/markbates/goth v1.66.1
@@ -69,7 +71,7 @@ require (
6971
github.com/mholt/archiver/v3 v3.5.0
7072
github.com/microcosm-cc/bluemonday v1.0.4
7173
github.com/minio/md5-simd v1.1.1 // indirect
72-
github.com/minio/minio-go/v7 v7.0.7
74+
github.com/minio/minio-go/v7 v7.0.9
7375
github.com/mitchellh/go-homedir v1.1.0
7476
github.com/msteinert/pam v0.0.0-20200810204841-913b8f8cdf8b
7577
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
@@ -80,7 +82,7 @@ require (
8082
github.com/pierrec/lz4/v4 v4.1.1 // indirect
8183
github.com/pkg/errors v0.9.1
8284
github.com/pquerna/otp v1.3.0
83-
github.com/prometheus/client_golang v1.8.0
85+
github.com/prometheus/client_golang v1.9.0
8486
github.com/quasoft/websspi v1.0.0
8587
github.com/rivo/uniseg v0.2.0 // indirect
8688
github.com/sergi/go-diff v1.1.0
@@ -98,16 +100,16 @@ require (
98100
github.com/unrolled/render v1.0.3
99101
github.com/urfave/cli v1.22.5
100102
github.com/willf/bitset v1.1.11 // indirect
101-
github.com/xanzy/go-gitlab v0.42.0
103+
github.com/xanzy/go-gitlab v0.44.0
102104
github.com/yohcop/openid-go v1.0.0
103-
github.com/yuin/goldmark v1.3.1
105+
github.com/yuin/goldmark v1.3.2
104106
github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691
105107
github.com/yuin/goldmark-meta v1.0.0
106108
go.jolheiser.com/hcaptcha v0.0.4
107109
go.jolheiser.com/pwn v0.0.3
108110
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
109111
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
110-
golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013
112+
golang.org/x/oauth2 v0.0.0-20210210192628-66670185b0cd
111113
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
112114
golang.org/x/text v0.3.5
113115
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect
@@ -118,8 +120,8 @@ require (
118120
gopkg.in/yaml.v2 v2.4.0
119121
mvdan.cc/xurls/v2 v2.2.0
120122
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
121-
xorm.io/builder v0.3.7
122-
xorm.io/xorm v1.0.6
123+
xorm.io/builder v0.3.9
124+
xorm.io/xorm v1.0.7
123125
)
124126

125127
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.2.4

0 commit comments

Comments
 (0)