680 Commits

Author SHA1 Message Date
Juan Cruz Viotti
3537848d3d
chore: make test npm script run everything we run on the CI services (#1937)
The idea is that the `test` command will replace the recently introduced
`concourse-test` script.

`concourse-test` will become simply a call to `test` for now to ensure
backwards compatibility while we update Resin Concourse.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-27 13:29:55 -04:00
Juan Cruz Viotti
357f2183b5
chore: add Concourse related NPM scripts (#1933)
Our Electron Concourse pipeline is completely independent from the
application its testing (ie we can apply it to any other Electron app we
build with ease).

In order to keep such genericity, the application under test should
provide certain npm scripts that tell Concourse how to do specific tasks
on the repo, like install dependencies, in a build-system independent
fashion.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-20 16:06:09 -04:00
Juan Cruz Viotti
c586d9f54c
chore: get rid of npx (#1929)
We can live without it with a simple `PATH` trick at the top of the
Makefile (thanks @lurch!).

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-19 16:08:37 -04:00
Jonas Hermsmeier
abfa44a088 upgrade(package): Bump electron-builder 19.9.1 -> 19.40.0 (#1905)
Change-Type: patch
Connects To: #1914
2017-12-19 13:53:26 -04:00
Jonas Hermsmeier
b086e4c2a1
refactor(scripts): Update clean-shrinkwrap script (#1816)
* refactor(scripts): Update clean-shrinkwrap script

This updates the `postshrinkwrap` script to traverse the dependency tree
and remove all `from` fields to avoid inconsistent diffs across platforms,
environments and installs when shrinkwrapping anew.

* chore(shrinkwrap): Update npm-shrinkwrap.json

* fix(scripts): Ensure `resolved` field in shrinkwrap is HTTPS

* fix(scripts): Only strip "from" of registry packages

* fix(clean-shrinkwrap): Fix linter errors

* chore(shrinkwrap): Update npm-shrinkwrap.json

* fix(scripts): fix spelling typo

Change-Type: patch
2017-12-15 16:08:33 +01:00
Juan Cruz Viotti
f2c9404fc4
chore: setup a Spectron integration test suite (#1884)
- Add a `make test-spectron` target

- Install `spectron` and `mocha` (since we don't need to run the tests
  inside an Electron instance like in the case of `electron-mocha`)

- Add some example tests

Fixes: https://github.com/resin-io/etcher/issues/1870
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-13 13:51:16 -04:00
Juan Cruz Viotti
b703a6f5fb
feat(SDK): display Compute Modules even if host OS has no drivers (#1892)
This is the first step towards full usbboot Windows support. The driver
selector dialog will now display disabled devices to represent Compute
Modules even when Windows drivers are not installed to act on them.
These drives will state "Missing drivers."

Change-Type: minor
Changelog-Entry: Display connected Compute Modules even if Windows doesn't have the necessary drivers to act on them.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-13 13:37:34 -04:00
Jonas Hermsmeier
4c00a25968
v1.2.1 (#1906) 2017-12-07 16:43:58 +01:00
Juan Cruz Viotti
19b7ce0668
upgrade: resin-corvus to v1.0.0-beta.31 (#1902)
This version contains a couple of patches to ensure that the Mixpanel
library doesn't send any HTTP request to api.mixpanel.com unless the
user enabled analytics.

- https://github.com/resin-io-modules/resin-corvus/pull/35
- https://github.com/resin-io-modules/resin-corvus/pull/36

See: https://github.com/resin-io/etcher/issues/1772
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-05 11:04:23 -04:00
Jonas Hermsmeier
b1abc79942
v1.2.0 (#1846) 2017-11-27 15:37:48 +01:00
Jonas Hermsmeier
8e79e9e459
upgrade(package): Bump sudo-prompt 6.1.0 -> 8.0.0 (#1861)
This updates `sudo-prompt` from v6.1.0 to v8.0.0

Changes:

- v8.0.0:
  - Breaking: Windows: Set code page of command batch script to UTF-8
- v7.1.1:
  - readme: explicitly mention that no child process is returned
- v7.1.0:
  - Detect when PowerShell fails to launch command
  - Escape ampersand and other characters special to PowerShell
- v7.0.0:
  - Add status code to error on Windows and macOS
- v6.2.0:
  - Rename OS X to macOS

Change-Type: patch
2017-11-22 21:12:04 +01:00
Jonas Hermsmeier
a35ac7613e
fix(writer): Use a core streams variant of unbzip2-stream (#1862)
This fixes pipage blowing up on unbzip2-stream because it's
based on through streams (which don't implement `.unpipe()`),
by utilizing a custom version based on core streams.

Change-Type: patch
Changelog-Entry: Fix bzip2 streaming with the new pipelines
2017-11-20 22:32:34 +01:00
Jonas Hermsmeier
9e75547166
upgrade(ipc): Update node-ipc 8.9.2 -> 9.1.1 (#1836)
Change-Type: patch
2017-11-16 21:12:36 +01:00
Jonas Hermsmeier
5e77958106
feat(writer): Implement streaming pipelines (#1671)
This implements a new way of image write streaming under use of pipage and blockmap, which paves the way for a few things like using network locations as sources, and imaging of storage devices (aka backups). As it allows for mutation of the streaming pipeline while it's writing, it also facilitates the development of dynamic block-mapping.

Change-Type: minor
2017-11-14 19:54:10 +01:00
Benedict Aas
5771c0f56e fix: rid linux startup elevation (#1831)
We remove the Linux elevation meant for usbboot device access.

Reverts: https://github.com/resin-io/etcher/pull/1708
See: https://github.com/resin-io/etcher/issues/1819
Change-Type: minor
Changelog-Entry: Remove Linux elevation meant for usbboot.
2017-11-13 15:34:20 -04:00
Benedict Aas
433b2734bb feat: add sudo-prompt to start on linux (#1708)
We prompt the user with a sudo-prompt upon launch on Linux-based systems
to ensure the program has enough permissions for features needed
throughout the program's runtime.

Changelog-Entry: Add a sudo-prompt upon launch on Linux-based systems.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-25 11:27:40 -04:00
Jonas Hermsmeier
dd0bb43616 upgrade(package): Bump resin-corvus to beta.30 (#1795)
This updates resin-corvus to v1.0.0-beta.30, fixing an issue
with attempting to use https transport in browserland.

Change-Type: patch
2017-10-20 22:11:13 +02:00
Jonas Hermsmeier
32399ba8a1 upgrade(package): Update Electron v1.6.6 -> v1.7.9 (#1784)
This updates Electron from v1.6.6 to v1.7.9

Change-Type: patch
Changelog-Entry: Update Electron to v1.7.9
2017-10-18 21:19:23 +02:00
Juan Cruz Viotti
179597b86f upgrade: drivelist to v5.2.4 (#1755)
See: https://github.com/resin-io-modules/drivelist/pull/229
Change-Type: patch
Changelog-Entry: Fix permission denied issues when XDG_RUNTIME_DIR is mounted with the `noexec` option.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-09 10:47:56 +01:00
Juan Cruz Viotti
f6a7b2add6 feat: implement usbboot adapter (#1686)
This commit installs `node-usb` v1.3.0 from GitHub, since that version
was never published to NPM, and is the only one that works with Visual
Studio 2015 (see https://github.com/tessel/node-usb/issues/109).

The usbboot communicates with a Raspberry Pi / Amber through USB and
eventually mounts it as a block device we can write to.

This feature bundles bootcode.bin and start.elf from the original
usbboot implementation.

The flow is the following:

- On each scan, the usbboot scanner will try to get a usbboot compatible
  USB device to the next "phase", until they are all transformed to
  block devices the user can flash to as usual

Change-Type: minor
Changelog-Entry: Integrate Raspberry Pi's usbboot technology.
Fixes: https://github.com/resin-io/etcher/issues/1541
See: https://github.com/raspberrypi/usbboot
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-06 14:19:35 +01:00
Jonas Hermsmeier
cb7117a36b upgrade(node-stream-zip): 1.3.4 -> 1.3.7 (#1730)
This fixes RangeErrors occurring with some zip files.

**Changes:**

- Fixed compatibility with node.js v0.10
- Fix error unpacking archives with a special comment
- Fix descriptive error messages

Change-Type: patch
Changelog-Entry: Fix Etcher being unable to read certain zip files
2017-09-22 20:15:29 +03:00
Juan Cruz Viotti
077eb5b079 upgrade: mountutils to v1.2.2 (#1712)
See: https://github.com/resin-io-modules/mountutils/pull/45
Change-Type: patch
Changelog-Entry: Retry ejection various times before giving up on Windows.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-09-08 15:43:46 +02:00
Jonas Hermsmeier
e654311997 chore(package): Bump resin-corvus to 1.0.0-beta.29 (#1720)
This updates `resin-corvus` to version 1.0.0-beta.29, switching
Mixpanel and Sentry analytics to HTTPS transports.

Changes:

- fix(sentry): Default to HTTPS transport
- fix(mixpanel): Use HTTPS transport
- test: Use standardjs for linting
- doc(README): Add CI & npm badges
- fix(ci): Fix Appveyor Node version matrix
- refactor: Ensure Node 4 compatibility

Change-Type: patch
Connects To: #1718
2017-09-06 11:12:18 +02:00
Juan Cruz Viotti
0d0ddd549b upgrade: drivelist to v5.1.8 (#1714)
Fixes: https://github.com/resin-io/etcher/issues/1699
Change-Type: patch
Changelog-Entry: Try to use `$XDG_RUNTIME_DIR` to extract temporary scripts on GNU/Linux.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-09-04 09:56:41 -04:00
Juan Cruz Viotti
9f4712f1f8 refactor: use an SDK orchestrator to implement drive scanning (#1707)
This is a major first step towards adopting an SDK architecture. This
commit creates an SDK adaptor with a `.scan()` function that uses
`drivelist` under the hood. Then, an SDK orchestrator is used to provide
drive scanning capabilities to the GUI.

Here's a list of some particularly interesting changes:

- The drives returned by the SDK adaptor now have a "pending" and an
  "adaptor" property. The "pending" property is a boolean flag that
  determines if the drive is ready to be used (this will come handy for
  usbboot), while the "adaptor" property simply contains the name of the
  adaptor that drive came from

- The GUI drive scanner Rx implementation was replaces with a "promise
  loop." Before, the drive scanning routine would be called every 2
  seconds (without waiting for the previous scan to complete), while
  now, the next scan happens *after* the previous scan completes. For
  this reason, I reduced the drive scanning interval timeout to match
  the timing we had before

Change-Type: patch
See: https://github.com/resin-io/etcher/pull/1686
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-24 17:24:48 -04:00
Juan Cruz Viotti
f9d7dd2977 upgrade: drivelist to v5.1.5 (#1692)
See https://github.com/resin-io-modules/drivelist/pull/206

Change-Type: patch
Changelog-Entry: Fix "Couldn't scan the drives: An unknown error occurred" error when there is a drive locked with BitLocker.
Fixes: https://github.com/resin-io/etcher/issues/1687
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-21 17:59:16 -04:00
Juan Cruz Viotti
b97d7080e5
v1.1.2 2017-08-07 11:26:15 -04:00
Juan Cruz Viotti
b8709d10c7 upgrade: drivelist to v5.1.4 (#1675)
Change-Type: patch
Changelog-Entry: Improve Windows drive detection error codes.
See: https://github.com/resin-io-modules/drivelist/pull/204
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-07 08:10:38 -07:00
Juan Cruz Viotti
d8e31665a0 chore: follow standardjs guidelines (#1664)
- Extend the `standard` ESLint configuration
- Remove ESLint rules that are defined in the `standard` configuration
- Get rid of semi-colons

See: https://github.com/resin-io/etcher/pull/1657
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-03 09:01:54 -04:00
Juan Cruz Viotti
4b4e6ea035 upgrade: drivelist to v5.1.3 (#1653)
This version contains the following fixes:

- Fix "Couldn't initialize the scanner: An unknown error occurred" error
- Fix "Couldn't scan the drives: An unknown error occurred" where there
  is a mounted virtual drive

See: https://github.com/resin-io-modules/drivelist/blob/master/CHANGELOG.md
Change-Type: patch
Changelog-Entry: Fix various drive scanning Windows errors.
Fixes: https://github.com/resin-io/etcher/issues/1646
Fixes: https://github.com/resin-io/etcher/issues/1639
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-02 10:12:27 -04:00
Benedict Aas
70ad86534d feat(GUI): make size units closest relative (#1539)
We make the size units used the closest relative unit through a new
filter `closestUnit` replacing the old `gigabyte` filter.

Changelog-Entry: Round byte sizes to the more appropriate unit.

* remove filters folder

* new shrinkwrap, add to package.json

* test
2017-08-01 17:34:13 -04:00
Juan Cruz Viotti
a63b6bf18c fix(CLI): pass required arguments to flashComplete message (#1630)
The `flashComplete` message takes the drive object and the image
basename as arguments. This was updated on the GUI, but causes the CLI
to throw an error upon completion.

Change-Type: patch
Changelog-Entry: Fix "imageBasename is not defined" error on the CLI.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-01 12:32:50 -04:00
Juan Cruz Viotti
7908c39ef4
v1.1.1
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-25 09:50:24 -03:00
Juan Cruz Viotti
f53a0af150 upgrade: mountutils to v1.2.1 (#1623)
This version contains a fix to a set of very recurrent "Unmount failed"
macOS errors.

See: https://github.com/resin-io-modules/mountutils/pull/44
Change-Type: patch
Changelog-Entry: Fix most "Unmount failed" errors on macOS.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-24 09:36:31 -03:00
Juan Cruz Viotti
1563a2392d
v1.1.0
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-20 14:48:30 -03:00
Juan Cruz Viotti
a19b0e028f upgrade: drivelist to v5.0.27 (#1607)
This new version contains the following PRs that we're interested about:

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

To reduce the amount of debug logging we produce (see
https://github.com/resin-io/etcher/pull/1600).

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

To properly handle spawning EAGAIN errors.

Fixes: https://github.com/resin-io/etcher/issues/1578
Change-Type: patch
Changelog-Entry: Retry various times on EAGAIN when spawning drive scanning scripts.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-19 15:23:32 -03:00
Benedict Aas
227533a7f9 upgrade(package): update resin-corvus to 1.0.0-beta.28 (#1604)
Closes: https://github.com/resin-io/etcher/issues/1465
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-18 14:54:03 -03:00
Juan Cruz Viotti
ca9136d1cb chore: send analytics about package types (#1570)
This commit adds a `packageType` property to package.json, which is set
according to the package type of the Etcher target (e.g: dmg, nsis, deb,
etc).

This information is then sent to Mixpanel as the `packageType` property
of the "Application start" event.

Change-Type: patch
Changelog-Entry: Send anonymous analytics about package types.
Fixes: https://github.com/resin-io/etcher/issues/1328
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-13 10:13:56 -04:00
Juan Cruz Viotti
77c60b91c6 upgrade: drivelist to v5.0.25 (#1574)
This version contains various improvements on the drive detection system
mainly on Windows. The improvements can be summarized as follows:

- Drivelist no longer spawns a .bat script to perform its job. This
  means that a lot of spawning related issues are now fixed

- Drivelist doesn't fetch drive sizes from WMI anymore, which was known
  to incorrectly report a very small size for certain drives, causing
  the famous "0.0 GB" Windows issues (see
  https://github.com/resin-io-modules/drivelist/issues/142)

- Cleanup temporary scripts after execution

This PR also sets the DRIVELIST_DEBUG environment variable to enable
debug information from Windows' drivelist implementation.

Change-Type: patch
Changelog-Entry: Implement Windows drive detection using C++
Changelog-Entry: Fix various Windows `.bat` spawning issues
Changelog-Entry: Fix 0.0 GB Windows drive detection issues
Changelog-Entry: Cleanup drive detection temporary scripts created for other operating systems
Fixes: https://github.com/resin-io/etcher/issues/1108
Fixes: https://github.com/resin-io/etcher/issues/1054
Fixes: https://github.com/resin-io/etcher/issues/995
Fixes: https://github.com/resin-io/etcher/issues/1483
Fixes: https://github.com/resin-io/etcher/issues/1142
Fixes: https://github.com/resin-io/etcher/issues/1571
See: https://github.com/resin-io-modules/drivelist/blob/master/CHANGELOG.md
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-12 15:18:05 -04:00
Juan Cruz Viotti
a5b1a92920 chore: add eslint-jsdoc-plugin to eslint (#1585)
This plugin helps us detect some things the built-in jsdoc rules can't,
like whether there is an example or not.

As expected, the addition of this plugin helped detect some minor JSDoc
issues.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-12 10:19:08 -04:00
Jonas Hermsmeier
58fa59e06d upgrade(package): Update udif 0.9.0 -> 0.10.0 (#1586)
This updates `udif` from 0.9.0 to 0.10.0, fixing two bugs;

* [57ddf788] fix(readstream): Avoid read-before-open situations
* [6333a183] fix(image): try/catch parsing the resource fork plist

[57ddf788]: 57ddf788b7
[6333a183]: 6333a183f6

Change-Type: patch
2017-07-12 10:21:38 +02:00
Juan Cruz Viotti
6ffba92dc8 chore: make use of pkg to package the Etcher CLI (#1547)
This commit replaces our home-grown CLI packaging mechanism based on
browserify + node-static-entry-point with pkg, an open source tool to
package Node.js applications for distribution.

Some highlights:

- Removing browserify got rid of a lot of dependencies from
  npm-shrinkwrap.json

- pkg currently has an issue where macOS binaries can't be code-signed
  (https://github.com/zeit/pkg/issues/128), therefore this commit
  comments-out the binary signing section for that operating system

- pkg currently has an issue where Windows binaries can't be branded
  (https://github.com/zeit/pkg/issues/149), therefore this commit
  comments-out the branding section for that operating system

See: https://github.com/zeit/pkg
Fixes: https://github.com/resin-io/etcher/issues/1531
Fixes: https://github.com/resin-io/etcher/issues/1450
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-11 14:37:14 -04:00
Juan Cruz Viotti
4dc56f4678 refactor(GUI): decouple localStorage from the redux store (#1569)
We're currently persisting the user settings in localSettings by using a
redux plugin called redux-localstorage. As a way to decouple the redux
store from a technology that is browser specific, this commit makes the
following changes:

- Create local-settings.js, which is concerned with managing settings in
  a persisting location

- Decouple the redux store from the persisting storage method

- Extend the settings model to persist settings, cache reads, etc

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-06 17:49:13 -04:00
Juan Cruz Viotti
1b695a49e9 upgrade: electron-builder to v19.9.1 (#1548)
- Exclude *.dll/*.exe files from the asar in non-Windows operating
  systems (from 19.8.0)

- Correctly parse boolean flags in `--extraMetadata` (in v19.9.0)

See: https://github.com/electron-userland/electron-builder/releases/tag/v19.9.1
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-06 13:51:55 -04:00
Jonas Hermsmeier
80b588683e feat(image-stream): Read MBR & GPT in .getImageMetadata() (#1248)
* feat(image-stream): Read MBR & GPT in .getImageMetadata()
* feat(gui): Display warning when image has no MBR
* test(image-stream): Update .isSupportedImage() tests
* feat(image-stream): Normalize MBR & GPT partitions
* test(image-stream): Add partition info
* feat(image-selection): Send missing part table event
* test(image-stream): Add GPT test image

Change-Type: minor
2017-07-05 16:18:02 +02:00
Juan Cruz Viotti
53d8118b8f chore: don't remove optional dependencies in clean-shrinkwrap.js (#1551)
If we include a platform specific optional dependency in the shrinkwrap
file, then npm will insist in installing it even if the platform doesn't
match. As a solution, we figured out we can avoid putting this platform
specific optional dependencies in the npm-shrinkwrap.json file.

In order to do this, we currently have a script called
`clean-shrinkwrap.js` that runs *before* any `npm shrinkwrap` file (its
a `preshrinkwrap` npm script) that deletes all the platform specific
modules we know about using `npm rm`.

The problem with this approach is that `npm rm` will remove the module's
code from `node_modules`, which means that if we run `npm shrinkwrap`,
we will lose certain optional dependencies, that may be needed at a
later stage.

The solution is to modify the `clean-shrinkwrap.js` script to parse
`npm-shrinkwrap.json`, and manually delete the entries that we want to
omit. Also, the script needs to be run *after* `npm shrinkwrap`, so we
change the npm script name to `postshrinkwrap`.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-03 10:30:04 -04:00
Juan Cruz Viotti
d8e9cb93b7 chore: move all electron-builder configuration to electron-builder.yml (#1544)
The electron-builder configuration we're putting in package.json is
growing. To make it easier to read and edit, we'll move the whole
`build` property into a configuration file called
`electron-builder.yml`.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-27 10:15:38 -04:00
Juan Cruz Viotti
cd4cff7e43 chore: remove npm ranges from package.json (#1549)
We don't make use of npm ranges at all (every dependency and its
subdependencies are shrinkwrapped). Removing npm ranges allows us to
simplify our clean-shrinkwrap.js script to get rid of platform specific
optional dependencies, and their subdependencies.

See: https://github.com/resin-io/etcher/pull/1514
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-26 18:49:51 -04:00
Juan Cruz Viotti
a7ac28b717 chore: make use of electron-builder to build GNU/Linux packages (#1520)
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-23 20:10:51 -04:00
Juan Cruz Viotti
840388e8c5 chore: don't extract native dependencies out of the asar (#1542)
Turns out add-ons are loaded just fine from the asar now.

See: https://github.com/electron-userland/electron-builder/issues/1723
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-23 18:57:57 -04:00