openpdu/src/main.go

54 lines
1.2 KiB
Go

package main
import (
"git.openpdu.org/OpenPDU/openpdu/syslog"
"git.openpdu.org/OpenPDU/openpdu/ups"
"git.openpdu.org/OpenPDU/openpdu/webui"
"github.com/spf13/viper"
)
const version = "0.1"
func init() {
viper.SetDefault("system.hostname", "openpdu")
}
func main() {
CreateBoards()
CreateOutlets()
InitBoards()
go MQTTSetup()
go MQTTRefreshLoop()
go ups.UpsConnect()
go displayLoop()
syslog.Info("hostname: " + viper.GetString("system.hostname"))
webui.StartServer()
}
// https://github.com/ColorlibHQ/AdminLTE/archive/v2.4.17.tar.gz
/* TODO
- config reset gpio
- classi per board
- classi per outlet
- fai funzionare toggle
- scan i2c
- impostazioni log
- sensori temperatura e umidità
- master/slave
- dispositivi collegati, ping, alimentazioni separate, linee separate
- misuratori carico per linee e per utenze
- limiti carico per linee e utenze
- alert? email?
- auto upgrade: openpdu / entireOS
- ssh enable/disable
- wlan config
- serial port console
- cli commands?
- reboot/shutdown from web
- shutdown behavior
- user management + roles (admin, port-reboot, port-on, port-off, readonly, ..) + api key
- ups: username and password are required in webui
*/