Skip to content

Commit 5614497

Browse files
committed
fix: remove dots from allowed project_id characters to prevent Vector container crashes
1 parent 3fe548f commit 5614497

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ var (
435435
initConfigEmbed string
436436
initConfigTemplate = template.Must(template.New("initConfig").Parse(initConfigEmbed))
437437

438-
invalidProjectId = regexp.MustCompile("[^a-zA-Z0-9_.-]+")
438+
invalidProjectId = regexp.MustCompile("[^a-zA-Z0-9_-]+")
439439
refPattern = regexp.MustCompile(`^[a-z]{20}$`)
440440
)
441441

@@ -975,10 +975,10 @@ func truncateText(text string, maxLen int) string {
975975
const maxProjectIdLength = 40
976976

977977
func sanitizeProjectId(src string) string {
978-
// A valid project ID must only contain alphanumeric and special characters _.-
978+
// A valid project ID must only contain alphanumeric and special characters _-
979979
sanitized := invalidProjectId.ReplaceAllString(src, "_")
980980
// It must also start with an alphanumeric character
981-
sanitized = strings.TrimLeft(sanitized, "_.-")
981+
sanitized = strings.TrimLeft(sanitized, "_-")
982982
// Truncate sanitized ID to 40 characters since docker hostnames cannot exceed
983983
// 63 characters, and we need to save space for padding supabase_*_edge_runtime.
984984
return truncateText(sanitized, maxProjectIdLength)

0 commit comments

Comments
 (0)