[For Discussion] Add environment variables to set SSL certs for Gunicorn#20
Open
anthonyfok wants to merge 1 commit intomasterfrom
Open
[For Discussion] Add environment variables to set SSL certs for Gunicorn#20anthonyfok wants to merge 1 commit intomasterfrom
anthonyfok wants to merge 1 commit intomasterfrom
Conversation
This is to allow pygeoapi to serve over HTTPS.
The environment variables are
- PYGEOAPI_SSL_KEYFILE corresponds to --keyfile
- PYGEOAPI_SSL_CERTFILE corresponds to --certfile
- PYGEOAPI_SSL_VERSION corresponds to --ssl-version
- PYGEOAPI_SSL_CA_CERTS corresponds to --ca-certs
Sample command:
docker run -p 5000:80 \
-e PYGEOAPI_SSL_KEYFILE=/certs/tls.key \
-e PYGEOAPI_SSL_CERTFILE=/certs/tls.crt \
-v /path/to/tls.crt:/certs/tls.crt:ro \
-v /path/to/tls.key:/certs/tls.key:ro \
-v $(pwd)/my.config.yml:/pygeoapi/local.config.yml \
-it ghcr.io/opendrr/pygeoapi:pr-20
where "url: https://localhost:5000" is set in the "server" section
in my.config.yml
Fixes #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is to allow pygeoapi to serve over HTTPS.
The environment variables are:
--keyfile--certfile--ssl-version--ca-certsSee https://docs.gunicorn.org/en/stable/settings.html#ssl for Gunicorn's SSL-related parameters.
Sample command:
where
url: https://localhost:5000is set in theserversection in my.config.ymlFixes #19
Despite discovering
GUNICORN_CMD_ARGSwhich might negate the need for this pull request, I decided to go ahead and complete it because I was almost done, and wanted to refresh myself on the procedure of updating and testing pygeoapi Docker image, and maybe to start test building Docker image for pull requests too. (New issue to be filed later.)As to whether we actually want to merge this PR, that is up for discussion. Perhaps worth approaching upstream to see if they are interested in these explicit
PYGEOAPI_SSL_*variables, and, probably more importantly, where to add a HOWTO for getting pygeoapi to serve HTTPS in the official documentation / FAQ.