switch to hybrid

This commit is contained in:
aptalca
2022-08-18 12:31:30 -04:00
parent 637e3fb322
commit 8ac80178f3
7 changed files with 23 additions and 4 deletions
+4 -4
View File
@@ -1,11 +1,11 @@
# Multi Language OCR - Docker mod for papermerge and paperless-ng
# Multi Language OCR - Docker mod for papermerge and paperless-ng/x
This mod adds multi language OCR packages to papermerge and paperless-ng, to be installed/updated during container start.
This mod adds multi language OCR packages to papermerge and paperless-ng/x, to be installed/updated during container start. Keep in mind that you still have to enable the languages in the app itself, as this mod only installs the system language packs.
In papermerge/paperless-ng docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:papermerge-multilangocr` to enable this mod.
In papermerge/paperless-ng/x docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:papermerge-multilangocr` to enable this mod.
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:papermerge-multilangocr|linuxserver/mods:papermerge-mod2`
Then set an environment variable named `OCRLANG` and set it to the language codes that follow `tesseract-ocr-` from [this page](https://packages.ubuntu.com/focal/tesseract-ocr-all). You can add multiple codes that are comma separated, with no spaces.
For example, if you want to enable OCR for Chinese Simple and Belarusian, you'd set the var as `-e OCRLANG="chi-sim,bel"`.
For example, if you want to enable OCR for Chinese Simple and Belarusian, you'd set the var as `-e OCRLANG="chi-sim,bel"`.
@@ -0,0 +1,17 @@
#!/usr/bin/with-contenv bash
if [ -n "$OCRLANG" ]; then
echo "**** OCRLANG variable is set, processing the language packages ****"
for i in $(echo "$OCRLANG" | tr "," " "); do
if apt-cache show tesseract-ocr-"${i}" > /dev/null 2>&1; then
if ! dpkg -s tesseract-ocr-"${i}" >/dev/null 2>&1; then
echo "**** Adding tesseract-ocr-${i} to package install list ****"
echo "tesseract-ocr-${i}" >> /mod-repo-packages-to-install.list
else
echo "**** tesseract-ocr-${i} is already installed, skipping ****"
fi
else
echo "**** package tesseract-ocr-${i} not found in the repository, skipping ****"
fi
done
fi
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-papermerge-multilangocr-add-package/run