sintls

package
v0.0.0-...-b90a4bf Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AuthUserKey = "user"

"user" will be set on the gin context

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(db *pg.DB, isadmin bool) middleware.BasicAuthValidator

func LegoCleanup

func LegoCleanup(c echo.Context) error

func LegoPresent

func LegoPresent(c echo.Context) error

func OpenDB

func OpenDB(options *pg.Options, debug bool, initdb bool, runmigrations bool) (db *pg.DB, err error)

func UpdateDNSRecords

func UpdateDNSRecords(c echo.Context) error

Types

type Authorization

type Authorization struct {
	AuthorizationId uint64       `pg:"authorization_id,pk"`
	CreatedAt       time.Time    `pg:"created_at,notnull,default:now()"`
	UpdatedAt       time.Time    `pg:"updated_at,notnull,default:now()"`
	Name            string       `pg:"name,notnull,unique"`
	Secret          string       `pg:"secret,notnull"`
	Admin           sql.NullBool `pg:"admin,notnull,default:false"`
	// contains filtered or unexported fields
}

func (*Authorization) CanUseHost

func (a *Authorization) CanUseHost(db *pg.DB, host string) bool

func (*Authorization) CreateOrUpdateHost

func (a *Authorization) CreateOrUpdateHost(
	db *pg.Tx, fqdn string,
	target_a, target_aaaa net.IP, target_cname string, target_mx string) error

func (Authorization) String

func (a Authorization) String() string

type Host

type Host struct {
	HostId         uint64     `pg:"host_id,pk"`
	CreatedAt      time.Time  `pg:"created_at,notnull,default:now()"`
	UpdatedAt      time.Time  `pg:"updated_at,notnull,default:now()"`
	SubDomain      *SubDomain `pg:"rel:has-one"`
	SubDomainId    uint64     `pg:"subdomain_id,notnull,on_delete:CASCADE"`
	Name           string     `pg:"name,notnull"`
	DnsTargetA     net.IP     `pg:"dns_target_a"`
	DnsTargetAAAA  net.IP     `pg:"dns_target_aaaa"`
	DnsTargetCNAME string     `pg:"dns_target_cname"`
	DnsTargetMX    string     `pg:"dns_target_mx"`
	// contains filtered or unexported fields
}

type LegoMessage

type LegoMessage struct {
	Domain      string `json:"domain"`
	Token       string `json:"token"`
	KeyAuth     string `json:"keyAuth"`
	TargetA     net.IP `json:"dnstarget_a,omitempty"`
	TargetAAAA  net.IP `json:"dnstarget_aaaa,omitempty"`
	TargetCNAME string `json:"dnstarget_cname,omitempty"`
	TargetMX    string `json:"dnstarget_mx,omitempty"`
}

Lego httpreq RAW request

type SubDomain

type SubDomain struct {
	SubDomainId     uint64         `pg:"subdomain_id,pk"`
	CreatedAt       time.Time      `pg:"created_at,notnull,default:now()"`
	UpdatedAt       time.Time      `pg:"updated_at,notnull,default:now()"`
	Authorization   *Authorization `pg:"rel:has-one"`
	AuthorizationId uint64         `pg:"authorization_id,notnull,on_delete:CASCADE"`
	Name            string         `pg:"name,notnull,unique"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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