diff --git a/conf/sample.ini b/conf/sample.ini index fa5123a2de8..241f85c69c4 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -995,12 +995,12 @@ [geomap] # Set the JSON configuration for the default basemap ;default_baselayer_config = `{ - "type": "xyz", - "config": { - "attribution": "Open street map", - "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png" - } -}` +; "type": "xyz", +; "config": { +; "attribution": "Open street map", +; "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png" +; } +;}` # Enable or disable loading other base map layers ;enable_custom_baselayers = true diff --git a/pkg/setting/setting_test.go b/pkg/setting/setting_test.go index 9a3d5ae6d35..411d10b69c7 100644 --- a/pkg/setting/setting_test.go +++ b/pkg/setting/setting_test.go @@ -54,6 +54,16 @@ func TestLoadingSettings(t *testing.T) { } }) + Convey("sample.ini should load successfully", func() { + customInitPath := CustomInitPath + CustomInitPath = "conf/sample.ini" + cfg := NewCfg() + err := cfg.Load(&CommandLineArgs{HomePath: "../../"}) + So(err, ShouldBeNil) + // Restore CustomInitPath to avoid side effects. + CustomInitPath = customInitPath + }) + Convey("Should be able to override via environment variables", func() { err := os.Setenv("GF_SECURITY_ADMIN_USER", "superduper") require.NoError(t, err)