Commit Graph

733 Commits

Author SHA1 Message Date
Matt Farina
5de444952a Merge pull request #293 from mook-as/win-log-clobber
Logging: Only delete files if we have single instance lock
v0.2.0
2021-05-14 05:54:57 -07:00
Matt Farina
695736fb2d Merge pull request #296 from mook-as/win-installer-path-repeated
NSIS: Add extra nested `resources` to PATH
2021-05-14 05:41:43 -07:00
Matt Farina
8b4cdbd7e5 Merge pull request #284 from mook-as/windows-wsl-no-reboot
NSIS: Don't restart on kernel update when interactive
2021-05-14 05:35:13 -07:00
Matt Farina
c8049715b4 Merge pull request #294 from mattfarina/bump-version-0.2.0
Bumping to v0.2.0
2021-05-14 05:34:30 -07:00
Mark Yen
bf9814c28a NSIS: Add extra nested resources to PATH
The extra layer is because that's where Electron puts things.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 17:08:28 -07:00
Matt Farina
6f2a7ecabd Bumping to v0.2.0
Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-05-13 18:12:13 -04:00
Mark Yen
f167780f9f Logging: Only delete files if we have single instance lock
If we are a secondary instance, do not attempt to delete any log files;
instead, continue writing to the existing logs.  As we will quit shortly,
the logs in the current process are not interesting.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 14:59:05 -07:00
Matt Farina
5c51e64e9d Merge pull request #289 from mook-as/win-handle-no-wsl
WSL: Provide better error message when WSL is not installed.
2021-05-13 14:45:17 -07:00
Matt Farina
74c785c3cc Merge pull request #290 from mook-as/license-pristine
LICENSE: Use pristine Apache-2.0 license
2021-05-13 13:55:59 -07:00
Matt Farina
ec1bd7413c Merge pull request #280 from mook-as/bundle-tinyk3s
Bundle tinyk3s
2021-05-13 13:55:36 -07:00
Mark Yen
0eaa3d74b4 LICENSE: Use pristine Apache-2.0 license
The previous license file had the copyright owner filled in within the
sample file header section.

This is a direct copy from https://www.apache.org/licenses/LICENSE-2.0.txt

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 13:01:06 -07:00
Matt Farina
a2f31108f3 Merge pull request #278 from mook-as/system-certs
Allow use of system certs
2021-05-13 12:07:54 -07:00
Mark Yen
b9691f7c65 WSL: Provide better error message when WSL is not installed.
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 11:58:25 -07:00
Mark Yen
61111696f1 WSL: Use pre-downloaded distro file
Using a different version requires rebuilding the application anyway; so
instead of downloading it at runtime, just package it in the application.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 11:38:58 -07:00
Mark Yen
16265792df Hyperkit: use pre-downloaded boot2tcl image.
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 11:36:05 -07:00
Mark Yen
6b17204844 scripts/hyperkit: Download boot2tcl ISO
This way we can cache the ISO file and bundle it with the installer.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 11:36:04 -07:00
Mark Yen
9c0eaba8c8 scripts/hyperkit: Re-use method from download-resources.
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 11:36:04 -07:00
Mark Yen
2504ef953a Download-resources: don't redownload files by default.
This is useful as we will soon download larger files.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 11:35:58 -07:00
Matt Farina
a35a7146fd Merge pull request #283 from rancher-sandbox/253-allow-rename-across-volumes
Avoid fs.rename in unsupported scenarios
2021-05-13 11:09:18 -07:00
Matt Farina
09fbd2d7c1 Merge pull request #281 from mook-as/win-license
NSIS: Add license
2021-05-13 11:07:49 -07:00
Eric Promislow
af75f46ea9 Prefer fs.promises.METHOD to await fs.METHOD
- Also prefer `fs.rename` to `fs.copyFile ; fs.unlink` but fall back
  to the latter when the former fails.

Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-05-13 10:11:54 -07:00
Eric Promislow
aaa647aed9 Avoid fs.rename in unsupported scenarios
- Known problem: can't fs.rename across windows drives,
because it uses a hard link to create the new file,
and that isn't supported.

- Could have checked for a[1] === b[1] === ':' and a[0].toUpperCase() !== b[0].toUpperCase()
but I'm doing this with an explicit copy and unlink to avoid other problems, like moving
over two mounted systems on macos.

Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-05-13 10:11:54 -07:00
Mark Yen
ea8dd7d8e8 Merge pull request #261 from mook-as/wsl-logging
WSL: Add logging
2021-05-13 09:37:07 -07:00
Mark Yen
35e5934d4a NSIS: Don't restart on kernel update when interactive
If the user had already installed WSL, but _not_ the kernel update, we
should not force a reboot; instead, we should prompt the user first.

Also remove logging that wasn't meant to be checked in.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-13 09:12:52 -07:00
Mark Yen
bd3895ad27 NSIS: Add license
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 15:15:16 -07:00
Mark Yen
85829da234 WSL: fix incorrect argument to wsl.exe
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 13:53:26 -07:00
Mark Yen
9585be56b2 childProcess: Fix passing in streams
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 12:59:37 -07:00
Mark Yen
9e117635fc Logging: Add a getter to return a stream with a fd
This is necessary as child_process.spawn() will error out badly when the
writable stream doesn't have a fd open yet.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 12:59:35 -07:00
Mark Yen
86c8c88f5a WSL: Fix typo
https://github.com/rancher-sandbox/rd/pull/261#discussion_r630575539

I have no idea how I managed to fix a typo into a different typo...

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 12:59:33 -07:00
Mark Yen
141f617953 utils: Fix lint warnings.
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 12:59:32 -07:00
Mark Yen
b17bbda777 Utils: Test childProcess wrapper
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 12:59:31 -07:00
Mark Yen
6c27126d9f WSL: Add logging.
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 12:59:30 -07:00
Mark Yen
9427d88502 Add helper for spawning child processes.
We repeatedly write code to handle spawning children that log to a file and
return a promise.  This attempts to factor that out.

Note that on Windows we may need to to string encoding conversion before
writing the output, as some tools may emit UTF-16 instead.  This has built-
in support for that.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 12:59:28 -07:00
Mark Yen
3228cdd0ad ESLint: Skip no-undef for TypeScript
ESLint doesn't recognize TypeScript built-ins.  This is fine, as the
TypeScript compiler will error out on undefined variables.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-12 12:59:26 -07:00
Jan Dubois
1f2af23324 Merge pull request #279 from mook-as/mac-remove-camera-mic-usage
Electron-builder: Remove camera & mic strings on mac
2021-05-11 16:12:14 -07:00
Mark Yen
2d1175c760 Electron-builder: Remove camera & mic strings on mac
Electron-builder has default entries in Info.plist for why it might want
camera and microphone usage (required on macOS 10.15+ for media access).
As we are unlikely to ever want media access, remove those entries instead
so that people are not confused about us possibly wanting unnecessary
permissions.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-11 14:50:29 -07:00
Mark Yen
0536945b51 Add more logging to files.
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-11 13:11:10 -07:00
Mark Yen
67c1ac12ef background.ts: Add support for system certificate authorities
This makes it possible to handle MITM-style corporate proxies, where custom
certificate authorities are added to the system certificate store.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-11 12:35:23 -07:00
Mark Yen
4022781876 Typings: Add incomplete types for mac-ca & win-ca
Needed for interoperability with TypeScript.  Note that these are rather
incomplete; they're enough for our uses, but in particular for win-ca the
API exposes a rather complicated surface for retrofitting types.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-11 12:33:55 -07:00
Mark Yen
16f45849b3 package.json: Add @types/node-forge
Needed to interact with the certificate authority libraries

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-11 12:32:11 -07:00
Mark Yen
cb2e16f939 Package.json: Add win-ca and mac-ca
These will help in using system certificate stores, mainly for machines on
corporate networks with MITM proxies.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-11 12:30:32 -07:00
Eric Promislow
4a89550dfc Merge pull request #277 from rancher-sandbox/214-deal-with-bad-config
Improve error message after detecting a corrupt config file
2021-05-10 16:29:47 -07:00
Eric Promislow
8f8bc02512 Improve error message at startup
1. No need to mention `undefined.clusters` in the dialog box,
   as it's in the code already.

2. All other problems should be reported in a general dialog box.
   Otherwise, the app will quietly fail to start.

Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-05-10 16:02:01 -07:00
Eric Promislow
17aae83a02 rethrow unexpected errors
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-05-10 15:56:05 -07:00
Eric Promislow
d10e8c88ef Improve error message after detecting a corrupt config file
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-05-10 15:39:58 -07:00
Mark Yen
a65dac1882 Merge pull request #245 from rancher-sandbox/211c-missing-windows-images
Raise the odds that services and images are displayed on windows
2021-05-10 11:58:15 -07:00
Mark Yen
f97abafa64 Merge pull request #276 from rancher-sandbox/268-bump-to-kim-0.1.0-alpha.11
268 bump to kim 0.1.0 alpha.11
2021-05-10 11:38:04 -07:00
Mark Yen
97c1981cbc background.ts: Use import
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-05-10 11:10:29 -07:00
Eric Promislow
a6f770c92d Misc. tweaks
* `refreshImages` no longer needs an `emitChanges` arg
* prefer `array.some` to `array.find` to determine existence only

Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-05-10 10:22:00 -07:00
Eric Promislow
600f7a861b clarifying comment
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-05-10 10:08:15 -07:00