servers

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBodySize = 1024 * 1024

Variables

This section is empty.

Functions

func NewApiServer

func NewApiServer(listen string, db *database.Queries, signer *mjwt.KeyStore, domains oUtils.DomainChecker) *http.Server

NewApiServer creates and runs a http server containing all the API endpoints for the software

`/cert` - edit certificate

Types

type AuthCallback

type AuthCallback func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims)

type CertAuthCallback

type CertAuthCallback func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims, certId int64)

type Certificate added in v0.0.5

type Certificate struct {
	Id         int64           `json:"id"`
	Name       string          `json:"name"`
	Authority  types.Authority `json:"authority"`
	AutoRenew  bool            `json:"auto_renew"`
	Active     bool            `json:"active"`
	Renewing   bool            `json:"renewing"`
	RenewRetry nulls.Time      `json:"renew_retry"`
	NotAfter   time.Time       `json:"not_after"`
	UpdatedAt  time.Time       `json:"updated_at"`
	Domains    []string        `json:"domains"`
	Addresses  []netip.Addr    `json:"addresses"`
	Subject    Subject         `json:"subject"`
}

type DomainStateValue

type DomainStateValue struct {
	Domain string `json:"domain"`
	State  int    `json:"state"`
}

type PatchCertOptions added in v0.0.7

type PatchCertOptions struct {
	AutoRenew nulls.Bool `json:"auto_renew"`
}

type PostCertOptions added in v0.0.7

type PostCertOptions struct {
	Name      string          `json:"name"`
	Authority types.Authority `json:"authority"`
	AutoRenew bool            `json:"auto_renew"`
	Subject   Subject         `json:"subject"`
	Domains   []string        `json:"domains"`
	Addresses []netip.Addr    `json:"addresses"`
}

type Subject added in v0.0.7

type Subject struct {
	CommonName string `json:"common_name"` // CN - 2.5.4.3
	Country    string `json:"country"`     // C - 2.5.4.6
	Org        string `json:"org"`         // O - 2.5.4.10
	OrgUnit    string `json:"org_unit"`    // OU - 2.5.4.11
	Locality   string `json:"locality"`    // L - 2.5.4.7
	Province   string `json:"province"`    // ST - 2.5.4.8
}

func (Subject) Validate added in v0.0.7

func (s Subject) Validate() error

Jump to

Keyboard shortcuts

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