# HG changeset patch # User Paul Boddie # Date 1442506120 -7200 # Node ID e332784ba2bbe5d04881a0e229d6132a956c6552 # Parent 67a3c848daf711e15c90493b7a666b07821b83e6 Added a setting to control Web publication of free/busy details. Introduced separate files for Web server configuration and added a description of the Web server configuration activity. Added a test for publishing to the free/busy script. diff -r 67a3c848daf7 -r e332784ba2bb README.txt --- a/README.txt Tue Sep 15 00:28:09 2015 +0200 +++ b/README.txt Thu Sep 17 18:08:40 2015 +0200 @@ -238,6 +238,33 @@ Where frequency-specific directories are not supported by cron on a system, a crontab entry of the appropriate format is required instead. +Configuring Web Servers for Free/Busy Publishing +------------------------------------------------ + +Each user may request the publishing of their free/busy information by +configuring certain settings. The conf/apache/imip-agent.conf file provides a +configuration file for deployment with the Apache Web server software that +exposes a directory for Web publishing containing the published free/busy +information. + +Access to free/busy information may not be moderated, but Web server +directives can be introduced to impose access controls. Mail programs that +wish to consult the free/busy information may have problems in dealing with +authentication mechanisms, however, and it may be regarded as acceptable in +certain environments to expose such information publicly or with +network-specific access constraints. + +Configuring Web Servers for the Calendar Management Interface +------------------------------------------------------------- + +A calendar management interface is provided to allow users to view and +interact with their calendars through the Web. The +conf/apache/imip-manager.conf file provides a configuration file for +deployment with the Apache Web server software that enables this interface. + +Since such access to calendars should only be performed by identified +users, access controls are suggested in the configuration file. + Prerequisites ============= diff -r 67a3c848daf7 -r e332784ba2bb conf/apache/imip-agent.conf --- a/conf/apache/imip-agent.conf Tue Sep 15 00:28:09 2015 +0200 +++ b/conf/apache/imip-agent.conf Thu Sep 17 18:08:40 2015 +0200 @@ -1,11 +1,11 @@ Alias /freebusy /var/www/imip-agent/static/ -Alias /imip-manager/styles.css /var/www/imip-agent/styles.css -ScriptAlias /imip-manager /var/www/imip-agent/imip_manager.py + +# Enable this directive to protect published free/busy information. - - AuthType basic - AuthName "imip-manager" - AuthBasicProvider ldap - AuthLDAPUrl "ldap://localhost/ou=People,dc=example,dc=com?mail?sub" - Require valid-user - +# +# AuthType basic +# AuthName "imip-agent" +# AuthBasicProvider ldap +# AuthLDAPUrl "ldap://localhost/ou=People,dc=example,dc=com?mail?sub" +# Require valid-user +# diff -r 67a3c848daf7 -r e332784ba2bb conf/apache/imip-manager.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/apache/imip-manager.conf Thu Sep 17 18:08:40 2015 +0200 @@ -0,0 +1,21 @@ +Alias /imip-manager/styles.css /var/www/imip-agent/styles.css +ScriptAlias /imip-manager /var/www/imip-agent/imip_manager.py + + + AuthType basic + AuthName "imip-manager" + + # Choose one of the sections below. + + # LDAP authentication... + AuthBasicProvider ldap + AuthLDAPUrl "ldap://localhost/ou=People,dc=example,dc=com?mail?sub" + + # Simple file-based authentication... + #AuthUserFile /var/www/imip-agent/users + + # Access policy. Where users and groups are involved, specific users or + # groups can be required here. + + Require valid-user + diff -r 67a3c848daf7 -r e332784ba2bb docs/preferences.txt --- a/docs/preferences.txt Tue Sep 15 00:28:09 2015 +0200 +++ b/docs/preferences.txt Thu Sep 17 18:08:40 2015 +0200 @@ -49,7 +49,8 @@ Alternative: always Indicate whether to bundle free/busy details with other payloads such as -event and free/busy objects. +event and free/busy objects. The freebusy_sharing setting must be configured +for bundling to operate. freebusy_messages ----------------- @@ -79,6 +80,15 @@ 600 extend scheduling offers for 10 minutes 1d extend offers for 1 day +freebusy_publishing +------------------- + +Default: no +Alternative: publish + +Indicate whether to publish free/busy details as Web resources. The +freebusy_sharing setting must be configured for publishing to operate. + freebusy_sharing ---------------- @@ -89,7 +99,8 @@ * bundling in e-mail messages if bundling is configured * responding to free/busy requests via e-mail - * publishing as Web resources if a static Web resource is configured + * publishing as Web resources if a static Web resource is configured and if + publishing is configured incoming -------- diff -r 67a3c848daf7 -r e332784ba2bb imiptools/client.py --- a/imiptools/client.py Tue Sep 15 00:28:09 2015 +0200 +++ b/imiptools/client.py Thu Sep 17 18:08:40 2015 +0200 @@ -89,22 +89,44 @@ return get_window_end(self.get_tzid(), self.get_window_size()) def is_participating(self): + + "Return participation in the calendar system." + prefs = self.get_preferences() return prefs and prefs.get("participating", "participate") != "no" or False def is_sharing(self): + + "Return whether free/busy information is being generally shared." + prefs = self.get_preferences() return prefs and prefs.get("freebusy_sharing") == "share" or False def is_bundling(self): + + "Return whether free/busy information is being bundled in messages." + prefs = self.get_preferences() return prefs and prefs.get("freebusy_bundling") == "always" or False def is_notifying(self): + + "Return whether recipients are notified about free/busy payloads." + prefs = self.get_preferences() return prefs and prefs.get("freebusy_messages") == "notify" or False + def is_publishing(self): + + "Return whether free/busy information is being published as Web resources." + + prefs = self.get_preferences() + return prefs and prefs.get("freebusy_publishing") == "publish" or False + def is_refreshing(self): + + "Return whether a recipient supports requests to refresh event details." + prefs = self.get_preferences() return prefs and prefs.get("event_refreshing") == "always" or False diff -r 67a3c848daf7 -r e332784ba2bb imiptools/handlers/common.py --- a/imiptools/handlers/common.py Tue Sep 15 00:28:09 2015 +0200 +++ b/imiptools/handlers/common.py Thu Sep 17 18:08:40 2015 +0200 @@ -129,7 +129,7 @@ self.remove_freebusy_for_recurrences(freebusy, self.store.get_recurrences(self.user, self.uid)) self.store.set_freebusy(self.user, freebusy) - if self.publisher and self.is_sharing(): + if self.publisher and self.is_sharing() and self.is_publishing(): self.publisher.set_freebusy(self.user, freebusy) # Update free/busy provider information if the event may recur @@ -150,7 +150,7 @@ self.remove_freebusy_for_recurrences(freebusy) self.store.set_freebusy(self.user, freebusy) - if self.publisher and self.is_sharing(): + if self.publisher and self.is_sharing() and self.is_publishing(): self.publisher.set_freebusy(self.user, freebusy) # Update free/busy provider information if the event may recur diff -r 67a3c848daf7 -r e332784ba2bb imipweb/resource.py --- a/imipweb/resource.py Tue Sep 15 00:28:09 2015 +0200 +++ b/imipweb/resource.py Thu Sep 17 18:08:40 2015 +0200 @@ -225,7 +225,7 @@ "Publish the details if configured to share them." - if self.publisher and self.is_sharing(): + if self.publisher and self.is_sharing() and self.is_publishing(): self.publisher.set_freebusy(self.user, freebusy) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 67a3c848daf7 -r e332784ba2bb tools/make_freebusy.py --- a/tools/make_freebusy.py Tue Sep 15 00:28:09 2015 +0200 +++ b/tools/make_freebusy.py Thu Sep 17 18:08:40 2015 +0200 @@ -22,6 +22,7 @@ """ from codecs import getwriter +from imiptools.client import Client from imiptools.data import get_window_end, Object from imiptools.dates import get_default_timezone, to_utc_datetime from imiptools.period import insert_period @@ -107,7 +108,9 @@ if store_and_publish: if user == participant: store.set_freebusy(user, fb) - publisher.set_freebusy(user, fb) + + if Client(user).is_sharing() and Client(user).is_publishing(): + publisher.set_freebusy(user, fb) # Update the list of objects providing periods on future occasions.