conf

package
v1.3.0-rc.0...-12c9840 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSRFCookieDomain

func CSRFCookieDomain() string

func CSRFWhiteList

func CSRFWhiteList() []string

func CookieDomain

func CookieDomain() string

func CreateOrgEnabled

func CreateOrgEnabled() bool

func CustomNamespace

func CustomNamespace() string

func Debug

func Debug() bool

func DiceProtocol

func DiceProtocol() string

func ErdaSystemFQDN

func ErdaSystemFQDN() string

func ExportUserWithRole

func ExportUserWithRole() bool

func GetCustomSvcHostPort

func GetCustomSvcHostPort(svc string) (string, uint16, bool)

func GetDomain

func GetDomain(host, confDomain string) (string, error)

GetDomain get a domain by request host

func GetUCRedirectHost

func GetUCRedirectHost(referer string) string

GetUCRedirectHost get a uc redirect host by referer

func ListenAddr

func ListenAddr() string

ListenAddr return LISTEN_ADDR

func Load

func Load()

Load 加载环境变量配置

func MySQLDatabase

func MySQLDatabase() string

func MySQLHost

func MySQLHost() string

func MySQLLoc

func MySQLLoc() string

func MySQLPassword

func MySQLPassword() string

func MySQLPort

func MySQLPort() string

func MySQLUsername

func MySQLUsername() string

func OAuth2NetdataDir

func OAuth2NetdataDir() string

func OldCookieDomain

func OldCookieDomain() string

func OryCompatibleClientID

func OryCompatibleClientID() string

func OryCompatibleClientSecret

func OryCompatibleClientSecret() string

func OryEnabled

func OryEnabled() bool

func OryKratosAddr

func OryKratosAddr() string

func OryKratosPrivateAddr

func OryKratosPrivateAddr() string

func OryLoginURL

func OryLoginURL() string

func OryLogoutURL

func OryLogoutURL() string

func RedirectAfterLogin

func RedirectAfterLogin() string

func RedisAddr

func RedisAddr() string

func RedisMasterName

func RedisMasterName() string

RedisMasterName

func RedisPwd

func RedisPwd() string

func RedisSentinelAddrs

func RedisSentinelAddrs() string

func RootDomainList

func RootDomainList() []string

func SelfPublicURL

func SelfPublicURL() string

func SessionCookieName

func SessionCookieName() string

func SurveyDingding

func SurveyDingding() string

func UCAddrFront

func UCAddrFront() string

func UCClientID

func UCClientID() string

func UCClientSecret

func UCClientSecret() string

func UCRedirectHost

func UCRedirectHost() string

func UseK8S

func UseK8S() bool

Types

type Conf

type Conf struct {
	ListenAddr string `default:":9529" env:"LISTEN_ADDR"`

	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"`

	UCAddrFront        string `default:"" env:"UC_PUBLIC_ADDR"`
	UCRedirectHost     string `default:"openapi.test.terminus.io" env:"SELF_PUBLIC_ADDR"`
	UCClientID         string `default:"dice" env:"UC_CLIENT_ID"`
	UCClientSecret     string `default:"secret" env:"UC_CLIENT_SECRET"`
	RedirectAfterLogin string `default:"//dice.test.terminus.io/" env:"UI_PUBLIC_ADDR"`
	CookieDomain       string `default:".terminus.io,.erda.cloud" env:"COOKIE_DOMAIN"`
	OldCookieDomain    string `default:"" env:"OLD_COOKIE_DOMAIN"`
	SessionCookieName  string `default:"OPENAPISESSION" env:"SESSION_COOKIE_NAME"`
	CSRFCookieDomain   string `default:"" env:"CSRF_COOKIE_DOMAIN"`

	UseK8S             string `env:"DICE_CLUSTER_TYPE"`
	SurveyDingding     string `env:"SURVEY_DINGDING"`
	DiceProtocol       string `env:"DICE_PROTOCOL"`
	CustomNamespace    string `env:"CUSTOM_NAMESPACE"`
	SelfPublicURL      string `env:"SELF_PUBLIC_URL"`
	ExportUserWithRole string `default:"false" env:"EXPORT_USER_WITH_ROLE"`
	ErdaSystemFQDN     string `env:"ERDA_SYSTEM_FQDN"`

	CustomSvcHostPortMapping map[string]ServiceHostPort

	// 修改该值的话,注意同步修改 dice.yml 中 '<%$.Storage.MountPoint%>/dice/openapi/oauth2/:/oauth2/:rw' 容器内挂载点的值
	OAuth2NetdataDir string `env:"OAUTH2_NETDATA_DIR" default:"/oauth2/"`

	CSRFWhiteList string `env:"CSRF_WHITE_LIST"`

	// ory/kratos config
	OryEnabled           bool   `default:"false" env:"ORY_ENABLED"`
	OryKratosAddr        string `default:"kratos-public" env:"ORY_KRATOS_ADDR"`
	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"`

	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"`
	Debug         bool   `env:"DEBUG" default:"false"`

	RootDomain string `env:"DICE_ROOT_DOMAIN"`
}

type ServiceHostPort

type ServiceHostPort struct {
	Host string
	Port uint16
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL