Documentation
¶
Overview ¶
Package caddywekan is a Caddy plugin that is WeKan, the kanban board, written in Go and running inside Caddy - no Node.js, no second process:
- the app "wekan" opens WeKan's database - FerretDB over SQLite, embedded by caddy-ferretdb-plugin - in <data>/files/db, the same wekan.sqlite Node.js WeKan writes, and stops it when Caddy stops;
- the handler "wekan" (http.handlers.wekan) serves WeKan's pages and REST API (the web package).
Caddyfile:
{
wekan {
data /var/lib/weddy
}
}
wekan.example.org {
wekan
}
With primary, every domain is a WeKan of its own (cloud.go).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeHost ¶
NormalizeHost is a request's Host as a domain: lower case, no port, no final dot.
func ValidDomain ¶
ValidDomain reports whether name is a domain name that can also be a directory name.
Types ¶
type App ¶
type App struct {
// Data is the directory of WeKan's files: <data>/files/db is its database. With
// primary, <data>/domains/<domain>/ is each domain's, and <data>/cloud/ the
// Cloud Panel's Domains table and CloudFlare token.
Data string `json:"data,omitempty"`
// Primary is the first domain, and turns on many domains: its WeKan has Admin
// Panel / People / Cloud, and the Cloud Panel on the Cloud Panel Domain.
Primary string `json:"primary,omitempty"`
// DatabaseListen is a TCP address where the database also answers, e.g.
// 127.0.0.1:27017, for mongodump and other MongoDB tools. Only without primary:
// each domain's database is its own.
DatabaseListen string `json:"database_listen,omitempty"`
// contains filtered or unexported fields
}
App runs WeKan.
func (App) CaddyModule ¶
func (App) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*App) Start ¶
Start opens WeKan's database and starts serving - or, with primary, every domain's.
func (*App) Stop ¶
Stop stops serving and closes the database - every domain's - when its last request is done.
func (*App) UnmarshalCaddyfile ¶
UnmarshalCaddyfile reads the global option:
wekan {
data <dir>
primary <first domain>
database_listen <host:port>
}
root is the older name of data. The options of the Node.js WeKan that Weddy used to start - bundle, command, args, dial, env, root_url, stop_timeout - are refused with the reason: WeKan runs in Go inside Weddy now.
type Cloud ¶
type Cloud struct {
// contains filtered or unexported fields
}
Cloud runs the WeKan of every domain.
func CurrentCloud ¶
func CurrentCloud() *Cloud
CurrentCloud is the running Cloud, for the TLS modules; nil without one.
func (*Cloud) Allowed ¶
Allowed reports whether name may have a certificate: an active domain, the primary or the Cloud Panel Domain.
func (*Cloud) ServeHTTP ¶
ServeHTTP sends the request to the WeKan of its domain - and only there: an unknown or expired domain gets 404, never another domain's WeKan.
type Domain ¶
Domain, DomainsFile and the rules are the web package's: the Cloud Panel there writes what this file reads.
type DomainStatus ¶
type DomainStatus struct {
Domain string `json:"domain"`
TLS string `json:"tls"` // "cloudflare-origin" or "letsencrypt"
Zone string `json:"zone,omitempty"`
DNS string `json:"dns,omitempty"`
CertExpires string `json:"certExpires,omitempty"`
Error string `json:"error,omitempty"`
}
DomainStatus is what this side did for one domain, in <root>/cloud/status.json.
type DomainsFile ¶
type DomainsFile = web.DomainsFile
Domain, DomainsFile and the rules are the web package's: the Cloud Panel there writes what this file reads.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves a site from WeKan - with primary, from the WeKan of the request's domain.
func (Handler) CaddyModule ¶
func (Handler) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
type OriginCerts ¶
type OriginCerts struct {
// contains filtered or unexported fields
}
OriginCerts gives the CloudFlare Origin certificate of a domain, when it has one.
func (OriginCerts) CaddyModule ¶
func (OriginCerts) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*OriginCerts) GetCertificate ¶
func (o *OriginCerts) GetCertificate(_ context.Context, hello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate returns the domain's Origin certificate, or nil - then Caddy's issuers (Let's Encrypt) get one.
func (*OriginCerts) Provision ¶
func (o *OriginCerts) Provision(caddy.Context) error
Provision makes the certificate cache.
func (*OriginCerts) UnmarshalCaddyfile ¶
func (o *OriginCerts) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile: "get_certificate wekan_cloudflare", no arguments.
type Permission ¶
type Permission struct{}
Permission allows an on-demand certificate only for a served domain.
func (Permission) CaddyModule ¶
func (Permission) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (Permission) CertificateAllowed ¶
func (Permission) CertificateAllowed(_ context.Context, name string) error
CertificateAllowed is nil only for the primary, the Cloud Panel Domain and an active domain of the Domains table.
func (*Permission) UnmarshalCaddyfile ¶
func (p *Permission) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile: "permission wekan_domains", no arguments.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
sync-i18n
command
Command sync-i18n copies WeKan's translations into web/i18n: for every language, only the keys the Go WeKan uses - the pages' `t $.L "key"` and the code's s.tr(lang, "key") - so the binary carries kilobytes, not WeKan's 94 MB.
|
Command sync-i18n copies WeKan's translations into web/i18n: for every language, only the keys the Go WeKan uses - the pages' `t $.L "key"` and the code's s.tr(lang, "key") - so the binary carries kilobytes, not WeKan's 94 MB. |
|
Package web is WeKan written in Go, running inside Caddy: Weddy's WeKan.
|
Package web is WeKan written in Go, running inside Caddy: Weddy's WeKan. |