paperless-home-assistant-addon icon indicating copy to clipboard operation
paperless-home-assistant-addon copied to clipboard

Tika Gotenberg

Open Sineiko opened this issue 1 year ago • 15 comments

Hello and Thank you for your work,

how can i use Tika and Gotenberg.

I activate them in the config. Or is that not active? I have at least activated this in the config file. But I am not sure. but he says to me: Could not parse content with tika server at http://192.169.178.123:9998: [Errno 111] Connection refused.

which address is the correct one to use?

Sineiko avatar Mar 07 '24 19:03 Sineiko

You'll need to run two others containers for this

I can maybe create an add-on for that

BenoitAnastay avatar Mar 07 '24 20:03 BenoitAnastay

That would of course be awesome.

Sineiko avatar Mar 07 '24 20:03 Sineiko

It would be really great if this addon also included Tika and Gotenberg. Unfortunately, Home Assistant does not allow Docker Compose projects as addons. This feature is definitely overdue!

But I was able to help myself by manually creating the containers for Gotenberg and Tika via the Portainer Addon and assigning them to the "hassio" network so that the Paperless Addon can access them.

Actually, I don't like to create containers manually via Portainer because they are not included in the Home Assistant backup (and generally cannot be backed up), but Tika and Gotenberg work stateless.

Skyleiger avatar Apr 09 '24 14:04 Skyleiger

Skyleiger could you please advise how I can install Tika & Gotenberg manually on HA. I ran into not-working backup problems with my synology docker installation of paperless/Tika&Gotenberg and therefore was happy to read about the paperless add-on in HA because I thought that it would automatically backup my whole installation without the database mess I had on my synolgy. Therefore I migrated from synology docker to HA, but now I learned that the add-on does not provide Tika / Gotenberg support to process other files than only pdf files. Could you please advise on how I can install Tika / Gotenberg on my NUC so that I can stay with the paperless add-on on Home Assistant. THANK YOU - I dont want to migrate back again to docker on my NAS. I dont even know if there is an export function in the add-on if I would have to.

Aliofredi avatar Apr 12 '24 12:04 Aliofredi

@Aliofredi You can run those servers in your Synology.

Since files are stored in Paperless-NGX you do not need to backup Tika and Gotenberg

You'll just have to expose ports to be accessible by home assistant host and configure the parameters in paperless.conf

BenoitAnastay avatar Apr 12 '24 12:04 BenoitAnastay

@Sineiko

I activate them in the config. Or is that not active? I have at least activated this in the config file.

how did you do that? I am trying for hours. Seems like I am not even able to achieve at least this. I added a config.yaml in

/root/addon_configs/xxxxxxxxx_paperless-ngx/config.yaml

with proper values for PAPERLESS_TIKA_* env variables.

but there is no sign of the add-on respecting this config.yaml on startup.

Am I missing something?

mimorocks avatar May 20 '24 16:05 mimorocks

You need the Portainer addon, and there you install Tika Gotenberg. But I haven't tried it myself yet.

Sineiko avatar May 20 '24 16:05 Sineiko

You need the Portainer addon, and there you install Tika Gotenberg. But I haven't tried it myself yet.

Yes. I got Portainer running. And even got Tika Gotenberg running in a separate Container.

I am struggling with telling the paperless add-on to use it.

mimorocks avatar May 20 '24 16:05 mimorocks

In the settings:

Tika settings

PAPERLESS_TIKA_ENABLED=true
PAPERLESS_TIKA_ENDPOINT=http://gotenberg:9998
PAPERLESS_TIKA_GOTENBERG_ENDPOINT=http://tika:3000

Sineiko avatar May 20 '24 17:05 Sineiko

Screenshot_20240520_190344_Home Assistant

The setting file name is paperless.conf

Sineiko avatar May 20 '24 17:05 Sineiko

I tried that before I tried the config.yaml. As I did not seem to have any effect. No sign of Tika in the log on startup of the add-on.

Should paperless.conf be respected automatically? or do I need to tell the add-on somewhere else that it should use it?

mimorocks avatar May 20 '24 17:05 mimorocks

The configuration file have the priority over all others configurations arguments But I never needed to anything else than PDF so I don't know how those addons works

BenoitAnastay avatar May 20 '24 17:05 BenoitAnastay

I'd be happy to figure that out :) But it seems I am stuck at a basic concept.

Now switched back to try a paperless.conf. But as before the starting paperless add-on seems to completely ignore the paperless.conf.

mimorocks avatar May 21 '24 05:05 mimorocks

If you enable the debug flag does it add some verbosity to the logs?

BenoitAnastay avatar May 25 '24 14:05 BenoitAnastay

How can i enable the debug flag? Add something to the configuration?

mimorocks avatar May 26 '24 09:05 mimorocks

@mimorocks Sorry for late reply You need to add this to paperless.conf

PAPERLESS_DEBUG=true

BenoitAnastay avatar Nov 27 '24 16:11 BenoitAnastay

Screenshot_20240520_190344_Home Assistant

The setting file name is paperless.conf

@Sineiko No need to hide the slug, it's the same for everyone, it's also the internal hostname but only exposed to HA itself, its not secret.

BenoitAnastay avatar Nov 27 '24 16:11 BenoitAnastay

I switch to Hassio with Supervisor soon and paperless will be my most important addon 😀

Is there already a proper way to make Tika and Gotenberg work with it?

HyperCriSiS avatar Dec 16 '24 21:12 HyperCriSiS

@HyperCriSiS it works with portainer addon

BenoitAnastay avatar Dec 17 '24 15:12 BenoitAnastay

I'm not familiar with portainer. Could anyone give me some short hints how to set up a container with Tika and Gotenburg?

Thank you.

UlrichThiess avatar Mar 18 '25 07:03 UlrichThiess

An-easy-to-install addon tuat runs without the need to install/use portainer would be awesome.

sevorl avatar Mar 18 '25 08:03 sevorl

Tika and Goteborg - My Solution

I guess you have already installed paperless-ngx. You also need Studio Code Server or any other editor.

1. Portainer

  • Install AddOn Portainer
  • Start AddOn without secure mode

2. Install Docker Stacks

Add Stack named gotenberg with Web editor and enter:

version: '3'
services:
  gotenberg:
    image: gotenberg/gotenberg:latest
    container_name: gotenberg
    ports:
      - "3000:3000"
    restart: unless-stopped

Click Deploy the stack

Add Stack named tikawith Web editor an enter:

version: '3'
services:
  apache-tika:
    image: apache/tika
    container_name: tika
    ports:
      - "9998:9998"
    restart: unless-stopped

3. Test

If you connect to you Home Assistant with http://homeassistant.local:8123 you should test

  • http://homeassistant.local:3000 You should see:

Image

  • http://homeassistant.local:9998 You should see:

Image

3. Change paperless.conf

Edit /addon_configs/ca5234a0_paperless-ngx/paperless.conf If you don't have it, create it. Beware not to use the folder /homeassistant/addon_configs

...
# Tika settings                
                         
PAPERLESS_TIKA_ENABLED=true             
PAPERLESS_TIKA_ENDPOINT=http://192.168.0.3:9998
PAPERLESS_TIKA_GOTENBERG_ENDPOINT=http://192.168.0.3:3000
...

Change the ip-address 192.168.0.3 into the ip-address of homeassistant.local or similar.

4. Restart paperless-ngx

Restart the AddOn.

5. Final Test

Drag an d Drop some .eml-files and office files.

UlrichThiess avatar Mar 18 '25 14:03 UlrichThiess

Thank you @UlrichThiess !

This is an excelent explanation. I got it working immediately. The only remarks that I have, for anyone else who might want to set this up:

There are two very similar folders, make sure to navigate to the correct one: addon_configs and /homeassistant/addons_config/ <- This is the wrong forlder.

If you use the file editor, you might not see folders outside of /homeassistant. Use Studio Code Server or other editors instead.

I had to create this file, as it did not exist on my system: /addon_configs/ca5234a0_paperless-ngx/paperless.conf

sevorl avatar Mar 19 '25 11:03 sevorl

Thanks @sevorl for the hints. I changed the description.

Whenever i have a solution for a problem i try to create a step by step description to give something back ...

UlrichThiess avatar Mar 19 '25 11:03 UlrichThiess

Thank you! The folder names are in fact homeassistant/addons_config vs. addon_configs with the plural s at a different place

sevorl avatar Mar 19 '25 12:03 sevorl