freedomofpress / securethenews

An automated scanner and web dashboard for tracking TLS deployment across news organizations
https://securethe.news
GNU Affero General Public License v3.0
102 stars 25 forks source link

Split version file into full (/admin) and short (/health) #373

Closed maeve-fpf closed 3 years ago

maeve-fpf commented 3 years ago

First site listed on https://github.com/freedomofpress/fpf-www-projects/issues/220

This overhauls the version script a bit to have better output (try it on prod vs develop vs a detached HEAD), adds a test, and the content-type for /health/ok.

It probably doesn't matter for efficiency but (not a change from before) this still builds the text files at boot time and reads them on every request. We could, for efficiency, build once at container build time and read once at app startup.

If this looks good, I can go ahead and implement for other sites.

maeve-fpf commented 3 years ago

I had to rebuild the requirements files locally, and while I tossed that commit out, it looks like it's causing a CI failure. I'm going to redo that.

SaptakS commented 3 years ago

https://github.com/freedomofpress/securethenews/pull/374 This should fix the run_dev and run_prod. The safety_check seems to be failing on a linting error though.

maeve-fpf commented 3 years ago

I ran black to fix the lints so there is a bit more whitespace and quote-character noise, but it's the same changes. Thanks!