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

Add support for config file as an alternative to Environment variables #1117

Closed
Stretch96 opened this issue Nov 15, 2017 · 1 comment
Closed

Comments

@Stretch96
Copy link
Contributor

When running the empire server the configuration is loaded through either flags or environment variables.

The latest codegansta/cli (now urfave/cli) package has added support for TOML/YAML files.

I've created a PR to update the cli package: #1116

Having the ability to load the configuration from a file instead of environment variables would make configuration management a little easier I believe.

@Stretch96
Copy link
Contributor Author

@ejholmes Looks as though it'll need to change again to gopkg.in/urfave/cli.v1 instead of github.com/urfave/cli 🤦‍♂️

Whilst trying to add the wrapper to allow the flags to be defined as an alternative source, the current package throws type errors: urfave/cli#561

I'll have a play around, I may just be doing it wrong. I was trying:

[...]
        altsrc.NewStringFlag(
                cli.StringFlag{
                        Name:   FlagURL,
                        Value:  "",
                        Usage:  "That base URL where this Empire instance runs",
                        EnvVar: "EMPIRE_URL",
                },
        ),
[...]

With github.com/urfave/cli, it throws type errors. With gopkg.in/urfave/cli.v1, the flags don't get initialised 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant