Documentation ¶
Overview ¶
Package conf 定义配置选项
Index ¶
- Variables
- func AuditArchiveCron() string
- func AuditCleanCron() string
- func AuditTemplate() apistructs.AuditTemplateMap
- func AvatarStorageURL() string
- func CreateOrgEnabled() bool
- func Debug() bool
- func EnableNS() bool
- func GittarOutterURL() string
- func LegacyUIDomain() string
- func LicenseKey() string
- func Load()
- func LoadForTest()
- func LocalMode() bool
- func MySQLDatabase() string
- func MySQLHost() string
- func MySQLLoc() string
- func MySQLPassword() string
- func MySQLPort() string
- func MySQLUsername() string
- func OpenAPIDomain() string
- func OrgAuditDefaultRetentionDays() uint64
- func OrgAuditMaxRetentionDays() uint64
- func OryCompatibleClientID() string
- func OryCompatibleClientSecret() string
- func OryEnabled() bool
- func OryKratosPrivateAddr() string
- func Permissions() map[string]model.RolePermission
- func ProjectStatsCacheCron() string
- func RedisAddr() string
- func RedisMasterName() string
- func RedisPwd() string
- func RedisSentinelAddrs() string
- func RolePermissions(roles []string) (map[string]model.RolePermission, []model.RolePermission)
- func RootDomain() string
- func RootDomainList() []string
- func SubscribeLimitNum() uint64
- func SysAuditCleanInterval() int
- func UCClientID() string
- func UCClientSecret() string
- func UIDomain() string
- func UIPublicURL() string
- type Conf
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 域名白名单 OrgWhiteList map[string]bool // legacy redirect paths RedirectPathList map[string]bool )
Functions ¶
func CreateOrgEnabled ¶
func CreateOrgEnabled() bool
func OrgAuditDefaultRetentionDays ¶
func OrgAuditDefaultRetentionDays() uint64
func OrgAuditMaxRetentionDays ¶
func OrgAuditMaxRetentionDays() uint64
func OryCompatibleClientID ¶
func OryCompatibleClientID() string
func OryCompatibleClientSecret ¶
func OryCompatibleClientSecret() string
func OryEnabled ¶
func OryEnabled() bool
func OryKratosPrivateAddr ¶
func OryKratosPrivateAddr() string
func RolePermissions ¶
func RolePermissions(roles []string) (map[string]model.RolePermission, []model.RolePermission)
RolePermissions 获取角色对应的权限配置
func SubscribeLimitNum ¶
func SubscribeLimitNum() uint64
func SysAuditCleanInterval ¶
func SysAuditCleanInterval() int
SysAuditCleanInterval 返回 sys scope 审计事件软删除周期
Types ¶
type Conf ¶
type Conf struct { LocalMode bool `env:"LOCAL_MODE" default:"false"` Debug bool `env:"DEBUG" default:"false"` MySQLHost string `env:"MYSQL_HOST"` MySQLPort string `env:"MYSQL_PORT"` MySQLUsername string `env:"MYSQL_USERNAME"` MySQLPassword string `env:"MYSQL_PASSWORD"` MySQLDatabase string `env:"MYSQL_DATABASE"` MySQLLoc string `env:"MYSQL_LOC" default:"Local"` GittarOutterURL string `env:"GITTAR_PUBLIC_URL"` UCClientID string `env:"UC_CLIENT_ID"` UCClientSecret string `env:"UC_CLIENT_SECRET"` RootDomain string `env:"DICE_ROOT_DOMAIN"` UIPublicURL string `env:"UI_PUBLIC_URL"` UIDomain string `env:"UI_PUBLIC_ADDR"` OpenAPIDomain string `env:"OPENAPI_PUBLIC_ADDR"` // Deprecated: after cli refactored AvatarStorageURL string `env:"AVATAR_STORAGE_URL"` // file:///avatars or oss://appkey:appsecret@endpoint/bucket LicenseKey string `env:"LICENSE_KEY"` RedisMasterName string `default:"my-master" env:"REDIS_MASTER_NAME"` RedisSentinelAddrs string `default:"" env:"REDIS_SENTINELS_ADDR"` RedisAddr string `default:"127.0.0.1:6379" env:"REDIS_ADDR"` RedisPwd string `default:"anywhere" env:"REDIS_PASSWORD"` ProjectStatsCacheCron string `env:"PROJECT_STATS_CACHE_CRON" default:"0 0 1 * * ?"` EnableProjectNS bool `env:"ENABLE_PROJECT_NS" default:"true"` LegacyUIDomain string `env:"LEGACY_UI_PUBLIC_ADDR"` // subscribe config SubscribeLimitNum uint64 `env:"SUBSCRIBE_LIMIT_NUM" default:"6"` // ory/kratos config OryEnabled bool `default:"false" env:"ORY_ENABLED"` OryKratosPrivateAddr string `default:"kratos-admin" env:"ORY_KRATOS_ADMIN_ADDR"` // Allow people who are not admin to create org CreateOrgEnabled bool `default:"false" env:"CREATE_ORG_ENABLED"` // audit AuditCleanCron string `env:"AUDIT_CLEAN_CRON" default:"0 0 3 * * ?"` // audit soft delete cron AuditArchiveCron string `env:"AUDIT_ARCHIVE_CRON" default:"0 0 4 * * ?"` // audit archive cron SysAuditCleanInterval int `env:"SYS_AUDIT_CLEAN_INTERVAL" default:"-30"` // sys audit clean interval OrgAuditMaxRetentionDays uint64 `env:"ORG_AUDIT_MAX_RETENTION_DAYS" default:"500"` // org level audit max retention days OrgAuditDefaultRetentionDays uint64 `env:"ORG_AUDIT_DEFAULT_RETENTION_DAYS" default:"365"` // org level audit default retention days // erda-configs ErdaConfigsBasePath string `env:"ERDA_CONFIGS_BASE_PATH" default:"common-conf/erda-configs"` }
Conf 定义基于环境变量的配置项
Click to show internal directories.
Click to hide internal directories.