Commit graph

90 commits

Author SHA1 Message Date
Scott Nonnenberg fb670ad6b9 Remove IndexedDB files after removing IndexedDB database 2018-11-01 17:00:24 -07:00
Scott Nonnenberg 9f647f00d8 A couple fixes for the data layer, legacy message upgrade/migrate 2018-11-01 17:00:24 -07:00
Scott Nonnenberg f11dd18536 Be resilient to malformed ephemeral.json 2018-11-01 09:34:24 -07:00
Scott Nonnenberg 1755e0adfd Move all remaining stores to SQLCipher 2018-10-31 17:36:51 -07:00
Scott Nonnenberg a7d78c0e9b Sealed Sender support
https://signal.org/blog/sealed-sender/
2018-10-29 14:49:18 -07:00
Scott Nonnenberg 2cfbfe477a Better handle large numbers of messages in cache on startup 2018-10-01 18:18:37 -07:00
Scott Nonnenberg cd60bdd08a Move conversations to SQLCipher 2018-10-01 18:18:37 -07:00
Scott Nonnenberg 48d937b66a Follow symlinks on target file path as well as user/config paths 2018-09-20 15:30:26 -07:00
Scott Nonnenberg 998c35dcb3 Split configuration into low and high traffic files
Also, we're now handling config ourselves instead of using
electron-config and config dependencies.
2018-08-29 10:40:16 -07:00
Scott Nonnenberg 496ebf2a47 Store SQLCipher decryption key in separate file
First, we write the key a whole lot less. We write it on creation, then
never again.

Second, it's in a file we control very closely. Instead of blindly
regenerating the key if the target file generates an error on read,
we block startup unless the error is 'ENOENT' - the file isn't there
at all.

This still allows for the key.txt file to be deleted or corrupted
somehow, but it should be a lot less common than the high-traffic
config.json used for window location and media permissions.
2018-08-16 17:01:32 -07:00
Scott Nonnenberg 9f920aa35b Re-enable orphaned attachment cleanup 2018-08-15 17:45:24 -07:00
Scott Nonnenberg a247ffe5cf When iOS device has been linked, use iOS color scheme 2018-08-15 11:22:45 -07:00
Scott Nonnenberg fba8e8d479 Add logging to help diagnose protocol handler false positives 2018-08-14 13:06:59 -07:00
Scott Nonnenberg c88df69094 New SQL indices and query tweaks to eliminate table scans
Also: New logging on client side to track performance of db queries
2018-08-09 10:11:12 -07:00
Scott Nonnenberg 727925a266 Clean up old messages, better handle errors from sending 2018-08-07 18:29:33 -07:00
Scott Nonnenberg 6e193456f9 Eliminate orphaned external message files on startup
Attachments, visual attachment thumbnails, video attachment screenshots
Quote thumbnails
Contact avatars
2018-08-06 18:08:10 -07:00
Scott Nonnenberg c56ea55e36 Fix duplicate message detection 2018-08-02 17:32:51 -07:00
Scott Nonnenberg 4d5894bf04 Ensure that all multi-statement sql functionss are serialized 2018-07-31 19:29:51 -07:00
Scott Nonnenberg 3105b77475 Migrate to SQLCipher for messages/cache
Quite a few other fixes, including:
  - Sending to contact with no avatar yet (not synced from mobile)
  - Left pane doesn't update quickly or at all on new message
  - Left pane doesn't show sent or error status

Also:
 - Contributing.md: Ensure set of linux dev dependencies is complete
2018-07-31 17:08:45 -07:00
Scott Nonnenberg 5933a34a18 Use window.log in browser context, turn on console eslint rule 2018-07-21 14:52:43 -07:00
Scott Nonnenberg 3c69886320 Finish new Message component, integrate into application
Also:
- New schema version 8 with video/image thumbnails, screenshots, sizes
- Upgrade messages not at current schema version when loading messages
  to show in conversation
- New MessageDetail react component
- New ConversationHeader react component
2018-07-17 15:58:07 -07:00
Scott Nonnenberg 3a2582a087 Permissions: 'return callback(true)' instead of 'return true' 2018-07-12 14:52:34 -07:00
Scott Nonnenberg ad4387803b New media permission, show dialog when not enabled for voice msg
UI now in separate renderer:
  - the permissions popup
  - settings dialog
  - debug log dialog
  - about window

Couple bug fixes:
  - About Window: Fix 'escape' to close window
  - Remove outdated dist/copy tasks from Gruntfile

Eslintified settings_view.js
2018-07-03 16:04:21 -07:00
Scott Nonnenberg 4415293100 Make all OS menus localizable
Turns out that Electron is not localizing the 'role' elements like we
expected would happen.
2018-07-03 16:04:21 -07:00
Scott Nonnenberg 7c3325f55e File protocol filter: log when non-absolute path is rejected 2018-05-31 13:25:45 -07:00
Scott Nonnenberg beb65b14c0 Deny all permissions we don't actually need 2018-05-31 13:25:45 -07:00
Scott Nonnenberg eec61f5289 Fine-tune file protocol filter 2018-05-31 13:25:45 -07:00
Scott Nonnenberg 06b0544bbe Hardening: normalize on-disk attachment paths before save/load 2018-05-31 13:25:45 -07:00
Scott Nonnenberg 53a471b2b1 Expand set of blocked URI schemes 2018-05-23 16:26:48 -07:00
Scott Nonnenberg e2d044e02b Filter file scheme; disable http, https and ftp entirely 2018-05-23 16:26:40 -07:00
Scott Nonnenberg 754d65ae2e Let's make it all pretty, shall we?
We missed a couple directories with previous attempts to turn this on
globally: app/ and libtextsecure/

Not to mention files in places we didn't expect: ts files that weren't
in the ts directory!

This turns prettier on for every file we care about (js, ts, tsx, md)
everywhere in the project but for a few key parts.
2018-05-02 13:40:57 -07:00
Daniel Gasienica f56dc09d01 Add getAbsoluteAttachmentPath 2018-04-27 16:31:43 -04:00
Daniel Gasienica 394d2f0bff Fix type signature 2018-04-27 16:31:43 -04:00
Daniel Gasienica 24f4ad53bc Use single quotes for identifiers 2018-04-11 15:54:32 -04:00
Daniel Gasienica 5a6668e677 Add Attachments.createWriteForExisting
This function lets us choose where to write attachment to instead of picking
random name.
2018-04-04 18:41:50 -04:00
Daniel Gasienica efd673083d Rename writeAttachmentData to writeNewAttachmentData 2018-04-04 18:41:50 -04:00
Daniel Gasienica 36771a2dab Prefer double quotes over backticks for identifiers 2018-04-04 18:41:50 -04:00
Daniel Gasienica 8474f3cf7f Use create* prefix to clarify curried functions 2018-04-03 15:25:24 -04:00
Daniel Gasienica d9be6a0f94 Destructure Lodash requires 2018-04-02 15:12:04 -04:00
Daniel Gasienica add5d4ab0b Prevent macOS Spotlight indexing of attachments folder
See: https://apple.stackexchange.com/a/92785
2018-03-26 16:38:34 -04:00
Daniel Gasienica 10afcf1bb0 Add Attachments.deleteData 2018-03-26 16:38:34 -04:00
Daniel Gasienica 1c8123ff1a Move writeAttachmentData into Attachments
Encapsulates all attachment operations that require Node.js / Electron APIs,
e.g. file system access.
2018-03-26 16:38:34 -04:00
Daniel Gasienica 6355c54114 Return relative path from writeAttachmentData
This will make our app more robust to changes in location on the file system.
2018-03-26 16:38:34 -04:00
Daniel Gasienica 1262d1d696 Shorten prefix to 2 characters
Using 2 hex characters [0-9a-f] will give us 16 * 16 = 256 root folders which
seems more manageable than 4096 (16^3). Assuming a user has 10,000 attachments,
they should roughly distribute at ~40 per folder with prefix length 2 rather
than ~2.5 per folder with a prefix of 3.
2018-03-26 16:38:34 -04:00
Daniel Gasienica e0428355be Wire up writeAttachment 2018-03-26 16:38:34 -04:00
Daniel Gasienica 8a94ca5c42 🎨 Use Buffer.from 2018-03-26 16:38:34 -04:00
Daniel Gasienica 1283c77518 Switch from hashed to random attachment file names
Using hashes, we get the benefit of deduplication but if a user receives two
messages with the same attachment, deleting one would delete it for both since
they are only stored once. To avoid the complexity of tracking number of
references, we simply generate random file names similar to iMessage on MacOS
(?) and Signal Android.
2018-03-26 16:38:34 -04:00
Daniel Gasienica d9de6dacba Add writeAttachmentData module 2018-03-26 16:38:34 -04:00
Scott Nonnenberg 2373840df8
Use proper logging if error pops when deleting all logs 2018-03-14 14:42:14 -07:00
Scott Nonnenberg 928906e0f3
Enable deletion of all logs on disk via IPC 2018-03-14 14:42:13 -07:00