pushing fixes for ACL / QUOTA in postinst + Postfix unused directives + fixing DBSERVER initialisation innewone
This commit is contained in:
parent
77c229a940
commit
b6991be784
|
@ -1,7 +1,6 @@
|
||||||
#! /bin/bash
|
#! /bin/bash -x
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -x
|
|
||||||
|
|
||||||
# Source debconf library.
|
# Source debconf library.
|
||||||
. /usr/share/debconf/confmodule
|
. /usr/share/debconf/confmodule
|
||||||
|
@ -215,30 +214,25 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do
|
||||||
#we get the first existing dir
|
#we get the first existing dir
|
||||||
aclcheckfile="$basedir/test-acl"
|
aclcheckfile="$basedir/test-acl"
|
||||||
touch "$aclcheckfile"
|
touch "$aclcheckfile"
|
||||||
setfacl -m u:root:rwx "$aclcheckfile" 2>/dev/null
|
setfacl -m u:root:rwx "$aclcheckfile" 2>/dev/null || (
|
||||||
|
test -e "$aclcheckfile" && rm -f "$aclcheckfile" || true
|
||||||
if [ $? -ne 0 ]; then
|
db_input critical alternc/acluninstalled || true
|
||||||
test -e "$aclcheckfile" && rm -f "$aclcheckfile" || true
|
db_go
|
||||||
db_input critical alternc/acluninstalled || true
|
db_reset alternc/acluninstalled || true
|
||||||
db_go
|
db_fset alternc/acluninstalled "seen" "false" || true
|
||||||
db_reset alternc/acluninstalled || true
|
exit 2
|
||||||
db_fset alternc/acluninstalled "seen" "false" || true
|
)
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
test -e "$aclcheckfile" && rm -f "$aclcheckfile" || true
|
test -e "$aclcheckfile" && rm -f "$aclcheckfile" || true
|
||||||
|
|
||||||
quota -gA -f $MOUNT_POINT 2>/dev/null
|
quota -gA -f $MOUNT_POINT 2>/dev/null || (
|
||||||
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
db_get alternc/quotauninstalled
|
db_get alternc/quotauninstalled
|
||||||
if [ -z "$RET" ]; then
|
if [ -z "$RET" ]; then
|
||||||
db_input critical alternc/quotauninstalled || true
|
db_input critical alternc/quotauninstalled || true
|
||||||
db_go
|
db_go
|
||||||
#db_reset alternc/quotauninstalled || true
|
#db_reset alternc/quotauninstalled || true
|
||||||
db_set alternc/quotauninstalled "false" || true
|
db_set alternc/quotauninstalled "false" || true
|
||||||
fi
|
fi
|
||||||
fi
|
)
|
||||||
;;
|
;;
|
||||||
11)
|
11)
|
||||||
db_get alternc/alternc_mail
|
db_get alternc/alternc_mail
|
||||||
|
|
|
@ -242,6 +242,7 @@ EOF
|
||||||
touch /var/lib/alternc/bind/automatic.conf /var/lib/alternc/bind/slaveip.conf
|
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
|
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
|
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
|
touch /var/run/alternc/refresh_slave
|
||||||
/usr/lib/alternc/slave_dns
|
/usr/lib/alternc/slave_dns
|
||||||
# Apache will not start without this file
|
# Apache will not start without this file
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -x
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Postfix Configuration options
|
# Postfix Configuration options
|
||||||
# Used by alternc.install with postconf
|
# Used by alternc.install with postconf
|
||||||
# CAREFULL this script is not used directly by postfix.
|
# WARNING: this script is not used directly by postfix! it is parse by alternc.install
|
||||||
home_mailbox = Maildir/
|
home_mailbox = Maildir/
|
||||||
smtpd_banner = $myhostname ESMTP
|
smtpd_banner = $myhostname ESMTP
|
||||||
header_checks = regexp:/etc/postfix/header_checks
|
header_checks = regexp:/etc/postfix/header_checks
|
||||||
|
@ -25,7 +25,6 @@ smtpd_tls_auth_only = no
|
||||||
smtpd_sasl_auth_enable = yes
|
smtpd_sasl_auth_enable = yes
|
||||||
smtpd_sasl_local_domain = postfix
|
smtpd_sasl_local_domain = postfix
|
||||||
smtpd_sasl_security_options = noanonymous
|
smtpd_sasl_security_options = noanonymous
|
||||||
enable_sasl_authentification = yes
|
|
||||||
broken_sasl_auth_clients = yes
|
broken_sasl_auth_clients = yes
|
||||||
smtpd_sasl_type=dovecot
|
smtpd_sasl_type=dovecot
|
||||||
smtpd_sasl_path=private/auth
|
smtpd_sasl_path=private/auth
|
||||||
|
@ -37,7 +36,6 @@ virtual_alias_maps = proxy:mysql:/etc/postfix/myalias.cf
|
||||||
virtual_alias_domains =
|
virtual_alias_domains =
|
||||||
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mydomain.cf
|
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mydomain.cf
|
||||||
virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf
|
virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf
|
||||||
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/myquota.cf
|
|
||||||
virtual_mailbox_base = %%ALTERNC_MAIL%%
|
virtual_mailbox_base = %%ALTERNC_MAIL%%
|
||||||
virtual_minimum_uid = 2000
|
virtual_minimum_uid = 2000
|
||||||
virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf
|
virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf
|
||||||
|
|
|
@ -29,34 +29,48 @@
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// On vérifie que mysql.so est bien chargé, sinon on essaye de le charger
|
|
||||||
if(!function_exists('mysql_connect')) {
|
if(!function_exists('mysql_connect')) {
|
||||||
if(!dl("mysql.so"))
|
if(!dl("mysql.so"))
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ne vérifie pas ma session :)
|
// don't check my authentication !
|
||||||
if(!chdir("/usr/share/alternc/panel"))
|
if(!chdir("/usr/share/alternc/panel"))
|
||||||
exit(1);
|
exit(1);
|
||||||
require("/usr/share/alternc/panel/class/config_nochk.php");
|
require("/usr/share/alternc/panel/class/config_nochk.php");
|
||||||
|
|
||||||
// On passe super-admin
|
// We go root
|
||||||
$admin->enabled=1;
|
$admin->enabled=1;
|
||||||
|
|
||||||
// On crée le compte admin :
|
// We Create the default mysql server if needed :
|
||||||
//FIXME the last parameter should not be chosen by default: it has to match an entry in the db_servers table
|
$db->query("SELECT MIN(id) AS id FROM db_servers;");
|
||||||
if (!$admin->add_mem("admin","admin","Administrateur", "Admin", "postmaster@".$L_FQDN,1,'default',0,'',0 ,'',1)) {
|
$db->next_record();
|
||||||
|
if(!intval($db->Record["id"])) {
|
||||||
|
echo "No default db_servers, creating one\n";
|
||||||
|
// No db_servers ? We create one from the local MySQL parameters
|
||||||
|
if ($L_MYSQL_HOST=="localhost") $client="localhost"; else $client="%";
|
||||||
|
$db->query("INSERT INTO db_servers SET `name`='Default', `host`='$L_MYSQL_HOST', `login`='$L_MYSQL_LOGIN', `password`='$L_MYSQL_PWD', `client`='$client';");
|
||||||
|
$db->query("SELECT MIN(id) AS id FROM db_servers;");
|
||||||
|
$db->next_record();
|
||||||
|
}
|
||||||
|
$dbs=$db->Record["id"];
|
||||||
|
|
||||||
|
// And create the admin account
|
||||||
|
if (!$admin->add_mem("admin","admin","Administrateur", "Admin", "postmaster@".$L_FQDN,
|
||||||
|
1,'default',0,'',0 ,'',
|
||||||
|
$dbs
|
||||||
|
)) {
|
||||||
echo $err->errstr()."\n";
|
echo $err->errstr()."\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$db->query("update membres set su=1 where login='admin';"))
|
if(!$db->query("UPDATE membres SET su=1 WHERE login='admin';"))
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
// On lui attribue des quotas par defaut
|
// Give admin account some default quota:
|
||||||
if(!$quota->synchronise_user_profile()) {
|
if(!$quota->synchronise_user_profile()) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
?>
|
|
||||||
|
|
Loading…
Reference in New Issue