3287 Commits

Author SHA1 Message Date
Juan Cruz Viotti
296a554637
Revert "chore: make use of resin.io's Docker base images"
This reverts commit d39b4ba7d7687a7eea72cbf7b8702f8ea122fb39.
2017-05-31 10:51:27 -04:00
Benedict Aas
b56a39e576 style(GUI): normal weight message on success page (#1469)
We make the fonts a regular weight instead of bold on the success page's
fallback banner.

Changelog-Entry: Minor style improvements to the fallback success page banner.
2017-05-30 09:36:33 -04:00
Benedict Aas
7898358617 fix(GUI): stop settings overflow into footer (#1468)
By removing the 'advanced' sub-header we stop the settings from
overflowing into the footer.

Fixes: https://github.com/resin-io/etcher/issues/1383
Changelog-Entry: Remove "Advanced" settings subtitle.
2017-05-30 09:34:45 -04:00
Juan Cruz Viotti
9a3900debb chore: make use of resin.io's Docker base images (#1481)
Resin.io already publishes multi-arch Docker base images running Jessie,
which is Debian version we wanted before falling back to Ubuntu 12.04.

The main reason behind this change is to be able to use other resin.io
base images (like ARM ones) without requiring a lot of per-base-image
changes.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-29 20:45:24 -04:00
Benedict Aas
dcb152aa00 fix(GUI): don't break up size number in drive selector (#1467)
We make the size number in the drive selector stay whole through
the `word-break: keep-all` CSS property, ensuring that it doesn't
partially overflow to the next line.

See: https://github.com/resin-io/etcher/issues/1437
Changelog-Entry: Don't break up size numbers in the drive selector.
2017-05-26 07:36:32 -04:00
Andrew Scheller
2e50ad802f chore(docker): Change APT mirror used by the Ubuntu12.04 32bit docker image (#1471)
Previously it was using http://ubuntu.stu.edu.tw but this host is no longer
active, which was causing all the 32bit Linux TravisCI builds to fail.
2017-05-25 19:06:18 +02:00
Juan Cruz Viotti
1e169315fd refactor(GUI): turn the update notifier modal into a native dialog (#1359)
Electron v1.6.1 introduced checkbox support to the native message
dialog, giving us everything that was needed to implement the update
notifier modal using a native dialog.

This change allows us to get rid of a lot code.

See: https://github.com/electron/electron/pull/8590
Change-Type: patch
Changelog-Entry: Turn the update notifier modal into a native dialog.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-23 19:06:35 -04:00
Benedict Aas
3df6cd07d0 feat(GUI): add metadata and icon to notifications (#1455)
We add the image filename, its destination drive, and application icon
to the notifications.

See: https://github.com/resin-io/etcher/issues/1443
Changelog-Entry: Add image name, drive name, and icon to notifications.
2017-05-22 15:06:32 -04:00
Juan Cruz Viotti
8e681b5534 fix(CLI): get rid of Browserify absolute path workaround (#1449)
We encountered a Browserify bug when releasing the CLI, where absolute
paths would be hard-coded in the final bundle. Since we were in the
middle of a release process, we added a quick and dirty
search-and-replace workaround on `concatenate-javascript.sh`.

After the release, we submitted a PR to Browserify which fixes the
issue. This commit makes use of my personal fork to be able to use such
fix while it gets merged to the main project.

See: https://github.com/substack/node-browserify/pull/1725
See: https://github.com/resin-io/etcher/pull/1409
Fixes: https://github.com/resin-io/etcher/issues/1429
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-22 11:33:09 -04:00
Juan Cruz Viotti
a12abc2a6c chore: unify CI scripts (#1434)
Currently we have almost equal CI scripts implemented in bash (for
Travis), and batch (for Appveyor). This commit takes advantage of MinGW
bash to unify all the scripts as bash scripts.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-22 09:20:28 -04:00
Juan Cruz Viotti
705e273400 fix(GUI): catch EACCES when querying S3 packages (#1463)
When the user is behind a firewall, then the HTTP request to query the
latest available version from S3 may throw an EACCES error, eventually
causing a confusin "You don't have access to this resource" error
window.

Change-Type: patch
Changelog-Entry: Fix "You don't have access to this resource" error at startup when behind a firewall.
Fixes: https://github.com/resin-io/etcher/issues/1458
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-20 14:47:50 -04:00
Juan Cruz Viotti
78f36dfd16 chore: track python dependencies with pip (#1447)
We're currently hardcoding various pip dependencies in
`appveyor-install.bat` and `travis-install.sh`.

This commit moves all the dependencies to a `requirements.txt` file in
the root of the project, and makes every install script run `pip install
-r requirements.txt`.

See: https://github.com/resin-io/etcher/pull/1401#discussion_r116547053
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-18 16:35:06 -04:00
Juan Cruz Viotti
30ed217c79 chore: create installers (but don't publish) on every pull request (#1365)
This allows us to catch changes that break our installer builds before
merging the problematic changes.

As a way to simplify the CI configuration files, this commit introduces
an `installers-all` Makefile target that builds all installers.

This commit also replaces all the `cp -rf` calls with `cp -RLf` in
Makefile to avoid some weird hard link Appveyor issues.

See: https://github.com/resin-io/etcher/pull/1078
See: https://github.com/resin-io/etcher/pull/1354
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-17 23:00:59 -04:00
Juan Cruz Viotti
a74e6b53cd chore: fix lzma-native not building for the x86 Linux CLI (#1448)
There are various problems that contributed to this issue:

- `node-pre-gyp` doesn't detect the 6.10.3 node version. We reverted to
  6.1.0, which the module recognised, and which shares the same v8 ABI

- Passing `--force` to `npm install` causes npm to swallow any errors
  and silently continue

- The x86 Docker container has problems writing to `$HOME/.node-gyp`.
  The solution is to enable `unsafe-perm` given that the container is
  running as `root`

Fixes: https://github.com/resin-io/etcher/issues/1444
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-17 17:10:00 -04:00
Andrew Scheller
57e29a5725 chore: Check for the commands used by electron-installer-debian (#1446) 2017-05-17 13:59:18 +01:00
Juan Cruz Viotti
369cfa7e88 refactor: address review comments from #1401 (#1433)
See: https://github.com/resin-io/etcher/pull/1401#pullrequestreview-37459059
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-15 13:17:51 -04:00
Juan Cruz Viotti
1048150654 chore: check that there are no unstaged shrinkwrap changes (#1379)
See: https://github.com/resin-io/etcher/pull/1372
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-15 12:58:20 -04:00
Benedict Aas
697c86362c feat(GUI): add success page resin referrer (#1430) 2017-05-15 11:24:48 -04:00
Jonas Hermsmeier
d8b48e6373 doc(CLI-INSTALLATION): Make headings h3 (#1419) 2017-05-12 15:03:54 +02:00
Andrew Scheller
b04d7ad8f2 docs(CLI): move the CLI installation instructions to a separate page (#1418) 2017-05-12 13:30:09 +01:00
Juan Cruz Viotti
05692b9947 docs(CLI): add installation instructions (#1417)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-12 11:20:46 +01:00
Juan Cruz Viotti
3203eb5eda
v1.0.0
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
v1.0.0
2017-05-12 01:09:35 -04:00
Benedict Aas
2c26b4c6ac feat(GUI): dynamic finish page (#1368)
* feat(GUI): dynamic finish page

We implement an externally loaded dynamic finish page in React with
`react2angular`. If the Internet connection is unreliable or unavailable, or a
non-200 HTTP response is returned we display a fallback default finish banner.

Change-Type: minor
Changelog-Entry: Implement a dynamic finish page.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-12 01:07:24 -04:00
Juan Cruz Viotti
5c33abca21 fix: add a delay before the final unmount on success (#1416)
If the user has the "Unmount on success" setting enabled, then Etcher
will unmount the drive after ther flashing process completed, right
after closing the drive file descriptor.

Turns out macOS will attempt to re-mount a drive once its file
descriptor gets closed, which means that if we try to unmount too fast,
then the drive will get re-mounted again.

As a naive solution, we add a timeout before finally unmounting the
drive. Keep in the mind this is only a temporary solution until we fix
mountutils to do the right thing.

See: https://github.com/resin-io/etcher/pull/1414
Fixes: https://github.com/resin-io/etcher/issues/1385
Change-Type: patch
Changelog-Entry: Prevent drive from getting re-mounted in macOS even when the unmount on success setting is enabled.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-12 00:40:08 -04:00
Juan Cruz Viotti
b7f871607e fix(GUI): ignore ECONNRESET and ECONNREFUSED when querying S3 (#1415)
Querying S3 to determine the latest available versions might throw
`ECONNRESET` and `ECONNREFUSED`. This commit extends the
`s3Packages.getRemoteVersions()` function to handle these errors and
return no available version if so, like we already do with other similar
HTTP errors.

Change-Type: patch
Changelog-Entry: Fix `ECONNRESET` and `ECONNREFUSED` errors when checking for updates on unstable connections.
Fixes: https://github.com/resin-io/etcher/issues/1396
Fixes: https://github.com/resin-io/etcher/issues/1388
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-11 21:20:03 -04:00
Juan Cruz Viotti
babe12cd7b fix(GUI): handle spaces in installation path when elevating on Windows (#1411)
Etcher will get stuck at "Starting..." when executing the application on
a directory that contains spaces, like "C:\Program Files (x86)".

The problem is that the command is not quoted correctly when passed to
`cmd.exe /c`. This commit addresses the following specific problems:

- Quote the whole argument to `cmd.exe /c`
- Quote each individual argument after `call`

Change-Type: patch
Changelog-Entry: Fix application stuck at "Starting..." on Windows.
See: https://github.com/resin-io/etcher/pull/1376
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-11 18:05:40 -04:00
Jonas Hermsmeier
bb4d352da0 doc(github): Add question about flashed image to issue template (#1413) 2017-05-11 16:10:32 -04:00
Juan Cruz Viotti
9c055fb165 fix(CLI): workaround absolute paths in Browserify bundles (#1409)
For some strange reason, Browserify will hardcode absolute paths from
the machine that generated the bundle to be able to resolve `__dirname`
and `__filename` calls. This makes no sense, given that it means that
the Browserify bundle will not work when we move it to another machine,
which went undetected probably for months.

The Browserify community apparently makes modules to fix this particular
issue (like `bundle-collapser`, and `intreq`), however none of this seem
to solve the problem for the Etcher CLI bundle.

I also gave https://github.com/zeit/pkg a go, however I gave up after
not being able to make use of native modules (nothing seems to work; the
packager result will simply not find the addons).

Finally, I ended up making the following workarounds:

- Edit the Browserify bundle file to use its own `__dirname` to
  dynamically resolve the values of `__dirname` and `__filename` of the
  files it contains

- Patch `lzma-native` to statically require its add-on rather than
  relying on dynamic requires from `node-pre-gyp`, which makes it
  impossible to resolve on the final bundle

See: https://github.com/resin-io/etcher/issues/355
See: http://stackoverflow.com/questions/21993073/browserify-with-paths-to-folders-in-my-system
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-11 15:37:45 -04:00
Juan Cruz Viotti
b02da2d0cd chore(CLI): fix cli-develop Make target headers version (#1407)
The `cli-develop` target was pointing `node-gyp` to the Electron
headers, which caused native add-ons to not work.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-11 06:51:49 -04:00
Benedict Aas
69a982bf8d refactor(GUI): remove analytics angular dependency (#1387)
We rename `AnalyticsService` to `analytics` and remove its dependency on
Angular.
2017-05-10 20:27:54 -04:00
Juan Cruz Viotti
66547c5abd chore: replace wget with curl on node-static-entry-point-download.sh (#1406)
See: https://github.com/resin-io/etcher/pull/1365
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-10 19:28:12 -04:00
Juan Cruz Viotti
159cc24e78 upgrade: resin-cli-visuals to v1.3.1 (#1404)
This version upgrades `drivelist` to v5.0.20, which inlines the scripts
as a JSON file.

See: https://github.com/resin-io-modules/resin-cli-visuals/pull/41
See: https://github.com/resin-io-modules/resin-cli-visuals/blob/master/CHANGELOG.md
See: https://github.com/resin-io/etcher/issues/355
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-10 18:02:15 -04:00
Juan Cruz Viotti
777ad14762 chore: upgrade npm-shrinkwrap.json file (#1405)
Ensure that the `npm-shrinkwrap.json` is up to date.

These changes were backported from
https://github.com/resin-io/etcher/pull/1379, since it will take a while
for that PR to get merged.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-10 17:21:48 -04:00
Juan Cruz Viotti
78705165f0 upgrade: drivelist to v5.0.20 (#1402)
This version includes the following fix:

- https://github.com/resin-io-modules/drivelist/pull/164

The above change is also a huge step forward to finalizing the Etcher
CLI packaging story.

See: https://github.com/resin-io/etcher/issues/355
See: https://github.com/resin-io-modules/drivelist/blob/master/CHANGELOG.md
Fixes: https://github.com/resin-io/etcher/issues/1395
Change-Type: patch
Changelog-Entry: Fix error on startup when Windows username contained an ampersand.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-10 15:19:35 -04:00
Juan Cruz Viotti
d521fbbd2c chore(CLI): minify Etcher CLI code (#1401)
UglifyJS v3 was recently released, which includes support for
compressing ES6 code.

This commit introduces the following changes:

- Add a boolean `-m` option to `concatenate-javascript.sh`, which when
  set, will minify the final concatenated JavaScript file

- Install `uglify-es` in the CI servers

See: https://news.ycombinator.com/item?id=14285179
See: https://github.com/mishoo/UglifyJS2/tree/harmony
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-10 15:15:41 -04:00
Benedict Aas
b6aa5ada30 refactor(GUI): central error/warning messages function (#1193)
* Centralise drive error/warning messages with a function
  `.getDriveImageCompatibilityStatuses` in `lib/shared/drive-constraints.js`
  -- tests included
* Fix an error where several labels show at once
* Clarify the source drive label to 'Drive Contains Image'
* Remove label icons and make text bold to match Zeplin's design

Closes: https://github.com/resin-io/etcher/issues/1143
Closes: https://github.com/resin-io/etcher/issues/1144
2017-05-10 13:52:20 -04:00
Daniel Aleksandersen
d76a6dff89 doc(GUI): suggest BootCamp as an alternative when flashing Windows images (#1393)
* Specify that Rufus is only an option for Windows.
* Suggest Apple Boot Camp Assistant (built-in) as an alternative for macOS users.
2017-05-10 11:50:36 -04:00
Juan Cruz Viotti
ecb8dd29b7 upgrade: etcher-image-write to v9.1.3 (#1400)
This version gets rid of the `diskpart` optional dependency:

- https://github.com/resin-io-modules/etcher-image-write/pull/101

which will simplify the way we manage our `npm-shrinkwrap.json` file.

See: https://github.com/resin-io/etcher/pull/1379
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-10 11:47:44 -04:00
Andrew Scheller
bfd2f2bf57 style(settings): Clarify meaning of the "Report Errors" button (#1392)
To make it clear that this actually controls the reporting of errors back to resin.io, and not the reporting of errors to the user.

See #1383
2017-05-10 16:13:07 +01:00
Juan Cruz Viotti
7ddc5d525c refactor: address code review comments from #1366 (#1390)
See: https://github.com/resin-io/etcher/pull/1366
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-09 19:33:45 -04:00
Benedict Aas
efa7f986a4 fix(GUI): bound flash progress percentage within 0-100 (#1258)
We limit the Store state flashing percentage to be within 0-100,
throwing errors otherwise. Comes with tests.

Changelog-Type: Bound flash progress percentage within 0-100 range.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-09 19:24:44 -04:00
Jonas Hermsmeier
df74a2763c feat(image-stream): Make invalid images user errors (#1369)
This displays a user error if the reading the image causes an error,
instead of letting it fall through and get reported.
This is to avoid reporting errors that are not due to malfunction of the software,
but due to malformatted images.

Change-Type: minor
Changelog-Entry: Display nicer error dialog when reading an invalid image
2017-05-08 18:29:28 +02:00
Juan Cruz Viotti
60754250d9 chore: add ensure-npm-valid-dependencies.sh to sanity-checks make target (#1378)
We forgot to do so on the PR that introduces this script.

This commit also moves all the CI code to separate scripts.

See: https://github.com/resin-io/etcher/pull/1371
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-07 17:35:22 -04:00
Jonas Hermsmeier
9055b4b773 doc(contributing): Add section about binary diffs (#1380)
This adds instructions on how to set up human-readable binary diffs
with git for Etcher, which is useful when altering test images etc.
2017-05-07 14:59:11 -04:00
Juan Cruz Viotti
91784d6380 chore(codespell): add rpi-sdcard to the list of ignored extensions (#1377)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-07 14:58:40 -04:00
Juan Cruz Viotti
63fdb18286
v1.0.0-rc.5 v1.0.0-rc.5 2017-05-02 18:40:32 -04:00
Juan Cruz Viotti
b75dfd3ece feat(GUI): implement Windows elevation using a native module (#1366)
Sentry error reports showcase that elevation errors on Windows are one
of the most frequent Windows errors.

In order to perform Windows elevation, we ship compiled EXEs of a third
party CLI elevation application (http://code.kliu.org/misc/elevate/)
that has several limitations:

- We have the scan the output of the script to determine if a user
  cancelled the elevation request, which causes all sorts of issues on
  computers where English is not the main language

- The application displays a `cmd.exe` window for some milliseconds,
  which is bad UX, that we have to workaround by distributing a patched
  version of the tool

- The CLI application has to be spawned, which seems to be problematic
  if users have anti-virus software, leading to hard to debug issues

- We don't have any control if something goes wrong

For these reasons, we decided to implement our own elevation mechanism
in C++ as a Node.js add-on, based on the `elevate.exe` code we where
previously using.

Misc changes:

- Introduce a `lib/shared/bindings.js` module to easily require local native
  add-ons

- Install `cpplint` and configure it to lint C++ files

Note that for practical reasons, the C++ code lives in this repository
rather than in a separate module. We will release this functionality in
a more accessible way in the future as part of the Etcher SDK project.

Change-Type: patch
Changelog-Entry: Fix uncaught errors when cancelling elevation requests on Windows when the system's language is not English.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-02 18:36:57 -04:00
Juan Cruz Viotti
9881364e1d chore: make isstream a top level production development (#1373)
Our `npm-shrinkwrap.json` file contains two entries for the `isstream`
dependency. One of them is in the top level of the file, and marks
`isstream` as a development dependency.

The `request` module makes use of `isstream`, so there is another
instance of `isstream` nested inside `request` which is marked as a
production dependency.

Most NPM versions will realise that there are two instances of
`isstream`, and since one of them is a production development, it will
include it in the final package.

However, there are some NPM version, like 4.6.1, which will only
consider the top level entry, and completely omit `isstream` on the
final package, causing a "Cannot find module 'isstream'" error.

The solution was to manually update the shrinkwrap file to remove the
nested instance, and make the top level instance a production
development.

I don't think there is a way we can protect ourselves from these edge
cases. NPM should have recognised that the dependencies were compatible,
and not create a nested instance on the first place.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-01 19:39:21 -04:00
Juan Cruz Viotti
4f5179f5c9 chore: ensure there are no extraneous or invalid npm dependencies (#1371)
The `npm ls` command will exit with an error code if there are invalid
or extraneous dependencies.

This commits adds that command to `make sanity-checks`, so we can catch
those cases early one.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-01 19:39:03 -04:00
Juan Cruz Viotti
79d5f0e90c chore: remove etcher-latest-version from package.json (#1372)
This version is no longer used, and was removed from the shrinkwrap
file, but for some reason, we forgot to remove it from package.json.

See: https://github.com/resin-io/etcher/pull/1183
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-01 19:38:52 -04:00