Skip to content

Commit 7b2ff29

Browse files
authored
Merge branch 'master' into oauth2-auto-register
2 parents 8ee4097 + ec06eb1 commit 7b2ff29

File tree

392 files changed

+21582
-6659
lines changed

Some content is hidden

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

392 files changed

+21582
-6659
lines changed

custom/conf/app.example.ini

Lines changed: 5 additions & 1 deletion
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
@@ -628,6 +630,8 @@ REGISTER_MANUAL_CONFIRM = false
628630
; List of domain names that are allowed to be used to register on a Gitea instance
629631
; gitea.io,example.com
630632
EMAIL_DOMAIN_WHITELIST =
633+
; Comma-separated list of domain names that are not allowed to be used to register on a Gitea instance
634+
EMAIL_DOMAIN_BLOCKLIST =
631635
; Disallow registration, only allow admins to create accounts.
632636
DISABLE_REGISTRATION = false
633637
; 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

Lines changed: 4 additions & 2 deletions
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):
@@ -472,6 +473,7 @@ relation to port exhaustion.
472473
- `DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME`: **true**: Only allow users with write permissions to track time.
473474
- `EMAIL_DOMAIN_WHITELIST`: **\<empty\>**: If non-empty, list of domain names that can only be used to register
474475
on this instance.
476+
- `EMAIL_DOMAIN_BLOCKLIST`: **\<empty\>**: If non-empty, list of domain names that cannot be used to register on this instance
475477
- `SHOW_REGISTRATION_BUTTON`: **! DISABLE\_REGISTRATION**: Show Registration Button
476478
- `SHOW_MILESTONES_DASHBOARD_PAGE`: **true** Enable this to show the milestones dashboard page - a view of all the user's milestones
477479
- `AUTO_WATCH_NEW_REPOS`: **true**: Enable this to let all organisation users watch new repos when they are created
@@ -556,7 +558,7 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
556558

557559
## Session (`session`)
558560

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

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

Lines changed: 6 additions & 5 deletions
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

go.mod

Lines changed: 11 additions & 9 deletions
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)