Giter Club home page Giter Club logo

dir-index-html's Introduction

IPFS is an open system to manage data without a central server

Check out our website at ipfs.tech.

For papers on IPFS, please see the Academic Papers section of the IPFS Docs.

License

MIT.

dir-index-html's People

Contributors

benlubar avatar hackergrrl avatar hsanjuan avatar jackloughran avatar jbenet avatar jessicaschilling avatar lidel avatar neatonk avatar noffle avatar rht avatar richardlitt avatar stebalien avatar stensonb avatar tusf 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

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

dir-index-html's Issues

Improve social media previews

People share links on social media and forums. Most of places have "oneboxing" logic, which turns link into more rich preview card with title, one line summary, and a thumbnail:

shared link card on facebook

Problem

Right now, when someone shares IPFS dir listing on social media, the card includes title, but instead of summary, we get random text from the page and no image.

Our directory listing pages should include relevant metadata in meta headers, so if someone shares a link to a directory, it looks better, provides educational information that the link is content-addressed + perhaps has an IPFS-themed thumbnail to make share more interesting.

TODO

I beleive we should make it look good in three most popular contexts:

Useful links

cc @jessicaschilling (this is the thing I briefly mentioned it the other day)

5001 port conflict with Cisco Anywhere Connect VPN

Out of the box install of IPFS will conflict with Cisco Anywhere Connect. In my particular case it was running on OSX Catalina. I had a standard install of the VPN software with not customizations. I downloaded IPFS Desktop and spent better part of a day tracking down why the daemon wouldn't start. On the enterprise front CISCO VPN software is pretty standard and this will get in the way of enterprise level deployments. I think the notifications should come front and center for non-computer science types so they understand they have a port conflict.
YMMV

Make table responsive

The dir-index is looking good when viewed on a computer or laptop. However, when using a smartphone the dir-index does not adapt to the small screen and you have to zoom-in and zoom-out to view and click on directory entries.

As a solution to this I recommend to use HTML5 and responsive Web design.

Humanize file sizes

the sizes are annoying to read, would be nicer as humanized (with the full bytes in the html, but not shown, or if shown, shown as well)

Implement simple test program for dir-index-html

Requesting a simple test program for purposes of being able to cross-browser test the dir-index-html files page itself. At present, it's only possible to browser-test using the flat html file with the short variable names themselves, which isn't terribly accurate when it comes to looking for display errors. Thank you!

Display viewed directory's size

The size of child directories are already shown, it would be nice to also show the size of the current directory.
Example:
Example

[BOUNTY] Directory page UI improvements

This issue has a bounty!

Successfully closing this issue by producing a production-ready PR can earn you not only the undying love of the IPFS community — it can net you a financial reward. See the current list of bounty issues and their values here.

The need in brief

We've had a handful of dir-index-html display requests lurking for a while that could benefit from being addressed together. These are each minor, but in total make the overall directory page UX substantially better.

Deliverable

To earn this bounty, please submit a PR that successfully solves for the following requirements, and documents them using screenshots from the test content.

EDIT 13 JULY 2020: Please also submit whatever upstream changes in go-ipfs must be made in order to enable this end result.

The original requests were each in their own issues -- including them here for context.

  1. Add CID column (original issue)
    [ ] Add a column for CIDs between the name column and the size column
    [ ] The column should be responsive, truncating as needed by replacing characters from the middle of the CID with ellipses "..."
    [ ] CIDs should be clickable links that open the item as a new "root path" (note this also enables users to copy direct links to images or subdirectories)

  2. Display viewed directory's size (original issue)
    [ ] Add the size of the current directory to the header of the table (mockup)
    [ ] Make sure the display behaves well at all responsive widths

  3. Make path components into links (original issue)
    [ ] In table headers, make any components of the path displayed after "Index of" into individual links (i.e. any segments between directory slashes will go to that level of the directory tree)

Font source target is invalid

The embedded style references a handful of fonts via a relative and nonexistant path ../fonts/
For instance font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);
This specifically causes issues when doing something like wget -r http://gateway/ipfs/Qm... presenting a bunch of 404's up front.

I'm not familiar enough with CSS to know, but is there any analog to the HTML <base> tag?
Specifically, I'm wondering if there's a way to hash these fonts and make the source target relative to the gateway root.
i.e. src:url(${gatewayroot}/ipfs/Qm.../font.eot)

If not, I suppose it would be best to just remove them.

Add CID Column

fiatjaf: why doesn't the gateway http output for unixfs dirs show the hashes of linked files?

Good question!

  • I suspect CIDs could be easily added to listing, next to the Size column
  • CIDs could be clickable links that open item as a new "root path"
    • this also enables users to copy direct link to image or a subdirectory
  • It probably requires changes to https://github.com/ipfs/dir-index-html and then switching go-ipfs to new version

cc @olizilla @fiatjaf

translate="no" for hashes

The translate="no" property should be added to the listed IPFS hashes to prevent browsers trying to translate the index pages to English, despite already being in English.

Broken CID column on DNSLink gateway

There is a problem when directory listing happens on DNSLink gateway (website under own domain name, backed by go-ipfs+DNSLink)

How to reproduce

To illustrate, if I render HTML like this (with go-ipfs 0.7.0):

$ curl -H "Host: dist.ipfs.io" -sD - "http://127.0.0.1:8080/go-ipfs/v0.7.0"

The breadcrumbs are broken:

          Index of
          /ipns/<a href="/ipns/dist.ipfs.io">dist.ipfs.io</a>/<a href="/ipns/dist.ipfs.io/go-ipfs">go-ipfs</a>/<a href="/ipns/dist.ipfs.io/go-ipfs/v0.7.0">v0.7.0</a>

Links under filenames are ok, but direct links to CID under truncated CIDs are broken:

        <td>
          <a href="/go-ipfs/v0.7.0/go-ipfs_v0.7.0_windows-amd64.zip.sha512">go-ipfs_v0.7.0_windows-amd64.zip.sha512</a>
        </td>
        <td class="no-linebreak">
          
          <a class="ipfs-hash" href="/ipfs/QmZwRgWU2St6St7bQi1uAh2j6EQHEJsTxuY7igVDi3dY1h">
            QmZw…dY1h
          </a>

This is because the /ipfs/... gateway is not mounted under DNSLink hostnames.
That is why attempt to load content path will fail:

$ curl -H "Host: dist.ipfs.io" -sD - "http://127.0.0.1:8080/ipfs/QmZwRgWU2St6St7bQi1uAh2j6EQHEJsTxuY7igVDi3dY1h"
HTTP/1.1 404 Not Found

TLDR

Good news is that the main link under filename continue to work, what is broken is this newly added CID column Its broken on DNSLink websites such as https://dist.ipfs.io/go-ipfs/v0.7.0 (when loaded without redirect to local gateway).

How to fix

  • Quick&dirty fix is to hide CID colum and disable links to /ipfs and /ipns when used on DNSLink gateway (path being /ipns/{Host} where Host match value from the header of the same name)
  • A proper fix require additional analysis
    • It should be possible to make breadcrumbs functional
    • ... but I don't think we can fix CID colum in DNSLink mod: we don't have knowledge if there is a public gateway available at all, and probably don't want to hardcode links to ipfs.io.
      • 💔 perhaps it should remain hidden in that mode?
      • 💚 or, to keep UI the same everywhere, when /ipfs/<cid> is not available, link to https://cid.ipfs.io#<cid> instead
  • sidenote: while working on this disable IPFS Companion to ensure you are looking at DNSlink gateway (context of this bug), and not the subdomain gateway at *.ipns.localhost (no bug in subdomain contexts)

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.