3117 Commits

Author SHA1 Message Date
Juan Cruz Viotti
16c3750b15 Don't check extensions before the first non compressed extension (#493)
Currently, we extract all the extensions from an image path and report
back that the image is invalid if *any* of the extensions is not a
valida extension, however this can cause trouble with images including
information between dots that are not strictly extensions.

For example:

```
elementaryos-0.3.2-stable-i386.20151209.iso
```

Etcher will consider `20151209` to be an invalid extension and therefore
will prevent such image from being selected.

As a way to allow these corner cases but will make use of our enforced
check controls, the validation routine will only consider extensions
starting from the first non compressed extension.

This PR also includes logic to show a nice GUI dialog saying that the
image is invalid in order to provide a much better experience than just
silently failing.

Fixes: https://github.com/resin-io/etcher/issues/492
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-20 12:05:33 -04:00
Juan Cruz Viotti
abdf26066c Open DevTools in "undocked" mode by default (#489)
Otherwise, DevTools gets opened inside the Etcher window, causing the
GUI to get completely messed up.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-17 17:53:03 -04:00
Juan Cruz Viotti
f49e2982e5 Resolve AppImage binary path correctly when running it as root (#490)
Currently, when the AppImage was being ran as `root` we would attempt to
run `./usr/bin/etcher`, assuming we were inside the AppDir already and
the relative path would resolve correctly.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-17 15:12:15 -04:00
Juan Cruz Viotti
9895773b6c Make sure elevated mount-point evaluates to a single line in GNU/Linux (#488)
Consider the case where a previously elevated mount was not unmounted
correctly. `mount | grep $(basename $APPIMAGE)` would evaluate to a
multi-line string, and therefore `awk` will perform its work on *each*
line separately, usually returning something like:

```
/tmp/.mountXXXX
/tmp/.mountYYYY-elevated
```

We then pass `$mountpoint` to `mkdir -p`, which evaluates to:

```
mkdir -p /tmp/.mountXXXX
/tmp/.mountYYYY-elevated
```

Therefore `/tmp/.mountXXXX` gets created, and
`/tmp/.mountYYYY-elevated` is ran as an executable, causing all sort of
cryptic errors to come out. This can be even worse, since the third
column of a `mount` line is not always a path, so the errors make even
less sense.

Fixes: https://github.com/resin-io/etcher/issues/482
Fixes: https://github.com/resin-io/etcher/issues/459

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-16 10:18:21 -04:00
Juan Cruz Viotti
cd87586cee Fix application wide vertical scroll bar (#487)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
v1.0.0-beta.8
2016-06-15 15:41:42 -04:00
Juan Cruz Viotti
0d2fcac5e4 v1.0.0-beta.8
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-15 11:52:02 -04:00
Juan Cruz Viotti
df24388c3d Move update notifier modal style to the component (#486)
Currently, the modal style style used in this component was declared in
`components/_modal.scss`, however since this srule is very specific to
the update notifier component, its better declared in
`update-notifier/styles`.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-15 11:26:38 -04:00
Juan Cruz Viotti
52f47d7b61 Check for python in build scripts (#485)
This dependency is not used directly by our build scripts, but its used
by `node-gyp` when building native modules, and its much nicer to show a
warning early on than having to halt the build script in the middle for
missing this dependency (specially on Windows systems).

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-15 11:26:22 -04:00
Juan Cruz Viotti
21b6e1aabc Prevent an invalid drive from being auto-selected (#484)
Currently we have logic in the drive selector dialog to prevent invalid
drives (too small, locked, etc) from being selected, however we are not
protecting auto-selection from these invalid devices.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-15 11:26:03 -04:00
Juan Cruz Viotti
a5fbe40b2d Move drive selector warning labels below the drive (#483)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-15 11:25:50 -04:00
Juan Cruz Viotti
8aa7bcd952 Prevent a very long image name from breaking the UI (#479)
This PR introduces two changes to mitigate this problem and overall
provide a better UX:

- Show ellipses in the middle of the image name in the first step if
needed.

- Add a tooltip below the image selection label in the first step to
show a little modal displaying the full path to the image.

Fixes: https://github.com/resin-io/etcher/issues/418
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-15 10:31:07 -04:00
Juan Cruz Viotti
34ab982b24 Remove body display hidden white flash workaround (#478)
In older versions of Electron, the application would display a quick
flash of white before running caused by the WebView loading up.

This workaround doesn't seem necessary anymore.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-13 10:58:01 -04:00
Juan Cruz Viotti
3d921f2f86 Upgrade etcher-image-write to v5.0.1 (#469)
* Upgrade etcher-image-write to v5.0.1

The new version contains an important fix to prevent `EPERM` errors on
Windows with certain drives.

Fixes: https://github.com/resin-io/etcher/issues/334
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Upgrade NPM to fix newer package versions not available in Appveyor

See: https://github.com/npm/npm/issues/4984
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-12 17:56:47 -04:00
Juan Cruz Viotti
4e9c25a1dd Fix sporadic race condition in update notifier test suite (#476)
We rely on a millisecond to determine the state of the update notifier
logic, which can fail at least once per 50 builds or so.

We increase the time difference to account for this little room for
error.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-12 15:58:33 -04:00
Juan Cruz Viotti
fbe6fe1142 Show a "Locked" label if the drive is write-protected (#475)
* Implement SelectionStateModel.isDriveLocked()

Notice we also increase the maximum number of lines JSCS check, since
the `SelectionStateModel` test suite already met that limit.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Show a "Locked" label if the drive is write-protected

Fixes: https://github.com/resin-io/etcher/issues/458
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-11 15:45:46 -04:00
Juan Cruz Viotti
51b6de4634 Show an informative label if a drive is not large enough (#474)
This is a huge improvement over our current approach, which was simply
to cross out the drive without further explanation.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-11 13:52:38 -04:00
Juan Cruz Viotti
dc7b31f061 Apply checksum label padding as a custom modifier (#473)
We want to re-use the `label` component without big paddings in other
areas of the application, therefore we move the custom padding to a
separate label modifier.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-11 13:44:02 -04:00
Juan Cruz Viotti
608cb5d74a Cleanup CSS (#471)
This is by no means a complete CSS refactoring. There still a lot to be
done. This encompasses mostly:

- Move "Finish page" specific styles to that module.
- Remove unused CSS rules.
- Move generic Bootstrap rules to `_bootstrap.scss`.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-11 13:21:22 -04:00
Juan Cruz Viotti
f674f3d706 Fix image containing dots in the filename considered unsupported (#468)
Currently, we detect the extensions of an image path by finding the
first dot, and splitting everything afterwards, however this will fail
with image paths containing dots, like `foo.1.2.3-bar.iso.gz`.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-10 10:19:26 -04:00
Juan Cruz Viotti
5ae5a1915d Refactor supported image logic to SupportedFormatsModel (#467)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-09 13:08:01 -04:00
Juan Cruz Viotti
b950136deb Extract DrivesModel from DriveScannerService (#466)
Currently, `DriveScannerService` is in charge of both scanning the
available drives and maintaining the state of the currently detected
drives.

To honour the single responsibility principle, we split this service
into a `DrivesModel`, which is incharge of maintaining the state without
caring how they are detected, and `DriveScannerService`, which only
scans the available drives and modified `DrivesModel` accordingly.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-09 12:42:09 -04:00
Juan Cruz Viotti
fc6ccf70dd Prevent selection of invalid images (#462)
The user might attempt to select an invalid image by dropping on the
first step, which would cause Etcher to blindly select it, possibly
causing errors later on the process.

This PR makes use of the list of supported extensions provided by
`SupportedFormatsModel` and prevents the selection if necessary, logging
an event that might help us determine which unsupported image types
users try to burn most often.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-08 15:49:55 -04:00
Juan Cruz Viotti
0557c45102 Link README to the roadmap (#463)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-08 15:49:49 -04:00
Juan Cruz Viotti
7d5f42f38c Try to get more information about error messages (#464)
If the error object is not well-formed, try to get as most information
about it as we can instead of just realying on generic error messages.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-08 15:49:42 -04:00
Juan Cruz Viotti
f2a8860135 Fix package.json key/property spacing (#461)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-08 13:36:00 -04:00
Juan Cruz Viotti
8de4be1897 Display ETA during flash and check (#460)
* Show speed during check

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Display ETA during flash and check

Fixes: https://github.com/resin-io/etcher/issues/256
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-08 13:35:44 -04:00
Juan Cruz Viotti
ef82c2f09b Update Appveyor badge (#457)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-08 13:19:11 -04:00
Juan Cruz Viotti
0c94de7fcf Prevent exernal resources from being loaded by the WebView (#456)
If a user drags and drops an image, an HTML file, or other resource the
WebView understands, Electron will navigate away from the application
and load it up in the WebView, making the application unusable unless
the user restarts it.

Fixes: https://github.com/resin-io/etcher/issues/430
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-08 11:10:46 -04:00
Juan Cruz Viotti
6c936a5192 Document can-ignore module.require annotation (#455)
* Document `can-ignore` module.require annotation

This annotation was introduced in: 1872d1f

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Trigger CI build
2016-06-08 11:10:32 -04:00
Igor Klopov
a27e246cc9 Annotation for EncloseJS to ignore missing dependency (#454) 2016-06-07 14:52:51 -04:00
Juan Cruz Viotti
11fb499344 Upgrade drivelist to v3.1.2 (#450)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-07 10:56:36 -04:00
Juan Cruz Viotti
052bb00be9 Fix CI tests (#452)
- Fix lint warning.
- Set the correct electron version in `appveyor.yml`

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-06 18:12:38 -04:00
Juan Cruz Viotti
dd6182ceb3 Write a document explaining Etcher's architecture (#447)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-06 17:52:18 -04:00
Juan Cruz Viotti
31728801f5 Don't show a progress bar in update notifier modal (#445)
Fixes: https://github.com/resin-io/etcher/issues/442
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-26 21:18:13 -04:00
Juan Cruz Viotti
b14e94fc3b Fix GNU/Linux not opening an external resource when elevated (#446)
We currently had a workaround in place to make use of `node-open`
instead of Electron's built-in `shell` module since the latter didn't
work on older Electron versions on GNU/Linux for some reason.

After some experimentation, `node-open` doesn't seem to be working for
elevated applications anymore. I honestly didn't chase the issue further
since Electron `shell` has been fixed, and works fine when elevated,
therefore this PR basically undoes the previous workaround.

Fixes: https://github.com/resin-io/etcher/issues/443
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-26 21:18:03 -04:00
Juan Cruz Viotti
28e6cb3f79 Create docs/MAINTAINERS.md (#441)
This document will evolve as a guide for maintainers to perform all
sorts of common tasks.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-26 16:13:50 -04:00
Juan Cruz Viotti
94bd796daa v1.0.0-beta.7
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
v1.0.0-beta.7
2016-05-26 10:12:04 -04:00
Juan Cruz Viotti
efe931cae5 Upgrade drivelist to v3.1.1 (#438)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-26 10:09:53 -04:00
Juan Cruz Viotti
bedda41843 Provide a GUI elevation dialog for GNU/Linux (#440)
Fixes: https://github.com/resin-io/etcher/issues/439
Fixes: https://github.com/resin-io/etcher/issues/412
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-26 10:04:23 -04:00
Juan Cruz Viotti
e9164df384 Install NPM dev dependencies during the build (#437)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 15:35:56 -04:00
Juan Cruz Viotti
7d0ea21567 Run linter as part of npm test (#436)
* Fix lint warnings

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Run linter as part of `npm test`

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 15:35:51 -04:00
Juan Cruz Viotti
abb7dc6469 Prevent pressing "space" to re-click the "Flash" button (#435)
Currently we disable pointer events on the "Flash" button once a flash
is in progress to prevent the user from clicking it, but we didn't
consider that if the user kept focus on the button, he can press the
"space" bar for the same effect.

Fixes: https://github.com/resin-io/etcher/issues/431
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 14:21:31 -04:00
Juan Cruz Viotti
c8edafdad8 Upgrade CI servers NodeJS version (#434)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 14:21:23 -04:00
Juan Cruz Viotti
6af2bd0d30 Prevent global shorcuts from interferring with other applications (#433)
Fixes: https://github.com/resin-io/etcher/issues/389
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 12:40:25 -04:00
Juan Cruz Viotti
2948d13075 Fix image drag and drop not working anymore (#432)
There has been changes in the model regarding with how the image
information was stored, and the dropzone directive was never modified to
comply with those changes.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 11:52:50 -04:00
Juan Cruz Viotti
3b30748b1f Add support for .gz and .bz2 (#419)
See: https://github.com/resin-io/etcher/issues/325
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 10:38:12 -04:00
Juan Cruz Viotti
c1074de198 Upgrade electron to v1.1.1 (#427)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 10:37:31 -04:00
Juan Cruz Viotti
d9f6c1b838 Add instructions to configure NPM for installation (#429)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-24 10:37:12 -04:00
Juan Cruz Viotti
f4d9de850c Fix indentation in build scripts (#428)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-23 14:27:03 -04:00
Juan Cruz Viotti
94e209ac80 Install dev dependencies before calling electron-builder on Windows (#426)
Since the addition of a patch to only install production dependencies on
build scripts, the Windows build would fail when reaching to
`electron-builder`, since this dependency might not be installed at that
point.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-22 22:45:06 -04:00