diff --git a/internal/commands/start.go b/internal/commands/start.go index 10f49dfe1..0206aa2e1 100644 --- a/internal/commands/start.go +++ b/internal/commands/start.go @@ -19,22 +19,22 @@ var StartCommand = cli.Command{ var startFlags = []cli.Flag{ cli.IntFlag{ - Name: "server-port, p", + Name: "http-port, p", Usage: "HTTP server port", Value: 80, - EnvVar: "PHOTOPRISM_SERVER_PORT", + EnvVar: "PHOTOPRISM_HTTP_PORT", }, cli.StringFlag{ - Name: "server-host, i", + Name: "http-host, i", Usage: "HTTP server host", Value: "", - EnvVar: "PHOTOPRISM_SERVER_HOST", + EnvVar: "PHOTOPRISM_HTTP_HOST", }, cli.StringFlag{ - Name: "server-mode, m", + Name: "http-mode, m", Usage: "debug, release or test", Value: "", - EnvVar: "PHOTOPRISM_SERVER_MODE", + EnvVar: "PHOTOPRISM_HTTP_MODE", }, } @@ -51,7 +51,7 @@ func startAction(ctx *cli.Context) error { conf.MigrateDb() - fmt.Printf("Starting web server at %s:%d...\n", ctx.String("server-host"), ctx.Int("server-port")) + fmt.Printf("Starting web server at %s:%d...\n", ctx.String("http-host"), ctx.Int("http-port")) server.Start(conf) diff --git a/internal/context/config.go b/internal/context/config.go index 142afb532..bb00de40f 100644 --- a/internal/context/config.go +++ b/internal/context/config.go @@ -94,15 +94,15 @@ func (c *Config) SetValuesFromFile(fileName string) error { c.dbServerPath = dbServerPath } - if httpServerHost, err := yamlConfig.Get("server-host"); err == nil { + if httpServerHost, err := yamlConfig.Get("http-host"); err == nil { c.httpServerHost = httpServerHost } - if httpServerPort, err := yamlConfig.GetInt("server-port"); err == nil { + if httpServerPort, err := yamlConfig.GetInt("http-port"); err == nil { c.httpServerPort = int(httpServerPort) } - if serverMode, err := yamlConfig.Get("server-mode"); err == nil { + if serverMode, err := yamlConfig.Get("http-mode"); err == nil { c.serverMode = serverMode } @@ -192,16 +192,16 @@ func (c *Config) SetValuesFromCliContext(ctx *cli.Context) error { c.dbServerPath = ctx.String("db-path") } - if ctx.IsSet("server-host") || c.httpServerHost == "" { - c.httpServerHost = ctx.String("server-host") + if ctx.IsSet("http-host") || c.httpServerHost == "" { + c.httpServerHost = ctx.String("http-host") } - if ctx.IsSet("server-port") || c.httpServerPort == 0 { - c.httpServerPort = ctx.Int("server-port") + if ctx.IsSet("http-port") || c.httpServerPort == 0 { + c.httpServerPort = ctx.Int("http-port") } - if ctx.IsSet("server-mode") || c.serverMode == "" { - c.serverMode = ctx.String("server-mode") + if ctx.IsSet("http-mode") || c.serverMode == "" { + c.serverMode = ctx.String("http-mode") } return nil