Skip to content

installers.fediverse.mediacms #

fn build #

fn build(args BuildArgs) !

install mediacms will return true if it was already installed

fn get #

fn get(name_ string) !Server

fn install #

fn install(args Config) !

fn new #

fn new(args_ Config) !Server

get the mediacms server

 name        string = 'default'
 path        string = '/data/mediacms'
 passwd      string

if name exists already in the config DB, it will load for that name

struct BuildArgs #

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

struct Config #

@[params]
struct Config {
pub mut:
	name            string = 'default'
	reset           bool
	path            string = '/data/mediacms'
	passwd          string @[required]
	postgresql_name string = 'default'
	domain          string @[required]
	title           string
	reset           bool
	timezone        string = 'Africa/Kinshasa'
	mail_from       string @[required]
	smtp_addr       string @[required]
	smtp_login      string @[required]
	smpt_port       int = 587
	smtp_passwd     string @[required]
}

struct Server #

struct Server {
pub mut:
	name        string
	config      Config
	process     ?zinit.ZProcess
	path_config pathlib.Path
}

fn (Server) status #

fn (mut server Server) status() zinit.ZProcessStatus

return status

pub enum ZProcessStatus {
    unknown
    init
    ok
    error
    blocked
    spawned
}

fn (Server) start #

fn (mut server Server) start() !

run mediacms as docker compose

fn (Server) restart #

fn (mut server Server) restart() !

fn (Server) stop #

fn (mut server Server) stop() !

fn (Server) check #

fn (mut server Server) check() !

check health, return true if ok

fn (Server) ok #

fn (mut server Server) ok() bool

check health, return true if ok

fn (Server) destroy #

fn (mut server Server) destroy() !

remove all data

struct UserAddArgs #

@[params]
struct UserAddArgs {
pub mut:
	name   string @[required]
	passwd string @[required]
	admin  bool
}