Giter Club home page Giter Club logo

ipfs-webui's Introduction

IPFS Web UI

A web interface to IPFS, shipped with Kubo, and ipfs-desktop.

Check on your node stats, explore the IPLD powered merkle forest, see peers around the world and manage your files, without needing to touch the CLI.

Screenshot of the status page

Files Explore Peers Settings
Screenshot of the file browser page Screenshot of the IPLD explorer page Screenshot of the swarm peers map Screenshot of the settings page

i18n status

The latest release version is always at https://webui.ipfs.io, and the preview of main branch is at https://dev.webui.ipfs.io.

The IPFS WebUI is a work-in-progress. Help us make it better! We use the issues on this repo to track the work.

The app uses kubo-rpc-client to communicate with your local IPFS node.

The app is built with create-react-app. Please read the docs.

Install

Supported Node.js versions:

> npm install

A Note on NodeJS support

We aim to support ipfs-webui development and build with "Current" and "Active LTS" Nodejs versions.

See https://nodejs.org/en/about/releases/ for more information about which versions have which release statuses.

Usage

When working on the code, run an ipfs daemon, the local dev server, the unit tests, and the storybook component viewer and see the results of your changes as you save files.

In separate shells run the following:

# Run IPFS
> ipfs daemon
# Run the dev server @ http://localhost:3000
> npm start
# Run the unit tests in watch mode
> npm run test:unit:watch
# Run the UI component viewer @ http://localhost:9009
> npm run storybook

Configure Kubo RPC API CORS headers

You must configure your Kubo RPC endpoint at http://127.0.0.1:5001 to allow cross-origin (CORS) requests from your dev server at http://localhost:3000

Similarly if you want to try out pre-release versions at https://dev.webui.ipfs.io you need to add that as an allowed domain too.

Easy mode

Run the cors-config.sh script with:

> ./cors-config.sh

The manual way

> ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://localhost:3000", "https://webui.ipfs.io", "http://127.0.0.1:5001"]'
> ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["POST"]'

Reverting

To reset your config back to the default configuration, run the following command.

> ipfs config --json API.HTTPHeaders {}

You might also like to copy the ~/.ipfs/config file somewhere with a useful name so you can use ipfs config replace <file> to switch your node between default and dev mode easily.

Running with Docker

If you need to run IPFS in a Docker container, you can still have Web UI available by exposing both the Gateway and Web UI ports.

Using the default ports:

docker pull ipfs/kubo
docker run -p 8080:8080 -p 5001:5001 -it ipfs/kubo

See the kubo page on Docker Hub to get started using IPFS with Docker.

Build

To create an optimized static build of the app, output to the build directory:

# Build out the html, css & jss to ./build
> npm run build

Test

The following command will run all tests: unit one for React and E2E against real Kubo RPC:

> npm test

Unit tests

To watch source files and re-run the tests when changes are made:

> npm run test:unit

The WebUI uses Jest to run the isolated unit tests. Unit test files are located next to the component they test and have the same file name, but with the extension .test.js

E2E tests

The end-to-end tests (E2E) test the full app in a headless Chromium browser. They spawn real Kubo node for HTTP RPC and a static HTTP server to serve the app. The purpose of those tests is not being comprehensible, but act as a quick regression and integration suite. Test files are located in test/e2e/.

Make sure npm run build is run before starting E2E tests:

> npm run build
> npm run test:e2e # end-to-end smoke tests (fast, headless, use Kubo)

Customizing E2E Tests

Default behavior can be tweaked via env variables below.

IPFS_GO_EXEC

It is possible to test against arbitrary versions by tweaking kubo in devDependencies section of package.json and applying the change via npm i.

One can also override the binary used in e2e tests by providing a path to an alternative one via IPFS_GO_EXEC:

> IPFS_GO_EXEC=$GOPATH/bin/ipfs  npm run test:e2e

E2E_API_URL

Instead of spawning a disposable node and repo for tests, one can point the E2E test suite at arbitrary Kubo-compatible RPC API running on localhost:

> E2E_API_URL=http://127.0.0.1:5001 npm run test:e2e

Caveat 1: HTTP RPC API used in tests needs to run on the local machine for Peers screen to pass (they test manual swarm connect to ephemeral /ip4/120.0.0.1/.. multiaddr)

Caveat 2: CORS requests from http://localhost:3001 (static server hosting dev version of webui) need to be added to Access-Control-Allow-Origin whitelist array in node's config:

"API": {
  "HTTPHeaders": {
    "Access-Control-Allow-Methods": ["POST"],
    "Access-Control-Allow-Origin": [
      "http://localhost:5001",
      "http://localhost:3001"
    ]
  }
}

Can be done ad-hoc via command line:

> ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://localhost:3001", "http://127.0.0.1:5001"]'
> ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["POST"]'

Debugging E2E tests

Show the browser

By default, the test run headless, so you won't see the browser. To debug test errors, it can be helpful to see the robot clicking around the site. To disable headless mode and see the browser, set the environment variable DEBUG=true:

> DEBUG=true npm run test:e2e # will show a browser window

To build and run e2e only for a specific test script, pass its name:

> npm run build && npm run test:e2e -- --grep "Settings"

Breakpoints

It is possible to set a "breakpoint" via await page.pause() to stop tests at a specific line.

Read more at https://playwright.dev/docs/debug#using-pagepause

Coverage

To do a single run of the tests and generate a coverage report, run the following:

> npm run test:coverage

Lint

Perform standard linting on the code:

> npm run lint

Analyze

To inspect the built bundle for bundled modules and their size, first build the app then:

# Run bundle
> npm run analyze

Translations

One can permanently switch to a different locale via Settings or temporarily via ?lng=<lang-code> URL parameter.

The translations are stored on ./public/locales and the English version is the source of truth. We use Transifex to help us translate WebUI to another languages.

If you're interested in contributing a translation, go to our page on Transifex, create an account, pick a language and start translating. Be sure to change your notification settings to be notified when translation sources change.

You can read more on how we use Transifex and i18next in this app at docs/LOCALIZATION.md

Releasing

  1. Check that the Transifex sync action is successful or fails because there are no updates.
  2. If UI is materially different, update screenshots in README.md and on docs.ipfs.io here
  3. Manually dispatch ci.yml workflow on main branch. This will create a new release.
  4. If release is good enough for LTS, update the CID at projects that use ipfs-webui by submitting PR against below lines:

Contribute

Feel free to dive in! Open an issue or submit PRs.

To contribute to IPFS in general, see the contributing guide.

Browser and device testing

We would like to thank BrowserStack for supporting Open Source and making it possible to test the IPFS Web UI on a wide array of operating systems and devices, improving compatibility for everyone.

License

MIT © Protocol Labs

ipfs-webui's People

Contributors

alanshaw avatar atinux avatar cwaring avatar daviddias avatar dependabot-preview[bot] avatar dependabot[bot] avatar digital-dreamer avatar dignifiedquire avatar fsdiogo avatar galargh avatar github-actions[bot] avatar gozala avatar grassias avatar greenkeeperio-bot avatar hacdias avatar infinisil avatar jbenet avatar jessicaschilling avatar krl avatar lidel avatar mappum avatar olizilla avatar rafaelramalho19 avatar richardlitt avatar semantic-release-bot avatar sgtpooki avatar strml avatar travisperson avatar web-flow avatar xrazis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipfs-webui's Issues

Path Resolve error for "fontawesome-webfont.woff2" on fresh IPFS install

I installed IPFS on both Debian Sid and Centos 6.6 (Final). When running the daemon I get:

ERROR core/serve: Path Resolve error: no link named "fontawesome-webfont.woff2" under QmWjympWW8hpP5Jgfu66ZrqTMykUBjGbFQF2XgfChau5NZ gateway_handler.go:436

It doesn't seem to affect functionality, but something is definitely amiss.

go version go1.4.2 linux/amd64
ipfs version 0.3.4

Bring back the log view

  • log/tail works in the new js-ipfs-api
  • To ensure we are not running out of memory the log should
    • be streamed into a ring buffer with a max of 1000 lines
    • stopped when navigating away from the log view and the ring buffer cleaned up from memory

Client-side Javascript DAG visualization / explorer

It seems like it would be immensely cool to have a visualization of data stored in ipfs.

[Edit: To clarify, what I'm imagining is an interactive node/link visualization/browser running in a JavaScript app, either in the webui or a separate application.]

  1. Does this exist already somewhere? If not, is the webui the right place to add it? I think this may ultimately want to be it's own application.
  2. What kind of visualization? I lean toward graph viz (nodes and edges). Other good options include tree-shaped viz.
  3. Which JS viz framework? My top 3 picks are:

If we were doing graph-shaped viz, I'd lean toward Sigma, because it creates beautiful graphs pretty much out of the box, and renders to webgl (when available) for use with large data sets.

If I get time I'll hack on it a bit; meanwhile any feedback very welcome.

"raw" button breaks when using ipns paths

repro: on the webui, put an ipns path in the search bar, i.e. /ipns/ipfs.git.sexy. Then click the "Raw" button on the resulting page, it will redirect you to a gateway link that will be broken as it tries to prepend the path with /ipfs/ resulting in /ipfs/ipns/ipfs.git.sexy

reverse proxy for webui not connecting

we are running an ipfs gateway on a server.

i'd like to be able to run the API behind a reverse proxy so that we can add basic authentication for the node but expose the gateway to the public. also, i'd like the url to resolve without having to type the ports when i want to check the gateway.

setup: ipfs with API on 0.0.0.0:5001 nginx in front reverse proxying to ipfsc.erisbootstrap.sexy ... nginx is working properly for the gateway (see #3 ) and urls to ipfs.erisbootstrap.sexy (which is routed to the gateway port) all resolve fine.

problem: when i connect to ipfsc.erisbootstrap.sexy which is proxied to 5001, the webui loads fine but does not connect to the API properly. it is just a plain UI without any connection details. however when I connect via the IP:Port combo it resolves fine. links below:

Unable to download nodewebkit

The location of node-webkit has been moved. The node-webkit-builder package needs to be updated to at least 1.0.6 (^1.0.6).

Test Suite

I'd like to setup a test suite for the webui, so i can reliably know merging something without running it + QA-ing it myself won't totally break everything. both:

  1. with a mocked out API (jasmine or whatever we want)
  2. with a live running node, so we test it end-to-end

this issue will track proposals on how to do this test suite.

how to connect to go-ipfs

OK, so this is probably a stupid question, but how do we bind this repo to the go-ipfs daemon? This repo does not seem to be a git submodule (or a subtree) of go-ipfs or anything.

We can install and compile go-ipfs, then initialize it and start up the daemon:

    ipfs init
   ipfs daemon

And then we look up localhost:5001 and get the older version.

I am asking here rather than via IRC so that the answer will be searchable and public.

What is the routine to checkout the newer versions?

EC6 incompabilities?

On running make serve, and checking the files page, i get multiple errors along the line of:

Uncaught TypeError: undefined is not a function files.jsx:21

the offending line is:

pinned.Keys.sort()

This seems to be a EC6 feature, but it's not being transpiled in the build.

As a workaround i replaced the places where this was used with lodash.

@travisperson
Is there some special setup to have it transpile in the dev-env?

spurious files listings

$ ipfs add US-Government-Still-Silent-on-American-Journalist-Murdered-for-Exposing-Turkey’s-ISIS-Ties.pdf
added QmY6sC3NmsCbZiPihyfhDiR2gijdzqN7BaYK2g7PewbYpH US-Government-Still-Silent-on-American-Journalist-Murdered-for-Exposing-Turkey’s-ISIS-Ties.pdf
$ ipfs ls QmY6sC3NmsCbZiPihyfhDiR2gijdzqN7BaYK2g7PewbYpH
QmeUkVZKQwrUdG1BndVNkq6n88yzGnGH5JBrdiVsG7Uc5i 262158 
QmVHBYN1HMasLHBMHWs1hVJFWJ3K7jNkr6f1EWSZJV27ZB 262158 
QmXCb1TaYAx8hW3KJLA3ZMneSg56iTRGewghsMHq53YqEc 262158 
QmZ6D1pzR7MJgXmjAfTJQxVAhYQqn6UYLFFtoUfyYYGDe8 262158 
QmT7FYPgR5wGesFBBDdN3sqXop9HgYaP5pn3zzKtJiQptS 262158 
QmczHBY4xExAQ1AEyoax38fC3Jh9yXTqGkgnqCfGotkrtV 262158 
QmQD1uXBz63RN8RENYBMgfZ1W7cJvZ5wx4TSFLjqFTBKZA 262158 
QmfFFPwwhTWZ6rj1wgsKo17zZ1uVi2mpNCrAz7CQ7FUgd8 143546 
$ 

Notice that I did not pin this object.

Yet, it appears in the pinned files list:
http://localhost:5001/ipfs/QmS2HL9v5YeKgQkkWMvs1EMnFtU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EWjCHavYbNqU
QmeFod9Whb3sMcXS3FyJrFdLPFad7PfiR8yFWADLTQFPB3
QmegAwrtM29oZqG52KM57SdxmiHveorJEguh1EdD42uYuh
QmfE3nUohq2nEYwieF7YFnJF1VfiL4i3wDxkMq8aGUg8Mt
QmfF48NZGzVq53XqutPmNRrgJQS3uypC73Ypc25qqsgKr5

But it’s NOT in [Files Tab]
Type Name ID Actions
HTM
You Are Here.htm
QmNxYrzU7nLMERzNn8SHnJYxiQQCr5xYFGBPMoDbXX3FCV
PNG
11080908_822881507801355_5238711632930395669_n.png
QmZNe3xvQaxdtVp43NTJ9oURYPBKyVFJ8VDWHPipcGUwNF
JPG
Terrorism 1966 Definition.jpg
QmXu6ouEAraepkgMshQ8C9Wpu6AVdQuSwZ1a7jJsoXQZMK
JPG
Errico-Malatesta.jpg
QmQmJ55Vm9Ct6Vvhpnv2r8JBpcxNeivvcGXvVvRogb8zu2
JPG
Lucy-Parsons-development-individuals.jpg
QmegAwrtM29oZqG52KM57SdxmiHveorJEguh1EdD42uYuh
JPG
11102920_786874584744137_4665089822529436252_o.jpg
QmY9eMeuK2JYpPwUiFCd5j8UvM5CDroMeu4L8o96nxrrgs
JPG
de19747bcbd79ad457971fa173f4952e_970x.jpg
QmdRkpcRWDQp3GDw2sLjdNjsmCAtaNivRex3r2ZkkgBNMC
PNG
boy 234x234.png
QmPQUsvqQH5kEntM99FspUWxMUd8iJy5FCFkd2dAa3eSFv
PNG
virtual reality 1213x449.png
QmX97wck9U7yUJHDjMVDHy2ZNmcHjgAseFaMoWMJtehxXT
JPG
boy electric socket.jpg
QmQQWN2nV3KgaWtGWMYGPvh1sLDk1Xg8MtCDQN2CCPoiyv

In fact all files in the Files list are only those I added before mid-October; none added since then appear. This begs the question: what is the intended purpose of the files list - only "unpinned" files?

Remove local storage

today, when files are added via webui they get put on local storage.

this should no longer be the case. we should not be using browser local storage for this, as it gets inconsistent with the ipfs repo itself. all[1] state should go through the api.

[1] i think all. post if you think any should remain in local storage. possible that some user preferences -- now i think about it i think @STRML made it a preference to pick a particular globe. (sorry i haven't published that, was waiting on some bugfixes)

Not being able to `make publish`

» make publish                                                                                            
rm -rf build
rm -rf publish
npm install
mkdir publish
cp -r static publish
cp -r html/index.html publish
node_modules/.bin/browserify -t reactify . > publish/bundle.js
SyntaxError: Unexpected token (30703:1) while parsing /Users/david/Documents/Code/ipfs/webui/node_modules/three/three.js while parsing file: /Users/david/Documents/Code/ipfs/webui/node_modules/three/three.js
    at DestroyableTransform.end [as _flush] (/Users/david/Documents/Code/ipfs/webui/node_modules/browserify/node_modules/insert-module-globals/index.js:75:21)
    at DestroyableTransform.<anonymous> (/Users/david/Documents/Code/ipfs/webui/node_modules/browserify/node_modules/readable-stream/lib/_stream_transform.js:135:12)
    at DestroyableTransform.g (events.js:260:16)
    at emitNone (events.js:67:13)
    at DestroyableTransform.emit (events.js:166:7)
    at prefinish (/Users/david/Documents/Code/ipfs/webui/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:450:12)
    at finishMaybe (/Users/david/Documents/Code/ipfs/webui/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:458:7)
    at endWritable (/Users/david/Documents/Code/ipfs/webui/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:469:3)
    at DestroyableTransform.Writable.end (/Users/david/Documents/Code/ipfs/webui/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:436:5)
    at DestroyableTransform.onend (/Users/david/Documents/Code/ipfs/webui/node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.j

webui keeps API server (daemon) from shutting down

The API server is served by braintree/manners, which keeps serving until all connections are closed.

Parts of the webui, such as polling for peers in the swarm, will open a connection and keep it open, but there doesn't seem to be any check for whether or not the server is in "shut down mode", which means the webui will keep the server alive forever.

On the ipfs daemon side there's no logging of why the server is kept alive, such as e.g. "Waiting for API connections to finish", and closing the tab with the webui in Chrome doesn't seem to immediately close the connection either, so the reason for the stuck server is quite opaque.

The only option is to forcefully close the daemon with another Ctrl+C, resulting in "Received another interrupt before graceful shutdown, terminating...", which can be a bit scary, as the user doesn't know what bad effects that might result in.

raw file links point to bound gateway instead of effective gateway

context: we have an IPFS gateway on a server. gateway is bound to 0.0.0.0:8080. in front of gateway, nginx is reverse proxying 8080 to 443. that all works fine. in addition, the API port is bound to 0.0.0.0:5001.

when i go to the webui here and hover on links to the raw files they resolve to http://0.0.0.0:8080/ipfs/.... rather than our gateway.

if there was a way to pass an effective base URL to the webui for links that would be tremendous, or some other way to have the ui understand that our public facing gateway is running on a different URL than what the backend is bound to.

Great work, BTW, the UI looks fantastic.

API Returns 403 only for web UI

I noticed that the web ui would stop working after a while, and permanently. The API still responds fine, but not when the UI makes the request. Chrome/firefox web tools lets you export a request to a cURL command, and I was able to export a working request (where I pasted in the api url into the address bar), and a broken request coming from the API. These results are replicated using cURL as well.

Chrome

Command from the address bar, working:

curl 'http://127.0.0.1:5001/api/v0/config?arg=Addresses.Gateway&stream-channels=true'
-H 'Accept-Encoding: gzip, deflate, sdch'
-H 'Accept-Language: en-US,en;q=0.8'
-H 'Upgrade-Insecure-Requests: 1'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36'
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
-H 'Cache-Control: max-age=0'
-H 'Connection: keep-alive' --compressed

Response:

{
  "Key": "Addresses.Gateway",
  "Value": "/ip4/127.0.0.1/tcp/8080"
}%

Command from the web UI, broken:

curl 'http://127.0.0.1:5001/api/v0/config?arg=Addresses.Gateway&stream-channels=true'
-H 'Accept-Encoding: gzip, deflate, sdch'
-H 'Accept-Language: en-US,en;q=0.8'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36'
-H 'content-type: undefined'
-H 'Accept: */*'
-H 'Referer: http://127.0.0.1:5001/ipfs/QmaaqrHyAQm7gALkRW8DcfGX3u8q9rWKnxEMmf7m9z515w/'
-H 'Connection: keep-alive' --compressed

Response:

403 - Forbidden%

The diff of these 2 requests are as follows (working on the left, web ui on the right):
2015-10-15-215515_1366x768_scrot

I found that removing the referrer and adding the Cache-Control: max-age=0 fixed the request:

curl 'http://127.0.0.1:5001/api/v0/config?arg=Addresses.Gateway&stream-channels=true'
-H 'Accept-Encoding: gzip, deflate, sdch'
-H 'Accept-Language: en-US,en;q=0.8'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36'
-H 'content-type: undefined'
-H 'Accept: */*'
-H 'Cache-Control: max-age=0'
-H 'Connection: keep-alive' --compressed

Result:

{                                                                 
  "Key": "Addresses.Gateway",
  "Value": "/ip4/127.0.0.1/tcp/8080"
}%  

Firefox

The requests coming from firefox are a bit different.

Working, from a request coming from the URL bar:

curl 'http://127.0.0.1:5001/api/v0/config?arg=Addresses.Gateway&stream-channels=true'
-H 'Host: 127.0.0.1:5001'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0'
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
-H 'Accept-Language: en-US,en;q=0.5' --compressed
-H 'Cookie: __utma=96992031.1150785634.1435613418.1435613418.1435687582.2; __utmz=96992031.1435613418.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)'
-H 'Connection: keep-alive'
-H 'Pragma: no-cache'
-H 'Cache-Control: no-cache'

Broken, coming from the web ui:

curl 'http://127.0.0.1:5001/api/v0/config?arg=Addresses.Gateway&stream-channels=true'
-H 'Host: 127.0.0.1:5001'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0'
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
-H 'Accept-Language: en-US,en;q=0.5' --compressed
-H 'Content-Type: undefined'
-H 'Referer: http://127.0.0.1:5001/ipfs/QmaaqrHyAQm7gALkRW8DcfGX3u8q9rWKnxEMmf7m9z515w/'
-H 'Cookie: __utma=96992031.1150785634.1435613418.1435613418.1435687582.2; __utmz=96992031.1435613418.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)'
-H 'Connection: keep-alive'
-H 'Pragma: no-cache'
-H 'Cache-Control: no-cache'

Diff:
2015-10-15-221116_1366x768_scrot

P.S. Here's what the web ui looks when the api requests fail. You can see the network inspector open with the xhr filter, showing all the failed requests:
2015-10-15-221717_1366x768_scrot

New build system

The webui is about to get an overhaul, and the build system needs to be figured out before too much work is done.

Here are some goals

  • Modularize everything. See #73
  • Create test suit. See #38
  • Build ES2015 with Babel

The two main options are Webpack and Browserify.

Browserify:

Pros:

  • Simple, follows Unix philosophy
  • Mature and fast

Cons:

  • Integrating non-JS assets requires writing non portable shell scripts

Webpack:

Pros:

  • Fully featured. Plugins allow for awesome things like react hot-reloading
  • Loads most any type of file. All assets can be processed with one tool

Cons:

  • A bit of magic. Complicated config(well documented though)

404 error doesn't link back to webui

I'm not quite sure if this is intentional or not, but when I enter a hash in the search bar of the webui that doesn't exist, the link to that let's you "Go to console home" sends you to http://localhost:5001 rather than http://localhost:5001/webui resulting in another 404 error.

Remove jquery

We should drop jquery as a dependency and replace all instances with alternatives. For all things bootstrap we should use react-bootstrap and drop bootstrap with jquery

  • scripts/pages/files.js:5:16
  • scripts/pages/objects.js:3:16
  • scripts/views/config.js:3:16
  • scripts/views/editable.js:2:16
  • scripts/views/filelist.js:2:16
  • scripts/views/page.js:5:16

webui feedback

This is an issue compiling a bunch of feedback in one place.

Styling + Home

Styling:

  • links still break url + back button... use hash or query string?
  • fa-list for logs
  • reduce sidebar nav font-weight (use 200 or 400? maybe helvetica neue?)
  • reduce size of sidebar?
  • title or dag search bar at the top navbar
  • top navbar 10px shorter
  • top right icons should have tool tips
  • add "Docs" top right icon

Home

  • use <code> for all hashes (monospace).
  • use <code> for version identifiers
  • use <pre> for key
  • use <code> or <pre> for addresses

Connections

  • dont geolocate local addresses. treat them as self.
    (geolocate own addresses only if not local)
  • still not loads conns for me :(

Files

  • drag+drop is super nice. but there's little indication that file was successfully added. maybe add a <div class="alert alert-success"> with each filename.
  • list all local unixfs files in this page.
  • hashes should be selectable (use <code>?), no need to link.
  • add a "DAG" (or maybe fa-share-alt) action, which takes you to object's dag page
  • Pinned Files should be in its own page. it's going to get big.
  • All Local Files should be in its own page (Local Objects

DAG

  • add to field: placeholder="Enter hash or path: /ipfs/QmBpath..."
  • as user enters things, the field outline should color greein if a hash is correctly entered, and red if not. (some taeke a sec to be transmitted)
  • enter on the field should work
  • needs an image when there is nothing selected.

Config

  • move save btn to right
  • add a reset btn
  • add reset + save buttons to top right
  • make textarea arbitrarily large.

Logs

  • use "Tail" instead of "Bottom".
  • make it actually tail (add events + rescroll to end)
  • add "Clear" and "Top" to bottom of file
  • clear looks too faded. use same color.
  • use<pre> for the text area,
  • pretty-print each json item.
  • use js syntax highlighting with GFM. (highlight.js?)

Build step needs to verify that the build directory is empty

If a file is removed from the static folder (or really anywhere) it could be left in the build directory from a previous build. We should remove everything from the build directory prior to doing a new build to make sure we are working with a clean slate.

WebUI Next - Codename Hive

Preparations for hive

Screens

Home

  • Not very interesting or useful at the moment, what else could we show on this screen? We should keep in mind that at least 95% of all people viewing these screens will be newcomers to IPFS for quite a while, so we should optimize for those cases.

Connections

  • Improve map (no more crazy fans)
  • Make peer list a table that's easy to navigate

Files

Take inspiration from Dropbox/Finder/Explorer

  • Drag n drop
  • Rename
  • Delete
  • Pin/Unpin
  • File type detection
  • Thumbnails for images and videos
  • Folder navigation

DAG

  • Is this actually needed? Wouldn't it be enough to have this data shown as a details screen from the files panel, and if you enter a hash in the search at the top.

Config

  • The config should not be a json object to edit, but rather toggles and input fields

Logs

  • Never worked for me once, so not sure what to do here

Stats

Other thoughts

  • Documentation?

Drafts

Connections

three.js warns about deprecations

When viewing the globe:

THREE.CubeGeometry has been renamed to THREE.BoxGeometry.
THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.

browser memory leak and cpu usage

I am using Firefox (latest release, on Linux) and when using /webui I see the RES memory size in top climbing at about 1MB/s.

Also, the browser eats quite some CPU (even if the globe is not showing, but just a static page).

So, what is causing this?

Accessing the webui behind a proxy

Hi, I have a server with my basic webapp being served via nginx.

Now I have installed ipfs and want to add a /ipfsui proxy target which would take me to the webui for ipfs, thus I made the following additions to my existing fowardproxy in nginx.conf

        location /ipfsui {
            proxy_pass http://127.0.0.1:5001/webui/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }

        location /ipfs {
            proxy_pass http://127.0.0.1:5001;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }    

Now I can go to the ipfs ui by going to http://my_server_ip/ipfsui which properly redirects me to
http://my_server_ip/ipfs/hash_here/#/

However, the page has no relevant ipfs info (like my peer id and so on).

Then I went on to inspect the console error messages and found:

Uncaught TypeError: Cannot read property 'split' of undefined     bundle.js:2185
(anonymous function) @ bundle.js:2185
(anonymous function) @ bundle.js:21711
EventEmitter.emit @ bundle.js:6430
Response.handle @ bundle.js:7115
xhr.onreadystatechange @ bundle.js:6878
bundle.js:2225 Object {version: undefined, updateAvailable: false, updating: false, gateway: "http://127.0.0.1:8080"}

After looking up these error lines I came to the conclusion that the code in page.jsx (which has since changed in the main webui git repo, link: https://github.com/ipfs/webui/blob/master/js/views/page.jsx, but not changed so as it would overcome this problem of mine) determines the ipfs api url and port from window.location.host and window.location.port.

This is the snippet of the webapp that that I currently get served (via ipfs of course):

var host = window.location.hostname
var port = window.location.port || 80
var daemonConf = LocalStorage.get('daemon')
if (daemonConf) {
  host = daemonConf.host
  port = daemonConf.port
}
var ipfs = require('ipfs-api')(host, port)
var ipfsHost = window.location.host

var Page = React.createClass({
  displayName: 'Page',
  getInitialState: function () {
    var t = this

    ipfs.config.get('Addresses.Gateway', function (err, res) {
      if (err || !res) return console.error(err)

      var split = res.Value.split('/')
      var port = split[4]

(you can see where the code failed to split and tracedback from this snippet and the error above)

I know that not everyone will be running this behind a proxy and also that I can temp fix via making the ipfs api listen on 0.0.0.0 by setting it via ipfs config ... but want to ask if there is anby other way to get around my current problem before I embark on that path.

Files added via the webui can not be unpinned via the webui.

Current when adding anything file to the webui they get pinned recursively. Any file you add via ipfs add gets pin recursively to protect the file, and all it's blocks, from a gc. The node-ipfs-api currently does not send a -r/--recursive when running the pin rm command (api.pin.remove), so on any file you try to "delete" (the X), will return an error saying it is added recursively.

scrolling on connections page shouldnt move the globe

when you have a lot of connections on the connections page, and you scroll down, the globe moves with the page. I think it would look nicer if only the connections list scrolled, knowing nothing about javascript, i'm not sure how easy that would be to do.

/files with thousands of files added makes my browser hang

I don't know how many files/directories I have added, but as an experiment I have added thousands of them.

Browsing to http://localhost:5001/ipfs/QmXX7YRpU7nNBKfw75VG7Y1c3GwpSAGHRev67XVPgZFv9R/#/files/all makes Firefox and Chromium on Linux hang a lot.

Use links in the connections list?

I wondered what the connections list is good for (except of "yay, I have 50 peers and they are all on earth!").

It shows me the node id of my peers, but it doesn't link the nodeid to the gateway URL for /ipns/, which would be a nice way to learn about their published content.

Error handling component

There is barely any error handling right now. I think the web ui could benefit from having a centralized error handling component.

Write more tests

Update: (17/2/2016) Please look at #229 for how you can help out with writing tests.

DAG links are broken

Pasting the hash of a local file in the search bar at the top or clicking the DAG link in the files list always results in a 404 page for me.

ipfs version 0.3.7 (latest version through homebrew)

Progress feedback, loading animation

We should have some kind of loading animation, when objects are being resolved etc.

Also, a way to set context timeout to something much lower would be great for ux.

Coordination

Hey everyone watching, we want to push to a 0.2.0 release of the webui next week. It will mostly be bug fixes and a couple improvements.

If you want to help with this, please self-assign an issue (if you don't have collab access to repo, can ask for it or just leave a comment at the end). -- but please keep assignments "fresh" (i.e. dont keep something assigned to self while not actively working on it).

Rough plan:

  • 0.2.0 - bugfixes and so on
  • ipfsdctl + atom-shell packaged app
  • 0.3.0 - continue with new features and enhancements

cc @krl @travisperson @STRML

add a 'local' tab

I would love to have a tab on the webui that gives you a file browser type thing into /ipns/local and allows you to do a lot of the same things you'd be able to do in a normal file browser.

features i want:

  • view files and folders
  • drag files into the browser to put them at that location
  • delete files
  • edit files
  • move files around
  • right click files to add metadata, rename, etc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.