gitea/modules/setting
wxiaoguang 0148d03f21
Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187)
Fix #880

Design:

1. A global setting `security.TWO_FACTOR_AUTH`.
* To support org-level config, we need to introduce a better "owner
setting" system first (in the future)
2. A user without 2FA can login and may explore, but can NOT read or
write to any repositories via API/web.
3. Keep things as simple as possible.
* This option only aggressively suggest users to enable their 2FA at the
moment, it does NOT guarantee that users must have 2FA before all other
operations, it should be good enough for real world use cases.
* Some details and tests could be improved in the future since this
change only adds a check and seems won't affect too much.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-04-28 15:31:59 -07:00
..
config
actions_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
actions.go Enable compression for Actions logs by default (#32013) 2024-09-09 21:34:42 +00:00
admin.go Enhance USER_DISABLED_FEATURES to allow disabling change username or full name (#31959) 2024-10-05 20:41:38 +00:00
api.go Add API endpoint to request contents of multiple files simultaniously (#34139) 2025-04-22 01:20:11 +08:00
asset_dynamic.go
asset_static.go
attachment_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
attachment.go Add avif image file support (#32508) 2024-11-15 00:55:50 +00:00
cache.go
camo.go Use camo.Always instead of camo.Allways (#32097) 2024-09-21 12:50:54 +03:00
config_env_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
config_env.go Make Gitea always use its internal config, ignore /etc/gitconfig (#33076) 2025-01-02 20:26:48 +00:00
config_provider_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
config_provider.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
config.go
cors.go Fix settings not being loaded at CLI (#26402) 2024-12-30 05:54:20 +00:00
cron_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
cron.go
database_sqlite.go
database_test.go
database.go
federation.go Remove SHA1 for support for ssh rsa signing (#31857) 2024-09-07 18:05:18 -04:00
git_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
git.go
gloabl_lock.go Use global lock instead of NewExclusivePool to allow distributed lock between multiple Gitea instances (#31813) 2024-09-06 10:12:41 +00:00
glob.go
global_lock_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
global.go
highlight.go
i18n.go Update i18n.go - Language Picker (#32933) 2024-12-21 04:56:08 +00:00
incoming_email.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
indexer_test.go
indexer.go Fix bleve fuzziness search (#33078) 2025-01-03 00:32:02 +08:00
lfs_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
lfs.go Use 8 as default value for git lfs concurrency (#32421) 2024-11-05 13:10:57 +00:00
log_test.go
log.go Use filepath.Join instead of path.Join for file system file operations (#33978) 2025-03-24 14:50:28 -07:00
mailer_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
mailer.go Email option to embed images as base64 instead of link (#32061) 2025-03-05 16:29:29 +00:00
markup_test.go Fix markdown render behaviors (#34122) 2025-04-05 11:56:48 +08:00
markup.go Set MERMAID_MAX_SOURCE_CHARACTERS to 50000 (#34152) 2025-04-09 07:52:01 +00:00
metrics.go
migrations.go
mime_type_map.go
mirror.go
oauth2_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
oauth2.go
other.go
packages_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
packages.go Fix package upload temp path (#34196) 2025-04-14 18:55:02 +08:00
path_test.go
path.go Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
picture.go
project.go
proxy.go
queue.go
repository_archive_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
repository_archive.go
repository.go Option to delay conflict checking of old pull requests until page view (#27779) 2025-04-24 19:26:57 +00:00
security.go Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
server.go Make public URL generation configurable (#34250) 2025-04-22 06:49:37 +08:00
service_test.go Add a config option to block "expensive" pages for anonymous users (#34024) 2025-03-30 05:26:19 +00:00
service.go Add middleware for request prioritization (#33951) 2025-04-14 16:25:48 +02:00
session.go Fix settings not being loaded at CLI (#26402) 2024-12-30 05:54:20 +00:00
setting_test.go
setting.go Move ParseBool to optional (#33979) 2025-03-24 03:53:30 +00:00
ssh.go Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
storage_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
storage.go enable staticcheck QFxxxx rules (#34064) 2025-03-29 17:32:28 -04:00
task.go
time.go Fix settings not being loaded at CLI (#26402) 2024-12-30 05:54:20 +00:00
ui.go Add material icons for file list (#33837) 2025-03-10 15:57:17 +08:00
webhook.go