-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Fix #2335 - If IPFS_HOST is ipfs pass localhost to IPFSJS #2336
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2336 +/- ##
==========================================
+ Coverage 27.75% 27.75% +<.01%
==========================================
Files 145 145
Lines 11642 11643 +1
Branches 1568 1568
==========================================
+ Hits 3231 3232 +1
Misses 8299 8299
Partials 112 112
Continue to review full report at Codecov.
|
Also we need to provide a ipfs config file to handle the CORS issues. What I did in my branch is this:
The |
@jasonrhaas I think manually defining the config would cause some problems, honestly. We want the local instance to provision itself and assign newly initialized |
@mbeacom I'm with you, I did not want to have to pass a config file for IPFS. I would prefer to be able to pass some ENV vars, or command line options. I looked into this, and I don't see any way of doing it, outside of defining our own https://github.com/INFURA/tutorials/wiki/IPFS-and-CORS#configuration-of-cors Changing the ALLOW HOSTS to the docker host if you can find it, or What I did was run those commands, which altered the config file inside of the container. Then I took that and saved the output to ipfsconfig.json. If you can figure out a better way to set up IPFS with those settings I'm definitely open to it. |
@jasonrhaas I came to the same conclusion. It's fairly frustrating there's no entry options to pass custom config properties to the CLI or the docker entry script 🤔 - Maybe they'll be open to an upstream change to allow the |
Yes I'm surprised no one has raised an issue about this in the repo! The closest one I could find is this one, from 2014. The way they have their configuration set up, its just a giant JSON file with a lot of ugly field names. I guess that's why they don't have ENV var support. However, it would be fairly easy to add support for some ENV vars, by just taking them in through docker, and executing some commands here: https://github.com/ipfs/go-ipfs/blob/master/bin/container_daemon#L21 The commands would only run on the first run though, and then it would pull the file from the data volume, which is probably not what we want. Going full circle, is there some version of saving a config file that would not be prone to breaking? Referencing your comment above about |
The main reason I referenced those keys above is because during Ideal, but probably slow: PR changes to Fast: Extend (or recreate) |
Lets go with the "Fast" approach, using the 2nd method (env vars). After that we can submit an issue or PR to the main repo and try to get them to merge it in if it makes sense for the broader community. So then we should:
|
@mbeacom Want me to try to take care of this one? I need it for testing on the other project anyway. |
I temporarily got around this in my test script by running this as part of my
Above that I also blow away the IPFS volumes, so that it starts from scratch. Otherwise it will just read in the existing settings. |
Description
The goal of this PR is to resolve a bug encountered while attempting to communicate with the local IPFS docker instance from IPFS JS by defaulting to
localhost
for IPFS JS ifIPFS_HOST == 'ipfs'
.Checklist
Affected core subsystem(s)
ipfs, context, settings
Testing
Locally
Refers/Fixes
Fix #2335