anselal / antminer-monitor

Cryptocurrency ASIC mining hardware monitor using a simple web interface
GNU General Public License v3.0
227 stars 145 forks source link

Command line arguments support #89

Closed stangri closed 3 years ago

stangri commented 6 years ago

As we've discussed previously, would be great if you could make the antminer-monitor command-line friendly. That would greatly improve the quality of the OpenWrt init script and the integration with the standard OpenWrt settings, might also help create better init scripts for desktop Linuxes.

You can use getopt (or getopts if available for python) to parse the command-line parameters.

As a refresher, here's copy-paste from our e-mail conversation:

  1. Give an option to override settings from the command-line. I could then create an OpenWrt-specific configuration file which my init script would translate into the command line parameters. That’s the way it’s done with most packages, like dnsmasq, etc. That would also enable me to create an OpenWrt Web UI (luci-app) for the package settings at least.
  2. Give an option to disable debugging from command-line. That’s kind of subset of #1.
  3. Give an option to specify the path to the database file from the command-line.
  4. Give an option to specify the path to the log-file from the command-line.
  5. Do not modify at all (or give an option to not modify it) the antminer-monitor directory itself, so I could do clean uninstall on OpenWrt. If you decide to make an easy to install package for any other distribution, that would probably be important too.
  6. And as a subset or #5 — give an option to specify path for settings.py from the command line.
anselal commented 6 years ago

@stangri I will see if I can implement this. By default you can set setting either via environment variables or adding them to the config/settings.py or instance/settings.py file.

I will look if I can somehow override Flask's run command to add command line arguments although I guess this is not something most users will use... maybe I am wrong ;)

stangri commented 6 years ago

@anselal -- I do not suppose it will be user-facing feature, but it would make the init scripts much easier to create, at least for OpenWrt.

anselal commented 6 years ago

I will see what can be done

anselal commented 3 years ago

@stangri hi. do you still use my software on your router ?

stangri commented 3 years ago

No, not anymore.