Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Web UI work with the read-only API #835

Open
olizilla opened this issue Sep 27, 2018 · 3 comments
Open

Make Web UI work with the read-only API #835

olizilla opened this issue Sep 27, 2018 · 3 comments
Labels
exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@olizilla
Copy link
Member

olizilla commented Sep 27, 2018

It's not well documented yet, but there is a "safe" subset of the IPFS HTTP API exposed on the Gateway port. Web UI should detect it and work with it so people can safely expose a subset of the functionality when hosting IPFS on a remote machine

You can see the read-only API in action on the Gateway:

https://ipfs.io/api/v0/version

The current definition of what's available is here:

https://github.com/ipfs/go-ipfs/blob/727bf49eff7ff61936aee6d4674ae3e7ad0aaddb/core/commands/root.go#L155-L187

@olizilla olizilla added exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked labels Sep 27, 2018
@olizilla
Copy link
Member Author

olizilla commented Sep 27, 2018

This will need

  • An update to test ipfs-redux-bundle uses to determine if a connection works. Right now it use /id which isn't in the read-only api Use an api call from the whitelist to check if the http api is available ipfs-inactive/ipfs-redux-bundle#4
  • We need a mechanism to determine the commands available, and permitted. We can use the /commands api when we have access to the http api. If we drop window.ipfs support Problem with window.ipfs and Files/Settings #787 then that'd be enough to get the list of api calls that could succeed and modify the UI accordingly. If we keep window.ipfs, then we need a mechanism to determine what permissions the user has granted. Meta: window.ipfs v2 ipfs-companion#589
  • Multiple UI updates, to show disabled actions and to indicate the read-only state of the api available
  • The deluxe solution to this is to review the UI and ensure there is a sensible disabled state for every api call, as the user could selectively disallow privileges via window.ipfs.

@olizilla
Copy link
Member Author

olizilla commented Oct 2, 2018

ipfs-redux-bundle update to not use /id is ready for review ipfs-inactive/ipfs-redux-bundle#15

@olizilla
Copy link
Member Author

Also of note, the dev domain webui.ipfs.io is configured with the /api routes for the read-only api from ipfs.io, so that fools our current webui + redux-bundle combo into thinking there is a full api available on the local domain, so it uses it, and then fails to get bandwidth stats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
No open projects
Status: Needs Grooming
Development

No branches or pull requests

1 participant