Code Monkey home page Code Monkey logo

Comments (8)

mdlayher avatar mdlayher commented on June 15, 2024

Makes sense to me. I went with flags for ease of use but I can understand your point.

Should be easy enough to add something like -unifi.config.file ~/.config/unifiexporter.yml or something.

Would environment variables also be acceptable?

from unifi_exporter.

jcollie avatar jcollie commented on June 15, 2024

Having the password in an environment variable is a little better, but still problematic is that the environment variable might need to be initialized somewhere (like a systemd unit file) that is world readable. In a config file is the best option, until Ubiquity offers an alternative like OAuth.

from unifi_exporter.

mbrgm avatar mbrgm commented on June 15, 2024

Would you be fine with having an INI file (using https://github.com/go-ini/ini)? If yes, then I would take a shot at creating a PR.

from unifi_exporter.

mttradebyte avatar mttradebyte commented on June 15, 2024

Funny you should post that @mbrgm - I've just finished creating support for a yaml configuration file and am about to submit a PR. I've never worked on Go before but it works and it's relatively tidy, so feel free to critique it.

from unifi_exporter.

mbrgm avatar mbrgm commented on June 15, 2024

@mtanatwine See my comments. I took the 'critique' part seriously, but everything I mentioned is very pedantic. Just thought I'd take the time to go through it thoroughly. Thanks! :)

from unifi_exporter.

dichro avatar dichro commented on June 15, 2024

spf13/viper is a good drop-in option for managing config files with command-line and/or environment overrides (although it's far from drop-in, tbh).

from unifi_exporter.

mbrgm avatar mbrgm commented on June 15, 2024

@dichro That's right, but I think for this project it might be overkill. @mtanatwine 's PR does the job fine imho.

from unifi_exporter.

mbrgm avatar mbrgm commented on June 15, 2024

I think this can be closed, now that #37 has been merged, right?

from unifi_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.