MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / GetBindDomain

Method GetBindDomain

agent/app/service/ai.go:303–323  ·  view source on GitHub ↗
(req dto.OllamaBindDomainReq)

Source from the content-addressed store, hash-verified

301}
302
303func (u *AIToolService) GetBindDomain(req dto.OllamaBindDomainReq) (*dto.OllamaBindDomainRes, error) {
304 install, err := appInstallRepo.GetFirst(repo.WithByID(req.AppInstallID))
305 if err != nil {
306 return nil, err
307 }
308 res := &dto.OllamaBindDomainRes{}
309 website, _ := websiteRepo.GetFirst(websiteRepo.WithAppInstallId(install.ID))
310 if website.ID == 0 {
311 return res, nil
312 }
313 res.WebsiteID = website.ID
314 res.Domain = website.PrimaryDomain
315 if website.WebsiteSSLID > 0 {
316 res.SSLID = website.WebsiteSSLID
317 ssl, _ := websiteSSLRepo.GetFirst(repo.WithByID(website.WebsiteSSLID))
318 res.AcmeAccountID = ssl.AcmeAccountID
319 }
320 res.ConnUrl = fmt.Sprintf("%s://%s", strings.ToLower(website.Protocol), website.PrimaryDomain)
321 res.AllowIPs = GetAllowIps(website)
322 return res, nil
323}
324
325func (u *AIToolService) UpdateBindDomain(req dto.OllamaBindDomain) error {
326 nginxInstall, _ := getAppInstallByKey(constant.AppOpenresty)

Callers

nothing calls this directly

Calls 4

GetAllowIpsFunction · 0.85
GetFirstMethod · 0.65
WithByIDMethod · 0.65
WithAppInstallIdMethod · 0.65

Tested by

no test coverage detected