btpanel

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeployCertificateToBTPanelCertificateStore

func DeployCertificateToBTPanelCertificateStore(ctx context.Context, certificatePEM, privateKeyPEM string) error

DeployCertificateToBTPanelCertificateStore 将证书保存到宝塔证书库并回读元数据校验。

func DeployCertificateToBTPanelWebsite

func DeployCertificateToBTPanelWebsite(ctx context.Context, targetRef, certificatePEM, privateKeyPEM string) error

DeployCertificateToBTPanelWebsite 精确部署 targetRef 对应宝塔网站的证书,并回读结果确认。

func IsBTPanelConfigured

func IsBTPanelConfigured() bool

IsBTPanelConfigured 判断兼容入口是否带有可用的宝塔面板配置。

func IsBTPanelConfiguredWithContext

func IsBTPanelConfiguredWithContext(ctx context.Context) bool

IsBTPanelConfiguredWithContext 从 context 快照判断宝塔面板是否已配置。

func IsBTPanelErrorRetryable

func IsBTPanelErrorRetryable(err error) bool

IsBTPanelErrorRetryable 判断宝塔面板操作是否适合由后端稍后重试。

func TestBTPanelCertificateConnection

func TestBTPanelCertificateConnection() error

TestBTPanelCertificateConnection 通过兼容入口测试宝塔证书库权限。

func TestBTPanelCertificateConnectionWithContext

func TestBTPanelCertificateConnectionWithContext(ctx context.Context) error

TestBTPanelCertificateConnectionWithContext 使用调用方 context 测试宝塔证书库权限。

func TestBTPanelWebsiteConnection

func TestBTPanelWebsiteConnection(ctx context.Context, targetRef string) error

TestBTPanelWebsiteConnection 只读确认 targetRef 对应网站仍存在并能读取 SSL 配置。

Types

type BTPanelWebsiteResource

type BTPanelWebsiteResource struct {
	TargetRef string   // TargetRef 是客户端生成的不透明稳定引用。
	Label     string   // Label 是网站备注或主域名。
	Domain    string   // Domain 是网站主域名。
	Domains   []string // Domains 是网站绑定的全部规范化域名。
	Protocol  string   // Protocol 是网站当前的 HTTP 或 HTTPS 状态。
	Status    string   // Status 是网站当前运行状态。
}

BTPanelWebsiteResource 是可以安全上报到 anSSL 后端的脱敏宝塔网站资源。

func DiscoverBTPanelWebsiteResources

func DiscoverBTPanelWebsiteResources(ctx context.Context) ([]BTPanelWebsiteResource, error)

DiscoverBTPanelWebsiteResources 动态读取全部宝塔网站的脱敏目录。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL