-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Labels
need/community-inputNeeds input from the wider communityNeeds input from the wider communitytopic/daemon + inittopic/repoTopic repoTopic repo
Milestone
Description
We have three ways to express configuration variables to ipfs:
$IPFS_DIR/configfile- ENV vars
- cli options / args
This is both good and bad. Good because all of these methods have specific use cases that make them much more preferrable to others (e.g. env vars in deployments, cli options are faster to change while experimenting than a config file, etc). Bad because it can create lots of confusion as to where each of these options should be defined in the code, and which methods it should support.
Here are some thoughts. Not sure what the right trajectory is yet.
- Config: below the "ipfs core" barrier (i.e. all code within an ipfs node), we should use the
Configexclusively (we have no access to options, AND should never useos.GetEnv). This means that all config variables the node can choose from have to be set on the config. (i think so far we've adhered to this). - Options: in commands, and commands exclusively, we parse options and call functions as need be. (this is already the case because only commands have access to options).
- ENV vars for normal execution: we define all env vars for normal execution in one place
cmd/env.go, read from the env, and set them on map on thecmdInvocation, or the execution context. Then, we could either force Config overrides to happen (i.e. env vars can only override config values) or Commands may access the env variables from the execution context. BUT, noteos.GetEnvis disallowed (forcing users of env vars to add them to the one place we define them all, so we have them all listed in one file). - ENV vars for tests: for simplicity, one small exception for test case env vars: we are free to use, for example,
os.GetEnv("NO_FUSE")from tests.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
need/community-inputNeeds input from the wider communityNeeds input from the wider communitytopic/daemon + inittopic/repoTopic repoTopic repo