openpdu/src/main.go

54 lines
1.1 KiB
Go
Raw Normal View History

2020-12-23 09:11:11 +00:00
package main
import (
2021-01-09 18:38:57 +00:00
"git.openpdu.org/OpenPDU/openpdu/syslog"
"git.openpdu.org/OpenPDU/openpdu/ups"
"git.openpdu.org/OpenPDU/openpdu/webui"
2020-12-23 09:11:11 +00:00
"github.com/spf13/viper"
)
2021-01-19 13:27:24 +00:00
const version = "0.1"
func init() {
viper.SetDefault("system.hostname", "openpdu")
}
2020-12-23 09:11:11 +00:00
func main() {
CreateBoards()
CreateOutlets()
2021-01-09 18:38:57 +00:00
InitBoards()
MQTTSetup()
go MQTTRefreshLoop()
go ups.UpsConnect()
2021-01-19 09:39:35 +00:00
go displayLoop()
2021-01-09 18:38:57 +00:00
syslog.Info("hostname: " + viper.GetString("system.hostname"))
webui.StartServer()
2020-12-23 09:11:11 +00:00
}
// 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
2021-09-28 16:59:46 +00:00
- 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
2020-12-23 09:11:11 +00:00
*/