Commit graph

2,665 commits

Author SHA1 Message Date
Tulir Asokan
c37ddcc3a5 Bump version to v0.25.1
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
v0.25.1
2025-09-16 14:45:37 +03:00
Tulir Asokan
b5bec2e96c client: stabilize support for state_after
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-13 13:44:46 +03:00
Tulir Asokan
717c8c3092 bridgev2/database: normalize disappearing settings before insert
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-09-13 01:38:06 +03:00
Tulir Asokan
3a6f20bb62 crypto/sqlstore: ignore unused sessions in olm unwedging
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-12 19:30:05 +03:00
Tiago Loureiro
4603a344ce
event: add org.matrix.msc3381.poll.end type (#412)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-11 15:10:14 -03:00
Tulir Asokan
5dbab3ae99 crypto/machine: don't clear account on Destroy()
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-11 14:46:21 +03:00
Tulir Asokan
87fe127414 crypto/decryptolm: retry prekey decryption with goolm 2025-09-11 14:17:24 +03:00
Tulir Asokan
c716f30959 crypto/register: don't use init in *olm packages 2025-09-11 14:14:15 +03:00
Tulir Asokan
84e5d6bda1 crypto/machine: allow canceling background context 2025-09-11 14:13:18 +03:00
Tulir Asokan
69869f7cb5 crypto: log active driver 2025-09-11 14:12:35 +03:00
Tulir Asokan
bdb9e22a43 crypto/libolm: clean up pointer management 2025-09-11 13:22:45 +03:00
Tulir Asokan
faa1c5ff8d crypto/machine: log when loading olm account
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-10 16:46:05 +03:00
Tulir Asokan
22a908d8d6 crypto/decryptolm: add debug logs for failing to decrypt with new session 2025-09-10 16:24:43 +03:00
Tulir Asokan
e295028ffd client: stabilize arbitrary profile field support
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-09 19:10:07 +03:00
Tulir Asokan
41bbe4ace4 bridgev2/portal: add action message metadata to disappearing notices 2025-09-09 16:24:18 +03:00
Tulir Asokan
30ab68f7f1 appservice: maybe fix url template raw path for unix sockets
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-09-04 18:18:53 +03:00
Tulir Asokan
709f48f2b3 bridgev2/provisioning: remove unused structs
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-09-02 18:24:24 +03:00
Tulir Asokan
8f8b26d815 event: add is_animated flag from MSC4230 2025-09-02 10:33:49 +03:00
Tulir Asokan
bcd0a70bdf appservice/websocket: override read limit
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-02 00:31:15 +03:00
Tulir Asokan
f8c3a95de7
bridgev2: add support for creating groups (#405)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-01 18:01:20 +03:00
timedout (aka nexy7574)
0627c42270
client: implement MSC4323 (#407) 2025-09-01 16:01:05 +01:00
Tulir Asokan
61a90da145 event: use RawMessage instead of map for bot command arguments
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-09-01 00:45:32 +03:00
Tulir Asokan
cd927c2796 event: add types for MSC4332
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-30 19:54:58 +03:00
fmseals
1d6bea5fe3
client: fix v3/delete_devices method (#393)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-29 19:34:06 +03:00
Tulir Asokan
050fbbd466 bridgev2/status: change RemoteID to a UserLoginID 2025-08-29 18:32:04 +03:00
Tulir Asokan
f9e3e8a30f bridgev2/provisionutil: allow passing mxids to ResolveIdentifier
Closes #398
2025-08-29 18:32:04 +03:00
Tulir Asokan
8f464b5b76 bridgev2: move shared SNC code to provisionutil 2025-08-29 16:45:54 +03:00
Ping Chen
c18d2e2565
bridgev2/matrixinterface: add GetEvent interface for linkedin reply (#406)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
Co-authored-by: Tulir Asokan <tulir@maunium.net>
2025-08-29 17:20:11 +09:00
Tulir Asokan
19f3b2179c pre-commit: ban log.Str(x.String()) 2025-08-29 11:07:16 +03:00
Tulir Asokan
3048d2edab bridgev2/provisioning: add minimum length for shared secret
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-28 02:20:41 +03:00
Tulir Asokan
359afbea2b bridgev2/matrix: remove provisioning API prefix option
Reverse proxy configuration should be used instead when adding prefixes
to the path. Changing the path entirely is not recommended even with
reverse proxies.

Fixes #403
2025-08-28 02:19:27 +03:00
Tulir Asokan
febca20dd7 bridgev2/status: use _file pattern for avatar instead of splitting url and keys
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-27 17:12:00 +03:00
Tulir Asokan
9f693702b0 federation/pdu: add extra field to internal metadata 2025-08-27 12:25:08 +03:00
Tulir Asokan
f131ae5aa4 federation/pdu: add cached event ID to internal metadata
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-27 12:24:15 +03:00
Tulir Asokan
ba16c30a8c
federation/eventauth: add v3-v12 event auth rules (#401)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-27 01:45:33 +03:00
Tulir Asokan
0345a5356d bridgev2/database: don't set disappearing timer content to nil
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-26 17:07:16 +03:00
Tulir Asokan
7b3a60742e event: allow omitting timers from disappearing timer capability 2025-08-26 15:57:10 +03:00
Tulir Asokan
e9d4eeb332 bridgev2/status: add avatar_keys to remote profile 2025-08-26 15:56:27 +03:00
Tulir Asokan
63b654187d event: marshal zero disappearing timers as empty object
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-25 19:03:07 +03:00
Tulir Asokan
c3a422347c bridgev2/portal: validate capabilities when updating disappearing timer 2025-08-25 18:37:15 +03:00
Tulir Asokan
bca8b0528c sqlstatestore: fix GetPowerLevels returning non-nil even if power levels weren't found 2025-08-25 18:27:49 +03:00
Tulir Asokan
4f7c7dafdc bridgev2/matrix: fix encryption error notice not being redacted after retry success 2025-08-25 17:42:20 +03:00
Tulir Asokan
a6bbe978bd bridgev2/networkinterface: add interface for handling disappearing timer changes from Matrix 2025-08-25 17:35:57 +03:00
Tulir Asokan
f860b0e238 bridgev2/portal: fix send notice option when updating disappearing message timer 2025-08-25 17:23:25 +03:00
Tulir Asokan
8e703410f4 bridgev2/portal: always set timestamp for disappearing message timer update 2025-08-25 17:21:55 +03:00
Tulir Asokan
5ac8a888a3 bridgev2/portal: make UpdateDisappearingSetting more versatile 2025-08-25 17:16:18 +03:00
Tulir Asokan
0fab92dbc1 event: add third party invite state event content 2025-08-25 17:16:18 +03:00
Tulir Asokan
c04d0b6681 bridgev2: merge mentions and url previews when merging caption 2025-08-25 17:16:18 +03:00
Brad Murray
fa7c1ae2bc
crypto/sqlstore: add index to make finding megolm sessions to backup faster (#402)
```
2025-08-24T22:23:19Z debug    [MatrixBridgeV2]           {"level":"warn","component":"matrix","component":"client_loop","subcomponent":"sync_key_backup_loop","rows":0,"duration_seconds":1.046191042,"method":"EndRows","query":"SELECT room_id, sender_key, signing_key, session, forwarding_chains, ratchet_safety, received_at, max_age, max_messages, is_scheduled, key_backup_version FROM crypto_megolm_inbound_session WHERE account_id=?1 AND session IS NOT NULL AND key_backup_version != ?2","time":"2025-08-24T22:23:19.22077Z","message":"Query took long"} 
```

before:
```
sqlite> EXPLAIN SELECT room_id, sender_key, signing_key, session, forwarding_chains, ratchet_safety, received_at, max_age, max_messages, is_scheduled, key_backup_version FROM crypto_megolm_inbound_session WHERE account_id='@brad:beeper.com/CHNWOJWEUC' AND sessi
addr  opcode         p1    p2    p3    p4             p5  comment
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     25    0                    0   Start at 25
1     OpenRead       0     48    0     15             0   root=48 iDb=0; crypto_megolm_inbound_session
2     OpenRead       1     49    0     k(3,,,)        2   root=49 iDb=0; sqlite_autoindex_crypto_megolm_inbound_session_1
3     String8        0     1     0     @brad:beeper.com/CHNWOJWEUC 0   r[1]='@brad:beeper.com/CHNWOJWEUC'
4     SeekGE         1     24    1     1              0   key=r[1]
5       IdxGT          1     24    1     1              0   key=r[1]
6       DeferredSeek   1     0     0                    0   Move 0 to 1.rowid if needed
7       Column         0     5     2                    128 r[2]= cursor 0 column 5
8       IsNull         2     23    0                    0   if r[2]==NULL goto 23
9       Column         0     14    2                    0   r[2]=crypto_megolm_inbound_session.key_backup_version
10      Eq             3     23    2     BINARY-8       82  if r[2]==r[3] goto 23
11      Column         0     4     4                    0   r[4]= cursor 0 column 4
12      Column         0     2     5                    0   r[5]= cursor 0 column 2
13      Column         0     3     6                    0   r[6]= cursor 0 column 3
14      Column         0     5     7                    0   r[7]= cursor 0 column 5
15      Column         0     6     8                    0   r[8]= cursor 0 column 6
16      Column         0     9     9                    0   r[9]= cursor 0 column 9
17      Column         0     10    10                   0   r[10]= cursor 0 column 10
18      Column         0     11    11                   0   r[11]= cursor 0 column 11
19      Column         0     12    12                   0   r[12]= cursor 0 column 12
20      Column         0     13    13    0              0   r[13]=crypto_megolm_inbound_session.is_scheduled
21      Column         0     14    14                   0   r[14]=crypto_megolm_inbound_session.key_backup_version
22      ResultRow      4     11    0                    0   output=r[4..14]
23    Next           1     5     0                    0
24    Halt           0     0     0                    0
25    Transaction    0     0     55    0              1   usesStmtJournal=0
26    Integer        1     3     0                    0   r[3]=1
27    Goto           0     1     0                    0
sqlite> SELECT COUNT(*) FROM crypto_megolm_inbound_session ;
+----------+
| COUNT(*) |
+----------+
| 168792   |
+----------+
sqlite> SELECT COUNT(*) FROM crypto_megolm_inbound_session WHERE session IS NULL;
+----------+
| COUNT(*) |
+----------+
| 39       |
+----------+
sqlite> SELECT COUNT(*) FROM crypto_megolm_inbound_session WHERE key_backup_version != 1;
+----------+
| COUNT(*) |
+----------+
| 39       |
+----------+
```

after:
```
sqlite> CREATE INDEX idx_megolm_filtered
   ...> ON crypto_megolm_inbound_session(account_id, key_backup_version, session);
sqlite> EXPLAIN SELECT room_id, sender_key, signing_key, session, forwarding_chains, ratchet_safety, received_at, max_age, max_messages, is_scheduled, key_backup_version FROM crypto_megolm_inbound_session WHERE account_id='@brad:beeper.com/CHNWOJWEUC' AND session IS NOT NULL AND key_backup_version != 1;
addr  opcode         p1    p2    p3    p4             p5  comment
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     25    0                    0   Start at 25
1     OpenRead       0     48    0     15             0   root=48 iDb=0; crypto_megolm_inbound_session
2     OpenRead       1     91264 0     k(4,,,,)       2   root=91264 iDb=0; idx_megolm_filtered
3     String8        0     1     0     @brad:beeper.com/CHNWOJWEUC 0   r[1]='@brad:beeper.com/CHNWOJWEUC'
4     SeekGE         1     24    1     1              0   key=r[1]
5       IdxGT          1     24    1     1              0   key=r[1]
6       DeferredSeek   1     0     0                    0   Move 0 to 1.rowid if needed
7       Column         1     2     2                    128 r[2]= cursor 1 column 2
8       IsNull         2     23    0                    0   if r[2]==NULL goto 23
9       Column         1     1     2                    0   r[2]=crypto_megolm_inbound_session.key_backup_version
10      Eq             3     23    2     BINARY-8       82  if r[2]==r[3] goto 23
11      Column         0     4     4                    0   r[4]= cursor 0 column 4
12      Column         0     2     5                    0   r[5]= cursor 0 column 2
13      Column         0     3     6                    0   r[6]= cursor 0 column 3
14      Column         1     2     7                    0   r[7]= cursor 1 column 2
15      Column         0     6     8                    0   r[8]= cursor 0 column 6
16      Column         0     9     9                    0   r[9]= cursor 0 column 9
17      Column         0     10    10                   0   r[10]= cursor 0 column 10
18      Column         0     11    11                   0   r[11]= cursor 0 column 11
19      Column         0     12    12                   0   r[12]= cursor 0 column 12
20      Column         0     13    13    0              0   r[13]=crypto_megolm_inbound_session.is_scheduled
21      Column         1     1     14                   0   r[14]=crypto_megolm_inbound_session.key_backup_version
22      ResultRow      4     11    0                    0   output=r[4..14]
23    Next           1     5     0                    0
24    Halt           0     0     0                    0
25    Transaction    0     0     56    0              1   usesStmtJournal=0
26    Integer        1     3     0                    0   r[3]=1
27    Goto           0     1     0                    0
sqlite>
```
2025-08-25 08:03:13 -04:00
Tulir Asokan
7e07700a69 format: add MarkdownMentionRoomID helper
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-24 00:47:55 +03:00