Compare commits

..

6 Commits

6 changed files with 51 additions and 16 deletions

View File

@ -275,7 +275,6 @@ files:
reports:
"LOADER: $(def.wmde_lib)/scripts/dovecot/rspamd-learn-ham.sieve.mustache";

7
php.cf
View File

@ -80,19 +80,17 @@ vars:
"pkgs" slist => {
"php$(xversion)-cli",
"php$(xversion)-common",
"php$(xversion)-pecl-zip",
"php$(xversion)-pgsql",
"php$(xversion)-mysqlnd",
"php$(xversion)-xml",
"php$(xversion)-gd",
"php$(xversion)-mbstring",
"php$(xversion)-intl",
"php$(xversion)-pecl-imagick-im6",
"php$(xversion)-ldap",
"php$(xversion)-pecl-imagick-im6",
"php-pecl-json-post",
"php-pecl-apcu",
"php-pecl-zip",
};
@ -290,8 +288,9 @@ commands:
handle => "php_composer_installer_downloaded",
depends_on => {"php_dir_created"};
"$(php.cli_exe) $(installer) --install-dir=/usr/local/bin --filename=composer"
"export HOME=/root && $(php.cli_exe) $(installer) --install-dir=/usr/local/bin --filename=composer"
handle => "php_composer_installed",
contain => wmde_cmd_useshell,
depends_on => {"php_composer_installer_downloaded"};

View File

@ -8,6 +8,14 @@ classes:
"runpw" expression => isvariable("cfg[password]");
vars:
"tpl_deps" slist => { "rspamd_pkgs_installed","rspamd_cfg_dir_created" };
runpw::
"tpl_deps" slist => { "rspamd_pkgs_installed","rspamd_cfg_dir_created","rspamd_password_ready" };
any::
"cfgfiles" slist => {
"local.d/milter_headers.conf",
# "local.d/actions.conf",
@ -44,11 +52,32 @@ vars:
"root_group" string => "root";
"rspamadm" string => "/usr//bin/rspamadm";
any::
"password" string => execresult("$(rspamadm) pw -p $(cfg[password])","noshell");
runpw::
"password" string => readfile("$(sys.workdir)/data/agent/rspamd/password-hash.txt"),
handle => "rspamd_password_ready",
depends_on => {"rspamd_password_hash_created"};
files:
runpw::
"$(sys.workdir)/data/agent/rspamd/password.txt"
create => "true",
content => "$(cfg[password])",
handle => "rspamd_password_created",
classes => if_repaired("rspamd_password_repaired");
rspamd_password_repaired::
"$(sys.workdir)/data/agent/rspamd/password-hash.txt"
content => execresult("$(rspamadm) pw -p $(cfg[password])","noshell"),
depends_on => {"rspamd_password_created"},
handle => "rspamd_password_hash_created";
commands:
!rspamd_password_repaired::
"/usr/bin/true"
depends_on => {"rspamd_password_created"},
handle => "rspamd_password_hash_created",
inform => "false";
methods:
"any" usebundle => install_rspamd_pkgs;
@ -67,16 +96,13 @@ files:
template_method => "mustache",
perms => m("644"),
template_data => bundlestate("$(this.bundle)"),
depends_on => { "rspamd_pkgs_installed","rspamd_cfg_dir_created" },
depends_on => @(tpl_deps),
classes => if_repaired(rspamd_repaired),
handle => "rspamd_cfgs_done";
reports:
# "RSPAMD: $(cfgjs)";
# "RSJ: $(worker_normalx)";
}

View File

@ -360,7 +360,9 @@ vars:
methods:
"any" usebundle => sympa_create_mailname(@(cfg));
"any" usebundle => wmde_install_packages(@(sympa.pkgs),"sympa");
#"any" usebundle => wmde_install_packages(@(sympa.pkgs),"sympa");
"any" usebundle => install_sympa_pkgs;
"any" usebundle => sympa_update_config(@(cfg));
"any" usebundle => sympa_init_db(@(cfg));
@ -379,7 +381,6 @@ methods:
"any" usebundle => install_sympa_domains(@(cfg[domains]),"$(cfg_dir)");
reports:
"ETC: $(cfg_dir) - $(cfg[settings][etc])";
}
@ -596,3 +597,11 @@ reports:
"SYMPA DOES NOT RUN BACKUP";
}
bundle agent install_sympa_pkgs
{
methods:
"any" usebundle => wmde_install_packages(@(sympa.pkgs),"sympa");
}

View File

@ -8,7 +8,7 @@ password_query = \
iterate_query = SELECT username AS user FROM mailbox
user_query = \
SELECT 'maildir:~/Maildir' as mail, '{{vars.dovecot_vimbadmin_sql.dovecot_cfg.vmail_dir}}/%d/%n' as home, 1003 as gid, 1003 as uid FROM mailbox WHERE username = '%u'
SELECT 'maildir:~/Maildir' as mail, '{{vars.dovecot_vimbadmin_sql.dovecot_cfg.vmail_dir}}/%d/%n' as home, {{vars.dovecot_vimbadmin_sql.dovecot_cfg.vmail_uid}} as gid, {{vars.dovecot_vimbadmin_sql.dovecot_cfg.vmail_gid}} as uid FROM mailbox WHERE username = '%u'

View File

@ -116,7 +116,7 @@ commands:
"/bin/sh"
# args => "-c 'cd $(cfg[install_dir]) && $(php_composer.exe) -q -n create-project --prefer-dist --no-dev opensolutions/vimbadmin'",
args => "-c 'cd $(cfg[install_dir]) && $(php_composer.exe) update -q --no-cache && $(php_composer.exe) install --no-cache -q --prefer-dist --no-dev",
args => "-c 'export HOME=$(cfg[install_dir]) && cd $(cfg[install_dir]) && $(php_composer.exe) update -q --no-cache && $(php_composer.exe) install --no-cache -q --prefer-dist --no-dev'",
handle => "vimbadmin_composed",
depends_on => {
"vimbadmin_pkgs_installed"
@ -160,4 +160,6 @@ body contain vimbadmin_cmd
exec_owner => "$(apache.www_user)";
exec_group => "$(apache.www_group)";
useshell=>"useshell";
}