diff --git a/install/docker/entrypoint.sh b/install/docker/entrypoint.sh index db2a637ee0..a38aa4196f 100755 --- a/install/docker/entrypoint.sh +++ b/install/docker/entrypoint.sh @@ -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" diff --git a/install/package.json b/install/package.json index 681c22aed3..7d2957ec93 100644 --- a/install/package.json +++ b/install/package.json @@ -203,4 +203,4 @@ "url": "https://github.com/barisusakli" } ] -} \ No newline at end of file +} diff --git a/public/src/client/groups/details.js b/public/src/client/groups/details.js index 8dde2e3eab..9ed57cd6ed 100644 --- a/public/src/client/groups/details.js +++ b/public/src/client/groups/details.js @@ -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; diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index 14420724f0..3771a72d36 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -266,8 +266,8 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => { await Notes.syncUserInboxes(tid, uid); if (!hasTid && uid && options.cid) { - // New topic via search/post-redirect, have category announce it - activitypub.out.announce.topic(tid); + // New topic, have category announce it + await activitypub.out.announce.topic(tid); } return { tid, count }; diff --git a/src/database/redis/connection.js b/src/database/redis/connection.js index 41a9243355..b97f75a4a4 100644 --- a/src/database/redis/connection.js +++ b/src/database/redis/connection.js @@ -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); });