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 DisableFileDownloadPermissionValidate() bool
- func EnableNS() bool
- func FileMaxMemorySize() datasize.ByteSize
- func FileMaxUploadSize() datasize.ByteSize
- func GittarOutterURL() string
- func LegacyUIDomain() string
- func LicenseKey() string
- func ListenAddr() string
- func Load()
- func LocalMode() bool
- func MySQLDatabase() string
- func MySQLHost() string
- func MySQLLoc() string
- func MySQLPassword() string
- func MySQLPort() string
- func MySQLUsername() string
- func OSSAccessID() string
- func OSSAccessSecret() string
- func OSSBucket() string
- func OSSEndpoint() string
- func OSSPathPrefix() string
- func OpenAPIDomain() string
- 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 StorageMountPointInContainer() string
- func SysAuditCleanIterval() 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 DisableFileDownloadPermissionValidate ¶
func DisableFileDownloadPermissionValidate() bool
DisableFileDownloadPermissionValidate return switch for file download permission check.
func FileMaxMemorySize ¶
FileMaxMemorySize return the size of the file parts stored in memory
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 StorageMountPointInContainer ¶
func StorageMountPointInContainer() string
StorageMountPointInContainer 返回 files 在容器内的挂载点.
func SysAuditCleanIterval ¶
func SysAuditCleanIterval() int
SysAuditCleanIterval 返回 sys scope 审计事件软删除周期
Types ¶
type Conf ¶
type Conf struct { LocalMode bool `env:"LOCAL_MODE" default:"false"` Debug bool `env:"DEBUG" default:"false"` ListenAddr string `env:"LISTEN_ADDR" default:":9526"` 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"` AuditCleanCron string `env:"AUDIT_CLEAN_CRON" default:"0 0 3 * * ?"` // 审计软删除任务执行周期 AuditArchiveCron string `env:"AUDIT_ARCHIVE_CRON" default:"0 0 4 * * ?"` // 审计归档任务执行周期 SysAuditCleanIterval int `env:"SYS_AUDIT_CLEAN_ITERVAL" default:"-7"` // 系统审计清除周期 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"` // ory/kratos config OryEnabled bool `default:"false" env:"ORY_ENABLED"` OryKratosAddr string `default:"kratos:4433" env:"KRATOS_ADDR"` OryKratosPrivateAddr string `default:"kratos:4434" env:"KRATOS_PRIVATE_ADDR"` // Allow people who are not admin to create org CreateOrgEnabled bool `default:"false" env:"CREATE_ORG_ENABLED"` // --- 文件管理 begin --- FileMaxUploadSizeStr string `env:"FILE_MAX_UPLOAD_SIZE" default:"300MB"` // 文件上传限制大小,默认 300MB FileMaxUploadSize datasize.ByteSize // the size of the file parts stored in memory, the default value 32M refer to https://github.com/golang/go/blob/5c489514bc5e61ad9b5b07bd7d8ec65d66a0512a/src/net/http/request.go FileMaxMemorySizeStr string `env:"FILE_MAX_MEMORY_SIZE" default:"32MB"` FileMaxMemorySize datasize.ByteSize // disable file download permission validate temporarily for multi-domain DisableFileDownloadPermissionValidate bool `env:"DISABLE_FILE_DOWNLOAD_PERMISSION_VALIDATE" default:"false"` // fs // 修改该值的话,注意同步修改 dice.yml 中 '<%$.Storage.MountPoint%>/dice/cmdb/files:/files:rw' 容器内挂载点的值 StorageMountPointInContainer string `env:"STORAGE_MOUNT_POINT_IN_CONTAINER" default:"/files"` // oss OSSEndpoint string `env:"OSS_ENDPOINT"` OSSAccessID string `env:"OSS_ACCESS_ID"` OSSAccessSecret string `env:"OSS_ACCESS_SECRET"` OSSBucket string `env:"OSS_BUCKET"` OSSPathPrefix string `env:"OSS_PATH_PREFIX" default:"/dice/cmdb/files"` }
Conf 定义基于环境变量的配置项
Click to show internal directories.
Click to hide internal directories.