config

package
v0.0.0-...-9967d42 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CipherKey = "JumpServer Cipher Key for KoKo !"

	KubectlBanner = "Welcome to JumpServer kubectl, try kubectl --help."
)

Functions

func EnsureDirExist

func EnsureDirExist(path string) error

func Setup

func Setup(configPath string)

Types

type Config

type Config struct {
	Name           string `mapstructure:"NAME"`
	CoreHost       string `mapstructure:"CORE_HOST"`
	BootstrapToken string `mapstructure:"BOOTSTRAP_TOKEN"`
	BindHost       string `mapstructure:"BIND_HOST"`
	SSHPort        string `mapstructure:"SSHD_PORT"`
	HTTPPort       string `mapstructure:"HTTPD_PORT"`
	SSHTimeout     int    `mapstructure:"SSH_TIMEOUT"`

	LogLevel string `mapstructure:"LOG_LEVEL"`

	Comment             string `mapstructure:"COMMENT"`
	LanguageCode        string `mapstructure:"LANGUAGE_CODE"`
	UploadFailedReplay  bool   `mapstructure:"UPLOAD_FAILED_REPLAY_ON_START"`
	UploadFailedFTPFile bool   `mapstructure:"UPLOAD_FAILED_FTP_FILE_ON_START"`
	AssetLoadPolicy     string `mapstructure:"ASSET_LOAD_POLICY"` // all
	ZipMaxSize          string `mapstructure:"ZIP_MAX_SIZE"`
	ZipTmpPath          string `mapstructure:"ZIP_TMP_PATH"`
	ClientAliveInterval int    `mapstructure:"CLIENT_ALIVE_INTERVAL"`
	RetryAliveCountMax  int    `mapstructure:"RETRY_ALIVE_COUNT_MAX"`
	ShowHiddenFile      bool   `mapstructure:"SFTP_SHOW_HIDDEN_FILE"`
	ReuseConnection     bool   `mapstructure:"REUSE_CONNECTION"`

	ShareRoomType string   `mapstructure:"SHARE_ROOM_TYPE"`
	RedisHost     string   `mapstructure:"REDIS_HOST"`
	RedisPort     string   `mapstructure:"REDIS_PORT"`
	RedisPassword string   `mapstructure:"REDIS_PASSWORD"`
	RedisDBIndex  int      `mapstructure:"REDIS_DB_ROOM"`
	RedisClusters []string `mapstructure:"REDIS_CLUSTERS"`

	RedisSentinelPassword string `mapstructure:"REDIS_SENTINEL_PASSWORD"`
	RedisSentinelHosts    string `mapstructure:"REDIS_SENTINEL_HOSTS"`
	RedisUseSSL           bool   `mapstructure:"REDIS_USE_SSL"`

	EnableLocalPortForward bool `mapstructure:"ENABLE_LOCAL_PORT_FORWARD"`
	EnableVscodeSupport    bool `mapstructure:"ENABLE_VSCODE_SUPPORT"`

	EnableReversePortForward bool `mapstructure:"ENABLE_REVERSE_PORT_FORWARD"`

	HiddenFields []string `mapstructure:"HIDDEN_FIELDS"`

	// 仅控制是否缓存 sftp 的 token 连接
	ConnectionTokenReusable bool `mapstructure:"CONNECTION_TOKEN_REUSABLE"`

	SshMaxSessions int `mapstructure:"SSH_MAX_SESSIONS"`

	DisableInputAsCommand bool `mapstructure:"DISABLE_INPUT_AS_COMMAND"`

	RootPath          string
	DataFolderPath    string
	LogDirPath        string
	KeyFolderPath     string
	AccessKeyFilePath string
	ReplayFolderPath  string
	FTPFileFolderPath string
	CertsFolderPath   string
}
var GlobalConfig *Config

func GetConf

func GetConf() Config

func (*Config) EnsureConfigValid

func (c *Config) EnsureConfigValid()

Jump to

Keyboard shortcuts

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