Commit Graph

107 Commits

Author SHA1 Message Date
skylord123 67920840e1 Add session manager and verification list to the server config editor
Adds two interactive admin tools to the matrix-server-config node so
device verification and session management can be done from the editor
without building a flow. Both open as modal dialogs and are backed by
new flows.write-protected admin endpoints.

Pending verifications
- New "Pending verification requests" button opens a modal listing
  incoming and in-progress verification requests, refreshed every 5
  seconds.
- Each entry shows the type (device or room), who it is from, a live
  age, and a live expiry countdown; the list is capped at the newest 20
  with a hidden-count note.
- Clicking an entry drives the SAS flow (accept, start, show emoji,
  confirm/cancel) within the modal.
- New /matrix-chat/verification endpoint with list, advance, confirm,
  mismatch, and cancel actions.
- trackVerificationRequest now records a seen-at timestamp and keeps
  finished requests for two minutes so their outcome can still be
  reported to the editor.

Sessions
- New "Manage sessions" button opens a modal listing the account's
  sessions, modelled on Element's session manager: the current session
  with a verified / not-verified status box, then other sessions, each
  with a green or red shield, last activity, and IP address.
- Clicking a session shows its details (session ID, last activity, IP),
  a Rename action, and a password-confirmed Remove. Unverified sessions
  offer a Verify action that hands off into the verification modal.
- New /matrix-chat/sessions endpoint with list, rename, remove, and
  verify actions.
2026-05-22 15:29:43 -06:00
skylord123 ebcb1eab81 Upgrade to matrix-js-sdk 41.5.0; add device verification
Upgrades matrix-js-sdk from 34.13.0 to 41.5.0. This crosses the v37
removal of the legacy libolm crypto stack, so E2EE is migrated to the
Rust crypto implementation. Also adds device verification, cross-signing
setup, and authenticated media support.

Dependencies
- Bump matrix-js-sdk ^34.13.0 -> ^41.5.0; require Node.js >= 22.
- Drop the `olm` dependency (legacy crypto only); add `fake-indexeddb`.

Rust crypto
- Replace initCrypto() with initRustCrypto(); the legacy crypto stack
  was removed upstream in v37.
- Add src/matrix-crypto-store.js: the Rust crypto store requires
  IndexedDB, absent in Node.js, so it is backed by fake-indexeddb and
  snapshotted to disk (rust-crypto-store.v8) to survive restarts.
- Migrate existing libolm crypto state into the Rust store on first run,
  and discard the stored crypto state when the device ID changes.

Homeserver discovery
- Resolve the homeserver via .well-known, so a delegating domain
  (e.g. example.org) works as the configured server URL.

Cross-signing & secure backup
- Add a secured /matrix-chat/secure-backup admin endpoint and a modal
  dialog on the server config node: check status, unlock an existing
  secure backup with its recovery key, or reset and create a new one.

Device verification (new nodes)
- matrix-verification: event source emitting verification requests and
  phase changes, with on-node filters (phase, initiated by, type,
  self-verification, user allowlist, room).
- matrix-verification-action: request, accept, start SAS, confirm,
  mismatch, or cancel an in-flight verification.

Authenticated media
- matrix-receive and matrix-crypt-file use the authenticated media
  endpoints, send a bearer token via msg.headers, and fall back between
  the v3 and v1 media endpoints on a 404.

Fixes
- Surface connection/auth errors in the log; node.error() calls were
  passed an empty msg object, which routed the error and suppressed
  console logging.
- matrix-get-user: await getProfileInfo()/getPresence().
- matrix-invite-room: pass the reason as the third invite() argument
  (the removed callback parameter was shifting it out).
- Guard the verification handlers so a throwing SDK getter cannot crash
  Node-RED.

Docs
- Add the device-verification example flow; update the READMEs and node
  help, correcting stale claims that device verification, secure backup,
  and encrypted file uploads were unsupported.
2026-05-22 14:40:00 -06:00
skylord123 68e63e5def Upgrade from matrix-js-sdk v34 to v34.13.0 2026-02-19 22:45:31 -07:00
Fabbio Protopapa f0af0e92fe Remove unused TimelineWindow in server-config 2025-12-23 09:45:57 +01:00
skylord123 8cb52112c1 Fix module compatibility with Node.js < 22 2025-02-09 22:36:52 -07:00
skylord123 ad34f018ab Merge pull request #127 from koosc/allow-unknown
Add option for allowing unknown devices in rooms
2025-02-07 20:52:10 -07:00
skylord123 093d59893e Fix roomId and eventId inputs not saving field type correctly for get-event node 2025-02-07 20:27:19 -07:00
skylord123 913f5dfcb9 - Upgrade to matrix-js-sdk 34.11.1 to fix CVE-2024-50336
- Remove request package (no longer needed)
2025-02-05 11:59:39 -07:00
skylord123 e0947dd3bc Merge pull request #128 from wuast94/master
Add m.notice to the receive node
2025-02-03 20:54:40 -07:00
skylord123 8287f3c08a Merge pull request #130 from LokiMidgard/patch-1
Support default plaintext in msg.format
2025-02-03 20:51:43 -07:00
Patrick Kranz 2a78524a90 use hasOwn instead of keys 2025-01-09 15:28:28 +01:00
Patrick Kranz d01838ac84 Fix error 2025-01-09 15:14:50 +01:00
Patrick Kranz 2059f8455d Update matrix-send-message.js 2025-01-09 15:12:09 +01:00
Marc 77f2c4be46 Add m.notice to the receive node 2025-01-01 05:17:12 +00:00
Chris Koos cf82daf5da Add option for allowing unknown devices
Allows workaround for sending messages until verification is implemented
2024-11-10 10:57:43 -08:00
skylord123 3b161f1ad9 - Convert examples list examples/README.md to use collapsable github sections
- Add another example for sending an uploading file to a room
- Add form tip for Send Message node's thread reply config option
2024-09-18 22:19:49 -06:00
skylord123 45ff930518 - Update examples README to make things much easier to find
- Added examples for every node
- Fixed User Settings node requiring a roomId when it's not needed
- Fixed the documentation for Upload File node
- Get User node had unused config code that has been removed
2024-09-18 15:21:13 -06:00
skylord123 9e3b66f4aa - Fix Mark Read node not working properly and update the docs for this node #111 2024-09-18 09:32:19 -06:00
skylord123 02826e2769 - Fix Room Pagination node event data being unaccessible #28
- Add new node `Get Event` that will give you room data for a corresponding roomId and eventId #117
- Add new node `Fetch Event Relations` that can paginate through events related to another event #119
- README updates
2024-09-16 23:27:29 -06:00
skylord123 1b54bc03eb Merge pull request #114 from squatica/fix-deprecated-login
stop using deprecated login object
2024-09-03 21:00:27 -06:00
skylord123 65edc94854 Add deprecation notice for Send File and Send Image nodes #102 2024-06-24 19:20:19 -06:00
skylord123 351679ad77 - Add image thumbnail generation support for file upload node (and improved logging) #102
- Fix Received images missing thumbnail kills Node Red #65
- Trim rooms provided in receive node's Room ID config value
2024-06-13 20:21:20 -06:00
squatica 2b2da4faf7 stop using deprecated login object 2024-05-06 20:53:04 +02:00
skylord123 5090e4fbb6 - fix 2024-02-24 22:29:52 -07:00
skylord123 51e649b4cf - #109 get own events
- #28 paginate room history
- #111 manual read markers
- fix clearing global storage
- update node docs for upload file
2024-02-07 09:06:28 -07:00
skylord123 a08709265e Update node icon 2023-12-15 22:32:20 -07:00
skylord123 57ba70db6c - Received room timeline events now output msg.user containing info about the user that sent the event. 2023-12-15 04:03:13 -07:00
skylord123 a3e1381d53 - Update room state events node so topic property can be dynamically configured 2023-12-15 03:56:32 -07:00
skylord123 6dca3aa70e - #106 Add node for getting data for a user
- couple other fixes
2023-12-15 03:52:28 -07:00
skylord123 f14190d9ea - #105 Add new node for setting or getting user settings (display name or avatar_url)
- Fix class name of matrix-room-state-events node
2023-12-15 01:37:03 -07:00
skylord123 000c28e3b8 - Reduce margin between checkboxes for matrix-receive node
- matrix-send-message node can now be used to reply in a thread (closes #104)
- matrix-receive node now returns msg.mentions for easier access to who was mentioned in message
- matrix-receive node now returns boolean msg.isThread based on whether the message is a thread reply or not
2023-11-25 05:38:09 -07:00
skylord123 e8506d8887 #102 Added new node for file uploading
#102 File upload node automatically detects mime type from name
#102 File upload node automatically fills in information for m.video, m.audio, and m.image (resolution, duration, etc)
#102 File upload node can generate a thumbnail for videos
#102 Send message node now accepts an object to override the message content
2023-11-05 00:06:52 -06:00
skylord123 d7c4bc26bb - #100 add documentation for new typing node and update README
- #100 fix typing event causing server error due to number being string
- Mention using pantalaimon as an alternative for E2EE support in README
2023-10-22 16:56:49 -06:00
skylord123 785e0cd7be - #100 add node for sending typing state to rooms
- fix global and flow variable in getters for Matrix Room States node
2023-10-22 04:32:06 -06:00
skylord123 2e9633e113 - #97 msg.state_key is now allowed as an input to Room State Events node for events that support it (required for m.space.child and m.space.parent)
- #97 added support for m.room.history_visibility, m.room.server_acl, m.room.pinned_events, m.space.child, and m.space.parent
- #97 fix issue with checkbox being hidden on config page when adding new setters/getters on config page
2023-10-22 03:01:33 -06:00
skylord123 1859696122 - #97 added option to fetch state event from local storage and fallback to server if necessary (allows for faster lookups and gives the full event object with information about when/who created it, etc)
- #97 remove num, bool, bin, and data from being options you can set to a state event (currently only objects and sometimes strings are allowed)
- Updated Leave Room node so it deletes the room from local storage
- Updated server config node so it deletes the matrix client from storage during shutdown (possibly solution to #94)
2023-10-22 00:29:12 -06:00
skylord123 fd605005d1 Closes #99
- matrix-server-config now auto populates with first option
2023-10-21 19:47:12 -06:00
skylord123 e7e0f2967b Issue #97 Room Settings
- Remove unused returnValues config option for Room State Events node
2023-10-21 19:39:32 -06:00
skylord123 611e23b845 Issue #97 Room Settings
- Room Settings node renamed to Room State Events
- Room State Events node allows configuring inputs/outputs from config
- Fix bug with various nodes allowing execution even though matrix server isn't connected
- Replace deprecated matrixClient.setGlobalErrorOnUnknownDevices method
- Update docs for new Room State Events node
2023-10-21 19:33:44 -06:00
skylord123 9d050a0d44 Issue #97 Room Settings
- fix join_allow_rules for Room Setting node not getting correctly
- update Room Setting docs
2023-10-15 14:45:16 -06:00
skylord123 c833a40a84 Issue #97 Room Settings
- Can set room name, topic, and avatar
- Can get name, topic, avatar, encrypted, power_levels, aliases, guest_access, join_rule, and join_allow_rules
2023-10-15 04:17:12 -06:00
skylord123 0e755bc350 - Remove console.log usage 2023-10-14 23:22:38 -06:00
skylord123 c920dd12cb - Fix error with matrix-synapse-register node
- Ensure matrix-server-config's register/deregister methods are always available
2023-10-14 22:26:29 -06:00
bvmensvoort 9661922f78 Pass msg object where possible
As described on https://nodered.org/docs/user-guide/writing-functions#handling-errors
2023-10-14 21:32:46 -06:00
bvmensvoort 20c7182511 Make errors catchable and (de)register at config node of all nodes 2023-10-14 21:32:46 -06:00
bvmensvoort f48ba74a72 Make errors of config node catchable via a catch node 2023-10-14 21:32:46 -06:00
bvmensvoort 124a0cba34 (de)Register consumer nodes at config node
In order for error messages to be catchable
2023-10-14 21:32:46 -06:00
bvmensvoort 8ca11f36d8 Make errors of nodes catchable by a catch node 2023-10-14 21:32:46 -06:00
skylord123 2fdc7482ce - Add back in persistent storage
- Receive node now accepts video files
2022-12-06 21:49:05 -07:00
skylord123 c7f9d56df2 - Updated code for new authedRequest argument format
- matrix-js-sdk updated to 22.0.0
- fs-extra updated to 11.1.0
- minimum version set to 14.14
2022-12-06 18:47:41 -07:00