Skip to content

Commit

Permalink
nassh: drop building of Chrome App
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: kokoro <[email protected]>
  • Loading branch information
vapier committed Nov 16, 2020
1 parent 5cd0521 commit c6628b2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 118 deletions.
3 changes: 0 additions & 3 deletions nassh/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ js/*.rollup.js

# npm related dirs.
node_modules

# Local dev files.
/manifest.json
16 changes: 6 additions & 10 deletions nassh/bin/mkdist
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
37 changes: 5 additions & 32 deletions nassh/doc/hack.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -109,31 +99,15 @@ 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

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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions nassh/doc/processes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
File renamed without changes.
68 changes: 0 additions & 68 deletions nassh/manifest_v1.5.json

This file was deleted.

0 comments on commit c6628b2

Please sign in to comment.