From c6628b2f82791fe5ebf249dc5833ef39b8ed53ce Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 14 Nov 2020 12:24:55 -0500 Subject: [PATCH] nassh: drop building of Chrome App We've forked this off into the chrome-app branch so we can update the extension to much newer standard versions. There's a lot more we can clean up, so this just drops the building of the app itself. Change-Id: Ic8b8e37bb00bc74cf697ad9845cfd8e6ebc34841 Reviewed-on: https://chromium-review.googlesource.com/c/apps/libapps/+/2538561 Reviewed-by: Joel Hockey Tested-by: kokoro --- nassh/.gitignore | 3 - nassh/bin/mkdist | 16 ++--- nassh/doc/hack.md | 37 ++---------- nassh/doc/processes.md | 10 ++-- nassh/{manifest_ext.json => manifest.json} | 0 nassh/manifest_v1.5.json | 68 ---------------------- 6 files changed, 16 insertions(+), 118 deletions(-) rename nassh/{manifest_ext.json => manifest.json} (100%) delete mode 100644 nassh/manifest_v1.5.json diff --git a/nassh/.gitignore b/nassh/.gitignore index ff62cd6e..b0bde3f2 100644 --- a/nassh/.gitignore +++ b/nassh/.gitignore @@ -17,6 +17,3 @@ js/*.rollup.js # npm related dirs. node_modules - -# Local dev files. -/manifest.json diff --git a/nassh/bin/mkdist b/nassh/bin/mkdist index 83ac4f97..a75e119a 100755 --- a/nassh/bin/mkdist +++ b/nassh/bin/mkdist @@ -167,19 +167,18 @@ def copyfiles(tmpdir, extra_exclude=()): shutil.copy(path, dst) -def mkzip(manifest_name: str, stable: bool, archive_suffix: str, +def mkzip(stable: bool, archive_suffix: str, version_mangle: Callable = lambda x: x): """Build the nassh extension archive. Args: - manifest_name: The input manifest file to process for this variant. stable: Whether to mark the manifest as stable or dev [channel]. archive_suffix: String to append to the archive name. Every build needs to have a unique name in order to be archived/signed correctly. version_mangle: Callback to mangle the manifest's version field. """ - logging.info('Processing %s', manifest_name) - manifest = os.path.join(nassh.DIR, manifest_name) + logging.info('Processing ...') + manifest = os.path.join(nassh.DIR, 'manifest.json') with open(manifest, encoding='utf-8') as fp: data = json.load(fp) @@ -345,19 +344,16 @@ def main(argv): # Build the dev channel variants. def _stamp_dev(version): return '.'.join([version] + list(stamps)) - mkzip('manifest_ext.json', False, '-dev', _stamp_dev) - mkzip('manifest_v1.5.json', False, '-dev', _stamp_dev) + mkzip(False, '-dev', _stamp_dev) # Build the stable channel variants. - mkzip('manifest_ext.json', True, '') - mkzip('manifest_v1.5.json', True, '') + mkzip(True, '') # Build the stable channel rollback variants. def _rollback(version): parts = list(int(x) for x in version.split('.')) parts[-1] += 1 parts += [0, 1] return '.'.join(str(x) for x in parts) - mkzip('manifest_ext.json', True, '-rollback', _rollback) - mkzip('manifest_v1.5.json', True, '-rollback', _rollback) + mkzip(True, '-rollback', _rollback) # Never minify, maybe gzip. mkcrosh(False, True) diff --git a/nassh/doc/hack.md b/nassh/doc/hack.md index 4c1359b1..f980c45d 100644 --- a/nassh/doc/hack.md +++ b/nassh/doc/hack.md @@ -74,16 +74,6 @@ testing. It will use the dev extension id to avoid conflicts with the stable extension id, although it will still conflict if you have the dev version installed from the Chrome Web Store (CWS). -You will need to manually select the variant you want to work on. The extension -is defined by the [manifest_ext.json] file while the app is defined by the -[manifest_v1.5.json] file. Simply symlink it to manifest.json: - - nassh$ ln -s manifest_ext.json manifest.json - -For details on the different manifests and modes, see the next section (and the -[FAQ]). You probably want to start with the extension version if you're not -going to be hacking on Chrome OS features. - The extension id is controlled by the `key` field in the manifest.json. See the [manifest key docs](https://developer.chrome.com/extensions/manifest/key) for more details. @@ -109,22 +99,7 @@ level/color as legitmate errors. ## Manifests -There are three manifest files in here currently. The [manifest_v1.5.json] is -used to build the Secure Shell App and has been what we've used for the longest -time, but is largely for Chrome OS only now. The [manifest_ext.json] is used to -build the Secure Shell Extension which works on all platforms (but lacks any -Chrome OS specific features). - -The "v1.5" and "v2" app formats should not be confused with the "v1" and "v2" -manifest formats. Secure Shell uses the legacy/deprecated "v1.5" app style to -launch itself rather than the "v2" style. It means that, in many ways, the -"v1.5" app behaves more like an extension (e.g. it shares cookies with your main -browser instance and can run inside a tab) rather than an app (e.g. it doesn't -get access to many newer `chrome.app.*` APIs). - -See the [FAQ] for more details on the differences between the extension & app. - -If you're updating these files, you'll sometimes also need to update the +If you're updating the [manifest.json], you'll sometimes also need to update the [manifest][manifest_crosh.json] for [crosh] which lives in the Chromium tree. ## Whitelisted Permissions @@ -132,8 +107,7 @@ If you're updating these files, you'll sometimes also need to update the Using the dev extension id is necessary in order to access some APIs that are whitelisted only for Secure Shell. If you don't need these features, you can get by with using a different id (and delete the settings from the -[manifest_v1.5.json] for the app to avoid warnings at runtime). These settings -are already removed from the [manifest_ext.json] for the extension. +[manifest.json] to avoid warnings at runtime). * Access to [crosh] under Chrome OS (`terminalPrivate`). [(1)](https://cs.chromium.org/search/?q=terminalPrivate) @@ -265,8 +239,7 @@ The vast majority of the code here lives under [js/]. * plugin/: Compiled NaCl & output from [ssh_client] * [third_party/]: Various 3rd party code we import. * [chrome-bootstrap.css]: Theme code for the extensions options page. -* [manifest_ext.json]: The Chrome manifest for the extension. -* [manifest_v1.5.json]: The Chrome manifest for the "v1.5" app. +* [manifest.json]: The [Chrome extension manifest]. ## JavaScript Source Layout @@ -519,8 +492,7 @@ Here's a random list of documents which would be useful to people. [_locales/]: ../_locales/ [third_party/]: ../third_party/ -[manifest_ext.json]: ../manifest_ext.json -[manifest_v1.5.json]: ../manifest_v1.5.json +[manifest.json]: ../manifest.json [manifest_crosh.json]: https://cs.chromium.org/chromium/src/chrome/browser/resources/chromeos/crosh_builtin/manifest.json [chrome-bootstrap.css]: ../third_party/chrome-bootstrap/chrome-bootstrap.css @@ -571,6 +543,7 @@ Here's a random list of documents which would be useful to people. [FAQ]: FAQ.md +[Chrome extension manifest]: https://developer.chrome.com/extensions/manifest [copy-data]: https://tools.ietf.org/html/draft-ietf-secsh-filexfer-extensions-00#section-7 [Corp Relay: relay-protocol.md#corp-relay [crosh]: chromeos-crosh.md diff --git a/nassh/doc/processes.md b/nassh/doc/processes.md index f6f461d1..23a9e1a2 100644 --- a/nassh/doc/processes.md +++ b/nassh/doc/processes.md @@ -93,8 +93,8 @@ entries in here (see the comments in the file for details). See commit [e992bb2c819188421b010a7c4fdc96cfae48db31] and tag [nassh-0.9] as examples, but don't create a tag yet! -The version should remain unchanged in the `manifest_*.json` files as we'll -update that after we create a git tag. +The version should remain unchanged in the `manifest.json` & `package.json` +files as we'll update that after we create a git tag. [e992bb2c819188421b010a7c4fdc96cfae48db31]: https://chromium.googlesource.com/apps/libapps/+/e992bb2c819188421b010a7c4fdc96cfae48db31^! [nassh-0.9]: https://chromium.googlesource.com/apps/libapps/+/nassh-0.9 @@ -118,11 +118,11 @@ We don't currently use signed tags. ### Update the manifest.json Versions Now that we've tagged the release and pushed it out, the version should be -updated in the `manifest_*.json` files to point to the next one. +updated in the `manifest.json` & `package.json` files to point to the next one. -See commit [ddb21ccd39010f4c537da2a104f1a8869fe1ee6c] as an example. +See the [nassh-0.34 tag] as an example. -[ddb21ccd39010f4c537da2a104f1a8869fe1ee6c]: https://chromium.googlesource.com/apps/libapps/+/ddb21ccd39010f4c537da2a104f1a8869fe1ee6c^! +[nassh-0.34 tag]: https://chromium.googlesource.com/apps/libapps/+/refs/tags/nassh-0.34^! ## Promoting a Stable Release diff --git a/nassh/manifest_ext.json b/nassh/manifest.json similarity index 100% rename from nassh/manifest_ext.json rename to nassh/manifest.json diff --git a/nassh/manifest_v1.5.json b/nassh/manifest_v1.5.json deleted file mode 100644 index 35f2e377..00000000 --- a/nassh/manifest_v1.5.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDixnK8f4AuZrV+QZx7iiONG/SAiU5VrjlXD2KxRGvI6tDJrLvUin+GpcuMH1d/Qrc0+PmCzJ1duAiD/9F2q8kiYwQ1C3gZmztYneAiVX+3/OvXHr/idyueNQ5XFvBnMCpKD0KqPEksP80utV417fuaHAY4NFjofLZyWUvu23XHRwIDAQAB", - "minimum_chrome_version": "57", - "manifest_version": 2, - "content_security_policy": "script-src 'self'; object-src 'self'", - "name": "__MSG_nassh_product_name__ App (tot)", - "version": "0.36", - "default_locale": "en", - "icons": { - "128": "images/dev/icon-128.png", - "48": "images/dev/icon-48.png", - "32": "images/dev/icon-32.png", - "24": "images/dev/icon-24.png", - "16": "images/dev/icon-16.png" - }, - "description": "Terminal emulator and SSH and SFTP client.", - "offline_enabled": true, - "options_page": "html/nassh_preferences_editor.html", - "incognito": "split", - "permissions": [ - "clipboardRead", - "clipboardWrite", - "idle", - "notifications", - "storage", - "terminalPrivate", - "unlimitedStorage", - "fileSystemProvider", - "accessibilityFeatures.read", - "crashReportPrivate", - "metricsPrivate" - ], - "file_system_provider_capabilities": { - "source": "network", - "multiple_mounts": true, - "configurable": true - }, - "web_accessible_resources": [ - "html/nassh.html", - "html/nassh_google_relay.html" - ], - "background": { - "persistent": false, - "page": "html/nassh_background.html" - }, - "platforms": [ - { - "nacl_arch": "x86-64", - "sub_package_path": "_platform_specific/x86-64/" - }, - { - "nacl_arch": "x86-32", - "sub_package_path": "_platform_specific/x86-32/" - }, - { - "nacl_arch": "arm", - "sub_package_path": "_platform_specific/arm/" - } - ], - "omnibox": { - "keyword": "ssh" - }, - "app": { - "launch": { - "local_path": "html/nassh.html" - } - } -}