Skip to content

Conversation

danceb
Copy link
Contributor

@danceb danceb commented Apr 28, 2025

To use another QGIS Server url than http://qwc-qgis-server/ows/ this should also be configurable via ENV.

Furthermore I added the possibility to read the WMS service names from a database via mounting a pg_service.conf file. So in this case not all project names has to be listed in preseed_services.txt.

@danceb danceb changed the title Make QGIS Server URL configurable via ENV Make QGIS Server URL configurable via ENV and read project names from database Apr 28, 2025
@manisandro
Copy link
Member

Thanks!

@danceb
Copy link
Contributor Author

danceb commented Sep 8, 2025

I came across this. Besides, that the PR is still open, just a question:

For what is the code in [1] needed? as the ENV are already specified within the Dockerfile at [2], is there a need to export them again to a local file and read them out of this file?

[1] https://github.com/qwc-services/qwc-qgs-cache-preseed/blob/main/entrypoint.sh#L21-L26
[2] https://github.com/qwc-services/qwc-qgs-cache-preseed/blob/main/Dockerfile#L10-L18

@manisandro manisandro merged commit 6a853cb into qwc-services:main Sep 8, 2025
@manisandro
Copy link
Member

Indeed either I forgot to click on merge or the mouse button failed. Regarding your question: I think to remember that chronjobs start with a clean environment

@danceb
Copy link
Contributor Author

danceb commented Sep 8, 2025

Uh, in this case the new ENV DEFAULT_QGIS_SERVER_URL has to be exposed there aswell:

cat > $HOME/.cron_env <<EOF
export QGS_EXT=${QGS_EXT}
export FCGI_INSTANCES=${FCGI_INSTANCES}
export SLEEP_INTERVAL=${SLEEP_INTERVAL}
export DEFAULT_QGIS_SERVER_URL=${DEFAULT_QGIS_SERVER_URL}
EOF

@manisandro
Copy link
Member

Right, done in a3ca37c

@danceb
Copy link
Contributor Author

danceb commented Sep 8, 2025

I am sorry, it's shame, that I missed this one... There is another new ENV PG_DB_SCHEMA for reading the QGIS projects from data base ...

@manisandro
Copy link
Member

Added this one as well: 78098cc

@danceb
Copy link
Contributor Author

danceb commented Sep 8, 2025

I admit it, I have done the tests with user request only and not via crontab... So I have found another one ...

export PGSERVICEFILE=${PGSERVICEFILE} has to be added aswell, otherwise the pg service is not found within the psql commands.

Furthermore L25 of the Dockerfile [1] isn't needed indeed, as the ENV CONFIG_DB_URL is not used within the shell scripts.
I think I introduced this to make the service name configurable, but choosed to set it to qgisprojects as it is used in the config service aswell.
The comment in [2] could be changed to somethin like:
# Postgres service configuration file including a [qgisprojects] service to read QGIS project files from database.

This should be everything until now ... ;-)

[1] https://github.com/qwc-services/qwc-qgs-cache-preseed/blob/main/Dockerfile#L25
[2] https://github.com/qwc-services/qwc-qgs-cache-preseed/blob/main/Dockerfile#L23

@manisandro
Copy link
Member

If you have those changes locally, could you submit a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants