Skip to content

Commit f1d313b

Browse files
authored
Version 2.1 as mkdocs (#33)
1 parent 2bb6de5 commit f1d313b

20 files changed

+430
-1949
lines changed

docs/img/setup/01-active-venv.png

-29.3 KB
Binary file not shown.

docs/img/setup/02-login-screen.png

-41.3 KB
Binary file not shown.
-69.6 KB
Binary file not shown.

docs/img/setup/linuxserver.io.png

-54.8 KB
Binary file not shown.

docs/img/setup/login.png

28.5 KB
Loading

docs/img/setup/papermerge-example.png

114 KB
Loading

docs/img/setup/papermerge-login.png

19.7 KB
Loading

docs/setup/backup.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Backup
22

3+
34
For peace of mind you always need to backup data. There three aspects of full backup:
45

56
* media directory
@@ -23,16 +24,16 @@ named "media" in of same directory where papermerge project was cloned.
2324

2425
!!! note
2526

26-
`media_dir` has two subfolders *docs* and *results*. :ref:`media_dir`/docs is place where
27+
`media_dir` has two subfolders *docs* and *results*. `media_dir`/docs is place where
2728
original documents are uploaded - it is the location you want to ensure is regularly backed up.
28-
Media directory configuration is pure Django webframework thing; in Django it is called [MEDIA_ROOT](https://docs.djangoproject.com/en/3.1/ref/settings/#media-root)
29+
Media directory configuration is pure Django web framework thing; in Django it is called <a href="https://docs.djangoproject.com/en/3.1/ref/settings/#media-root" class="external-link" target="_blank">MEDIA_ROOT </a>
2930

3031
!!! note
3132

3233
**Papermerge never overwrites or renames original uploads!**, in that sense, Papermerge is non-destructive :ref:`dms`. Every time you perform changes on document, like :ref:`moving pages around <page_management>` a new document version is created, thus keeping original document version intact.
3334

3435

35-
## Database
36+
### Database
3637

3738
Another important part of whole backup picture - is backing up your Papermerge database. In database, Papermerge stores information like user related information, documents' metadata, documents' tags etc.
3839

@@ -44,14 +45,14 @@ Another important part of whole backup picture - is backing up your Papermerge d
4445
Basically with database backup you can restore "the state" of Papermerge application.
4546

4647

47-
## Application Version
48+
### Application Version
4849

4950
If you want to restore Papermerge backups you need to know for what
5051
application version that backup is. This is why it is a good idea to append
5152
Papermerge application version to your backup archives.
5253

5354

54-
## Backup Utility
55+
### Backup Utility
5556

5657
Papermerge is shipped with backup command line utility. You can run it from project current directory:
5758

@@ -65,8 +66,9 @@ That command will backup all your documents with preserved directory structure (
6566

6667
provided backup utility does not backup tags and metadata information.
6768

69+
6870
In order to restore backup:
6971

7072
```console
7173
./manage.py restore <path-to-tar-file>
72-
```
74+
```

docs/setup/docker-compose.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Docker Compose
2+
3+
This section describes how to setup Papermerge and
4+
related services using docker compose.
5+
6+
Each docker compose file is used here in combination with one `environment file` usually
7+
named `.env`.
8+
9+
Make sure you have both `docker`.
10+
11+
This guide was tested with docker version 20.10.6 and
12+
docker-compose version 1.29.2.
13+
14+
15+
## Complete Stack in 2 minutes
16+
17+
18+
This setup installs complete {{ extra.project }} stack with all required services.
19+
20+
Save following `docker-compose.yml` file on your local computer.
21+
22+
23+
Next, create `.env` file with following content:
24+
25+
```console
26+
DB_USER=postgres
27+
DB_NAME=postgres
28+
DB_PASSWORD=postgres
29+
DB_HOST=db
30+
DB_PORT=5432
31+
32+
REDIS_HOST=redis
33+
REDIS_PORT=6379
34+
35+
SECRET_KEY=12345abcdxyz
36+
37+
SUPERUSER_USERNAME=admin
38+
39+
SUPERUSER_PASSWORD=admin
40+
```
41+
42+
Start {{ extra.project }} using following docker compose command:
43+
44+
```console
45+
docker compose -f docker-compose.yml --env-file .env up
46+
```
47+
48+
You can access |project| user interface using a web browser like Firefox.
49+
Open your web browser and point it to http://localhost:16000 address:
50+
51+
![papermerge login](../img/setup/papermerge-login.png)
52+
53+
Sign in using credentials configured with ``SUPERUSER_USERNAME`` and
54+
``SUPERUSER_PASSWORD`` options in ``.env`` file.
55+
56+
![papermerge example](../img/setup/papermerge-example.png)
57+
58+
59+
## Elastic Search
60+
61+
In previous section, {{ extra.project }} used xapian built in search engine. However, for
62+
production environments, a full fledged search engine like Elasticsearch makes more sense.
63+
64+
Here is setup which uses Elasticsearch:
65+
66+
```yaml
67+
version: '3.7'
68+
x-backend: &common # yaml anchor definition
69+
image: papermerge/papermerge:2.1.9
70+
volumes:
71+
- media_root:/app/media
72+
environment:
73+
- PAPERMERGE__MAIN__SECRET_KEY=12345SKK
74+
- DJANGO_SUPERUSER_PASSWORD=1234
75+
- PAPERMERGE__REDIS__HOST=redis
76+
- PAPERMERGE__REDIS__PORT=6379
77+
- PAPERMERGE__DATABASE__TYPE=postgres
78+
- PAPERMERGE__DATABASE__USER=postgres
79+
- PAPERMERGE__DATABASE__NAME=postgres
80+
- PAPERMERGE__DATABASE__PASSWORD=postgres
81+
- PAPERMERGE__DATABASE__HOST=db
82+
- PAPERMERGE__DATABASE__PORT=5432
83+
- PAPERMERGE__SEARCH__ENGINE=elastic7
84+
- PAPERMERGE__SEARCH__URL=http://es:9200
85+
services:
86+
backend:
87+
<<: *common
88+
worker:
89+
<<: *common
90+
command: worker
91+
redis:
92+
image: redis:6
93+
ports:
94+
- '6379:6379'
95+
db:
96+
image: postgres:14.4
97+
volumes:
98+
- postgres_data:/var/lib/postgresql/data/
99+
environment:
100+
- POSTGRES_USER=postgres
101+
- POSTGRES_DB=postgres
102+
- POSTGRES_PASSWORD=postgres
103+
es:
104+
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.2
105+
environment:
106+
- discovery.type=single-node
107+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
108+
ports:
109+
- 9200:9200
110+
- 9300:9300
111+
volumes:
112+
media_root:
113+
postgres_data:
114+
```

0 commit comments

Comments
 (0)