go version and deps update, fixed middlewares and metrics

- fixed "API JWT secret empty" warning output format
- fixed metrics initialized when it should not
- fixed middlewares.modifyRequest Host header not working properly
This commit is contained in:
yusing
2024-11-08 06:14:08 +08:00
parent 5214ae1760
commit f97e3f65fe
13 changed files with 101 additions and 78 deletions

View File

@@ -48,12 +48,6 @@ var (
APIPasswordHash = HashPassword(GetEnvString("API_PASSWORD", "password"))
)
func init() {
if APIJWTSecret == nil && GetArgs().Command == CommandStart {
log.Warn().Msg("API JWT secret is empty, authentication is disabled")
}
}
func GetEnv[T any](key string, defaultValue T, parser func(string) (T, error)) T {
var value string
var ok bool