2020-06-02 05:47:39 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-06-16 04:10:58 -04:00
|
|
|
"flag"
|
2021-09-17 13:58:35 -04:00
|
|
|
_ "time/tzdata"
|
2020-08-19 22:32:50 -04:00
|
|
|
|
2020-06-02 05:47:39 -04:00
|
|
|
"github.com/librespeed/speedtest/config"
|
|
|
|
"github.com/librespeed/speedtest/database"
|
2020-06-16 03:34:29 -04:00
|
|
|
"github.com/librespeed/speedtest/results"
|
2020-06-02 05:47:39 -04:00
|
|
|
"github.com/librespeed/speedtest/web"
|
2021-09-17 13:58:35 -04:00
|
|
|
|
|
|
|
_ "github.com/breml/rootcerts"
|
|
|
|
log "github.com/sirupsen/logrus"
|
2020-06-02 05:47:39 -04:00
|
|
|
)
|
|
|
|
|
2020-06-16 04:10:58 -04:00
|
|
|
var (
|
|
|
|
optConfig = flag.String("c", "", "config file to be used, defaults to settings.toml in the same directory")
|
|
|
|
)
|
|
|
|
|
2020-06-02 05:47:39 -04:00
|
|
|
func main() {
|
2020-06-16 04:10:58 -04:00
|
|
|
flag.Parse()
|
2020-11-10 03:33:19 -05:00
|
|
|
conf := config.Load(*optConfig)
|
2020-06-16 04:10:58 -04:00
|
|
|
web.SetServerLocation(&conf)
|
2020-06-16 03:34:29 -04:00
|
|
|
results.Initialize(&conf)
|
2020-06-02 05:47:39 -04:00
|
|
|
database.SetDBInfo(&conf)
|
|
|
|
log.Fatal(web.ListenAndServe(&conf))
|
|
|
|
}
|