From 3d677f67d845cf6e74271681e76d3cb806036483 Mon Sep 17 00:00:00 2001
From: default
Date: Tue, 21 Jan 2025 14:33:21 +0100
Subject: Added more Markdown (contributed by an-im-dugud).
---
format.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 46 insertions(+), 1 deletion(-)
diff --git a/format.c b/format.c
index 52ed3ec..e5934b8 100644
--- a/format.c
+++ b/format.c
@@ -92,6 +92,8 @@ static xs_str *format_line(const char *line, xs_list **attach)
"`[^`]+`" "|"
"~~[^~]+~~" "|"
"\\*\\*?\\*?[^\\*]+\\*?\\*?\\*" "|"
+ "_[^_]+_" "|" //anzu
+ "__[^_]+__" "|" //anzu
"!\\[[^]]+\\]\\([^\\)]+\\)" "|"
"\\[[^]]+\\]\\([^\\)]+\\)" "|"
"[a-z]+:/" "/[^[:space:]]+" "|"
@@ -127,6 +129,20 @@ static xs_str *format_line(const char *line, xs_list **attach)
xs *s2 = xs_fmt("%s", s1);
s = xs_str_cat(s, s2);
}
+ //anzu - begin
+ else
+ if (xs_startswith(v, "__")) {
+ xs *s1 = xs_strip_chars_i(xs_dup(v), "_");
+ xs *s2 = xs_fmt("%s", s1);
+ s = xs_str_cat(s, s2);
+ }
+ else
+ if (xs_startswith(v, "_")) {
+ xs *s1 = xs_strip_chars_i(xs_dup(v), "_");
+ xs *s2 = xs_fmt("%s", s1);
+ s = xs_str_cat(s, s2);
+ }
+ //anzu - end
else
if (xs_startswith(v, "~~")) {
xs *s1 = xs_strip_chars_i(xs_dup(v), "~");
@@ -303,6 +319,31 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag
continue;
}
+ //anzu - begin
+ // h1 reserved for snac?
+ if (xs_startswith(ss, "# ")) {
+ ss = xs_strip_i(xs_crop_i(ss, 2, 0));
+ s = xs_str_cat(s, "
");
+ s = xs_str_cat(s, ss);
+ s = xs_str_cat(s, "
");
+ continue;
+ }
+ if (xs_startswith(ss, "## ")) {
+ ss = xs_strip_i(xs_crop_i(ss, 3, 0));
+ s = xs_str_cat(s, "");
+ s = xs_str_cat(s, ss);
+ s = xs_str_cat(s, "
");
+ continue;
+ }
+ if (xs_startswith(ss, "### ")) {
+ ss = xs_strip_i(xs_crop_i(ss, 4, 0));
+ s = xs_str_cat(s, "");
+ s = xs_str_cat(s, ss);
+ s = xs_str_cat(s, "
");
+ continue;
+ }
+ //anzu - end
+
if (xs_startswith(ss, ">")) {
/* delete the > and subsequent spaces */
ss = xs_strip_i(xs_crop_i(ss, 1, 0));
@@ -336,6 +377,8 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag
s = xs_replace_i(s, "
", "
");
s = xs_replace_i(s, "
", "
");
s = xs_replace_i(s, "
", "");
+ s = xs_replace_i(s, "
", ""); //anzu ???
+ s = xs_replace_i(s, "
", ""); //anzu ???
{
/* traditional emoticons */
@@ -378,7 +421,9 @@ xs_str *not_really_markdown(const char *content, xs_list **attach, xs_list **tag
const char *valid_tags[] = {
"a", "p", "br", "br/", "blockquote", "ul", "ol", "li", "cite", "small",
- "span", "i", "b", "u", "s", "pre", "code", "em", "strong", "hr", "img", "del", "bdi", NULL
+ "span", "i", "b", "u", "s", "pre", "code", "em", "strong", "hr", "img", "del", "bdi",
+ "h2","h3", //anzu
+ NULL
};
xs_str *sanitize(const char *content)
--
cgit v1.2.3
From ece1b9ed165f524d50c3be20e477a7c9b25e19a4 Mon Sep 17 00:00:00 2001
From: default
Date: Tue, 21 Jan 2025 14:34:29 +0100
Subject: Updated RELEASE_NOTES.
---
RELEASE_NOTES.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index cc6866a..1e8c221 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -26,6 +26,8 @@ If the `SNAC_BASEDIR` environment variable is defined and set to the base direct
Fixed a bug in the generation of the top page (contributed by an-im-dugud).
+Added support for Markdown headers and underlining (contributed by an-im-dugud).
+
## 2.68
Fixed regression in link verification code (contributed by nowster).
--
cgit v1.2.3
From 468b7a38885152cb2d61537abfdd9a4cda9c847a Mon Sep 17 00:00:00 2001
From: default
Date: Tue, 21 Jan 2025 14:39:49 +0100
Subject: Updated documentation.
---
doc/snac.5 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/doc/snac.5 b/doc/snac.5
index be7bfd7..3550995 100644
--- a/doc/snac.5
+++ b/doc/snac.5
@@ -24,9 +24,11 @@ A special subset of Markdown is allowed, including:
.It bold
**text between two pairs of asterisks**
.It italic
-*text between a pair of asterisks*
+*text between a pair of asterisks* or _between a pair of underscores_
.It strikethrough text
~~text between a pair of tildes~~
+.It underlined text
+__text between two pairs of underscores__
.It code
Text `between backticks` is formatted as code.
.Bd -literal
@@ -53,6 +55,9 @@ Horizonal rules can be inserted by typing three minus symbols
alone in a line.
.It quoted text
Lines starting with >.
+.It headers
+One, two or three # at the beginning of a line plus a space plus
+some text are converted to HTML headers.
.It user mentions
Strings in the format @user@host are requested using the Webfinger
protocol and converted to links and mentions if something reasonable
--
cgit v1.2.3
From 2611c816b01d3999ffcf3b59c0d3592908054950 Mon Sep 17 00:00:00 2001
From: default
Date: Tue, 21 Jan 2025 20:25:50 +0100
Subject: Hide the 'relay' user from the greeting list.
---
httpd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/httpd.c b/httpd.c
index c13402b..e0a36b6 100644
--- a/httpd.c
+++ b/httpd.c
@@ -138,7 +138,7 @@ static xs_str *greeting_html(void)
while (xs_list_iter(&p, &uid)) {
snac user;
- if (user_open(&user, uid)) {
+ if (strcmp(uid, "relay") && user_open(&user, uid)) {
xs_html_add(ul,
xs_html_tag("li",
xs_html_tag("a",
--
cgit v1.2.3
From e6baf0d45c9b55f0b1532a0069b59ca06ac8fbc1 Mon Sep 17 00:00:00 2001
From: Paul Martin
Date: Tue, 21 Jan 2025 23:26:50 +0000
Subject: When reading timeline in ascending order, return results in
descending order
---
mastoapi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mastoapi.c b/mastoapi.c
index 3250a20..54b4333 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1453,7 +1453,10 @@ xs_list *mastoapi_timeline(snac *user, const xs_dict *args, const char *index_fn
xs *st = mastoapi_status(user, msg);
if (st != NULL) {
- out = xs_list_append(out, st);
+ if (ascending)
+ out = xs_list_insert(out, 0, st);
+ else
+ out = xs_list_append(out, st);
cnt++;
}
--
cgit v1.2.3
From 7cd62dd25b92780ef4e1ad42c1d2e9ba69c931e9 Mon Sep 17 00:00:00 2001
From: default
Date: Wed, 22 Jan 2025 05:29:25 +0100
Subject: Don't account as such announces by our own relay.
---
activitypub.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/activitypub.c b/activitypub.c
index 8b44dc8..5517bf4 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2274,11 +2274,16 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
xs *who_o = NULL;
if (valid_status(actor_request(snac, who, &who_o))) {
- if (timeline_admire(snac, object, actor, 0) == HTTP_STATUS_CREATED)
- snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
- else
- snac_log(snac, xs_fmt("repeated 'Announce' from %s to %s",
- actor, object));
+ /* don't account as such announces by our own relay */
+ xs *this_relay = xs_fmt("%s/relay", srv_baseurl);
+
+ if (strcmp(actor, this_relay) != 0) {
+ if (timeline_admire(snac, object, actor, 0) == HTTP_STATUS_CREATED)
+ snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
+ else
+ snac_log(snac, xs_fmt("repeated 'Announce' from %s to %s",
+ actor, object));
+ }
/* distribute the post with the actor as 'proxy' */
list_distribute(snac, actor, a_msg);
--
cgit v1.2.3
From 070a9db3d72e0961dca45c7e65aa9fc4532aba73 Mon Sep 17 00:00:00 2001
From: default
Date: Wed, 22 Jan 2025 05:59:15 +0100
Subject: Also accept 'Update' activities for 'Application' objects.
---
activitypub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/activitypub.c b/activitypub.c
index 5517bf4..8fa29c9 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2302,7 +2302,7 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
}
else
if (strcmp(type, "Update") == 0) { /** **/
- if (xs_match(utype, "Person|Service")) { /** **/
+ if (xs_match(utype, "Person|Service|Application")) { /** **/
actor_add(actor, xs_dict_get(msg, "object"));
timeline_touch(snac);
--
cgit v1.2.3
From f5e75f90058665f413e1535e8001ec5b4e0a7a19 Mon Sep 17 00:00:00 2001
From: default
Date: Wed, 22 Jan 2025 06:28:46 +0100
Subject: Updated RELEASE_NOTES.
---
RELEASE_NOTES.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 1e8c221..eb5c3b2 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -18,7 +18,7 @@ Fixed broken NetBSD build (missing dependency in Makefile.NetBSD).
The user profile can now include longitude and latitude data for your current location.
-Mastodon API: implemented limit= on notification fetches (contributed by nowster), implemented faster min_id handling (contributed by nowster), obey the quiet public visibility set for posts.
+Mastodon API: implemented limit= on notification fetches (contributed by nowster), implemented faster min_id handling (contributed by nowster), obey the quiet public visibility set for posts, other timeline improvements (contributed by nowster).
Reduced RSA key size for new users from 4096 to 2048. This will be friendlier to smaller machines, and everybody else out there is using 2048.
--
cgit v1.2.3
From ac663a6b4dd5eee1fb3c676524b8e141eb2529ed Mon Sep 17 00:00:00 2001
From: default
Date: Wed, 22 Jan 2025 10:07:39 +0100
Subject: Moved followed hashtag check to its own function.
---
activitypub.c | 60 +++++++++++++++++++++++++++++++++++------------------------
1 file changed, 36 insertions(+), 24 deletions(-)
diff --git a/activitypub.c b/activitypub.c
index 8fa29c9..b505fbb 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -587,6 +587,40 @@ int is_msg_from_private_user(const xs_dict *msg)
}
+int followed_hashtag_check(snac *user, const xs_dict *msg)
+/* returns true if this message contains a hashtag followed by me */
+{
+ const xs_list *fw_tags = xs_dict_get(user->config, "followed_hashtags");
+
+ if (xs_is_list(fw_tags)) {
+ const xs_list *tags_in_msg = xs_dict_get(msg, "tag");
+
+ if (xs_is_list(tags_in_msg)) {
+ const xs_dict *te;
+
+ /* iterate the tags in the message */
+ xs_list_foreach(tags_in_msg, te) {
+ if (xs_is_dict(te)) {
+ const char *type = xs_dict_get(te, "type");
+ const char *name = xs_dict_get(te, "name");
+
+ if (xs_is_string(type) && xs_is_string(name)) {
+ if (strcmp(type, "Hashtag") == 0) {
+ xs *lc_name = xs_utf8_to_lower(name);
+
+ if (xs_list_in(fw_tags, lc_name) != -1)
+ return 1;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
+
int is_msg_for_me(snac *snac, const xs_dict *c_msg)
/* checks if this message is for me */
{
@@ -708,30 +742,8 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
}
/* does this message contain a tag we are following? */
- const xs_list *fw_tags = xs_dict_get(snac->config, "followed_hashtags");
- if (pub_msg && xs_type(fw_tags) == XSTYPE_LIST) {
- const xs_list *tags_in_msg = xs_dict_get(msg, "tag");
- if (xs_type(tags_in_msg) == XSTYPE_LIST) {
- const xs_dict *te;
-
- /* iterate the tags in the message */
- xs_list_foreach(tags_in_msg, te) {
- if (xs_type(te) == XSTYPE_DICT) {
- const char *type = xs_dict_get(te, "type");
- const char *name = xs_dict_get(te, "name");
-
- if (xs_type(type) == XSTYPE_STRING && xs_type(name) == XSTYPE_STRING) {
- if (strcmp(type, "Hashtag") == 0) {
- xs *lc_name = xs_utf8_to_lower(name);
-
- if (xs_list_in(fw_tags, lc_name) != -1)
- return 7;
- }
- }
- }
- }
- }
- }
+ if (pub_msg && followed_hashtag_check(snac, msg))
+ return 7;
return 0;
}
--
cgit v1.2.3
From a51c996efe0e41334523602271740b6e6b2501c0 Mon Sep 17 00:00:00 2001
From: default
Date: Wed, 22 Jan 2025 10:38:01 +0100
Subject: More tweaks to hashtag following code.
---
activitypub.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/activitypub.c b/activitypub.c
index b505fbb..86599ee 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -636,19 +636,32 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
if (xs_match(type, "Like|Announce|EmojiReact")) {
const char *object = xs_dict_get(c_msg, "object");
- if (xs_type(object) == XSTYPE_DICT)
+ if (xs_is_dict(object))
object = xs_dict_get(object, "id");
/* bad object id? reject */
- if (xs_type(object) != XSTYPE_STRING)
+ if (!xs_is_string(object))
return 0;
/* if it's about one of our posts, accept it */
if (xs_startswith(object, snac->actor))
return 2;
- /* if it's by someone we don't follow, reject */
- return following_check(snac, actor);
+ /* if it's by someone we follow, accept it */
+ if (following_check(snac, actor))
+ return 1;
+
+ /* do we follow any hashtag? */
+ if (xs_is_list(xs_dict_get(snac->config, "followed_hashtags"))) {
+ xs *obj = NULL;
+
+ /* if the admired object contains any followed hashtag, accept it */
+ if (valid_status(object_get(object, &obj)) &&
+ followed_hashtag_check(snac, obj))
+ return 7;
+ }
+
+ return 0;
}
/* if it's an Undo, it must be from someone related to us */
--
cgit v1.2.3
From 0cae9a520c7f3d72ecdabf1fac066f1da943605c Mon Sep 17 00:00:00 2001
From: default
Date: Wed, 22 Jan 2025 15:23:37 +0100
Subject: Minor visual tweak.
---
html.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/html.c b/html.c
index 2a02d18..fcf2904 100644
--- a/html.c
+++ b/html.c
@@ -1855,22 +1855,20 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
}
}
}
- else
+
if (strcmp(type, "Note") == 0) {
- if (level == 0) {
- /* is the parent not here? */
- const char *parent = get_in_reply_to(msg);
+ /* is the parent not here? */
+ const char *parent = get_in_reply_to(msg);
- if (user && !xs_is_null(parent) && *parent && !timeline_here(user, parent)) {
- xs_html_add(post_header,
- xs_html_tag("div",
- xs_html_attr("class", "snac-origin"),
- xs_html_text(L("in reply to")),
- xs_html_text(" "),
- xs_html_tag("a",
- xs_html_attr("href", parent),
- xs_html_text("»"))));
- }
+ if (user && !xs_is_null(parent) && *parent && !timeline_here(user, parent)) {
+ xs_html_add(post_header,
+ xs_html_tag("div",
+ xs_html_attr("class", "snac-origin"),
+ xs_html_text(L("in reply to")),
+ xs_html_text(" "),
+ xs_html_tag("a",
+ xs_html_attr("href", parent),
+ xs_html_text("»"))));
}
}
--
cgit v1.2.3
From ced28f931928fac1ded3e435868c3ca204b9280b Mon Sep 17 00:00:00 2001
From: default
Date: Wed, 22 Jan 2025 15:31:20 +0100
Subject: Updated documentation.
---
doc/snac.8 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/snac.8 b/doc/snac.8
index c0e1af5..1ca5d4b 100644
--- a/doc/snac.8
+++ b/doc/snac.8
@@ -599,7 +599,7 @@ they will received as if they were for them.
Example:
.Bd -literal -offset indent
snac adduser $SNAC_BASEDIR relay # only needed once
-snac follow $SNAC_BASEDIR relay https://fedi-relay.gyptazy.com/actor
+snac follow $SNAC_BASEDIR relay https://relay.example.com/actor
.Ed
.Pp
Please take note that subscribing to relays can increase the traffic towards your instance
--
cgit v1.2.3
From 0f0e33f5f6f49b9b4055b24761559b11c80da45e Mon Sep 17 00:00:00 2001
From: default
Date: Wed, 22 Jan 2025 15:47:21 +0100
Subject: Fixed bug in 'in reply to' checking.
---
html.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/html.c b/html.c
index fcf2904..a15bd06 100644
--- a/html.c
+++ b/html.c
@@ -1856,19 +1856,23 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
}
}
- if (strcmp(type, "Note") == 0) {
+ if (user && strcmp(type, "Note") == 0) {
/* is the parent not here? */
const char *parent = get_in_reply_to(msg);
- if (user && !xs_is_null(parent) && *parent && !timeline_here(user, parent)) {
- xs_html_add(post_header,
- xs_html_tag("div",
- xs_html_attr("class", "snac-origin"),
- xs_html_text(L("in reply to")),
- xs_html_text(" "),
- xs_html_tag("a",
- xs_html_attr("href", parent),
- xs_html_text("»"))));
+ if (!xs_is_null(parent) && *parent) {
+ xs *md5 = xs_md5_hex(parent, strlen(parent));
+
+ if (!timeline_here(user, md5)) {
+ xs_html_add(post_header,
+ xs_html_tag("div",
+ xs_html_attr("class", "snac-origin"),
+ xs_html_text(L("in reply to")),
+ xs_html_text(" "),
+ xs_html_tag("a",
+ xs_html_attr("href", parent),
+ xs_html_text("»"))));
+ }
}
}
--
cgit v1.2.3
From fda3057dc86d859a0935d2f5fce890d114db5861 Mon Sep 17 00:00:00 2001
From: default
Date: Thu, 23 Jan 2025 14:39:59 +0100
Subject: More hashtag following tweaks.
---
activitypub.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/activitypub.c b/activitypub.c
index 86599ee..cade0d9 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -621,6 +621,36 @@ int followed_hashtag_check(snac *user, const xs_dict *msg)
}
+void followed_hashtag_distribute(const xs_dict *msg)
+/* distribute this post to all users following the included hashtags */
+{
+ const char *id = xs_dict_get(msg, "id");
+ const xs_list *tags_in_msg = xs_dict_get(msg, "tag");
+
+ if (!xs_is_string(id) || !xs_is_list(tags_in_msg) || xs_list_len(tags_in_msg) == 0)
+ return;
+
+ srv_debug(1, xs_fmt("followed_hashtag_distribute check for %s", id));
+
+ xs *users = user_list();
+ const char *uid;
+
+ xs_list_foreach(users, uid) {
+ snac user;
+
+ if (user_open(&user, uid)) {
+ if (followed_hashtag_check(&user, msg)) {
+ timeline_add(&user, id, msg);
+
+ snac_log(&user, xs_fmt("followed hashtag in %s", id));
+ }
+
+ user_free(&user);
+ }
+ }
+}
+
+
int is_msg_for_me(snac *snac, const xs_dict *c_msg)
/* checks if this message is for me */
{
@@ -2313,6 +2343,9 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
/* distribute the post with the actor as 'proxy' */
list_distribute(snac, actor, a_msg);
+ /* distribute the post to users following these hashtags */
+ followed_hashtag_distribute(a_msg);
+
do_notify = 1;
}
else
--
cgit v1.2.3
From 0394f835e45975b9a82b0b009de2471e55a6cb7a Mon Sep 17 00:00:00 2001
From: default
Date: Thu, 23 Jan 2025 20:09:22 +0100
Subject: Added some code to supress repeated notifications.
---
html.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/html.c b/html.c
index a15bd06..d325063 100644
--- a/html.c
+++ b/html.c
@@ -2967,9 +2967,12 @@ xs_str *html_notifications(snac *user, int skip, int show)
xs_html_attr("class", "snac-posts"));
xs_html_add(body, posts);
- xs_list *p = n_list;
+ xs_set rep;
+ xs_set_init(&rep);
+
const xs_str *v;
- while (xs_list_iter(&p, &v)) {
+
+ xs_list_foreach(n_list, v) {
xs *noti = notify_get(user, v);
if (noti == NULL)
@@ -2990,6 +2993,9 @@ xs_str *html_notifications(snac *user, int skip, int show)
object_get(id, &obj);
+ if (xs_set_add(&rep, xs_dict_get(obj, "id")) != 1)
+ continue;
+
const char *actor_id = xs_dict_get(noti, "actor");
xs *actor = NULL;
@@ -3103,6 +3109,8 @@ xs_str *html_notifications(snac *user, int skip, int show)
}
}
+ xs_set_free(&rep);
+
if (noti_new == NULL && noti_seen == NULL)
xs_html_add(body,
xs_html_tag("h2",
--
cgit v1.2.3
From cc1d4258e5dea493605c3f09b8279e28dd61e727 Mon Sep 17 00:00:00 2001
From: shtrophic
Date: Thu, 23 Jan 2025 20:15:23 +0100
Subject: Sandbox fixes
- allow reading `/dev/urandom` as it is shown as a failed syscall when
tracing
- resolve `/etc/ssl/cert.pem` in case it is a symlink
---
sandbox.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sandbox.c b/sandbox.c
index cbe0043..0fc48ad 100644
--- a/sandbox.c
+++ b/sandbox.c
@@ -71,15 +71,22 @@ LL_BEGIN(sbox_enter_linux_, const char* basedir, const char *address, int smail)
LANDLOCK_ACCESS_FS_REFER_COMPAT,
s = LANDLOCK_ACCESS_FS_MAKE_SOCK,
x = LANDLOCK_ACCESS_FS_EXECUTE;
+ char *resolved_path = NULL;
LL_PATH(basedir, rf|rd|w|c);
LL_PATH("/tmp", rf|rd|w|c);
#ifndef WITHOUT_SHM
LL_PATH("/dev/shm", rf|w|c );
#endif
+ LL_PATH("/dev/urandom", rf );
LL_PATH("/etc/resolv.conf", rf );
LL_PATH("/etc/hosts", rf );
- LL_PATH("/etc/ssl", rf );
+ LL_PATH("/etc/ssl", rf|rd );
+ if ((resolved_path = realpath("/etc/ssl/cert.pem", NULL))) {
+ /* some distros like cert.pem to be a symlink */
+ LL_PATH(resolved_path, rf );
+ free(resolved_path);
+ }
LL_PATH("/usr/share/zoneinfo", rf );
if (mtime("/etc/pki") > 0)
--
cgit v1.2.3
From 95d32cbe7cfbb0321ac37b57ada23b6c268815e2 Mon Sep 17 00:00:00 2001
From: default
Date: Thu, 23 Jan 2025 20:17:38 +0100
Subject: Improved notify repetition code.
---
html.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/html.c b/html.c
index d325063..3fd1e4b 100644
--- a/html.c
+++ b/html.c
@@ -2993,7 +2993,9 @@ xs_str *html_notifications(snac *user, int skip, int show)
object_get(id, &obj);
- if (xs_set_add(&rep, xs_dict_get(obj, "id")) != 1)
+ const char *msg_id = NULL;
+
+ if (xs_is_dict(obj) && (msg_id = xs_dict_get(obj, "id")) && xs_set_add(&rep, msg_id) != 1)
continue;
const char *actor_id = xs_dict_get(noti, "actor");
--
cgit v1.2.3
From 3f3419d8dbc810fe3ba8c8b1b33b7cb529900c61 Mon Sep 17 00:00:00 2001
From: default
Date: Fri, 24 Jan 2025 08:12:57 +0100
Subject: Updated documentation.
---
doc/snac.8 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/doc/snac.8 b/doc/snac.8
index 1ca5d4b..e228495 100644
--- a/doc/snac.8
+++ b/doc/snac.8
@@ -591,10 +591,10 @@ instance can subscribe to LitePub (Pleroma-style) Fediverse Relays. Doing this i
visibility and allows following hashtags. To do this, you must create a special user named
relay and, from it, follow the relay actor(s) like you do with regular actor URLs. This
special user will start receiving boosts from the relay server of posts from other instances
-also following it. It any other user of the same
+also following it. If any other user of the same
.Nm
instance follows any of the hashtags included in these boosted posts coming from the relay,
-they will received as if they were for them.
+they will be received as if they were for them.
.Pp
Example:
.Bd -literal -offset indent
@@ -602,6 +602,9 @@ snac adduser $SNAC_BASEDIR relay # only needed once
snac follow $SNAC_BASEDIR relay https://relay.example.com/actor
.Ed
.Pp
+Users on your instance do NOT need to follow the local relay user to benefit from following
+hashtags.
+.Pp
Please take note that subscribing to relays can increase the traffic towards your instance
significantly. In any case, lowering the "Maximum days to keep posts" value for the relay
special user is recommended (e.g. setting to just 1 day).
--
cgit v1.2.3
From a72d09ae56b927b872540fec5c85881496c23e27 Mon Sep 17 00:00:00 2001
From: default
Date: Fri, 24 Jan 2025 08:23:18 +0100
Subject: Set value 'purge_days' to 1 by default when creating the relay user.
---
utils.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/utils.c b/utils.c
index a5b1124..fd00e99 100644
--- a/utils.c
+++ b/utils.c
@@ -318,6 +318,10 @@ int adduser(const char *uid)
mkdirx(d);
}
+ /* add a specially short data retention time for the relay */
+ if (strcmp(uid, "relay") == 0)
+ config = xs_dict_set(config, "purge_days", xs_stock(1));
+
xs *cfn = xs_fmt("%s/user.json", basedir);
if ((f = fopen(cfn, "w")) == NULL) {
--
cgit v1.2.3
From 4140d46faf6571f729da807ca857733d1b72a397 Mon Sep 17 00:00:00 2001
From: default
Date: Fri, 24 Jan 2025 10:14:57 +0100
Subject: Updated RELEASE_NOTES.
---
RELEASE_NOTES.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index eb5c3b2..23a2a17 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,6 +1,6 @@
# Release Notes
-## UNRELEASED
+## 2.69 "Yin/Yang of Love"
Added support for subscribing to LitePub (Pleroma-style) Fediverse Relays like e.g. https://fedi-relay.gyptazy.com to improve federation. See `snac(8)` (the Administrator Manual) for more information on how to use this feature.
--
cgit v1.2.3
From 1cb7b37ae6adb01444ea1466d8884aacca10ebd8 Mon Sep 17 00:00:00 2001
From: default
Date: Fri, 24 Jan 2025 10:15:17 +0100
Subject: Version 2.69 RELEASED.
---
snac.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/snac.h b/snac.h
index 65ece5d..c0e512d 100644
--- a/snac.h
+++ b/snac.h
@@ -1,7 +1,7 @@
/* snac - A simple, minimalistic ActivityPub instance */
/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */
-#define VERSION "2.69-dev"
+#define VERSION "2.69"
#define USER_AGENT "snac/" VERSION
--
cgit v1.2.3