config

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestName     = "Jane Done"
	TestEmail    = "jane@example.com"
	TestPassword = "1234"
)

Variables

This section is empty.

Functions

func ConfigCMD

func ConfigCMD() *cli.Command

func GetAgeSecret

func GetAgeSecret(ctx context.Context) *age.X25519Identity

func GetSecuritySecret

func GetSecuritySecret(ctx context.Context) ed25519.PrivateKey

func Load

func Load(base *Options) (context.Context, error)

Types

type Options

type Options struct {
	Listen string
	URL    string
	Mailer struct {
		Enabled       bool
		Name, Address string
		SMTP          struct {
			Address       string
			AuthAnonymous struct {
				Enabled bool
				Trace   string
			}

			AuthOAUTHBearer struct {
				Enabled               bool
				Username, Token, Host string
				Port                  int
			}
			AuthPlain struct {
				Enabled                      bool
				Identity, Username, Password string
			}
			EnableMailHog bool
		}
	}
	DataPath string
	LogLevel string
	Secrets  struct {
		Age, Secret string
	}
	Cors struct {
		Origin                string
		Credentials           bool
		MaxAge                int
		Headers               []string
		Expose                []string
		Methods               []string
		SendPreflightResponse bool
	}
	SuperUserId []uint64
	Firewall    struct {
		Enabled bool
		BlockIP []string
		AllowIP []string
	}
	Intervals struct {
		SiteCache, TSSync time.Duration
	}
	Backup struct {
		Enabled bool
		Dir     string
	}
	Acme struct {
		Enabled         bool
		Domain          string
		CertsPath       string
		Issuer          certmagic.ACMEIssuer
		ExternalAccount acme.EAB
	}
	TLS struct {
		Enabled            bool
		Address, Key, Cert string
	}
	Bootstrap struct {
		Enabled                    bool
		Name, Email, Password, Key string
	}
	Alerts struct {
		Enabled bool
		Source  string
	}
	EnableProfile bool
	// If true don't listen on os.Interrupt signal.
	NoSignal bool
}

func Get

func Get(ctx context.Context) *Options

func Test added in v0.0.10

func Test(fn ...func(*Options)) *Options

Test returns Options with initialized values. This rely only on env Variables for flags.

func (*Options) Flags

func (o *Options) Flags() []cli.Flag

func (*Options) IsSuperUser

func (o *Options) IsSuperUser(uid uint64) bool

func (*Options) Magic added in v0.0.11

func (o *Options) Magic() *certmagic.Config

Jump to

Keyboard shortcuts

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