|
|
@@ -4,6 +4,7 @@ import (
|
|
4
|
4
|
"fmt"
|
|
5
|
5
|
"github.com/spf13/viper"
|
|
6
|
6
|
"strings"
|
|
|
7
|
+ "time"
|
|
7
|
8
|
)
|
|
8
|
9
|
|
|
9
|
10
|
const (
|
|
|
@@ -13,12 +14,12 @@ const (
|
|
13
|
14
|
)
|
|
14
|
15
|
|
|
15
|
16
|
type App struct {
|
|
16
|
|
- WebClient int `mapstructure:"web-client"`
|
|
17
|
|
- Register bool `mapstructure:"register"`
|
|
18
|
|
- ShowSwagger int `mapstructure:"show-swagger"`
|
|
19
|
|
- TokenExpire int `mapstructure:"token-expire"`
|
|
20
|
|
- WebSso bool `mapstructure:"web-sso"`
|
|
21
|
|
- DisablePwdLogin bool `mapstructure:"disable-pwd-login"`
|
|
|
17
|
+ WebClient int `mapstructure:"web-client"`
|
|
|
18
|
+ Register bool `mapstructure:"register"`
|
|
|
19
|
+ ShowSwagger int `mapstructure:"show-swagger"`
|
|
|
20
|
+ TokenExpire time.Duration `mapstructure:"token-expire"`
|
|
|
21
|
+ WebSso bool `mapstructure:"web-sso"`
|
|
|
22
|
+ DisablePwdLogin bool `mapstructure:"disable-pwd-login"`
|
|
22
|
23
|
}
|
|
23
|
24
|
type Admin struct {
|
|
24
|
25
|
Title string `mapstructure:"title"`
|
|
|
@@ -73,7 +74,7 @@ func Init(rowVal *Config, path string) *viper.Viper {
|
|
73
|
74
|
})
|
|
74
|
75
|
*/
|
|
75
|
76
|
if err := v.Unmarshal(rowVal); err != nil {
|
|
76
|
|
- fmt.Println(err)
|
|
|
77
|
+ panic(fmt.Errorf("Fatal error config: %s \n", err))
|
|
77
|
78
|
}
|
|
78
|
79
|
rowVal.Rustdesk.LoadKeyFile()
|
|
79
|
80
|
rowVal.Rustdesk.ParsePort()
|