2227 Commits

Author SHA1 Message Date
Jonas Hermsmeier
25d50fed74 doc: Merge running locally into contributing guide (#1640)
As recently several people have been asking for things
that are described in `RUNNING-LOCALLY.md`, but couldn't be
found in the `CONTRIBUTING.md`, this consilidates the two into
one single resource to look for on how to get started developing.

Change-Type: patch
2017-07-31 17:24:33 +02:00
Jonas Hermsmeier
07ac2ecf4c doc: Add link to commit guidelines to contributing guide (#1641)
This adds a reference to the commit guidelines to the contributing guide.
Fixes #1494

Change-Type: patch
2017-07-28 12:44:15 +02:00
Juan Cruz Viotti
7908c39ef4
v1.1.1
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
v1.1.1
2017-07-25 09:50:24 -03:00
Juan Cruz Viotti
b64ef705e8 chore: use old custom build system to create AppImages (#1625)
electron-builder seems to ship with an older AppImages version that
doesn't play very well with the custom AppImages elevation system we
created.

More particularly, we can't execute custom binaries inside the mounted
AppImage given that the mount point seems to lose permissions, owner,
and group file information.

This commit goes back to our old custom build system just for AppImages,
until we properly solve the problem, which will likely involve updating
the AppImages version in electron-builder.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-25 09:47:33 -03:00
Jonas Hermsmeier
36664fb251 fix(writer): Use final size if it's not an estimation (#1587)
This avoids running into the "flashstate percentage above 100%" error again.

Change-Type: patch
Changelog-Entry: Prevent "percentage above 100%" errors on DMG images.
2017-07-24 16:54:02 -03:00
Andrew Scheller
fa8f8151f6 docs(PUBLISHING): fix Etcher forum link (#1626) 2017-07-24 19:55:34 +01:00
Andrew Scheller
bebedf1a50 chore: make distclean now deletes build directory too (#1624) 2017-07-24 13:12:46 -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
09bf430a1e chore: remove the concept of target and host platforms (#1610)
Its very unlikely that we will ever support cross platform builds. For
that reason, let's simplify the whole Makefile by removing the concept
of target and host platforms.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-23 23:33:05 -03:00
Juan Cruz Viotti
b221914a3d fix(GUI): properly pass error object to "Flash error" event (#1619)
Simply running `_.merge` on an Error object results in an empty plain
object `{}` being sent to Mixpanel/Sentry.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-23 23:32:50 -03:00
Juan Cruz Viotti
1d66794450 fix(windows): include local native modules in final asar (#1616)
Etcher has local native code that gets built to `build/`, but that's not
being included inside the final asar.

The fix is to manually add the `*.node` files inside `build/Release` by
adding the appropriate wilcard to the `files` section of
`electron-builder.yml`.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
v1.1.0
2017-07-21 09:10:46 -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
Andrew Scheller
fa60a746a2 chore: fix typos in target-convert.sh (#1608) 2017-07-19 10:04:15 -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
4122e0bf1d refactor: move most models to lib/shared/ (#1596)
Now that the Redux store is no longer front-end dependent, we can move
most of the models to lib/shared. Currently, lib/shared is a mess, and
contains all sorts of functionality, however moving things out of the
GUI is the first step. Once we have everything decoupled, we can
organise all the code we have there.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-18 12:34:10 -03:00
Juan Cruz Viotti
3a42331875 fix(GUI): incorrect function call in FlashController (#1606)
This commit fixes a subtle issue where we are calling a non-existing
function of an error object, instead of using the exception reporter
module.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-18 11:47:26 -03:00
Juan Cruz Viotti
37b7ea3b0a refactor(image-stream): extract part of utils.js into mime.js (#1594)
This is a small refactoring commit that extracts the MIME related
function from utils.js into a new file called mime.js, and stores the
default image MIME type there as a constant, to avoid duplicating it in
multiple parts of the code.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-14 19:59:33 -04:00
Juan Cruz Viotti
a772877ae1 test(image-stream): move extraction timeout to a shared constant (#1599)
The image stream tests that extract images all have a 20s timeout, which
is manually set in all the suites related to extraction.

This commit extracts that number as a constant called DEFAULT_TIMEOUT.

See: https://github.com/resin-io/etcher/pull/1595
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-14 19:59:25 -04:00
Juan Cruz Viotti
76b6bdfd06 chore: cache ~/.pkg-cache in Travis CI and Appveyor CI (#1598)
Looks like pkg downloads node binaries from GitHub Releases, and GitHub
may impose a rate limiting if we download too many things from them in a
short period of time (likely to happen when there are many concurrent
PRs).

In order to mitigate this issue, this commit adds `$HOME/.pkg-cache`,
the directory where pkg stores node binaries, to the CI services cache.

See: https://github.com/resin-io/etcher/pull/1594
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-14 11:48:45 -04:00
Juan Cruz Viotti
2a8e91190c test(image-stream): increase DMG tests timeouts (#1595)
I caught an sporadic issue a couple of times, where the DMG tests would
exceed the default 2000ms mocha timeout. All the other image
decompression tests have a much higher timeout already, so this commit
adds the same timeout to the DMG tests file.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-13 17:41:44 -04:00
Juan Cruz Viotti
be8a638fce chore: pass --quiet to pip install (#1592)
This helps reduce a bit of output in the CI servers.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-13 16:15:03 -04:00
Juan Cruz Viotti
3e2da6a386 chore: cache electron-builder temporary files in macOS (#1591)
Our current Travis CI configuration caches temporary files created by
electron-builder, but only for GNU/Linux builds. In macOS, electron and
electron-builder store their cache at ~/Library/Caches, so we must cache
that as well.

This commit was motivated by the fact that most macOS builds are failing
for Electron package download timeouts.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-13 11:37:26 -04:00
Juan Cruz Viotti
ff547035be chore: only ignore top level directories in gitignore for some cases (#1588)
We accidentally added build/ to gitignore, causing any new files from
`scripts/build` to be ignored.

See: https://github.com/resin-io/etcher/pull/1547#discussion_r126790010
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-13 10:23:22 -04: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
439be1c222 refactor(image-stream): rename file variable to imagePath (#1589)
This is a small initial step towards decoupling the image stream
handlers from the concept of a "file."

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-13 09:30:28 -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
Benedict Aas
fc6c5bf585 refactor(GUI): deangular os-dialog and error module (#1546)
We remove the Angular dependency from `lib/gui/os/dialog` and
`lib/gui/modules/error` which is also now renamed to
`lib/gui/modules/exception`.

Changelog-Entry: Deangular the os-dialog and error modules
2017-07-11 17:21:48 -04:00
Juan Cruz Viotti
e52ef501bb chore: avoid brew taking a long time on macOS Travis builds (#1583)
- Homebrew now auto-updates before performing any installation, which
  can take quite some time. We can disable this by enabling
  HOMEBREW_NO_AUTO_UPDATE

- We can pass the --force-bottle option to `brew install` to force it to
  download pre-compiled binaries, and don't attempt any compilations

See: https://github.com/resin-io/etcher/pull/1582
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-11 17:12:44 -04: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
3ade1ea59b chore: don't install NSIS in Appveyor CI (#1584)
This dependency comes bundled with electron-builder, so there is no
reason to install it separately.

See: https://github.com/resin-io/etcher/pull/1582
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-11 14:14:15 -04:00
Juan Cruz Viotti
427a791de5 refactor(GUI): remove flash of white electron webContents workaround (#1575)
The lib/gui/etcher.js file contained a workaround to an Electron issue
that have since then been solved. In summary:

- Replace the `did-finish-load` event of `webContents` with
  `ready-to-show`, which is only emitted when the whole webview has
  finished loading

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-11 11:56:05 -04:00
Juan Cruz Viotti
dbe6ea68d5 chore: cache as most as possible from electron-builder (#1582)
These directories contain files downloaded by electron-builder (like
electron itself), that we can cache in Travis CI and Appveyor CI to
speed up builds.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-11 11:46:57 -04:00
Juan Cruz Viotti
b6c6eb4dfa chore(appveyor): make node_modules cache depend on npm-shrinkwrap.json (#1580)
We've been hitting some weird npm-shrinkwrap.json issues in our
shrinkwrap staged sanity checks, where Appveyor would complain that the
shrinkwrap is not up to date, while that wasn't the case either locally
or in Travis CI.

The issue is related to caching. If a commit changes a `from` entry of a
npm-shrinkwrap.json dependency, but the CI servers kept the cached
node_modules, then there will be a discrepancy between the `_from` field
from the `package.json` of a dependency in `node_modules` and what the
npm-shrinkwrap.json says. npm will obey `node_modules` over
`npm-shrinkwrap`, causing the invalid diff.

The fix is to make the Appveyor node_modules cached directory dependent
on any change to the npm-shrinkwrap.json file.

Change-Type: patch
See: https://github.com/resin-io/etcher/pull/1547
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-10 15:07:09 -04:00
Juan Cruz Viotti
fdceaadec5 refactor(GUI): move redux store to lib/shared (#1576)
After https://github.com/resin-io/etcher/pull/1569, the redux store can
run outside of a browser context. This commit moves it to `lib/shared`,
where we will likely move all the other models as well. As an extra, I
renamed `Store` to `store`, since there was no reason for that variable
to be capitalized.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-07 18:47:39 -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
Jonas Hermsmeier
1b79d50288 fix(gui): Fix image checks in image selections (#1573)
I must have screwed something up during a rebase,
this mends the partition table an windows image checks.

Change-Type: patch
2017-07-06 16:00:07 -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
Juan Cruz Viotti
fd109b5770 fix(elevator): make use of wide characters everywhere (#1559)
Switching the Windows language to a language encoded using UTF-16 (like
Japanese) revealed that our native elevator module garbles language
specific strings, making the child writer process unable to find an
image inside a language specific directory, and thus resulting in a
"File is not accessible" error.

As a solution, we make use of `std::wstring` and wide character Windows
API functions in the elevator module.

Change-Type: patch
Changelog-Entry: Fix "file is not accessible" error when flashing an image that lives inside a directory whose name is UTF-16 encoded on Windows.
Fixes: https://github.com/resin-io/etcher/issues/1459
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-05 14:13:36 -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
Benedict Aas
b18fa1f13f feat(GUI): add webview api version parameter (#1558)
We add the API version sent to the banner via a GET search parameter,
allowing for more intricate control over what data needs or can be sent.
2017-07-04 13:11:44 -04:00
Jonas Hermsmeier
f1ddf07a45 test(image-stream): Test more compression methods (#1565)
* test(image-stream): Add more zip compression methods
* test(image-stream): Add more dmg compression methods
* test(image-stream): Add bz2 level 9 test

Change-Type: patch
2017-07-03 23:35:06 +02:00
Jonas Hermsmeier
5f5a4b61b0 chore(scripts): Silence stdout for npm install (#1567)
Change-Type: patch
2017-07-03 17:08:53 -04:00
Andrew Scheller
20ca03496f chore: fix typo in Makefile (#1562)
This is a change that should have been made in #1543
2017-07-03 16:26:10 -04:00
Juan Cruz Viotti
7af66c4911 chore:(windows): make use of NSIS one-click installers (#1560)
One-click installers are a "modern" version of usual wizard installers,
and somewhat resemble the Squirrel.Windows installers you can see in
apps like Atom.

As the name implies, the user needs to agree the license, and that's
all, the remaining installer is non-interactive, leading to a very
smooth user experience.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-03 16:25:48 -04:00
Juan Cruz Viotti
2e3a2f045e chore: pipe stdout from npm ls to /dev/null (#1566)
As part of our CI sanity checks, we run `npm ls`, to ensure we don't
have any extraneous dependencies (the command fails if so), however by
its own definition, `npm ls` prints the whole dependency tree, which
spams the builds.

This commit redirects stdout to /dev/null, which contains the dependency
tree, but still prints and extraneous dependency warning, which is
printed to stderr instead.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-03 13:14:22 -04:00
Juan Cruz Viotti
c2563c2f87 chore(npm): move retry options to INSTALL_OPTS (#1564)
See: https://github.com/resin-io/etcher/pull/1550/files#r125015773
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-03 11:48:07 -04: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