config

package
v0.0.0-...-c4d1a2a Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControlList

type AccessControlList struct {
	Name             string
	AddToEveryAction bool
	MatchUsergroups  []string
	MatchUsernames   []string
	Permissions      PermissionsList
}

AccessControlList defines what permissions apply to a user or user group.

type Action

type Action struct {
	ID                     string
	Title                  string
	Icon                   string
	Shell                  string
	ShellAfterCompleted    string
	Timeout                int
	Acls                   []string
	Entity                 string
	Hidden                 bool
	ExecOnStartup          bool
	ExecOnCron             []string
	ExecOnFileCreatedInDir []string
	ExecOnFileChangedInDir []string
	ExecOnCalendarFile     string
	Trigger                string
	MaxConcurrent          int
	Arguments              []ActionArgument
	PopupOnStart           string
}

Action represents the core functionality of OliveTin - commands that show up as buttons in the UI.

func (*Action) FindArg

func (action *Action) FindArg(name string) *ActionArgument

FindArg will return an arg if there is a match on Name

type ActionArgument

type ActionArgument struct {
	Name        string
	Title       string
	Description string
	Type        string
	Default     string
	Choices     []ActionArgumentChoice
	Entity      string
	Suggestions map[string]string
}

ActionArgument objects appear on Actions.

type ActionArgumentChoice

type ActionArgumentChoice struct {
	Value string
	Title string
}

ActionArgumentChoice represents a predefined choice for an argument.

type Config

type Config struct {
	UseSingleHTTPFrontend           bool
	ThemeName                       string
	ListenAddressSingleHTTPFrontend string
	ListenAddressWebUI              string
	ListenAddressRestActions        string
	ListenAddressGrpcActions        string
	ExternalRestAddress             string
	LogLevel                        string
	Actions                         []*Action             `mapstructure:"actions"`
	Entities                        []*EntityFile         `mapstructure:"entities"`
	Dashboards                      []*DashboardComponent `mapstructure:"dashboards"`
	CheckForUpdates                 bool
	PageTitle                       string
	ShowFooter                      bool
	ShowNavigation                  bool
	ShowNewVersions                 bool
	AuthJwtCookieName               string
	AuthJwtSecret                   string // mutually exclusive with pub key config fields
	AuthJwtClaimUsername            string
	AuthJwtClaimUserGroup           string
	AuthJwtPubKeyPath               string // will read pub key from file on disk
	AuthHttpHeaderUsername          string
	AuthHttpHeaderUserGroup         string
	DefaultPermissions              PermissionsList
	AccessControlLists              []*AccessControlList
	WebUIDir                        string
	CronSupportForSeconds           bool
	SectionNavigationStyle          string
	DefaultPopupOnStart             string
	InsecureAllowDumpVars           bool
	InsecureAllowDumpSos            bool
	InsecureAllowDumpActionMap      bool
}

Config is the global config used through the whole app.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig gets a new Config structure with sensible default values.

func (*Config) FindAcl

func (cfg *Config) FindAcl(aclTitle string) *AccessControlList

func (*Config) FindAction

func (cfg *Config) FindAction(actionTitle string) *Action

FindAction will return a action if there is a match on Title

func (*Config) Sanitize

func (cfg *Config) Sanitize()

Sanitize will look for common configuration issues, and fix them. For example, populating undefined fields - name -> title, etc.

type DashboardComponent

type DashboardComponent struct {
	Title    string
	Type     string
	Entity   string
	Contents []DashboardComponent
}

type EntityFile

type EntityFile struct {
	File string
	Name string
	Icon string
}

Entity represents a "thing" that can have multiple actions associated with it. for example, a media player with a start and stop action.

type PermissionsList

type PermissionsList struct {
	View bool
	Exec bool
}

PermissionsList defines what users can do with an action.

Jump to

Keyboard shortcuts

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