Compare commits

...

8 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
1f9f2dff2f fix: update data-isowner when changing is ownership
fixes multiple ownership toggles
2025-12-23 14:29:28 -05:00
Barış Soner Uşaklı
59dd1ca607 chore: up body-parser 2025-12-19 17:38:19 -05:00
Julian Lam
d03137128c fix: bump 2factor 2025-12-18 11:39:31 -05:00
b2cc
da79582148 * Docker: add function to entrypoint to auto-install plugins on reboot (fixes #13735) (#13749)
* * Docker: add function to entrypoint to auto-install plugins on reboot (fixes #13735)

Added a function to install additional NodeBB plugins if specified. This fixes #13735

* fix: case on

---------

Co-authored-by: Jakub Bliźniuk <opliko.reg@protonmail.com>
2025-12-17 17:00:43 -05:00
Barış Uşaklı
550411fb58 test: change redis connection (#13844) 2025-12-17 16:56:07 -05:00
Barış Soner Uşaklı
1305faa838 test: add await to check tests 2025-12-17 14:35:35 -05:00
Barış Soner Uşaklı
d505301fa0 chore: up mentions 2025-12-17 13:02:43 -05:00
Barış Soner Uşaklı
9f8d50706e test: add back logs for failing test 2025-12-17 12:46:33 -05:00
6 changed files with 43 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ set_defaults() {
export SETUP="${SETUP:-}"
export PACKAGE_MANAGER="${PACKAGE_MANAGER:-npm}"
export OVERRIDE_UPDATE_LOCK="${OVERRIDE_UPDATE_LOCK:-false}"
export NODEBB_ADDITIONAL_PLUGINS="${NODEBB_ADDITIONAL_PLUGINS:-}"
}
# Function to check if a directory exists and is writable
@@ -172,6 +173,33 @@ debug_log() {
echo "DEBUG: $message"
}
install_additional_plugins() {
if [[ ! -z ${NODEBB_ADDITIONAL_PLUGINS} ]]; then
export START_BUILD="true"
for plugin in "${NODEBB_ADDITIONAL_PLUGINS[@]}"; do
echo "Installing additional plugin ${plugin}..."
case "$PACKAGE_MANAGER" in
yarn) yarn install || {
echo "Failed to install plugin ${plugin} with yarn"
exit 1
} ;;
npm) npm install || {
echo "Failed to install plugin ${plugin} with npm"
exit 1
} ;;
pnpm) pnpm install || {
echo "Failed to install plugin ${plugin} with pnpm"
exit 1
} ;;
*)
echo "Unknown package manager: $PACKAGE_MANAGER"
exit 1
;;
esac
done
fi
}
# Main function
main() {
set_defaults
@@ -182,12 +210,14 @@ main() {
debug_log "PACKAGE_MANAGER: $PACKAGE_MANAGER"
debug_log "CONFIG location: $CONFIG"
debug_log "START_BUILD: $START_BUILD"
debug_log "NODEBB_ADDITIONAL_PLUGINS: ${NODEBB_ADDITIONAL_PLUGINS}"
if [ -n "$SETUP" ]; then
start_setup_session "$CONFIG"
fi
if [ -f "$CONFIG" ]; then
install_additional_plugins
start_forum "$CONFIG" "$START_BUILD"
else
start_installation_session "$NODEBB_INIT_VERB" "$CONFIG"

View File

@@ -45,7 +45,7 @@
"autoprefixer": "10.4.22",
"bcryptjs": "3.0.3",
"benchpressjs": "2.5.5",
"body-parser": "2.2.0",
"body-parser": "2.2.1",
"bootbox": "6.0.4",
"bootstrap": "5.3.8",
"bootswatch": "5.3.8",
@@ -96,14 +96,14 @@
"mousetrap": "1.6.5",
"multer": "2.0.2",
"nconf": "0.13.0",
"nodebb-plugin-2factor": "7.6.0",
"nodebb-plugin-2factor": "7.6.1",
"nodebb-plugin-composer-default": "10.3.1",
"nodebb-plugin-dbsearch": "6.3.4",
"nodebb-plugin-emoji": "6.0.5",
"nodebb-plugin-emoji-android": "4.1.1",
"nodebb-plugin-link-preview": "2.1.5",
"nodebb-plugin-markdown": "13.2.2",
"nodebb-plugin-mentions": "4.8.3",
"nodebb-plugin-mentions": "4.8.4",
"nodebb-plugin-spam-be-gone": "2.3.2",
"nodebb-plugin-web-push": "0.7.6",
"nodebb-rewards-essentials": "1.0.2",
@@ -203,4 +203,4 @@
"url": "https://github.com/barisusakli"
}
]
}
}

View File

@@ -81,6 +81,7 @@ define('forum/groups/details', [
case 'toggleOwnership':
api[isOwner ? 'del' : 'put'](`/groups/${ajaxify.data.group.slug}/ownership/${uid}`, {}).then(() => {
ownerFlagEl.toggleClass('invisible');
userRow.attr('data-isowner', isOwner ? '0' : '1');
}).catch(alerts.error);
break;

View File

@@ -267,7 +267,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
if (!hasTid && options.cid) {
// New topic, have category announce it
activitypub.out.announce.topic(tid);
await activitypub.out.announce.topic(tid);
}
return { tid, count };

View File

@@ -58,13 +58,12 @@ connection.connect = async function (options) {
winston.error(err.stack);
reject(err);
});
cxn.on('ready', () => {
cxn.connect().then(() => {
// back-compat with node_redis
cxn.batch = cxn.multi;
resolve(cxn);
});
cxn.connect().then(() => {
winston.info('Connected to Redis successfully');
resolve(cxn);
}).catch((err) => {
winston.error('Error connecting to Redis:', err);
});

View File

@@ -164,8 +164,9 @@ describe('FEPs', () => {
});
pid = id;
({ activity } = await helpers.mocks.create(note));
console.log('before inbox create', activitypub._sent);
await activitypub.inbox.create({ body: activity });
console.log('after inbox create', activitypub._sent);
const activities = Array.from(activitypub._sent);
const test1 = activities.some((activity) => {
@@ -174,14 +175,13 @@ describe('FEPs', () => {
activity.object && activity.object.type === 'Create' &&
activity.object.object && activity.object.object.type === 'Note';
});
assert(test1);
const test2 = activities.some((activity) => {
[, activity] = activity;
return activity.type === 'Announce' &&
activity.object && activity.object.type === 'Note';
});
assert(test1 && test2);
assert(test2);
});
it('should federate out an Announce(Create(Note)) on reply', async () => {