imagestorage: fix templating of public_url option for webdav (#74885)

* spelling in error message

* imguploader: fix template for webdav url

Since a few years ago, when loading the config file, the  template gets replaced in the expanding
env var phase (see ##25075) and introduced a bug in the webdav public_url config option. This commit
changes the template syntax to be {{file}}. This doesn't get expanded and removed when the config file
is loaded.

* devenv: add a block for a WebDAV server

* Adding alerting as codeowners for webdav

---------

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
This commit is contained in:
Daniel Lee
2023-09-28 00:35:10 +03:00
committed by GitHub
co-authored by Timur Olzhabayev
parent 6cede32535
commit 33a32df47b
7 changed files with 45 additions and 9 deletions
+2 -2
View File
@@ -37,8 +37,8 @@ var netClient = &http.Client{
}
func (u *WebdavUploader) PublicURL(filename string) string {
if strings.Contains(u.public_url, "${file}") {
return strings.ReplaceAll(u.public_url, "${file}", filename)
if strings.Contains(u.public_url, "{{file}}") {
return strings.ReplaceAll(u.public_url, "{{file}}", filename)
}
publicURL, _ := url.Parse(u.public_url)