onepanel

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: 25 Imported by: 0

Documentation

Index

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

func DeployToStore(ctx context.Context, sourceDir, domain string) error

DeployToStore 上传证书到 1Panel 证书库,保留原有非网站级行为。

func IsOnePanelConfigured

func IsOnePanelConfigured() bool

IsOnePanelConfigured 判断兼容入口是否带有可用的 1Panel 配置。

func IsOnePanelConfiguredWithContext

func IsOnePanelConfiguredWithContext(ctx context.Context) bool

IsOnePanelConfiguredWithContext 从 context 快照判断 1Panel 是否已配置。

func IsOnePanelErrorRetryable

func IsOnePanelErrorRetryable(err error) bool

IsOnePanelErrorRetryable 判断 1Panel 操作是否适合由后端稍后重试。

func TestOnePanelConnection

func TestOnePanelConnection() error

TestOnePanelConnection 通过兼容入口验证 1Panel 证书管理权限。

func TestOnePanelConnectionWithContext

func TestOnePanelConnectionWithContext(ctx context.Context) error

TestOnePanelConnectionWithContext 使用调用方 context 验证 1Panel 连接。

func TestOnePanelWebsiteConnection

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

TestOnePanelWebsiteConnection 只读确认 targetRef 对应网站仍存在、正在运行且 HTTPS 配置可访问。

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 网站的脱敏目录。

Jump to

Keyboard shortcuts

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