qgis / qgis-docker

Official Docker image for QGIS Server and Desktop
GNU Affero General Public License v3.0
74 stars 24 forks source link

Make .local/share/QGIS profile folder working #16

Closed daniviga closed 5 years ago

daniviga commented 5 years ago

In our docker container we do not have a 'qgis' user: this allows uid to be specified at runtime, per container, without requiring a full rebuild of it.

Because of that and because spawn-fcgi does not set $HOME based on -u ${QGIS_USER:-nginx} the QGIS profile folder was expected under /root/.local. Since the fcgi process is properly run by ${QGIS_USER:-nginx} such user was indeed not able to write to /root/.local. The missing profile folders was preventing the Auth DB to be created: this has several side effects, like with basemaps using https.

It looks like that there's no way to customize where the QGIS server profile is located: it can be done when using the GUI via --profiles-path and QGIS_OPTIONS_PATH changes only where the configuration file in saved (and not the entire profile).

To avoid this issue a generic /var/lib/qgis is created with 1777 (as /tmp is, because we don't know who will run QGIS upfront and I don't want to make the entry point logic too complex) and $HOME is then set to that folder.