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