Compare commits

..

No commits in common. "fb7878aa8f3bc349e49061440a1c46a317d3c19e" and "026f626dbe3f91e59e8cd5e02342f6a4c2078300" have entirely different histories.

5 changed files with 33 additions and 182 deletions

View File

@ -124,6 +124,15 @@ commands:
args => "certonly --agree-tos -n $(webroot_arg) --expand --email $(site[email]) $(args)";
reports:
# "CURRENT DOMAINS FOR $(site[domain]) : $(current_domains)";
# "EXEC IST: $(cert_test_cmd)";
# "IS '$(domains_txt)' == '$(current_domains_txt) ' ?";
# run_certbot_new::
# "WE MUST RUN CERTBOT FOR $(domains_txt)";
# !run_certbot_new::
# "WE SHOULD NOT RUN CERTBOT FOR $(domains_txt)";
}

71
lib.cf
View File

@ -288,74 +288,3 @@ methods:
reports:
}
bundle agent download_file(method,src,dst,cls,prms_arg)
{
vars:
"prms_default" data => '{
"m":"600",
"o":"$(sys.user_data[uid])",
"g":"$(sys.user_data[gid])"
}';
"prms" data => mergedata(@(prms_default),parsejson($(prms_arg)));
classes:
"$(method)";
wget::
"run_wget" expression => not(fileexists($(dst)));
files:
policyhub::
"$(dst)"
copy_from => remote_dcp("$(src)","$(sys.policy_hub)"),
classes => if_repaired("$(cls)_repaired"),
perms => mog ("$(prms[m])","$(prms[o])","$(prms[g])");
methods:
wget::
"any" usebundle => "install_wget", handle=>"wget_installed";
commands:
run_wget::
"$(wget.exe)"
args => "-q -O $(dst) $(src) || (rm -f $(dst) && /usr/bin/false) ",
contain => wmde_cmd_useshell,
handle => "$(cls)_downloaded",
classes => results("namespace","$(cls)"),
depends_on => {"wget_installed"},
inform => "true";
"/usr/bin/true"
depends_on => {"$(cls)_downloaded"},
classes => if_repaired("$(cls)_kept");
(!run_wget)&(wget)::
"/usr/bin/true"
classes => if_repaired("$(cls)_kept");
files:
"$(dst)"
perms => mog ("$(prms[m])","$(prms[o])","$(prms[g])"),
depends_on => {"$(cls)_downloaded"};
reports:
!run_wget::
"Not run wget";
run_wget::
"Run wget";
"$(cls)_repaired"::
"$(cls) repaired";
"!($(cls)_repaired)"::
"$(cls) not repaired";
"$(cls)_kept"::
"$(cls) kept";
"!($(cls)_kept)"::
"$(cls) not kept";
}

49
php.cf
View File

@ -21,26 +21,14 @@ vars:
"php$(php.bsdvs)-zip",
"php$(php.bsdvs)-pgsql",
"php$(php.bsdvs)-mysqli",
"php$(php.bsdvs)-pdo_mysql",
"php$(php.bsdvs)-pdo",
"php$(php.bsdvs)-filter",
"php$(php.bsdvs)-mbstring",
"php$(php.bsdvs)-dom",
"php$(php.bsdvs)-xml",
"php$(php.bsdvs)-ctype",
"php$(php.bsdvs)-intl",
"php$(php.bsdvs)-curl",
"php$(php.bsdvs)-fileinfo",
"php$(php.bsdvs)-exif",
"php$(php.bsdvs)-iconv",
"php$(php.bsdvs)-ldap",
"php$(php.bsdvs)-gd",
"php$(php.bsdvs)-pecl-imagick",
"php$(php.bsdvs)-pdo",
"php$(php.bsdvs)-pdo_sqlite",
"php$(php.bsdvs)-sqlite3",
"php$(php.bsdvs)-pdo_pgsql",
"php$(php.bsdvs)-pdo_mysql",
};
# "php$(bsdvs)-json",
@ -122,10 +110,7 @@ methods:
depends_on => {"php_repo_ready"};
commands:
freebsd::
"/usr/bin/true"
inform => "false",
handle => "php_repo_ready";
}
@ -186,7 +171,6 @@ vars:
"fpm_pkgs" slist => { "php$(version)-fpm" };
"fpm_service_name" string => "php$(version)-fpm";
"fpm_socket" string => "/run/php/php$(version)-fpm.sock";
"fpm_socket_type" string => "unix";
"apt_repo_url" string => "https://packages.sury.org/php/";
"apt_repo_key" string => "https://packages.sury.org/php/apt.gpg";
@ -206,18 +190,14 @@ vars:
freebsd::
"ini_files" slist => {
# "/etc/php/$(install_php.version)/apache2/php.ini",
# "/etc/php/$(install_php.version)/fpm/php.ini"
"/etc/php/$(install_php.version)/apache2/php.ini",
"/etc/php/$(install_php.version)/fpm/php.ini"
};
"cli_exe" string => "/usr/local/bin/php";
"version" string => "8.2";
"bsdvs" string => "82";
"apache_m" string => "php";
"apache_f" string => "libphp";
"fpm_pkgs" slist => {};
"fpm_service_name" string => "php-fpm";
"fpm_socket" string => "127.0.0.1:9000";
"fpm_socket_type" string => "inet";
centos::
"cli_exe" string => "/usr/bin/php";
@ -239,31 +219,22 @@ files:
#methods:
# "any" usebundle => install_php;
reports:
# "PHP VERSION: $(ini_files) V:$(install_php.version)";
"PHP VERSION: $(ini_files) V:$(install_php.version)";
}
bundle agent install_php_fpm
{
vars:
"service_deps" slist => {
"php_fpm_pkgs_installed",
"php_pkgs_installed"
};
freebsd::
"service_deps" slist => {
"php_pkgs_installed"
};
methods:
"any" usebundle => install_php;
"any" usebundle => wmde_install_packages(@(php.fpm_pkgs),"php_fpm");
"any" usebundle => wmde_service("$(php.fpm_service_name)","php_kept|php_fpm_kept","php_repaired|php_fpm_repaired"),
depends_on => @(service_deps);
reports:
# "php ????";
depends_on =>{
"php_fpm_pkgs_installed",
"php_pkgs_installed"
};
}

View File

@ -5,13 +5,12 @@
bundle agent roundcube(cfg)
{
classes:
"dlbyversion" expression => not (isvariable ("cfg[src_tgz]"));
"roundcube_untar" expression => not(fileexists("$(install_sub_dir)/index.php"));
"config_exists" expression => fileexists("$(install_sub_dir)/config/config.inc.php");
"roundcube_untar" expression => not(fileexists("$(cfg[install_sub_dir])/index.php"));
"config_exists" expression => fileexists("$(cfg[install_sub_dir])/config/config.inc.php");
"backup_config_exists" expression => fileexists("$(cfg[backup_dir])/config.inc.php");
@ -23,51 +22,21 @@ classes:
"sql_backup_exists" expression => fileexists("$(cfg[backup_dir])/roundcube.sql");
vars:
"dldir" string =>"$(sys.workdir)/data/agent/roundcube";
!(dlbyversion)::
"dlfile" string => "$(sys.workdir)/data/public/$(cfg[src_tgz])";
"dltype" string => "policyhub";
"dlsrc" string => "$(def.hub_public_dir)/$(cfg[src_tgz])";
"install_sub_dir" string => "$(cfg[install_sub_dir])";
dlbyversion::
"tgzname" string => "roundcubemail-$(cfg[version])-complete.tar.gz";
"dlfile" string => "$(dldir)/$(tgzname)";
"install_sub_dir" string => "$(cfg[install_dir])/roundcubemail-$(cfg[version])";
"dltype" string => "wget";
"dlsrc" string => "https://github.com/roundcube/roundcubemail/releases/download/$(cfg[version])/$(tgzname)";
reports:
dlbyversion::
"dl by version";
!dlbyversion::
"not dl by version";
"dlfile" string => "$(sys.workdir)/data/public/$(cfg[src_tgz])";
files:
"$(dldir)/."
create => "true",
handle => "roundcube_agent_dir_created";
"$(dlfile)"
copy_from => remote_dcp("$(def.hub_public_dir)/$(cfg[src_tgz])","$(sys.policy_hub)"),
handle => "roundcube_tgz_copied",
classes => if_repaired ("roundcube_untar"),
perms => m(644);
methods:
"any" usebundle => download_file("$(dltype)","$(dlsrc)","$(dlfile)","roundcube_tgz_file",'{}'),
handle => "roundcube_tgz_copied",
depends_on => {"roundcube_agent_dir_created"},
classes => if_repaired ("roundcube_untar");
# "$(dlfile)"
# copy_from => remote_dcp("$(def.hub_public_dir)/$(cfg[src_tgz])","$(sys.policy_hub)"),
# perms => m(644);
files:
"$(cfg[install_dir])/public"
link_from => ln_s("$(install_sub_dir)"),
link_from => ln_s("$(cfg[install_sub_dir])"),
move_obstructions => "true",
depends_on => {"roundcube_untarred"};
run_backups&(!config_exists)&backup_config_exists::
"$(install_sub_dir)/config/config.inc.php"
"$(cfg[install_sub_dir])/config/config.inc.php"
copy_from => local_cp("$(cfg[backup_dir])/config.inc.php"),
perms => m("644"),
classes => if_repaired("roundcube_config_repaired"),
@ -75,14 +44,14 @@ files:
run_backups&config_exists::
"$(cfg[backup_dir])/config.inc.php"
copy_from => local_dcp("$(install_sub_dir)/config/config.inc.php"),
copy_from => local_dcp("$(cfg[install_sub_dir])/config/config.inc.php"),
depends_on => {"roundcube_untarred"};
methods:
"any" usebundle => mysql_table_exists(@(cfg),"users");
config_exists|roundcube_configr_repaired::
"any" usebundle => rm_rf ("$(install_sub_dir)/installer");
"any" usebundle => rm_rf ("$(cfg[install_sub_dir])/installer");
commands:
roundcube_untar::
@ -125,22 +94,3 @@ reports:
# "ROUNDCUBE SHOULD RUN BACKUPS";
}
bundle agent download_roundcube(cfg)
{
vars:
"tgzname" string => "roundcubemail-$(cfg[version])-complete.tar.gz";
"dldir" string =>"$(sys.workdir)/data/agent/roundcube";
"dst" string => "$(dldir)/$(tgzname)";
files:
"$(dldir)/."
create => "true",
handle => "roundcube_agentdir_created";
methods:
"any" usebundle => download_file("wget",
"https://github.com/roundcube/roundcubemail/releases/download/$(cfg[version])/$(tgzname)",
"$(dst)","roundcube_tgz_file",'{}');
}

10
wget.cf
View File

@ -1,16 +1,8 @@
#
#
#
bundle agent wget
{
vars:
freebsd::
"pkgs" slist => {"wget","curl"};
centos::
"pkgs" slist => {"wget","tar","bzip2","xz","unzip"};
"pkgs" slist => {"wget","tar"};
"exe" string => "/usr/bin/wget";
freebsd::