config

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config   *Configuration
	Version  = "v0.5.6"
	URL      = URLProd
	URLProd  = "https://anssl.cn/deploy"
	URLLocal = "http://localhost:9000/deploy"
)

Functions

func Init

func Init(configFile string) error

Init 初始化配置

Types

type Configuration

type Configuration struct {
	Server   *ServerConfig `yaml:"server"`
	SSL      *DeployConfig `yaml:"ssl"`
	Update   *UpdateConfig `yaml:"update"`
	Provider []*Provider   `yaml:"provider"`
}

Configuration 应用配置结构

func GetConfig

func GetConfig() *Configuration

GetConfig 获取配置

type DeployConfig added in v0.5.0

type DeployConfig struct {
	NginxPath     string          `yaml:"nginxPath"`     // Nginx SSL 证书目录
	ApachePath    string          `yaml:"apachePath"`    // Apache SSL 证书目录
	RustFSPath    string          `yaml:"rustFSPath"`    // RustFS TLS 证书目录
	FeiNiuEnabled bool            `yaml:"feiNiuEnabled"` // 飞牛 TLS 证书部署开关
	OnePanel      *OnePanelConfig `yaml:"onePanel"`      // 1Panel 配置
}

type OnePanelConfig added in v0.5.1

type OnePanelConfig struct {
	URL    string `yaml:"url"`    // 1Panel API 地址
	APIKey string `yaml:"apiKey"` // 1Panel API 密钥
}

OnePanelConfig 1Panel 配置

type Provider

type Provider struct {
	Name   string        `yaml:"name"`
	Remark string        `yaml:"remark"`
	Auth   *ProviderAuth `yaml:"auth"`
}

func GetProvider

func GetProvider(name string) *Provider

GetProvider 获取提供商配置

func (*Provider) GetAccessKey added in v0.5.0

func (p *Provider) GetAccessKey() string

GetAccessKey 获取七牛云 AccessKey

func (*Provider) GetAccessKeyId added in v0.5.0

func (p *Provider) GetAccessKeyId() string

GetAccessKeyId 获取阿里云 AccessKeyId

func (*Provider) GetAccessKeySecret added in v0.5.0

func (p *Provider) GetAccessKeySecret() string

GetAccessKeySecret 获取阿里云 AccessKeySecret

func (*Provider) GetAccessSecret added in v0.5.0

func (p *Provider) GetAccessSecret() string

GetAccessSecret 获取七牛云 AccessSecret

func (*Provider) GetESASiteID added in v0.5.5

func (p *Provider) GetESASiteID() string

GetESASiteID 获取阿里云 ESA SiteId

func (*Provider) GetSecretId added in v0.5.0

func (p *Provider) GetSecretId() string

GetSecretId 获取腾讯云 SecretId

func (*Provider) GetSecretKey added in v0.5.0

func (p *Provider) GetSecretKey() string

GetSecretKey 获取腾讯云 SecretKey

type ProviderAuth added in v0.5.0

type ProviderAuth struct {
	// 阿里云认证字段
	AccessKeyId     string `yaml:"accessKeyId,omitempty"`
	AccessKeySecret string `yaml:"accessKeySecret,omitempty"`
	ESASiteID       string `yaml:"esaSiteId,omitempty"`
	// 腾讯云认证字段
	SecretId  string `yaml:"secretId,omitempty"`
	SecretKey string `yaml:"secretKey,omitempty"`
	// 七牛云认证字段
	AccessKey    string `yaml:"accessKey,omitempty"`
	AccessSecret string `yaml:"accessSecret,omitempty"`
}

type ServerConfig

type ServerConfig struct {
	AccessKey string `yaml:"accessKey"`
	Env       string `yaml:"env"`
	Port      int    `yaml:"port"` // HTTP-01 challenge 服务端口,默认 19000
}

type UpdateConfig

type UpdateConfig struct {
	// 镜像源类型: github(默认), ghproxy, fastgit, custom
	Mirror string `yaml:"mirror"`
	// 自定义镜像地址(当 mirror=custom 时使用)
	CustomURL string `yaml:"customUrl"`
	// HTTP 代理地址
	Proxy string `yaml:"proxy"`
}

Jump to

Keyboard shortcuts

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