fix: Use repo-owner format for Pages subdomain URL
Some checks failed
Build and Release / Create Release (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 1m34s
Build and Release / Lint (push) Failing after 1m52s
Build and Release / Build Binaries (amd64, darwin) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux) (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 2m3s

- Format: {repo}-{owner}.{domain} (e.g., gitcaddy-gitcaddy.git-test.marketally.com)
- Simpler and unique URL structure
This commit is contained in:
Claude Code 2026-01-11 00:51:31 +01:00
parent 853ff29ae2
commit 919746c756

View File

@ -172,8 +172,8 @@ func DisablePages(ctx context.Context, repo *repo_model.Repository) error {
// GetPagesSubdomain returns the subdomain for a repository's pages // GetPagesSubdomain returns the subdomain for a repository's pages
func GetPagesSubdomain(repo *repo_model.Repository) string { func GetPagesSubdomain(repo *repo_model.Repository) string {
// Format: {repo}.{owner}.pages.{domain} // Format: {repo}-{owner}.{domain}
return fmt.Sprintf("%s.%s", strings.ToLower(repo.Name), strings.ToLower(repo.OwnerName)) return fmt.Sprintf("%s-%s", strings.ToLower(repo.Name), strings.ToLower(repo.OwnerName))
} }
// GetPagesURL returns the full URL for a repository's pages // GetPagesURL returns the full URL for a repository's pages
@ -182,7 +182,7 @@ func GetPagesURL(repo *repo_model.Repository) string {
// This should be configurable // This should be configurable
// Extract domain from settings // Extract domain from settings
domain := setting.Domain domain := setting.Domain
return fmt.Sprintf("https://%s.pages.%s", subdomain, domain) return fmt.Sprintf("https://%s.%s", subdomain, domain)
} }
// GetPagesDomains returns all custom domains for a repository's pages // GetPagesDomains returns all custom domains for a repository's pages