1.1 --- a/README.txt Wed Oct 21 00:27:36 2015 +0200
1.2 +++ b/README.txt Wed Oct 21 14:59:43 2015 +0200
1.3 @@ -74,9 +74,13 @@
1.4 useradd -d /var/lib/imip-agent -m -U -G www-data -r imip-agent
1.5
1.6 Again, the tools/init.sh script will initialise directories for stored and
1.7 -published data. For example:
1.8 +published data. The tools/config.sh script should be edited and the group
1.9 +redefined as follows:
1.10
1.11 - tools/init.sh imip-agent www-data
1.12 + IMIP_AGENT_GROUP=www-data
1.13 +
1.14 +If already installed, the /etc/imip-agent/config.sh script should be edited
1.15 +instead.
1.16
1.17 Installing the Software
1.18 =======================
1.19 @@ -120,9 +124,12 @@
1.20 Such files need adjusting for the deployment environment so that, for example,
1.21 the example.com domain would be replaced with a suitable value.
1.22
1.23 -Where $lmtp_socket is employed, a suitable filesystem path is required; see
1.24 +Where LMTP_SOCKET is employed, a suitable filesystem path is required; see
1.25 below for a discussion of LMTP and mail delivery.
1.26
1.27 +If local SMTP delivery is being used, the conf/postfix/master.cf.items file
1.28 +will need adjusting to use the appropriate system group.
1.29 +
1.30 Configuring Mail Systems for Mail Recipients
1.31 --------------------------------------------
1.32
2.1 --- a/conf/exim/30_exim4-config_people Wed Oct 21 00:27:36 2015 +0200
2.2 +++ b/conf/exim/30_exim4-config_people Wed Oct 21 14:59:43 2015 +0200
2.3 @@ -1,6 +1,6 @@
2.4 people_transport:
2.5 debug_print = "T: people_transport for $local_part@$domain"
2.6 driver = pipe
2.7 - command = /var/lib/imip-agent/imip_person.py -l $lmtp_socket -o $pipe_addresses
2.8 + command = /var/lib/imip-agent/imip_person.py -l LMTP_SOCKET -o $pipe_addresses
2.9 user = imip-agent
2.10 initgroups = true
3.1 --- a/conf/postfix/master.cf.items Wed Oct 21 00:27:36 2015 +0200
3.2 +++ b/conf/postfix/master.cf.items Wed Oct 21 14:59:43 2015 +0200
3.3 @@ -2,9 +2,9 @@
3.4 imip_resources unix - n n - - pipe
3.5 flags=FR user=imip-agent:lmtp argv=/var/lib/imip-agent/imip_resource.py
3.6 -o ${original_recipient}
3.7 -# Replace "-l $lmtp_socket" with "-L" for local SMTP delivery.
3.8 +# Replace "-l LMTP_SOCKET" with "-L" for local SMTP delivery.
3.9 imip_people unix - n n - - pipe
3.10 flags=FR user=imip-agent:lmtp argv=/var/lib/imip-agent/imip_person.py
3.11 - -o ${original_recipient} -l $lmtp_socket
3.12 + -o ${original_recipient} -l LMTP_SOCKET
3.13 imip_people_outgoing unix - n n - - pipe
3.14 flags=FR user=imip-agent:lmtp argv=/var/lib/imip-agent/imip_person_outgoing.py
4.1 --- a/conf/postfix/transport Wed Oct 21 00:27:36 2015 +0200
4.2 +++ b/conf/postfix/transport Wed Oct 21 14:59:43 2015 +0200
4.3 @@ -3,4 +3,4 @@
4.4 # iMIP content handling for example.com via the people address:
4.5 people@example.com imip_people:
4.6 # iMIP content handling for example.com via the people-outgoing address:
4.7 -people-outgoing@example.com imip_people_outgoing:
4.8 +people-outgoing@example.com imip_people_outgoing:
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/tools/config.sh Wed Oct 21 14:59:43 2015 +0200
5.3 @@ -0,0 +1,6 @@
5.4 +#!/bin/sh
5.5 +
5.6 +IMIP_AGENT_USER=imip-agent
5.7 +IMIP_AGENT_GROUP=lmtp
5.8 +INSTALL_DIR=/var/lib/imip-agent
5.9 +WEB_INSTALL_DIR=/var/www/imip-agent
6.1 --- a/tools/fix.sh Wed Oct 21 00:27:36 2015 +0200
6.2 +++ b/tools/fix.sh Wed Oct 21 14:59:43 2015 +0200
6.3 @@ -1,28 +1,33 @@
6.4 #!/bin/sh
6.5
6.6 +DIRNAME=`dirname $0`
6.7 +
6.8 +if [ -e "$DIRNAME/config.sh" ]; then
6.9 + . "$DIRNAME/config.sh"
6.10 +else
6.11 + . /etc/imip-agent/config.sh
6.12 +fi
6.13 +
6.14 PROGNAME=`basename $0`
6.15
6.16 -DEFAULT_USER=imip-agent
6.17 -DEFAULT_GROUP=lmtp
6.18 -DEFAULT_INSTALL_DIR=/var/lib/imip-agent
6.19 -DEFAULT_WEB_INSTALL_DIR=/var/www/imip-agent
6.20 -
6.21 if [ "$1" = "--help" ]; then
6.22 cat 1>&2 <<EOF
6.23 -Usage: $PROGNAME [ <user> [ <group> [ <stored data directory> [ <published data directory> ] ] ] ]
6.24 +Usage: $PROGNAME [ <stored data directory> [ <published data directory> [ <user> [ <group> ] ] ] ]
6.25
6.26 -Fix permissions for the stored and published data directories, using the given
6.27 -user and group (or, respectively, $DEFAULT_USER and $DEFAULT_GROUP if omitted),
6.28 -and operating on the given stored data and published data directories (or,
6.29 -respectively, $DEFAULT_INSTALL_DIR and $DEFAULT_WEB_INSTALL_DIR if omitted).
6.30 +Fix permissions for the stored and published data directories, operating on the
6.31 +given stored data and published data directories (or, respectively,
6.32 +$INSTALL_DIR and $WEB_INSTALL_DIR if omitted).
6.33 +
6.34 +Set ownership and membership using the given user and group (or, respectively,
6.35 +$IMIP_AGENT_USER and $IMIP_AGENT_GROUP if omitted).
6.36 EOF
6.37 exit 1
6.38 fi
6.39
6.40 -USER=${1:-$DEFAULT_USER}
6.41 -GROUP=${2:-$DEFAULT_GROUP}
6.42 -INSTALL_DIR=${3:-$DEFAULT_INSTALL_DIR}
6.43 -WEB_INSTALL_DIR=${4:-$DEFAULT_WEB_INSTALL_DIR}
6.44 +INSTALL_DIR=${1:-$INSTALL_DIR}
6.45 +WEB_INSTALL_DIR=${2:-$WEB_INSTALL_DIR}
6.46 +USER=${3:-$IMIP_AGENT_USER}
6.47 +GROUP=${4:-$IMIP_AGENT_GROUP}
6.48
6.49 chown -R "$USER" "$INSTALL_DIR"
6.50 chgrp -R "$GROUP" "$INSTALL_DIR"
7.1 --- a/tools/init.sh Wed Oct 21 00:27:36 2015 +0200
7.2 +++ b/tools/init.sh Wed Oct 21 14:59:43 2015 +0200
7.3 @@ -1,37 +1,43 @@
7.4 #!/bin/sh
7.5
7.6 +DIRNAME=`dirname $0`
7.7 +
7.8 +if [ -e "$DIRNAME/config.sh" ]; then
7.9 + . "$DIRNAME/config.sh"
7.10 +else
7.11 + . /etc/imip-agent/config.sh
7.12 +fi
7.13 +
7.14 PROGNAME=`basename $0`
7.15
7.16 -DEFAULT_USER=imip-agent
7.17 -DEFAULT_GROUP=lmtp
7.18 -DEFAULT_INSTALL_DIR=/var/lib/imip-agent
7.19 -DEFAULT_WEB_INSTALL_DIR=/var/www/imip-agent
7.20 -
7.21 if [ "$1" = "--help" ]; then
7.22 cat 1>&2 <<EOF
7.23 -Usage: $PROGNAME [ <user> [ <group> [ <stored data directory> [ <published data directory> ] ] ] ]
7.24 +Usage: $PROGNAME [ <stored data directory> [ <published data directory> [ <user> [ <group> ] ] ] ]
7.25
7.26 -Initialise stored and published data directories with permissions set to the
7.27 -given user and group (or, respectively, $DEFAULT_USER and $DEFAULT_GROUP if omitted),
7.28 -and with the given stored data and published data directories (or, respectively,
7.29 -$DEFAULT_INSTALL_DIR and $DEFAULT_WEB_INSTALL_DIR if omitted).
7.30 +Initialise stored and published data directories either at any specified
7.31 +locations or, respectively, at $INSTALL_DIR and $WEB_INSTALL_DIR.
7.32 +
7.33 +Set permissions to the given user and group or, respectively, to $IMIP_AGENT_USER
7.34 +and $IMIP_AGENT_GROUP.
7.35
7.36 -Within the stored data directory, the following directories are created:
7.37 +Within the stored data directory (using $INSTALL_DIR as an example), the
7.38 +following directories are created:
7.39
7.40 - * $DEFAULT_INSTALL_DIR/store
7.41 - * $DEFAULT_INSTALL_DIR/preferences
7.42 + * $INSTALL_DIR/store
7.43 + * $INSTALL_DIR/preferences
7.44
7.45 -Within the published data directory, the following directory is created:
7.46 +Within the published data directory (using $WEB_INSTALL_DIR as an example), the
7.47 +following directory is created:
7.48
7.49 - * $DEFAULT_WEB_INSTALL_DIR/static
7.50 + * $WEB_INSTALL_DIR/static
7.51 EOF
7.52 exit 1
7.53 fi
7.54
7.55 -USER=${1:-$DEFAULT_USER}
7.56 -GROUP=${2:-$DEFAULT_GROUP}
7.57 -INSTALL_DIR=${3:-$DEFAULT_INSTALL_DIR}
7.58 -WEB_INSTALL_DIR=${4:-$DEFAULT_WEB_INSTALL_DIR}
7.59 +INSTALL_DIR=${1:-$INSTALL_DIR}
7.60 +WEB_INSTALL_DIR=${2:-$WEB_INSTALL_DIR}
7.61 +USER=${3:-$IMIP_AGENT_USER}
7.62 +GROUP=${4:-$IMIP_AGENT_GROUP}
7.63
7.64 for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
7.65 mkdir -p "$DIR"
8.1 --- a/tools/init_user.sh Wed Oct 21 00:27:36 2015 +0200
8.2 +++ b/tools/init_user.sh Wed Oct 21 14:59:43 2015 +0200
8.3 @@ -1,27 +1,33 @@
8.4 #!/bin/sh
8.5
8.6 +DIRNAME=`dirname $0`
8.7 +
8.8 +if [ -e "$DIRNAME/config.sh" ]; then
8.9 + . "$DIRNAME/config.sh"
8.10 +else
8.11 + . /etc/imip-agent/config.sh
8.12 +fi
8.13 +
8.14 PROGNAME=`basename $0`
8.15
8.16 -DEFAULT_USER=imip-agent
8.17 -DEFAULT_INSTALL_DIR=/var/lib/imip-agent
8.18 -DEFAULT_WEB_INSTALL_DIR=/var/www/imip-agent
8.19 -
8.20 if [ "$1" = "--help" ]; then
8.21 cat 1>&2 <<EOF
8.22 -Usage: $PROGNAME <calendar user> [ <user> [ <stored data directory> [ <published data directory> ] ] ]
8.23 +Usage: $PROGNAME <calendar user> [ <stored data directory> [ <published data directory> [ <user> ] ] ]
8.24
8.25 -Initialise a given calendar user within an existing installation, using the
8.26 -given system user for ownership and the installation's stored data and published
8.27 -data directories (or, respectively, $DEFAULT_USER, $DEFAULT_INSTALL_DIR and
8.28 -$DEFAULT_WEB_INSTALL_DIR if omitted).
8.29 +Initialise a given calendar user within an existing installation, creating
8.30 +resources within the given stored data and published data directories or,
8.31 +respectively, within $INSTALL_DIR and $WEB_INSTALL_DIR.
8.32 +
8.33 +The resources will be defined as having the given system user as owner or,
8.34 +if the user is omitted, the $IMIP_AGENT_USER as owner.
8.35 EOF
8.36 exit 1
8.37 fi
8.38
8.39 -CALENDAR_USER=${1:-$DEFAULT_CALENDAR_USER}
8.40 -USER=${2:-$DEFAULT_USER}
8.41 -INSTALL_DIR=${3:-$DEFAULT_INSTALL_DIR}
8.42 -WEB_INSTALL_DIR=${4:-$DEFAULT_WEB_INSTALL_DIR}
8.43 +CALENDAR_USER=$1
8.44 +INSTALL_DIR=${2:-$INSTALL_DIR}
8.45 +WEB_INSTALL_DIR=${3:-$WEB_INSTALL_DIR}
8.46 +USER=${4:-$IMIP_AGENT_USER}
8.47
8.48 for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
8.49 mkdir -p "$DIR/$CALENDAR_USER"
9.1 --- a/tools/install.sh Wed Oct 21 00:27:36 2015 +0200
9.2 +++ b/tools/install.sh Wed Oct 21 14:59:43 2015 +0200
9.3 @@ -16,9 +16,9 @@
9.4
9.5 if [ ! -e "$INSTALL_DIR/imiptools" ]; then
9.6 mkdir "$INSTALL_DIR/imiptools"
9.7 - if [ ! -e "$INSTALL_DIR/imiptools" ]; then
9.8 - mkdir "$INSTALL_DIR/imiptools/handlers"
9.9 - fi
9.10 +fi
9.11 +if [ ! -e "$INSTALL_DIR/imiptools/handlers" ]; then
9.12 + mkdir "$INSTALL_DIR/imiptools/handlers"
9.13 fi
9.14
9.15 # Remove any symbolic link to the config module.
9.16 @@ -44,11 +44,21 @@
9.17 fi
9.18 fi
9.19
9.20 +if [ -e "$CONFIG_DIR/config.sh" ]; then
9.21 + if [ ! -e "$CONFIG_DIR/config.sh.backup" ]; then
9.22 + mv "$CONFIG_DIR/config.sh" "$CONFIG_DIR/config.sh.backup"
9.23 + fi
9.24 +fi
9.25 +
9.26 # Replace the config module with a symbolic link.
9.27
9.28 mv "$INSTALL_DIR/imiptools/config.py" "$CONFIG_DIR/"
9.29 ln -s "$CONFIG_DIR/config.py" "$INSTALL_DIR/imiptools/config.py"
9.30
9.31 +# Copy the config script.
9.32 +
9.33 +cp tools/config.sh "$CONFIG_DIR/"
9.34 +
9.35 # Tools
9.36
9.37 TOOLS="fix.sh init.sh init_user.sh make_freebusy.py"