From 11032bdf9328e5d4b13fa6dc324293dd718d7912 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Thu, 16 Sep 2021 12:26:34 +1000 Subject: [PATCH] fix(server): remove obselete memory check warning (#2380) Given the fact that many Linux OSes are defaulting to CGroups v2 and also Authelia changing the default memory config for argon2id this warning is now obselete. --- internal/server/server.go | 20 -------------------- web/.commitlintrc.js | 1 + 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/internal/server/server.go b/internal/server/server.go index 25f6e8693..75f2043ea 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -3,13 +3,10 @@ package server import ( "embed" "io/fs" - "io/ioutil" "net" "net/http" "os" - "runtime" "strconv" - "strings" duoapi "github.com/duosecurity/duo_api_golang" "github.com/fasthttp/router" @@ -174,23 +171,6 @@ func Start(configuration schema.Configuration, providers middlewares.Providers) logger.Fatalf("Error initializing listener: %s", err) } - // TODO(clems4ever): move that piece to a more related location, probably in the configuration package. - if configuration.AuthenticationBackend.File != nil && configuration.AuthenticationBackend.File.Password.Algorithm == "argon2id" && runtime.GOOS == "linux" { - f, err := ioutil.ReadFile("/sys/fs/cgroup/memory/memory.limit_in_bytes") - if err != nil { - logger.Warnf("Error reading hosts memory limit: %s", err) - } else { - m, _ := strconv.Atoi(strings.TrimSuffix(string(f), "\n")) - hostMem := float64(m) / 1024 / 1024 / 1024 - argonMem := float64(configuration.AuthenticationBackend.File.Password.Memory) / 1024 - - if hostMem/argonMem <= 2 { - logger.Warnf("Authelia's password hashing memory parameter is set to: %gGB this is %g%% of the available memory: %gGB", argonMem, argonMem/hostMem*100, hostMem) - logger.Warn("Please read https://www.authelia.com/docs/configuration/authentication/file.html#memory and tune your deployment") - } - } - } - if configuration.Server.TLS.Certificate != "" && configuration.Server.TLS.Key != "" { if err = writeHealthCheckEnv(configuration.Server.DisableHealthcheck, "https", configuration.Server.Host, configuration.Server.Path, configuration.Server.Port); err != nil { logger.Fatalf("Could not configure healthcheck: %v", err) diff --git a/web/.commitlintrc.js b/web/.commitlintrc.js index 47f149291..a2897b486 100644 --- a/web/.commitlintrc.js +++ b/web/.commitlintrc.js @@ -1,6 +1,7 @@ module.exports = { extends: ["@commitlint/config-conventional"], rules: { + "body-max-line-length": [2, "always", "Infinity"], "body-min-length": [2, "always", 20], "header-case": [2, "always", "lower-case"], "header-max-length": [2, "always", 72],