diff --git a/cmd/geoloc-import/main.go b/cmd/geoloc-import/main.go index 3987b3e86..a8e1bf452 100644 --- a/cmd/geoloc-import/main.go +++ b/cmd/geoloc-import/main.go @@ -20,6 +20,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" @@ -79,7 +80,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-asset-snapshots-to-documents/main.go b/cmd/migrate-asset-snapshots-to-documents/main.go index 5dce58fec..1c0342c22 100644 --- a/cmd/migrate-asset-snapshots-to-documents/main.go +++ b/cmd/migrate-asset-snapshots-to-documents/main.go @@ -22,6 +22,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" "strings" @@ -416,7 +417,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-data-snapshots-to-documents/main.go b/cmd/migrate-data-snapshots-to-documents/main.go index 51b8c0b03..f009ca0e9 100644 --- a/cmd/migrate-data-snapshots-to-documents/main.go +++ b/cmd/migrate-data-snapshots-to-documents/main.go @@ -22,6 +22,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" "strings" @@ -415,7 +416,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-document-versions-markdown/main.go b/cmd/migrate-document-versions-markdown/main.go index a41d5096a..3e07d594a 100644 --- a/cmd/migrate-document-versions-markdown/main.go +++ b/cmd/migrate-document-versions-markdown/main.go @@ -21,6 +21,7 @@ import ( "encoding/json" "flag" "fmt" + "net" "net/url" "os" "time" @@ -130,7 +131,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-finding-snapshots-to-documents/main.go b/cmd/migrate-finding-snapshots-to-documents/main.go index 3e0c1a030..2dcc75430 100644 --- a/cmd/migrate-finding-snapshots-to-documents/main.go +++ b/cmd/migrate-finding-snapshots-to-documents/main.go @@ -22,6 +22,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" "time" @@ -469,7 +470,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-obligation-snapshots-to-documents/main.go b/cmd/migrate-obligation-snapshots-to-documents/main.go index 6951c7202..b2fae5e2a 100644 --- a/cmd/migrate-obligation-snapshots-to-documents/main.go +++ b/cmd/migrate-obligation-snapshots-to-documents/main.go @@ -22,6 +22,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" "time" @@ -432,7 +433,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-processing-activity-snapshots-to-documents/main.go b/cmd/migrate-processing-activity-snapshots-to-documents/main.go index 40c58f518..1c9393ab6 100644 --- a/cmd/migrate-processing-activity-snapshots-to-documents/main.go +++ b/cmd/migrate-processing-activity-snapshots-to-documents/main.go @@ -24,6 +24,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" "strings" @@ -740,7 +741,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-risk-snapshots-to-documents/main.go b/cmd/migrate-risk-snapshots-to-documents/main.go index 0cee358fd..32765ed81 100644 --- a/cmd/migrate-risk-snapshots-to-documents/main.go +++ b/cmd/migrate-risk-snapshots-to-documents/main.go @@ -22,6 +22,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" "time" @@ -507,7 +508,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-soa-snapshots-to-documents/main.go b/cmd/migrate-soa-snapshots-to-documents/main.go index 40622037f..1fbf4574d 100644 --- a/cmd/migrate-soa-snapshots-to-documents/main.go +++ b/cmd/migrate-soa-snapshots-to-documents/main.go @@ -22,6 +22,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" "time" @@ -516,7 +517,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/cmd/migrate-vendor-snapshots-to-documents/main.go b/cmd/migrate-vendor-snapshots-to-documents/main.go index faf8ba683..aa46132f0 100644 --- a/cmd/migrate-vendor-snapshots-to-documents/main.go +++ b/cmd/migrate-vendor-snapshots-to-documents/main.go @@ -22,6 +22,7 @@ import ( "context" "flag" "fmt" + "net" "net/url" "os" "strings" @@ -731,7 +732,11 @@ func newPgClientFromDSN(dsn string) (*pg.Client, error) { var opts []pg.Option if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { diff --git a/packages/cookie-banner/src/components/banner.ts b/packages/cookie-banner/src/components/banner.ts index be6f21b2b..b44c892c7 100644 --- a/packages/cookie-banner/src/components/banner.ts +++ b/packages/cookie-banner/src/components/banner.ts @@ -38,7 +38,11 @@ export class ProboBanner extends ProboElement { if (this.root) { this.root.addEventListener("probo-state", this.onStateChange); - this.root.addEventListener("probo-ready", this.onReady, { once: true }); + try { + this.validate(this.root.bannerConfig); + } catch { + this.root.addEventListener("probo-ready", this.onReady, { once: true }); + } if (this.root.state === "banner") { this.hidden = false; } diff --git a/pkg/coredata/access_entry_upsert_test.go b/pkg/coredata/access_entry_upsert_test.go index 9225e93bd..ab3c8af89 100644 --- a/pkg/coredata/access_entry_upsert_test.go +++ b/pkg/coredata/access_entry_upsert_test.go @@ -16,6 +16,7 @@ package coredata_test import ( "context" + "net" "net/url" "os" "testing" @@ -52,7 +53,11 @@ func newTestPgClient(t *testing.T) *pg.Client { // run in parallel. opts := []pg.Option{pg.WithRegisterer(prometheus.NewRegistry())} if u.Host != "" { - opts = append(opts, pg.WithAddr(u.Host)) + host := u.Host + if u.Port() == "" { + host = net.JoinHostPort(u.Hostname(), "5432") + } + opts = append(opts, pg.WithAddr(host)) } if u.User != nil { opts = append(opts, pg.WithUser(u.User.Username()))