3291 Commits

Author SHA1 Message Date
Juan Cruz Viotti
832bfad9d1 chore: reuse npm/bower dependencies across builds (#923)
Currently, we create a "resources app" and install dependencies on it.
This means that to create another "resources app", the whole dependency
installation process needs to be repeated.

As a solution, we cache dependencies at
`release/electron-$(TARGET_PLATFORM)-$(TARGET_ARCH)-dependencies/` and
copy them to the resources apps as we need them.

This has the additional benefit that the resources app depends on the
dependencies rather than the other way around (dependencies depend on
the resources app), which didn't feel right.

In order to accomodate to these changes, the dependencies scripts are
now in charge of taking their corresponding manifests with them when the
prefix option is passed, given that neither `npm` nor `bower` allow to
customise the output location.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 19:52:07 -04:00
Juan Cruz Viotti
2b7f36a3c7 style: convert spaces to tabs in Makefile (#924)
Additionally, we setup an EditorConfig rule to automatically switch to
tab style on Makefile.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 19:51:53 -04:00
Juan Cruz Viotti
68a71d89e2 chore: add Makefile to build OS X and GNU/Linux (#922)
This Makefile ties together all the build scripts we've been developing
so far. It currently only supports UNIX based operating systems, but
Windows support will be added soon.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 15:16:47 -04:00
Juan Cruz Viotti
4f233f20e0 chore: move GNU/Linux zip generation to installer-appimage (#913)
Currently, `installer-appimage` creates only the AppImage, and we rely
on code outside the main task to package it up as a Zip. Since Zip is
a required step for AppImage deployment (since the AppImage will lose
its execution permissions if its moved around), we integrate Zip
generation into the AppImage task itself.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 12:29:27 -04:00
Juan Cruz Viotti
6f0fe93aad chore: improve naming of build scripts (#918)
- `darwin/configure-electron.sh` -> `darwin/electron-configure-package-darwin.sh`
- `darwin/installer-zip.sh` -> `darwin/electron-installer-app-zip.sh`
- `darwin/installer-dmg.sh` -> `darwin/electron-installer-dmg.sh`
- `darwin/sign.sh` -> `darwin/electron-sign-app.sh`
- `linux/configure-electron.sh` -> `linux/electron-configure-package-linux.sh`
- `linux/installer-appimage.sh` -> `linux/electron-installer-appimage.sh`
- `linux/installer-deb.sh` -> `linux/electron-installer-debian.sh`
- `unix/create-asar.sh` -> `unix/electron-create-asar.sh`
- `unix/create-electron-app.sh` -> `unix/electron-create-resources-app.sh`
- `unix/download-electron.sh` -> `unix/electron-download-package.sh`

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 12:11:08 -04:00
Juan Cruz Viotti
100ab79eab chore: exit with error code 1 on build script usage section (#916)
We're currently exitting with error code 0 when displaying the usage
information on build scripts, which means that if the user forgets or
mistypes an option argument, the script will carry on its way.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 11:58:10 -04:00
Andrew Scheller
fa958537c1 docs: Update 'announcing' section of Publishing instructions (#921) 2016-12-01 11:40:54 -04:00
Juan Cruz Viotti
b2124499c7 chore: extract code-signing logic from windows.bat to sign.bat (#911)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 10:59:26 -04:00
Juan Cruz Viotti
5b6f3cca60 chore: split dependencies.sh into bower and npm scripts (#914)
The purpose of this change is to stay true to the Makefile approach,
where each rule is meant to create a single directory/file.

Currently, `unix/dependencies.sh` resulted in `bower_components` and
`node_modules`. Splitting this rule also means that we don't have to
install bower dependencies where we don't need them (e.g: the CLI).

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 10:58:26 -04:00
Juan Cruz Viotti
7f79384b71 chore: cache chocolatey installs as recommended by Appveyor (#915)
We tried to save the Chocolatey cache in a previous PR, but it looks
like its not working properly. This PR implements the "correct" way to
cache Chocolatey installs, as recommended in Appveyor forums.

The arrows mean that the cache is invalidated if the file in the right
side (`appveyor.yml`) in this case, is changed.

See: http://help.appveyor.com/discussions/suggestions/592-speeding-up-chocolatey-downloads-and-installs
See: e603cb0838
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-01 10:58:14 -04:00
Juan Cruz Viotti
a8116250d2 chore: install dependencies directly in package (#909)
Previously, the build scripts would override the top level
`node_modules` and `bower_components`. After this commit, the
dependencies are installed directly in the Electron package.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-30 11:38:31 -04:00
Juan Cruz Viotti
43922f94c0 chore: extract dependencies.bat from windows.bat (#910)
The logic to install dependencies on Windows now separately lives in
`scripts/windows/dependencies.bat`, similarly to what we've been done
with other operating systems.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-30 11:33:47 -04:00
Benedict Aas
cfeb35b531 feat(GUI): allow double-click to quick-select drives (#889)
The user can now double-click to swiftly select a drive in the
drive widget instead of having to toggle a drive and then clicking the
continue button to close the modal and finalize the drive selection.

Closes: https://github.com/resin-io/etcher/issues/880
Change-Type: patch
Changelog-Entry: Implement double-click to quick-select drives in the
drive widget.
2016-11-30 11:11:11 -04:00
Benedict Aas
ccd2076a20 fix(GUI): show not-allowed cursor over unselectable drives (#886)
The cursor is incorrectly a pointer on hover over a disabled and
unselectable drive in the drive selector widget. This patch changes the
cursor to `not-allowed`, providing the user with visual feedback that it is
not selectable.

Fixes: https://github.com/resin-io/etcher/issues/865
Change-Type: patch
Changelog-Entry: Use not-allowed cursor over disabled drives in the
drive selector widget.
2016-11-30 11:06:41 -04:00
Andrew Scheller
b8ffd24cce chore: refactor and enhance dependency checking in build scripts (#908)
This refactors the way that the build shell-scripts check for dependencies
in order to cut down on code duplication, and also adds additional
dependency-checks that were missing previously.

Change-Type: minor
2016-11-29 19:37:31 -04:00
Juan Cruz Viotti
2397b5d2aa chore: don't include LICENSE and version in OS X package (#907)
Including them means we have to nicely display them in the final `.dmg`.
For simplicity reasons, we'll omit it for now.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-29 19:18:31 -04:00
Juan Cruz Viotti
ad3636c31a fix: don't lock installer-cli architecture to x64 in build scripts (#904)
We were accidentally hardcoding the installer generation to `x64`.

See: https://github.com/resin-io/etcher/pull/896#discussion_r89999295
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-29 15:20:59 -04:00
Juan Cruz Viotti
55bd372082 v1.0.0-beta.17
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
v1.0.0-beta.17
2016-11-28 09:58:29 -04:00
Juan Cruz Viotti
0ed4f5d3c8 chore: adopt new build command convention for OS X (#903)
The `darwin.sh` script now accepts the following commands:

- `develop-electron`
- `installer-dmg`
- `installer-zip`

In order to accomplish this, `./scripts/darwin/package.sh` is no longer
relying on `electron-packager`.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-28 09:56:14 -04:00
Juan Cruz Viotti
7794bf06d1 refactor: extract electron downloading logic to its own script (#902)
This will allow us to easily re-use this functionality in the OS X
package script.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-28 01:13:12 -04:00
Juan Cruz Viotti
6e0d8e1f5c refactor: ditch electron-osx-sign for OS X signing (#901)
Making use of `codesign` directly allows us to have much more
flexibility in how we sign things, which will prove very valuable when
adapting this `sign.sh` script to code sign the Etcher CLI.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-28 01:13:02 -04:00
Juan Cruz Viotti
19b3bc56c2 chore: adopt new build script command convention in GNU/Linux (#899)
The GNU/Linux build script (as the rest of the OSes will in the near
future), now accepts the following command:

- `develop-electron`
- `develop-cli`
- `installer-cli`
- `installer-appimage`
- `installer-debian`

Each of the commands is now completely independent from the others.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-27 22:29:23 -04:00
Juan Cruz Viotti
553f7f3f4b refactor: get rid of electron-packager in GNU/Linux (#897)
In order to take a whitelisting approach to dependencies, the
`unix/dependencies.sh` script is ran as part of packaging as well, but
passing the `-p` (production) flag.

In the future, the current `install`, `package`, and `installer` targets
will be deplaced by `develop-<type>`, `installer-<type>`.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-25 16:13:59 -04:00
Juan Cruz Viotti
151d19ce63 chore: add "cli" command to GNU/Linux and OS X build script (#896)
This is the first step towards properly publishing the Etcher CLI. The
option is not present in Windows yet, and its intentionally undocumented
for the time being.

See: https://github.com/resin-io/etcher/issues/355
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-25 14:11:13 -04:00
Juan Cruz Viotti
a01c9aa6b1 refactor: improve and unify dependencies.sh script across UNIX targets (#894)
- Unify both `linux/dependencies.sh` and `darwin/dependencies.sh` in
  `unix/dependencies.sh`

- Add `-f` (force) option to `unix/dependencies.sh`

- Add `-p` (production) option to `unix/dependencies.sh`

- Allow passing a target type to `unix/dependencies.sh`

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-25 12:57:09 -04:00
Juan Cruz Viotti
7d51dea35d fix(CLI): always omit first two elements of process.argv (#891)
This is a great simplification to the logic previously included in the
Yargs `.parse()` function on the Etcher CLI.

There is no scenario where the CLI script will be executed in a
standalone fashion (e.g: `etcher.js <options>`), so we can always safely
drop the first two elements from `process.argv`.

Change-Type: patch
Changelog-Entry: Fix command line arguments not interpreted correctly when running the CLI with a custom named NodeJS binary.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-25 12:56:54 -04:00
Juan Cruz Viotti
3eac1762b1 upgrade: drivelist to v5.0.4 (#893)
- https://github.com/resin-io-modules/drivelist/pull/125

Change-Type: patch
Changelog-Entry: Fix drive scanning exceptions on GNU/Linux systems with `net.ifnames` enabled.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-25 12:56:44 -04:00
Juan Cruz Viotti
c4868995aa chore: add appdmg and ds-store to shrinkwrapIgnore (#895)
These dependencies are suddently causing issues when running `npm
install` in platforms other than OS X.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-25 12:08:29 -04:00
Juan Cruz Viotti
f0bc04c238 refactor: extract GNU/Linux build scripts into many files (#890)
Related changes

- Remove AppImages related binary blob from `scripts/build/AppImages` and
  fetch them from the internet instead.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-23 12:20:51 -04:00
Juan Cruz Viotti
2f980e808f chore: add x86 architecture support for darwin/dependencies.sh (#883)
We don't really do x64 builds for OS X at the moment, but nice to make
the build scripts consistent.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-18 17:28:23 +00:00
Benedict Aas
18799d4274 fix(GUI): wrap long words in drivelist (#882)
Drives with long names or descriptions expand outside the drivelist,
this commit fixes that using CSS `word-break: break-all`.

Change-Type: patch
Changelog-Entry: Wrap drive names and descriptions in the drive selector widget.
2016-11-18 17:28:10 +00:00
Juan Cruz Viotti
8d44c9b86c refactor: extract OS X build script into many files (#875)
This is the first step towards decoupling the build system as many
different scripts, for maintainability and convenience purposes.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-18 16:54:14 +00:00
Juan Cruz Viotti
ca4d05ced0 refactor(GUI): resolve undefined on modal keyboard bindings (#879)
Currently we resolve `false`, which might not mean very much to some
modal use cases. `undefined` is a much more generic falsy value.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-18 15:23:10 +00:00
Benedict Aas
e85906d50d fix(GUI): pressing escape cancels modal dialogue (#878)
Pressing the ESC key in any modal dialogue currently just emits a
message. This change actually cancels the modal, closing it.

Closes: https://github.com/resin-io/etcher/issues/874
Change-Type: patch
Changelog-Entry: Allow the user to press ESC to cancel a modal dialog.
2016-11-18 12:55:30 +00:00
Juan Cruz Viotti
938fa71d50 fix(GUI): terminate IPC server on any errors (#872)
If the child process (e.g: writer proxy, or CLI) emits either an error,
or an invalid output, the error will be emitted to the GUI, which will
report it to the state machine, however the IPC server will keep
receiving further messages, which will be passed to the GUI, which will
keep trying to update the state, in which case Redux will rightfully
complain that we can't update the flashing state if there is no flash in
process.

As a solution, we make sure the IPC server is terminated on every
possible error code flow, and to do this effectively, we needed to
manually destroy every connected socket before actually closing the
server.

Change-Type: patch
Changelog-Entry: Fix "Can't set the flashing state when not flashing" error.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-18 11:58:00 +00:00
Juan Cruz Viotti
9b6cd5c81c chore: update "join us" email to join+etcher@resin.io (#873)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-17 09:05:37 +00:00
Juan Cruz Viotti
4296868ff7 upgrade: drivelist to v5.0.3 (#871)
See: https://github.com/resin-io-modules/drivelist/pull/120
Fixes: https://github.com/resin-io/etcher/issues/870
Change-Type: patch
Changelog-Entry: Fix `0x80131700` error when scanning drives on Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-16 14:29:34 +00:00
Juan Cruz Viotti
6456a8fe96 upgrade: drivelist to v5.0.1 (#869)
- Fix internal SDCard reader descriptions in GNU/Linux.
- Transform `mountpoint` into an array of mountpoints.

Change-Type: patch
Changelog-Entry: Fix internal SDCard drive descriptions.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-16 13:52:20 +00:00
Juan Cruz Viotti
8992db807d fix(GUI): kill CLI processes when child writer dies (#855)
Turns out that when the parent process gets SIGKILL, the children
process would still remain alive.

In order to mitigate this, we force the IPC client opened by the child
writer to not attempt to reconnect to the IPC server if this one dies,
so we can catch the "disconnect" event and kill the children as a
result.

Fixes: https://github.com/resin-io/etcher/issues/850
Change-Type: patch
Changelog-Entry: Fix writing process remaining alive after the GUI is closed.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-16 00:48:29 +00:00
Juan Cruz Viotti
b4f1d82a51 fix(CLI): check CLI elevation early on (#864)
The CLI requires elevation permissions to actually be able to write to
drives. For this reason, it makes sense that we introduce such a check
early on.

See: https://github.com/resin-io/etcher/issues/726
Change-Type: patch
Changelog-Entry: Check available permissions in the CLI early on.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-14 11:22:08 +02:00
Juan Cruz Viotti
4e3bdb7e22 refactor(CLI): move UNIX umount functionality to repository (#866)
- Move UNIX unmount functionality to the CLI module
- Run `electron-mocha` for the CLI code
- Make unmount command templates that take a `drivelist` object as input

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-14 11:11:49 +02:00
David Lechner
f80feb9edf docs: more explicit key server (#861)
Use full URL with port for key server. Also use port 80 to work around firewalls and proxies.

Fixes: #859
2016-11-13 13:14:11 +02:00
Benedict Aas
2c07bce25f style(GUI): clarify wording at finished flash prompt (new → different) (#867)
Currently, the wording "same" versus "new" on the completion screen
is ambiguous when they respectively mean use the same image file, or use a new
and different image file. Therefore, change the wording from "new" to
"different".

Closes: https://github.com/resin-io/etcher/issues/839
2016-11-12 11:22:03 +02:00
Juan Cruz Viotti
6e03a00008 upgrade: electron-mocha to v3.1.1 (#854)
The current version would exit with error code 0 even when the tests
failed, causing CI servers to report false positives.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-09 22:20:11 +02:00
Juan Cruz Viotti
dae07ad050 test: fix failing ImageSelectionController tests (#856)
This was a small issue affected due to the change in order of the
supported extensions in the ImageSelectionController.

Since we want to test that the array contents are equally the same
independently on the order, we sort both sides of the assertion.

This issue was not caught before since `electron-mocha` was reporting
exit code 0 even when there were changes failing, causing the CI
services to incorrectly support success.

See: https://github.com/resin-io/etcher/pull/854
See: https://github.com/resin-io/etcher/pull/806
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-09 21:23:30 +02:00
Juan Cruz Viotti
5d25ef7dee docs(GUI): publishing a new version to homebrew cask (#837)
Publishing to Homebrew Cask involves changing a Cask file in the
official Cask registry pull request updating the `version` and `sha256`
properties.

See: https://github.com/caskroom/homebrew-cask/pull/26319
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-09 17:04:22 +02:00
Juan Cruz Viotti
0085880d3c chore: add productDescription to package.json (#842)
This key is added as the long description of the Debian package.
Omitting this option means that `description` is duplicated two times,
which is of course not the desired outcome.

See: https://github.com/resin-io/etcher/issues/632
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-09 17:04:05 +02:00
Juan Cruz Viotti
9c4afa0680 upgrade: umount to v1.1.5 (#843)
The changes we're interested in are:

- Escape device paths containing spaces.

Change-Type: patch
Changelog-Entry: Fix unmount issues in GNU/Linux and OS Xwhen paths contain spaces.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-07 18:07:57 +02:00
Juan Cruz Viotti
5a48395d6d style(GUI): unify "close" top right corner X in all modals (#841)
Every modal in the application should contain the same "close" X at the
top right corner, for consistency purposes. The only modal lacking this
button was the update notifier modal.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-07 17:56:03 +02:00
Juan Cruz Viotti
5d42fd181a minifix(GUI): improve unsafe mode setting dialog (#840)
- Change dialog message to "Are you sure you want to turn this on? You
  will be able to overwrite your system drives if you're not careful."

- Remove "CANCEL" button and put a cross at the top right corner.

- Change dialog button label from "YES, CONTINUE" to "ENABLE UNSAFE
  MODE"

In order to adapt to changes described above:

- `WarningModalService.display()` now takes an object including
  `description`, and `confirmationLabel`

Fixes: https://github.com/resin-io/etcher/issues/729
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-07 17:13:26 +02:00