Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Add installApp API #267

Closed
weilu opened this issue Feb 12, 2014 · 9 comments
Closed

Add installApp API #267

weilu opened this issue Feb 12, 2014 · 9 comments
Assignees

Comments

@weilu
Copy link
Member

weilu commented Feb 12, 2014

Following are options I can think of:

  1. bitcoin.installApp(""https://github.com/author/app_repo.git")
  2. bitcoin.installApp(""http://github.com/author/releases/package-name.hiveapp")

Option 1 has dependency on git and osx client will have to integrate with git so will be more complex. But upgrade could be easier and signing the app can be as simple as signing git release tags.

Option 2 provides more flexibility and is probably much simpler to implement on the osx client side. App upgrade can rely on the combined json file produced by our Hive App Registry Worker/Server (at http://hive-app-registry.herokuapp.com/index.json for now) Git dependency is pushed up the chain. So osx doesn't have to worry about it.

@jsuder @nschum @tgerring @w-hive Thoughts?

@weilu weilu mentioned this issue Feb 12, 2014
@mackuba
Copy link
Member

mackuba commented Feb 12, 2014

You know my thoughts :) I'm against integrating git client in the app and doing a sequence of git pulls on every startup (while also forcing app developers to develop apps in a very specific way), if we can instead just do one or more HTTP requests for JSON files and compare the version fields in the returned records.

@weilu
Copy link
Member Author

weilu commented Feb 12, 2014

@jsuder so does option 2 work for you?

@mackuba
Copy link
Member

mackuba commented Feb 12, 2014

Actually, we might not even need a method for this. It should be possible to intercept downloads of hiveapp files and handle them as app installation, i.e. you'd create a link <a href="...hiveapp">install</a> and clicking it would show the confirmation alert. If I can do that then I think this would be the cleanest solution.

@weilu
Copy link
Member Author

weilu commented Feb 13, 2014

@jsuder Good point! I'll try that. Will close this & release a new version of app store if this works.

@mackuba
Copy link
Member

mackuba commented Feb 14, 2014

No, I take that back, this will need to be an API method:

  • you'll probably want some indication if the app was successfully downloaded and installed, and there's no way to do that with a link
  • in the JS wallets (and other wallets if they use our platform) this will have to be implemented differently anyway (perhaps with apps hosted on the server, and "installation" only as adding a URL to the list in the profile?)

BTW, you can use a link with target="_blank" as a fallback, then the .hiveapp will just be downloaded in the default browser.

@mackuba
Copy link
Member

mackuba commented Feb 14, 2014

Added first version of bitcoin.installApp. I'm thinking how the callback(s) should look... there are basically 3 possible outcomes: installed, user cancelled installation, couldn't download the app for some reason.

So it could be e.g.:

bitcoin.installApp(url, function(wasInstalled, [error]) { ... })

@nschum
Copy link
Contributor

nschum commented Feb 16, 2014

Do we want all apps to have the permission to install other apps? At the very least, apps installed via HTTP should be somewhat sandboxed in this regard.

And shouldn't we add a hash argument to validate the downloaded zip, in order to prevent someone from modifying the zip on the way?

@mackuba
Copy link
Member

mackuba commented Feb 16, 2014

You can always make a link that opens in an external browser that leads to a hiveapp, which will be immediately downloaded, and then you're only one click away from the same confirmation dialog. So I don't think limiting access to this method would help that much.

As for modifying zips on the way, I guess we could make this method reject downloads that use unencrypted http.

@mackuba
Copy link
Member

mackuba commented Feb 17, 2014

@mackuba mackuba closed this as completed Feb 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants