Skip to content

installers.sysadmintools.daguserver #

daguserver

To get started




import freeflowuniverse.crystallib.installers.something. daguserver

mut installer:= daguserver.get()!

installer.start()!

example heroscript

!!daguserver.install
    homedir: '/home/user/daguserver'
    username: 'admin'
    password: 'secretpassword'
    title: 'Some Title'
    host: 'localhost'
    port: 8888

Constants #

const version = '1.14.3'

fn get #

fn get(args_ ArgsGet) !&DaguInstaller

fn heroscript_default #

fn heroscript_default() !string

fn play #

fn play(args_ PlayArgs) !

fn switch #

fn switch(name string)

switch instance to be used for daguserver

struct ArgsGet #

@[params]
struct ArgsGet {
pub mut:
	name string
}

///////FACTORY

struct DaguCommunicationConfig #

@[params]
struct DaguCommunicationConfig {
pub:
	log_dir                string // directory path to save logs from standard output
	history_retention_days int    // history retention days (default: 30)
	mail_on                MailOn // Email notification settings
	smtp                   SMTP   // SMTP server settings
	error_mail             Mail   // Error mail configuration
	info_mail              Mail   // Info mail configuration
}

struct DaguInstaller #

struct DaguInstaller {
pub mut:
	name string = 'default'

	dagsdir    string
	configpath string
	username   string
	password   string @[secret]
	secret     string @[secret]
	title      string
	host       string
	port       int
}

fn (DaguInstaller) comms_configure #

fn (mut self DaguInstaller) comms_configure(config DaguCommunicationConfig) !

fn (DaguInstaller) destroy #

fn (mut self DaguInstaller) destroy() !

fn (DaguInstaller) install #

fn (mut self DaguInstaller) install(args InstallArgs) !

fn (DaguInstaller) install_start #

fn (mut self DaguInstaller) install_start(args InstallArgs) !

fn (DaguInstaller) reload #

fn (mut self DaguInstaller) reload() !

load from disk and make sure is properly intialized

fn (DaguInstaller) restart #

fn (mut self DaguInstaller) restart() !

fn (DaguInstaller) running #

fn (mut self DaguInstaller) running() !bool

fn (DaguInstaller) start #

fn (mut self DaguInstaller) start() !

fn (DaguInstaller) stop #

fn (mut self DaguInstaller) stop() !

struct InstallArgs #

@[params]
struct InstallArgs {
pub mut:
	reset bool
}

struct Mail #

struct Mail {
pub:
	from   string
	to     string
	prefix string
}

struct MailOn #

struct MailOn {
pub:
	failure bool
	success bool
}

struct PlayArgs #

@[params]
struct PlayArgs {
pub mut:
	heroscript string // if filled in then plbook will be made out of it
	plbook     ?playbook.PlayBook
	reset      bool
}

struct SMTP #

struct SMTP {
pub:
	host       string
	port       string
	username   string
	password   string
	error_mail Mail
}