config

package
v0.0.0-...-5b2cea3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cfg = Config{
	SiteName:       "Anniv",
	Description:    "",
	Listen:         ":8080",
	Enforce2FA:     false,
	TrustedProxies: []string{"127.0.0.1/32"},
	RepoURL:        "https://github.com/ProjectAnni/repo.git",
	RequireInvite:  false,
	InviteCode:     uuid.NewV4().String(),
	AnnilToken: []AnnilToken{
		{
			Enabled:    false,
			Name:       "Default Library",
			URL:        "",
			Credential: "",
			AllowShare: false,
		},
	},
	Debug: DebugConfig{
		Enabled:        false,
		MemProfilePath: "mem.prof",
	},
}

Functions

func Load

func Load() error

func Save

func Save() error

Types

type AnnilToken

type AnnilToken struct {
	Enabled      bool   `yaml:"enabled"`
	Name         string `yaml:"name"`
	URL          string `yaml:"url"`
	AdminBaseURL string `yaml:"admin_base_url,omitempty"`
	Credential   string `yaml:"credential"`
	AllowShare   bool   `yaml:"allow_share"`
}

type Config

type Config struct {
	SiteName       string            `yaml:"site_name"`
	Description    string            `yaml:"description"`
	Listen         string            `yaml:"listen"`
	Enforce2FA     bool              `yaml:"enforce_2fa"`
	Headers        map[string]string `yaml:"headers"`
	TrustedProxies []string          `yaml:"trusted_proxies"`
	RepoURL        string            `yaml:"repo_url"`
	RequireInvite  bool              `yaml:"require_invite"`
	InviteCode     string            `yaml:"invite_code"`
	AnnilToken     []AnnilToken      `yaml:"annil_token"`
	Debug          DebugConfig       `yaml:"debug"`
}

type DebugConfig

type DebugConfig struct {
	Enabled        bool   `yaml:"enabled"`
	MemProfilePath string `yaml:"mem_profile_path"`
}

Jump to

Keyboard shortcuts

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