diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2024-09-24 05:54:25 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2024-09-24 05:57:41 +0200 |
commit | 7dd3a4d86defff9c0960f7e39481215603ac85b9 (patch) | |
tree | b5874ed3481d5dd4862ec5c113ac4566e6ad8129 | |
parent | 196f1088232c1b1d725762f0c6379992fd510fd2 (diff) | |
download | pleroma-7dd3a4d86defff9c0960f7e39481215603ac85b9.tar.gz pleroma-7dd3a4d86defff9c0960f7e39481215603ac85b9.zip |
push: make vapid_config fallback to empty array
2024-09-24T03:53:27.770757+00:00 NightmareMoon pleroma: path=/notice/AmJcSqyeyij4W70K36 [error] Preloading for /notice/AmJcSqyeyij4W70K36 failed.
** (FunctionClauseError) no function clause matching in Keyword.get/3
(elixir 1.15.8) lib/keyword.ex:388: Keyword.get(nil, :public_key, nil)
(pleroma 2.7.0-3067-g9b76dbd4-dev-lanodan2) lib/pleroma/web/mastodon_api/views/instance_view.ex:262: Pleroma.Web.MastodonAPI.InstanceView.pleroma_configuration/1
(pleroma 2.7.0-3067-g9b76dbd4-dev-lanodan2) lib/pleroma/web/mastodon_api/views/instance_view.ex:45: Pleroma.Web.MastodonAPI.InstanceView.render/2
(pleroma 2.7.0-3067-g9b76dbd4-dev-lanodan2) lib/pleroma/web/preload/providers/instance.ex:28: Pleroma.Web.Preload.Providers.Instance.build_info_tag/1
(pleroma 2.7.0-3067-g9b76dbd4-dev-lanodan2) lib/pleroma/web/preload/providers/instance.ex:21: Pleroma.Web.Preload.Providers.Instance.generate_terms/1
(pleroma 2.7.0-3067-g9b76dbd4-dev-lanodan2) lib/pleroma/web/preload.ex:13: anonymous fn/3 in Pleroma.Web.Preload.build_tags/2
-rw-r--r-- | changelog.d/vapid_keyword_fallback.fix | 1 | ||||
-rw-r--r-- | lib/pleroma/web/push.ex | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/vapid_keyword_fallback.fix b/changelog.d/vapid_keyword_fallback.fix new file mode 100644 index 000000000..aa48f8938 --- /dev/null +++ b/changelog.d/vapid_keyword_fallback.fix @@ -0,0 +1 @@ +Make vapid_config return empty array, fixing preloading for instances without push notifications configured
\ No newline at end of file diff --git a/lib/pleroma/web/push.ex b/lib/pleroma/web/push.ex index 6d777142e..77f77f88e 100644 --- a/lib/pleroma/web/push.ex +++ b/lib/pleroma/web/push.ex @@ -20,7 +20,7 @@ defmodule Pleroma.Web.Push do end def vapid_config do - Application.get_env(:web_push_encryption, :vapid_details, nil) + Application.get_env(:web_push_encryption, :vapid_details, []) end def enabled, do: match?([subject: _, public_key: _, private_key: _], vapid_config()) |