setting.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. // Copyright 2014 Unknwon
  2. // Copyright 2014 Torkel Ödegaard
  3. package setting
  4. import (
  5. "bytes"
  6. "encoding/json"
  7. "fmt"
  8. "net/url"
  9. "os"
  10. "path"
  11. "path/filepath"
  12. "regexp"
  13. "runtime"
  14. "strings"
  15. "github.com/go-macaron/session"
  16. "gopkg.in/ini.v1"
  17. "github.com/grafana/grafana/pkg/log"
  18. "github.com/grafana/grafana/pkg/util"
  19. )
  20. type Scheme string
  21. const (
  22. HTTP Scheme = "http"
  23. HTTPS Scheme = "https"
  24. )
  25. const (
  26. DEV string = "development"
  27. PROD string = "production"
  28. TEST string = "test"
  29. )
  30. var (
  31. // App settings.
  32. Env string = DEV
  33. AppUrl string
  34. AppSubUrl string
  35. // build
  36. BuildVersion string
  37. BuildCommit string
  38. BuildStamp int64
  39. // Paths
  40. LogsPath string
  41. HomePath string
  42. DataPath string
  43. PluginsPath string
  44. // Log settings.
  45. LogModes []string
  46. LogConfigs []util.DynMap
  47. // Http server options
  48. Protocol Scheme
  49. Domain string
  50. HttpAddr, HttpPort string
  51. SshPort int
  52. CertFile, KeyFile string
  53. RouterLogging bool
  54. StaticRootPath string
  55. EnableGzip bool
  56. EnforceDomain bool
  57. // Security settings.
  58. SecretKey string
  59. LogInRememberDays int
  60. CookieUserName string
  61. CookieRememberName string
  62. DisableGravatar bool
  63. EmailCodeValidMinutes int
  64. DataProxyWhiteList map[string]bool
  65. // Snapshots
  66. ExternalSnapshotUrl string
  67. ExternalSnapshotName string
  68. ExternalEnabled bool
  69. // User settings
  70. AllowUserSignUp bool
  71. AllowUserOrgCreate bool
  72. AutoAssignOrg bool
  73. AutoAssignOrgRole string
  74. VerifyEmailEnabled bool
  75. LoginHint string
  76. DefaultTheme string
  77. // Http auth
  78. AdminUser string
  79. AdminPassword string
  80. AnonymousEnabled bool
  81. AnonymousOrgName string
  82. AnonymousOrgRole string
  83. // Auth proxy settings
  84. AuthProxyEnabled bool
  85. AuthProxyHeaderName string
  86. AuthProxyHeaderProperty string
  87. AuthProxyAutoSignUp bool
  88. // Basic Auth
  89. BasicAuthEnabled bool
  90. // Session settings.
  91. SessionOptions session.Options
  92. // Global setting objects.
  93. Cfg *ini.File
  94. ConfRootPath string
  95. IsWindows bool
  96. // PhantomJs Rendering
  97. ImagesDir string
  98. PhantomDir string
  99. // for logging purposes
  100. configFiles []string
  101. appliedCommandLineProperties []string
  102. appliedEnvOverrides []string
  103. ReportingEnabled bool
  104. CheckForUpdates bool
  105. GoogleAnalyticsId string
  106. GoogleTagManagerId string
  107. // LDAP
  108. LdapEnabled bool
  109. LdapConfigFile string
  110. // SMTP email settings
  111. Smtp SmtpSettings
  112. // QUOTA
  113. Quota QuotaSettings
  114. // Alerting
  115. AlertingEnabled bool
  116. )
  117. type CommandLineArgs struct {
  118. Config string
  119. HomePath string
  120. Args []string
  121. }
  122. func init() {
  123. IsWindows = runtime.GOOS == "windows"
  124. log.NewLogger(0, "console", `{"level": 0, "formatting":true}`)
  125. }
  126. func parseAppUrlAndSubUrl(section *ini.Section) (string, string) {
  127. appUrl := section.Key("root_url").MustString("http://localhost:3000/")
  128. if appUrl[len(appUrl)-1] != '/' {
  129. appUrl += "/"
  130. }
  131. // Check if has app suburl.
  132. url, err := url.Parse(appUrl)
  133. if err != nil {
  134. log.Fatal(4, "Invalid root_url(%s): %s", appUrl, err)
  135. }
  136. appSubUrl := strings.TrimSuffix(url.Path, "/")
  137. return appUrl, appSubUrl
  138. }
  139. func ToAbsUrl(relativeUrl string) string {
  140. return AppUrl + relativeUrl
  141. }
  142. func shouldRedactKey(s string) bool {
  143. uppercased := strings.ToUpper(s)
  144. return strings.Contains(uppercased, "PASSWORD") || strings.Contains(uppercased, "SECRET")
  145. }
  146. func applyEnvVariableOverrides() {
  147. appliedEnvOverrides = make([]string, 0)
  148. for _, section := range Cfg.Sections() {
  149. for _, key := range section.Keys() {
  150. sectionName := strings.ToUpper(strings.Replace(section.Name(), ".", "_", -1))
  151. keyName := strings.ToUpper(strings.Replace(key.Name(), ".", "_", -1))
  152. envKey := fmt.Sprintf("GF_%s_%s", sectionName, keyName)
  153. envValue := os.Getenv(envKey)
  154. if len(envValue) > 0 {
  155. key.SetValue(envValue)
  156. if shouldRedactKey(envKey) {
  157. envValue = "*********"
  158. }
  159. appliedEnvOverrides = append(appliedEnvOverrides, fmt.Sprintf("%s=%s", envKey, envValue))
  160. }
  161. }
  162. }
  163. }
  164. func applyCommandLineDefaultProperties(props map[string]string) {
  165. appliedCommandLineProperties = make([]string, 0)
  166. for _, section := range Cfg.Sections() {
  167. for _, key := range section.Keys() {
  168. keyString := fmt.Sprintf("default.%s.%s", section.Name(), key.Name())
  169. value, exists := props[keyString]
  170. if exists {
  171. key.SetValue(value)
  172. if shouldRedactKey(keyString) {
  173. value = "*********"
  174. }
  175. appliedCommandLineProperties = append(appliedCommandLineProperties, fmt.Sprintf("%s=%s", keyString, value))
  176. }
  177. }
  178. }
  179. }
  180. func applyCommandLineProperties(props map[string]string) {
  181. for _, section := range Cfg.Sections() {
  182. for _, key := range section.Keys() {
  183. keyString := fmt.Sprintf("%s.%s", section.Name(), key.Name())
  184. value, exists := props[keyString]
  185. if exists {
  186. key.SetValue(value)
  187. appliedCommandLineProperties = append(appliedCommandLineProperties, fmt.Sprintf("%s=%s", keyString, value))
  188. }
  189. }
  190. }
  191. }
  192. func getCommandLineProperties(args []string) map[string]string {
  193. props := make(map[string]string)
  194. for _, arg := range args {
  195. if !strings.HasPrefix(arg, "cfg:") {
  196. continue
  197. }
  198. trimmed := strings.TrimPrefix(arg, "cfg:")
  199. parts := strings.Split(trimmed, "=")
  200. if len(parts) != 2 {
  201. log.Fatal(3, "Invalid command line argument", arg)
  202. return nil
  203. }
  204. props[parts[0]] = parts[1]
  205. }
  206. return props
  207. }
  208. func makeAbsolute(path string, root string) string {
  209. if filepath.IsAbs(path) {
  210. return path
  211. }
  212. return filepath.Join(root, path)
  213. }
  214. func evalEnvVarExpression(value string) string {
  215. regex := regexp.MustCompile(`\${(\w+)}`)
  216. return regex.ReplaceAllStringFunc(value, func(envVar string) string {
  217. envVar = strings.TrimPrefix(envVar, "${")
  218. envVar = strings.TrimSuffix(envVar, "}")
  219. envValue := os.Getenv(envVar)
  220. return envValue
  221. })
  222. }
  223. func evalConfigValues() {
  224. for _, section := range Cfg.Sections() {
  225. for _, key := range section.Keys() {
  226. key.SetValue(evalEnvVarExpression(key.Value()))
  227. }
  228. }
  229. }
  230. func loadSpecifedConfigFile(configFile string) {
  231. if configFile == "" {
  232. configFile = filepath.Join(HomePath, "conf/custom.ini")
  233. // return without error if custom file does not exist
  234. if !pathExists(configFile) {
  235. return
  236. }
  237. }
  238. userConfig, err := ini.Load(configFile)
  239. userConfig.BlockMode = false
  240. if err != nil {
  241. log.Fatal(3, "Failed to parse %v, %v", configFile, err)
  242. }
  243. for _, section := range userConfig.Sections() {
  244. for _, key := range section.Keys() {
  245. if key.Value() == "" {
  246. continue
  247. }
  248. defaultSec, err := Cfg.GetSection(section.Name())
  249. if err != nil {
  250. defaultSec, _ = Cfg.NewSection(section.Name())
  251. }
  252. defaultKey, err := defaultSec.GetKey(key.Name())
  253. if err != nil {
  254. defaultKey, _ = defaultSec.NewKey(key.Name(), key.Value())
  255. }
  256. defaultKey.SetValue(key.Value())
  257. }
  258. }
  259. configFiles = append(configFiles, configFile)
  260. }
  261. func loadConfiguration(args *CommandLineArgs) {
  262. var err error
  263. // load config defaults
  264. defaultConfigFile := path.Join(HomePath, "conf/defaults.ini")
  265. configFiles = append(configFiles, defaultConfigFile)
  266. Cfg, err = ini.Load(defaultConfigFile)
  267. Cfg.BlockMode = false
  268. if err != nil {
  269. log.Fatal(3, "Failed to parse defaults.ini, %v", err)
  270. }
  271. // command line props
  272. commandLineProps := getCommandLineProperties(args.Args)
  273. // load default overrides
  274. applyCommandLineDefaultProperties(commandLineProps)
  275. // init logging before specific config so we can log errors from here on
  276. DataPath = makeAbsolute(Cfg.Section("paths").Key("data").String(), HomePath)
  277. initLogging(args)
  278. // load specified config file
  279. loadSpecifedConfigFile(args.Config)
  280. // apply environment overrides
  281. applyEnvVariableOverrides()
  282. // apply command line overrides
  283. applyCommandLineProperties(commandLineProps)
  284. // evaluate config values containing environment variables
  285. evalConfigValues()
  286. // update data path and logging config
  287. DataPath = makeAbsolute(Cfg.Section("paths").Key("data").String(), HomePath)
  288. initLogging(args)
  289. }
  290. func pathExists(path string) bool {
  291. _, err := os.Stat(path)
  292. if err == nil {
  293. return true
  294. }
  295. if os.IsNotExist(err) {
  296. return false
  297. }
  298. return false
  299. }
  300. func setHomePath(args *CommandLineArgs) {
  301. if args.HomePath != "" {
  302. HomePath = args.HomePath
  303. return
  304. }
  305. HomePath, _ = filepath.Abs(".")
  306. // check if homepath is correct
  307. if pathExists(filepath.Join(HomePath, "conf/defaults.ini")) {
  308. return
  309. }
  310. // try down one path
  311. if pathExists(filepath.Join(HomePath, "../conf/defaults.ini")) {
  312. HomePath = filepath.Join(HomePath, "../")
  313. }
  314. }
  315. var skipStaticRootValidation bool = false
  316. func validateStaticRootPath() error {
  317. if skipStaticRootValidation {
  318. return nil
  319. }
  320. if _, err := os.Stat(path.Join(StaticRootPath, "css")); err == nil {
  321. return nil
  322. }
  323. if _, err := os.Stat(StaticRootPath + "_gen/css"); err == nil {
  324. StaticRootPath = StaticRootPath + "_gen"
  325. return nil
  326. }
  327. return fmt.Errorf("Failed to detect generated css or javascript files in static root (%s), have you executed default grunt task?", StaticRootPath)
  328. }
  329. func NewConfigContext(args *CommandLineArgs) error {
  330. setHomePath(args)
  331. loadConfiguration(args)
  332. Env = Cfg.Section("").Key("app_mode").MustString("development")
  333. PluginsPath = Cfg.Section("paths").Key("plugins").String()
  334. server := Cfg.Section("server")
  335. AppUrl, AppSubUrl = parseAppUrlAndSubUrl(server)
  336. Protocol = HTTP
  337. if server.Key("protocol").MustString("http") == "https" {
  338. Protocol = HTTPS
  339. CertFile = server.Key("cert_file").String()
  340. KeyFile = server.Key("cert_key").String()
  341. }
  342. Domain = server.Key("domain").MustString("localhost")
  343. HttpAddr = server.Key("http_addr").MustString("0.0.0.0")
  344. HttpPort = server.Key("http_port").MustString("3000")
  345. RouterLogging = server.Key("router_logging").MustBool(false)
  346. EnableGzip = server.Key("enable_gzip").MustBool(false)
  347. EnforceDomain = server.Key("enforce_domain").MustBool(false)
  348. StaticRootPath = makeAbsolute(server.Key("static_root_path").String(), HomePath)
  349. if err := validateStaticRootPath(); err != nil {
  350. return err
  351. }
  352. // read security settings
  353. security := Cfg.Section("security")
  354. SecretKey = security.Key("secret_key").String()
  355. LogInRememberDays = security.Key("login_remember_days").MustInt()
  356. CookieUserName = security.Key("cookie_username").String()
  357. CookieRememberName = security.Key("cookie_remember_name").String()
  358. DisableGravatar = security.Key("disable_gravatar").MustBool(true)
  359. // read snapshots settings
  360. snapshots := Cfg.Section("snapshots")
  361. ExternalSnapshotUrl = snapshots.Key("external_snapshot_url").String()
  362. ExternalSnapshotName = snapshots.Key("external_snapshot_name").String()
  363. ExternalEnabled = snapshots.Key("external_enabled").MustBool(true)
  364. // read data source proxy white list
  365. DataProxyWhiteList = make(map[string]bool)
  366. for _, hostAndIp := range security.Key("data_source_proxy_whitelist").Strings(" ") {
  367. DataProxyWhiteList[hostAndIp] = true
  368. }
  369. // admin
  370. AdminUser = security.Key("admin_user").String()
  371. AdminPassword = security.Key("admin_password").String()
  372. users := Cfg.Section("users")
  373. AllowUserSignUp = users.Key("allow_sign_up").MustBool(true)
  374. AllowUserOrgCreate = users.Key("allow_org_create").MustBool(true)
  375. AutoAssignOrg = users.Key("auto_assign_org").MustBool(true)
  376. AutoAssignOrgRole = users.Key("auto_assign_org_role").In("Editor", []string{"Editor", "Admin", "Read Only Editor", "Viewer"})
  377. VerifyEmailEnabled = users.Key("verify_email_enabled").MustBool(false)
  378. LoginHint = users.Key("login_hint").String()
  379. DefaultTheme = users.Key("default_theme").String()
  380. // anonymous access
  381. AnonymousEnabled = Cfg.Section("auth.anonymous").Key("enabled").MustBool(false)
  382. AnonymousOrgName = Cfg.Section("auth.anonymous").Key("org_name").String()
  383. AnonymousOrgRole = Cfg.Section("auth.anonymous").Key("org_role").String()
  384. // auth proxy
  385. authProxy := Cfg.Section("auth.proxy")
  386. AuthProxyEnabled = authProxy.Key("enabled").MustBool(false)
  387. AuthProxyHeaderName = authProxy.Key("header_name").String()
  388. AuthProxyHeaderProperty = authProxy.Key("header_property").String()
  389. AuthProxyAutoSignUp = authProxy.Key("auto_sign_up").MustBool(true)
  390. authBasic := Cfg.Section("auth.basic")
  391. BasicAuthEnabled = authBasic.Key("enabled").MustBool(true)
  392. // PhantomJS rendering
  393. ImagesDir = filepath.Join(DataPath, "png")
  394. PhantomDir = filepath.Join(HomePath, "vendor/phantomjs")
  395. analytics := Cfg.Section("analytics")
  396. ReportingEnabled = analytics.Key("reporting_enabled").MustBool(true)
  397. CheckForUpdates = analytics.Key("check_for_updates").MustBool(true)
  398. GoogleAnalyticsId = analytics.Key("google_analytics_ua_id").String()
  399. GoogleTagManagerId = analytics.Key("google_tag_manager_id").String()
  400. ldapSec := Cfg.Section("auth.ldap")
  401. LdapEnabled = ldapSec.Key("enabled").MustBool(false)
  402. LdapConfigFile = ldapSec.Key("config_file").String()
  403. alerting := Cfg.Section("alerting")
  404. AlertingEnabled = alerting.Key("enabled").MustBool(false)
  405. readSessionConfig()
  406. readSmtpSettings()
  407. readQuotaSettings()
  408. if VerifyEmailEnabled && !Smtp.Enabled {
  409. log.Warn("require_email_validation is enabled but smpt is disabled")
  410. }
  411. return nil
  412. }
  413. func readSessionConfig() {
  414. sec := Cfg.Section("session")
  415. SessionOptions = session.Options{}
  416. SessionOptions.Provider = sec.Key("provider").In("memory", []string{"memory", "file", "redis", "mysql", "postgres", "memcache"})
  417. SessionOptions.ProviderConfig = strings.Trim(sec.Key("provider_config").String(), "\" ")
  418. SessionOptions.CookieName = sec.Key("cookie_name").MustString("grafana_sess")
  419. SessionOptions.CookiePath = AppSubUrl
  420. SessionOptions.Secure = sec.Key("cookie_secure").MustBool()
  421. SessionOptions.Gclifetime = Cfg.Section("session").Key("gc_interval_time").MustInt64(86400)
  422. SessionOptions.Maxlifetime = Cfg.Section("session").Key("session_life_time").MustInt64(86400)
  423. SessionOptions.IDLength = 16
  424. if SessionOptions.Provider == "file" {
  425. SessionOptions.ProviderConfig = makeAbsolute(SessionOptions.ProviderConfig, DataPath)
  426. os.MkdirAll(path.Dir(SessionOptions.ProviderConfig), os.ModePerm)
  427. }
  428. if SessionOptions.CookiePath == "" {
  429. SessionOptions.CookiePath = "/"
  430. }
  431. }
  432. var logLevels = map[string]int{
  433. "Trace": 0,
  434. "Debug": 1,
  435. "Info": 2,
  436. "Warn": 3,
  437. "Error": 4,
  438. "Critical": 5,
  439. }
  440. func getLogLevel(key string, defaultName string) (string, int) {
  441. levelName := Cfg.Section(key).Key("level").In(defaultName, []string{"Trace", "Debug", "Info", "Warn", "Error", "Critical"})
  442. level, ok := logLevels[levelName]
  443. if !ok {
  444. log.Fatal(4, "Unknown log level: %s", levelName)
  445. }
  446. return levelName, level
  447. }
  448. func initLogging(args *CommandLineArgs) {
  449. //close any existing log handlers.
  450. log.Close()
  451. // Get and check log mode.
  452. LogModes = strings.Split(Cfg.Section("log").Key("mode").MustString("console"), ",")
  453. LogsPath = makeAbsolute(Cfg.Section("paths").Key("logs").String(), HomePath)
  454. defaultLevelName, _ := getLogLevel("log", "Info")
  455. LogConfigs = make([]util.DynMap, len(LogModes))
  456. for i, mode := range LogModes {
  457. mode = strings.TrimSpace(mode)
  458. sec, err := Cfg.GetSection("log." + mode)
  459. if err != nil {
  460. log.Fatal(4, "Unknown log mode: %s", mode)
  461. }
  462. // Log level.
  463. _, level := getLogLevel("log."+mode, defaultLevelName)
  464. // Generate log configuration.
  465. switch mode {
  466. case "console":
  467. formatting := sec.Key("formatting").MustBool(true)
  468. LogConfigs[i] = util.DynMap{
  469. "level": level,
  470. "formatting": formatting,
  471. }
  472. case "file":
  473. logPath := sec.Key("file_name").MustString(filepath.Join(LogsPath, "grafana.log"))
  474. os.MkdirAll(filepath.Dir(logPath), os.ModePerm)
  475. LogConfigs[i] = util.DynMap{
  476. "level": level,
  477. "filename": logPath,
  478. "rotate": sec.Key("log_rotate").MustBool(true),
  479. "maxlines": sec.Key("max_lines").MustInt(1000000),
  480. "maxsize": 1 << uint(sec.Key("max_size_shift").MustInt(28)),
  481. "daily": sec.Key("daily_rotate").MustBool(true),
  482. "maxdays": sec.Key("max_days").MustInt(7),
  483. }
  484. case "conn":
  485. LogConfigs[i] = util.DynMap{
  486. "level": level,
  487. "reconnectOnMsg": sec.Key("reconnect_on_msg").MustBool(),
  488. "reconnect": sec.Key("reconnect").MustBool(),
  489. "net": sec.Key("protocol").In("tcp", []string{"tcp", "unix", "udp"}),
  490. "addr": sec.Key("addr").MustString(":7020"),
  491. }
  492. case "smtp":
  493. LogConfigs[i] = util.DynMap{
  494. "level": level,
  495. "user": sec.Key("user").MustString("example@example.com"),
  496. "passwd": sec.Key("passwd").MustString("******"),
  497. "host": sec.Key("host").MustString("127.0.0.1:25"),
  498. "receivers": sec.Key("receivers").MustString("[]"),
  499. "subject": sec.Key("subject").MustString("Diagnostic message from serve"),
  500. }
  501. case "database":
  502. LogConfigs[i] = util.DynMap{
  503. "level": level,
  504. "driver": sec.Key("driver").String(),
  505. "conn": sec.Key("conn").String(),
  506. }
  507. case "syslog":
  508. LogConfigs[i] = util.DynMap{
  509. "level": level,
  510. "network": sec.Key("network").MustString(""),
  511. "address": sec.Key("address").MustString(""),
  512. "facility": sec.Key("facility").MustString("local7"),
  513. "tag": sec.Key("tag").MustString(""),
  514. }
  515. }
  516. cfgJsonBytes, _ := json.Marshal(LogConfigs[i])
  517. log.NewLogger(Cfg.Section("log").Key("buffer_len").MustInt64(10000), mode, string(cfgJsonBytes))
  518. }
  519. }
  520. func LogConfigurationInfo() {
  521. var text bytes.Buffer
  522. text.WriteString("Configuration Info\n")
  523. text.WriteString("Config files:\n")
  524. for i, file := range configFiles {
  525. text.WriteString(fmt.Sprintf(" [%d]: %s\n", i, file))
  526. }
  527. if len(appliedCommandLineProperties) > 0 {
  528. text.WriteString("Command lines overrides:\n")
  529. for i, prop := range appliedCommandLineProperties {
  530. text.WriteString(fmt.Sprintf(" [%d]: %s\n", i, prop))
  531. }
  532. }
  533. if len(appliedEnvOverrides) > 0 {
  534. text.WriteString("\tEnvironment variables used:\n")
  535. for i, prop := range appliedEnvOverrides {
  536. text.WriteString(fmt.Sprintf(" [%d]: %s\n", i, prop))
  537. }
  538. }
  539. text.WriteString("Paths:\n")
  540. text.WriteString(fmt.Sprintf(" home: %s\n", HomePath))
  541. text.WriteString(fmt.Sprintf(" data: %s\n", DataPath))
  542. text.WriteString(fmt.Sprintf(" logs: %s\n", LogsPath))
  543. text.WriteString(fmt.Sprintf(" plugins: %s\n", PluginsPath))
  544. log.Info(text.String())
  545. }