Skip to content

Commit

Permalink
fix ssgen caddy: uniq by app id
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed Jun 11, 2023
1 parent 4769fea commit 7e3bae6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/infrastructure/staticserver/caddy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path/filepath"

"github.com/friendsofgo/errors"
"github.com/samber/lo"

"github.com/traPtitech/neoshowcase/pkg/domain"
"github.com/traPtitech/neoshowcase/pkg/domain/web"
Expand Down Expand Up @@ -46,6 +47,7 @@ file_server @%v {
func (s *server) Reconcile(sites []*domain.StaticSite) error {
var b bytes.Buffer
b.WriteString(":80 {\n")
sites = lo.UniqBy(sites, func(site *domain.StaticSite) string { return site.Application.ID })
for _, site := range sites {
matcherName := fmt.Sprintf("nsapp-%v", site.Application.ID)
b.WriteString(fmt.Sprintf(
Expand Down

0 comments on commit 7e3bae6

Please sign in to comment.