PACTCare / Dweb.page

Your Gateway to the Distributed Web
https://dweb.page/
MIT License
247 stars 25 forks source link

Search doesn’t work in Firefox #5

Open da2x opened 5 years ago

da2x commented 5 years ago

Console error:

OpenFailedError: UnknownError The operation failed for reasons unrelated to the database itself and not covered by any other error code.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://[::1]/ipfs/na. (Reason: CORS request did not succeed).

UI error:

You have entered an invalid filename!

Version: /ipfs/QmafJoUPkhmKJSKJHFvpkZ5Hb5eUbQN8UBhuwrLVsH6W2K

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

IPFS: ipfs-go 0.4.18, ipfs-companion 2.6.3

Noc2 commented 5 years ago

Thanks for reporting and testing! Since you are using Dweb.page on your own ipfs gateway, the reason is probably that the files need a long time to load/propagate. I integrated a system to create so-called availability metadata and additional distribution of the files, but both needs a lot of improvement/refinement. It also has issues on the participating ipfs nodes at the moment. I will release an improved version as soon as possible.

Noc2 commented 5 years ago

The latest version now has a new availability system which mixes location- and name-based addressing for faster content loading. I hope this solves your issue. See https://noreallyitis.me/ipfs/QmVpg1PnMyDPLspthDwN4rWZXw8AGRBvfe7e6Y82ZYHNHe/ If it doesn’t work feel free to reopen this issue.

da2x commented 5 years ago

I can’t reopen the issue, but I can still comment.

I tried the new version and the error message is gone.

However, as soon as I press Open I get this in the console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://[::1]/ipfs/QmQrXZ4iXdEKQMiQT6GRg2Wy3vxb9exR25sYdaqoHwWWuR. (Reason: CORS request did not succeed)

The problem here is that my local gateway’s port number is lost. The page is loaded from a local IPFS gateway at:

http://[::1]:4737/ipfs/QmVpg1PnMyDPLspthDwN4rWZXw8AGRBvfe7e6Y82ZYHNHe/

Noc2 commented 5 years ago

Got it. Sorry, I only tested it on the cloudflare-ipfs.com address. The previous system didn’t work with different local ports. I fixed it with the latest version: https://ipfs.sopinka.com/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/. Just let me know if it still doesn't work.

da2x commented 5 years ago

Seems to be working now!

My console is full of errors still, though. I’m asked to Agree to terms every time I open the page (even from the same address), and the Files tab gives me a new public key and says I’m in a private window in Firefox although I’m using a regular window.

Console errors:

Object { _e: Error, name: "OpenFailedError", message: "UnknownError The operation failed for reasons unrelated to the database itself and not covered by any other error code.", inner: {…}, stack: "" } Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7:38:204236
Object { _e: Error, name: "OpenFailedError", message: "UnknownError The operation failed for reasons unrelated to the database itself and not covered by any other error code.", inner: {…}, stack: "" } Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7:38:182532
Unhandled promise rejection TypeError: "a is undefined"
    t http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:38:181378
    A http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:348144
    _invoke http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:347934
    e http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:348320
    E http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:38:177921
    a http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:38:178123
    a http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:175439
    P http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:175584
    c http://[::1]:4737/ipfs/Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7/:21:333958
 Qmcai4xdhGeYnsLjFJu71vdXLouMzaTDjHtS2NndW9qvp7:21:175819

I can’t upload anything either. I get an “The current IPFS gateway you are using isn't writable!” error message but I’m never prompted to give it write permissions. I’ve confirmed that I have the IPFS Companion extension available and that the window.ipfs interface is exposed, and that it prompts for permissions just fine for other IPFS upload web interfaces.

Lastly, can I search-for/upload/add-to-index an existing hash that I’ve got on a local node? Reuploading the same file won’t create the same hash as I’m using the Rabin fingerprint chunker instead of the less efficient fixed-size 256 kiB chunker.

Noc2 commented 5 years ago

Thanks for all the feedback and testing. I will reopen the issue since your describing multiple problems here, which aren’t fixed/integrated yet:

I will see what I can do.

Noc2 commented 5 years ago

Here is the first version with basic support for the ipfs companion/window.ipfs: https://pactcare.online/ipfs/QmeHJR27YxNp7VdwwH91fv1qgHHtL77dJuRV4Li1ZfN5k4

da2x commented 5 years ago
pezinek commented 5 years ago

Actually the new version is broken in a different way, If I try to enter something to the search box, doesn't show any results but downloads file called "undefined.undefined" with content "invalid ipfs path: selected encoding not supported" (browser chrome, using private ipfs gateway running go-ipfs v0.4.18, ipfs companion v 2.6.3)

Noc2 commented 5 years ago

@pezinek I just opened a new issue for this problem: https://github.com/PACTCare/Dweb.page/issues/6