Merge remote-tracking branch 'upstream/master' into pu
This commit is contained in:
		
						commit
						4ac10979c7
					
				|  | @ -13,7 +13,7 @@ if(isset($L_ALTERNC_LOGS_ARCHIVE)) | |||
| define('ALTERNC_LOGS',     "$L_ALTERNC_LOGS"); | ||||
| define('ALTERNC_PANEL',    "/usr/share/alternc/panel"); | ||||
| define('ALTERNC_LOCALES',  ALTERNC_PANEL."/locales"); | ||||
| define('ALTERNC_LOCK_JOBS', '/var/run/alternc/jobs-lock'); | ||||
| define('ALTERNC_LOCK_JOBS', '/run/alternc/jobs-lock'); | ||||
| define('ALTERNC_LOCK_PANEL', '/var/lib/alternc/panel/nologin.lock'); | ||||
| 
 | ||||
| /* PHPLIB inclusions : */ | ||||
|  |  | |||
|  | @ -87,7 +87,7 @@ if (isset($L_ALTERNC_LOGS_ARCHIVE)) { | |||
| define('ALTERNC_LOGS', "$L_ALTERNC_LOGS"); | ||||
| define('ALTERNC_PANEL', "/usr/share/alternc/panel"); | ||||
| define('ALTERNC_LOCALES', ALTERNC_PANEL . "/locales"); | ||||
| define('ALTERNC_LOCK_JOBS', '/var/run/alternc/jobs-lock'); | ||||
| define('ALTERNC_LOCK_JOBS', '/run/alternc/jobs-lock'); | ||||
| define('ALTERNC_LOCK_PANEL', '/var/lib/alternc/panel/nologin.lock'); | ||||
| define('ALTERNC_APACHE2_GEN_TMPL_DIR', '/etc/alternc/templates/apache2/'); | ||||
| define('ALTERNC_VHOST_DIR', "/var/lib/alternc/apache-vhost/"); | ||||
|  |  | |||
|  | @ -63,7 +63,7 @@ class DB_Sql { | |||
|         $dsn = sprintf('mysql:dbname=%s;host=%s', $db, $host); | ||||
| 
 | ||||
|         $options=array( | ||||
|             \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION | ||||
| //            \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
 | ||||
|         ); | ||||
|         try { | ||||
|             $this->pdo_instance = new PDO($dsn, $user, $passwd, $options); | ||||
|  |  | |||
|  | @ -139,7 +139,7 @@ function get_remote_ip() { | |||
| /** | ||||
|  * Check that $url is a correct url (http:// or https:// or ftp://)  | ||||
|  *  | ||||
|  * @param type $url | ||||
| 1 * @param type $url | ||||
|  * @return boolean | ||||
|  */ | ||||
| function checkurl($url) { | ||||
|  | @ -1221,11 +1221,11 @@ function _sha512cr($password, $salt = NULL) { | |||
|         else if (function_exists('mcrypt_create_iv')) { | ||||
|             $salt = base64_encode(mcrypt_create_iv(12, MCRYPT_DEV_URANDOM)); | ||||
|         } | ||||
|         else if (function_exists('')) { | ||||
|         else if (function_exists('openssl_random_pseudo_bytes')) { | ||||
|             $salt  = base64_encode(openssl_random_pseudo_bytes(12)); | ||||
|         } | ||||
|         if (!$salt) { | ||||
|             throw Error('Unable to generate salt'); | ||||
|             throw Exception('Unable to generate salt'); | ||||
|         } | ||||
|     } | ||||
|     $salt = '$6$rounds=20000$' . $salt; | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ | |||
|   ---------------------------------------------------------------------- | ||||
| */ | ||||
| 
 | ||||
| define('SLAVE_FLAG', "/var/run/alternc/refresh_slave"); | ||||
| define('SLAVE_FLAG', "/run/alternc/refresh_slave"); | ||||
| 
 | ||||
| /** | ||||
|  * Classe de gestion des domaines de l'hébergé. | ||||
|  | @ -54,7 +54,7 @@ class m_dom { | |||
|      * du domaine par update_domains.sh | ||||
|      * @access private | ||||
|      */ | ||||
|     var $fic_lock_cron = "/var/run/alternc/cron.lock"; | ||||
|     var $fic_lock_cron = "/run/alternc/cron.lock"; | ||||
| 
 | ||||
|     /** | ||||
|      * Le cron a-t-il été bloqué ? | ||||
|  | @ -63,6 +63,7 @@ class m_dom { | |||
|      * @access private | ||||
|      */ | ||||
|     var $islocked = false; | ||||
| 
 | ||||
|     var $type_local = "VHOST"; | ||||
|     var $type_url = "URL"; | ||||
|     var $type_ip = "IP"; | ||||
|  | @ -166,6 +167,7 @@ class m_dom { | |||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     // returns array(ALL,NONE,ADMIN) 
 | ||||
|     function domains_type_enable_values() { | ||||
|         global $db, $msg, $cuid; | ||||
|         $msg->debug("dom", "domains_type_enable_values"); | ||||
|  | @ -185,6 +187,7 @@ class m_dom { | |||
| 
 | ||||
|     /** | ||||
|      * @param integer $type | ||||
|      * all = 'NONE','URL','DIRECTORY','IP','IPV6','DOMAIN','TXT' | ||||
|      */ | ||||
|     function domains_type_target_values($type = null) { | ||||
|         global $db, $msg; | ||||
|  | @ -551,7 +554,7 @@ class m_dom { | |||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     function domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced, $create_tmpdir, $create_targetdir) { | ||||
|     function domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced, $create_tmpdir, $create_targetdir,$has_https_option=0) { | ||||
|         global $msg, $db; | ||||
|         // The name MUST contain only letter and digits, it's an identifier after all ...
 | ||||
|         if (!preg_match("#^[a-z0-9]+$#", $name)) { | ||||
|  | @ -561,9 +564,10 @@ class m_dom { | |||
|         $only_dns = intval($only_dns); | ||||
|         $need_dns = intval($need_dns); | ||||
|         $advanced = intval($advanced); | ||||
|         $has_https_option = intval($has_https_option); | ||||
|         $create_tmpdir = intval($create_tmpdir); | ||||
|         $create_targetdir = intval($create_targetdir); | ||||
|         $db->query("UPDATE domaines_type SET description= ?, target= ?, entry= ?, compatibility= ?, enable= e, need_dns= ?, only_dns= ?, advanced= ?,create_tmpdir= ?,create_targetdir= ? where name= ?;", array($description, $target, $entry, $compatibility, $enable, $need_dns, $only_dns, $advanced, $create_tmpdir, $create_targetdir, $name)); | ||||
|         $db->query("UPDATE domaines_type SET description= ?, target= ?, entry= ?, compatibility= ?, enable= e, need_dns= ?, only_dns= ?, advanced= ?,create_tmpdir= ?,create_targetdir= ?, has_https_option=? where name= ?;", array($description, $target, $entry, $compatibility, $enable, $need_dns, $only_dns, $advanced, $create_tmpdir, $create_targetdir, $has_https_option, $name)); | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|  | @ -922,177 +926,47 @@ class m_dom { | |||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * Retourne les entrées DNS du domaine $domain issues du WHOIS. | ||||
|      * | ||||
|      * Cette fonction effectue un appel WHOIS($domain) sur Internet, | ||||
|      * et extrait du whois les serveurs DNS du domaine demandé. En fonction | ||||
|      * du TLD, on sait (ou pas) faire le whois correspondant. | ||||
|      * Actuellement, les tld suivants sont supportés : | ||||
|      * .com .net .org .be .info .ca .cx .fr .biz .name | ||||
|      * | ||||
|      * @param string $domain Domaine fqdn dont on souhaite les serveurs DNS | ||||
|      * @return array Retourne un tableau indexé avec les NOMS fqdn des dns | ||||
|      *   du domaine demandé. Retourne FALSE si une erreur s'est produite. | ||||
|      * Return the NS of a server by interrogating its parent zone. | ||||
|      *  | ||||
|      * @param string $domain FQDN we are searching for | ||||
|      * @return array Return the authoritative NS of this domain | ||||
|      *   or FALSE if an error occurred | ||||
|      * | ||||
|      */ | ||||
|     function whois($domain) { | ||||
|         global $msg; | ||||
|         $msg->debug("dom", "whois", $domain); | ||||
|         // pour ajouter un nouveau TLD, utiliser le code ci-dessous.
 | ||||
|         //  echo "whois : $domain<br />";
 | ||||
|         preg_match("#.*\.([^\.]*)#", $domain, $out); | ||||
|         $ext = $out[1]; | ||||
|         // pour ajouter un nouveau TLD, utiliser le code ci-dessous.
 | ||||
|         //  echo "ext: $ext<br />";
 | ||||
| 
 | ||||
|         $serveur = ""; | ||||
|         if (($fp = @fsockopen("whois.iana.org", 43)) > 0) { | ||||
|             fputs($fp, "$domain\r\n"); | ||||
|             $found = false; | ||||
|             $state = 0; | ||||
|             while (!feof($fp)) { | ||||
|                 $ligne = fgets($fp, 128); | ||||
|                 if (preg_match('#^whois:#', $ligne)) { | ||||
|                     $serveur = preg_replace('/whois:\ */', '', $ligne, 1); | ||||
|                 } | ||||
|         $domain=trim($domain,"."); // strip initial/final .
 | ||||
|         $parent=$domain; $loopmax=32; | ||||
|         do { | ||||
|             $parent=substr($parent,strpos($parent,".")+1); | ||||
|             $parent=trim($parent,"."); | ||||
|             if (!$parent) { | ||||
|                 $msg->raise("ALERT", "dom", _("The domain has no parent. Check syntax")); | ||||
|                 return false; // no . in this fqdn??
 | ||||
|             } | ||||
|             // ask the parent for its NS (no +trace)
 | ||||
|             $out=array(); | ||||
|             exec("dig +short NS ".escapeshellarg($parent),$out); | ||||
|             $loopmax--; | ||||
|         } while (!count($out) && $loopmax); // will stop when : we have no parent, or
 | ||||
|         if (!count($out)) { | ||||
|             return false; // bad exit of the loop
 | ||||
|         } | ||||
|         $parentns=trim($out[0]);  | ||||
| 
 | ||||
|         // we take the first NS of the SOA of the parent and interrogate it for the child domain:
 | ||||
|         $out=array(); | ||||
|         exec("dig NS ".escapeshellarg($domain)." ".escapeshellarg("@".$parentns),$out); | ||||
|         // we scan the dig result for authoritative information :
 | ||||
|         $ns=array(); | ||||
|         foreach($out as $line) { | ||||
|             if (preg_match('#^'.str_replace(".","\\.",$domain).'\..*IN\s*NS\s*(.*)$#',$line,$mat)) { | ||||
|                 $ns[]=trim($mat[1]); | ||||
|             } | ||||
|         } | ||||
|         $serveur = str_replace(array(" ", "\n"), "", $serveur); | ||||
| 
 | ||||
|         $egal = ""; | ||||
|         switch ($ext) { | ||||
|         case "net": | ||||
|             $egal = "="; | ||||
|             break; | ||||
|         case "name": | ||||
|             $egal = "domain = "; | ||||
|             break; | ||||
|         } | ||||
|         $serveurList = array(); | ||||
|         // pour ajouter un nouveau TLD, utiliser le code ci-dessous.
 | ||||
|         //  echo "serveur : $serveur <br />";
 | ||||
|         if (($fp = @fsockopen($serveur, 43)) > 0) { | ||||
|             fputs($fp, "$egal$domain\r\n"); | ||||
|             $found = false; | ||||
|             $state = 0; | ||||
|             while (!feof($fp)) { | ||||
|                 $ligne = fgets($fp, 128); | ||||
|                 // pour ajouter un nouveau TLD, utiliser le code ci-dessous.
 | ||||
|                 //  echo "| $ligne<br />";
 | ||||
|                 switch ($ext) { | ||||
|                 case "org": | ||||
|                 case "com": | ||||
|                 case "net": | ||||
|                 case "info": | ||||
|                 case "biz": | ||||
|                 case "name": | ||||
|                 case "cc": | ||||
|                     if (preg_match("#Name Server:#", $ligne)) { | ||||
|                         $found = true; | ||||
|                         $tmp = strtolower(str_replace(chr(10), "", str_replace(chr(13), "", str_replace(" ", "", str_replace("Name Server:", "", $ligne))))); | ||||
|                         if ($tmp) { | ||||
|                             $serveurList[] = $tmp; | ||||
|                         } | ||||
|                     } | ||||
|                 break; | ||||
|                 case "co": | ||||
|                     if (preg_match("#Name Server:#", $ligne)) { | ||||
|                         $found = true; | ||||
|                         $tmp = strtolower(str_replace(chr(10), "", str_replace(chr(13), "", str_replace(" ", "", str_replace("Name Server:", "", $ligne))))); | ||||
|                         if ($tmp) | ||||
|                             $serveurList[] = $tmp; | ||||
|                     } | ||||
|                     break; | ||||
|                 case "cx": | ||||
|                     $ligne = str_replace(chr(10), "", str_replace(chr(13), "", str_replace(" ", "", $ligne))); | ||||
|                     if ($ligne == "" && $state == 1) { | ||||
|                         $state = 2; | ||||
|                     } | ||||
|                     if ($state == 1) { | ||||
|                         $serveurList[] = strtolower($ligne); | ||||
|                     } | ||||
|                     if ($ligne == "Nameservers:" && $state == 0) { | ||||
|                         $state = 1; | ||||
|                         $found = true; | ||||
|                     } | ||||
|                     break; | ||||
|                 case "eu": | ||||
|                 case "be": | ||||
|                     $ligne = preg_replace("/^ *([^ ]*) \(.*\)$/", "\\1", trim($ligne)); | ||||
|                 $tmp=""; | ||||
|                 if ($found) { | ||||
|                     $tmp = trim($ligne); | ||||
|                 } | ||||
|                 if ($tmp) { | ||||
|                     $serveurList[] = $tmp; | ||||
|                 } | ||||
|                 if ($ligne == "Nameservers:") { | ||||
|                     $state = 1; | ||||
|                     $found = true; | ||||
|                 } | ||||
|                 break; | ||||
|                 case "im": | ||||
|                     if (preg_match('/Name Server:/', $ligne)) { | ||||
|                         $found = true; | ||||
|                         // weird regexp (trailing garbage after name server), but I could not make it work otherwise
 | ||||
|                         $tmp = strtolower(preg_replace('/Name Server: ([^ ]+)\..$/', "\\1", $ligne)); | ||||
|                         $tmp = preg_replace('/[^-_a-z0-9\.]/', '', $tmp); | ||||
|                         if ($tmp) { | ||||
|                             $serveurList[] = $tmp; | ||||
|                         } | ||||
|                     } | ||||
|                     break; | ||||
|                 case "it": | ||||
|                     if (preg_match("#nserver:#", $ligne)) { | ||||
|                         $found = true; | ||||
|                         $tmp = strtolower(preg_replace("/nserver:\s*[^ ]*\s*([^\s]*)$/", "\\1", $ligne)); | ||||
|                         if ($tmp) { | ||||
|                             $serveurList[] = $tmp; | ||||
|                         } | ||||
|                     } | ||||
|                     break; | ||||
|                 case "fr": | ||||
|                 case "re": | ||||
|                     if (preg_match("#nserver:#", $ligne)) { | ||||
|                         $found = true; | ||||
|                         $tmp = strtolower(preg_replace("#nserver:\s*([^\s]*)\s*.*$#", "\\1", $ligne)); | ||||
|                         if ($tmp) { | ||||
|                             $serveurList[] = $tmp; | ||||
|                         } | ||||
|                     } | ||||
|                 break; | ||||
|                 case "ca": | ||||
|                 case "ws"; | ||||
|                 if (preg_match('#Name servers#', $ligne)) { | ||||
|                     // found the server
 | ||||
|                     $state = 1; | ||||
|                 } elseif ($state) { | ||||
|                     if (preg_match('#^[^%]#', $ligne) && $ligne = preg_replace('#[[:space:]]#', "", $ligne)) { | ||||
|                         // first non-whitespace line is considered to be the nameservers themselves
 | ||||
|                         $found = true; | ||||
|                         $serveurList[] = $ligne; | ||||
|                     } | ||||
|                 } | ||||
|                 break; | ||||
|                 case "coop": | ||||
|                     if (preg_match('#Host Name:\s*([^\s]+)#', $ligne, $matches)) { | ||||
|                         $found = true; | ||||
|                         $serveurList[] = $matches[1]; | ||||
|                     } | ||||
|                 } // switch
 | ||||
|             } // while
 | ||||
|             fclose($fp); | ||||
|         } else { | ||||
|             $msg->raise("ALERT", "dom", _("The Whois database is unavailable, please try again later")); | ||||
|             return array(); | ||||
|         } | ||||
| 
 | ||||
|         if ($found) { | ||||
|             return $serveurList; | ||||
|         } else { | ||||
|             $msg->raise("ALERT", "dom", _("The domain cannot be found in the Whois database")); | ||||
|             return array(); | ||||
|         } | ||||
|         return $ns; | ||||
|     } // whois
 | ||||
| 
 | ||||
| 
 | ||||
|  | @ -1195,7 +1069,6 @@ class m_dom { | |||
|         $db->next_record(); | ||||
|         $r["nsub"] = $db->Record["cnt"]; | ||||
|         $db->free(); | ||||
|         #$db->query("SELECT sd.*, dt.description AS type_desc, dt.only_dns FROM sub_domaines sd, domaines_type dt WHERE compte='$cuid' AND domaine='$dom' AND UPPER(dt.name)=UPPER(sd.type) ORDER BY sd.sub,sd.type");
 | ||||
|         $db->query("SELECT sd.*, dt.description AS type_desc, dt.only_dns, dt.advanced, dt.has_https_option FROM sub_domaines sd LEFT JOIN domaines_type dt on  UPPER(dt.name)=UPPER(sd.type) WHERE compte= ? AND domaine= ? ORDER BY dt.advanced,sd.sub,sd.type ;", array($cuid, $dom)); | ||||
|         // Pas de webmail, on le cochera si on le trouve.
 | ||||
|         $r["sub"] = array(); | ||||
|  | @ -1268,6 +1141,8 @@ class m_dom { | |||
|             return $https; | ||||
|         } else return ""; | ||||
|     } | ||||
| 
 | ||||
|      | ||||
|     /** | ||||
|      * @param integer $type | ||||
|      * @param string $value | ||||
|  | @ -1594,7 +1469,7 @@ class m_dom { | |||
| 
 | ||||
|         // Can't have ttl == 0. There is also a check in function_dns
 | ||||
|         if ($ttl == 0) { | ||||
|             $ttl = 86400; | ||||
|             $ttl = 3600; | ||||
|         } | ||||
| 
 | ||||
|         $t = checkfqdn($dom); | ||||
|  |  | |||
|  | @ -1,8 +1,8 @@ | |||
| 
 | ||||
| PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||||
| 
 | ||||
| # Create /var/run/ folder : it may be a ramdrive | ||||
| @reboot	 root	   mkdir -p /var/run/alternc && chown alterncpanel:alterncpanel /var/run/alternc  | ||||
| # Create /run/ folder : it may be a ramdrive | ||||
| @reboot	 root	   mkdir -p /run/alternc && chown alterncpanel:alterncpanel /run/alternc  | ||||
| 
 | ||||
| # Every 2 days compress log files | ||||
| 0 4 * * *	alterncpanel	/usr/lib/alternc/compress_logs.sh | ||||
|  |  | |||
|  | @ -113,10 +113,10 @@ SQLBACKUP_OVERWRITE="" | |||
| ALTERNC_SLAVES="" | ||||
| 
 | ||||
| # File to look at for forced launch of update_domain (use incron) | ||||
| INOTIFY_UPDATE_DOMAIN="/var/run/alternc/inotify_update_domain.lock" | ||||
| INOTIFY_UPDATE_DOMAIN="/run/alternc/inotify_update_domain.lock" | ||||
| 
 | ||||
| # File to look at for forced launch of do_actions (use incron) | ||||
| INOTIFY_DO_ACTION="/var/run/alternc/inotify_do_action.lock" | ||||
| INOTIFY_DO_ACTION="/run/alternc/inotify_do_action.lock" | ||||
| 
 | ||||
| # AlternC Locations | ||||
| ALTERNC_HTML="" | ||||
|  | @ -251,8 +251,8 @@ NFS_QUOTA=no" >> $CONFIGFILE | |||
|     touch           /var/lib/alternc/bind/automatic.conf /var/lib/alternc/bind/slaveip.conf | ||||
|     chown root:bind /var/lib/alternc/bind/automatic.conf /var/lib/alternc/bind/slaveip.conf | ||||
|     chmod 640       /var/lib/alternc/bind/automatic.conf /var/lib/alternc/bind/slaveip.conf | ||||
|     mkdir -p /var/run/alternc && chown alterncpanel:alterncpanel /var/run/alternc | ||||
|     touch /var/run/alternc/refresh_slave | ||||
|     mkdir -p /run/alternc && chown alterncpanel:alterncpanel /run/alternc | ||||
|     touch /run/alternc/refresh_slave | ||||
|     /usr/lib/alternc/slave_dns | ||||
|     # Apache will not start without this file | ||||
|     touch /var/lib/alternc/apache-vhost/vhosts_all.conf | ||||
|  |  | |||
|  | @ -19,6 +19,7 @@ Depends: debianutils (>= 1.13.1) | |||
|        , apache2-mpm-itk | libapache2-mpm-itk | ||||
|        , libapache2-mod-php5 | libapache2-mod-php7.0 | ||||
|        , php5-mysql | php7.0-mysql | ||||
|        , php-curl | php5-curl | php7.0-curl | ||||
|        , phpmyadmin | ||||
|        , ssl-cert | ||||
|        , libjs-prettify | ||||
|  | @ -107,6 +108,7 @@ Depends: debianutils (>= 1.13.1) | |||
|          , apache2-mpm-itk | libapache2-mpm-itk | ||||
|          , libapache2-mod-php5 | libapache2-mod-php7.0 | ||||
|          , php5-mysql | php7.0-mysql | ||||
|          , php-curl | php5-curl | php7.0-curl | ||||
|          , phpmyadmin | ||||
|          , ssl-cert | ||||
|          , libjs-prettify | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ | |||
|   php_value post_max_size 50M | ||||
|   AddDefaultCharset UTF-8 | ||||
| # open_basedir allows access to specifics directories. We need to grant access to these directories for alternc, awstats, mailman... | ||||
|   php_admin_value open_basedir /usr/share/alternc-mailman/patches/:/etc/alternc/:/run/alternc:/var/run/alternc/:/usr/share/alternc/panel/:%%ALTERNC_HTML%%/:/tmp:/usr/share/php/:/var/cache/alternc-webalizer/:/etc/locale.gen:%%ALTERNC_LOGS%%:/etc/awstats/:/var/log/alternc/:/var/lib/alternc/panel/ | ||||
|   php_admin_value open_basedir /usr/share/alternc-mailman/patches/:/etc/alternc/:/run/alternc:/usr/share/alternc/panel/:%%ALTERNC_HTML%%/:/tmp:/usr/share/php/:/var/cache/alternc-webalizer/:/etc/locale.gen:%%ALTERNC_LOGS%%:/etc/awstats/:/var/log/alternc/:/var/lib/alternc/panel/ | ||||
| 
 | ||||
| </Directory> | ||||
| 
 | ||||
|  |  | |||
|  | @ -20,8 +20,8 @@ fi | |||
| # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc. | ||||
| export APACHE_RUN_USER=www-data | ||||
| export APACHE_RUN_GROUP=www-data | ||||
| export APACHE_PID_FILE=/var/run/apache2$SUFFIX.pid | ||||
| export APACHE_RUN_DIR=/var/run/apache2$SUFFIX | ||||
| export APACHE_PID_FILE=/run/apache2$SUFFIX.pid | ||||
| export APACHE_RUN_DIR=/run/apache2$SUFFIX | ||||
| export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX | ||||
| # Only /var/log/apache2 is handled by /etc/logrotate.d/apache2. | ||||
| export APACHE_LOG_DIR=/var/log/apache2$SUFFIX | ||||
|  |  | |||
|  | @ -4,10 +4,10 @@ | |||
| # Command-line options specified here will override the contents of | ||||
| # /etc/opendkim.conf. See opendkim(8) for a complete list of options. | ||||
| #DAEMON_OPTS="" | ||||
| # Change to /var/spool/postfix/var/run/opendkim to use a Unix socket with | ||||
| # Change to /var/spool/postfix/run/opendkim to use a Unix socket with | ||||
| # postfix in a chroot: | ||||
| #RUNDIR=/var/spool/postfix/var/run/opendkim | ||||
| RUNDIR=/var/run/opendkim | ||||
| #RUNDIR=/var/spool/postfix/run/opendkim | ||||
| RUNDIR=/run/opendkim | ||||
| # | ||||
| # Uncomment to specify an alternate socket | ||||
| # Note that setting this will override any Socket value in opendkim.conf | ||||
|  |  | |||
|  | @ -57,7 +57,7 @@ driver = mysql | |||
| #                           the default my.cnf location | ||||
| #     option_group        - Read options from the given group (default: client) | ||||
| #  | ||||
| #   You can connect to UNIX sockets by using host: host=/var/run/mysql.sock | ||||
| #   You can connect to UNIX sockets by using host: host=/run/mysql.sock | ||||
| #   Note that currently you can't use spaces in parameters. | ||||
| # | ||||
| # sqlite: | ||||
|  |  | |||
|  | @ -182,7 +182,7 @@ protocol lda { | |||
| 
 | ||||
| 
 | ||||
|   # UNIX socket path to master authentication server to find users. | ||||
|   auth_socket_path = /var/run/dovecot/auth-master | ||||
|   auth_socket_path = /run/dovecot/auth-master | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -1 +1 @@ | |||
| /var/run/alternc/ IN_CREATE,IN_ATTRIB,IN_NO_LOOP /usr/lib/alternc/inotify_do_actions.sh | ||||
| /run/alternc/ IN_CREATE,IN_ATTRIB,IN_NO_LOOP /usr/lib/alternc/inotify_do_actions.sh | ||||
|  |  | |||
|  | @ -1 +1 @@ | |||
| /var/run/alternc/ IN_CREATE,IN_ATTRIB,IN_NO_LOOP /usr/lib/alternc/inotify_update_domains.sh | ||||
| /run/alternc/ IN_CREATE,IN_ATTRIB,IN_NO_LOOP /usr/lib/alternc/inotify_update_domains.sh | ||||
|  |  | |||
|  | @ -157,7 +157,7 @@ chown :alterncpanel /etc/alternc/local.sh | |||
| . /etc/alternc/local.sh | ||||
| 
 | ||||
| # May be missing  | ||||
| test -d /var/run/alternc || ( mkdir -p /var/run/alternc && chown alterncpanel:alterncpanel /var/run/alternc ) | ||||
| test -d /run/alternc || ( mkdir -p /run/alternc && chown alterncpanel:alterncpanel /run/alternc ) | ||||
| 
 | ||||
| # Create the target directory | ||||
| for i in "$ALTERNC_HTML" "$ALTERNC_MAIL" "$ALTERNC_LOGS" ; do | ||||
|  |  | |||
|  | @ -263,6 +263,7 @@ CREATE TABLE IF NOT EXISTS `mailbox` ( | |||
|   `bytes` bigint(20) NOT NULL DEFAULT '0', -- number of bytes in the mailbox, filled by dovecot | ||||
|   `messages` int(11) NOT NULL DEFAULT '0', -- number of messages in the mailbox, filled by dovecot  | ||||
|   `lastlogin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -- Last login, filled by dovecot | ||||
|   `lastloginsasl` DATETIME NOT NULL DEFAULT 0, -- last login on SASL / SMTP, not filled yet ;)  | ||||
|   `mail_action` enum('OK','DELETE','DELETING') NOT NULL default 'OK', -- mail_action is DELETE or DELETING when deleting a mailbox by cron | ||||
|   PRIMARY KEY (`id`), | ||||
|   UNIQUE KEY `address_id` (`address_id`) | ||||
|  |  | |||
|  | @ -6,9 +6,9 @@ | |||
| if [ -z "$INOTIFY_UPDATE_DOMAIN" ] ; then | ||||
| /bin/echo -e ' | ||||
| # File to look at for forced launch of update_domain (use incron) | ||||
| INOTIFY_UPDATE_DOMAIN="/var/run/alternc/inotify_update_domain.lock" | ||||
| INOTIFY_UPDATE_DOMAIN="/run/alternc/inotify_update_domain.lock" | ||||
| ' >> /etc/alternc/local.sh | ||||
| fi | ||||
| 
 | ||||
| mkdir -p /var/run/alternc && chown alterncpanel /var/run/alternc | ||||
| mkdir -p /run/alternc && chown alterncpanel /run/alternc | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,2 +0,0 @@ | |||
| 
 | ||||
| ALTER TABLE mailbox MODIFY  `lastlogin` DATETIME NOT NULL DEFAULT 0; | ||||
|  | @ -1,2 +0,0 @@ | |||
| ALTER TABLE `membres` MODIFY `pass` varchar(255); | ||||
| ALTER TABLE `ftpusers` MODIFY `encrypted_password` varchar(255); | ||||
|  | @ -1,3 +1,10 @@ | |||
| -- upgrade from 3.4.10 and 3.4.11 (a bug prevented them to be inserted :/ ) | ||||
| 
 | ||||
| ALTER TABLE mailbox MODIFY  `lastlogin` DATETIME NOT NULL DEFAULT 0; | ||||
| ALTER TABLE mailbox ADD  `lastloginsasl` DATETIME NOT NULL DEFAULT 0 AFTER `lastlogin`; | ||||
| 
 | ||||
| ALTER TABLE `membres` MODIFY `pass` varchar(255); | ||||
| ALTER TABLE `ftpusers` MODIFY `encrypted_password` varchar(255); | ||||
| 
 | ||||
| -- upgrade to merge alternc-ssl into alternc + change the way we work on SSL | ||||
| 
 | ||||
|  | @ -9,7 +16,7 @@ ALTER TABLE `certificates` | |||
|       DROP `ssl_result`, | ||||
|       ADD `provider` VARCHAR(16) NOT NULL DEFAULT '', | ||||
|       ADD `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP; | ||||
| 
 | ||||
|    | ||||
| ALTER TABLE `sub_domaines` | ||||
|       ADD `certificate_id` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `enable`, | ||||
|       ADD `provider` VARCHAR(16) NOT NULL DEFAULT '' AFTER `certificate_id`, | ||||
|  |  | |||
|  | @ -60,7 +60,7 @@ if(isset($L_ALTERNC_LOGS_ARCHIVE)){ | |||
|  define('ALTERNC_LOGS_ARCHIVE', "$L_ALTERNC_LOGS_ARCHIVE"); | ||||
| } | ||||
| if( !defined("ALTERNC_LOCALES") ) { define('ALTERNC_LOCALES', ALTERNC_PANEL."/locales"); }; | ||||
| if( !defined("ALTERNC_LOCK_JOBS") ) { define('ALTERNC_LOCK_JOBS', '/var/run/alternc/jobs-lock'); }; | ||||
| if( !defined("ALTERNC_LOCK_JOBS") ) { define('ALTERNC_LOCK_JOBS', '/run/alternc/jobs-lock'); }; | ||||
| if( !defined("ALTERNC_LOCK_PANEL") ) { define('ALTERNC_LOCK_PANEL', '/var/lib/alternc/panel/nologin.lock'); }; | ||||
| if( !defined("ALTERNC_APACHE2_GEN_TMPL_DIR") ) { define('ALTERNC_APACHE2_GEN_TMPL_DIR', '/etc/alternc/templates/apache2/'); }; | ||||
| if( !defined("ALTERNC_VHOST_DIR") ) { define('ALTERNC_VHOST_DIR', "/var/lib/alternc/apache-vhost/"); }; | ||||
|  |  | |||
|  | @ -9,7 +9,7 @@ | |||
| require_once("/usr/share/alternc/panel/class/config_nochk.php"); | ||||
| ini_set("display_errors", 1); | ||||
| 
 | ||||
| if (file_exists("/var/run/alternc/jobs-lock")) { | ||||
| if (file_exists("/run/alternc/jobs-lock")) { | ||||
|   echo "jobs-lock exists, did you ran alternc.install?\n"; | ||||
|   echo "canceling cron_users\n"; | ||||
|   exit(1); | ||||
|  |  | |||
|  | @ -57,7 +57,7 @@ require_once("/usr/share/alternc/panel/class/config_nochk.php"); | |||
| $admin->stop_if_jobs_locked(); | ||||
| 
 | ||||
| if( !defined("ALTERNC_DO_ACTION_LOCK")){ | ||||
|     define("ALTERNC_DO_ACTION_LOCK",'/var/run/alternc/do_actions_cron.lock'); | ||||
|     define("ALTERNC_DO_ACTION_LOCK",'/run/alternc/do_actions_cron.lock'); | ||||
| } | ||||
| 
 | ||||
| $SCRIPT='/usr/bin/php do_actions.php'; | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ mysql_query() { /usr/bin/mysql --defaults-file=/etc/alternc/my.cnf -Bs -e "$@" ; | |||
| DOMAIN_LOG_FILE="/var/log/alternc/update_domains.log" | ||||
| VHOST_FILE="$VHOST_DIR/vhosts_all.conf"  | ||||
| VHOST_MANUALCONF="$VHOST_DIR/manual/" | ||||
| LOCK_JOBS="/var/run/alternc/jobs-lock" | ||||
| LOCK_JOBS="/run/alternc/jobs-lock" | ||||
| 
 | ||||
| 
 | ||||
| # Some useful miscellaneous shell functions | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
| # with the IP of the slave dns | ||||
| 
 | ||||
| PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||||
| FLAGFILE="/var/run/alternc/refresh_slave"; | ||||
| FLAGFILE="/run/alternc/refresh_slave"; | ||||
| TPL="/etc/alternc/templates/bind/slaveip.conf" | ||||
| TARGET="/var/lib/alternc/bind/slaveip.conf" | ||||
| 
 | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ done | |||
| 
 | ||||
| stop_if_jobs_locked | ||||
| 
 | ||||
| LOCK_FILE="/var/run/alternc/update_mails" | ||||
| LOCK_FILE="/run/alternc/update_mails" | ||||
| 
 | ||||
| # ALTERNC_MAIL is from local.sh | ||||
| 
 | ||||
|  |  | |||
|  | @ -31,7 +31,7 @@ UMask			007 | |||
| # ##  local:/path/to/socket       to listen on a UNIX domain socket | ||||
| # | ||||
| #Socket                  inet:8892@localhost | ||||
| Socket			local:/var/run/opendkim/opendkim.sock | ||||
| Socket			local:/run/opendkim/opendkim.sock | ||||
| 
 | ||||
| ##  PidFile filename | ||||
| ###      default (none) | ||||
|  | @ -39,7 +39,7 @@ Socket			local:/var/run/opendkim/opendkim.sock | |||
| ###  Name of the file where the filter should write its pid before beginning | ||||
| ###  normal operations. | ||||
| # | ||||
| PidFile               /var/run/opendkim/opendkim.pid | ||||
| PidFile               /run/opendkim/opendkim.pid | ||||
| 
 | ||||
| 
 | ||||
| # Always oversign From (sign using actual From and a null From to prevent | ||||
|  |  | |||
|  | @ -45,7 +45,7 @@ LOG_FILE=$LOG_DIR/xferlog | |||
| TMP_ROOT=$ALTERNC_ROOT/tmp | ||||
| RES_FILE=$TMP_ROOT/$PROG_NAME.res.$$ | ||||
| INTERMEDIATE_FILE=$TMP_ROOT/$PROG_NAME.int.$$ | ||||
| LOCK_FILE=/var/run/$PROG_NAME | ||||
| LOCK_FILE=/run/$PROG_NAME | ||||
| export TEXTDOMAIN=alternc-admintools | ||||
| YES=yes | ||||
| NO=no | ||||
|  |  | |||
|  | @ -40,7 +40,7 @@ LOG_DIR=/var/log/apache | |||
| TMP_ROOT=$ALTERNC_ROOT/tmp | ||||
| RES_FILE=$TMP_ROOT/$PROG_NAME.res.$$ | ||||
| INTERMEDIATE_FILE=$TMP_ROOT/$PROG_NAME.int.$$ | ||||
| LOCK_FILE=/var/run/$PROG_NAME | ||||
| LOCK_FILE=/run/$PROG_NAME | ||||
| export TEXTDOMAIN=alternc-admintools | ||||
| YES=yes | ||||
| NO=no | ||||
|  |  | |||
|  | @ -40,7 +40,7 @@ LOG_DIR=/var/log | |||
| LOG_FILE=$LOG_DIR/mysql.log | ||||
| TMP_ROOT=$ALTERNC_ROOT/tmp | ||||
| RES_FILE=$TMP_ROOT/$PROG_NAME.res.$$ | ||||
| LOCK_FILE=/var/run/$PROG_NAME | ||||
| LOCK_FILE=/run/$PROG_NAME | ||||
| export TEXTDOMAIN=alternc-admintools | ||||
| YES=yes | ||||
| NO=no | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue