Skip to content

Commit 67a83e7

Browse files
committed
set user/pass via env
1 parent 52dbbeb commit 67a83e7

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

agent/agent.go

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ func Run(c Config) error {
7272
//custom middleware stack
7373
//3. basic-auth middleware
7474
if c.User != "" || c.Pass != "" {
75-
log.Printf("cookieauth")
7675
h = cookieauth.Wrap(h, c.User, c.Pass)
7776
}
7877
//2. ipfilter middlware

agent/config.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ const (
2727

2828
type Config struct {
2929
Host string `help:"listening interface"`
30-
Port int `help:"listening port"`
31-
User string `help:"basic auth username"`
32-
Pass string `help:"basic auth password"`
30+
Port int `help:"listening port" env:"PORT"`
31+
User string `help:"basic auth username" env:"USER"`
32+
Pass string `help:"basic auth password" env:"PASS"`
3333
AllowedIPs []string `opts:"-"`
3434
ProgramArgs []string `type:"arglist" min:"1" name:"args" help:"args can be either a command with arguments or a webproc file"`
3535
Log Log `opts:"-"`
3636
OnExit OnExit `help:"process exit action" default:"proxy"`
3737
ConfigurationFiles []string `name:"config" type:"commalist" help:"comma-separated list of configuration files"`
38-
VerifyProgramArgs []string `name:"verify" type:"spacelist" help:"command used to verify configuration"`
39-
RestartTimeout Duration `opts:"-"`
38+
// VerifyProgramArgs []string `name:"verify" type:"spacelist" help:"command used to verify configuration"`
39+
RestartTimeout Duration `opts:"-"`
4040
}
4141

4242
func LoadConfig(path string, c *Config) error {

default.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ OnExit = "proxy"
3333
# For example, dnsmasq would include "/etc/dnsmasq.conf"
3434
ConfigurationFiles = []
3535

36-
# When provided, this command will be used verify all configuration changes
36+
# TODO When provided, this command will be used verify all configuration changes
3737
# before restarting the process. An exit code 0 means valid, otherwise it's assumed invalid.
38-
VerifyProgramArgs = []
38+
# VerifyProgramArgs = []
3939

4040
# After the restart signal (SIGINT) has been sent, webproc will wait for RestartTimeout before
4141
# forcibly restarting the process (SIGKILL).

0 commit comments

Comments
 (0)