From da83c6a1603d106a092f5500a100e39ebed0ff36 Mon Sep 17 00:00:00 2001 From: Markus Kohn Date: Tue, 21 Oct 2025 10:51:33 +0200 Subject: [PATCH 1/2] feat: Introduceenv var to stop wings from writing to its own config file --- config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/config.go b/config/config.go index cfc22b2e..6ed8a7a2 100644 --- a/config/config.go +++ b/config/config.go @@ -442,6 +442,15 @@ func GetJwtAlgorithm() *jwt.HMACSHA { // and will only allow one write at a time. Additional calls while writing are // queued up. func WriteToDisk(c *Configuration) error { + + // If the environment variable is set, skip actual writes. Useful for containers + // or managed environments where you want Wings to never modify files. + if os.Getenv("WINGS_NO_CONFIG_WRITE") == "1" { + // Note: use your logger package as appropriate; using apex/log.Logger in this file + // may require importing it. For clarity we keep this a simple no-op. + return nil + } + _writeLock.Lock() defer _writeLock.Unlock() From ec557ad57c286a64b13754e28bbbb92039114289 Mon Sep 17 00:00:00 2001 From: Markus Kohn Date: Tue, 9 Dec 2025 19:08:54 +0100 Subject: [PATCH 2/2] Fix: filter log config options for non-local logging drivers --- config/config_docker.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/config_docker.go b/config/config_docker.go index f3e846b0..df90e77b 100644 --- a/config/config_docker.go +++ b/config/config_docker.go @@ -103,9 +103,23 @@ func (c DockerConfiguration) ContainerLogConfig() container.LogConfig { return container.LogConfig{} } + // Filter config options based on the logging driver type + // The "local" driver has specific options that aren't compatible with other drivers + config := make(map[string]string) + for k, v := range c.LogConfig.Config { + // Only include these options if using the "local" driver + if c.LogConfig.Type != "local" { + // Exclude local-specific options for non-local drivers like fluentd, json-file, etc. + if k == "max-size" || k == "max-file" || k == "compress" || k == "mode" { + continue + } + } + config[k] = v + } + return container.LogConfig{ Type: c.LogConfig.Type, - Config: c.LogConfig.Config, + Config: config, } }