Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

feat: show Web UI url in daemon output #1595

Merged
merged 3 commits into from
Oct 19, 2018
Merged

Conversation

olizilla
Copy link
Member

  • make it easier for people to discover the Web UI
  • tidy up inconsistencies across the log lines
  • add IPFS to the first line. confirm to new users they started what they expected to.

fixes ipfs/ipfs-webui#815

Before

$ jsipfs daemon
Initializing daemon...
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/QmPmrqh4ybdUJwGchEecuj2GBXCxKL5iapW9qmk8pwgCGs
Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/QmPmrqh4ybdUJwGchEecuj2GBXCxKL5iapW9qmk8pwgCGs
Swarm listening on /ip4/192.168.1.244/tcp/4002/ipfs/QmPmrqh4ybdUJwGchEecuj2GBXCxKL5iapW9qmk8pwgCGs
API is listening on: /ip4/127.0.0.1/tcp/5002
Gateway (readonly) is listening on: /ip4/127.0.0.1/tcp/9090
Daemon is ready

After

$ node src/cli/bin.js daemon
Initializing IPFS daemon...
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/QmPmrqh4ybdUJwGchEecuj2GBXCxKL5iapW9qmk8pwgCGs
Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/QmPmrqh4ybdUJwGchEecuj2GBXCxKL5iapW9qmk8pwgCGs
Swarm listening on /ip4/192.168.1.244/tcp/4002/ipfs/QmPmrqh4ybdUJwGchEecuj2GBXCxKL5iapW9qmk8pwgCGs
API listening on /ip4/127.0.0.1/tcp/5002
Gateway (read only) listening on /ip4/127.0.0.1/tcp/9090
Web UI available at http://127.0.0.1:5002/webui
Daemon is ready
  • Announces the Web UI 🎉
  • No colons, simply siding with what most of the log lines do currently
  • Use "listening on" consistently rather than "is listening on"
  • Use "read only" not "readonly"
  • Initializing IPFS daemon... to confirm to the user they started the thing they expected.

I'd keep the "Daemon is ready" copy the same though as it's the kind of output that people might be scraping from scripts to check that it started without error, and changing it would frustrate.

License: MIT
Signed-off-by: Oli Evans oli@tableflip.io

@ghost ghost assigned olizilla Sep 27, 2018
@ghost ghost added the status/in-progress In progress label Sep 27, 2018
@olizilla
Copy link
Member Author

While thinking about this, I came up with what I'd actually like to see in my console...

$ jsipfs daemon
Starting IPFS daemon

Peer ID       QmNTAZYQ5rtaoFtryAX2h9dycuBjhVgXtjPVZNYuMHMBw8
Swarm address /ip4/127.0.0.1/tcp/4003/ws/ipfs QmNTAZYQ5rtaoFtryAX2h9dycuBjhVgXtjPVZNYuMHMBw8
Swarm address /ip4/127.0.0.1/tcp/4002/ipfs/QmNTAZYQ5rtaoFtryAX2h9dycuBjhVgXtjPVZNYuMHMBw8
Swarm address /ip4/192.168.1.244/tcp/4002/ipfs/QmNTAZYQ5rtaoFtryAX2h9dycuBjhVgXtjPVZNYuMHMBw8
Gateway       /ip4/127.0.0.1/tcp/9090
API           /ip4/127.0.0.1/tcp/5002

Web UI available at http://localhost:5002/webui

Daemon is ready

It's a little different to what we have now, but I think it's worth discussing. The PR in it's current state just tides things up, but if others like the look of the above, I'll make it happen. I could even learn some Go.

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ❤️ all the changes in the PR.

I'm not as keen on the alignment in #1595 (comment), but I'm +1 on the addition of the peer ID.

@Stebalien would you accept a PR to make the same changes in go-ipfs?

@olizilla will you send a PR to update

return reply().redirect().location('/ipfs/QmQLXHs7K98JNQdWrBB2cQLJahPhmupbDjRuH1b9ibmwVa')
? 😜

FYI - in the next go-ipfs, version numbers will be printed: ipfs/kubo#5503

I'd keep the "Daemon is ready" copy the same though as it's the kind of output that people might be scraping from scripts to check that it started without error, and changing it would frustrate.

That is absolutely true.

@olizilla
Copy link
Member Author

@alanshaw the alignment isn't like when people create work for everyone by aligning their variable declarations; in this case it's more like we're showing tabular data (or at least a definition list) so lets give it a table-like layout for readability.

You will get a PR with a CID for the new Web UI when we fix all the issues you raised 😜

@achingbrain
Copy link
Member

I'd love a --quiet option that doesn't show anything so as to not see anything in test output, etc.

@alanshaw
Copy link
Member

@achingbrain the silent option should probably do this!

@Stebalien
Copy link
Member

@Stebalien would you accept a PR to make the same changes in go-ipfs?

Absolutely! (once go-ipfs has had it's webui version updated to the revamped version, that is...)

Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, if I approve this it means that js-ipfs gets the nuWebUI first? APPROVE!!!!! :D

Btw, congratz again on the nuWebUI, it looks aaaamazing! :D

@alanshaw
Copy link
Member

alanshaw commented Oct 2, 2018

@olizilla I think this is going to need changes to ipfsd-ctl before we can merge it.

@olizilla
Copy link
Member Author

olizilla commented Oct 2, 2018

Sure I'll take a look.

@alanshaw alanshaw mentioned this pull request Oct 17, 2018
38 tasks
- make it easier for people to discover the Web UI
- tidy up inconsistencies across the log lines
- add IPFS to the first line. confirm to new users they started what they expected to.

fixes ipfs/ipfs-webui#815

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
alanshaw added a commit to ipfs/js-ipfsd-ctl that referenced this pull request Oct 19, 2018
Required for ipfs/js-ipfs#1595

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
@alanshaw
Copy link
Member

ipfs/js-ipfsd-ctl#301

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
@ghost ghost assigned alanshaw Oct 19, 2018
hugomrdias pushed a commit to ipfs/js-ipfsd-ctl that referenced this pull request Oct 19, 2018
"API is listening..." changed to "API listening..." and no longer matches the regex.

N.B. is backwards compatible with older versions of the daemon.

Required for ipfs/js-ipfs#1595
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
@alanshaw alanshaw merged commit 9a82b05 into master Oct 19, 2018
@alanshaw alanshaw deleted the webui-in-daemon-output branch October 19, 2018 12:01
@ghost ghost removed the status/in-progress In progress label Oct 19, 2018
package.json Outdated
@@ -72,7 +72,7 @@
"form-data": "^2.3.2",
"hat": "0.0.3",
"interface-ipfs-core": "~0.78.0",
"ipfsd-ctl": "~0.39.1",
"ipfsd-ctl": "ipfs/js-ipfsd-ctl#fix/cli-scraping",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get this released before releases js-ipfs

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

Successfully merging this pull request may close these issues.

How do users discover the Web UI?
5 participants