Bug 278425 - deskutils/py-paperless-ngx: paperless.conf file has wrong NLTK_DIR value
Summary: deskutils/py-paperless-ngx: paperless.conf file has wrong NLTK_DIR value
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Michael Gmelin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-18 07:35 UTC by freebsd.bugzilla
Modified: 2024-04-27 10:11 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (grembo)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description freebsd.bugzilla 2024-04-18 07:35:48 UTC
The [patch-paperless.conf.example](https://github.com/freebsd/freebsd-ports/blob/ddf83690e4171846f72b6872deaf487199ee9504/deskutils/py-paperless-ngx/files/patch-paperless.conf.example#L59) patch file adds:
> +NLTK_DIR=/var/db/paperless/nltk_data

But the directory that is actually used throughout the patch is:
> /var/db/paperless/nltkdata

Examples:
- [Makefile](https://github.com/freebsd/freebsd-ports/blob/ddf83690e4171846f72b6872deaf487199ee9504/deskutils/py-paperless-ngx/Makefile#L157)
- [pkg-plist](https://github.com/freebsd/freebsd-ports/blob/ddf83690e4171846f72b6872deaf487199ee9504/deskutils/py-paperless-ngx/pkg-plist#L2868)
- [files/paperless-ngx.7.in](https://github.com/freebsd/freebsd-ports/blob/ddf83690e4171846f72b6872deaf487199ee9504/deskutils/py-paperless-ngx/files/paperless-ngx.7.in#L163)

As a result, if the user follows the man page suggestion to download NLTK to `/var/db/paperless/nltkdata`, then the port won't be able to use NLTK, because of the different value of `NLTK_DIR` in their `/usr/local/etc/paperless.conf`.
Comment 1 freebsd.bugzilla 2024-04-18 14:22:43 UTC
patch-paperless.conf.example also adds incorrect variable names for the NLTK settings. It uses 'NLTK_DIR' and 'NLTK_ENABLED', while the correct values are 'PAPERLESS_NLTK_DIR' and 'PAPERLESS_ENABLE_NLTK'.

I also have not seen any reference to 'NLTK_LANGUAGE' or the like in the documentation.

https://docs.paperless-ngx.com/configuration/
Comment 2 Michael Gmelin freebsd_committer freebsd_triage 2024-04-18 18:03:54 UTC
Thanks for reporting, this is pretty weird (as it worked ok before, so I must have messed up a patch at some point). I'll look into it.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-04-24 22:00:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d716cbc8e98a9410782bbad8139f7b6457920e5b

commit d716cbc8e98a9410782bbad8139f7b6457920e5b
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2024-04-24 12:39:17 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2024-04-24 21:56:50 +0000

    deskutils/py-paperless-ngx: Fixes and improvements

    - Fix NLTK configuration in paperless.conf.sample
    - Mention snowball_data in NLTK instructions
    - Fix sad defect that prevented rc scripts from picking
      up configuration data from rc.conf
    - Improve startup script documentation
    - Document required ACL when using a remote redis instance
    - Document how to enable JBIG2 and its potential pitfalls

    PR:             278424, 278425, 278426
    Reported by:    anonymous bugzilla user, netchild
    MFH:            2024Q2

 deskutils/py-paperless-ngx/Makefile                |  1 +
 deskutils/py-paperless-ngx/files/paperless-beat.in | 12 ++++++-----
 .../py-paperless-ngx/files/paperless-consumer.in   |  8 +++++---
 .../py-paperless-ngx/files/paperless-flower.in     | 12 ++++++-----
 .../py-paperless-ngx/files/paperless-migrate.in    | 12 ++++++-----
 .../py-paperless-ngx/files/paperless-ngx.7.in      | 24 +++++++++++++++++++---
 .../py-paperless-ngx/files/paperless-webui.in      | 20 +++++++++++-------
 .../py-paperless-ngx/files/paperless-worker.in     | 12 ++++++-----
 .../files/patch-paperless.conf.example             | 10 ++++-----
 deskutils/py-paperless-ngx/files/pkg-message.in    | 21 +++++++++++++++++++
 10 files changed, 93 insertions(+), 39 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-04-24 23:11:23 UTC
A commit in branch 2024Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=27a97f780c56cf51b482aa828ad0e20e24f23fcc

commit 27a97f780c56cf51b482aa828ad0e20e24f23fcc
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2024-04-24 12:39:17 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2024-04-24 23:09:18 +0000

    deskutils/py-paperless-ngx: Fixes and improvements

    - Fix NLTK configuration in paperless.conf.sample
    - Mention snowball_data in NLTK instructions
    - Fix sad defect that prevented rc scripts from picking
      up configuration data from rc.conf
    - Improve startup script documentation
    - Document required ACL when using a remote redis instance
    - Document how to enable JBIG2 and its potential pitfalls

    PR:             278424, 278425, 278426
    Reported by:    anonymous bugzilla user, netchild
    MFH:            2024Q2

    (cherry picked from commit d716cbc8e98a9410782bbad8139f7b6457920e5b)

 deskutils/py-paperless-ngx/Makefile                |  1 +
 deskutils/py-paperless-ngx/files/paperless-beat.in | 12 ++++++-----
 .../py-paperless-ngx/files/paperless-consumer.in   |  8 +++++---
 .../py-paperless-ngx/files/paperless-flower.in     | 12 ++++++-----
 .../py-paperless-ngx/files/paperless-migrate.in    | 12 ++++++-----
 .../py-paperless-ngx/files/paperless-ngx.7.in      | 24 +++++++++++++++++++---
 .../py-paperless-ngx/files/paperless-webui.in      | 20 +++++++++++-------
 .../py-paperless-ngx/files/paperless-worker.in     | 12 ++++++-----
 .../files/patch-paperless.conf.example             | 10 ++++-----
 deskutils/py-paperless-ngx/files/pkg-message.in    | 21 +++++++++++++++++++
 10 files changed, 93 insertions(+), 39 deletions(-)