From 48c1c7594d10b817cb0fe5eedc76759b0c8b0c01 Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Mon, 27 Mar 2023 18:10:57 +0000 Subject: [PATCH 1/8] chore: incrementing version number - v2.8.10 --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 92c5410c53..bec6b4c399 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "2.8.9", + "version": "2.8.10", "homepage": "http://www.nodebb.org", "repository": { "type": "git", From 188ec62f9ab15be4624728fe451d2a6a211879fa Mon Sep 17 00:00:00 2001 From: Misty Release Bot Date: Mon, 27 Mar 2023 18:10:57 +0000 Subject: [PATCH 2/8] chore: update changelog for v2.8.10 --- CHANGELOG.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6feab404d2..e07cc91229 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,51 @@ +#### v2.8.10 (2023-03-27) + +##### Chores + +* up composer-default (e9a8e195) +* incrementing version number - v2.8.9 (57f14e41) +* update changelog for v2.8.9 (18b2150e) +* incrementing version number - v2.8.8 (b331b942) +* incrementing version number - v2.8.7 (3f8248d6) +* incrementing version number - v2.8.6 (af6ce447) +* incrementing version number - v2.8.5 (bff5ce2d) +* incrementing version number - v2.8.4 (a46b2bbc) +* incrementing version number - v2.8.3 (c20b20a7) +* incrementing version number - v2.8.2 (050e43f8) +* incrementing version number - v2.8.1 (727f879e) +* incrementing version number - v2.8.0 (8e77673d) +* incrementing version number - v2.7.0 (96cc0617) +* incrementing version number - v2.6.1 (7e52a7a5) +* incrementing version number - v2.6.0 (e7fcf482) +* incrementing version number - v2.5.8 (dec0e7de) +* incrementing version number - v2.5.7 (5836bf4a) +* incrementing version number - v2.5.6 (c7bd7dbf) +* incrementing version number - v2.5.5 (3509ed94) +* incrementing version number - v2.5.4 (e83260ca) +* incrementing version number - v2.5.3 (7e922936) +* incrementing version number - v2.5.2 (babcd17e) +* incrementing version number - v2.5.1 (ce3aa950) +* incrementing version number - v2.5.0 (01d276cb) +* incrementing version number - v2.4.5 (dd3e1a28) +* incrementing version number - v2.4.4 (d5525c87) +* incrementing version number - v2.4.3 (9c647c6c) +* incrementing version number - v2.4.2 (3aa7b855) +* incrementing version number - v2.4.1 (60cbd148) +* incrementing version number - v2.4.0 (4834cde3) +* incrementing version number - v2.3.1 (d2425942) +* incrementing version number - v2.3.0 (046ea120) + +##### Bug Fixes + +* #11403, remove loader.js crash counter logic (830f142b) +* don't crash if event name is not a string (37b48b82) +* closes #11173, move cache clear code (c2961ad4) + +##### Other Changes + +* fix arrow (1aff9cad) +* whitespace (894f392b) + #### v2.8.9 (2023-03-19) ##### Chores From 7397873db355d5449e9de3e6ca39b47b4cb34813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 27 Mar 2023 22:16:41 -0400 Subject: [PATCH 3/8] fix: fire action:user.online on user login --- src/controllers/authentication.js | 2 +- src/user/online.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 82dc6b1660..bb6e6bf49f 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -383,7 +383,7 @@ authenticationController.onSuccessfulLogin = async function (req, uid) { }), user.auth.addSession(uid, req.sessionID), user.updateLastOnlineTime(uid), - user.updateOnlineUsers(uid), + user.onUserOnline(uid, Date.now()), analytics.increment('logins'), db.incrObjectFieldBy('global', 'loginCount', 1), ]); diff --git a/src/user/online.js b/src/user/online.js index ffba4c9a94..b7c6b9d45a 100644 --- a/src/user/online.js +++ b/src/user/online.js @@ -27,9 +27,13 @@ module.exports = function (User) { if (now - parseInt(userOnlineTime, 10) < 300000) { return; } - await db.sortedSetAdd('users:online', now, uid); + await User.onUserOnline(uid, now); topics.pushUnreadCount(uid); - plugins.hooks.fire('action:user.online', { uid: uid, timestamp: now }); + }; + + User.onUserOnline = async (uid, timestamp) => { + await db.sortedSetAdd('users:online', timestamp, uid); + plugins.hooks.fire('action:user.online', { uid, timestamp }); }; User.isOnline = async function (uid) { From 4d2d76897a02e7068ab74c81d17a2febfae8bfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 28 Mar 2023 08:08:59 -0400 Subject: [PATCH 4/8] fix: don't crash on objects with toString property --- src/socket.io/index.js | 77 +++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/src/socket.io/index.js b/src/socket.io/index.js index 30e4e23581..963267ed9a 100644 --- a/src/socket.io/index.js +++ b/src/socket.io/index.js @@ -112,48 +112,49 @@ async function onMessage(socket, payload) { return winston.warn('[socket.io] Empty payload'); } - const eventName = payload.data[0]; + let eventName = payload.data[0]; const params = typeof payload.data[1] === 'function' ? {} : payload.data[1]; const callback = typeof payload.data[payload.data.length - 1] === 'function' ? payload.data[payload.data.length - 1] : function () {}; - if (!eventName) { - return winston.warn('[socket.io] Empty method name'); - } - - if (typeof eventName !== 'string') { - const escapedName = validator.escape(String(eventName)); - return callback({ message: `[[error:invalid-event, ${escapedName}]]` }); - } - - const parts = eventName.split('.'); - const namespace = parts[0]; - const methodToCall = parts.reduce((prev, cur) => { - if (prev !== null && prev[cur] && (!prev.hasOwnProperty || prev.hasOwnProperty(cur))) { - return prev[cur]; - } - return null; - }, Namespaces); - - if (!methodToCall || typeof methodToCall !== 'function') { - if (process.env.NODE_ENV === 'development') { - winston.warn(`[socket.io] Unrecognized message: ${eventName}`); - } - const escapedName = validator.escape(String(eventName)); - return callback({ message: `[[error:invalid-event, ${escapedName}]]` }); - } - - socket.previousEvents = socket.previousEvents || []; - socket.previousEvents.push(eventName); - if (socket.previousEvents.length > 20) { - socket.previousEvents.shift(); - } - - if (!eventName.startsWith('admin.') && ratelimit.isFlooding(socket)) { - winston.warn(`[socket.io] Too many emits! Disconnecting uid : ${socket.uid}. Events : ${socket.previousEvents}`); - return socket.disconnect(); - } - try { + if (!eventName) { + return winston.warn('[socket.io] Empty method name'); + } + + if (typeof eventName !== 'string') { + eventName = typeof eventName; + const escapedName = validator.escape(eventName); + return callback({ message: `[[error:invalid-event, ${escapedName}]]` }); + } + + const parts = eventName.split('.'); + const namespace = parts[0]; + const methodToCall = parts.reduce((prev, cur) => { + if (prev !== null && prev[cur] && (!prev.hasOwnProperty || prev.hasOwnProperty(cur))) { + return prev[cur]; + } + return null; + }, Namespaces); + + if (!methodToCall || typeof methodToCall !== 'function') { + if (process.env.NODE_ENV === 'development') { + winston.warn(`[socket.io] Unrecognized message: ${eventName}`); + } + const escapedName = validator.escape(String(eventName)); + return callback({ message: `[[error:invalid-event, ${escapedName}]]` }); + } + + socket.previousEvents = socket.previousEvents || []; + socket.previousEvents.push(eventName); + if (socket.previousEvents.length > 20) { + socket.previousEvents.shift(); + } + + if (!eventName.startsWith('admin.') && ratelimit.isFlooding(socket)) { + winston.warn(`[socket.io] Too many emits! Disconnecting uid : ${socket.uid}. Events : ${socket.previousEvents}`); + return socket.disconnect(); + } + await checkMaintenance(socket); await validateSession(socket, '[[error:revalidate-failure]]'); From e0b20658029bcec26528881d9ea14b2793f05305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 28 Mar 2023 08:15:42 -0400 Subject: [PATCH 5/8] test: update socket.io test --- test/socket.io.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/socket.io.js b/test/socket.io.js index 110258a0de..3628e3b0d0 100644 --- a/test/socket.io.js +++ b/test/socket.io.js @@ -110,8 +110,7 @@ describe('socket.io', () => { it('should return error for invalid eventName type', (done) => { const eventName = ['topics.loadMoreTags']; io.emit(eventName, (err) => { - const eventAsString = String(eventName); - assert.strictEqual(err.message, `[[error:invalid-event, ${eventAsString}]]`); + assert.strictEqual(err.message, `[[error:invalid-event, object]]`); done(); }); }); From 67055006df503f0d4ac32f2302f31caa4899dde3 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 29 Mar 2023 10:31:39 -0400 Subject: [PATCH 6/8] docs: update readme with new screenshot and updated copy for Harmony --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d06bc0362a..a45ba24ab8 100644 --- a/README.md +++ b/README.md @@ -24,17 +24,14 @@ NodeBB's theming engine is highly flexible and does not restrict your design cho [![](http://i.imgur.com/LmHtPhob.png)](http://i.imgur.com/LmHtPho.png) [![](http://i.imgur.com/paiJPJkb.jpg)](http://i.imgur.com/paiJPJk.jpg) -Our minimalist "Persona" theme gets you going right away, no coding experience required. - -[![](http://i.imgur.com/HwNEXGu.png)](http://i.imgur.com/HwNEXGu.png) -[![](http://i.imgur.com/II1byYs.png)](http://i.imgur.com/II1byYs.png) - +Our minimalist "Harmony" theme gets you going right away, no coding experience required. +![Rendering of a NodeBB install on desktop and mobile devices](https://user-images.githubusercontent.com/923011/228570420-2a4db745-b20d-474a-a571-1b59259508ef.png) ## How can I follow along/contribute? * If you are a developer, feel free to check out the source and submit pull requests. We also have a wide array of [plugins](http://community.nodebb.org/category/7/nodebb-plugins) which would be a great starting point for learning the codebase. -* If you are a designer, [NodeBB needs themes](http://community.nodebb.org/category/10/nodebb-themes)! NodeBB's theming system allows extension of the base templates as well as styling via LESS or CSS. NodeBB's base theme utilizes [Bootstrap 3](http://getbootstrap.com/) but themes can choose to use a different framework altogether. +* If you are a designer, [NodeBB needs themes](http://community.nodebb.org/category/10/nodebb-themes)! NodeBB's theming system allows extension of the base templates as well as styling via SCSS or CSS. NodeBB's base theme utilizes [Bootstrap 5](http://getbootstrap.com/) as a frontend toolkit. * If you know languages other than English you can help us translate NodeBB. We use [Transifex](https://explore.transifex.com/nodebb/nodebb/) for internationalization. * Please don't forget to **like**, **follow**, and **star our repo**! Join our growing [community](http://community.nodebb.org) to keep up to date with the latest NodeBB development. @@ -42,7 +39,7 @@ Our minimalist "Persona" theme gets you going right away, no coding experience r NodeBB requires the following software to be installed: -* A version of Node.js at least 12 or greater ([installation/upgrade instructions](https://github.com/nodesource/distributions)) +* A version of Node.js at least 16 or greater ([installation/upgrade instructions](https://github.com/nodesource/distributions)) * MongoDB, version 3.6 or greater **or** Redis, version 2.8.9 or greater * If you are using [clustering](https://docs.nodebb.org/configuring/scaling/) you need Redis installed and configured. * nginx, version 1.3.13 or greater (**only if** intending to use nginx to proxy requests to a NodeBB) @@ -76,10 +73,10 @@ Interested in a sublicense agreement for use of NodeBB in a non-free/restrictive * [Demo](https://try.nodebb.org) * [Developer Community](http://community.nodebb.org) -* [Documentation & Installation Instructions](http://docs.nodebb.org) +* [Documentation & Installation Instructions](https://docs.nodebb.org) * [Help translate NodeBB](https://explore.transifex.com/nodebb/nodebb/) -* [NodeBB Blog](http://blog.nodebb.org) -* [Premium Hosting for NodeBB](http://www.nodebb.org/ "NodeBB") +* [NodeBB Blog](https://nodebb.org/blog) +* [Premium Hosting for NodeBB](https://www.nodebb.org/ "NodeBB") * Unofficial IRC community – channel `#nodebb` on Libera.chat * [Follow us on Twitter](http://www.twitter.com/NodeBB/ "NodeBB Twitter") * [Like us on Facebook](http://www.facebook.com/NodeBB/ "NodeBB Facebook") From c33730530e4f3a5474447b975cba4e6b7c7660c0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 29 Mar 2023 10:32:05 -0400 Subject: [PATCH 7/8] Revert "docs: update readme with new screenshot and updated copy for Harmony" This reverts commit 67055006df503f0d4ac32f2302f31caa4899dde3. --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a45ba24ab8..d06bc0362a 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,17 @@ NodeBB's theming engine is highly flexible and does not restrict your design cho [![](http://i.imgur.com/LmHtPhob.png)](http://i.imgur.com/LmHtPho.png) [![](http://i.imgur.com/paiJPJkb.jpg)](http://i.imgur.com/paiJPJk.jpg) -Our minimalist "Harmony" theme gets you going right away, no coding experience required. +Our minimalist "Persona" theme gets you going right away, no coding experience required. + +[![](http://i.imgur.com/HwNEXGu.png)](http://i.imgur.com/HwNEXGu.png) +[![](http://i.imgur.com/II1byYs.png)](http://i.imgur.com/II1byYs.png) + -![Rendering of a NodeBB install on desktop and mobile devices](https://user-images.githubusercontent.com/923011/228570420-2a4db745-b20d-474a-a571-1b59259508ef.png) ## How can I follow along/contribute? * If you are a developer, feel free to check out the source and submit pull requests. We also have a wide array of [plugins](http://community.nodebb.org/category/7/nodebb-plugins) which would be a great starting point for learning the codebase. -* If you are a designer, [NodeBB needs themes](http://community.nodebb.org/category/10/nodebb-themes)! NodeBB's theming system allows extension of the base templates as well as styling via SCSS or CSS. NodeBB's base theme utilizes [Bootstrap 5](http://getbootstrap.com/) as a frontend toolkit. +* If you are a designer, [NodeBB needs themes](http://community.nodebb.org/category/10/nodebb-themes)! NodeBB's theming system allows extension of the base templates as well as styling via LESS or CSS. NodeBB's base theme utilizes [Bootstrap 3](http://getbootstrap.com/) but themes can choose to use a different framework altogether. * If you know languages other than English you can help us translate NodeBB. We use [Transifex](https://explore.transifex.com/nodebb/nodebb/) for internationalization. * Please don't forget to **like**, **follow**, and **star our repo**! Join our growing [community](http://community.nodebb.org) to keep up to date with the latest NodeBB development. @@ -39,7 +42,7 @@ Our minimalist "Harmony" theme gets you going right away, no coding experience r NodeBB requires the following software to be installed: -* A version of Node.js at least 16 or greater ([installation/upgrade instructions](https://github.com/nodesource/distributions)) +* A version of Node.js at least 12 or greater ([installation/upgrade instructions](https://github.com/nodesource/distributions)) * MongoDB, version 3.6 or greater **or** Redis, version 2.8.9 or greater * If you are using [clustering](https://docs.nodebb.org/configuring/scaling/) you need Redis installed and configured. * nginx, version 1.3.13 or greater (**only if** intending to use nginx to proxy requests to a NodeBB) @@ -73,10 +76,10 @@ Interested in a sublicense agreement for use of NodeBB in a non-free/restrictive * [Demo](https://try.nodebb.org) * [Developer Community](http://community.nodebb.org) -* [Documentation & Installation Instructions](https://docs.nodebb.org) +* [Documentation & Installation Instructions](http://docs.nodebb.org) * [Help translate NodeBB](https://explore.transifex.com/nodebb/nodebb/) -* [NodeBB Blog](https://nodebb.org/blog) -* [Premium Hosting for NodeBB](https://www.nodebb.org/ "NodeBB") +* [NodeBB Blog](http://blog.nodebb.org) +* [Premium Hosting for NodeBB](http://www.nodebb.org/ "NodeBB") * Unofficial IRC community – channel `#nodebb` on Libera.chat * [Follow us on Twitter](http://www.twitter.com/NodeBB/ "NodeBB Twitter") * [Like us on Facebook](http://www.facebook.com/NodeBB/ "NodeBB Facebook") From c27567289f9937abd4abe6960a9b6e387cf68331 Mon Sep 17 00:00:00 2001 From: Opliko Date: Thu, 16 Mar 2023 17:48:03 +0100 Subject: [PATCH 8/8] ci: publish to ghcr instead of docker hub --- .github/workflows/docker.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a901a4ee46..5cf00383ef 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,13 +13,14 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel permissions: contents: read + packages: write jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -32,14 +33,15 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Docker meta id: meta uses: docker/metadata-action@v4 with: - images: nodebb/docker + images: ghcr.io/${{ github.repository }} tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}}