Compare commits

...

5 Commits

Author SHA1 Message Date
shamoon
df5af5c8ad
Fix: correctly handle dict data with webhook (#9674) 2025-04-16 00:07:08 -07:00
shamoon
67a97ffc4d
Documentation: expound email config explanation 2025-04-15 07:52:53 -07:00
github-actions[bot]
45b39f36d6
Documentation: Add v2.15.2 changelog (#9660) 2025-04-14 14:08:18 -07:00
shamoon
a339853bc5
Merge branch 'dev' 2025-04-14 13:25:39 -07:00
shamoon
d956269d5f
Update faq 2025-04-10 20:25:16 -07:00
5 changed files with 61 additions and 38 deletions

View File

@ -1,5 +1,28 @@
# Changelog # Changelog
## paperless-ngx 2.15.2
### Bug Fixes
- Fix: Adds better handling during folder checking/creation/permissions for non-root [@stumpylog](https://github.com/stumpylog) ([#9616](https://github.com/paperless-ngx/paperless-ngx/pull/9616))
- Fix: Explicitly set the HOME environment to resolve issues running as root with database certificates [@stumpylog](https://github.com/stumpylog) ([#9643](https://github.com/paperless-ngx/paperless-ngx/pull/9643))
- Fix: prevent self-linking when bulk edit doc link [@shamoon](https://github.com/shamoon) ([#9629](https://github.com/paperless-ngx/paperless-ngx/pull/9629))
### Dependencies
- Chore: Bump celery to 5.5.1 [@hannesortmeier](https://github.com/hannesortmeier) ([#9642](https://github.com/paperless-ngx/paperless-ngx/pull/9642))
### All App Changes
<details>
<summary>4 changes</summary>
- Tweak: consistently use created date when displaying doc in list [@shamoon](https://github.com/shamoon) ([#9651](https://github.com/paperless-ngx/paperless-ngx/pull/9651))
- Fix: Adds better handling during folder checking/creation/permissions for non-root [@stumpylog](https://github.com/stumpylog) ([#9616](https://github.com/paperless-ngx/paperless-ngx/pull/9616))
- Fix: Explicitly set the HOME environment to resolve issues running as root with database certificates [@stumpylog](https://github.com/stumpylog) ([#9643](https://github.com/paperless-ngx/paperless-ngx/pull/9643))
- Fix: prevent self-linking when bulk edit doc link [@shamoon](https://github.com/shamoon) ([#9629](https://github.com/paperless-ngx/paperless-ngx/pull/9629))
</details>
## paperless-ngx 2.15.1 ## paperless-ngx 2.15.1
### Bug Fixes ### Bug Fixes

View File

@ -1670,7 +1670,7 @@ started by the container.
## Email sending ## Email sending
Setting an SMTP server for the backend will allow you to reset your Setting an SMTP server for the backend will allow you to use the Email workflow action, send documents from the UI as well as reset your
password. All of these options come from their similarly-named [Django settings](https://docs.djangoproject.com/en/4.2/ref/settings/#email-host) password. All of these options come from their similarly-named [Django settings](https://docs.djangoproject.com/en/4.2/ref/settings/#email-host)
#### [`PAPERLESS_EMAIL_HOST=<str>`](#PAPERLESS_EMAIL_HOST) {#PAPERLESS_EMAIL_HOST} #### [`PAPERLESS_EMAIL_HOST=<str>`](#PAPERLESS_EMAIL_HOST) {#PAPERLESS_EMAIL_HOST}

View File

@ -112,30 +112,6 @@ able to run paperless, you're a bit on your own. If you can't run the
docker image, the documentation has instructions for bare metal docker image, the documentation has instructions for bare metal
installs. installs.
## _How do I proxy this with NGINX?_
**A:** See [the wiki](https://github.com/paperless-ngx/paperless-ngx/wiki/Using-a-Reverse-Proxy-with-Paperless-ngx#nginx).
## _How do I get WebSocket support with Apache mod_wsgi_?
**A:** `mod_wsgi` by itself does not support ASGI. Paperless will
continue to work with WSGI, but certain features such as status
notifications about document consumption won't be available.
If you want to continue using `mod_wsgi`, you will have to run an
ASGI-enabled web server as well that processes WebSocket connections,
and configure Apache to redirect WebSocket connections to this server.
Multiple options for ASGI servers exist:
- `gunicorn` with `uvicorn` as the worker implementation (the default
of paperless)
- `daphne` as a standalone server, which is the reference
implementation for ASGI.
- `uvicorn` as a standalone server
You may also find the [Django documentation](https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/) on ASGI
useful to review.
## _What about the Redis licensing change and using one of the open source forks_? ## _What about the Redis licensing change and using one of the open source forks_?
Currently (October 2024), forks of Redis such as Valkey or Redirect are not officially supported by our upstream Currently (October 2024), forks of Redis such as Valkey or Redirect are not officially supported by our upstream

View File

@ -622,20 +622,30 @@ def send_webhook(
as_json: bool = False, as_json: bool = False,
): ):
try: try:
post_args = {
"url": url,
"headers": headers,
"files": files,
}
if as_json: if as_json:
httpx.post( post_args["json"] = data
url, elif isinstance(data, dict):
json=data, post_args["data"] = data
files=files,
headers=headers,
).raise_for_status()
else: else:
httpx.post( post_args["content"] = data
url,
content=data, httpx.post(
files=files, **post_args,
headers=headers, ).raise_for_status()
).raise_for_status() logger.info(
f"Webhook sent to {url}",
)
except Exception as e:
logger.error(
f"Failed attempt sending webhook to {url}: {e}",
)
raise e
logger.info( logger.info(
f"Webhook sent to {url}", f"Webhook sent to {url}",
) )

View File

@ -2614,7 +2614,7 @@ class TestWorkflows(
) )
mock_post.assert_called_once_with( mock_post.assert_called_once_with(
"http://paperless-ngx.com", url="http://paperless-ngx.com",
content="Test message", content="Test message",
headers={}, headers={},
files=None, files=None,
@ -2623,6 +2623,20 @@ class TestWorkflows(
expected_str = "Webhook sent to http://paperless-ngx.com" expected_str = "Webhook sent to http://paperless-ngx.com"
self.assertIn(expected_str, cm.output[0]) self.assertIn(expected_str, cm.output[0])
# with dict
send_webhook(
url="http://paperless-ngx.com",
data={"message": "Test message"},
headers={},
files=None,
)
mock_post.assert_called_with(
url="http://paperless-ngx.com",
data={"message": "Test message"},
headers={},
files=None,
)
@mock.patch("httpx.post") @mock.patch("httpx.post")
def test_workflow_webhook_send_webhook_retry(self, mock_http): def test_workflow_webhook_send_webhook_retry(self, mock_http):
mock_http.return_value.raise_for_status = mock.Mock( mock_http.return_value.raise_for_status = mock.Mock(