CanUseHTTPOnly returns true if the project can be accessed via http only
()
| 528 | |
| 529 | // CanUseHTTPOnly returns true if the project can be accessed via http only |
| 530 | func (app *DdevApp) CanUseHTTPOnly() bool { |
| 531 | switch { |
| 532 | // Codespaces/Devcontainer has its own router with TLS termination |
| 533 | case nodeps.IsCodespaces(): |
| 534 | return false |
| 535 | case nodeps.IsDevcontainer(): |
| 536 | return false |
| 537 | // If we have no router, then no https otherwise |
| 538 | case IsRouterDisabled(app): |
| 539 | return true |
| 540 | // If a custom cert, we can do https, so false |
| 541 | case app.HasCustomCert(): |
| 542 | return false |
| 543 | // If no mkcert installed, no https |
| 544 | case globalconfig.GetCAROOT() == "": |
| 545 | return true |
| 546 | } |
| 547 | // Default case is OK to use https |
| 548 | return false |
| 549 | } |
| 550 | |
| 551 | // Turn a slice of *DdevApp into a map keyed by name |
| 552 | func AppSliceToMap(appList []*DdevApp) map[string]*DdevApp { |