Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backup-domain.pl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ package virtual_server;
}
elsif ($a eq "--feature") {
local $f = shift(@ARGV);
if (&indexof($f, @retired_features) >= 0) {
Comment thread
jcameron marked this conversation as resolved.
Outdated
push(@bfeats, $f);
next;
}
$f eq "virtualmin" || $config{$f} ||
&indexof($f, &list_backup_plugins()) >= 0 ||
&usage("Feature $f is not enabled on this system");
Expand Down
1 change: 1 addition & 0 deletions backup.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ else {
@do_features = split(/\0/, $in{'feature'});
}
@do_features || &error($text{'backup_efeatures'});
@do_features = grep { &indexof($_, @retired_features) < 0 } @do_features;

# Parse destinations
for($i=0; defined($in{"dest".$i."_mode"}); $i++) {
Expand Down
3 changes: 1 addition & 2 deletions backup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ package virtual_server;
else {
@do_features = split(/\s+/, $sched->{'features'});
}
@do_features = grep { &indexof($_, @retired_features) < 0 } @do_features;
foreach $f (@do_features) {
$options{$f} = { map { split(/=/, $_) }
split(/,/, $sched->{'backup_opts_'.$f}) };
Expand Down Expand Up @@ -387,5 +388,3 @@ sub usage
print " [--force-email]\n";
exit(1);
}


1 change: 1 addition & 0 deletions backups-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3738,6 +3738,7 @@ sub missing_restore_features
local @rv;
foreach my $f (@allfeatures) {
next if ($f eq 'virtualmin');
next if (&indexof($f, @retired_features) >= 0);
if (&indexof($f, @features) >= 0) {
if (!$config{$f}) {
# Missing feature
Expand Down
5 changes: 1 addition & 4 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mail=1
web=1
dns=1
mysql=1
ftp=0
webalizer=0
iface=
shell=/dev/null
Expand Down Expand Up @@ -39,7 +38,6 @@ udisplay_max=
postgres=0
avail_change-user=1
apache_config=ServerName ${DOM} ServerAlias www.${DOM} ServerAlias mail.${DOM} DocumentRoot ${HOME}/public_html ErrorLog /var/log/virtualmin/${DOM}_error_log CustomLog /var/log/virtualmin/${DOM}_access_log combined ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/ DirectoryIndex index.php index.htm index.html <Directory ${HOME}/public_html> Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch Require all granted AllowOverride All </Directory> <Directory ${HOME}/cgi-bin> Require all granted AllowOverride All </Directory>
proftpd_config=ServerName ${DOM} ServerAlias ftp.${DOM} <Anonymous ${HOME}/ftp> User ftp Group ftp UserAlias anonymous ftp <Limit WRITE> DenyAll </Limit> RequireValidShell off ExtendedLog ${HOME}/logs/ftp.log </Anonymous>
domain_template=none
subdomain_template=none
user_template=none
Expand All @@ -49,7 +47,7 @@ reseller_template=none
edit_afiles=1
edit_homes=0
alias_types=1,2,5,6,7,8,9,10,11,12,13
disable=unix,mail,web,dns,mysql,postgres,ftp
disable=unix,mail,web,dns,mysql,postgres
webmin_theme=*
leave_acl=0
hard_quotas=1
Expand Down Expand Up @@ -201,7 +199,6 @@ reseller_unix=0
dovecot_ssl=1
postfix_ssl=1
mysql_ssl=1
proftpd_ssl=1
cert_type=sha2
gzip_mysql=1
show_preview=2
Expand Down
5 changes: 1 addition & 4 deletions config-freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mail=1
web=1
dns=1
mysql=1
ftp=0
webalizer=0
iface=
shell=/dev/null
Expand Down Expand Up @@ -39,7 +38,6 @@ udisplay_max=
postgres=0
avail_change-user=1
apache_config=ServerName ${DOM} ServerAlias www.${DOM} ServerAlias mail.${DOM} DocumentRoot ${HOME}/public_html ErrorLog /var/log/virtualmin/${DOM}_error_log CustomLog /var/log/virtualmin/${DOM}_access_log combined ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/ DirectoryIndex index.php index.htm index.html <Directory ${HOME}/public_html> Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch Require all granted AllowOverride All </Directory> <Directory ${HOME}/cgi-bin> Require all granted AllowOverride All </Directory>
proftpd_config=ServerName ${DOM} ServerAlias ftp.${DOM} <Anonymous ${HOME}/ftp> User nobody Group nogroup UserAlias anonymous nobody <Limit WRITE> DenyAll </Limit> RequireValidShell off ExtendedLog ${HOME}/logs/ftp.log </Anonymous>
domain_template=none
subdomain_template=none
user_template=none
Expand All @@ -49,7 +47,7 @@ reseller_template=none
edit_afiles=1
edit_homes=0
alias_types=1,2,5,6,7,8,9,10,11,12,13
disable=unix,mail,web,dns,mysql,postgres,ftp
disable=unix,mail,web,dns,mysql,postgres
webmin_theme=*
leave_acl=0
hard_quotas=1
Expand Down Expand Up @@ -201,7 +199,6 @@ reseller_unix=0
dovecot_ssl=1
postfix_ssl=1
mysql_ssl=1
proftpd_ssl=1
cert_type=sha2
gzip_mysql=1
show_preview=2
Expand Down
2 changes: 1 addition & 1 deletion config.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mail_system=Mail server to configure,4,0-Postfix,1-Sendmail,2-Qmail,3-Detect aut
generics=Also update outgoing addresses for mailboxes?,1,1-Yes,0-No
bccs=Allow automatic BCCing of outgoing email?,1,1-Yes,0-No
quotas=Set quotas for domain and mail users?,1,1-Yes (if enabled),0-No
disable=Features to deactivate when disabling,13,unix-Administration user (lock account),mail-Mail (lock mailboxes),web-Website (replace site with error page),dns-DNS (stop serving domain),mysql-MySQL (disallow login by MySQL user),postgres-PostgreSQL (disallow login by PostgreSQL user),ftp-ProFTPD (deny access)
disable=Features to deactivate when disabling,13,unix-Administration user (lock account),mail-Mail (lock mailboxes),web-Website (replace site with error page),dns-DNS (stop serving domain),mysql-MySQL (disallow login by MySQL user),postgres-PostgreSQL (disallow login by PostgreSQL user)
disable_mail=When disabling email,1,1-Just lock mailboxes,0-Lock mailboxes and stop accepting email
ldap=Store users and groups,1,1-In LDAP database,0-In local files
preload_mode=Preload Virtualmin libraries at startup?,1,2-All libraries,1-Only core,0-No
Expand Down
59 changes: 21 additions & 38 deletions copycert-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ sub list_service_ssl_cert_types
'virt' => 1,
'short' => 'p' });
}
if ($config{'ftp'} || &foreign_installed("proftpd")) {
if (&has_proftpd_support()) {
push(@rv, {'id' => 'proftpd',
'dom' => 0,
'virt' => 1,
'virt' => 0,
'short' => 'f' });
}
if ($config{'mysql'}) {
Expand Down Expand Up @@ -254,48 +254,26 @@ sub get_all_service_ssl_certs
}
}

if ($config{'ftp'} || &foreign_installed("proftpd")) {
# Check ProFTPd per-IP certificate
my $proftpd_conf;
if (&has_proftpd_support()) {
# Check ProFTPd global certificate
&foreign_require("proftpd");
my $conf = &proftpd::get_config();
if ($perip) {
my ($virt, $vconf) = &get_proftpd_virtual($d);
if ($virt) {
my $cfile = &proftpd::find_directive(
"TLSRSACertificateFile", $vconf);
$cfile ||= &proftpd::find_directive(
"TLSECCertificateFile", $vconf);
my $kfile = &proftpd::find_directive(
"TLSRSACertificateKeyFile", $vconf);
$kfile ||= &proftpd::find_directive(
"TLSECCertificateKeyFile", $vconf);
my $cafile = &proftpd::find_directive(
"TLSCACertificateFile", $vconf);
if ($cfile) {
push(@svcs, { 'id' => 'proftpd',
'cert' => $cfile,
'key' => $kfile,
'ca' => $cafile,
'prefix' => 'ftp',
'port' => 990,
'ip' => $d->{'ip'},
'd' => $d,
});
}
}
$proftpd_conf = eval { &proftpd::get_config() };
if ($@ || !ref($proftpd_conf)) {
$proftpd_conf = undef;
}

# Check ProFTPd global certificate
}
if ($proftpd_conf) {
my $cfile = &proftpd::find_directive(
"TLSRSACertificateFile", $conf);
"TLSRSACertificateFile", $proftpd_conf);
$cfile ||= &proftpd::find_directive(
"TLSECCertificateFile", $conf);
"TLSECCertificateFile", $proftpd_conf);
my $kfile = &proftpd::find_directive(
"TLSRSACertificateKeyFile", $conf);
"TLSRSACertificateKeyFile", $proftpd_conf);
$kfile ||= &proftpd::find_directive(
"TLSECCertificateKeyFile", $conf);
"TLSECCertificateKeyFile", $proftpd_conf);
my $cafile = &proftpd::find_directive(
"TLSCACertificateFile", $conf);
"TLSCACertificateFile", $proftpd_conf);
if ($cfile) {
push(@svcs, { 'id' => 'proftpd',
'cert' => $cfile,
Expand Down Expand Up @@ -702,9 +680,14 @@ sub copy_proftpd_ssl_service
my ($d) = @_;

# Get the ProFTPd config and cert files
&has_proftpd_support() || &error($text{'copycert_eproftpd'});
&foreign_require("proftpd");
&proftpd::lock_proftpd_files();
my $conf = &proftpd::get_config();
my $conf = eval { &proftpd::get_config() };
Comment thread
jcameron marked this conversation as resolved.
Outdated
if ($@ || !ref($conf)) {
&proftpd::unlock_proftpd_files();
&error($text{'copycert_eproftpd'});
}
my $cfile = &proftpd::find_directive("TLSRSACertificateFile", $conf);
$cfile ||= &proftpd::find_directive("TLSECCertificateFile", $conf);
my $kfile = &proftpd::find_directive("TLSRSACertificateKeyFile", $conf);
Expand Down
5 changes: 4 additions & 1 deletion create-scheduled-backup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ package virtual_server;
}
elsif ($a eq "--feature") {
local $f = shift(@ARGV);
if (&indexof($f, @retired_features) >= 0) {
push(@bfeats, $f);
next;
}
$f eq "virtualmin" || $config{$f} ||
&indexof($f, &list_backup_plugins()) >= 0 ||
&usage("Feature $f is not enabled on this system");
Expand Down Expand Up @@ -437,4 +441,3 @@ sub usage
print "Multiple destinations can be given by repeating this flag.\n";
exit(1);
}

3 changes: 1 addition & 2 deletions edit_newbw.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ print &ui_table_row(&hlink($text{'newbw_servers'}, "bandwidth_serversmode"),
[ &list_visible_domains() ]));

# Log files for FTP and mail
$defftplog = $config{'ftp'} ? &get_proftpd_log() : undef;
$defftplog = &get_proftpd_log();
print &ui_table_row(&hlink($text{'newbw_ftplog'}, "bandwidth_ftplog_def"),
&ui_opt_textbox("ftplog", $config{'bw_ftplog'}, 40,
$defftplog ? &text('newbw_ftplogdef', "<tt>$defftplog</tt>")."<br>"
Expand Down Expand Up @@ -175,4 +175,3 @@ if ($config{'bw_active'} && $virtualmin_pro) {
print &ui_buttons_end();

&ui_print_footer("", $text{'index_return'});

4 changes: 2 additions & 2 deletions edit_user.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ elsif ($user_type eq 'ftp') {
$user = &create_initial_user($d, undef, 1);

# FTP user in a sub-server .. check if FTP restrictions are active
if ($user->{'webowner'} && $d->{'parent'} && $config{'ftp'}) {
if ($user->{'webowner'} && $d->{'parent'} && &has_ftp_chroot()) {
my @chroots = &list_ftp_chroots();
my ($home) = grep { $_->{'dir'} eq '~' } @chroots;
if (!$home) {
Expand Down Expand Up @@ -617,7 +617,7 @@ else {
}

# FTP user in a sub-server .. check if FTP restrictions are active
if ($user->{'webowner'} && $d->{'parent'} && $config{'ftp'}) {
if ($user->{'webowner'} && $d->{'parent'} && &has_ftp_chroot()) {
my @chroots = &list_ftp_chroots();
my ($home) = grep { $_->{'dir'} eq '~' } @chroots;
if (!$home) {
Expand Down
Loading