k8_apps.biz.k8_nextcloud #
k8_nextcloud
To get started
import incubaid.herolib.installers.something.k8_nextcloud as k8_nextcloud_installer
heroscript:='
!!k8_nextcloud.configure name:'test'
password: '1234'
port: 7701
!!k8_nextcloud.start name:'test' reset:1
'
k8_nextcloud_installer.play(heroscript=heroscript)!
//or we can call the default and do a start with reset
//mut installer:= k8_nextcloud_installer.get()!
//installer.start(reset:true)!
example heroscript
!!k8_nextcloud.configure
homedir: '/home/user/k8_nextcloud'
username: 'admin'
password: 'secretpassword'
title: 'Some Title'
host: 'localhost'
port: 8888
Constants #
const version = '0.0.0'
fn delete #
fn delete(args ArgsGet) !
fn exists #
fn exists(args ArgsGet) !bool
does the config exists?
fn get #
fn get(args ArgsGet) !&NextcloudK8SInstaller
fn heroscript_loads #
fn heroscript_loads(heroscript string) !NextcloudK8SInstaller
///////////NORMALLY NO NEED TO TOUCH
fn installed #
fn installed() !bool
checks if a certain version or above is installed
fn list #
fn list(args ArgsList) ![]&NextcloudK8SInstaller
if fromdb set: load from filesystem, and not from mem, will also reset what is in mem
fn new #
fn new(args ArgsGet) !&NextcloudK8SInstaller
fn play #
fn play(mut plbook PlayBook) !
fn set #
fn set(o NextcloudK8SInstaller) !
register the config for the future
fn switch #
fn switch(name string)
switch instance to be used for k8_nextcloud
struct ArgsGet #
@[params]
struct ArgsGet {
pub mut:
name string = k8_nextcloud_default
fromdb bool // will load from filesystem
create bool // default will not create if not exist
}
///////FACTORY
struct ArgsList #
@[params]
struct ArgsList {
pub mut:
fromdb bool // will load from filesystem
}
struct InstallArgs #
@[params]
struct InstallArgs {
pub mut:
reset bool
}
struct NextcloudK8SInstaller #
@[heap]
struct NextcloudK8SInstaller {
pub mut:
name string = 'nextcloud'
// K8s integration
k8app ?core.K8App
// Storage configuration
nextcloud_storage_size string = '10Gi'
postgres_storage_size string = '10Gi'
// Admin credentials
admin_user string = 'admin'
admin_password string // Auto-generated if empty
// Database configuration
db_name string = 'nextcloud'
db_user string = 'ncuser'
db_password string // Auto-generated if empty
// Redis (no auth by default)
redis_host string = 'nextcloud-redis'
// OnlyOffice integration
onlyoffice_enabled bool = true
onlyoffice_jwt_secret string // Auto-generated if empty
// YAML output paths
secrets_path string = '/tmp/nextcloud/secrets.yaml'
postgres_path string = '/tmp/nextcloud/postgres.yaml'
redis_path string = '/tmp/nextcloud/redis.yaml'
tfgw_path string = '/tmp/nextcloud/tfgw.yaml'
nextcloud_path string = '/tmp/nextcloud/nextcloud.yaml'
onlyoffice_path string = '/tmp/nextcloud/onlyoffice.yaml'
// Internal
kube_client kubernetes.KubeClient @[skip]
}
fn (NextcloudK8SInstaller) destroy #
fn (mut self NextcloudK8SInstaller) destroy() !
fn (NextcloudK8SInstaller) install #
fn (mut self NextcloudK8SInstaller) install(args InstallArgs) !
fn (NextcloudK8SInstaller) reload #
fn (mut self NextcloudK8SInstaller) reload() !
load from disk and make sure is properly intialized