@@ -529,6 +529,8 @@ func assertHostnameEqual(inputUrl string, expectedHostname string) error {
529529 return nil
530530}
531531
532+ // Returns URL's that are accessible from the host machine (outside the container) for
533+ // the homeserver's client API and federation API.
532534func getHostAccessibleHomeserverUrls (ctx context.Context , docker * client.Client , containerID string , hsPortBindingIP string ) (baseURL string , fedBaseURL string , err error ) {
533535 inspectResponse , err := inspectPortsOnContainer (ctx , docker , containerID )
534536 if err != nil {
@@ -537,10 +539,10 @@ func getHostAccessibleHomeserverUrls(ctx context.Context, docker *client.Client,
537539
538540 baseURL , fedBaseURL , err = endpoints (inspectResponse .NetworkSettings .Ports , hsPortBindingIP , 8008 , 8448 )
539541
540- // Sanity check that the URL's match the expected binding hostname. It's important
541- // that we use the canonical publically accessible hostname for the homeserver as ...
542- // such as important cookies that are set during a SSO/OIDC login process ( cookies are
543- // scoped to the domain) .
542+ // Sanity check that the URL's match the expected configured binding hostname. It's
543+ // also important that we use the canonical publicly accessible hostname for the
544+ // homeserver for some situations like SSO/OIDC login where important cookies are set
545+ // for the domain.
544546 err = assertHostnameEqual (baseURL , hsPortBindingIP )
545547 if err != nil {
546548 return "" , "" , fmt .Errorf ("failed to assert baseURL has the correct hostname: %w" , err )
@@ -574,7 +576,8 @@ func waitForPorts(ctx context.Context, docker *client.Client, containerID string
574576type ContainerInspectionError struct {
575577 // Error message
576578 msg string
577- // Whether this error should stop retrying to inspect the container.
579+ // Indicates whether the caller should stop retrying to inspect the container because
580+ // it has already exited.
578581 Fatal bool
579582}
580583
0 commit comments