Support env vars

This commit is contained in:
Milan Nikolic
2019-10-06 05:14:06 +02:00
parent 9e6d20863a
commit 1c342a67df
5 changed files with 49 additions and 11 deletions

View File

@@ -7,6 +7,8 @@ import (
"fmt"
"os"
"github.com/jamiealquiza/envy"
"github.com/gen2brain/cam2ip/camera"
"github.com/gen2brain/cam2ip/server"
)
@@ -27,6 +29,8 @@ func main() {
flag.BoolVar(&srv.NoWebGL, "nowebgl", false, "Disable WebGL drawing of images (html handler)")
flag.StringVar(&srv.Bind, "bind-addr", ":56000", "Bind address")
flag.StringVar(&srv.Htpasswd, "htpasswd-file", "", "Path to htpasswd file, if empty auth is disabled")
envy.Parse("CAM2IP")
flag.Parse()
srv.Name = name

View File

@@ -7,6 +7,8 @@ import (
"fmt"
"os"
"github.com/jamiealquiza/envy"
"github.com/gen2brain/cam2ip/camera"
"github.com/gen2brain/cam2ip/server"
"github.com/gen2brain/cam2ip/video"
@@ -29,6 +31,8 @@ func main() {
flag.StringVar(&srv.Bind, "bind-addr", ":56000", "Bind address")
flag.StringVar(&srv.Htpasswd, "htpasswd-file", "", "Path to htpasswd file, if empty auth is disabled")
flag.StringVar(&srv.FileName, "video-file", "", "Use video file instead of camera")
envy.Parse("CAM2IP")
flag.Parse()
srv.Name = name