Marius Burkard
2016-05-04 c3189ce6c7301c3ec17878fd3918f31d0d3cb18a
install/lib/installer_base.lib.php
@@ -172,9 +172,9 @@
      if(is_installed('squid')) $conf['squid']['installed'] = true;
      if(is_installed('nginx')) $conf['nginx']['installed'] = true;
      if(is_installed('iptables') && is_installed('ufw')) $conf['ufw']['installed'] = true;
      if(is_installed('iptables') && is_installed('bastille-netfilter')) $conf['firewall']['installed'] = true;
      if(is_installed('fail2ban-server')) $conf['fail2ban']['installed'] = true;
      if(is_installed('vzctl')) $conf['openvz']['installed'] = true;
      if(is_installed('iptables') && is_installed('bastille-netfilter')) $conf['bastille']['installed'] = true;
      if(is_installed('metronome') && is_installed('metronomectl')) $conf['xmpp']['installed'] = true;
      if(is_installed('spamassassin')) $conf['spamassassin']['installed'] = true;
      if(is_installed('vlogger')) $conf['vlogger']['installed'] = true;
@@ -185,7 +185,11 @@
    public function force_configure_app($service, $enable_force=true) {
      $force = false;
        swriteln("[WARN] autodetect for $service failed");
      if($enable_force == true) {
         swriteln("[WARN] autodetect for $service failed");
      } else {
         swriteln("[INFO] service $service not detected");
      }
      if($enable_force) {
           if(strtolower($this->simple_query("Force configure $service", array('y', 'n'), 'n') ) == 'y') {
               $force = true;
@@ -654,6 +658,15 @@
            if(!$this->dbmaster->query($query, $value['db'] . '.mail_backup', $value['user'], $host)) {
               $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
            }
            $query = "GRANT SELECT, UPDATE(`dnssec_initialized`, `dnssec_info`, `dnssec_last_signed`) ON ?? TO ?@?";
            if ($verbose){
               echo $query ."\n";
            }
            if(!$this->dbmaster->query($query, $value['db'] . '.dns_soa', $value['user'], $host)) {
               $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
            }
         }
      }
@@ -1617,7 +1630,7 @@
        caselog('chmod u+x /etc/init.d/metronome', __FILE__, __LINE__);
        caselog('update-rc.d metronome defaults', __FILE__, __LINE__);
        exec($this->getinitcommand('xmpp', 'restart'));
        exec($this->getinitcommand($conf['xmpp']['init_script'], 'restart'));
/*
writing new private key to 'smtpd.key'
@@ -1829,12 +1842,14 @@
   public function configure_ufw_firewall()
   {
      $configfile = 'ufw.conf';
      if(is_file('/etc/ufw/ufw.conf')) copy('/etc/ufw/ufw.conf', '/etc/ufw/ufw.conf~');
      $content = rf("tpl/".$configfile.".master");
      wf('/etc/ufw/ufw.conf', $content);
      exec('chmod 600 /etc/ufw/ufw.conf');
      exec('chown root:root /etc/ufw/ufw.conf');
      if($this->is_update == false) {
         $configfile = 'ufw.conf';
         if(is_file('/etc/ufw/ufw.conf')) copy('/etc/ufw/ufw.conf', '/etc/ufw/ufw.conf~');
         $content = rf("tpl/".$configfile.".master");
         wf('/etc/ufw/ufw.conf', $content);
         exec('chmod 600 /etc/ufw/ufw.conf');
         exec('chown root:root /etc/ufw/ufw.conf');
      }
   }
   public function configure_bastille_firewall() {