frpc: support 'includes' in common section to include proxy configs in other files(#2421)

This commit is contained in:
fatedier
2021-06-02 00:39:05 +08:00
committed by GitHub
parent 9ae322cccf
commit c32a2ed140
4 changed files with 116 additions and 54 deletions

View File

@@ -18,8 +18,6 @@ import (
"fmt"
"os"
"github.com/fatedier/frp/pkg/config"
"github.com/spf13/cobra"
)
@@ -31,18 +29,7 @@ var verifyCmd = &cobra.Command{
Use: "verify",
Short: "Verify that the configures is valid",
RunE: func(cmd *cobra.Command, args []string) error {
iniContent, err := config.GetRenderedConfFromFile(cfgFile)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
cfg, err := parseClientCommonCfg(CfgFileTypeIni, iniContent)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
_, _, err = config.LoadAllProxyConfsFromIni(cfg.User, iniContent, cfg.Start)
_, _, _, err := parseConfig(cfgFile)
if err != nil {
fmt.Println(err)
os.Exit(1)