Auto_news
A utility to fetch article requests from slack and generate pdfs for them, fully automatically.
Running - Docker compose
A rudimentary docker compose file makes for much simpler command linde calls.
-
For normal,
productionmode anduploadmode, run:docker compose --env-file env/<desired mode> upAll relevant passthroughs and mounts are specified through the env-file, for which I configured 4 versions: production, debug (development in general), upload and check. These files will have to be adapted to your individual setup but can be reused more easily.
-
For
debugmode, you will likely want interactivity, so you need to run:docker compose --env-file env/debug up -d && docker compose --env-file env/debug exec auto_news bash && docker compose --env-file env/debug downwhich should automatically shutdown the containers once you are done. (
ctrl+dto exit the container shell). If not, re-rundocker compose --env-file env/debug downmanually.Note: The live-mounted code is then under
/code. Note that theDEBUG=trueenvironment variable is still set. If you want to test things on production, runexport DEBUG=false. Runningpython runner.pywill now run the newly written code but, with the production database and storage. -
For
checkmode, some env-variables are also changed and you still require interactivity. You don't need the geckodriver service however. The simplest way is to run
docker compose --env-file env/check run auto_news
Building
The software (firefox, selenium, python) changes frequently. For non-breaking changes it is useful to regularly clean build the docker image! This is also crucial to update the code itself.
In docker, simply run:
docker build -t auto_news --no-cache .
where the Dockerfile has to be in the working directory
In docker compose, run
docker compose --env-file env/production build
Roadmap:
❌ automatically upload files to NAS
❌ handle paywalled sites like faz, spiegel, .. through their dedicated edu-friendly sites