mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Short Links: Add setting for changing expiration time (#86003)
* Add setting for changing shortlink expiration time * Add docs, add better language * put all the numbers in the duration 🤷 * 🙄 * update language to be correct and clear * Add max limit and more documentation
This commit is contained in:
@@ -516,6 +516,9 @@ type Cfg struct {
|
||||
// Experimental scope settings
|
||||
ScopesListScopesURL string
|
||||
ScopesListDashboardsURL string
|
||||
|
||||
//Short Links
|
||||
ShortLinkExpiration int
|
||||
}
|
||||
|
||||
// AddChangePasswordLink returns if login form is disabled or not since
|
||||
@@ -1158,6 +1161,14 @@ func (cfg *Cfg) parseINIFile(iniFile *ini.File) error {
|
||||
queryHistory := iniFile.Section("query_history")
|
||||
cfg.QueryHistoryEnabled = queryHistory.Key("enabled").MustBool(true)
|
||||
|
||||
shortLinks := iniFile.Section("short_links")
|
||||
cfg.ShortLinkExpiration = shortLinks.Key("expire_time").MustInt(7)
|
||||
|
||||
if cfg.ShortLinkExpiration > 365 {
|
||||
cfg.Logger.Warn("short_links expire_time must be less than 366 days. Setting to 365 days")
|
||||
cfg.ShortLinkExpiration = 365
|
||||
}
|
||||
|
||||
panelsSection := iniFile.Section("panels")
|
||||
cfg.DisableSanitizeHtml = panelsSection.Key("disable_sanitize_html").MustBool(false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user