conf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CMDBCurrentUserHost

func CMDBCurrentUserHost() string

func CSRFCookieDomain

func CSRFCookieDomain() string

func CSRFWhiteList

func CSRFWhiteList() []string

func CookieDomain

func CookieDomain() string

func CustomNamespace

func CustomNamespace() string

func DiceProtocol

func DiceProtocol() string

func ErdaSystemFQDN

func ErdaSystemFQDN() string

func ExportUserWithRole

func ExportUserWithRole() bool

func GetDomain

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

GetDomain get a domian 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 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 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"`
	CMDBCurrentUserHost string `default:"cmdb.marathon.l4lb.thisdcos.directory:9093" env:"CMDB_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" required:"true"`
	ExportUserWithRole  string `default:"false" env:"EXPORT_USER_WITH_ROLE"`
	ErdaSystemFQDN      string `env:"ERDA_SYSTEM_FQDN"`

	// 修改该值的话,注意同步修改 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:4433" env:"KRATOS_ADDR"`
	OryKratosPrivateAddr string `default:"kratos:4434" env:"KRATOS_PRIVATE_ADDR"`
}

Jump to

Keyboard shortcuts

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