Every setting of rproxy and servewaf is now read through viper (github.com/spf13/viper), bound to the same environment variable names as before, in place of the os.LookupEnv function Main passed down.
config.NewViper turns AutomaticEnv and AllowEmptyEnv on; the latter keeps a setting that is set but empty reading as set, which viper does not do by default. FromEnvironment, RProxyFromEnvironment, Command, ServeWAFListenAddr, InstanceName and RProxyListenAddrAndUpstreamURL take the viper, and Params carries it instead of LookupEnv. No setting is read with os.Getenv or os.LookupEnv outside that viper.
The _FILE forms, their validation and errors, and rproxy reading no file form are unchanged. make check passes; the settings tests pass with the same names, defaults and errors, set into a viper instead of a lookup function.
Model: deepseek-v4-pro
Run usage: DeepSeek V4 Pro through OpenRouter, 794,970 input, 77,256 output, 107,400 reasoning and 74,666,496 cache-read tokens; cost $9.24.
Every setting of `rproxy` and `servewaf` is now read through viper (`github.com/spf13/viper`), bound to the same environment variable names as before, in place of the `os.LookupEnv` function `Main` passed down.
`config.NewViper` turns `AutomaticEnv` and `AllowEmptyEnv` on; the latter keeps a setting that is set but empty reading as set, which viper does not do by default. `FromEnvironment`, `RProxyFromEnvironment`, `Command`, `ServeWAFListenAddr`, `InstanceName` and `RProxyListenAddrAndUpstreamURL` take the viper, and `Params` carries it instead of `LookupEnv`. No setting is read with `os.Getenv` or `os.LookupEnv` outside that viper.
The `_FILE` forms, their validation and errors, and rproxy reading no file form are unchanged. `make check` passes; the settings tests pass with the same names, defaults and errors, set into a viper instead of a lookup function.
Model: deepseek-v4-pro
Run usage: DeepSeek V4 Pro through OpenRouter, 794,970 input, 77,256 output, 107,400 reasoning and 74,666,496 cache-read tokens; cost $9.24.
servewaf's and rproxy's settings are read through viper, bound to the same environment variable names as before, in place of the os.LookupEnv function Main passed down. NewViper turns AutomaticEnv and AllowEmptyEnv on, so a setting that is set but empty reads as set, as it did. The _FILE forms, their errors, and rproxy reading no file form are unchanged, and the settings tests pass set into a viper instead of a lookup function.
Model: deepseek-v4-pro
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Every setting of
rproxyandservewafis now read through viper (github.com/spf13/viper), bound to the same environment variable names as before, in place of theos.LookupEnvfunctionMainpassed down.config.NewViperturnsAutomaticEnvandAllowEmptyEnvon; the latter keeps a setting that is set but empty reading as set, which viper does not do by default.FromEnvironment,RProxyFromEnvironment,Command,ServeWAFListenAddr,InstanceNameandRProxyListenAddrAndUpstreamURLtake the viper, andParamscarries it instead ofLookupEnv. No setting is read withos.Getenvoros.LookupEnvoutside that viper.The
_FILEforms, their validation and errors, and rproxy reading no file form are unchanged.make checkpasses; the settings tests pass with the same names, defaults and errors, set into a viper instead of a lookup function.Model: deepseek-v4-pro
Run usage: DeepSeek V4 Pro through OpenRouter, 794,970 input, 77,256 output, 107,400 reasoning and 74,666,496 cache-read tokens; cost $9.24.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.