ietf-tools / bibxml-service

Django-based Web service implementing IETF BibXML APIs
https://bib.ietf.org
BSD 3-Clause "New" or "Revised" License
17 stars 19 forks source link

chore: Handle missing environment variables for local dev #433

Closed microamp closed 4 months ago

microamp commented 4 months ago

Fixes #432

I could've added SOURCE_REPO_URL to .env in the documentation instead of changing docker-compose.yml, but decided to treat it like MATOMO_URL, MATOMO_SITE_ID, etc. at the end. Let me know.

kesara commented 4 months ago

Note that SOURCE_REPO_URL for production service is SOURCE_REPO_URL: "https://github.com/ietf-tools/". So this could be the default value as well.

microamp commented 4 months ago

Note that SOURCE_REPO_URL for production service is SOURCE_REPO_URL: "https://github.com/ietf-tools/". So this could be the default value as well.

I noticed that that's what it says in the Helm chart.

SOURCE_REPO_URL: "https://github.com/ietf-tools/"

compared to the documentation, https://github.com/ietf-tools/bibxml-service/blob/docs/missing-env-vars/docs/howto/run-in-production.rst, that says

SOURCE_REPO_URL=https://github.com/ietf-tools/bibxml-service

Do you know which one's the correct one?

microamp commented 4 months ago

Unlike MATOMO_*, SOURCE_REPO_URL is required for getting data. So better to have this one .env.

I think SOURCE_REPO_URL is only being used on the about page, https://bib.ietf.org/about. Upon a quick look, there is a different set of variables related to dataset sources, DATASET_SOURCE_OVERRIDES, DEFAULT_DATASET_REPO_URL_TEMPLATE, etc. Please correct me if I'm wrong.

kesara commented 4 months ago

Unlike MATOMO_*, SOURCE_REPO_URL is required for getting data. So better to have this one .env.

I think SOURCE_REPO_URL is only being used on the about page, https://bib.ietf.org/about. Upon a quick look, there is a different set of variables related to dataset sources, DATASET_SOURCE_OVERRIDES, DEFAULT_DATASET_REPO_URL_TEMPLATE, etc. Please correct me if I'm wrong.

Yeah, looks like it's defined in the settings file. This may be an opportunity to make things better. Ether get rid of the ENV or use that ENV in settings file?