diff --git a/assets/packages/hareply.conf b/assets/packages/hareply.conf index 38b6fe9..48e0891 100644 --- a/assets/packages/hareply.conf +++ b/assets/packages/hareply.conf @@ -1 +1 @@ -HAREPLY_FILE=/etc/hareply/agentstate +HAREPLY_STATE_FILE=/etc/hareply/agentstate diff --git a/assets/packages/hareply.service b/assets/packages/hareply.service index 7cf0ef1..5e0a85e 100644 --- a/assets/packages/hareply.service +++ b/assets/packages/hareply.service @@ -4,7 +4,7 @@ After=syslog.target network-online.target [Service] EnvironmentFile=/etc/hareply/hareply.conf -ExecStart=/usr/bin/hareply +ExecStart=/usr/bin/hareply serve Restart=always Type=simple diff --git a/cmd/cli.go b/cmd/cli.go index 1028fa6..ba4b7b9 100644 --- a/cmd/cli.go +++ b/cmd/cli.go @@ -18,9 +18,9 @@ type Config struct { Debug bool `help:"Enable debug mode."` Serve struct { - Host string `help:"Host to listen on." default:""` - Port int `help:"Port to reply on." short:"p" default:"8442"` - File string `help:"Path to read response from." short:"f" default:"agentstate"` + Host string `help:"Host to listen on." default:""` + Port int `help:"Port to reply on." short:"p" default:"8442"` + StateFile string `help:"Path to read response from." short:"f" default:"agentstate"` } `cmd:"" help:"Start hareply TCP responder service."` Version kong.VersionFlag @@ -33,7 +33,7 @@ func CLI(ctx context.Context, w io.Writer, args []string, opts ...kong.Option) e opts = append(opts, kong.Name("hareply"), kong.Description("A simple TCP server that replies with a response read from a file."), - kong.DefaultEnvars("HAREPLY_"), + kong.DefaultEnvars("HAREPLY"), kong.Vars{"version": buildinfo.FullVersion()}, ) @@ -51,7 +51,7 @@ func CLI(ctx context.Context, w io.Writer, args []string, opts ...kong.Option) e switch kctx.Command() { case "serve": - app, err := hareply.New(cli.Serve.File, + app, err := hareply.New(cli.Serve.StateFile, hareply.WithPort(cli.Serve.Port), hareply.WithHost(cli.Serve.Host), hareply.WithLogger(logger),