You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin.go 816B

1234567891011121314151617181920212223242526
  1. // Copyright 2023 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package setting
  4. import "code.gitea.io/gitea/modules/container"
  5. // Admin settings
  6. var Admin struct {
  7. DisableRegularOrgCreation bool
  8. DefaultEmailNotification string
  9. UserDisabledFeatures container.Set[string]
  10. }
  11. func loadAdminFrom(rootCfg ConfigProvider) {
  12. sec := rootCfg.Section("admin")
  13. Admin.DisableRegularOrgCreation = sec.Key("DISABLE_REGULAR_ORG_CREATION").MustBool(false)
  14. Admin.DefaultEmailNotification = sec.Key("DEFAULT_EMAIL_NOTIFICATIONS").MustString("enabled")
  15. Admin.UserDisabledFeatures = container.SetOf(sec.Key("USER_DISABLED_FEATURES").Strings(",")...)
  16. }
  17. const (
  18. UserFeatureDeletion = "deletion"
  19. UserFeatureManageSSHKeys = "manage_ssh_keys"
  20. UserFeatureManageGPGKeys = "manage_gpg_keys"
  21. )