This runs at startup of anything, so we should be extra sure to not
break anything, and lots of things can go wrong downloading files from
the internet
We should be creating the directory because the static tree from the
repo isn't actually copied into the container, so we can't rely on it
existing.
And if we can't write it, we should catch that error instead of crashing
the whole thing, oops!
We can't bake the font into the Docker image as such, because we mount
the volumes which blows away anything we have in the app tree
beforehand.
We could stash it somewhere in the image and then copy it from there on
app startup or something, but at that point we might as well just
download it as part of the app startup.
Include the license and a README explaining things in the repo itself.
Depending on an external source for this is intended to be temporary,
the goal is to have a Bookywrm-managed source for these, but this should
be stable enough for now.
We build it into the Dockerfile to make it available without adding it
to the git repo itself, because git history is forever and we don't want
to bake large files into the history.
Theoretically it would make sense to gate this download on the
ENABLE_PREVIEW_IMAGES environment variable, but ENV variables aren't
available at Docker image build time (for sensible reasons), so we just
unconditonally download it.
This does mean users will ultimately download it anyway, but the benefit
to doing this over adding it to the git history is that if we switch
fonts, or update this one, or change strategies altogether, this version
of the font will no longer have to be downloaded.
Additionally, the font won't be downloaded until the application is
actually built, which involves a bunch of other downloading (of Docker
images and the like), so it's a reasonable time to do it.
So, you can't define handlers piecewise, and if you redefine a logger,
you have to also include everything it uses, because your "new" logger
doesn't have a reference to the original logging config to get things
like mail_admins and require_debug_false.
require_debug_true isn't strictly necessary here, but it seemed strange
to just copy over one of them.