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

No webui when running daemon as private swarm #4174

Closed
chrismatthieu opened this issue Aug 28, 2017 · 14 comments
Closed

No webui when running daemon as private swarm #4174

chrismatthieu opened this issue Aug 28, 2017 · 14 comments

Comments

@chrismatthieu
Copy link

chrismatthieu commented Aug 28, 2017

Version information: 0.4.10

Type: Bug

Severity: High

Description: When creating a private network via new swarm key without bootstraps, the webui (http://localhost:5001/webui) no longer loads.

ipfs daemon output below:

Swarm is limited to private network of peers with the swarm key
Swarm key fingerprint: add41ab40fa...
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.86.31/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready

@chrismatthieu
Copy link
Author

chrismatthieu commented Aug 28, 2017

12:48:18.123 ERROR core/serve: ipfs resolve -r /ipfs/QmPhnvn747LqwPYMJmQV...: Failed to get block for QmPhnvn747LqwPYMJmQV...: context canceled gateway_handler.go:584

@Kubuxu
Copy link
Member

Kubuxu commented Aug 28, 2017

This will be the case. What you would have to do is:

  1. create fresh repo
  2. load webui on it
  3. add it to private network
  4. load webui

Webui is fetched not as a part of go-ipfs itself but from the network.

@whyrusleeping
Copy link
Member

whyrusleeping commented Aug 28, 2017

@Kubuxu we should create an easy to load up 'pack' for the webui. Can probably just ipfs get the webui code and put it in a tar for people to download manually and add. That could even go up on the distributions page

@chrismatthieu
Copy link
Author

chrismatthieu commented Aug 29, 2017

That would be cool. I'm not sure yet how to "load" the webui. Should I just clone a repo for now?

@chrismatthieu
Copy link
Author

chrismatthieu commented Aug 29, 2017

I see the repo (https://github.com/ipfs/webui). Thanks!

@ahester57
Copy link

ahester57 commented Jun 27, 2018

The webui from ipfs-shipyard does not work with private swarm right away. To get it working, what I had to do was:

  1. Clone the repo at https://github.com/ipfs-shipyard/ipfs-webui
  2. Start the ipfs daemon without the swarm.key
  3. Start up the ipfs webui with npm start
  4. Stop the daemon.
  5. Put the swarm.key back in and start daemon
  6. Refresh the webui

No idea why. It seems that the webui could not retrieve the node info when the swarm.key was in place, but starting it without it and then restarting it with it caused it to remember the node info. After these steps, however, I am still unable to see my connected peers even though ipfs swarm peers returns my list of peers.

@whyrusleeping
Copy link
Member

whyrusleeping commented Jun 27, 2018

@ahester57 the webui is generally fetched from other ipfs peers who have it. If nobody in your private network has the webui, then you have nobody to fetch it from.

@ahester57
Copy link

ahester57 commented Jun 27, 2018

@whyrusleeping I have the development branch of the webui running one one machine. I can upload and retrieve files to and from my private swarm with it. I can also get the file using the uploaded hash on an AWS server. But not everything is working.

How do I go about uploading the webui to IPFS? I could pin the webui repo, but this would not necessarily automatically route those files to localhost:5001, right?

@whyrusleeping
Copy link
Member

whyrusleeping commented Jun 27, 2018

@olizilla is the most knowledgeable on the current webui stuff, let's ask him

@ahester57
Copy link

ahester57 commented Jun 27, 2018

paging @olizilla @tableflip

@ahester57
Copy link

ahester57 commented Jun 27, 2018

I've fixed it.

  1. Build & bundle webui.
  2. Add webui/dist to ipfs.
  3. Pin that hash to boot node.
  4. Modify source of go-ipfs/core/corehttp/webui.go to point to that hash.
  5. Install modified client and viola, webui is served on localhost:5001

@whyrusleeping Thanks for the concern!

@douglasmsi
Copy link

douglasmsi commented Sep 10, 2018

Do you know if there is another way without changing the core? We are integrating ipfs into a solution for private networking. We are in a segregated network without access to the Internet and github to perform the build. Is there any webui tarball that would just work by adding it to ipfs?

@Stebalien
Copy link
Member

Stebalien commented Sep 10, 2018

Do you know if there is another way without changing the core? We are integrating ipfs into a solution for private networking. We are in a segregated network without access to the Internet and github to perform the build. Is there any webui tarball that would just work by adding it to ipfs?

Yes. curl https://ipfs.io/api/v0/get/QmQLXHs7K98JNQdWrBB2cQLJahPhmupbDjRuH1b9ibmwVa | tar -xf -. You can then add it with a normal ipfs add -r ..., that should give you the same hash back (as long as you use the default options).

@ThomasFreedman
Copy link

ThomasFreedman commented Sep 22, 2019

Your solution to avoid core code changes doesn't work fully. Not sure what you meant by should give same hash, presumably for the entire folder. That seems to be true but what about the individual files and their hashes?

See this forum post for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants