Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ Paperless Annotations addresses this by allowing highlights, text, and drawings
- [uv](https://github.com/astral-sh/uv) package manager
- [npm](https://www.npmjs.com/) to install EmbedPDF

## Usage

Once setup, go to `<your paperless annotations url>/view/<your paperless document id>`.

e.g. if the link to your document in paperless is `http://my-paperless/view/93` then to annotate it, go to `http://my-paperless-annotations/view/93`.

If you've enabled `ENABLE_AUTO_UPDATE_LINKS`, links will be added to each document in your paperless archive (after `UPDATE_INTERVAL_MINS`.)

## Setup


Expand Down Expand Up @@ -104,6 +112,7 @@ Or use the web-based initializer at `http://<your-server-address>:8000/initializ
- `UPDATE_INTERVAL_MINS` - Interval (minutes) for automatic link updates (default: `60`)
- `CUSTOM_FIELD_NAME` - Name of the custom field in Paperless-ngx used to store document links (Default: `Annotations`)
- `ANNO_STORAGE` - Annotation storage backend: `paperless_notes` or `database` (default: `paperless_notes`)
- `VERIFY_SSL` - disable SSL verification for connections to your Paperless-ngx instance. Work-around for installations with self-signed certificates.


## Auto-update document links
Expand Down
1 change: 1 addition & 0 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def _split_csv(value):
UPDATE_INTERVAL_MINS = int(os.environ.get("UPDATE_INTERVAL_MINS", "60"))
ANNO_SERIALIZER = os.environ.get("ANNO_SERIALIZER", "85gj")
ANNO_STORAGE = os.environ.get("ANNO_STORAGE", "paperless_notes").lower()
VERIFY_SSL = _is_true(os.environ.get("VERIFY_SSL", "true"))

with open(BASE_DIR / "pyproject.toml", "rb") as f:
VERSION = tomllib.load(f)["project"]["version"]
4 changes: 4 additions & 0 deletions plannotations/paperless_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from typing import Any, Dict, List, Optional, Generator
import requests
from pydantic import BaseModel, Field
from core.settings import (
VERIFY_SSL,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -85,6 +88,7 @@ def __init__(self, base_url: str, api_token: str, timeout: int = 10) -> None:
self.base_url = base_url.rstrip("/")
self.timeout = timeout
self.session = requests.Session()
self.session.verify = VERIFY_SSL
if not api_token:
raise PaperlessAPIError("paperless api_token is required")
# Paperless-ngx uses `Token <token>` authorization header
Expand Down