Commit graph

191 commits

Author SHA1 Message Date
Scott Nonnenberg
177dfb3220
Dependency updates, fixes required for successful release (#1966)
* A number of fixes required for successful build after upgrades

- extract now takes an absolute directory only
- something changed, so we now need to force NODE_ENV=production; we use
  electron-is-dev for this
- electron-builder, electron-publisher-s3, and electron-updater are now
  updated to their latest available versions

* Add direct dependency on extract-zip, since we use it directly

* Load 'config' module after we've modified NODE_ENV

* Downgrade electron-builder due to bug, downgrade icon-maker too

The latest electron-builder came with a fix for one of our bugs as well
as a new bug that blocks builds on Windows: https://github.com/electron-userland/electron-builder/issues/2462

There's no good reason to upgrade icon-maker. And a good reason to keep at the version on github: https://github.com/jaretburkett/electron-icon-maker/issues/7
2018-01-12 16:14:45 -08:00
Scott Nonnenberg
64fe9dbfb2
Clean logs on start - and eslint/mocha with code coverage (#1945)
* Clean logs on startup; install server-side testing/linting

* Add eslint config, make all of app/ conform to its demands

* Add Node.js testing and linting to CI

* Lock project to Node.js 7.9.0, used by Electron 1.7.10

* New eslint error: trailing commas in function argumensts

Node 7.9.0 doesn't like trailing commas, but Electron does

* Move electron to devDependency, tell eslint it's built-in
2018-01-08 13:19:25 -08:00
Scott Nonnenberg
94a8c7e524
Update a number of dependencies to the latest: builder, websocket, spellcheck (#1920)
* Update builder to the latest

* Upgrade a number of dependencies
2018-01-08 10:48:15 -08:00
Scott Nonnenberg
8fd0adc486
Update to Electron 1.7.10 (#1919) 2018-01-04 16:20:41 -08:00
Scott Nonnenberg
5caee59921
Support the latest phone number formats via libphonenumber (#1899)
* Update to the latest google-libphonenumber

* Update package.json to the format uses when updating it
2017-12-14 16:30:24 -08:00
Scott Nonnenberg
18ee8a3557
Remove obsolete emoji via a new fork of emoji-panel (#1893)
In many cases this removes generic emoji in favor of new gendered
options (one of which was a copy of the previous generic emoji anyway).
2017-12-14 11:30:41 -08:00
Scott Nonnenberg
b17a67ec65
Support pass-through proxies with HTTPS_PROXY env var (#1878)
We've simplified; HTTPS_PROXY or https_proxy is used for all requests.

We also require that only our self-signed certificates are used for
secure traffic. That rules out all SSL-terminating MITM proxies, since
we don't trust their root certificate.

Once we're sure that this system works for people, we'll improve config
on MacOS and Windows.
2017-12-08 10:38:01 -08:00
Scott Nonnenberg
acc94edd23
Add proxy support based on environment variables (#1855)
We pull proxy settings from environment variables:

- HTTPS_PROXY for sending, profile pulls, and attachment download/upload
- WSS_PROXY for connecting to the websocket for receiving messages
- ALL_PROXY to provide one server for both

More details on our proxy handling:

- https://github.com/Rob--W/proxy-from-env#environment-variables
- https://github.com/TooTallNate/node-proxy-agent

This is the natural way of things for Linux. My understanding is that
most proxies on MacOS are system-wide and transparent, so it's not so
urgent. But Windows will likely require further UI for configuration.
Will need to do some testing with Windows users.
2017-12-04 15:35:50 -08:00
Lilia
9c7ba87d6a Add support for Emoji 5 (#1797)
* Add support for Emoji 5

Update to latest emoji-datasource and emoji-js and switch to an up-to-date fork
of emoji-panel.

// FREEBIE

* Dark theme support for emoji-panel

Fixes #1763

// FREEBIE
2017-11-27 15:54:59 -08:00
Scott Nonnenberg
17f0bb42bc
deployment: update electron-publisher-s3 to match builder update 2017-11-22 17:37:54 -08:00
Scott Nonnenberg
16ad94148a
Introduce library for notifications on downlevel windows (#1812) 2017-11-22 13:50:52 -08:00
Scott Nonnenberg
be2d4535a8
yarn.lock and libtextsecure.js catchup 2017-11-21 19:10:22 -08:00
Scott Nonnenberg
f7140af9cb
Update to the latest 1.7.x electron (#1736) 2017-11-08 17:32:52 -08:00
Scott Nonnenberg
9e6d50b966
Merge branch 'master' into development
Bringing our development (beta) branch inline with all the more urgent
fixes which went directly into the master (production) branch.
2017-11-08 17:02:00 -08:00
Scott Nonnenberg
d098328ee2
Update to the latest Electron 1.6.x (#1666) 2017-11-01 19:06:46 -07:00
Lilia
1f967abf0a Update libphonenumber (#1598)
* Update libphonenumber

Also switch from bower to yarn for managing this dependency.

// FREEBIE

* Remove libphonenumber from bower.json

// FREEBIE
2017-10-30 14:45:57 -07:00
Lilia
fb931b4733 Emoji picker (#1608)
* Add emoji button and popup panel

This integrates a simple third party emoji panel with a few css overrides to
correct some relative paths and colors.

The trickiest thing about this is ensuring we don't break the layout, which is
acheived through precise control over the panel's height, and prodigious calls
to updateMessageFieldSize.

// FREEBIE

* Don't close emoji panel on click, do close on send

To better facilitate multiple emoji entry.

// FREEBIE

* Make panel emojis bigger and higher resolution

// FREEBIE

* Move paperclip button to the right of the microphone

This makes our bottom-bar button arrangement more comfortable and consistent
with Android.

// FREEBIE

* Move emoji picker padding to inner container

* Insert emojis at cursor position

Don't just append to the end like a n00b! Also handle selected text correctly.
https://stackoverflow.com/questions/11076975

// FREEBIE

* A few visual tweaks to reduce visual complexity of emoji panel

- No gray buffer on the right side of the emoji panel
- No gray buffer between message compose text box and emoji window
- The scroll bar for the emojis is the same as our normal scrollbars
2017-10-30 13:54:55 -07:00
Lilia
af8b0164b5 Move to node fetch API for web requests instead of XHR (#1552)
* Use node-fetch instead of xhr

* Remove XMLHttpRequest.js

// FREEBIE

* Avoid calling json() on non json responses

Previously we would catch and swallow JSON parsing errors resulting from an
empty response, though empty responses are normal from a few endpoints, like
requesting sms or voice registration codes.

Since the JSON parsing call is now handled internally by node-fetch, we have to
keep closer track of our expected response type to avoid throwing an exception.

// FREEBIE
2017-10-20 15:52:02 -07:00
Scott Nonnenberg
0291882328 Update electron-updater and supply it with windows/publisherName (#1535)
This ensures that the signing certificate of any binary pulled down as
part of auto-update on Windows is in the CA chain (not self-signed) and
has the right publisherName. electron-updater also rejects any unsigned
binary when asked to check the publisherName.

FREEBIE
2017-10-04 14:05:23 -07:00
Scott Nonnenberg
29053059b2 Update electron to v1.6.14 to get security fix (#1519)
https://electron.atom.io/blog/2017/09/27/chromium-rce-vulnerability-fix

FREEBIE
2017-09-28 17:44:29 -07:00
Scott Nonnenberg
4c48d12dc3
Remove unused grunt tasks: sauce labs and connect
We can't run our tests in a standalone server anymore, so no need for
connect.

Similarly, sauce labs is no longer necessary because all of our tests
are run locally inside of Electron.

FREEBIE
2017-09-25 15:38:27 -07:00
Scott Nonnenberg
6b11f67dc6
Move logging to disk via bunyan
- Logging is available in main process as well as renderer process, and
  entries all go to one set of rotating files. Log entries in the
  renderer process go to DevTools as well as the console. Entries from
  the main process only show up in the console.
- We save three days of logs, one day per file in %userData%/logs
- The 'debug' object store is deleted in a new database migration
- Timestamps and level included in the new log we generate for publish
  as well as the devtools
- The bunyan API is exposed via windows.log (providing the ability to
  log at different levels, and save objects instead of just text), so we
  can move our code to it over time.

FREEBIE
2017-09-25 15:00:34 -07:00
Lilia
4449a5f110 Upgrade emoji support (#1482)
* Upgrade emoji deps and move to node_modules

Add support for Emoji 3.0 and switch from bower to yarn for managing emoji
dependencies.

// FREEBIE

* Delete old emoji deps

// FREEBIE

* Don't copy emoji on windows

It is no longer necessary since the symlinked image dir is gone.

// FREEBIE

* Update emoji test

// FREEBIE

* Fix emoji tests; remove all overrides of emoji-js functions

FREEBIE
2017-09-15 13:22:11 -07:00
Scott Nonnenberg
e6c7ebcaf9
Update builder (Windows taskbar), tweak config (GNOME taskbar) (#1473)
* Update electron-builder and config, grunt-exec, and spellchecker

electron-builder is a major update: ^18.8.1 -> ^19.27.3

Fixes #1463, where we lose the user's decision to pin to taskbar

The other three are all minor changes, but it's generally good to stay
up to date.

FREEBIE

* Add category for our Linux build target

Fixes #1460, though the recommended list of categories doesn't seem to
match what is shown in Linux Mint. Hopefully it understands that
what was previously 'Networking' should now be 'Internet'

Standard list:
  https://standards.freedesktop.org/menu-spec/latest/apa.html

FREEBIE

* Add StartupWMClass to .desktop file so GNOME can find running app

Fixes #1432

FREEBIE
2017-09-14 17:04:03 -07:00
Lilia
50c470e53d
Certificate pinning via node XMLHttpRequest implementation (#1394)
* Add certificate pinning on https service requests

Make https requests to the server using node apis instead of browser apis, so we
can specify our own CA list, which contains only our own CA.

This protects us from MITM by a rogue CA.

As a bonus, this let's us drop the use of non-standard ports and just use good
ol' default 443 all the time, at least for http requests.

// FREEBIE

* Make certificateAuthorities an option on requests

Modify node-based xhr implementation based on driverdan/node-XMLHttpRequest,
adding support for setting certificate authorities on each request.

This allows us to pin our master CA for requests to the server and cdn but not
to the s3 attachment server, for instance. Also fix an exception when sending
binary data in a request: it is submitted as an array buffer, and must be
converted to a node Buffer since we are now using a node based request api.

// FREEBIE

* Import node-based xhr implementation

Add a copy of https://github.com/driverdan/node-XMLHttpRequest@86ff70e, and
expose it to the renderer in the preload script.

In later commits this module will be extended to support custom certificate
authorities.

// FREEBIE

* Support "arraybuffer" responseType on requests

When fetching attachments, we want the result as binary data rather than a utf8
string. This lets our node-based XMLHttpRequest honor the responseType property
if it is set on the xhr.

Note that naively using the raw `.buffer` from a node Buffer won't work, since
it is a reuseable backing buffer that is often much larger than the actual
content defined by the Buffer's offset and length.

Instead, we'll prepare a return buffer based on the response's content length
header, and incrementally write chunks of data into it as they arrive.

// FREEBIE

* Switch to self-signed server endpoint

* Log more error info on failed requests

With the node-based xhr, relevant error info are stored in statusText and
responseText when a request fails.

// FREEBIE

* Add node-based websocket w/ support for custom CA

// FREEBIE

* Support handling array buffers instead of blobs

Our node-based websocket calls onmessage with an arraybuffer instead of a blob.
For robustness (on the off chance we switch or update the socket implementation
agian) I've kept the machinery for converting blobs to array buffers.

// FREEBIE

* Destroy all wacky server ports

// FREEBIE
2017-09-14 17:03:17 -07:00
Scott Nonnenberg
270f626cd7
Add lodash for server-side utility functions
FREEBIE
2017-09-14 17:03:17 -07:00
Scott Nonnenberg
122719688a
Add os-locale to reliably get xx-XX style locale on all OSes
FREEBIE
2017-09-14 17:03:17 -07:00
Scott Nonnenberg
51768a16c4
Add semver and spellchecker directly, remove electron-provider
FREEBIE
2017-09-14 17:03:17 -07:00
David Balatero
9a7f4ae41c
Show dialog box when there's an update for download 2017-09-14 16:53:50 -07:00
Scott Nonnenberg
ebc373185a
Introduce new dependency for user settings: electron-config
FREEBIE
2017-09-14 16:53:48 -07:00
lilia
d63c603c21
Add spectron 2017-09-14 16:53:45 -07:00
lilia
81d8b78d05
Switch to grunt-sass + node-sass-import-once
These modules together allow us to import css files from third party
components without maintaining symlinks that essentially rename them as
sass partials, which doesn't work on windows.

// FREEBIE
2017-09-14 16:53:44 -07:00
lilia
7ef901d628
yarn remove icon-gen 2017-09-14 16:53:41 -07:00
lilia
7d47b53dc3
Generate icons with electron-icon-maker
Either icon-gen or local scaling of images was producing a corrupted and
glitchy .icns file. With this module, we need only provide a 1024px
image and it handles the scaling and generation of all other icon
assets.

// FREEBIE
2017-09-14 16:53:40 -07:00
lilia
c9537ff9a9
Add asar for inspeting asar contents 2017-09-14 16:53:40 -07:00
lilia
429cc46cf9
yarn add --dev electron-publisher-s3
// FREEBIE
2017-09-14 16:53:40 -07:00
lilia
9f873e21a2
yarn upgrade electron-builder 2017-09-14 16:53:40 -07:00
lilia
8732127b1d
yarn upgrade icon-gen 2017-09-14 16:53:40 -07:00
lilia
a885123ab3
Upgrade dev dependencies
Including multiple major version upgrades.

// FREEBIE
2017-09-14 16:53:40 -07:00
lilia
404c8baffc
yarn upgrade
// FREEBIE
2017-09-14 16:53:40 -07:00
lilia
90ad83a91d
Add yarn.lock
Remove grunt-preen due to its dependency on module incompatible with
current node.

// FREEBIE
2017-09-14 16:53:40 -07:00