diff --git a/config/config.go b/config/config.go index 8480866..21ea4bb 100644 --- a/config/config.go +++ b/config/config.go @@ -321,6 +321,11 @@ type Configuration struct { // This is required to have the "Server Mounts" feature work properly. AllowedMounts []string `json:"-" yaml:"allowed_mounts"` + // BlockBaseDirMount indicates whether mounting to /home/container is blocked. + // If true, mounting to /home/container is blocked. + // If false, mounting to /home/container is allowed. + BlockBaseDirMount bool `default:"true" json:"-" yaml:"BlockBaseDirMount"` + // AllowedOrigins is a list of allowed request origins. // The Panel URL is automatically allowed, this is only needed for adding // additional origins. diff --git a/server/mounts.go b/server/mounts.go index 2c5caa3..d9f72e2 100644 --- a/server/mounts.go +++ b/server/mounts.go @@ -66,8 +66,8 @@ func (s *Server) customMounts() []environment.Mount { } // Check if the target path includes /home/container - if strings.Contains(target, "/home/container") { - logger.WithField("invalid_target_path", target).Warn("skipping custom server mount, target path includes /home/container") + if strings.HasPrefix(target, "/home/container") && config.Get().BlockBaseDirMount { + logger.WithField("invalid_target_path", target).Warn("Skipping custom server mount; target path includes /home/container") continue }