comparison pkg/config/config.go @ 3104:19fc84a98479

Added "published-config" field to configuration. It's a path to a published JSON file (after login) to give additional parameters to the client. Reached by GET /api/system/config Currently the field "osm-url" is used by the client to determine the URL of the OSM server for the background layer.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 25 Apr 2019 15:31:43 +0200
parents ae678f7cf938
children 6a44a89ffb51
comparison
equal deleted inserted replaced
3103:247e78ba2bf7 3104:19fc84a98479
103 func GeoServerClean() bool { return viper.GetBool("geoserver-clean") } 103 func GeoServerClean() bool { return viper.GetBool("geoserver-clean") }
104 104
105 // TmpDir is the path where to store temporary files. 105 // TmpDir is the path where to store temporary files.
106 // If left empty the system default for temporary files is used. 106 // If left empty the system default for temporary files is used.
107 func TmpDir() string { return viper.GetString("tmp-dir") } 107 func TmpDir() string { return viper.GetString("tmp-dir") }
108
109 // PublishedConfig is a name of a JSON file where extra configuration is stored
110 // to be served to to the web client.
111 func PublishedConfig() string { return viper.GetString("published-config") }
108 112
109 var ( 113 var (
110 proxyKeyOnce sync.Once 114 proxyKeyOnce sync.Once
111 proxyKey []byte 115 proxyKey []byte
112 proxyPrefixOnce sync.Once 116 proxyPrefixOnce sync.Once
265 269
266 str("tmp-dir", "", "Temp directory of gemma server.\n"+ 270 str("tmp-dir", "", "Temp directory of gemma server.\n"+
267 "Defaults to system temp directory.") 271 "Defaults to system temp directory.")
268 272
269 str("schema-dirs", ".", "Directories to find XSD schema files in (recursive).") 273 str("schema-dirs", ".", "Directories to find XSD schema files in (recursive).")
274
275 str("published-config", "", "path to a config file served to client.")
270 } 276 }
271 277
272 var ( 278 var (
273 configCond = sync.NewCond(new(sync.Mutex)) 279 configCond = sync.NewCond(new(sync.Mutex))
274 configReady bool 280 configReady bool