-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
daemon: add options to set the API and GW addresses #845
Conversation
The ipfs daemon command lets you initialize the configuration with default parameters, but in certain situations (like starting ipfs daemon in a docker container), it would be convenient to be able to set the API and gateway addresses to something more meaningful. This patch introduces two new options for the ipfs daemon command: -address-api and -address-gateway. When used together with -init, they set the respective addresses in the generated configuration file: $ ipfs daemon -init -address-api=/ip4/0.0.0.0/tcp/5001 \ -address-gateway=/ip4/0.0.0.0/tcp/8080 When used without -init, they simply override value for that run of the daemon, without overwriting it in the configuration file: $ ipfs daemon -address-api=/ip4/0.0.0.0/tcp/5001 \ -address-gateway=/ip4/0.0.0.0/tcp/8080
Intention ❤️ |
Would be neat to generalize this into something like:
Although that might be difficult/confusing |
Commit 8bdf7f6 introduced and extra argument to config.Init, but failed to add it to all calls of config.Init. This should take care of all of them.
Sorry about the breakage, it should work now. @whyrusleeping I agree it would be nice to have something more generic, but as you say, it would be more complicated to implement. |
Yeah, this LGTM. It solves the problem at hand. |
I'd prefer if we generalized sooner than later. when we change, it will break people's scripts.
see also: #387 #251 http://github.com/spf13/viper |
@jbenet Okay, but then it should also be unified between If anyone has suggestions, or wants to help me on this, don't hesitate. |
git has a '-c' option that can be used to change some config parameters when launching a command. No config file is changed. Config options passed like this only have effects on the current command. This option can be used with any command but must me put between 'git' and the command name on the command line. For example |
thanks @chriscool -- i like it. agreed that it should only be for that run-- no change to the config on disk. Perhaps we should repurpose our own |
@BenoitKnecht thoughts on this? |
closing due to inactivity, please reopen as necessary note: all pull requests older than three weeks may be closed in an effort to keep our open pull requests more focused. |
I would like to see this feature added. I'm building dotnet tooling to bootstrap and start the Kubo process, and would like to provide the option to change this before first startup. This would greatly simplify the setup. |
The ipfs daemon command lets you initialize the configuration with
default parameters, but in certain situations (like starting ipfs daemon
in a docker container), it would be convenient to be able to set the
API and gateway addresses to something more meaningful.
This patch introduces two new options for the ipfs daemon command:
-address-api and -address-gateway. When used together with -init, they
set the respective addresses in the generated configuration file:
$ ipfs daemon -init -address-api=/ip4/0.0.0.0/tcp/5001
-address-gateway=/ip4/0.0.0.0/tcp/8080
When used without -init, they simply override value for that run of the
daemon, without overwriting it in the configuration file:
$ ipfs daemon -address-api=/ip4/0.0.0.0/tcp/5001
-address-gateway=/ip4/0.0.0.0/tcp/8080