remove alternc/mynetwork debconf parameter, stop overriding it in

postfix

also split the config prompts between slave and non-slave package

See: #1029
This commit is contained in:
Antoine Beaupré 2008-10-06 21:13:11 +00:00
parent 277f17fc11
commit cdb3a1e281
9 changed files with 181 additions and 28 deletions

3
.gitattributes vendored
View File

@ -245,6 +245,7 @@ bureau/locales/manual.pot -text
bureau/locales/messages.pot -text bureau/locales/messages.pot -text
bureau/locales/pt_BR/LC_MESSAGES/messages.po -text bureau/locales/pt_BR/LC_MESSAGES/messages.po -text
debian/README.Debian -text debian/README.Debian -text
debian/alternc-slave.config -text
debian/alternc-slave.dirs -text debian/alternc-slave.dirs -text
debian/alternc-slave.install -text debian/alternc-slave.install -text
debian/alternc-slave.links -text debian/alternc-slave.links -text
@ -253,6 +254,7 @@ debian/alternc-slave.logrotate -text
debian/alternc-slave.postinst -text debian/alternc-slave.postinst -text
debian/alternc-slave.postrm -text debian/alternc-slave.postrm -text
debian/alternc-slave.prerm -text debian/alternc-slave.prerm -text
debian/alternc.config -text
debian/alternc.cron.d -text debian/alternc.cron.d -text
debian/alternc.dirs -text debian/alternc.dirs -text
debian/alternc.links -text debian/alternc.links -text
@ -264,7 +266,6 @@ debian/alternc.preinst -text
debian/alternc.prerm -text debian/alternc.prerm -text
debian/changelog -text debian/changelog -text
debian/compat -text debian/compat -text
debian/config -text
debian/control -text debian/control -text
debian/copyright -text debian/copyright -text
debian/docs -text debian/docs -text

176
debian/alternc-slave.config vendored Normal file
View File

@ -0,0 +1,176 @@
#! /bin/sh
set -e
# Source debconf library.
. /usr/share/debconf/confmodule
db_title AlternC
db_input critical alternc-slave/welcomeconfirm || true
db_go
# Check the answer.
db_get alternc-slave/welcomeconfirm || true
if [ "$RET" = "false" ]; then
# reset the welcomeconfirm flag if user refuses so it gets asked again next time
db_reset alternc-slave/welcomeconfirm || true
db_fset alternc-slave/welcomeconfirm "seen" "false" || true
exit 1
fi
# default values for local.sh
MYSQL_HOST=127.0.0.1
MYSQL_DATABASE=alternc
MYSQL_USER=sysusr
MYSQL_PASS="`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..10)' `"
MYSQL_CLIENT=localhost
FQDN="`cat /etc/mailname 2>/dev/null || hostname -f`"
INTERNAL_IP="`/sbin/ifconfig|grep "inet addr:" | grep -v 127.0.0.1| head -1 | sed -e 's/^.*addr:\([0-9\.]*\).*$/\1/' 2>/dev/null || hostname -f`"
PUBLIC_IP="$INTERNAL_IP"
DEFAULT_MX="`cat /etc/mailname 2>/dev/null || hostname -f`"
ALTERNC_LOC=/var/alternc
NS1_HOSTNAME="$FQDN"
NS2_HOSTNAME="$FQDN"
HOSTING="AlternC"
SQLBACKUP_TYPE="rotate"
SQLBACKUP_OVERWRITE="no"
if [ -r /etc/alternc/local.sh ]; then
# source the current config
. /etc/alternc/local.sh
fi
if [ -r /etc/alternc/my.cnf ]; then
# make mysql configuration available as shell variables
# to convert from .cnf to shell syntax, we:
# * match only lines with "equal" in them (/=/)
# * remove whitespace around the = and add a left quote operator ' (;s)
# * add a right quote operator at the end of line (;s)
# * convert mysql variables into our MYSQL_ naming convention (;s)
# * print the result (;p)
eval `sed -n -e "/=/{s/ *= *\"\?/='/;s/\"\?\$/'/;s/host/MYSQL_HOST/;s/user/MYSQL_USER/;s/password/MYSQL_PASS/;s/database/MYSQL_DATABASE/;p}" /etc/alternc/my.cnf`
fi
# mettre les valeurs de local.sh comme "default" pour debconf
db_get alternc-slave/hostingname
if [ -z "$RET" ]
then
db_set alternc-slave/hostingname "$HOSTING"
fi
db_get alternc-slave/desktopname
if [ -z "$RET" ]
then
db_set alternc-slave/desktopname "$FQDN"
fi
db_get alternc-slave/public_ip
if [ -z "$RET" ]
then
db_set alternc-slave/public_ip "$PUBLIC_IP"
fi
db_get alternc-slave/internal_ip
if [ -z "$RET" ]
then
db_set alternc-slave/internal_ip "$INTERNAL_IP"
fi
db_get alternc-slave/monitor_ip
if [ -z "$RET" ]
then
db_set alternc-slave/monitor_ip "$MONITOR_IP"
fi
db_get alternc-slave/ns1
if [ -z "$RET" ]
then
db_set alternc-slave/ns1 "$NS1_HOSTNAME"
fi
db_get alternc-slave/ns2
if [ -z "$RET" ]
then
db_set alternc-slave/ns2 "$NS2_HOSTNAME"
fi
db_get alternc-slave/bind_internal
if [ -z "$RET" ]
then
db_set alternc-slave/bind_internal "$BIND_INTERNAL"
fi
db_get alternc-slave/default_mx
if [ -z "$RET" ]
then
db_set alternc-slave/default_mx "$DEFAULT_MX"
fi
db_get alternc-slave/mysql/host
if [ -z "$RET" ]
then
db_set alternc-slave/mysql/host "$MYSQL_HOST"
fi
db_get alternc-slave/mysql/db
if [ -z "$RET" ]
then
db_set alternc-slave/mysql/db "$MYSQL_DATABASE"
fi
db_get alternc-slave/mysql/user
if [ -z "$RET" ]
then
db_set alternc-slave/mysql/user "$MYSQL_USER"
fi
db_get alternc-slave/mysql/password
if [ -z "$RET" ]
then
db_set alternc-slave/mysql/password "$MYSQL_PASS"
fi
db_get alternc-slave/mysql/client
if [ -z "$RET" ]
then
db_set alternc-slave/mysql/client "$MYSQL_CLIENT"
fi
db_get alternc-slave/sql/backup_type
if [ -z "$RET" ]
then
db_set alternc-slave/sql/backup_type "$SQLBACKUP_TYPE"
fi
db_get alternc-slave/sql/backup_overwrite
if [ -z "$RET" ]
then
db_set alternc-slave/sql/backup_overwrite "$SQLBACKUP_OVERWRITE"
fi
db_get alternc-slave/alternc_location
if [ -z "$RET" ]
then
db_set alternc-slave/alternc_location "$ALTERNC_LOC"
fi
db_input medium alternc-slave/desktopname || true
db_input medium alternc-slave/hostingname || true
db_input medium alternc-slave/internal_ip || true
db_input medium alternc-slave/public_ip || true
db_input medium alternc-slave/default_mx || true
db_input medium alternc-slave/ns1 || true
db_input medium alternc-slave/ns2 || true
db_input low alternc-slave/alternc_location || true
db_input low alternc-slave/mysql/host || true
db_input low alternc-slave/mysql/db || true
db_input low alternc-slave/mysql/user || true
db_input low alternc-slave/mysql/password || true
db_input low alternc-slave/mysql/client || true
db_input low alternc-slave/sql/backup_type || true
db_input low alternc-slave/sql/overwrite || true
db_input low alternc-slave/monitor_ip || true
db_input low alternc-slave/bind_internal || true
db_go
# vim: et sw=4

View File

@ -93,9 +93,6 @@ MYSQL_CLIENT=""
# Folder holding data (used for quota management) # Folder holding data (used for quota management)
ALTERNC_LOC="" ALTERNC_LOC=""
# Networks that SMTP should relay, separated with spaces
SMTP_RELAY_NETWORKS=""
# the type of backup created by the sql backup script # the type of backup created by the sql backup script
# valid options are "rotate" (newsyslog-style) or "date" (suffix is the date) # valid options are "rotate" (newsyslog-style) or "date" (suffix is the date)
SQLBACKUP_TYPE="" SQLBACKUP_TYPE=""
@ -129,7 +126,6 @@ EOF
update_var alternc/sql/backup_type SQLBACKUP_TYPE update_var alternc/sql/backup_type SQLBACKUP_TYPE
update_var alternc/sql/backup_overwrite SQLBACKUP_OVERWRITE update_var alternc/sql/backup_overwrite SQLBACKUP_OVERWRITE
update_var alternc/alternc_location ALTERNC_LOC update_var alternc/alternc_location ALTERNC_LOC
update_var alternc/mynetwork SMTP_RELAY_NETWORKS
sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp
mv -f $CONFIGFILE.tmp $CONFIGFILE mv -f $CONFIGFILE.tmp $CONFIGFILE

View File

@ -154,12 +154,6 @@ if [ -z "$RET" ]
db_set alternc/alternc_location "$ALTERNC_LOC" db_set alternc/alternc_location "$ALTERNC_LOC"
fi fi
db_get alternc/mynetwork
if [ -z "$RET" ]
then
db_set alternc/mynetwork "$SMTP_RELAY_NETWORKS"
fi
db_input medium alternc/desktopname || true db_input medium alternc/desktopname || true
db_input medium alternc/hostingname || true db_input medium alternc/hostingname || true
db_input medium alternc/internal_ip || true db_input medium alternc/internal_ip || true
@ -177,7 +171,6 @@ db_input low alternc/sql/backup_type || true
db_input low alternc/sql/overwrite || true db_input low alternc/sql/overwrite || true
db_input low alternc/monitor_ip || true db_input low alternc/monitor_ip || true
db_input low alternc/bind_internal || true db_input low alternc/bind_internal || true
db_input low alternc/mynetwork || true
db_go db_go
# vim: et sw=4 # vim: et sw=4

View File

@ -93,9 +93,6 @@ MYSQL_CLIENT=""
# Folder holding data (used for quota management) # Folder holding data (used for quota management)
ALTERNC_LOC="" ALTERNC_LOC=""
# Networks that SMTP should relay, separated with spaces
SMTP_RELAY_NETWORKS=""
# the type of backup created by the sql backup script # the type of backup created by the sql backup script
# valid options are "rotate" (newsyslog-style) or "date" (suffix is the date) # valid options are "rotate" (newsyslog-style) or "date" (suffix is the date)
SQLBACKUP_TYPE="" SQLBACKUP_TYPE=""
@ -129,7 +126,6 @@ EOF
update_var alternc/sql/backup_type SQLBACKUP_TYPE update_var alternc/sql/backup_type SQLBACKUP_TYPE
update_var alternc/sql/backup_overwrite SQLBACKUP_OVERWRITE update_var alternc/sql/backup_overwrite SQLBACKUP_OVERWRITE
update_var alternc/alternc_location ALTERNC_LOC update_var alternc/alternc_location ALTERNC_LOC
update_var alternc/mynetwork SMTP_RELAY_NETWORKS
sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp
mv -f $CONFIGFILE.tmp $CONFIGFILE mv -f $CONFIGFILE.tmp $CONFIGFILE

3
debian/changelog vendored
View File

@ -19,6 +19,9 @@ alternc (0.9.9) stable; urgency=low
value or available domains value or available domains
* make a new alternc-slave package that eases installation on NFS-backed * make a new alternc-slave package that eases installation on NFS-backed
frontend nodes frontend nodes
* other changes:
* deprecate the mynetwork modification in Postfix, this is now left to the
admin
-- Antoine Beaupré <anarcat@koumbit.org> Tue, 15 Apr 2008 11:52:56 -0400 -- Antoine Beaupré <anarcat@koumbit.org> Tue, 15 Apr 2008 11:52:56 -0400

10
debian/templates vendored
View File

@ -148,11 +148,6 @@ _Description: trusted servers for bind:
IP address or prefix of trusted machines for DNS transfers, IP address or prefix of trusted machines for DNS transfers,
delimited by ';', optional. delimited by ';', optional.
Template: alternc/mynetwork
Type: string
_Description: SMTP authorized networks:
IP addresses of the networks authorized in SMTP, space-delimited.
Template: alternc/pop_before_smtp_warning Template: alternc/pop_before_smtp_warning
Type: note Type: note
_Description: POP Before SMTP deprecated _Description: POP Before SMTP deprecated
@ -337,11 +332,6 @@ _Description: trusted servers for bind:
IP address or prefix of trusted machines for DNS transfers, IP address or prefix of trusted machines for DNS transfers,
delimited by ';', optional. delimited by ';', optional.
Template:alternc-slave/mynetwork
Type: string
_Description: SMTP authorized networks:
IP addresses of the networks authorized in SMTP, space-delimited.
Template:alternc-slave/pop_before_smtp_warning Template:alternc-slave/pop_before_smtp_warning
Type: note Type: note
_Description: POP Before SMTP deprecated _Description: POP Before SMTP deprecated

View File

@ -23,7 +23,6 @@ default_destination_concurrency_limit = 10
myhostname = %%fqdn%% myhostname = %%fqdn%%
myorigin = %%fqdn%% myorigin = %%fqdn%%
mynetworks = 127.0.0.1 %%mynetwork%%
# Configuration TLS pour le serveur smtp : # Configuration TLS pour le serveur smtp :

View File

@ -136,7 +136,6 @@ s\\%%dbname%%\\$MYSQL_DATABASE\\;
s\\%%dbuser%%\\$MYSQL_USER\\; s\\%%dbuser%%\\$MYSQL_USER\\;
s\\%%dbpwd%%\\$MYSQL_PASS\\; s\\%%dbpwd%%\\$MYSQL_PASS\\;
s\\%%ALTERNC_LOC%%\\$ALTERNC_LOC\\; s\\%%ALTERNC_LOC%%\\$ALTERNC_LOC\\;
s\\%%mynetwork%%\\$SMTP_RELAY_NETWORKS\\;
s\\%%warning_message%%\\$WARNING\\; s\\%%warning_message%%\\$WARNING\\;
s\\%%fqdn_lettre%%\\$FQDN_LETTER\\; s\\%%fqdn_lettre%%\\$FQDN_LETTER\\;
s\\%%version%%\\$VERSION\\; s\\%%version%%\\$VERSION\\;