Skip to content

Commit

Permalink
feat: add 2.11 support (#178)
Browse files Browse the repository at this point in the history
* add 2.9 support

* add v2.10 support

* Add doc for maintenance calls

* force requests==2.31.0

docker/docker-py#3256

* fix paperless_ngx_conf_trash_dir occurences

* fix none type trash dir variable
  • Loading branch information
stevenengland committed Jul 13, 2024
1 parent 2dcaca3 commit 7d55794
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ ansible==9.4.0
ansible-lint==24.2.2
pip==24.0
# urllib3==1.26.16 # <- periodically needed in some environments but not in github pipeline. Will leave it here for local builds: #https://github.com/docker/docker-py/issues/3113
yamllint==1.35.1
yamllint==1.35.1
requests==2.31.0
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ repos:
- id: yamllint
name: yamllint
entry: |
yamllint -c=.yamllint.yml .
.venv/bin/yamllint -c=.yamllint.yml .
language: system
types: [yaml]
pass_filenames: false
- id: ansible-lint
name: ansible-lint
entry: |
ansible-lint -c .ansible-lint
.venv/bin/ansible-lint -c .ansible-lint
language: system
types: [yaml]
pass_filenames: false
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ To save reading space a few abbreviations are used in the table down below:
| `paperless_ngx_conf_email_task_cron` | "*/10 * * * *" | Y | Y | | 1.12 |
| `paperless_ngx_conf_email_use_ssl` | false | Y | Y | | 2.0 |
| `paperless_ngx_conf_email_use_tls` | false | Y | Y | | 2.0 |
| `paperless_ngx_conf_empty_trash_delay` | 30 | Y | Y | | 2.10 |
| `paperless_ngx_conf_empty_trash_dir` | "{{ paperless_ngx_dir_runtime_data }}/trash" | Y | Y | | 2.10 |
| `paperless_ngx_conf_empty_trash_task_cron` | "0 1 * * *" | Y | Y | | 2.10 |
| `paperless_ngx_conf_enable_compression` | true | Y | Y | | 1.13 |
| `paperless_ngx_conf_enable_flower` | false | Y | Y | Whether to start flower or not. See [using flower](docs/USING_FLOWER.md) for more information | 1.10 |
| `paperless_ngx_conf_enable_http_remote_user` | false | Y | Y | | |
Expand All @@ -177,6 +180,7 @@ To save reading space a few abbreviations are used in the table down below:
| `paperless_ngx_conf_logrotate_max_size` | 1024 * 1024 | Y | Y | | |
| `paperless_ngx_conf_max_image_pixels` | None | Y | Y | | 2.6 |
| `paperless_ngx_conf_media_root` | "{{ paperless_ngx_dir_runtime_data }}/media" | Y | Y | | |
| `paperless_ngx_conf_model_file` | "{{ paperless_ngx_conf_data_dir }}/classification_model.pickle" | Y | Y | | 2.9 |
| `paperless_ngx_conf_nltk_dir` | /usr/share/nltk_data | Y | Y | | 1.11 |
| `paperless_ngx_conf_number_of_suggested_dates` |3| Y | Y | | |
| `paperless_ngx_conf_ocr_clean` | clean | Y | Y | | |
Expand Down Expand Up @@ -215,7 +219,6 @@ To save reading space a few abbreviations are used in the table down below:
| `paperless_ngx_conf_tika_gotenberg_endpoint` | http://localhost:3000 | Y | Y | | |
| `paperless_ngx_conf_time_zone` | Europe/London | Y | Y | | |
| `paperless_ngx_conf_train_task_cron` | "5 */1 * * *" | Y | Y | | 1.12 |
| `paperless_ngx_conf_trash_dir` | "{{ paperless_ngx_dir_runtime_data }}/trash" | Y | Y | | |
| `paperless_ngx_conf_trusted_proxies` | "" | Y | Y | | 1.14 |
| `paperless_ngx_conf_url` | http://localhost:8000 | Y | Y | | |
| `paperless_ngx_conf_use_x_forward_host` | False | Y | Y | | 1.14 |
Expand Down
5 changes: 4 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ paperless_ngx_conf_email_host_password: ""
paperless_ngx_conf_email_port: 25
paperless_ngx_conf_email_use_tls: false
paperless_ngx_conf_email_use_ssl: false
paperless_ngx_conf_empty_trash_delay: 30
paperless_ngx_conf_empty_trash_dir: "{{ paperless_ngx_dir_runtime_data }}/trash"
paperless_ngx_conf_empty_trash_task_cron: "0 1 * * *"
paperless_ngx_conf_enable_http_remote_user_api: false
paperless_ngx_conf_max_image_pixels:
paperless_ngx_conf_model_file: "{{ paperless_ngx_conf_data_dir }}/classification_model.pickle"
paperless_ngx_conf_ocr_color_conversion_strategy: "RGB"
paperless_ngx_conf_ocr_skip_archive_file: "never"
paperless_ngx_conf_proxy_ssl_header:
Expand All @@ -77,7 +81,6 @@ paperless_ngx_conf_dbsslmode: prefer
paperless_ngx_conf_db_timeout:
paperless_ngx_conf_consumption_dir: "{{ paperless_ngx_dir_runtime_data }}/consumption"
paperless_ngx_conf_data_dir: "{{ paperless_ngx_dir_runtime_data }}/data"
paperless_ngx_conf_trash_dir: "{{ paperless_ngx_dir_runtime_data }}/trash"
paperless_ngx_conf_media_root: "{{ paperless_ngx_dir_runtime_data }}/media"
paperless_ngx_conf_filename_format:
paperless_ngx_conf_filename_format_remove_none: false
Expand Down
24 changes: 24 additions & 0 deletions maintenance/CALLS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Doc generation for vars

Call

`python3 maintenance/vars/transform_var.py <PAPERLESS_VAR> <default value from setttings.py> <version when introduced>`
`python3 maintenance/vars/transform_var.py PAPERLESS_MODEL_FILE PAPERLESS_DATA_DIR/classification_model.pickle 2.9`

Result

```
paperless_ngx_conf_model_file: PAPERLESS_DATA_DIR/classification_model.pickle # <-- vars default
| `paperless_ngx_conf_model_file` | PAPERLESS_DATA_DIR/classification_model.pickle | Y | Y | | 2.9 | <--- readme
- pngx_var: PAPERLESS_MODEL_FILE # <-- conf yml
role_var: "{{ paperless_ngx_conf_model_file }}"
since_version: '2.9.0'
```

Call

`python3 maintenance/vars/check_vars.py --version 2.11.0`

Result

Shows differences between local vars in different files and the online documentation.
14 changes: 12 additions & 2 deletions tasks/paperless_ngx/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,24 @@
- pngx_var: PAPERLESS_EMAIL_USE_TLS
role_var: "{{ paperless_ngx_conf_email_use_tls }}"
since_version: '2.0.0'
- pngx_var: PAPERLESS_EMPTY_TRASH_DELAY
role_var: "{{ paperless_ngx_conf_empty_trash_delay }}"
since_version: '2.10.0'
- pngx_var: PAPERLESS_EMPTY_TRASH_DIR
role_var: "{{ paperless_ngx_conf_empty_trash_dir }}"
since_version: '2.10.0'
- pngx_var: PAPERLESS_EMPTY_TRASH_TASK_CRON
role_var: "{{ paperless_ngx_conf_empty_trash_task_cron }}"
since_version: '2.10.0'
- pngx_var: PAPERLESS_ENABLE_HTTP_REMOTE_USER_API
role_var: "{{ paperless_ngx_conf_enable_http_remote_user_api }}"
since_version: '2.5.0'
- pngx_var: PAPERLESS_MAX_IMAGE_PIXELS
role_var: "{{ paperless_ngx_conf_max_image_pixels }}"
since_version: '2.6.0'
- pngx_var: PAPERLESS_MODEL_FILE
role_var: "{{ paperless_ngx_conf_model_file }}"
since_version: '2.9.0'
- pngx_var: PAPERLESS_OCR_COLOR_CONVERSION_STRATEGY
role_var: "{{ paperless_ngx_conf_ocr_color_conversion_strategy }}"
since_version: '2.1.0'
Expand Down Expand Up @@ -191,8 +203,6 @@
role_var: "{{ paperless_ngx_conf_consumption_dir }}"
- pngx_var: PAPERLESS_DATA_DIR
role_var: "{{ paperless_ngx_conf_data_dir }}"
- pngx_var: PAPERLESS_TRASH_DIR
role_var: "{{ paperless_ngx_conf_trash_dir }}"
- pngx_var: PAPERLESS_MEDIA_ROOT
role_var: "{{ paperless_ngx_conf_media_root }}"
- pngx_var: PAPERLESS_STATICDIR
Expand Down
2 changes: 1 addition & 1 deletion tasks/preparation/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- 'not paperless_ngx_dir_installation in paperless_ngx_dir_runtime_data'
- 'not paperless_ngx_dir_installation in paperless_ngx_conf_consumption_dir'
- 'not paperless_ngx_dir_installation in paperless_ngx_conf_data_dir'
- 'not paperless_ngx_dir_installation in paperless_ngx_conf_trash_dir'
- 'not paperless_ngx_dir_installation in paperless_ngx_conf_empty_trash_dir'
- 'not paperless_ngx_dir_installation in paperless_ngx_conf_media_root'
- 'not paperless_ngx_dir_installation in paperless_ngx_conf_logging_dir'
msg:
Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ paperless_ngx_dir_force_permission_include:
- "{{ paperless_ngx_dir_runtime_data }}"
- "{{ paperless_ngx_conf_consumption_dir }}"
- "{{ paperless_ngx_conf_data_dir }}"
- "{{ paperless_ngx_conf_trash_dir }}"
- "{{ paperless_ngx_conf_empty_trash_dir }}"
- "{{ paperless_ngx_conf_media_root }}"
- "{{ paperless_ngx_conf_logging_dir }}"
paperless_ngx_dir_tmp: /tmp/paperless-ngx
Expand Down

0 comments on commit 7d55794

Please sign in to comment.