3460 Commits

Author SHA1 Message Date
Juan Cruz Viotti
fe91be11e8 refactor(errors): createError and createUserError accept an object (#1322)
Currently, both of these functions accept two arguments: the error
title, and the error description. This function signature makes is hard
to keep adding options to these error creation functions, like an error
code, so this commit refactors them to take a single argument: an
options object containing `title` and `description` properties.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-20 12:23:32 -04:00
Juan Cruz Viotti
b93fd86092 chore: perform GNU/Linux builds on Debian Jessie docker containers (#1319)
We recently hit an issue where Etcher builds produced on Ubuntu relied
on a too new glibc version, making them incompatible with GNU/Linux
distributions such as Debian Jessie.

As a solution, we will start producing builds on Debian Jessie, which
ensures that the builds will be compatible with the majority of
GNU/Linux versions out there.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-20 12:23:13 -04:00
Juan Cruz Viotti
880ca257a6 chore: make electron-installer-debian an optional dependency (#1326)
We currently require this module to be available in the environment in
order to be able to build debian packages.

This commit adds it as an optional dependency, so we can have control
over the version that we use, to prevent any potential incompatibility.

We also update the `udif` package.json version to match what its on the
shrinkwrap file to avoid npm complaining about version mismatches.

See: https://github.com/resin-io/etcher/pull/1290
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-20 12:06:53 -04:00
Juan Cruz Viotti
96f586900c fix(GUI): catch EIO errors and display a user friendly message (#1318)
If we get EIO at this point, then it means that the writer did
everything it could to recover (like multiple retries), and the error
is truly an input/output error coming from the operating system.

In this commit, we show a nice user friendly message explaining what
happened, and advising users to try again with another drive, reader, or
port instead of showing an uncaught EIO error.

Change-Type: patch
Changelog-Entry: Show a friendly user message on EIO after many retries.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-20 12:01:43 -04:00
Juan Cruz Viotti
c3a41b172e chore: pass bintray environment variables to Docker containers (#1307)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-20 11:06:17 -04:00
Juan Cruz Viotti
586a6950b2 fix(GUI): send an "elevation cancelled" analytics event (#1310)
If the user cancels the elevation dialog, then no event is emitted,
making it hard to track down what happened after the flash button was
pressed.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-20 11:04:45 -04:00
Juan Cruz Viotti
2ec2ceea14 upgrade: drivelist to v5.0.19 (#1327)
- https://github.com/resin-io-modules/drivelist/pull/161
- https://github.com/resin-io-modules/drivelist/pull/156
- https://github.com/resin-io-modules/drivelist/pull/153

Change-Type: patch
Changelog-Entry: Various fixes for when drive descriptions contain special characters.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-20 10:49:40 -04:00
Ștefan Daniel Mihăilă
24fe1a6c89 upgrade: resin-corvus to 1.0.0-beta.26 (#1321)
This version solves the issue regarding some messages
getting console logged (and reaching Sentry) as "[object Object]".

Change-Type: patch
Changelog-Entry: Upgrade `resin-corvus` to 1.0.0-beta.26.
2017-04-19 11:07:50 -04:00
Juan Cruz Viotti
31aa73ce07
v1.0.0-rc.3 v1.0.0-rc.3 2017-04-15 00:18:35 -04:00
Jonas Hermsmeier
6c930e2d8d fix(image-stream): fix Apple disk image detection & reading (#1283)
This fixes two things: The format detection, and a bug in `udif`.

First, by categorizing the `.dmg` extension as compressed image,
`.isSupportedImage()` would attempt to detect the format after stripping
the extension, causing it to be misdetected.

Second, `udif`'s ReadStream didn't add the `dataForkOffset` to its
position when reading blocks, causing the wrong data to be read for some images,
in turn causing zlib to error on invalid headers.

Changes:
- Classify `.dmg` as `type: 'image'`
- Update `udif` to 0.8.0

Change-Type: patch
Changelog-Entry: Fix Apple disk image detection & streaming
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-15 00:17:41 -04:00
Juan Cruz Viotti
847b41f49a upgrade: etcher-image-write to v9.1.1 (#1306)
This version includes a fix to throw an `EUNPLUGGED` error instead of an
`UNKNOWN` one when unplugging an SD Card from an internal reader on
Windows.

Change-Type: patch
Changelog-Entry: Fix "UNKNOWN: unknown error" error when unplugging an SD Card from an internal reader on Windows.
See: https://github.com/resin-io-modules/etcher-image-write/pull/97
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-14 23:45:21 -04:00
Juan Cruz Viotti
e4a47611c0 upgrade: elevator to v2.2.2 (#1304)
This version prints debug messages to `stdout`.

See: https://github.com/resin-io-modules/elevator/pull/11
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-14 22:18:54 -04:00
Juan Cruz Viotti
0b500d2585 fix(GUI): correctly log debugging messages on Windows (#1303)
Windows will not react to dynamically set environment variables (e.g:
`process.env.MOUNTUTILS_DEBUG = '1'`), so in order to workaround this
limitation, we set `MOUNTUTILS_DEBUG` in
`lib/child-writer/writer-proxy.js` when spawning the CLI, and we also
set `DEBUG='*'` in `lib/start.js`, so it gets picked up by the child
writer module, which spawns the writer proxy by inheriting the
environment.
2017-04-14 16:41:00 -04:00
Juan Cruz Viotti
ebd2d85de7 upgrade: mountutils to v1.0.5 (#1302)
This version accepts a `MOUNTUTILS_DEBUG` environment variable to make
the module output extra logging information, which we enable in this
commit as well.

See: https://github.com/resin-io-modules/mountutils/pull/25
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-14 14:59:27 -04:00
Juan Cruz Viotti
c5a9a1fca4 fix(GUI): show a friendly message when the drive is unplugged half-way through (#1301)
This commit shows a user friendly message when Etcher loses access to
the drive while flashing/validating, and prevents the cryptic errors
from getting to Sentry.

See: https://github.com/resin-io-modules/etcher-image-write/pull/96
Change-Type: minor
Changelog-Entry: Show a user friendly message when the drive is unplugged half-way through.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-14 14:24:06 -04:00
Juan Cruz Viotti
e66d805672 feat(child-writer): log non-robot messages for debugging purposes (#1295)
Currently, if the child writer receives a message from the writer
process that is not a valid robot object, then it will throw an error.

Now, we check if the message is a robot message, and if so, we try to
parse it (throwing errors if its indeed a malformed/incomplete robot
message), however we log it if not.

The main motivation behind this feature is that it will allows us to
print debugging information on the mountutils module, and have it
redirected to DevTools.

Change-Type: minor
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-14 14:07:00 -04:00
Juan Cruz Viotti
468312b6cc upgrade: elevator to v2.2.1 (#1300)
This version improves the error message if the elevate.exe utility
failed.

See: https://github.com/resin-io-modules/elevator/pull/10
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-14 13:17:18 -04:00
Ștefan Daniel Mihăilă
8edc41dee0 upgrade: resin-corvus to 1.0.0-beta.25 (#1299)
This version handles better non-error objects sent to Sentry.

Change-Type: patch
Changelog-Entry: Improve error reporting accuracy.
2017-04-14 12:38:20 -04:00
Juan Cruz Viotti
5535111314 upgrade: elevator to v2.2.0 (#1298)
This version contains a patch to output debugging information.

See: https://github.com/resin-io-modules/elevator/pull/9
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-14 12:27:19 -04:00
Juan Cruz Viotti
0890b1e369 refactor(GUI): move SupportedFormatsModel to lib/shared (#1251)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-13 14:38:30 -04:00
Juan Cruz Viotti
64c8eb594b refactor(GUI): make OSWindowProgress a simple CommonJS module (#1253)
There is no need to tie this module to Angular by using an Angular
service.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-13 14:38:22 -04:00
Juan Cruz Viotti
55021376b5 tests(image-stream): ensure imageStream.getFromFilePath() returns a path (#1280)
This would have prevented https://github.com/resin-io/etcher/pull/1278
from happening.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-13 14:38:13 -04:00
Juan Cruz Viotti
3f7ec8a148 tests(image-stream): remove unnecessary big timeout (#1285)
See: https://github.com/resin-io/etcher/pull/1279#discussion_r110880004
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-13 14:38:05 -04:00
Juan Cruz Viotti
5f9b46b98b upgrade: etcher-image-write to v9.0.2 (#1286)
This release fixes an uncaught error when there is a validation error.

See: https://github.com/resin-io-modules/etcher-image-write/pull/94
Change-Type: patch
Changelog-Entry: Fix "function createError(opts) {}" error on validation failure.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-13 14:37:56 -04:00
Juan Cruz Viotti
a1d8f28fc2 upgrade: mountutils to v1.0.4 (#1294)
This version contains a fix for when unmounting a physical drive with no
logical volumes attached.

See: http://github.com/resin-io-modules/mountutils/pull/24
Change-Type: patch
Changelog-Entry: Fix "Unmount failed, invalid drive" error on Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-13 14:37:43 -04:00
Ștefan Daniel Mihăilă
5ace384607 upgrade: resin-corvus to 1.0.0.beta-24 (#1296)
This version fixes the release not being sent to Mixpanel.

Change-Type: patch
2017-04-13 14:30:04 -04:00
David Lechner
588c94a64f chore: fix debian package run script (#1290)
The rc2 debian package is not working because the path where the package files
is installed has changed. The change in paths comes from an upstream change
in the electron-installer-debian node package. So, updating the path here to
match the actuall install location.
2017-04-13 13:38:54 -04:00
Jonas Hermsmeier
7fc10b71e3 chore(package): fix codespell binary file warnings (#1289)
This avoids codespell printing warnings for binary files
which have been added recently (`.iso`, `.dmg`), as well as dotfiles (i.e. `.DS_Store`).

Change-Type: patch
2017-04-13 08:45:02 -04:00
Andrew Scheller
57045ef1f6 chore: small tweak to the jq-insert.sh syntax (#1287) 2017-04-12 18:33:03 -04:00
Juan Cruz Viotti
36822b1f91
v1.0.0-rc.2 v1.0.0-rc.2 2017-04-11 01:00:08 -04:00
Juan Cruz Viotti
68f87435de fix(CLI): throw error if image is inaccessible (#1281)
Consider the following scenario:

- The user selects an image from an external drive
- The user selects a drive
- The user unmounts/ejects the external drive
- The user clicks flash

The application state will contain an image path that is no longer
accessible, causing an ENOENT error when spawning the CLI process.

Change-Type: patch
Changelog-Entry: Display a user error if the image is no longer accessible when the writer starts.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-11 00:59:08 -04:00
Juan Cruz Viotti
6deec4bbb5
Revert "chore(ci): limit git clone depth (#1269)"
This reverts commit 02da44691459195ebed32d08dd30cb0586f417c2.
2017-04-11 00:56:52 -04:00
Juan Cruz Viotti
cf271100f5 fix(image-stream): throw user error if image is a directory (#1279)
If the user tries to drag and drop a directory to the application, then
he'll get a scary `EISDIR` error message. This commit catches this
error, and display a nice user friendly message instead.

Change-Type: patch
Changelog-Entry: Prevent uncaught `EISDIR` when dropping a directory to the application.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-11 00:34:21 -04:00
Juan Cruz Viotti
2af129d0b7 chore: add analytics token environment variables to Docker container (#1274)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-10 23:49:53 -04:00
Juan Cruz Viotti
85e1bdb650 chore: fix jq crashing on Windows when using relative paths (#1276)
`jq` crashes when setting a value on a relative file. We workaround the
issue by using `jq` in a pipe instead of passing the file to it as an
argument.

See: https://github.com/stedolan/jq/issues/1155
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-10 23:49:46 -04:00
Juan Cruz Viotti
c418bc6512 chore: remove duplicated curl dependency in Dockerfiles (#1275)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-10 23:49:37 -04:00
Juan Cruz Viotti
44094680fb fix(image-stream): return a path from the handler (#1278)
The `application/x-apple-diskimage` handler doesn't return a path,
causing an issue when fetching the image metadata, and trying using the
path to determine if its a supported image type.

Change-Type: patch
Changelog-Entry: Fix "Path must be a string. Received undefined" when selecting Apple images.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-10 23:49:22 -04:00
Juan Cruz Viotti
fc46958ac0 fix(image-stream): interpret iso9660 as application/octet-stream (#1277)
This is a regression caused by
https://github.com/resin-io/etcher/pull/1257, which introduced a new way
to detect mime types by using the `mime-types` module.

This module, contrary to `file-type`, will detect certain ISO files as
`application/x-iso9660-image`, which Etcher doesn't know how to handle,
and will therefore should at the user that the format is unsupported.

Change-Type: patch
Changelog-Entry: Don't interpret certain ISO images as unsupported.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-10 23:49:11 -04:00
Juan Cruz Viotti
53bc5a51e9
v1.0.0-rc.1 v1.0.0-rc.1 2017-04-10 17:01:15 -04:00
Juan Cruz Viotti
f87a690df1 fix(GUI): correctly reference the eta property in lib/gui/app.js (#1273)
See: https://github.com/resin-io/etcher/pull/1264/files#r110662965
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-10 16:57:20 -04:00
Ștefan Daniel Mihăilă
91a1c3d107 feat(GUI): use resin-corvus in AnalyticsService (#1208)
Change-Type: patch
Changelog-Entry: Start reporting errors to Sentry instead of to TrackJS.
Fixes: https://github.com/resin-io/etcher/issues/1027
2017-04-10 15:06:32 -04:00
Mico Piira
1d14f8ad08 docs(README): fix waffle.io badge (#1271) 2017-04-10 14:39:46 -04:00
Juan Cruz Viotti
1b68e9394b style(shared): fix given that is -> given that it typo (#1272)
See: https://github.com/resin-io/etcher/pull/1262#discussion_r110541438
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-10 14:36:01 -04:00
Benedict Aas
b28c345ba0 refactor(GUI): remove Angular from FlashStateModel and rename (#1264)
We remove the usage of Angular from 'FlashStateModel' and its usage
throughout the project comes under the new 'flashState' moniker.


Depends: https://github.com/resin-io/etcher/pull/1261
2017-04-10 14:30:21 -04:00
Andrew Scheller
07dad2a0ef chore: fix a CI script to 'properly fail' on Windows (#1270) 2017-04-10 10:06:32 -04:00
Benedict Aas
19dd2834fb fix(GUI): replace Math object usage in progressButton directive (#1263)
We were using `Math.min` in a progressButton's template expression,
however such object is not exposed to the Angular expression context.
2017-04-10 09:59:13 -04:00
Jonas Hermsmeier
f15587807a test: Use mocha with promises instead of callbacks (#1268)
This changes the test cases to just return the Promises,
to avoid timing out on failures and to provide better
error messages and stack traces.

Change-Type: patch
2017-04-09 21:30:58 +02:00
Juan Cruz Viotti
3cdd925c41 refactor: get rid of is-elevated (#1262)
This commit implements our own version of the `is-elevated` module. The
reason behind this is that `is-elevated` relies on lots of unnecessary
modules, that eventually require `spawn-sync` and `try-thread-sleep`,
which conditionally require dependencies that are not even declared in
their `package.json`, causing issues when concatenating the Etcher CLI.

See: https://github.com/resin-io/etcher/pull/1235
See: https://github.com/resin-io/etcher/pull/1228
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-04-08 20:15:17 -04:00
Jonas Hermsmeier
02da446914 chore(ci): limit git clone depth (#1269)
This may speed up cloning on CI services by reducing the clone depth.

Change-Type: patch
2017-04-08 20:14:46 -04:00
Andrew Scheller
810ced3907 chore: fix CI script to work when 'require'ing nested modules (#1267) 2017-04-08 20:00:43 -04:00