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

'publish' adding a duplicate of itself #22

Closed
hackergrrl opened this issue Jan 7, 2016 · 0 comments · Fixed by #43
Closed

'publish' adding a duplicate of itself #22

hackergrrl opened this issue Jan 7, 2016 · 0 comments · Fixed by #43
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@hackergrrl
Copy link
Contributor

Consider the following bash session, where I create a directory with a single file:

stephen // tmp $ cat > foo/hello
world
stephen // tmp $ ls foo
hello

stephen // tmp $ ipscend init
This utility will walk you through creating a ipscend.json file.
Path of your Web Application (project)? (public) foo

stephen // tmp $ ipscend publish
{ hash: 'QmeXrqL7QXTD8XWR12je7nCjyRaDu7EpkHpgLw5mPJn2Ti',
  timestamp: Thu Jan 07 2016 13:44:52 GMT-0600 (CST) }
published foo QmeXrqL7QXTD8XWR12je7nCjyRaDu7EpkHpgLw5mPJn2Ti

stephen // tmp $ ipfs ls QmeXrqL7QXTD8XWR12je7nCjyRaDu7EpkHpgLw5mPJn2Ti
QmSse56Tcq3y23LjGNfVKyEfPno7w5JdzHBYvUHdyNjAH3 65 foo/
QmaRGe7bVmVaLmxbrMiVNXqW4pRNNp3xq7hFtyRKA3mtJL 14 hello

stephen // tmp $ ipfs ls QmeXrqL7QXTD8XWR12je7nCjyRaDu7EpkHpgLw5mPJn2Ti/foo
QmaRGe7bVmVaLmxbrMiVNXqW4pRNNp3xq7hFtyRKA3mtJL 14 hello

The published site includes foo/ itself, which duplicates the root contents. It looks like ipfs-api is doing this: the daemon returns an ipfs object that has a link to the directory being added, as well as the root's contents.

Not sure if this is intentional, but it's an easy fix if not. (Use the second-last hash in the result array in publish.js.)

@daviddias daviddias added the kind/bug A bug in existing code (including security flaws) label Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants