Revert expiration default changes to main branch state

These changes are being handled in a separate PR branch (short-url-default-never-expire),
so removing them from this branch to avoid duplication.
This commit is contained in:
nmarrs
2025-12-09 10:34:18 -08:00
parent b0198a66b8
commit e22eba7ae9
3 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -1747,9 +1747,9 @@ enabled = true
#################################### Short Links #############################
[short_links]
# Short links that are never accessed will be deleted as cleanup. Time is set up in days. The default is -1 (never expire). Maximum value is 365.
# Short links that are never accessed will be deleted as cleanup. Time is set up in days. The default is 7 days. Maximum value is 365.
# 0 means they will be deleted approximately every 10 minutes. A negative value (such as -1) will disable expiration.
expire_time = -1
expire_time = 7
#################################### Internal Grafana Metrics ############
# Metrics available at HTTP URL /metrics and /metrics/plugins/:pluginId
+2 -2
View File
@@ -1689,8 +1689,8 @@ default_datasource_uid =
#################################### Short Links #############################
[short_links]
# Short links which are never accessed will be deleted as cleanup. Time is in days. Default is -1 (never expire). Max is 365. 0 means they will be deleted approximately every 10 minutes. A negative value (such as -1) will disable expiration.
;expire_time = -1
# Short links which are never accessed will be deleted as cleanup. Time is in days. Default is 7 days. Max is 365. 0 means they will be deleted approximately every 10 minutes.
;expire_time = 7
#################################### Internal Grafana Metrics ##########################
# Metrics available at HTTP URL /metrics and /metrics/plugins/:pluginId
+1 -2
View File
@@ -1330,13 +1330,12 @@ func (cfg *Cfg) parseINIFile(iniFile *ini.File) error {
cfg.QueryHistoryEnabled = queryHistory.Key("enabled").MustBool(true)
shortLinks := iniFile.Section("short_links")
cfg.ShortLinkExpiration = shortLinks.Key("expire_time").MustInt(-1)
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
}
// -1 means never expire, which is allowed
panelsSection := iniFile.Section("panels")
cfg.DisableSanitizeHtml = panelsSection.Key("disable_sanitize_html").MustBool(false)