aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorviolette p. <vi@violette.town>2025-12-09 04:58:13 +0100
committergrunfink <grunfink@comam.es>2025-12-09 04:58:13 +0100
commit4102a6a7ac7ab7c651fe0b03358148e8d15418cc (patch)
tree9f8fe1daed0f20bf6f1c78318347851f86c12cb9
parentc741c3078e4dcc0fcdda15f9082a87788383b61d (diff)
make webpush use our notification server vkey instead of a random, ill-formated
key (necessary for some client notifications, such as moshidon)
-rw-r--r--doc/snac.82
-rw-r--r--mastoapi.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/doc/snac.8 b/doc/snac.8
index a6d925d..0dc0769 100644
--- a/doc/snac.8
+++ b/doc/snac.8
@@ -294,6 +294,8 @@ The URL to a favicon. If it's not set, the default one is used instead.
The maximum number of days an instance is considered down after continuous failed
outgoing messages (default: 15). Anyway, whenever any incoming activity from a
failed instance is detected, this counter is reset for it.
+.It Ic vkey
+Public vapid key. Used for notification on some client.
.El
.Pp
You must restart the server to make effective these changes.
diff --git a/mastoapi.c b/mastoapi.c
index acb95a0..9aa29d8 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -3044,7 +3044,10 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
xs *app = xs_dict_new();
xs *id = xs_replace_i(tid(0), ".", "");
xs *csec = random_str();
- xs *vkey = random_str();
+ char *vkey = (char *)xs_dict_get(srv_config, "vkey");
+ if (vkey == NULL)
+ vkey = random_str();
+
xs *cid = NULL;
/* pick a non-existent random cid */