Documentation
¶
Overview ¶
Package ntfy 托管 ntfy(binwiederhier/ntfy)自建推送服务:在界面中配置监听地址与管理员账号, 生成 server.yml 并守护 ntfy 进程;通知中心的 ntfy 渠道可直接使用本机服务。
Index ¶
- Constants
- type Module
- func (m *Module) ID() string
- func (m *Module) Init(env module.Env) error
- func (m *Module) ProgramInstallers() []*binstall.Installer
- func (m *Module) Routes(r module.Router)
- func (m *Module) SetHTTPClient(fn func() *http.Client)
- func (m *Module) Start(context.Context) error
- func (m *Module) Stop() error
- func (m *Module) Summary() []module.SummaryItem
- func (m *Module) Title() string
- type Server
- type ServerView
- type Settings
Constants ¶
const ID = "ntfy"
ID 是模块标识。
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module 是 ntfy 模块。
func (*Module) ProgramInstallers ¶
ProgramInstallers 返回模块托管的程序安装器,供 Gately 自动检查更新时一并检查托管程序。
func (*Module) SetHTTPClient ¶
SetHTTPClient 实现 module.HTTPClientAware。
func (*Module) Summary ¶
func (m *Module) Summary() []module.SummaryItem
Summary 实现 module.Summarizer。
type Server ¶
type Server struct {
Enable bool `json:"enable"`
// ListenIP 为空表示监听全部 IPv4 地址
ListenIP string `json:"listenIp"`
Port int `json:"port"`
// BaseURL 是客户端访问 ntfy 的外部地址(例如经 Web 服务反向代理的域名),留空时 ntfy 使用请求中的地址;
// 手机 App 的即时推送(iOS、Web Push)需要填写
BaseURL string `json:"baseUrl"`
// BehindProxy 为 true 时信任 X-Forwarded-For,仅应在反向代理之后开启
BehindProxy bool `json:"behindProxy"`
// AdminUser 是 Gately 管理的管理员账号,默认 admin
AdminUser string `json:"adminUser"`
// AdminPassword 在每次启动时同步为管理员账号的密码;留空时保存会自动生成
AdminPassword string `json:"adminPassword"`
// Token 是 Gately 生成的管理员访问令牌,用于通知中心的 ntfy 渠道,只读
Token string `json:"token"`
Remark string `json:"remark"`
}
Server 是托管的 ntfy 服务配置。ntfy 的用户库、消息缓存都在 Gately 配置目录下的 ntfy 子目录中。