nextcloud / univention-app

📦 Nextcloud App for the Univention Corporate Server
34 stars 21 forks source link

Support for Nextcloud App "Optical character recognition" https://github.com/janis91/ocr #69

Open herrep opened 6 years ago

herrep commented 6 years ago

Dear App Maintainer,

Would you consider support for integrating the Nextcloud App "Optical character recognition" available at https://github.com/janis91/ocr into your Nextcloud Docker Container?

When activating this Nextcloud App, I need to add further packages to be run locally in the Nextcloud Docker Container and this breaks later updates of Nextcloud.

If there are no plans to do so, what would be the best way forward to integrate the Nextcloud App "Optical character recognition" or is the only way of installing Nextcloud directly within UCS 4.3?

Best regards, Peter

blizzz commented 6 years ago

Hi @herrep, adding package is no problem, at least when they are provided by the distro. Please open a pull request and add necessary packages to the block at https://github.com/nextcloud/univention-app/blob/master/Dockerfile#L34-L60

LightTemplar commented 1 year ago

That plugin is too old now and I suggest switching to https://apps.nextcloud.com/apps/workflow_ocr Though it needs ocrmypdf installed. And this package pulls about 100 another packages as dependencies. Also I suggest installing two languages: German and English for OCR. If it's ok, I can make a PR with it.

blizzz commented 1 year ago

Though it needs ocrmypdf installed. And this package pulls about 100 another packages as dependencies.

This would blow the image, I suppose, and I already have mixed feelings about additional php modules. I solution I would rather fancy is some mechanism to allow admins to specifiy additional packages that would be installed with each installation / image upgrade. This could be doable through some ucr entry, that will be checked in the setup script (first idea coming to my mind, not necessarily best idea).

LightTemplar commented 1 year ago

This could be doable through some ucr entry, that will be checked in the setup script.

As for me, it would be acceptable. I would use this mechanism. Though, it's not elegant, but would work.

Another alternative is a full operational post-install script, I think. It gives more flexibility, but is more difficult to implement. And I think, it should be more universal, applicable also to another apps.

LightTemplar commented 1 year ago

Just tested installing ocrmypdf on the fresh released 25.0.8 container, and it looked nicer:

~$ sudo univention-app shell nextcloud sudo -u root apt install --no-install-recommends ocrmypdf 

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  icc-profiles-free libarchive13 libgif7 libimagequant0 liblept5 libqpdf28
  libraqm0 libtesseract4 python3-cffi-backend python3-chardet
  python3-coloredlogs python3-cryptography python3-humanfriendly
  python3-img2pdf python3-importlib-metadata python3-lxml
  python3-more-itertools python3-packaging python3-pdfminer python3-pikepdf
  python3-pil python3-pkg-resources python3-pluggy python3-pyparsing
  python3-reportlab python3-reportlab-accel python3-tqdm python3-zipp
  tesseract-ocr tesseract-ocr-eng tesseract-ocr-osd
Suggested packages:
  lrzip ocrmypdf-doc python-watchdog img2pdf python-cryptography-doc
  python3-cryptography-vectors python-lxml-doc pdfminer-data python-pil-doc
  python3-setuptools python-pyparsing-doc pdf-viewer
  python3-egenix-mxtexttools python-reportlab-doc
Recommended packages:
  unpaper pngquant python3-bs4 python3-html5lib python3-olefile
  python3-renderpm
The following NEW packages will be installed:
  icc-profiles-free libarchive13 libgif7 libimagequant0 liblept5 libqpdf28
  libraqm0 libtesseract4 ocrmypdf python3-cffi-backend python3-chardet
  python3-coloredlogs python3-cryptography python3-humanfriendly
  python3-img2pdf python3-importlib-metadata python3-lxml
  python3-more-itertools python3-packaging python3-pdfminer python3-pikepdf
  python3-pil python3-pkg-resources python3-pluggy python3-pyparsing
  python3-reportlab python3-reportlab-accel python3-tqdm python3-zipp
  tesseract-ocr tesseract-ocr-eng tesseract-ocr-osd
0 upgraded, 32 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.5 MB of archives.
After this operation, 44.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
blizzz commented 1 year ago

We could have an ucr entry like nextcloud/container/extra-packages (like https://github.com/nextcloud/univention-app/blob/master/inst#L125) which is by default empty, and expect to carry a space seperated list of packages we can pass on to apt install (after an apt update in case is not empty). The check and execution can be placed somewhere at the end of the setup script, ideally before placing the cron file. It should not be breaking however, log on error, but otherwise continue.

LightTemplar commented 1 year ago

It should not be breaking however

are the possibility to rerun script or reinstall Nextcloud container after changing of UCR Value?

somewhere at the end of the setup script

Why not at the beginning? As I understand, this script makes preadjustments to Nextcloud itself. Shouldn't preadjustments to its system be before it?

blizzz commented 1 year ago

It should not be breaking however

are the possibility to rerun script or reinstall Nextcloud container after changing of UCR Value?

Might be possible with some hooks through UCS. But would that be necessary at all? It's a rare action.

somewhere at the end of the setup script

Why not at the beginning? As I understand, this script makes preadjustments to Nextcloud itself. Shouldn't preadjustments to its system be before it?

For then we have a known and defined state to set up or update Nextcloud.

LightTemplar commented 1 year ago

Might be possible with some hooks through UCS. But would that be necessary at all? It's a rare action.

As I understand the install order: 1) Choosing Nextcloud from the App center 2) Installing it from there 3) Only then there will be UCR values available to set, will they?

And then there is also a situation, when an admin later decides to use some new addons, which requires again some packages.

blizzz commented 1 year ago

The variables can be set up front, before 1.

And then there is also a situation, when an admin later decides to use some new addons, which requires again some packages.

Yeah, that would be an univention-app shell nextcloud apt …, unless you write a listener on ucr variable changes. I think it was possible, I am not sure know. Maybe per roundtrip… https://docs.software-univention.de/manual/5.0/en/computers/ucr.html for starters.

Fuseteam commented 1 year ago

will setting the ucr variable the persist across updates? In that case, installing in the container and setting the var should be fine......as it should still be a rare action

blizzz commented 1 year ago

will setting the ucr variable the persist across updates?

Setting an ucr entry is done on the host and yes "survives" updates.