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.go
actions_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
admin.go
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.go
attachment_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
cache.go
camo.go
config.go
config_env.go
config_env_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_provider_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
cors.go
cron.go
cron_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
database.go
database_sqlite.go
database_test.go
federation.go
git.go
git_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
gloabl_lock.go
glob.go
global.go
global_lock_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
highlight.go
i18n.go
incoming_email.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
indexer.go
indexer_test.go
lfs.go
lfs_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
log.go Use filepath.Join instead of path.Join for file system file operations (#33978) 2025-03-24 14:50:28 -07:00
log_test.go
mailer.go
mailer_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
markup.go Set MERMAID_MAX_SOURCE_CHARACTERS to 50000 (#34152) 2025-04-09 07:52:01 +00:00
markup_test.go Fix markdown render behaviors (#34122) 2025-04-05 11:56:48 +08:00
metrics.go
migrations.go
mime_type_map.go
mirror.go
oauth2.go
oauth2_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
other.go
packages.go Fix package upload temp path (#34196) 2025-04-14 18:55:02 +08:00
packages_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
path.go Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
path_test.go
picture.go
project.go
proxy.go
queue.go
repository.go Option to delay conflict checking of old pull requests until page view (#27779) 2025-04-24 19:26:57 +00:00
repository_archive.go
repository_archive_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04: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.go Add middleware for request prioritization (#33951) 2025-04-14 16:25:48 +02:00
service_test.go Add a config option to block "expensive" pages for anonymous users (#34024) 2025-03-30 05:26:19 +00:00
session.go
setting.go Move ParseBool to optional (#33979) 2025-03-24 03:53:30 +00:00
setting_test.go
ssh.go Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
storage.go enable staticcheck QFxxxx rules (#34064) 2025-03-29 17:32:28 -04:00
storage_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
task.go
time.go
ui.go Add material icons for file list (#33837) 2025-03-10 15:57:17 +08:00
webhook.go