Better structure

This commit is contained in:
Remy Moll
2022-04-17 22:32:56 +02:00
parent 0a6dde8c78
commit 0d76bcbb98
15 changed files with 310 additions and 58 deletions

View File

@@ -6,26 +6,25 @@ A utility to fetch article requests from slack and generate pdfs for them, fully
## Running
### How to run - auto archiving mode
In this mode the program is launched as a docker container, in a headless mode. For persistence purposes a local storage volume is required, but that's it!
`docker run -it -v <your storage>:/app/file_storage/ auto_news`
You can specify additional parameters:
`docker run -it -v <your storage>:/app/file_storage/ auto_news debug` runs with debug values (does not write to prod db, does not send mails)
`docker run -it -v <your storage>:/app/file_storage/ auto_news upload` catches up on past uploads to archive.
`docker run -it -v <your storage>:/app/file_storage/ -e DISPLAY=":0" --network host -v \$XAUTHORITY:/root/.Xauthority auto_news check` lets you visually verify the downloaded files. Be aware that it requires additional parameters in order to open guis on the host.
`docker run -it -v <your storage>:/app/file_storage/ auto_news upload` catches up on incomplete uploads to archive.
`docker run -it -v <your storage>:/app/file_storage/ -e DISPLAY=":0" --network host -v \$XAUTHORITY:/root/.Xauthority auto_news check` lets you visually verify the downloaded files. The additional parameters are required in order to open guis on the host.
### How to run - development mode
In this mode, a docker container is launched with an additional volume, the local code. You can test your code without the need to rebuild the image.
`docker run -it -v <your storage>:/app/file_storage/ -v <your code>:/code/ --entry-point /bin/bash auto_news`
You are droppped into a bash shell, in which you can navigate to the `/code` directory and then test live.
% ### How to run - file checker mode
% This mode requires the most access rights. You want to access all files and open gui programs.
% `docker run -it -e DISPLAY=":0" --network host -v $XAUTHORITY:/root/.Xauthority -v /mnt/Data/COSS/DOWNLOADS/auto_news/container_data/:/app/file_storage/ -v /mnt/Data/COSS/DOWNLOADS/auto_news/app:/code auto_news /bin/bash`
% Similarly to the development mode, you can cd into code and run your checking duties.
## Building
@@ -41,6 +40,17 @@ where the `Dockerfile` has to be in the working directory
## Cheat-sheet Remy:
docker run -it -e LIVECODE=TRUE -v /mnt/Data/COSS/DOWNLOADS/auto_news/container_data/:/app/file_storage/ -v /mnt/Data/COSS/DOWNLOADS/auto_news/app:/code/ auto_news /bin/bash
`docker run -it -v /mnt/Data/COSS/DOWNLOADS/auto_news/container_data/:/app/file_storage/ auto_news`
docker run -it -v /mnt/Data/COSS/DOWNLOADS/auto_news/container_data/:/app/file_storage/ auto_news
`docker run -it -v /mnt/Data/COSS/DOWNLOADS/auto_news/container_data/:/app/file_storage/ -v /mnt/Data/COSS/auto_news/app:/code --entrypoint /bin/bash auto_news`
`docker run -it -v /mnt/Data/COSS/DOWNLOADS/auto_news/container_data/:/app/file_storage/ -e DISPLAY=":0" --network host -v \$XAUTHORITY:/root/.Xauthority auto_news check`
## Roadmap:
[] automatically upload files to NAS
[] handle paywalled sites like faz, spiegel, .. through their dedicated edu-sites
...