From 1b4e0c87260b4d2c5eb9b0b0f954480182ff2a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 8 Feb 2025 19:51:52 -0500 Subject: [PATCH 1/6] fix: delete from payload instead of setting null --- src/api/topics.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api/topics.js b/src/api/topics.js index 56977c9674..b9066786a0 100644 --- a/src/api/topics.js +++ b/src/api/topics.js @@ -59,7 +59,8 @@ topicsAPI.create = async function (caller, data) { throw new Error('[[error:invalid-data]]'); } - const payload = { ...data, tid: null }; + const payload = { ...data }; + delete payload.tid; payload.tags = payload.tags || []; apiHelpers.setDefaultPostData(caller, payload); const isScheduling = parseInt(data.timestamp, 10) > payload.timestamp; @@ -97,7 +98,8 @@ topicsAPI.reply = async function (caller, data) { if (!data || !data.tid || (meta.config.minimumPostLength !== 0 && !data.content)) { throw new Error('[[error:invalid-data]]'); } - const payload = { ...data, pid: null }; + const payload = { ...data }; + delete payload.pid; apiHelpers.setDefaultPostData(caller, payload); await meta.blacklist.test(caller.ip); From 6d73c13495ff3fddde43a9c540cf1834b3ba7c57 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Sun, 9 Feb 2025 01:01:54 +0000 Subject: [PATCH 2/6] chore: incrementing version number - v4.0.3 --- install/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/package.json b/install/package.json index cd00e60504..af56f2d072 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "4.0.2", + "version": "4.0.3", "homepage": "https://www.nodebb.org", "repository": { "type": "git", @@ -200,4 +200,4 @@ "url": "https://github.com/barisusakli" } ] -} +} \ No newline at end of file From 123e16358d402e466fc785dfc7eeeb69d48f1c4a Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Sun, 9 Feb 2025 01:01:55 +0000 Subject: [PATCH 3/6] chore: update changelog for v4.0.3 --- CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2808bece2b..783b4dd082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,53 @@ +#### v4.0.3 (2025-02-09) + +##### Chores + +* up harmony (2ee0cda2) +* update persona (b6b76639) +* bump persona to fix theme description issue (cd88cce0) +* up harmony (a01bf73e) +* forgot to remove bad code (865c09a5) +* up harmony (c3f8222f) +* up harmony (f07f3801) +* up harmony (67a789ad) +* up themes (c1c5cc6e) +* up themes (b2b0ed35) +* up peace (55eedcbe) +* up themes (38a21e29) +* up harmony (58e551fe) +* incrementing version number - v4.0.2 (73fe5fcf) +* update changelog for v4.0.2 (75588ffe) +* incrementing version number - v4.0.1 (a461b758) +* incrementing version number - v4.0.0 (c1eaee45) + +##### Bug Fixes + +* delete from payload instead of setting null (1b4e0c87) +* regression :tmi: (f5328aa8) +* #13139, payload.version can be null (bfe6d9d8) +* tidChanged (1f8e2f9a) +* #13135, tids are not numeric for ap topics (d687f081) +* handle cases where url passed to mime does not pass because url contained a query string (5baa46d0) +* isDraft logic, closes #13119 (21156673) +* path on windows, #13119 (36063d1f) +* #13115, prevent messages from getting duplicated (1ff8e1e4) +* #13115, limit bodyLength length (8e9fdb5f) + +##### Other Changes + +* remove log (a8e7bf35) + +##### Refactors + +* events are returned inside post objects (3ab22c2c) +* move dropdown search inputs into dropdown (b993be6f) +* server.destroy (72091ec4) +* remove deprecated methods (265e44f0) + +##### Tests + +* search endpoint with start & end (c1b630d4) + #### v4.0.2 (2025-02-02) ##### Chores From 040584f035547153454cf075e9ae673196ccb492 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 7 Feb 2025 08:20:27 -0500 Subject: [PATCH 4/6] fix: missing actor on some local activities when federating out --- src/api/activitypub.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/api/activitypub.js b/src/api/activitypub.js index 76abcc9c51..3b078a7862 100644 --- a/src/api/activitypub.js +++ b/src/api/activitypub.js @@ -168,6 +168,7 @@ activitypubApi.create.privateNote = enabledCheck(async (caller, { messageObj }) const payload = { id: `${object.id}#activity/create/${Date.now()}`, type: 'Create', + actor: object.attributedTo, to: object.to, object, }; @@ -186,6 +187,7 @@ activitypubApi.update.profile = enabledCheck(async (caller, { uid }) => { await activitypub.send('uid', caller.uid, targets, { id: `${object.id}#activity/update/${Date.now()}`, type: 'Update', + actor: object.id, to: [activitypub._constants.publicAddress], cc: [], object, @@ -201,6 +203,7 @@ activitypubApi.update.category = enabledCheck(async (caller, { cid }) => { await activitypub.send('cid', cid, targets, { id: `${object.id}#activity/update/${Date.now()}`, type: 'Update', + actor: object.id, to: [activitypub._constants.publicAddress], cc: [], object, @@ -227,6 +230,7 @@ activitypubApi.update.note = enabledCheck(async (caller, { post }) => { const payload = { id: `${object.id}#activity/update/${post.edited || Date.now()}`, type: 'Update', + actor: object.attributedTo, to, cc, object, @@ -251,6 +255,7 @@ activitypubApi.update.privateNote = enabledCheck(async (caller, { messageObj }) const payload = { id: `${object.id}#activity/create/${Date.now()}`, type: 'Update', + actor: object.attributedTo, to, object, }; @@ -280,6 +285,7 @@ activitypubApi.delete.note = enabledCheck(async (caller, { pid }) => { const payload = { id: `${id}#activity/delete/${Date.now()}`, type: 'Delete', + actor: object.attributedTo, to, cc, object: id, @@ -334,6 +340,7 @@ activitypubApi.announce.note = enabledCheck(async (caller, { tid }) => { await activitypub.send('uid', caller.uid, Array.from(targets), { id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/${Date.now()}`, type: 'Announce', + actor: `${nconf.get('url')}/uid/${caller.uid}`, to, cc, object: pid, @@ -380,6 +387,7 @@ activitypubApi.flag = enabledCheck(async (caller, flag) => { await activitypub.send('uid', caller.uid, reportedIds, { id: `${nconf.get('url')}/${flag.type}/${encodeURIComponent(flag.targetId)}#activity/flag/${caller.uid}`, type: 'Flag', + actor: `${nconf.get('url')}/uid/${caller.uid}`, object: reportedIds, content: reason, }); @@ -426,6 +434,7 @@ activitypubApi.undo.flag = enabledCheck(async (caller, flag) => { await activitypub.send('uid', caller.uid, reportedIds, { id: `${nconf.get('url')}/${flag.type}/${encodeURIComponent(flag.targetId)}#activity/undo:flag/${caller.uid}/${Date.now()}`, type: 'Undo', + actor: `${nconf.get('url')}/uid/${caller.uid}`, object: { id: `${nconf.get('url')}/${flag.type}/${encodeURIComponent(flag.targetId)}#activity/flag/${caller.uid}`, actor: `${nconf.get('url')}/uid/${caller.uid}`, From 5cbf3dd7eaaa3b7e703c3a7b9852b4606471ce28 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sat, 8 Feb 2025 20:28:17 -0500 Subject: [PATCH 5/6] fix: sanity-check the id when mocking a post --- src/activitypub/mocks.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index 3ea4c03494..493655c272 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -155,7 +155,10 @@ Mocks.post = async (objects) => { await activitypub.actors.assert(Array.from(actorIds)); const posts = await Promise.all(objects.map(async (object) => { - if (!activitypub._constants.acceptedPostTypes.includes(object.type)) { + if ( + !activitypub._constants.acceptedPostTypes.includes(object.type) || + !activitypub.helpers.isUri(object.id) // sanity-check the id + ) { return null; } From d1f78295bab9a1baf20e906819aac1a13ee73af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 8 Feb 2025 20:57:56 -0500 Subject: [PATCH 6/6] chore: up harmony --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index af56f2d072..d5c3521217 100644 --- a/install/package.json +++ b/install/package.json @@ -108,7 +108,7 @@ "nodebb-plugin-spam-be-gone": "2.3.0", "nodebb-plugin-web-push": "0.7.2", "nodebb-rewards-essentials": "1.0.0", - "nodebb-theme-harmony": "2.0.18", + "nodebb-theme-harmony": "2.0.19", "nodebb-theme-lavender": "7.1.17", "nodebb-theme-peace": "2.2.38", "nodebb-theme-persona": "14.0.14",