diff --git a/api/panel/bootstrap.php b/api/panel/bootstrap.php index 4fe55c98..35125b66 100644 --- a/api/panel/bootstrap.php +++ b/api/panel/bootstrap.php @@ -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 : */ diff --git a/bureau/class/config.php b/bureau/class/config.php index f23acb1d..dd2ee7dc 100755 --- a/bureau/class/config.php +++ b/bureau/class/config.php @@ -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/"); diff --git a/bureau/class/db_mysql.php b/bureau/class/db_mysql.php index e681469b..8e5a3c36 100644 --- a/bureau/class/db_mysql.php +++ b/bureau/class/db_mysql.php @@ -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); diff --git a/bureau/class/functions.php b/bureau/class/functions.php index fe873c13..b9c94817 100755 --- a/bureau/class/functions.php +++ b/bureau/class/functions.php @@ -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; diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index e3cc3dd6..64d50a7f 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -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
"; - preg_match("#.*\.([^\.]*)#", $domain, $out); - $ext = $out[1]; - // pour ajouter un nouveau TLD, utiliser le code ci-dessous. - // echo "ext: $ext
"; - $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
"; - 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
"; - 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); diff --git a/debian/alternc.cron.d b/debian/alternc.cron.d index 62180c31..f324f260 100644 --- a/debian/alternc.cron.d +++ b/debian/alternc.cron.d @@ -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 diff --git a/debian/alternc.postinst b/debian/alternc.postinst index 40be48cd..74c973c0 100644 --- a/debian/alternc.postinst +++ b/debian/alternc.postinst @@ -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 diff --git a/debian/control b/debian/control index e6904d47..166cd069 100644 --- a/debian/control +++ b/debian/control @@ -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 diff --git a/etc/alternc/templates/alternc/apache2.conf b/etc/alternc/templates/alternc/apache2.conf index 4bea9718..a8cdaef2 100644 --- a/etc/alternc/templates/alternc/apache2.conf +++ b/etc/alternc/templates/alternc/apache2.conf @@ -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/ diff --git a/etc/alternc/templates/apache2/envvars b/etc/alternc/templates/apache2/envvars index e7dda7ae..cd3b5eb0 100644 --- a/etc/alternc/templates/apache2/envvars +++ b/etc/alternc/templates/apache2/envvars @@ -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 diff --git a/etc/alternc/templates/default/opendkim b/etc/alternc/templates/default/opendkim index 2e309626..d5fcd424 100644 --- a/etc/alternc/templates/default/opendkim +++ b/etc/alternc/templates/default/opendkim @@ -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 diff --git a/etc/alternc/templates/dovecot/alternc-sql.conf b/etc/alternc/templates/dovecot/alternc-sql.conf index e4bad783..d34a80a8 100644 --- a/etc/alternc/templates/dovecot/alternc-sql.conf +++ b/etc/alternc/templates/dovecot/alternc-sql.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: diff --git a/etc/alternc/templates/dovecot/conf.d/95_alternc.conf b/etc/alternc/templates/dovecot/conf.d/95_alternc.conf index 14e6c7d7..a6713cb3 100644 --- a/etc/alternc/templates/dovecot/conf.d/95_alternc.conf +++ b/etc/alternc/templates/dovecot/conf.d/95_alternc.conf @@ -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 } diff --git a/etc/incron.d/alternc_do_action b/etc/incron.d/alternc_do_action index 509d73d5..bb8fcca1 100644 --- a/etc/incron.d/alternc_do_action +++ b/etc/incron.d/alternc_do_action @@ -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 diff --git a/etc/incron.d/alternc_update_domains b/etc/incron.d/alternc_update_domains index 528275eb..6188c1a0 100644 --- a/etc/incron.d/alternc_update_domains +++ b/etc/incron.d/alternc_update_domains @@ -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 diff --git a/install/alternc.install b/install/alternc.install index a878d9de..37c515a7 100755 --- a/install/alternc.install +++ b/install/alternc.install @@ -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 diff --git a/install/mysql.sql b/install/mysql.sql index fc377c56..2e43504c 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -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`) diff --git a/install/upgrades/3.0.0~4.sh b/install/upgrades/3.0.0~4.sh index ee152385..d0ee1b5c 100755 --- a/install/upgrades/3.0.0~4.sh +++ b/install/upgrades/3.0.0~4.sh @@ -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 diff --git a/install/upgrades/3.4.10.sql b/install/upgrades/3.4.10.sql deleted file mode 100644 index eb1bad9e..00000000 --- a/install/upgrades/3.4.10.sql +++ /dev/null @@ -1,2 +0,0 @@ - -ALTER TABLE mailbox MODIFY `lastlogin` DATETIME NOT NULL DEFAULT 0; diff --git a/install/upgrades/3.4.11.sql b/install/upgrades/3.4.11.sql deleted file mode 100644 index 643d3bc8..00000000 --- a/install/upgrades/3.4.11.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `membres` MODIFY `pass` varchar(255); -ALTER TABLE `ftpusers` MODIFY `encrypted_password` varchar(255); diff --git a/install/upgrades/3.5.0.1.sql b/install/upgrades/3.5.0.1.sql index b53fbe8a..49fc7f44 100644 --- a/install/upgrades/3.5.0.1.sql +++ b/install/upgrades/3.5.0.1.sql @@ -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`, diff --git a/phpunit/bootstrap.php b/phpunit/bootstrap.php index 1b53576e..bff4365b 100644 --- a/phpunit/bootstrap.php +++ b/phpunit/bootstrap.php @@ -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/"); }; diff --git a/src/cron_users.sh b/src/cron_users.sh index ca7cc738..3b3cdfdd 100755 --- a/src/cron_users.sh +++ b/src/cron_users.sh @@ -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); diff --git a/src/do_actions.php b/src/do_actions.php index 908487eb..7710115f 100644 --- a/src/do_actions.php +++ b/src/do_actions.php @@ -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'; diff --git a/src/functions.sh b/src/functions.sh index b6cd5fee..6fce08aa 100755 --- a/src/functions.sh +++ b/src/functions.sh @@ -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 diff --git a/src/slave_dns b/src/slave_dns index 7c459ec4..0b20420e 100644 --- a/src/slave_dns +++ b/src/slave_dns @@ -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" diff --git a/src/update_mails.sh b/src/update_mails.sh index 1ee68a83..de8650a6 100755 --- a/src/update_mails.sh +++ b/src/update_mails.sh @@ -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 diff --git a/stretch/opendkim.conf b/stretch/opendkim.conf index afc808cc..0a63f560 100644 --- a/stretch/opendkim.conf +++ b/stretch/opendkim.conf @@ -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 diff --git a/tools/top_ftp_users b/tools/top_ftp_users index 47dc8f93..f9c3c12b 100755 --- a/tools/top_ftp_users +++ b/tools/top_ftp_users @@ -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 diff --git a/tools/top_http_users b/tools/top_http_users index 9cf3115c..59e85e89 100755 --- a/tools/top_http_users +++ b/tools/top_http_users @@ -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 diff --git a/tools/top_mysql_users b/tools/top_mysql_users index bfceeef3..d737d186 100755 --- a/tools/top_mysql_users +++ b/tools/top_mysql_users @@ -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