From 86ac2a67c35d483aa3c62ae1738fdec84c9836e1 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 16 Jul 2025 22:59:50 +0200 Subject: [PATCH] paperless: Improve documentation --- roles/paperless/README.md | 24 ++++++++++++------- roles/paperless/handlers/main.yml | 2 -- .../paperless/scripts}/scantopaperless.sh | 2 +- roles/paperless/vars/main.yml | 2 -- 4 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 roles/paperless/handlers/main.yml rename {stacks/paperless => roles/paperless/scripts}/scantopaperless.sh (90%) delete mode 100644 roles/paperless/vars/main.yml diff --git a/roles/paperless/README.md b/roles/paperless/README.md index 225dd44..dfa8474 100644 --- a/roles/paperless/README.md +++ b/roles/paperless/README.md @@ -1,38 +1,46 @@ Role Name ========= -A brief description of the role goes here. +Set up a docker-hosted paperless-ngx instance. Requirements ------------ -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. +The target server needs to be running a reasonably recent version of docker, +which contains the `docker compose` (_not_ `docker-compose`) sub-command. Role Variables -------------- -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. +All relevant variables reside in `defaults/main.yml`. + Dependencies ------------ -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. +Relies on the `caddy` role to be executed for caddy to pick up the container and proxy to it. Example Playbook ---------------- -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: +The role can easily be set up in the following way to deploy to any server: - hosts: servers roles: - - { role: username.rolename, x: 42 } + - role: paperless + +An example scanning script is included which I wrote for my old printer and allows (relatively) rapid scanning by pushing a button, +and automatically merging and sending the files to the consume folder. + +This will need to be adjusted for wherever you watch for the documents, +but is a simple example of how it could be integrated into a scanning workflow. License ------- -BSD +MIT Author Information ------------------ -An optional section for the role authors to include contact information, or a website (HTML is not allowed). +Copyright (c) 2025 Marty Oehme. All Rights Reserved. diff --git a/roles/paperless/handlers/main.yml b/roles/paperless/handlers/main.yml deleted file mode 100644 index 6d5ba60..0000000 --- a/roles/paperless/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for paperless diff --git a/stacks/paperless/scantopaperless.sh b/roles/paperless/scripts/scantopaperless.sh similarity index 90% rename from stacks/paperless/scantopaperless.sh rename to roles/paperless/scripts/scantopaperless.sh index 5c10c0c..ad43f3e 100755 --- a/stacks/paperless/scantopaperless.sh +++ b/roles/paperless/scripts/scantopaperless.sh @@ -24,5 +24,5 @@ if ! stat -t out*.png >/dev/null 2>&1; then fi magick out*.png out.pdf -mv out.pdf "$HOME/documents/archive/consume/$(date +'%Y-%m-%dT%H-%M')_scan.pdf" +mv out.pdf "$HOME/documents/consume/$(date +'%Y-%m-%dT%H-%M')_scan.pdf" rm out*.png diff --git a/roles/paperless/vars/main.yml b/roles/paperless/vars/main.yml deleted file mode 100644 index 3082f84..0000000 --- a/roles/paperless/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for paperless