coss_archiving/README.md
2022-06-25 16:06:45 +02:00

2.0 KiB

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, production mode and upload mode, run:

    docker compose --env-file env/<desired mode> up

    All 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 debug mode, 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 down

    which should automatically shutdown the containers once you are done. (ctrl+d to exit the container shell). If not, re-run docker compose --env-file env/debug down manually.

    Note: The live-mounted code is then under /code. Note that the DEBUG=true environment variable is still set. If you want to test things on production, run export DEBUG=false. Running python runner.py will now run the newly written code but, with the production database and storage.

  • For check mode, 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