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

gateway overrides /version with information about IPFS #5422

Closed
swedneck opened this issue Sep 3, 2018 · 5 comments
Closed

gateway overrides /version with information about IPFS #5422

swedneck opened this issue Sep 3, 2018 · 5 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@swedneck
Copy link
Contributor

swedneck commented Sep 3, 2018

Version information:

0.4.17

Type:

Bug (probably)

Description:

When using a domain with a dnslink, any request to example.com/version will return information about the IPFS node running on the gateway, instead of potential information about the webapp's version.
Examples: https://riot.swedneck.xyz/version, https://https://docs.ipfs.io/version, http://explore.ipld.io/version

This breaks the version checking function of the Riot matrix client, which otherwise works perfectly via IPFS.

@lidel
Copy link
Member

lidel commented Sep 3, 2018

Thank you for reporting this @swedneck!

It sure looks like a bug: makes it impossible to expose asset named /version when dnslink is used.
I suspect it is a legacy thing: these days version can be read via /api/v0/version call.

Anyone familiar whats the story behind /version?
Would it be ok to PR a fix removing it (at least when dnslink is in use)?

@Stebalien Stebalien added the kind/bug A bug in existing code (including security flaws) label Sep 3, 2018
@Stebalien
Copy link
Member

Yes, this does look like a bug. Having the version endpoint on the gateway isn't but it shouldn't be available when we pivot to a dnslink-based website.

@ghost
Copy link

ghost commented Sep 3, 2018

but it shouldn't be available when we pivot to a dnslink-based website.

👍

It's probably easy to fix by simply reordering the http handlers in https://github.com/ipfs/go-ipfs/blob/78a32f2e48db69a1d517da29121ef5a51b2a8015/cmd/ipfs/daemon.go#L543-L549 by moving VersionOption after GatewayOption.

@swedneck
Copy link
Contributor Author

swedneck commented Sep 4, 2018

@lgierth I just tried compiling it with that change and it works!

@lidel
Copy link
Member

lidel commented Sep 4, 2018

@swedneck great! mind creating a PR with the fix?


Update: PR is at: #5424 👍

swedneck pushed a commit to swedneck/go-ipfs that referenced this issue Sep 4, 2018
Stebalien added a commit that referenced this issue Sep 6, 2018
move VersionOption after GatewayOption to fix #5422
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

No branches or pull requests

3 participants