mantlenetworkio/mantle

TSS: can't read jwt secret in config

Closed this issue · 0 comments

Describe the bug
Now both ManagerConfig and NodeConfig has contain jwt_secret. Although, we have specified jwt_secret in environment variable, the viper can't read the value.

type ManagerConfig struct {
	WsAddr     string `json:"ws_addr" mapstructure:"ws_addr"`
	HttpAddr   string `json:"http_addr" mapstructure:"http_addr"`
	JwtSecret  string `json:"jwt_secret" mapstructure:"jwt_secret"`
	DBDir      string `json:"db_dir" mapstructure:"db_dir"`
	PrivateKey string `json:"private_key" mapstructure:"private_key"`

        ...
}

type NodeConfig struct {
	BaseDir      string `json:"base_dir" mapstructure:"base_dir"`
	DBDir        string `json:"db_dir" mapstructure:"db_dir"`
	WsAddr       string `json:"ws_addr" mapstructure:"ws_addr"`
	HttpAddr     string `json:"http_addr" mapstructure:"http_addr"`
	JwtSecret    string `json:"jwt_secret" mapstructure:"jwt_secret"`
	L2EthRpc     string `json:"l2_eth_rpc" mapstructure:"l2_eth_rpc"`
	DisableHTTP2 bool   `json:"disable_http2" mapstructure:"disable_http2"`
	PrivateKey   string `json:"private_key" mapstructure:"private_key"
        
        ...
}

Expected behavior
The config can read secret key value from environment variables.