9 "git.curoverse.com/arvados.git/sdk/go/config"
10 "git.curoverse.com/arvados.git/sdk/go/ctxlog"
11 "github.com/coreos/go-systemd/daemon"
14 var logger = ctxlog.FromContext
19 configPath := flag.String("config", "/etc/arvados/ws/ws.yml", "`path` to config file")
20 dumpConfig := flag.Bool("dump-config", false, "show current configuration and exit")
21 cfg := defaultConfig()
24 err := config.LoadFile(&cfg, *configPath)
29 ctxlog.SetLevel(cfg.LogLevel)
30 ctxlog.SetFormat(cfg.LogFormat)
33 txt, err := config.Dump(&cfg)
37 fmt.Print(string(txt))
42 eventSource := &pgEventSource{
43 DataSource: cfg.Postgres.ConnectionString(),
44 QueueSize: cfg.ServerEventQueue,
48 ReadTimeout: time.Minute,
49 WriteTimeout: time.Minute,
50 MaxHeaderBytes: 1 << 20,
53 eventSource: eventSource,
54 newPermChecker: func() permChecker { return newPermChecker(cfg.Client) },
60 log.Fatal("event source stopped")
63 if _, err := daemon.SdNotify(false, "READY=1"); err != nil {
64 log.WithError(err).Warn("error notifying init daemon")
67 log.WithField("Listen", srv.Addr).Info("listening")
68 log.Fatal(srv.ListenAndServe())