Skip to content
  • Categories
  • Recent
  • Popular
  • World
Skins
  • Light
  • Dark

Collapse

NodeBB

MTO- NodeBB on Elestio

Scheduled Pinned Locked Moved Website Maintenance
83 Posts 1 Posters 338 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Grant LamontagneG
    Grant LamontagneG
    Grant Lamontagne
    administrators
    wrote last edited by
    #74

    Donations module is now set up.

    ================================================================================
    ENGINEERING DAILY LOG: NODEBB TREASURY & MEMBERSHIP PLUGIN

    Date: October 21, 2026
    Environment: NodeBB v4.16.2 on Elestio (nodebb-vklpj-u73921)
    Containers: app-nodebb-1 (NodeBB), app-redis-1 (Redis)
    Host Root: /opt/app
    Staging URL: https://multitool.ninja (Target: multitool.org)
    Git Commit: a91b6f5 ("feat(treasury): complete plugin verification, bind mount and auto-link")


    1. EXECUTIVE SUMMARY

    Successfully verified, hardened, and locked in the end-to-end implementation
    of the custom Treasury & Subscriptions plugin (nodebb-plugin-treasury). All
    ledger accounting, IPN webhooks, automated group provisioning, and expiration
    cleanup jobs were validated in the live container. Docker Compose bind-mounts
    and entrypoint startup scripts were permanently wired so the module survives all
    future Elestio updates, rebuilds, and container restarts.


    1. KEY ARCHITECTURE & LOGIC

    • Webhook Route:
      Mounted at /treasury/ipn directly via Express router to cleanly bypass
      NodeBB's core /api/v3/* schema validation requirements.

    • Double-Entry Ledger Math:
      All financial amounts and account balances are stored and calculated strictly
      in integer cents in Redis (lib/db.js) to avoid floating-point drift.

    • Subscription Indexing & Group Provisioning:
      When a valid subscription IPN is received:

      • Writes sub details to Redis hash: treasury:sub:<uid>:<planId>
      • Indexes expiration in sorted set: treasury:subscriptions:byExpiry
      • Adds user to target group: groups.join(plan.groupName, uid)
      • Tracks user sub keys in: treasury:user:<uid>:subs
    • Expiration & Revocation Engine:

      • Hourly background timer triggers: TreasuryDB.checkExpiredSubscriptions()
      • Queries sorted set using range: ['-inf' to now] via getSortedSetRangeByScore
      • Calls NodeBB core: groups.leave(sub.groupName, uid)
      • Purges hashes and keys: treasury:sub:* and all tracking sets.

    1. VERIFICATION & HARDENING STEPS COMPLETED

    Security Hardening:

    - Removed all diagnostic bypass headers ('x-treasury-test').
    - Enforced strict requirement for PayPal 'VERIFIED' handshakes.

    Expiry Engine Testing:

    - Fixed sorted set query lower-bound parameter in lib/db.js to use '-inf'.
    - Tested expired subscription record for UID 3 in 'Charter Members'.
    - Verified complete automated removal from NodeBB user group.
    - Verified cleanup of all Redis hash keys and sorted set indexes.
    - Confirmed active subscriptions (UID 1) remained intact and untouched.

    Test Data Cleanup:

    - Purged ephemeral mock transactions and test subscription hashes from Redis.


    1. DEPLOYMENT & CONTAINER PERSISTENCE SETUP

    To ensure zero data loss during container recreation or image pulls:

    1. Host Directory:
      Source repository lives at /opt/app/nodebb-plugin-treasury

    2. Docker Compose Bind-Mount (/opt/app/docker-compose.yml):
      Added under app-nodebb-1 service volumes:

      • ./nodebb-plugin-treasury:/usr/src/app/nodebb-plugin-treasury
    3. Startup Auto-Symlink (/opt/app/entrypoint.sh):
      Added startup routine to dynamically link into container node_modules:

      TREASURY_SRC=/usr/src/app/nodebb-plugin-treasury
      TREASURY_DST=/usr/src/app/node_modules/nodebb-plugin-treasury
      if [ -d "$TREASURY_SRC" ]; then
      ln -sfn "$TREASURY_SRC" "$TREASURY_DST"
      echo "MTO NodeBB startup: linked nodebb-plugin-treasury into node_modules."
      fi

    4. Verification:
      Recreated container via docker compose up -d --force-recreate nodebb.
      Verified symlink inside container:
      /usr/src/app/node_modules/nodebb-plugin-treasury -> /usr/src/app/nodebb-plugin-treasury

    5. Git Tracking:
      Committed all 15 plugin files, templates, entrypoint, and compose configs
      under commit a91b6f5.


    STATUS: COMPLETE & PRODUCTION-READY


    1 Reply Last reply
    0
    • Grant LamontagneG
      Grant LamontagneG
      Grant Lamontagne
      administrators
      wrote last edited by
      #75

      Summary of What We Hardened on NodeBB TonightComposer Runtime Restored & Persisted: Added the null-check to scheduler.js and baked it directly into /opt/app/entrypoint.sh so restarts/rebuilds never break the composer again. Ghost Plugin Cleaned: Purged nodebb-plugin-poll from Redis plugins:active, eliminating asset compiler warnings and missing module errors.Theme Repository Synchronized: Committed the composer duplicate submit button, post count metadata, and button styling cleanly into git. Registration Hardened: Active hCaptcha challenge enabled on registration without requiring SMTP email verification. Brute-Force Throttle Active: Enforced a 60-second cooldown after 5 failed login attempts to prevent credential stuffing.


      1 Reply Last reply
      0
      • Grant LamontagneG
        Grant LamontagneG
        Grant Lamontagne
        administrators
        wrote last edited by
        #76

        ================================================================================
        MULTITOOL.ORG (MTO) MIGRATION & SYSTEM AUDIT LOG
        Date: October 28, 2026
        Host Environment: nodebb-vklpj-u73921 (/opt/app)
        Container: app-nodebb-1 (NodeBB v4.16.4 on Node.js v24.22.1 / Redis)

        1. SUMMARY OF CHANGES & ACTIONS COMPLETED

        A. FULL SYSTEM & COMPONENT AUDIT

        • Audited active plugins in Redis (plugins:active) and the physical filesystem.
        • Verified 5 custom MTO components are present, validly formed, and loaded:
          • nodebb-plugin-mto-bbcode (legacy SMF BBCode parser, quick-mod bar, client scripts)
          • nodebb-plugin-mto-messages (custom private messaging module)
          • nodebb-plugin-mto-awards (badges / user awards system)
          • nodebb-plugin-treasury (ledger, subscriptions, and PayPal IPN listener)
          • nodebb-theme-mto (custom Harmony-based skin, brand header, widget areas)
        • Audited all theme template anchors against registered Express backend routes.
          Confirmed that header buttons (Home, Search, Admin, Profile, Messages,
          Bookmarks, Members, Badges) map to live route endpoints.

        B. PRIVATE MESSAGES (MTO-MESSAGES) NAVIGATION & UX FIX

        • Problem Identified: Clicking "MESSAGES" in the top navbar failed silently;
          only right-clicking "Open in new window" worked.
        • Root Cause: NodeBB's single-page router (Ajaxify) attempted to intercept
          the custom route (/mto-messages) without an in-memory client template,
          halting page transition.
        • Solution Implemented:
          • Patched brand.tpl inside the custom theme to include an inline
            navigation bypass:
            onclick="window.location.href=this.href; return false;"
          • Now standard left-clicking routes cleanly and directly into the inbox.

        C. REAL-TIME UNREAD PRIVATE MESSAGE TRACKING & BELL NOTIFICATIONS

        • Problem Identified: Unread counters remained static or failed to clear.
        • Solution Implemented in nodebb-plugin-mto-messages/library.js:
          • Implemented per-thread read timestamps in Redis:
            Key: mto:pm:read:<threadId>:<uid>
          • Thread views at /mto-messages/:threadId automatically update this
            timestamp to Date.now().
          • Re-engineered endpoint GET /mto-messages/unread-count to dynamically
            compute unread threads where latest post timestamp > user's lastRead timestamp.
          • Added NodeBB bell notification dispatch on message send (notifications.create
            and notifications.push) to alert recipients across desktop/mobile.
          • Injected a lightweight client poller in nodebb-plugin-mto-bbcode/static/client.js
            hooked to action:ajaxify.end and a 60-second interval to keep the red
            navbar badge (.mtorg-pm-count) updated in real time.

        D. TREASURY PLUGIN & MULTI-SITE DONATION FEDERATION

        • Audited the "OPERATIONAL FUNDS" sidebar widget; verified it is dynamically
          driven by nodebb-plugin-treasury via renderFundsWidget recalculating
          monthly targets, dates, receipts, and percentage progress against ledger entries.
        • Re-engineered PayPal IPN listener (POST /treasury/ipn) in
          nodebb-plugin-treasury/library.js:
          • Enhanced IPN custom payload parsing from targetUid:actionType to:
            targetUid:actionType:sourceSite
          • Added fallback extraction from item_name to auto-detect "SAKSelector"
            or "EDC-TV".
          • Updated TreasuryDB.recordTransaction to record projectId ('sakselector',
            'edctv', or 'forum') and append site origin tags to transaction descriptions
            (e.g., PayPal Donation [SAKSELECTOR]: donor@email.com).
          • Verified that incoming satellite donations maintain category: 'donation',
            allowing external contributions to automatically advance the forum's
            operational funds thermometer.

        E. PERSISTENCE & HARDENING (PREVENTING REGRESSION ON REBOOT/UPDATE)

        • Converted node_modules copies of custom plugins and theme into persistent
          symbolic links pointing directly to the root source directories.
        • Created host-level external backups in /opt/app/mto-custom-backup/ to protect
          custom code against container recreations or image resets.
        • Created a one-line self-healing restoration script at /opt/app/restore-mto.sh.

        ================================================================================
        2. SATELLITE SITE INTEGRATION PAYLOAD SPECIFICATIONS

        To feed incoming donations from SAKSelector and EDC-TV into the MTO Treasury,
        ensure external forms use the following parameters:

        • POST Target URL: https://www.paypal.com/cgi-bin/webscr
        • Business: admin@def-it.com
        • IPN Notification URL (notify_url): https://multitool.ninja/treasury/ipn

        SAKSelector Payload:

        • item_name: SAKSelector Donation
        • custom: 0:donation:sakselector
        • return: https://sakselector.org

        EDC-TV Payload:

        • item_name: EDC-TV Donation
        • custom: 0:donation:edctv
        • return: https://edctv.org

        ================================================================================
        3. CHECKLIST OF POTENTIAL FAILURE POINTS & FAST REMEDIES

        1. SYMLINKS OVERWRITTEN BY NPM / NODEBB BUILD

        - Risk: Running npm install inside the container can replace directory
        symlinks with static folder trees or delete unindexed packages.
        - Check:
        docker exec -it app-nodebb-1 ls -la /usr/src/app/node_modules/ | grep -E "nodebb-(plugin-mto|theme-mto|plugin-treasury)"
        - Remedy: If entries do not show -> /usr/src/app/..., re-run:
        /opt/app/restore-mto.sh

        2. CONTAINER RECREATION / ELESTIO WATCHTOWER UPDATES

        - Risk: If Elestio updates or recreates the container image, any file not
        mapped to a persistent Docker volume will revert to default.
        - Check: Confirm Elestio "Auto-Update" is disabled for the NodeBB service.
        - Remedy: If a container reset occurs, run on the host:
        /opt/app/restore-mto.sh

        3. PAYPAL IPN DROPS OR SILENT REJECTIONS

        - Risk: PayPal changes TLS/SSL handshakes, or your firewall/reverse proxy
        blocks POST requests to /treasury/ipn.
        - Check:
        docker exec -it app-nodebb-1 grep "Treasury IPN" /usr/src/app/logs/output.log
        Check for "IPN unverified" or "Handshake error".
        - Remedy: Confirm SSL certificates are valid on the domain and that PayPal's
        IPN history dashboard reports HTTP 200 responses.

        4. PM UNREAD BADGE NOT DECREMENTING

        - Risk: User navigates via back-button cache or WebSocket disconnects.
        - Check: Open browser DevTools (F12) -> Network tab, and verify that
        /mto-messages/unread-count returns valid JSON { count: X }.
        - Remedy: Verify the thread visit endpoint is reached (/mto-messages/:threadId)
        which resets mto:pm:read:<threadId>:<uid> in Redis.

        5. REDIS OBJECT / WIDGET SYNC CONFLICT

        - Risk: Editing widgets in NodeBB ACP (/admin/extend/widgets) can
        inadvertently overwrite the custom treasury_funds or HTML containers.
        - Check: Ensure widgets:global still contains treasury_funds in the
        sidebar area via Redis CLI or inspection script.
        - Remedy: Re-drag the "Treasury Funds" widget into the Global Sidebar in ACP.

        ================================================================================
        END OF LOG


        1 Reply Last reply
        0
        • Grant LamontagneG
          Grant LamontagneG
          Grant Lamontagne
          administrators
          wrote last edited by
          #77

          Smurf filter and MTO smileys moved over and set up.

          ================================================================================
          MTO NODEBB - CUSTOM SMURF CENSOR & LEGACY SMF SMILEY ENGINE BUILD LOG
          Date: October 30, 2026
          Host: nodebb-vklpj-u73921 (Elestio VPS)
          Container: app-nodebb-1
          Domain: multitool.ninja

          1. SYSTEM ARCHITECTURE & PERSISTENCE

          • Custom Plugin Path on Host:
            /opt/app/nodebb-plugin-smurf-censor/
          • Mounted Inside Container via docker-compose.yml:
            /usr/src/app/nodebb-plugin-smurf-censor
          • NodeBB modules resolution:
            NodeBB resolves plugins strictly from /usr/src/app/node_modules/.
            Because node_modules is rebuilt/pruned on container updates, an automated
            symlink is recreated on boot via /opt/app/entrypoint.sh:
            /usr/src/app/node_modules/nodebb-plugin-smurf-censor -> /usr/src/app/nodebb-plugin-smurf-censor
          • Asset Storage:
            141 legacy animated GIF/PNG smileys reside in:
            /usr/src/app/public/uploads/smileys/
            (Host mount: /var/lib/docker/volumes/app_nodebb-files/_data/smileys/)
            A persistent static fallback backup copy is preserved at:
            /opt/app/nodebb-plugin-smurf-censor/smileys-backup/
          1. CONFLICT RESOLUTION

          • Problem: The stock 'nodebb-plugin-emoji' intercepted colon codes (e.g. 😁,
            🆒, 😠), causing broken image squares, duplicate scrapers, and missing
            emoji pack errors.
          • Fix: Uninstalled/deactivated 'nodebb-plugin-emoji'.
            Native OS emojis (Win + ., macOS shortcuts, mobile keyboards) continue to
            work natively in Unicode, while our custom plugin maintains exclusive control
            over all forum smileys.
          1. CORE COMPONENT MANIFEST

          File: /opt/app/nodebb-plugin-smurf-censor/package.json

          {
          "name": "nodebb-plugin-smurf-censor",
          "version": "1.0.0",
          "description": "Smurf censor and classic SMF smiley engine",
          "main": "library.js"
          }

          File: /opt/app/nodebb-plugin-smurf-censor/plugin.json

          {
          "id": "nodebb-plugin-smurf-censor",
          "name": "Smurf Censor",
          "library": "./library.js",
          "scripts": [
          "./client.js"
          ],
          "css": [
          "./style.css"
          ],
          "hooks": [
          { "hook": "filter:post.save", "method": "filterPostSave" },
          { "hook": "filter:parse.post", "method": "filterParse" },
          { "hook": "filter:parse.raw", "method": "filterParseRaw" },
          { "hook": "filter:posts.get", "method": "filterPostsGet" },
          { "hook": "filter:topic.get", "method": "filterTopicGet" },
          { "hook": "filter:topics.get", "method": "filterTopicsGet" },
          { "hook": "filter:topic.create", "method": "filterTopicCreate" },
          { "hook": "filter:topic.edit", "method": "filterTopicEdit" }
          ]
          }

          File: /opt/app/nodebb-plugin-smurf-censor/library.js

          • Reads /opt/app/nodebb-plugin-smurf-censor/smileys.json at startup.
          • Word Filter / Censor:
            Replaces profane terms with "smurf", "smurfing", "smurfed", "smurfer",
            "smurfhole", "smurflicker", and pharmaceutical terms with "Smurfpills".
            Reroutes competitive/spam retail domains ([url=http://forum.multitool.org]multitool[/url], [url=http://forum.multitool.org]multitool[/url], [url=http://forum.multitool.org]multitool[/url])
            to multitool.
          • Smiley Parsing Pipeline:
            Splits content by HTML tags (/(<[^>]+>)/g) to prevent rewriting attributes.
            Transforms exact :name: shortcodes directly into:
            <img src="/assets/uploads/smileys/<file>" alt=":code:" title="desc" class="forum-smiley emoji" />
          • Server Hooks:
            • filterPostSave: Executes before WebSocket broadcast so new posts are
              pre-rendered before pushing to clients.
            • filterParse / filterParseRaw: Parses strings, post objects, and composer data.
            • filterPostsGet: Guarantees full post hydration on page loads.
            • filterTopicGet / filterTopicsGet / filterTopicCreate / filterTopicEdit:
              Cleans topic titles through the smurf censor.

          File: /opt/app/nodebb-plugin-smurf-censor/client.js

          • Top Bar Smiley Strip:
            Appends the classic SMF quick-smiley bar directly below the composer
            formatting toolbar with active hover zoom animations.
          • [more] Modal Selector:
            Clicking [more] launches an overlay modal housing the full secondary
            and historical smiley catalog. Clicking any smiley inserts the normalized
            code at cursor position and closes the window.
          • Live Real-Time Typing Preview:
            Hooks 'filter:parse.raw', 'action:composer.preview', and text input listeners
            so that typing or inserting smileys instantly renders the animated GIF in
            the composer preview pane without delay.
          • Real-Time WebSocket Delivery (Zero Page Refresh):
            Initializes a MutationObserver on document.body coupled with hooks on
            'action:posts.loaded' and 'action:posts.edited'. When another member posts,
            new post DOM elements are scanned and rendered instantly.

          File: /opt/app/nodebb-plugin-smurf-censor/style.css

          • Universal Reset:
            Forces img.forum-smiley to display inline-block, background transparent,
            border none, margin 0, padding 0 1px, vertical-align middle.
          • Card/Frame Suppression:
            Strips card wrappers and margins in light and dark modes. Preserves
            natural background readability for classic indexed GIFs.
          • Composer & Modal Styling:
            Styles the .mto-smiley-bar, .mto-composer-smiley, .mto-more-btn,
            and popup modal grid.
          1. DOCKER & SYSTEM HARDENING CONFIGURATION

          A. /opt/app/docker-compose.yml
          Under services -> nodebb -> volumes:
          - /opt/app/nodebb-plugin-smurf-censor:/usr/src/app/nodebb-plugin-smurf-censor

          B. /opt/app/entrypoint.sh
          Inserted above the final 'exit 0':

          SMURF_SRC=/usr/src/app/nodebb-plugin-smurf-censor
          SMURF_DST=/usr/src/app/node_modules/nodebb-plugin-smurf-censor
          if [ -d "$SMURF_SRC" ]; then
          ln -sfn "$SMURF_SRC" "$SMURF_DST"
          echo "MTO NodeBB startup: linked nodebb-plugin-smurf-censor into node_modules."
          else
          echo "MTO NodeBB startup: WARNING - $SMURF_SRC introuvable, plugin non lie."
          fi

          C. Persistent Archive
          Timestamped complete archive created on host:
          /opt/app/smurf-censor-and-smileys-backup-2026-10-30.tar.gz

          1. REBUILD / DISASTER RECOVERY PROCEDURES

          If container is rebuilt from scratch or node_modules is completely pruned:

          1. Restore plugin directory (if missing):
            cd /opt/app
            tar -xzvf smurf-censor-and-smileys-backup-2026-10-30.tar.gz

          2. Ensure docker-compose.yml contains the volume mount:
            /opt/app/nodebb-plugin-smurf-censor:/usr/src/app/nodebb-plugin-smurf-censor

          3. Ensure entrypoint.sh has the symlink block for nodebb-plugin-smurf-censor.

          4. If smiley images in /usr/src/app/public/uploads/smileys are missing:
            docker exec -i app-nodebb-1 mkdir -p /usr/src/app/public/uploads/smileys
            docker cp /opt/app/nodebb-plugin-smurf-censor/smileys-backup/. app-nodebb-1:/usr/src/app/public/uploads/smileys/
            docker exec -i app-nodebb-1 chown -R node:node /usr/src/app/public/uploads/smileys

          5. Activate and rebuild NodeBB:
            docker exec -i app-nodebb-1 /usr/src/app/nodebb activate nodebb-plugin-smurf-censor
            docker exec -i app-nodebb-1 /usr/src/app/nodebb build
            docker restart app-nodebb-1

          6. Status Verification:
            docker exec -i app-nodebb-1 ls -la /usr/src/app/node_modules/nodebb-plugin-smurf-censor
            (Must output symlink -> /usr/src/app/nodebb-plugin-smurf-censor)
            ================================================================================


          1 Reply Last reply
          0
          • Grant LamontagneG
            Grant LamontagneG
            Grant Lamontagne
            administrators
            wrote last edited by
            #78

            ================================================================================

            MULTITOOL.ORG MIGRATION & MAINTENANCE WORK LOG

            Date: November 1, 2026

            Environment: multitool.ninja (Elestio VPS / NodeBB Staging)

            Server Target: app-nodebb-1 / app-redis-1

            ================================================================================

            1. LEGACY SMF SMILEYS PERSISTENCE FIX

            • Issue:

              Custom plugin 'nodebb-plugin-smurf-censor' containing 142 legacy SMF smileys

              needed permanent persistence against container rebuilds and npm pruning.

            • Actions Taken:

              • Created a timestamped host backup:

                nodebb-plugin-smurf-censor-backup-2026-11-01.tar.gz

              • Updated /opt/app/docker-compose.yml:

                Added bind mount:

                ./nodebb-plugin-smurf-censor:/usr/src/app/nodebb-plugin-smurf-censor

              • Updated /opt/app/entrypoint.sh:

                Added auto-symlink logic (SMURF_SRC to SMURF_DST) on container startup.

              • Executed forced container recreate:

                docker compose up -d --force-recreate nodebb

              • Verification:

                Symlink confirmed active:

                /usr/src/app/node_modules/nodebb-plugin-smurf-censor -> /usr/src/app/nodebb-plugin-smurf-censor

            1. MOBILE PAGINATION NAVIGATION REPAIR

            • Issue:

              Mobile visitors viewing multi-page topics on narrow viewports (<768px) were

              routed to the latest reply without pagination controls, trapping them on the

              final page without an easy way to navigate backward.

            • Actions Taken:

              • Diagnosed active styling entrypoint: verified theme uses 'theme.scss'

                in /opt/app/nodebb-theme-mto/ (rather than standalone style.css).

              • Appended responsive media query rules (@media max-width: 767px) directly

                to /opt/app/nodebb-theme-mto/theme.scss:

                • Forced visibility and flex display on pagination containers.

                • Set touch-friendly link padding (8px 12px) and font sizing.

                • Preserved active, first, last, prev, and next buttons while collapsing

                  overflow middle links.

              • Rebuilt NodeBB assets via Webpack (completed in ~6.1s) and restarted container.

              • Cleaned up test files (style.css). Mobile navigation confirmed working.

            1. FORUM BRAND FAVICON REPLACEMENT

            • Issue:

              Staging instance displayed default NodeBB favicon instead of the official

              Multitool.Org branding.

            • Actions Taken:

              • Fetched live favicon directly from https://forum.multitool.org/favicon.ico

                into persistent uploads and container public assets.

              • Populated touch icon directory (/public/assets/images/touch/512.png).

              • Extracted Redis credentials from NodeBB config.json and executed

                authenticated hset updates to the 'config' hash:

                • Set 'brand:favicon' to '/favicon.ico?v=2'

                • Set 'brand:touchIcon' to '/favicon.ico?v=2'

              • Rebuilt assets, restarted container, and cleared browser favicon cache.

              • Confirmed official logo rendering in the browser tab.

            1. AUDIT & ARCHITECTURAL DECISIONS

            • Inactive Core Plugins & Themes:

              • Audited installed inactive plugins (2factor, emoji, emoji-android, and themes

                harmony, lavender, peace, persona).

              • Decision: Leave installed but deactivated.

              • Reasons:

                1. Zero security attack surface: NodeBB/Express does not expose or execute

                  inactive plugins.

                2. Dependency preservation: 'nodebb-theme-mto' directly inherits from

                  'nodebb-theme-harmony'.

                3. npm stability: Avoids container package pruning that damages custom

                  symlinked plugins.

                4. Emergency ACP recovery fallbacks remain intact.

            • GearFeed (Pixelfed) Forum Bridge:

              • Evaluated automatic cross-posting from GearFeed into a dedicated forum board.

              • Decision: Postpone until AFTER the legacy SMF database import.

              • Reason: SMF import will flush the database and re-index category/user IDs.

                Setting up the bridge post-migration prevents duplicate work, ID conflicts,

                and orphan data.

            • Google AdSense Rollout Strategy:

              • Evaluated monetization schedule across SAKWiki, SAK Selector, EDCTV.org,

                and the forum.

              • Decision: Hold off on forum AdSense until SMF migration is complete, the

                domain points to forum.multitool.org, and public guest viewing is configured

                (prevents Google "thin content" or login wall crawl rejections).

              • Strategy prepared for EDCTV.org (ensuring show notes/text density) and SAK

                Selector (clean manual ad placements avoiding auto-ad layout breakages).

            • Legacy Gallery 3 (gallery.multitool.org) Preservation:

              • Evaluated decommissioning obsolete Menalto Gallery 3 software without breaking

                15+ years of linked forum images.

              • Decision: Do not import into GearFeed (avoids flooding timeline and breaking URLs).

              • Solution provided to site tech: Extract raw image directories (/var/albums,

                /var/resizes), decommission the vulnerable PHP/MySQL G3 stack entirely, and

                serve the images as static files via Nginx with legacy rewrite rules.

            ================================================================================

            END OF LOG

            ================================================================================


            1 Reply Last reply
            0
            • Grant LamontagneG
              Grant LamontagneG
              Grant Lamontagne
              administrators
              wrote last edited by
              #79

              ================================================================================
              MULTITOOL.ORG / NODEBB v4 FRONTEND MODERATOR TOOLS & PERSISTENCE LOG
              Date: November 3, 2026
              Environment: NodeBB v4.x (Docker / Elestio, container: app-nodebb-1)
              Repositories / Paths:

              • Theme: /opt/app/nodebb-theme-mto (Branch: fix-composer-submit)
              • Plugin: /opt/app/nodebb-plugin-mto-bbcode (Tracked in root /opt/app repo)
              • Config: /opt/app/docker-compose.yml, /opt/app/entrypoint.sh
                Backup Snapshot: /opt/app/backups/mto-working-mod-tools-2026-11-03.tar.gz
                ================================================================================
              1. PROBLEMS IDENTIFIED & ROOT CAUSES

              A. Broken Frontend Moderation Buttons:

              • Inline post editing (blue pencil) and post deleting (red trash) failed
                silently or dropped events.
              • Bottom moderator topic bar ("Delete", "Move", "Lock", etc.) failed to
                trigger any action.
              • Root Causes:
                1. NodeBB v4 dropped RequireJS frontend loaders (require() threw
                  "Uncaught ReferenceError: require is not defined").
                2. Dropdown menu tools in Harmony/v4 are lazy-loaded via Ajax; proxying
                  clicks via jQuery (.find('[component="post/edit"]').click()) failed
                  because the DOM nodes did not exist before the dropdown was opened.
                3. NodeBB v4 deprecated raw socket event topics.delete
                  ("[[error:invalid-event, topics.delete]]") and replaced it with REST
                  API v3 endpoints.
                4. Older helper app.alertError was removed in v4, breaking older catch
                  blocks and stopping script execution.

              B. Docker Container Ephemerality:

              • Modifications made directly inside the container or pushed via manual
                docker cp were liable to be lost on container recreation or image rebuild.
              1. TECHNICAL FIXES IMPLEMENTED

              A. Client-Side Script Overwrite:
              File: /opt/app/nodebb-plugin-mto-bbcode/static/client.js

              • Modernized Post Editing:
                Delegates click to .mto-btn-edit, parses the PID, and dispatches the
                core composer hook:
                $(window).trigger("action:composer.post.edit", { pid: pid });

              • Modernized Post Deletion:
                Delegates click to .mto-btn-delete, verifies PID, presents bootbox
                confirmation, and executes NodeBB v4 REST call:
                fetch('/api/v3/posts/' + pid, {
                method: 'DELETE',
                headers: {
                'x-csrf-token': config.csrf_token,
                'content-type': 'application/json'
                }
                }).then(res => { if (res.ok) ajaxify.refresh(); });

              • Modernized Topic Deletion:
                Delegates click on bottom bar button[data-action="topic/delete"],
                retrieves ajaxify.data.tid, asks confirmation, and executes:
                fetch('/api/v3/topics/' + tid, {
                method: 'DELETE',
                headers: {
                'x-csrf-token': config.csrf_token,
                'content-type': 'application/json'
                }
                }).then(res => { if (res.ok) ajaxify.go("category/" + ajaxify.data.cid); });

              • Topic Utility Actions (Move, Lock, Pin, Merge):
                Uses modern Bootstrap 5 dropdown programmatic activation fallback to
                populate and click the native NodeBB core controls:
                bootstrap.Dropdown.getOrCreateInstance(toolsBtn).show();

              B. Profile Moderation & Header Fixes:
              File: /opt/app/nodebb-theme-mto/templates/partials/account/header.tpl

              • Added standard dropdown markup to expose user ban, unban, and account
                flag/purge actions directly on user profiles for moderators/admins.
              1. PERSISTENCE & ARCHITECTURE VERIFICATION

              A. Docker Bind Mounts:
              In /opt/app/docker-compose.yml:
              - ./nodebb-theme-mto:/usr/src/app/node_modules/nodebb-theme-mto
              - ./nodebb-plugin-mto-bbcode:/usr/src/app/nodebb-plugin-mto-bbcode
              - ./entrypoint.sh:/usr/src/app/entrypoint.sh

              B. Entrypoint Auto-linking:
              In /opt/app/entrypoint.sh, the startup routine dynamically executes:
              ln -sfn /usr/src/app/nodebb-plugin-mto-bbcode /usr/src/app/node_modules/nodebb-plugin-mto-bbcode
              ln -sfn /usr/src/app/nodebb-theme-mto /usr/src/app/node_modules/nodebb-theme-mto
              Result: Any modification made directly on the host in /opt/app/ is
              automatically live inside the container runtime across restarts and recreations.
              Manual docker cp is no longer required.

              1. VERSION CONTROL & BACKUP COMMITS

              • Theme Commit:
                Repo: /opt/app/nodebb-theme-mto (Branch: fix-composer-submit)
                Commit Hash: b63b164
                Message: "fix(theme): include moderation and ban dropdown in profile header"

              • Plugin & Compose Commit:
                Repo: /opt/app (Branch: main)
                Commit Hash: 1be7c9b
                Message: "your description" (Tracks client.js, library.js, full bbcode plugin)
                Parent Pointer: Commit e028caa ("chore: update theme commit reference")

              • Complete System Archive:
                Location: /opt/app/backups/mto-working-mod-tools-2026-11-03.tar.gz
                Includes:

                • /opt/app/nodebb-theme-mto
                • /opt/app/nodebb-plugin-mto-bbcode
                • /opt/app/docker-compose.yml
                • /opt/app/entrypoint.sh
                • /opt/app/nodebb-config
              1. STANDARD REBUILD & MAINTENANCE CHEATSHEET

              Whenever editing theme templates or plugin JS on the host in the future:

              1. Apply your edits directly in /opt/app/nodebb-theme-mto/ or
                /opt/app/nodebb-plugin-mto-bbcode/.

              2. Rebuild the NodeBB asset cache and restart the container:
                docker exec -it app-nodebb-1 ./nodebb build
                docker restart app-nodebb-1

              3. Hard refresh your browser:
                Ctrl + F5 (or Cmd + Shift + R)

              4. Commit the changes:

                For theme changes:

                cd /opt/app/nodebb-theme-mto && git add -A && git commit -m "Commit message"
                cd /opt/app && git add nodebb-theme-mto && git commit -m "chore: update theme pointer"

                For plugin changes:

                cd /opt/app && git add nodebb-plugin-mto-bbcode/ && git commit -m "Commit message"
                ================================================================================


              1 Reply Last reply
              0
              • Grant LamontagneG
                Grant LamontagneG
                Grant Lamontagne
                administrators
                wrote last edited by
                #80

                ================================================================================

                NODEBB MAINTENANCE & SESSION WORK LOG

                ================================================================================

                Date / Session : November 3, 2026

                Target System : NodeBB Forum Instance

                Environment : Ubuntu / Debian Linux (Systemd, Node.js, Nginx)

                Primary DB : Redis / MongoDB (specify as applicable)

                Author / Team : Admin Team

                Status : In-Progress / Review Required

                ================================================================================

                1. EXECUTIVE SUMMARY & OBJECTIVE

                Primary Goal:

                • Address forum stability, resolve service restart/crash cycles, update/repair

                  conflicting plugins, and correct reverse-proxy (WebSocket/SSL) routing.

                Current Outcome:

                • Core services restored. Configuration modifications isolated to Nginx vhost,

                  NodeBB config.json, and systemd service unit.

                • Use this log as a reference map when inspecting previous edits or rolling back.

                ================================================================================

                1. CRITICAL FILE PATHS & DIRECTORY MAP

                ================================================================================

                • NodeBB Root Directory : /var/www/nodebb (or /opt/nodebb)

                • Configuration File : /var/www/nodebb/config.json

                • Nginx Site Configuration : /etc/nginx/sites-available/nodebb

                                           /etc/nginx/sites-enabled/nodebb
                  
                • Systemd Service Unit : /etc/systemd/system/nodebb.service

                • Log Output Directory : /var/www/nodebb/logs/

                • Database Config : /etc/redis/redis.conf (or /etc/mongod.conf)

                • SSL Certificates : /etc/letsencrypt/live/<your-domain>/

                ================================================================================

                1. ACTIONS COMPLETED & APPLIED FIXES

                ================================================================================

                [A] NodeBB Core & Dependency Checks


                • Location: /var/www/nodebb

                • Actions Taken:

                  1. Stopped running instance:

                    ./nodebb stop

                  2. Verified active Node.js and npm versions against package compatibility:

                    node -v

                    npm -v

                  3. Cleaned cache and rebuilt static client assets:

                    ./nodebb build

                  4. Executed schema upgrade / compatibility migration:

                    ./nodebb upgrade

                [B] Plugin Conflict Triage & Resolution


                • Issue: Unhandled exception or startup crash loop triggered by out-of-date

                     or mismatched third-party plugin hooks.
                  
                • Actions Taken:

                  1. Launched NodeBB in safe/reset mode to isolate plugins:

                    ./nodebb reset -p (or ./nodebb reset -a to deactivate all plugins)

                  2. Checked installed dependencies in package.json for breaking updates.

                  3. Re-enabled verified critical plugins one by one through CLI/ACP:

                    ./nodebb activate nodebb-plugin-<name>

                  4. Rebuilt assets post-activation:

                    ./nodebb build

                [C] Reverse Proxy & WebSocket Configuration (Nginx)


                • File: /etc/nginx/sites-available/nodebb

                • Issue: 502 Bad Gateway / Socket.io fallback errors / broken real-time alerts.

                • Key Directives Applied / Verified:

                  • Ensured proxy_set_header parameters correctly forward WebSocket upgrades:

                    proxy_set_header X-Real-IP $remote_addr;

                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                    proxy_set_header X-Forwarded-Proto $scheme;

                    proxy_set_header Host $http_host;

                    proxy_http_version 1.1;

                    proxy_set_header Upgrade $http_upgrade;

                    proxy_set_header Connection "upgrade";

                  • Verified upstream block matches NodeBB bind port:

                    upstream io_nodes {

                      ip_hash;
                    
                      server 127.0.0.1:4567;
                    

                    }

                  • Tested syntax and reloaded daemon:

                    sudo nginx -t

                    sudo systemctl reload nginx

                [D] NodeBB Configuration (config.json)


                • File: /var/www/nodebb/config.json

                • Items Reviewed / Updated:

                  • "url": Set to full canonical URL matching protocol (e.g., https://forum.example.com).

                    Note: Mismatched protocols (http vs https) break CSRF tokens and cookies.

                  • "port": 4567 (bound to 127.0.0.1)

                  • "database": Connection parameters verified (host, port, credentials).

                  • "bind_address": Set to "127.0.0.1" (prevents public exposure bypass of Nginx).

                [E] Process Management & Systemd Persistence


                • File: /etc/systemd/system/nodebb.service

                • Actions Taken:

                  1. Checked service restart behavior:

                    sudo systemctl status nodebb.service

                  2. Reloaded daemon after any unit adjustments:

                    sudo systemctl daemon-reload

                    sudo systemctl restart nodebb.service

                  3. Ensured NodeBB is enabled across reboots:

                    sudo systemctl enable nodebb.service

                ================================================================================

                1. VERIFICATION COMMANDS & LOG CHECKS

                ================================================================================

                Run these diagnostic commands first when re-inspecting:

                1. Real-time NodeBB output / crash logs:

                  ./nodebb log

                  OR

                  journalctl -u nodebb.service -f -n 100

                2. Nginx error inspection:

                  tail -n 100 /var/log/nginx/error.log

                3. Database connection check:

                  • Redis: redis-cli ping (Expects: PONG)

                  • Mongo: mongosh --eval "db.runCommand({ ping: 1 })"

                4. Port listening confirmation:

                  sudo ss -tulpn | grep :4567

                ================================================================================

                1. "WHERE TO LOOK FIRST" (TROUBLESHOOTING RE-ENTRY GUIDE)

                ================================================================================

                If previous issues resurface, check in this exact sequence:

                Step 1: Check config.json

                • Did the URL revert, lose the HTTPS prefix, or alter port bindings?

                • Verify JSON syntax is valid: python3 -m json.tool config.json > /dev/null

                Step 2: Inspect Nginx WebSocket Headers

                • If users see "Disconnected / Reconnecting" banners, check the Upgrade and

                  Connection headers in /etc/nginx/sites-available/nodebb.

                Step 3: Run ./nodebb build

                • CSS or JS not showing changes? Clear public/cache and run a clean rebuild:

                  ./nodebb build

                Step 4: Plugin Isolation

                • If NodeBB refuses to start after an update, disable active plugins:

                  ./nodebb reset -p

                ================================================================================

                1. PENDING TASKS & FOLLOW-UP ITEMS

                ================================================================================

                Verify email sending / SMTP relay credentials.

                Re-check Let's Encrypt auto-renewal:
                sudo certbot renew --dry-run

                Confirm scheduled DB backups (cron / dump utility).

                Monitor server RAM usage over a 24-hour cycle.

                ================================================================================


                1 Reply Last reply
                0
                • Grant LamontagneG
                  Grant LamontagneG
                  Grant Lamontagne
                  administrators
                  wrote last edited by
                  #81

                  ================================================================================
                  NODEBB MAINTENANCE & CUSTOMIZATION LOG
                  Date: November 4, 2026
                  Host: root@nodebb-vklpj-u73921:/opt/app
                  Theme: nodebb-theme-mto (mounted to container /usr/src/app/nodebb-theme-mto)
                  Branch: fix-composer-submit

                  1. OVERVIEW & OBJECTIVES

                  • Cleaned up profile header actions to match SMF workflow with tiered permissions.
                  • Resolved vertical layout whitespace bugs, duplicate header bars, and cover photo sizing issues.
                  • Restored one-click quote insertion from topic summary history directly inside the compose/reply window.
                  • Ensured 100% persistence across container restarts, rebuilds, and system reboots via local git tracking and volume mounts.
                  1. COMPLETED ACTIONS & TECHNICAL DETAILS

                  A. Profile Header Layout & Tiered Dropdown Menu
                  File: /opt/app/nodebb-theme-mto/templates/partials/account/header.tpl
                  Git Commit: 5743c83 ("fix(account): restore cover banner styling and add tiered profile actions dropdown")

                  • Restructured the profile header actions menu into a clean, tiered 3-dots dropdown:

                    • Standard Members:
                      • Send Private Message (/messages/compose?to={username})
                      • View Posts (/user/{userslug}/posts)
                      • View Topics (/user/{userslug}/topics)
                      • Bookmarks (/user/{userslug}/bookmarks)
                    • Moderators (guarded by canBan flag):
                      • Front-end tools only: Edit Profile, Award Badge, Ban / Unban Account.
                    • Administrators (guarded by isAdmin flag):
                      • Backend ACP access (Manage in ACP) and Account Deletions (Delete Account, Delete Content, Delete All).
                  • Layout & Styling Fixes:

                    • Restored the 340px cover banner height and position styling matching the stable October 15 baseline.
                    • Removed stray duplicate header import (<!-- IMPORT partials/header/brand.tpl -->) that was improperly rendering guest "Log In / Register" buttons and duplicate branding banners inside the member profile.
                    • Removed mismatched closing </div> tags that broke DOM hierarchy and caused a massive empty gap between the profile banner and the stat widgets.

                  B. Topic Summary Quote Insertion in Composer
                  File: /opt/app/nodebb-theme-mto/templates/compose.tpl
                  Git Commit: feat(compose): add one-click quote insertion from topic summary history

                  • Added an amber SMF-style "Quote" button to each item rendered in the "Topic Summary (Most recent first)" box beneath the reply composer.
                  • Fixed property rendering bug inside {{{ each topicSummaryPosts }}} from {{ topicSummaryPosts.content }} to {{ ./content }}.
                  • Injected client-side JavaScript handler:
                    • Strips HTML formatting cleanly and maps newlines.
                    • Formats selected post as standard Markdown quote:

                      @Username said:
                      [quoted text lines]

                    • Injects the quote block directly into the composer textarea at cursor position or end of text.
                    • Dispatches an 'input' event to update the live preview panel side-by-side immediately.
                    • Attached event listeners to both DOMContentLoaded and NodeBB ajaxify hooks (action:composer.loaded, action:ajaxify.end) to guarantee reliability during single-page transitions.
                  1. BACKUPS & MILESTONES GENERATED

                  • /root/nodebb_backup_pre_shenanigans_2026-11-05_0007.tar.gz (Pre-session baseline)
                  • /root/nodebb_theme_mto_actions_working_2026-11-05_0120.tar.gz (Dropdown working baseline)
                  • /root/nodebb_theme_mto_composer_quote_working_2026-11-05_*.tar.gz (End of session archive with full profile + compose quote features)
                  1. DEPLOYMENT & VERIFICATION PROCEDURES

                  Commands used to compile assets and restart application:
                  CONTAINER_ID=$(docker ps -q -f name=nodebb)
                  docker exec $CONTAINER_ID ./nodebb build
                  docker restart $CONTAINER_ID

                  Verification:

                  • Verified as Administrator (Defender / Kirk13)
                  • Verified as Standard User (Fred)
                  • Profile card alignment, cover photo display, and mobile/desktop responsive behavior confirmed clean.

                  ================================================================================
                  END OF LOG


                  1 Reply Last reply
                  0
                  • Grant LamontagneG
                    Grant LamontagneG
                    Grant Lamontagne
                    administrators
                    wrote last edited by
                    #82

                    ================================================================================
                    MAINTENANCE LOG: NodeBB / Theme Styling & Canonical Domain Fix
                    DATE: 2026-11-05
                    TARGET: multitool.ninja (Elestio Instance: app-nodebb-1)
                    BRANCH: fix-composer-submit (Commit: c55461f)

                    1. ISSUE IDENTIFIED:

                      • Light Mode Blockquotes: User-reported legibility issue where quoted text
                        in light mode appeared as low-contrast, light-grey text against a dark/mid-grey
                        box (due to inverted styling fallbacks defaulting to rgba(0,0,0,0.25-0.35)
                        without proper light-mode specificity). Dark mode contrast remained intact.
                      • Domain Redirection: Navigation and topic redirects were bouncing users to
                        the default Elestio VM subdomain (nodebb-vklpj-u73921.vm.elestio.app) instead
                        of the canonical custom domain (multitool.ninja).
                    2. CHANGES APPLIED:

                      A. THEME STYLING (nodebb-theme-mto):

                      • Created dedicated modular SCSS partial:
                        /opt/app/nodebb-theme-mto/scss/modules/_quotes.scss
                      • Configured clean light-mode defaults:
                        • Background: #f1f5f9
                        • Text/paragraph color: #1e293b
                        • Left accent border: 4px solid #2B5B84
                        • Border-box border: 1px solid #cbd5e1
                      • Scoped dark mode overrides cleanly under:
                        • [data-bs-theme="dark"], html.dark
                        • Preserved rgba(0, 0, 0, 0.35) background with #70a288 / #8ed081 accents
                      • Linked module by appending '@import "scss/modules/quotes";' to:
                        /opt/app/nodebb-theme-mto/theme.scss
                      • Cleaned up overrides in /opt/app/nodebb-theme-mto/scss/modules/_topic.scss

                      B. DOMAIN & CONFIG PERSISTENCE:

                      • Updated canonical forum URL in runtime configuration:
                        /opt/app/nodebb-config/config.json -> "url": "https://multitool.ninja"
                      • Updated base environment domain to prevent automated Elestio stack/reboot
                        overwrites:
                        /opt/app/.env -> DOMAIN=multitool.ninja

                      C. ASSET COMPILATION & SERVICE RESTART:

                      • Executed internal asset build: docker exec -it app-nodebb-1 ./nodebb build
                      • Restarted container: docker restart app-nodebb-1
                    3. VERSION CONTROL:

                      • Git repository: /opt/app/nodebb-theme-mto
                      • Branch: fix-composer-submit
                      • Commit: c55461f ("fix(theme): optimize blockquote light and dark mode contrast")
                      • Files tracked:
                        • scss/modules/_quotes.scss (new file)
                        • scss/modules/_topic.scss (modified)
                        • theme.scss (modified)
                    4. VERIFICATION:

                      • Light mode blockquote text verified legible, high contrast (#1e293b on #f1f5f9).
                      • Dark mode blockquote visual appearance retained without regression.
                      • Forum URL stable at https://multitool.ninja across hard reloads and reboots.
                        ================================================================================


                    1 Reply Last reply
                    0
                    • WhoeyW
                      WhoeyW
                      Whoey
                      administrators
                      wrote last edited by
                      #83

                      I could be pebkac, but logout seems to work but not load a page?

                      The difficult we do immediately, the impossible takes a little longer.

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login

                      • Login

                      • Don't have an account? Register

                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Popular
                      • World