diff --git a/docs/helpers/configenvextractor.go b/docs/helpers/configenvextractor.go index b680186df34..146b35bdaa7 100644 --- a/docs/helpers/configenvextractor.go +++ b/docs/helpers/configenvextractor.go @@ -7,6 +7,7 @@ import ( "os/exec" "path" "path/filepath" + "runtime" "strings" "text/template" ) @@ -71,6 +72,12 @@ func runIntermediateCode(intermediateCodePath string) { defaultDataPath := "/var/lib/ocis" os.Setenv("OCIS_BASE_DATA_PATH", defaultDataPath) os.Setenv("OCIS_CONFIG_DIR", defaultConfigPath) + + // Set AUTOMEMLIMIT_EXPERIMENT=system on non-Linux systems to avoid cgroups errors + if runtime.GOOS != "linux" { + os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system") + } + out, err := exec.Command("go", "run", intermediateCodePath).CombinedOutput() if err != nil { log.Fatal(string(out), err) diff --git a/docs/helpers/extended_vars.yaml b/docs/helpers/extended_vars.yaml index 14ecb19cfb1..ac8c3598753 100644 --- a/docs/helpers/extended_vars.yaml +++ b/docs/helpers/extended_vars.yaml @@ -144,6 +144,14 @@ variables: description: The default directory location for config files. See the General Info section in the documentation for more details on defaults. do_ignore: false +- rawname: OCIS_INSECURE + path: ocis-pkg/service/grpc/client.go:77 + foundincode: true + name: OCIS_INSECURE + type: "" + default_value: "false" + description: "Insecure TLS mode is only allowed in development environments with OCIS_INSECURE=true" + do_ignore: false - rawname: RUN_CMD_TEST path: internal/testenv/test.go:32 foundincode: true diff --git a/ocis-pkg/shared/memlimit.go b/ocis-pkg/shared/memlimit.go index 146838d68e1..295367dbdfd 100644 --- a/ocis-pkg/shared/memlimit.go +++ b/ocis-pkg/shared/memlimit.go @@ -2,6 +2,8 @@ package shared import ( "log/slog" + "os" + "runtime" "github.com/KimMachineGun/automemlimit/memlimit" ) @@ -9,6 +11,12 @@ import ( // we init the memlimit here to include it for ocis als well as individual service binaries func init() { slog.SetLogLoggerLevel(slog.LevelError) + + // Enable system memory provider on non-Linux systems to avoid cgroups errors + if runtime.GOOS != "linux" { + os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system") + } + _, _ = memlimit.SetGoMemLimitWithOpts( memlimit.WithLogger(slog.Default()), )