Paperless-ng

Currently reading
Paperless-ng

7
8
NAS
DS216+II
Operating system
  1. Linux
  2. Windows
Mobile operating system
  1. Android
  2. iOS
Of course, now that I'm in it won't work
So you have logged into the UI with your new account? It won't work means what exactly?
I had assumed that once I had it open there'd be a place in the application to select the folders I wanted to use
By this, you mean what exactly?
 
Upvote 0
So you have logged into the UI with your new account? It won't work means what exactly?

By this, you mean what exactly?

Sorry, should have given details. When I drag a file to be analyzed into the "in" box, it gives me a generic error and won't process. I assume this is because it doesn't know where to store the file once it has been processed. I didn't create the "consume" folders or anything else mentioned in the tutorial because I assumed I could create them once I was in the Paperless UI like I'd be able to for a normal application. Paperless itself is working fine; I can change settings and everything. I think it just doesn't know where to store it's data.
 
Upvote 0
Sorry, should have given details. When I drag a file to be analyzed into the "in" box, it gives me a generic error and won't process. I assume this is because it doesn't know where to store the file once it has been processed. I didn't create the "consume" folders or anything else mentioned in the tutorial because I assumed I could create them once I was in the Paperless UI like I'd be able to for a normal application. Paperless itself is working fine; I can change settings and everything. I think it just doesn't know where to store it's data.
Correct you need 4 mapping locations on that container, something like this:

/volume1/docker/paperlessng/consume/usr/src/paperless/consume
/volume1/docker/paperlessng/export/usr/src/paperless/export
/volume1/docker/paperlessng/media/usr/src/paperless/media
/volume1/docker/paperlessng/data/usr/src/paperless/data

The left side is your NAS location, right are the paths that Paperless uses. Configure those and try it out.
 
Upvote 0
Thanks. A bunch more questions:
1. Are the folders created via file station in dsm, or do they have to be created via ssh?
2. Do I actually have to map the right side to the left side, or is the right side already created with the environment variables and they just need a corresponding target? My Paperless environment variables in docker are shown below.
3. If created via ssh, are they visible via file station once created?
4. Can it be set up to export documents to different folders? ie, a Business folder and a Personal folder. For my workflow outside of the paperless app, it'd be nice to be able to differentiate.
5. Do the folders have to be on Volume 1?
 

Attachments

  • 1610116929423.png
    1610116929423.png
    8 KB · Views: 113
Upvote 0
1. Are the folders created via file station in dsm, or do they have to be created via ssh?
You can create your folders using ssh or file station

2. Do I actually have to map the right side to the left side, or is the right side already created with the environment variables and they just need a corresponding target? My Paperless environment variables in docker are shown below.
Left side needs to be mapped to the right side. Ignore those parameters that are automatically generated also do not change those.

3. If created via ssh, are they visible via file station once created?
Not sure what you are referring to but data seen via ssh will be visible via file station (if they are hosted on yours user accessible volume)

4. Can it be set up to export documents to different folders? ie, a Business folder and a Personal folder. For my workflow outside of the paperless app, it'd be nice to be able to differentiate.
End files can be mapped to any folder on your NAS that you want. So map “media” folder where you want.

Do the folders have to be on Volume 1?
nope
 
Upvote 0
Hello! Jonas from Paperless-ng here.

Apparently there's some confusion about why I'm using docker-compose and why it's the recommended way to install and run paperless. Let me shed some light on this and hopefully clear up some of your questions.
  • The docker images as you see it in your interface contains Paperless and all of its direct dependencies. That includes all binaries that are directly required for paperless to start (!).
  • Paperless depends on an external service called redis. This is a message broker, and paperless uses that for inter process communication. Inside the image, there's a process that does document consumption and a process that serves the web page, and redis forwards messages between these processes (example: the webserver communicates "hey, I've got a new file, please process that in the background!" to the consumer).
  • Without redis, paperless does not work and you see that generic error that something went wrong when uploading documents (which is somewhat more clearer in recent versions).
  • redis is not distributed with the paperless docker image for the same reason that postgresql is not distributed with paperless: Some users wish to use their existing infrastructure, and these don't want to have two redis servers running on the same machine for no reason.
Now here's where this docker compose thing comes into play.
  • The docker compose files define multiple images that are supposed to be run together. The paperless docker compose files define two (three) services: the core paperless service, the redis service, and optionally the postgresql service.
  • Docker compose also creates a private network for these services, so that they can all communicate with each other, isolated from the rest of the machine. If you read into the compose files, you see some weird URL for redis ("redis://broker:6379"). This host name is generated by docker compose and only valid inside this private network.
  • Docker compose also defines where to mount volumes inside the container, so that data is not lost between restarts.
With docker compose, its pretty fail-proof to get this running. It's certainly possible without, but you have to take care of everything that would otherwise be done by docker compose.

That said, I don't have a NAS and don't know anything about these synology devices or their interface.
 
Upvote 0
Last edited by a moderator:
Apparently there's some confusion

If you are referring to my posts, it is because I'm easily confused ;). I'm just very green at docker. I see shiny things that I want to do but don't know how to do them properly. Working on educating myself some more and then I'll give it another shot. Thanks for all the info though.
 
Upvote 0
I'm already running redis docker for another service. Will that same redis docker support Paperless-ng.
As long as it's at least version 5, I don't see why not. You'll need to make sure that both containers run on a network that allows paperless to connect to redis. By default, paperless tries to connect to redis on localhost:6379; if that's not where redis is located, you need to provide the PAPERLESS_REDIS environment variable in the form "redis://<host>:<port>".
 
Upvote 0
Hi All,
if that can help, I have shared the way to have it working with synology docker
 
Upvote 0
Hi, I got all the docker images up and running, but as soon as I put PDFs in the consume folder, the worker process starts and then gets stuck. Looking into the logs reveals that there are missing access permissions with basically ALL of the paperless-ng folders (consume, data, media, export) in the docker folder on my DS. I could easily solve this by chmod everything to 777, but this is maybe not the best route to take. So: what are the minimum required access permissions for all paperless-ng folders and which ownerships should they have (root:root does not quite work, although Docker obviously runs with the root user)?

BTW, I followed the portainer install method posted by Naitakal: Setting up Paperless-ng on a Synology NAS using Portainer
 
Upvote 0
Last edited:
According the Dockerfile, the process is started with a user that has the userid 1000 and groupid 1000. Just chaning the owner to the userid 1000 and sticking with the groupid 100 for users should be fine though.

In the entrypoint script, you can see that you can actualy use container environment variables to configure the UID/GID for the user that starts paperless-ng:

USERMAP_UID and USERMAP_GID

Docker obviously runs with the root use
The engine, yes? containers: well, this depends on the container.
 
Upvote 0
Last edited:
I'm having issues creating the superuser with the command
docker-compose run --rm webserver createsuperuser

I can see the script running but when it gets to the step "Executing management command createsuper" there's a very long list of errors:

Executing management command createsuperuser
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26 , in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 200, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26 , in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/postgresql/bas e.py", line 187, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: password authentication failed for user "pape rless"



I'm sure it's a rookie move mistake I'm making, but appreciate anyone's help. I can see all three containers running in the docker window, and all of the install steps went fine as I walked through them in ssh.
-- post merged: --

Here's the 2nd half of the error messages that appear:
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute
return super().execute(*args, **options)
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 397, in execute
self.check_migrations()
File "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 486, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/usr/local/lib/python3.7/site-packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python3.7/site-packages/django/db/migrations/loader.py", line 53, in __init__
self.build_graph()
File "/usr/local/lib/python3.7/site-packages/django/db/migrations/loader.py", line 220, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/usr/local/lib/python3.7/site-packages/django/db/migrations/recorder.py", line 77, in applied_migrations
if self.has_table():
File "/usr/local/lib/python3.7/site-packages/django/db/migrations/recorder.py", line 55, in has_table
with self.connection.cursor() as cursor:
File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 259, in cursor
return self._cursor()
File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 235, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/usr/local/lib/python3.7/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 200, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL: password authentication failed for user "paperless"


Really appreciate any help. Note that I edited the config to specify port 8181, since I have portainer running on 8000 and 9000.
 
Upvote 0
Looks like a DB password problem from the log
Hi to all,

I got exactly the same error message on DSM7 with paperless-ng 1.5. Also tried and older versions and i got the same message. If anyone could help us, i would appreciate. Docker newbies here :)
 
Upvote 0
Last edited:
Hello
I just finished the setup of paperless on dsm7. It was done from the docker app.

Downloaded the paperless and redis container and configured it this way:
Screenshot 2021-10-18 at 09.03.56.png

Configuration of paperless:

Auto-restart
Screenshot 2021-10-18 at 09.09.03.png



Volumes. I created all this with the add folder button.
Screenshot 2021-10-18 at 09.06.53.png


Specify a local port:
Screenshot 2021-10-18 at 09.07.09.png


Environment:
The paperless_redis is mandatory, else it will default to docker localhost.
I created the paperless user with ssh, but in the documentation it looks like it's possible to create it with two variables: PAPERLESS_ADMIN_USER and PAPERLESS_ADMIN_PASSWORD. It looks like this is the most simple way.


Screenshot 2021-10-18 at 09.07.34.png



If you are not creating the superuser with environment variable, log in to the synology box with ssh and create the user/password.

Code:
ltg@Larss-MacBook-Air:~$ ssh [email protected]
[email protected]'s password:


Synology strongly advises you not to run commands as the root user, who has
the highest privileges on the system. Doing so may cause major damages
to the system. Please note that if you choose to proceed, all consequences are
at your own risk.


Could not chdir to home directory /var/services/homes/sjef: No such file or directory


sjef@lager:/$ sudo docker exec -it jonaswinkler-paperless-ng1 /bin/bash
Password:
root@jonaswinkler-paperless-ng1:/usr/src/paperless/src# python3 manage.py createsuperuser



Redis

It was not much to be done here:

Auto-restart

Screenshot 2021-10-18 at 09.09.57.png


And port settings.


Screenshot 2021-10-18 at 09.09.44.png



Since I run firewall on the box I opened port 8931 (paperless) and 6379 (redis)

Screenshot 2021-10-18 at 09.11.17.png


That´s all. Just had to document it. 😅
 
Upvote 0
Last edited by a moderator:
Hello

I am aware that this is not a Paperless_ngx forum. But maybe there is a professional who can answer my question:

I have Paperless_ngx installed on my Synology DS720+ in Docker. Everything works as it should.

Can someone explain to me how it works and at best the usefulness of the secret keys.

The following is written in the manual:
Hosting & Security
- PAPERLESS_SECRET_KEY=<key>
Paperless uses this to make session tokens. If you expose paperless on the internet, you need to change this, since the default secret is well known. Use any sequence of characters. The more, the better. You don't need to remember this. Just face-roll your keyboard.

Does this secret key increase security against unauthorised access if Paperless can be accessed externally via DDNS through the Synology proxy server?
 
Upvote 0

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top