( //nolint:funlen // single env-var config map, not decomposable cfg *model.ConfigConfig, subdomain string, dashboardVersion string, httpPort uint, useTLS bool, appID string, )
| 341 | } |
| 342 | |
| 343 | func dashboard( //nolint:funlen // single env-var config map, not decomposable |
| 344 | cfg *model.ConfigConfig, |
| 345 | subdomain string, |
| 346 | dashboardVersion string, |
| 347 | httpPort uint, |
| 348 | useTLS bool, |
| 349 | appID string, |
| 350 | ) *Service { |
| 351 | // With constellation enabled, the dashboard's hasura admin/metadata API |
| 352 | // calls flow through constellation (which proxies unmatched paths to hasura) |
| 353 | // instead of hitting hasura directly. Console UI and migrations API stay on |
| 354 | // the hasura-cli helper containers and are not affected. |
| 355 | hasuraAPISubdomain := "hasura" |
| 356 | if cfg.GetExperimental().GetConstellation() != nil { |
| 357 | hasuraAPISubdomain = "graphql" |
| 358 | } |
| 359 | |
| 360 | return &Service{ |
| 361 | Image: dashboardVersion, |
| 362 | DependsOn: nil, |
| 363 | EntryPoint: nil, |
| 364 | Command: nil, |
| 365 | Environment: map[string]string{ |
| 366 | "NEXT_PUBLIC_ENV": "dev", |
| 367 | "NEXT_PUBLIC_NHOST_PLATFORM": "false", |
| 368 | "NEXT_PUBLIC_NHOST_APP_ID": appID, |
| 369 | "NEXT_PUBLIC_NHOST_ADMIN_SECRET": cfg.Hasura.AdminSecret, |
| 370 | "NEXT_PUBLIC_NHOST_AUTH_URL": URL( |
| 371 | subdomain, "auth", httpPort, useTLS, |
| 372 | ) + "/v1", |
| 373 | "NEXT_PUBLIC_NHOST_CONFIGSERVER_URL": URL( |
| 374 | subdomain, "dashboard", httpPort, useTLS, |
| 375 | ) + "/v1/configserver/graphql", |
| 376 | "NEXT_PUBLIC_NHOST_FUNCTIONS_URL": URL( |
| 377 | subdomain, "functions", httpPort, useTLS, |
| 378 | ) + "/v1", |
| 379 | "NEXT_PUBLIC_NHOST_LOGS_GRAPHQL_URL": URL( |
| 380 | subdomain, "dashboard", httpPort, useTLS, |
| 381 | ) + "/v1/logs/graphql", |
| 382 | "NEXT_PUBLIC_NHOST_LOGS_WEBSOCKET": WebsocketURL( |
| 383 | subdomain, "dashboard", httpPort, useTLS, |
| 384 | ) + "/v1/logs/graphql", |
| 385 | "NEXT_PUBLIC_NHOST_GRAPHQL_URL": URL( |
| 386 | subdomain, "graphql", httpPort, useTLS, |
| 387 | ) + "/v1", |
| 388 | "NEXT_PUBLIC_NHOST_HASURA_API_URL": URL( |
| 389 | subdomain, hasuraAPISubdomain, httpPort, useTLS, |
| 390 | ), |
| 391 | "NEXT_PUBLIC_NHOST_HASURA_CONSOLE_URL": URL( |
| 392 | subdomain, "hasura", httpPort, useTLS, |
| 393 | ) + "/console", |
| 394 | "NEXT_PUBLIC_NHOST_HASURA_MIGRATIONS_API_URL": URL( |
| 395 | subdomain, "hasura", httpPort, useTLS, |
| 396 | ) + "/apis/migrate", |
| 397 | "NEXT_PUBLIC_NHOST_STORAGE_URL": URL( |
| 398 | subdomain, "storage", httpPort, useTLS, |
| 399 | ) + "/v1", |
| 400 | }, |
no test coverage detected