feat: concatenate custom Caddy configs for services into final Caddyfile (no upstream interpolation)

This commit is contained in:
Pasha Sviderski
2025-08-19 22:01:48 +10:00
parent 8bf9fc0c9c
commit 03970862ab
6 changed files with 267 additions and 188 deletions
+8
View File
@@ -62,6 +62,14 @@ type ServiceSpec struct {
Volumes []VolumeSpec
}
// CaddyConfig returns the Caddy reverse proxy configuration for the service or an empty string if it's not defined.
func (s *ServiceSpec) CaddyConfig() string {
if s.Caddy == nil {
return ""
}
return strings.TrimSpace(s.Caddy.Config)
}
func (s *ServiceSpec) Volume(name string) (VolumeSpec, bool) {
for _, v := range s.Volumes {
if v.Name == name {