Documentation
¶
Index ¶
- func DeployCertificateTo1PanelWebsite(ctx context.Context, targetRef, certificatePEM, privateKeyPEM string) error
- func DeployToStore(ctx context.Context, sourceDir, domain string) error
- func IsOnePanelConfigured() bool
- func IsOnePanelConfiguredWithContext(ctx context.Context) bool
- func IsOnePanelErrorRetryable(err error) bool
- func TestOnePanelConnection() error
- func TestOnePanelConnectionWithContext(ctx context.Context) error
- func TestOnePanelWebsiteConnection(ctx context.Context, targetRef string) error
- type OnePanelAPIResponse
- type OnePanelWebsiteResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeployCertificateTo1PanelWebsite ¶
func DeployCertificateTo1PanelWebsite(ctx context.Context, targetRef, certificatePEM, privateKeyPEM string) error
DeployCertificateTo1PanelWebsite 精确部署 targetRef 对应网站的证书,并回读指纹确认。
func DeployToStore ¶
DeployToStore 上传证书到 1Panel 证书库,保留原有非网站级行为。
func IsOnePanelConfigured ¶
func IsOnePanelConfigured() bool
IsOnePanelConfigured 判断兼容入口是否带有可用的 1Panel 配置。
func IsOnePanelConfiguredWithContext ¶
IsOnePanelConfiguredWithContext 从 context 快照判断 1Panel 是否已配置。
func IsOnePanelErrorRetryable ¶
IsOnePanelErrorRetryable 判断 1Panel 操作是否适合由后端稍后重试。
func TestOnePanelConnection ¶
func TestOnePanelConnection() error
TestOnePanelConnection 通过兼容入口验证 1Panel 证书管理权限。
func TestOnePanelConnectionWithContext ¶
TestOnePanelConnectionWithContext 使用调用方 context 验证 1Panel 连接。
Types ¶
type OnePanelAPIResponse ¶
type OnePanelAPIResponse struct {
Code int `json:"code"` // Code 是 1Panel 业务状态码,200 表示成功。
Message string `json:"message"` // Message 是仅供 deploy 本地日志使用的诊断信息。
Data json.RawMessage `json:"data"` // Data 是具体接口返回的数据。
}
OnePanelAPIResponse 描述 1Panel v2 API 的统一响应外壳。
type OnePanelWebsiteResource ¶
type OnePanelWebsiteResource struct {
TargetRef string // TargetRef 是客户端生成的不透明稳定引用。
Label string // Label 是网站别名或主域名。
Domain string // Domain 是网站主域名。
Domains []string // Domains 是网站绑定的全部规范化域名。
Protocol string // Protocol 是安全展示的当前协议,仅用于判断首次 HTTPS 部署。
Status string // Status 是安全展示的当前运行状态,仅用于阻止停止网站部署。
}
OnePanelWebsiteResource 是可以安全上报到 anSSL 后端的脱敏网站资源。
func DiscoverOnePanelWebsiteResources ¶
func DiscoverOnePanelWebsiteResources(ctx context.Context) ([]OnePanelWebsiteResource, error)
DiscoverOnePanelWebsiteResources 动态读取全部 1Panel 网站的脱敏目录。
Click to show internal directories.
Click to hide internal directories.