Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2025-12-24 23:27:06 -05:00
5 changed files with 37 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ set_defaults() {
export SETUP="${SETUP:-}" export SETUP="${SETUP:-}"
export PACKAGE_MANAGER="${PACKAGE_MANAGER:-npm}" export PACKAGE_MANAGER="${PACKAGE_MANAGER:-npm}"
export OVERRIDE_UPDATE_LOCK="${OVERRIDE_UPDATE_LOCK:-false}" 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 # Function to check if a directory exists and is writable
@@ -172,6 +173,33 @@ debug_log() {
echo "DEBUG: $message" 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 function
main() { main() {
set_defaults set_defaults
@@ -182,12 +210,14 @@ main() {
debug_log "PACKAGE_MANAGER: $PACKAGE_MANAGER" debug_log "PACKAGE_MANAGER: $PACKAGE_MANAGER"
debug_log "CONFIG location: $CONFIG" debug_log "CONFIG location: $CONFIG"
debug_log "START_BUILD: $START_BUILD" debug_log "START_BUILD: $START_BUILD"
debug_log "NODEBB_ADDITIONAL_PLUGINS: ${NODEBB_ADDITIONAL_PLUGINS}"
if [ -n "$SETUP" ]; then if [ -n "$SETUP" ]; then
start_setup_session "$CONFIG" start_setup_session "$CONFIG"
fi fi
if [ -f "$CONFIG" ]; then if [ -f "$CONFIG" ]; then
install_additional_plugins
start_forum "$CONFIG" "$START_BUILD" start_forum "$CONFIG" "$START_BUILD"
else else
start_installation_session "$NODEBB_INIT_VERB" "$CONFIG" start_installation_session "$NODEBB_INIT_VERB" "$CONFIG"

View File

@@ -203,4 +203,4 @@
"url": "https://github.com/barisusakli" "url": "https://github.com/barisusakli"
} }
] ]
} }

View File

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

View File

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

View File

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