qwc-services / qwc-ogc-service

QWC OGC service
MIT License
3 stars 11 forks source link

QGIS_SERVER_URL environment variable #8

Closed danceb closed 1 year ago

danceb commented 1 year ago

In this section https://github.com/qwc-services/qwc-ogc-service#usage it is mentioned that a QGIS_SERVER_URL environment variable to the QGIS server URL can be set.

But it seems, that in https://github.com/qwc-services/qwc-ogc-service/blob/master/ogc_service.py#L37 the function takes a look at the tenantConfig.json only and sets the default value to 'http://localhost:8001/ows/' if nothing is found there. We couldn't find the spot where the mentioned environment variable is taking in account. Are we missing something or is this not implemented (which would be nice if that were so)?

Thanks!

manisandro commented 1 year ago

All service config settings in the tenantConfig.json can be overridden by fully-capitalized corresponding environment-variable [1]. So this happens transparently via `config.get()'.

[1] https://github.com/qwc-services/qwc-services-core/blob/master/qwc_services_core/runtime_config.py#L57.

danceb commented 1 year ago

ah ok! So the environmental variable should named DEFAULT_QGIS_SERVER_URL, not QGIS_SERVER_URL, correct?

manisandro commented 1 year ago

Yes indeed, fixed.