diff --git a/README.md b/README.md index bcd62f4..0b3dee9 100644 --- a/README.md +++ b/README.md @@ -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 `/view/`. + +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 @@ -104,6 +112,7 @@ Or use the web-based initializer at `http://: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 diff --git a/core/settings.py b/core/settings.py index f0feeb1..3016044 100644 --- a/core/settings.py +++ b/core/settings.py @@ -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"] diff --git a/plannotations/paperless_api.py b/plannotations/paperless_api.py index e52ce7c..ddec122 100644 --- a/plannotations/paperless_api.py +++ b/plannotations/paperless_api.py @@ -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__) @@ -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 ` authorization header