Documentation
¶
Index ¶
- Constants
- func Export(c *conf.Config) string
- func ParseFile(filename string) (*conf.Config, error)
- func ParseFragment(content string) (*conf.Config, error)
- func ParseString(content string) (*conf.Config, error)
- func Render(c *conf.Config) string
- type Dialect
- func (Dialect) BeforeReload() error
- func (Dialect) ConfigFile() string
- func (Dialect) ConfigTest() string
- func (Dialect) DefaultSiteConf() string
- func (Dialect) ErrorPageConf() string
- func (Dialect) Features() types.Features
- func (Dialect) HTMLDir() string
- func (Dialect) HTPasswdLine(username, password string) string
- func (Dialect) HTTPSListenArgs() []string
- func (Dialect) LSCacheConf(string) string
- func (Dialect) NewPHPVhost(configDir string) (types.PHPVhost, error)
- func (Dialect) NewProxyVhost(configDir string) (types.ProxyVhost, error)
- func (Dialect) NewStaticVhost(configDir string) (types.StaticVhost, error)
- func (Dialect) PHPCacheConf() string
- func (Dialect) PanelACMEConf() string
- func (Dialect) RemovePanelChallenge(conf string) (bool, error)
- func (Dialect) RemoveSiteChallenge(conf, path, _ string) (bool, error)
- func (Dialect) RewritesDir() string
- func (Dialect) SPAConf() string
- func (Dialect) Service() string
- func (Dialect) StatConf(string) (string, string)
- func (Dialect) WriteDefaultSite(bool) error
- func (Dialect) WritePanelChallenge(conf string, names []string, tokens map[string]string) (bool, error)
- func (Dialect) WriteSiteChallenge(conf, path, token string) (bool, error)
- type PHPVhost
- func (v PHPVhost) AccessLog() string
- func (v PHPVhost) BasicAuth() []types.BasicAuth
- func (v PHPVhost) ClearBasicAuth() error
- func (v PHPVhost) ClearRateLimit() error
- func (v PHPVhost) ClearRealIP() error
- func (v PHPVhost) ClearSSL() error
- func (v PHPVhost) Config(name string, scope types.ConfigScope) string
- func (v PHPVhost) Default() bool
- func (v PHPVhost) Enable() bool
- func (v PHPVhost) ErrorLog() string
- func (v PHPVhost) Includes() []types.IncludeFile
- func (v PHPVhost) Index() []string
- func (v PHPVhost) Listen() []types.Listen
- func (v *PHPVhost) PHP() uint
- func (v PHPVhost) RateLimit() *types.RateLimit
- func (v PHPVhost) RealIP() *types.RealIP
- func (v PHPVhost) Redirects() []types.Redirect
- func (v PHPVhost) RemoveConfig(name string, scope types.ConfigScope) error
- func (v PHPVhost) Reset() error
- func (v PHPVhost) Root() string
- func (v PHPVhost) SSL() bool
- func (v PHPVhost) SSLConfig() *types.SSLConfig
- func (v PHPVhost) Save() error
- func (v PHPVhost) ServerName() []string
- func (v PHPVhost) SetAccessLog(accessLog string) error
- func (v PHPVhost) SetBasicAuth(auths []types.BasicAuth) error
- func (v PHPVhost) SetConfig(name string, scope types.ConfigScope, content string) error
- func (v PHPVhost) SetDefault(bool) error
- func (v PHPVhost) SetEnable(enable bool) error
- func (v PHPVhost) SetErrorLog(errorLog string) error
- func (v PHPVhost) SetIncludes(includes []types.IncludeFile) error
- func (v PHPVhost) SetIndex(index []string) error
- func (v PHPVhost) SetListen(listens []types.Listen) error
- func (v *PHPVhost) SetPHP(version uint) error
- func (v PHPVhost) SetRateLimit(limit *types.RateLimit) error
- func (v PHPVhost) SetRawConfig(name string, scope types.ConfigScope, content string) error
- func (v PHPVhost) SetRealIP(realIP *types.RealIP) error
- func (v PHPVhost) SetRedirects(redirects []types.Redirect) error
- func (v PHPVhost) SetRoot(root string) error
- func (v PHPVhost) SetSSLConfig(cfg *types.SSLConfig) error
- func (v PHPVhost) SetServerName(serverName []string) error
- type ParseOptions
- type ProxyVhost
- func (v ProxyVhost) AccessLog() string
- func (v ProxyVhost) BasicAuth() []types.BasicAuth
- func (v ProxyVhost) ClearBasicAuth() error
- func (v *ProxyVhost) ClearProxies() error
- func (v ProxyVhost) ClearRateLimit() error
- func (v ProxyVhost) ClearRealIP() error
- func (v ProxyVhost) ClearSSL() error
- func (v *ProxyVhost) ClearUpstreams() error
- func (v ProxyVhost) Config(name string, scope types.ConfigScope) string
- func (v ProxyVhost) Default() bool
- func (v ProxyVhost) Enable() bool
- func (v ProxyVhost) ErrorLog() string
- func (v ProxyVhost) Includes() []types.IncludeFile
- func (v ProxyVhost) Index() []string
- func (v ProxyVhost) Listen() []types.Listen
- func (v *ProxyVhost) Proxies() []types.Proxy
- func (v ProxyVhost) RateLimit() *types.RateLimit
- func (v ProxyVhost) RealIP() *types.RealIP
- func (v ProxyVhost) Redirects() []types.Redirect
- func (v ProxyVhost) RemoveConfig(name string, scope types.ConfigScope) error
- func (v ProxyVhost) Reset() error
- func (v ProxyVhost) Root() string
- func (v ProxyVhost) SSL() bool
- func (v ProxyVhost) SSLConfig() *types.SSLConfig
- func (v ProxyVhost) Save() error
- func (v ProxyVhost) ServerName() []string
- func (v ProxyVhost) SetAccessLog(accessLog string) error
- func (v ProxyVhost) SetBasicAuth(auths []types.BasicAuth) error
- func (v ProxyVhost) SetConfig(name string, scope types.ConfigScope, content string) error
- func (v ProxyVhost) SetDefault(bool) error
- func (v ProxyVhost) SetEnable(enable bool) error
- func (v ProxyVhost) SetErrorLog(errorLog string) error
- func (v ProxyVhost) SetIncludes(includes []types.IncludeFile) error
- func (v ProxyVhost) SetIndex(index []string) error
- func (v ProxyVhost) SetListen(listens []types.Listen) error
- func (v *ProxyVhost) SetProxies(proxies []types.Proxy) error
- func (v ProxyVhost) SetRateLimit(limit *types.RateLimit) error
- func (v ProxyVhost) SetRawConfig(name string, scope types.ConfigScope, content string) error
- func (v ProxyVhost) SetRealIP(realIP *types.RealIP) error
- func (v ProxyVhost) SetRedirects(redirects []types.Redirect) error
- func (v ProxyVhost) SetRoot(root string) error
- func (v ProxyVhost) SetSSLConfig(cfg *types.SSLConfig) error
- func (v ProxyVhost) SetServerName(serverName []string) error
- func (v *ProxyVhost) SetUpstreams(upstreams []types.Upstream) error
- func (v *ProxyVhost) Upstreams() []types.Upstream
- type StaticVhost
- func (v StaticVhost) AccessLog() string
- func (v StaticVhost) BasicAuth() []types.BasicAuth
- func (v StaticVhost) ClearBasicAuth() error
- func (v StaticVhost) ClearRateLimit() error
- func (v StaticVhost) ClearRealIP() error
- func (v StaticVhost) ClearSSL() error
- func (v StaticVhost) Config(name string, scope types.ConfigScope) string
- func (v StaticVhost) Default() bool
- func (v StaticVhost) Enable() bool
- func (v StaticVhost) ErrorLog() string
- func (v StaticVhost) Includes() []types.IncludeFile
- func (v StaticVhost) Index() []string
- func (v StaticVhost) Listen() []types.Listen
- func (v StaticVhost) RateLimit() *types.RateLimit
- func (v StaticVhost) RealIP() *types.RealIP
- func (v StaticVhost) Redirects() []types.Redirect
- func (v StaticVhost) RemoveConfig(name string, scope types.ConfigScope) error
- func (v StaticVhost) Reset() error
- func (v StaticVhost) Root() string
- func (v StaticVhost) SSL() bool
- func (v StaticVhost) SSLConfig() *types.SSLConfig
- func (v StaticVhost) Save() error
- func (v StaticVhost) ServerName() []string
- func (v StaticVhost) SetAccessLog(accessLog string) error
- func (v StaticVhost) SetBasicAuth(auths []types.BasicAuth) error
- func (v StaticVhost) SetConfig(name string, scope types.ConfigScope, content string) error
- func (v StaticVhost) SetDefault(bool) error
- func (v StaticVhost) SetEnable(enable bool) error
- func (v StaticVhost) SetErrorLog(errorLog string) error
- func (v StaticVhost) SetIncludes(includes []types.IncludeFile) error
- func (v StaticVhost) SetIndex(index []string) error
- func (v StaticVhost) SetListen(listens []types.Listen) error
- func (v StaticVhost) SetRateLimit(limit *types.RateLimit) error
- func (v StaticVhost) SetRawConfig(name string, scope types.ConfigScope, content string) error
- func (v StaticVhost) SetRealIP(realIP *types.RealIP) error
- func (v StaticVhost) SetRedirects(redirects []types.Redirect) error
- func (v StaticVhost) SetRoot(root string) error
- func (v StaticVhost) SetSSLConfig(cfg *types.SSLConfig) error
- func (v StaticVhost) SetServerName(serverName []string) error
Constants ¶
View Source
const ( RedirectStartNum = 100 // 重定向配置起始序号 (100-199) RedirectEndNum = 199 ProxyStartNum = 200 // 代理配置起始序号 (200-299) ProxyEndNum = 299 )
配置文件序号范围
View Source
const ConfigName = "apache.conf"
View Source
const DefaultVhostConf = `` /* 489-byte string literal not displayed */
View Source
const DisablePage = HTMLDir + "/stop.html"
View Source
const HSTSValue = "max-age=31536000"
HSTSValue 是 HSTS 响应头的默认 max-age(1 年)
View Source
const HTMLDir = ServerRoot + "/htdocs"
View Source
const ListenConf = "listen.conf"
ListenConf 面板维护的全局监听配置,装的是 Listen 指令
View Source
const ServerRoot = "/opt/ace/server/apache"
View Source
const SitesPath = "/opt/ace/sites"
Variables ¶
This section is empty.
Functions ¶
func ParseFragment ¶ added in v3.2.5
ParseFragment 解析片段文件内容(裸指令/块列表,容错模式)
func ParseString ¶
ParseString 从字符串解析配置(容错模式)
Types ¶
type Dialect ¶ added in v3.3.6
type Dialect struct{}
func (Dialect) BeforeReload ¶ added in v3.3.6
func (Dialect) ConfigFile ¶ added in v3.3.6
func (Dialect) ConfigTest ¶ added in v3.3.6
func (Dialect) DefaultSiteConf ¶ added in v3.3.6
func (Dialect) ErrorPageConf ¶ added in v3.3.6
func (Dialect) HTPasswdLine ¶ added in v3.3.6
HTPasswdLine 保持明文以便面板回读,保存站点时再转成 Apache 需要的 bcrypt 用户文件
func (Dialect) HTTPSListenArgs ¶ added in v3.3.6
func (Dialect) LSCacheConf ¶ added in v3.3.6
func (Dialect) NewPHPVhost ¶ added in v3.3.6
func (Dialect) NewProxyVhost ¶ added in v3.3.6
func (Dialect) NewProxyVhost(configDir string) (types.ProxyVhost, error)
func (Dialect) NewStaticVhost ¶ added in v3.3.6
func (Dialect) NewStaticVhost(configDir string) (types.StaticVhost, error)
func (Dialect) PHPCacheConf ¶ added in v3.3.6
func (Dialect) PanelACMEConf ¶ added in v3.3.6
func (Dialect) RemovePanelChallenge ¶ added in v3.3.6
func (Dialect) RemoveSiteChallenge ¶ added in v3.3.6
func (Dialect) RewritesDir ¶ added in v3.3.6
func (Dialect) WriteDefaultSite ¶ added in v3.3.6
func (Dialect) WritePanelChallenge ¶ added in v3.3.6
type PHPVhost ¶
type PHPVhost struct {
// contains filtered or unexported fields
}
func NewPHPVhost ¶
func (PHPVhost) ClearBasicAuth ¶
func (v PHPVhost) ClearBasicAuth() error
func (PHPVhost) ClearRateLimit ¶
func (v PHPVhost) ClearRateLimit() error
func (PHPVhost) ClearRealIP ¶
func (v PHPVhost) ClearRealIP() error
func (PHPVhost) Default ¶ added in v3.3.6
func (v PHPVhost) Default() bool
Default 默认站点切换只在 nginx 与 Caddy 支持
func (PHPVhost) Includes ¶
func (v PHPVhost) Includes() []types.IncludeFile
func (PHPVhost) RemoveConfig ¶
func (v PHPVhost) RemoveConfig(name string, scope types.ConfigScope) error
func (PHPVhost) ServerName ¶
func (v PHPVhost) ServerName() []string
func (PHPVhost) SetAccessLog ¶
func (PHPVhost) SetBasicAuth ¶
func (PHPVhost) SetConfig ¶
func (v PHPVhost) SetConfig(name string, scope types.ConfigScope, content string) error
func (PHPVhost) SetDefault ¶ added in v3.3.6
func (PHPVhost) SetErrorLog ¶
func (PHPVhost) SetIncludes ¶
func (v PHPVhost) SetIncludes(includes []types.IncludeFile) error
func (PHPVhost) SetRateLimit ¶
func (PHPVhost) SetRawConfig ¶ added in v3.2.5
func (v PHPVhost) SetRawConfig(name string, scope types.ConfigScope, content string) error
func (PHPVhost) SetRedirects ¶
func (PHPVhost) SetSSLConfig ¶
func (PHPVhost) SetServerName ¶
type ParseOptions ¶
type ParseOptions struct {
// Tolerant 容错模式:遇到结构错误(孤立闭合标签、未闭合块)记录后尽力继续,不致命
Tolerant bool
}
type ProxyVhost ¶
type ProxyVhost struct {
// contains filtered or unexported fields
}
func NewProxyVhost ¶
func NewProxyVhost(configDir string) (*ProxyVhost, error)
func (ProxyVhost) ClearBasicAuth ¶
func (v ProxyVhost) ClearBasicAuth() error
func (*ProxyVhost) ClearProxies ¶
func (v *ProxyVhost) ClearProxies() error
func (ProxyVhost) ClearRateLimit ¶
func (v ProxyVhost) ClearRateLimit() error
func (ProxyVhost) ClearRealIP ¶
func (v ProxyVhost) ClearRealIP() error
func (*ProxyVhost) ClearUpstreams ¶
func (v *ProxyVhost) ClearUpstreams() error
func (ProxyVhost) Default ¶ added in v3.3.6
func (v ProxyVhost) Default() bool
Default 默认站点切换只在 nginx 与 Caddy 支持
func (ProxyVhost) Includes ¶
func (v ProxyVhost) Includes() []types.IncludeFile
func (*ProxyVhost) Proxies ¶
func (v *ProxyVhost) Proxies() []types.Proxy
func (ProxyVhost) RemoveConfig ¶
func (v ProxyVhost) RemoveConfig(name string, scope types.ConfigScope) error
func (ProxyVhost) ServerName ¶
func (v ProxyVhost) ServerName() []string
func (ProxyVhost) SetAccessLog ¶
func (ProxyVhost) SetBasicAuth ¶
func (ProxyVhost) SetConfig ¶
func (v ProxyVhost) SetConfig(name string, scope types.ConfigScope, content string) error
func (ProxyVhost) SetDefault ¶ added in v3.3.6
func (ProxyVhost) SetErrorLog ¶
func (ProxyVhost) SetIncludes ¶
func (v ProxyVhost) SetIncludes(includes []types.IncludeFile) error
func (*ProxyVhost) SetProxies ¶
func (v *ProxyVhost) SetProxies(proxies []types.Proxy) error
func (ProxyVhost) SetRateLimit ¶
func (ProxyVhost) SetRawConfig ¶ added in v3.2.5
func (v ProxyVhost) SetRawConfig(name string, scope types.ConfigScope, content string) error
func (ProxyVhost) SetRedirects ¶
func (ProxyVhost) SetSSLConfig ¶
func (ProxyVhost) SetServerName ¶
func (*ProxyVhost) SetUpstreams ¶
func (v *ProxyVhost) SetUpstreams(upstreams []types.Upstream) error
func (*ProxyVhost) Upstreams ¶
func (v *ProxyVhost) Upstreams() []types.Upstream
type StaticVhost ¶
type StaticVhost struct {
// contains filtered or unexported fields
}
func NewStaticVhost ¶
func NewStaticVhost(configDir string) (*StaticVhost, error)
func (StaticVhost) ClearBasicAuth ¶
func (v StaticVhost) ClearBasicAuth() error
func (StaticVhost) ClearRateLimit ¶
func (v StaticVhost) ClearRateLimit() error
func (StaticVhost) ClearRealIP ¶
func (v StaticVhost) ClearRealIP() error
func (StaticVhost) Config ¶
func (v StaticVhost) Config(name string, scope types.ConfigScope) string
func (StaticVhost) Default ¶ added in v3.3.6
func (v StaticVhost) Default() bool
Default 默认站点切换只在 nginx 与 Caddy 支持
func (StaticVhost) Includes ¶
func (v StaticVhost) Includes() []types.IncludeFile
func (StaticVhost) RemoveConfig ¶
func (v StaticVhost) RemoveConfig(name string, scope types.ConfigScope) error
func (StaticVhost) ServerName ¶
func (v StaticVhost) ServerName() []string
func (StaticVhost) SetAccessLog ¶
func (StaticVhost) SetBasicAuth ¶
func (StaticVhost) SetConfig ¶
func (v StaticVhost) SetConfig(name string, scope types.ConfigScope, content string) error
func (StaticVhost) SetDefault ¶ added in v3.3.6
func (StaticVhost) SetErrorLog ¶
func (StaticVhost) SetIncludes ¶
func (v StaticVhost) SetIncludes(includes []types.IncludeFile) error
func (StaticVhost) SetRateLimit ¶
func (StaticVhost) SetRawConfig ¶ added in v3.2.5
func (v StaticVhost) SetRawConfig(name string, scope types.ConfigScope, content string) error
func (StaticVhost) SetRedirects ¶
func (StaticVhost) SetSSLConfig ¶
func (StaticVhost) SetServerName ¶
Click to show internal directories.
Click to hide internal directories.