gitea/modules/structs/repo_pages.go
Claude Code 7292421334
Some checks failed
Build and Release / Create Release (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 1m37s
Build and Release / Unit Tests (push) Successful in 1m54s
Build and Release / Lint (push) Failing after 1m58s
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
feat: Add SSL external option for Pages custom domains
- Add checkbox to mark SSL as handled externally (e.g., Cloudflare)
- Add Activate SSL button for verified domains with pending SSL
- Add SSLExternal option to API
- Useful when using CDN/reverse proxy that handles SSL certificates
2026-01-11 00:40:44 +01:00

50 lines
1.6 KiB
Go

// Copyright 2026 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
import "time"
// PagesConfig represents the pages configuration for a repository
type PagesConfig struct {
Enabled bool `json:"enabled"`
Template string `json:"template"`
Subdomain string `json:"subdomain,omitempty"`
URL string `json:"url,omitempty"`
}
// PagesDomain represents a custom domain for Gitea Pages
type PagesDomain struct {
ID int64 `json:"id"`
Domain string `json:"domain"`
Verified bool `json:"verified"`
VerificationToken string `json:"verification_token,omitempty"`
SSLStatus string `json:"ssl_status"`
SSLCertExpiry time.Time `json:"ssl_cert_expiry,omitzero"`
Created time.Time `json:"created_at"`
VerifiedAt time.Time `json:"verified_at,omitzero"`
}
// CreatePagesConfigOption options for creating/updating pages config
type CreatePagesConfigOption struct {
// Whether pages is enabled
Enabled bool `json:"enabled"`
// Template to use (simple, documentation, product, portfolio)
Template string `json:"template" binding:"In(simple,documentation,product,portfolio)"`
}
// AddPagesDomainOption options for adding a custom domain
type AddPagesDomainOption struct {
// The custom domain to add
// required: true
Domain string `json:"domain" binding:"Required"`
// Mark SSL as handled externally (e.g., by Cloudflare)
SSLExternal bool `json:"ssl_external"`
}
// PagesInfo represents the full pages information for a repository
type PagesInfo struct {
Config *PagesConfig `json:"config"`
Domains []*PagesDomain `json:"domains,omitempty"`
}