<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12483] CalendarServer/trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12483">12483</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-01-30 13:20:16 -0800 (Thu, 30 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Starting work on directory proxy service</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertapcaldavpy">CalendarServer/trunk/calendarserver/tap/caldav.py</a></li>
<li><a href="#CalendarServertrunktwistedpluginscaldavpy">CalendarServer/trunk/twisted/plugins/caldav.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstdconfigpy">CalendarServer/trunk/twistedcaldav/stdconfig.py</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>CalendarServer/trunk/txdav/dps/</li>
<li><a href="#CalendarServertrunktxdavdps__init__py">CalendarServer/trunk/txdav/dps/__init__.py</a></li>
<li><a href="#CalendarServertrunktxdavdpsprotocolpy">CalendarServer/trunk/txdav/dps/protocol.py</a></li>
<li><a href="#CalendarServertrunktxdavdpsservicepy">CalendarServer/trunk/txdav/dps/service.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarservertapcaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/caldav.py (12482 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/caldav.py        2014-01-30 18:51:26 UTC (rev 12482)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -520,6 +520,27 @@
</span><span class="cx"> )
</span><span class="cx"> self.monitor.addProcessObject(process, PARENT_ENVIRONMENT)
</span><span class="cx">
</span><ins>+ if (
+ config.DirectoryProxy.Enabled and
+ config.DirectoryProxy.SocketPath != ""
+ ):
+ log.info("Adding directory proxy service")
+
+ dpsArgv = [
+ sys.executable,
+ sys.argv[0],
+ ]
+ if config.UserName:
+ dpsArgv.extend(("-u", config.UserName))
+ if config.GroupName:
+ dpsArgv.extend(("-g", config.GroupName))
+ dpsArgv.extend((
+ "--reactor=%s" % (config.Twisted.reactor,),
+ "-n", "caldav_directoryproxy",
+ "-f", self.configPath,
+ ))
+ self.monitor.addProcess("directoryproxy", dpsArgv,
+ env=PARENT_ENVIRONMENT)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> class WorkSchedulingService(Service):
</span></span></pre></div>
<a id="CalendarServertrunktwistedpluginscaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twisted/plugins/caldav.py (12482 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twisted/plugins/caldav.py        2014-01-30 18:51:26 UTC (rev 12482)
+++ CalendarServer/trunk/twisted/plugins/caldav.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> from twisted.internet.protocol import Factory
</span><span class="cx"> Factory.noisy = False
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def serviceMakerProperty(propname):
</span><span class="cx"> def getProperty(self):
</span><span class="cx"> return getattr(reflect.namedClass(self.serviceMakerClass), propname)
</span><span class="lines">@@ -50,3 +51,4 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> TwistedCalDAV = TAP("calendarserver.tap.caldav.CalDAVServiceMaker")
</span><ins>+DirectoryProxy = TAP("txdav.dps.service.DirectoryProxyServiceMaker")
</ins></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py (12482 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/stdconfig.py        2014-01-30 18:51:26 UTC (rev 12482)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx">
</span><span class="cx"> from twisted.python.runtime import platform
</span><span class="cx">
</span><del>-from plistlib import PlistParser #@UnresolvedImport
</del><ins>+from plistlib import PlistParser # @UnresolvedImport
</ins><span class="cx"> from twext.python.log import Logger, InvalidLogLevelError, LogLevel
</span><span class="cx"> from txweb2.dav.resource import TwistedACLInheritable
</span><span class="cx">
</span><span class="lines">@@ -52,25 +52,25 @@
</span><span class="cx"> "twistedcaldav.directory.xmlfile.XMLDirectoryService": {
</span><span class="cx"> "xmlFile": "accounts.xml",
</span><span class="cx"> "recordTypes": ("users", "groups"),
</span><del>- "statSeconds" : 15,
</del><ins>+ "statSeconds": 15,
</ins><span class="cx"> },
</span><span class="cx"> "twistedcaldav.directory.appleopendirectory.OpenDirectoryService": {
</span><span class="cx"> "node": "/Search",
</span><del>- "cacheTimeout": 1, # Minutes
- "batchSize": 100, # for splitting up large queries
</del><ins>+ "cacheTimeout": 1, # Minutes
+ "batchSize": 100, # for splitting up large queries
</ins><span class="cx"> "negativeCaching": False,
</span><span class="cx"> "restrictEnabledRecords": False,
</span><span class="cx"> "restrictToGroup": "",
</span><span class="cx"> "recordTypes": ("users", "groups"),
</span><span class="cx"> },
</span><span class="cx"> "twistedcaldav.directory.ldapdirectory.LdapDirectoryService": {
</span><del>- "cacheTimeout": 1, # Minutes
</del><ins>+ "cacheTimeout": 1, # Minutes
</ins><span class="cx"> "negativeCaching": False,
</span><span class="cx"> "warningThresholdSeconds": 3,
</span><del>- "batchSize": 500, # for splitting up large queries
- "requestTimeoutSeconds" : 10,
- "requestResultsLimit" : 200,
- "optimizeMultiName" : False,
</del><ins>+ "batchSize": 500, # for splitting up large queries
+ "requestTimeoutSeconds": 10,
+ "requestResultsLimit": 200,
+ "optimizeMultiName": False,
</ins><span class="cx"> "queryLocationsImplicitly": True,
</span><span class="cx"> "restrictEnabledRecords": False,
</span><span class="cx"> "restrictToGroup": "",
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> "tls": False,
</span><span class="cx"> "tlsCACertFile": None,
</span><span class="cx"> "tlsCACertDir": None,
</span><del>- "tlsRequireCert": None, # never, allow, try, demand, hard
</del><ins>+ "tlsRequireCert": None, # never, allow, try, demand, hard
</ins><span class="cx"> "credentials": {
</span><span class="cx"> "dn": None,
</span><span class="cx"> "password": None,
</span><span class="lines">@@ -90,76 +90,76 @@
</span><span class="cx"> "guidAttr": "entryUUID",
</span><span class="cx"> "users": {
</span><span class="cx"> "rdn": "ou=People",
</span><del>- "attr": "uid", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
- "filter": None, # additional filter for this type
- "loginEnabledAttr" : "", # attribute controlling login
- "loginEnabledValue" : "yes", # "True" value of above attribute
- "calendarEnabledAttr" : "", # attribute controlling enabledForCalendaring
- "calendarEnabledValue" : "yes", # "True" value of above attribute
- "mapping" : { # maps internal record names to LDAP
</del><ins>+ "attr": "uid", # used only to synthesize email address
+ "emailSuffix": None, # used only to synthesize email address
+ "filter": None, # additional filter for this type
+ "loginEnabledAttr": "", # attribute controlling login
+ "loginEnabledValue": "yes", # "True" value of above attribute
+ "calendarEnabledAttr": "", # attribute controlling enabledForCalendaring
+ "calendarEnabledValue": "yes", # "True" value of above attribute
+ "mapping": { # maps internal record names to LDAP
</ins><span class="cx"> "recordName": "uid",
</span><del>- "fullName" : "cn",
- "emailAddresses" : ["mail"],
- "firstName" : "givenName",
- "lastName" : "sn",
</del><ins>+ "fullName": "cn",
+ "emailAddresses": ["mail"],
+ "firstName": "givenName",
+ "lastName": "sn",
</ins><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> "groups": {
</span><span class="cx"> "rdn": "ou=Group",
</span><del>- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
- "filter": None, # additional filter for this type
- "mapping" : { # maps internal record names to LDAP
</del><ins>+ "attr": "cn", # used only to synthesize email address
+ "emailSuffix": None, # used only to synthesize email address
+ "filter": None, # additional filter for this type
+ "mapping": { # maps internal record names to LDAP
</ins><span class="cx"> "recordName": "cn",
</span><del>- "fullName" : "cn",
- "emailAddresses" : ["mail"],
- "firstName" : "givenName",
- "lastName" : "sn",
</del><ins>+ "fullName": "cn",
+ "emailAddresses": ["mail"],
+ "firstName": "givenName",
+ "lastName": "sn",
</ins><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> "locations": {
</span><span class="cx"> "rdn": "ou=Places",
</span><del>- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
- "filter": None, # additional filter for this type
- "calendarEnabledAttr" : "", # attribute controlling enabledForCalendaring
- "calendarEnabledValue" : "yes", # "True" value of above attribute
- "mapping" : { # maps internal record names to LDAP
</del><ins>+ "attr": "cn", # used only to synthesize email address
+ "emailSuffix": None, # used only to synthesize email address
+ "filter": None, # additional filter for this type
+ "calendarEnabledAttr": "", # attribute controlling enabledForCalendaring
+ "calendarEnabledValue": "yes", # "True" value of above attribute
+ "mapping": { # maps internal record names to LDAP
</ins><span class="cx"> "recordName": "cn",
</span><del>- "fullName" : "cn",
- "emailAddresses" : ["mail"],
- "firstName" : "givenName",
- "lastName" : "sn",
</del><ins>+ "fullName": "cn",
+ "emailAddresses": ["mail"],
+ "firstName": "givenName",
+ "lastName": "sn",
</ins><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> "resources": {
</span><span class="cx"> "rdn": "ou=Resources",
</span><del>- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
- "filter": None, # additional filter for this type
- "calendarEnabledAttr" : "", # attribute controlling enabledForCalendaring
- "calendarEnabledValue" : "yes", # "True" value of above attribute
- "mapping" : { # maps internal record names to LDAP
</del><ins>+ "attr": "cn", # used only to synthesize email address
+ "emailSuffix": None, # used only to synthesize email address
+ "filter": None, # additional filter for this type
+ "calendarEnabledAttr": "", # attribute controlling enabledForCalendaring
+ "calendarEnabledValue": "yes", # "True" value of above attribute
+ "mapping": { # maps internal record names to LDAP
</ins><span class="cx"> "recordName": "cn",
</span><del>- "fullName" : "cn",
- "emailAddresses" : ["mail"],
- "firstName" : "givenName",
- "lastName" : "sn",
</del><ins>+ "fullName": "cn",
+ "emailAddresses": ["mail"],
+ "firstName": "givenName",
+ "lastName": "sn",
</ins><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> "groupSchema": {
</span><del>- "membersAttr": "member", # how members are specified
- "nestedGroupsAttr": None, # how nested groups are specified
- "memberIdAttr": None, # which attribute the above refer to
</del><ins>+ "membersAttr": "member", # how members are specified
+ "nestedGroupsAttr": None, # how nested groups are specified
+ "memberIdAttr": None, # which attribute the above refer to
</ins><span class="cx"> },
</span><span class="cx"> "resourceSchema": {
</span><del>- "resourceInfoAttr": None, # contains location/resource info
- "autoAcceptGroupAttr": None, # auto accept group
</del><ins>+ "resourceInfoAttr": None, # contains location/resource info
+ "autoAcceptGroupAttr": None, # auto accept group
</ins><span class="cx"> },
</span><span class="cx"> "poddingSchema": {
</span><del>- "serverIdAttr": None, # maps to augments server-id
</del><ins>+ "serverIdAttr": None, # maps to augments server-id
</ins><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> }
</span><span class="lines">@@ -167,22 +167,22 @@
</span><span class="cx"> DEFAULT_RESOURCE_PARAMS = {
</span><span class="cx"> "twistedcaldav.directory.xmlfile.XMLDirectoryService": {
</span><span class="cx"> "xmlFile": "resources.xml",
</span><del>- "recordTypes" : ("locations", "resources", "addresses"),
</del><ins>+ "recordTypes": ("locations", "resources", "addresses"),
</ins><span class="cx"> },
</span><span class="cx"> "twistedcaldav.directory.appleopendirectory.OpenDirectoryService": {
</span><span class="cx"> "node": "/Search",
</span><del>- "cacheTimeout": 1, # Minutes
</del><ins>+ "cacheTimeout": 1, # Minutes
</ins><span class="cx"> "negativeCaching": False,
</span><span class="cx"> "restrictEnabledRecords": False,
</span><span class="cx"> "restrictToGroup": "",
</span><del>- "recordTypes" : ("locations", "resources"),
</del><ins>+ "recordTypes": ("locations", "resources"),
</ins><span class="cx"> },
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> DEFAULT_AUGMENT_PARAMS = {
</span><span class="cx"> "twistedcaldav.directory.augment.AugmentXMLDB": {
</span><span class="cx"> "xmlFiles": ["augments.xml", ],
</span><del>- "statSeconds" : 15,
</del><ins>+ "statSeconds": 15,
</ins><span class="cx"> },
</span><span class="cx"> "twistedcaldav.directory.augment.AugmentSqliteDB": {
</span><span class="cx"> "dbpath": "augments.sqlite",
</span><span class="lines">@@ -229,8 +229,8 @@
</span><span class="cx"> "standardizeSyntheticUIDs": False,
</span><span class="cx"> "addDSAttrXProperties": False,
</span><span class="cx"> "appleInternalServer": False,
</span><del>- "additionalAttributes" : [],
- "allowedAttributes" : [],
</del><ins>+ "additionalAttributes": [],
+ "allowedAttributes": [],
</ins><span class="cx"> },
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -248,14 +248,16 @@
</span><span class="cx"> #
</span><span class="cx"> "ServerHostName": "", # Network host name.
</span><span class="cx"> "HTTPPort": 0, # HTTP port (0 to disable HTTP)
</span><del>- "SSLPort" : 0, # SSL port (0 to disable HTTPS)
- "EnableSSL" : False, # Whether to listen on SSL port(s)
- "RedirectHTTPToHTTPS" : False, # If True, all nonSSL requests redirected to an SSL Port
- "SSLMethod" : "SSLv3_METHOD", # SSLv2_METHOD, SSLv3_METHOD, SSLv23_METHOD, TLSv1_METHOD
- "SSLCiphers" : "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM",
- "StrictTransportSecuritySeconds" : 7 * 24 * 60 * 60, # max-age value for
- # Strict-Transport-Security header; set to 0 to disable header.
</del><ins>+ "SSLPort": 0, # SSL port (0 to disable HTTPS)
+ "EnableSSL": False, # Whether to listen on SSL port(s)
+ "RedirectHTTPToHTTPS": False, # If True, all nonSSL requests redirected to an SSL Port
+ "SSLMethod": "SSLv3_METHOD", # SSLv2_METHOD, SSLv3_METHOD, SSLv23_METHOD, TLSv1_METHOD
+ "SSLCiphers": "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM",
</ins><span class="cx">
</span><ins>+ # Max-age value for Strict-Transport-Security header; set to 0 to
+ # disable header.
+ "StrictTransportSecuritySeconds": 7 * 24 * 60 * 60,
+
</ins><span class="cx"> #
</span><span class="cx"> # Network address configuration information
</span><span class="cx"> #
</span><span class="lines">@@ -264,54 +266,54 @@
</span><span class="cx"> "BindAddresses": [], # List of IP addresses to bind to [empty = all]
</span><span class="cx"> "BindHTTPPorts": [], # List of port numbers to bind to for HTTP
</span><span class="cx"> # [empty = same as "Port"]
</span><del>- "BindSSLPorts" : [], # List of port numbers to bind to for SSL
</del><ins>+ "BindSSLPorts": [], # List of port numbers to bind to for SSL
</ins><span class="cx"> # [empty = same as "SSLPort"]
</span><del>- "InheritFDs" : [], # File descriptors to inherit for HTTP requests
</del><ins>+ "InheritFDs": [], # File descriptors to inherit for HTTP requests
</ins><span class="cx"> # (empty = don't inherit)
</span><span class="cx"> "InheritSSLFDs": [], # File descriptors to inherit for HTTPS requests
</span><span class="cx"> # (empty = don't inherit)
</span><del>- "MetaFD" : 0, # Inherited file descriptor to call recvmsg() on to
</del><ins>+ "MetaFD": 0, # Inherited file descriptor to call recvmsg() on to
</ins><span class="cx"> # receive sockets (none = don't inherit)
</span><span class="cx">
</span><del>- "UseMetaFD" : True, # Use a 'meta' FD, i.e. an FD to transmit other FDs
</del><ins>+ "UseMetaFD": True, # Use a 'meta' FD, i.e. an FD to transmit other FDs
</ins><span class="cx"> # to slave processes.
</span><span class="cx">
</span><del>- "UseDatabase" : True, # True: database; False: files
</del><ins>+ "UseDatabase": True, # True: database; False: files
</ins><span class="cx">
</span><del>- "TransactionTimeoutSeconds" : 0, # Timeout transactions that take longer than
</del><ins>+ "TransactionTimeoutSeconds": 0, # Timeout transactions that take longer than
</ins><span class="cx"> # the specified number of seconds. Zero means
</span><span class="cx"> # no timeouts
</span><span class="cx">
</span><del>- "DBType" : "", # 2 possible values: empty, meaning 'spawn postgres
</del><ins>+ "DBType": "", # 2 possible values: empty, meaning 'spawn postgres
</ins><span class="cx"> # yourself', or 'postgres', meaning 'connect to a
</span><span class="cx"> # postgres database as specified by the 'DSN'
</span><span class="cx"> # configuration key. Will support more values in
</span><span class="cx"> # the future.
</span><span class="cx">
</span><del>- "SpawnedDBUser" : "caldav", # The username to use when DBType is empty
</del><ins>+ "SpawnedDBUser": "caldav", # The username to use when DBType is empty
</ins><span class="cx">
</span><del>- "DBImportFile" : "", # File path to SQL file to import at startup (includes schema)
</del><ins>+ "DBImportFile": "", # File path to SQL file to import at startup (includes schema)
</ins><span class="cx">
</span><del>- "DSN" : "", # Data Source Name. Used to connect to an external
</del><ins>+ "DSN": "", # Data Source Name. Used to connect to an external
</ins><span class="cx"> # database if DBType is non-empty. Format varies
</span><span class="cx"> # depending on database type.
</span><span class="cx">
</span><del>- "DBAMPFD" : 0, # Internally used by database to tell slave
</del><ins>+ "DBAMPFD": 0, # Internally used by database to tell slave
</ins><span class="cx"> # processes to inherit a file descriptor and use it
</span><span class="cx"> # as an AMP connection over a UNIX socket; see
</span><span class="cx"> # twext.enterprise.adbapi2.ConnectionPoolConnection
</span><span class="cx">
</span><del>- "SharedConnectionPool" : False, # Use a shared database connection pool in
</del><ins>+ "SharedConnectionPool": False, # Use a shared database connection pool in
</ins><span class="cx"> # the master process, rather than having
</span><span class="cx"> # each client make its connections directly.
</span><span class="cx">
</span><del>- "FailIfUpgradeNeeded" : True, # Set to True to prevent the server or utility
</del><ins>+ "FailIfUpgradeNeeded": True, # Set to True to prevent the server or utility
</ins><span class="cx"> # tools from running if the database needs a schema
</span><span class="cx"> # upgrade.
</span><del>- "StopAfterUpgradeTriggerFile" : "stop_after_upgrade", # if this file exists in ConfigRoot, stop
</del><ins>+ "StopAfterUpgradeTriggerFile": "stop_after_upgrade", # if this file exists in ConfigRoot, stop
</ins><span class="cx"> # the service after finishing upgrade phase
</span><span class="cx">
</span><del>- "UpgradeHomePrefix" : "", # When upgrading, only upgrade homes where the owner UID starts with
</del><ins>+ "UpgradeHomePrefix": "", # When upgrading, only upgrade homes where the owner UID starts with
</ins><span class="cx"> # with the specified prefix. The upgrade will only be partial and only
</span><span class="cx"> # apply to upgrade pieces that affect entire homes. The upgrade will
</span><span class="cx"> # need to be run again without this prefix set to complete the overall
</span><span class="lines">@@ -320,42 +322,42 @@
</span><span class="cx"> #
</span><span class="cx"> # Work queue configuration information
</span><span class="cx"> #
</span><del>- "WorkQueue" : {
</del><ins>+ "WorkQueue": {
</ins><span class="cx"> "ampPort": 7654, # Port used for hosts in a cluster to take to each other
</span><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> #
</span><span class="cx"> # Types of service provided
</span><span class="cx"> #
</span><del>- "EnableCalDAV" : True, # Enable CalDAV service
- "EnableCardDAV" : True, # Enable CardDAV service
</del><ins>+ "EnableCalDAV": True, # Enable CalDAV service
+ "EnableCardDAV": True, # Enable CardDAV service
</ins><span class="cx">
</span><span class="cx"> #
</span><span class="cx"> # Data store
</span><span class="cx"> #
</span><del>- "ServerRoot" : "/var/db/caldavd",
- "DataRoot" : "Data",
- "DatabaseRoot" : "Database",
- "AttachmentsRoot" : "Attachments",
- "DocumentRoot" : "Documents",
- "ConfigRoot" : "Config",
- "LogRoot" : "/var/log/caldavd",
- "RunRoot" : "/var/run/caldavd",
- "WebCalendarRoot" : "/Applications/Server.app/Contents/ServerRoot/usr/share/collabd/webcal/public",
</del><ins>+ "ServerRoot": "/var/db/caldavd",
+ "DataRoot": "Data",
+ "DatabaseRoot": "Database",
+ "AttachmentsRoot": "Attachments",
+ "DocumentRoot": "Documents",
+ "ConfigRoot": "Config",
+ "LogRoot": "/var/log/caldavd",
+ "RunRoot": "/var/run/caldavd",
+ "WebCalendarRoot": "/Applications/Server.app/Contents/ServerRoot/usr/share/collabd/webcal/public",
</ins><span class="cx">
</span><span class="cx"> #
</span><span class="cx"> # Quotas
</span><span class="cx"> #
</span><span class="cx">
</span><span class="cx"> # Attachments
</span><del>- "UserQuota" : 104857600, # User attachment quota (in bytes)
</del><ins>+ "UserQuota": 104857600, # User attachment quota (in bytes)
</ins><span class="cx">
</span><span class="cx"> # Resource data
</span><del>- "MaxCollectionsPerHome" : 50, # Maximum number of calendars/address books allowed in a home
- "MaxResourcesPerCollection" : 10000, # Maximum number of resources in a calendar/address book
- "MaxResourceSize" : 1048576, # Maximum resource size (in bytes)
- "MaxAttendeesPerInstance" : 100, # Maximum number of unique attendees
- "MaxAllowedInstances" : 3000, # Maximum number of instances the server will index
</del><ins>+ "MaxCollectionsPerHome": 50, # Maximum number of calendars/address books allowed in a home
+ "MaxResourcesPerCollection": 10000, # Maximum number of resources in a calendar/address book
+ "MaxResourceSize": 1048576, # Maximum resource size (in bytes)
+ "MaxAttendeesPerInstance": 100, # Maximum number of unique attendees
+ "MaxAllowedInstances": 3000, # Maximum number of instances the server will index
</ins><span class="cx">
</span><span class="cx"> # Set to URL path of wiki authentication service, e.g. "/auth", in order
</span><span class="cx"> # to use javascript authentication dialog. Empty string indicates standard
</span><span class="lines">@@ -823,6 +825,11 @@
</span><span class="cx"> }
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ "DirectoryProxy": {
+ "Enabled": False,
+ "SocketPath": "directory-proxy.sock"
+ },
+
</ins><span class="cx"> #
</span><span class="cx"> # Support multiple hosts within a domain
</span><span class="cx"> #
</span><span class="lines">@@ -900,7 +907,6 @@
</span><span class="cx"> # processes. If blank, then an AF_INET socket is used instead.
</span><span class="cx"> "ControlSocket": "caldavd.sock",
</span><span class="cx">
</span><del>-
</del><span class="cx"> # Support for Content-Encoding compression options as specified in
</span><span class="cx"> # RFC2616 Section 3.5
</span><span class="cx"> # Defaults off, because it weakens TLS (CRIME attack).
</span><span class="lines">@@ -1167,6 +1173,7 @@
</span><span class="cx"> ("RunRoot", "PIDFile"),
</span><span class="cx"> ("RunRoot", ("Stats", "UnixStatsSocket",)),
</span><span class="cx"> ("RunRoot", "ControlSocket"),
</span><ins>+ ("RunRoot", ("DirectoryProxy", "SocketPath",)),
</ins><span class="cx"> ]
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktxdavdps__init__py"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/txdav/dps/__init__.py (0 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/dps/__init__.py         (rev 0)
+++ CalendarServer/trunk/txdav/dps/__init__.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+##
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+Directory Proxy Service
+"""
</ins></span></pre></div>
<a id="CalendarServertrunktxdavdpsprotocolpy"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/txdav/dps/protocol.py (0 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/dps/protocol.py         (rev 0)
+++ CalendarServer/trunk/txdav/dps/protocol.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+##
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+# import twext.who
+from twisted.protocols import amp
+from twisted.internet.defer import succeed
+from twext.python.log import Logger
+
+log = Logger()
+
+
+class DirectoryProxyAMPCommand(amp.Command):
+ """
+ A DirectoryProxy command
+ """
+ arguments = [('command', amp.String())]
+ response = [('result', amp.String())]
+
+
+
+class DirectoryProxyAMPProtocol(amp.AMP):
+ """
+ """
+
+ def __init__(self):
+ """
+ """
+ amp.AMP.__init__(self)
+
+
+ @DirectoryProxyAMPCommand.responder
+ # @inlineCallbacks
+ def testCommandReceived(self, command):
+ """
+ Process a command
+
+ @param command: DirectoryProxyAMPCommand
+ @returns: a deferred returning a dict
+ """
+ # command = readPlistFromString(command)
+ log.debug("Command arrived: {cmd}", cmd=command)
+ response = {"result": "plugh", "command": command}
+ log.debug("Responding with: {response}", response=response)
+ # returnValue(dict(result=result))
+ return succeed(response)
+
+
+#
+# A test AMP client
+#
+
+command = "xyzzy"
+
+
+def makeRequest():
+ from twisted.internet import reactor
+ from twisted.internet.protocol import ClientCreator
+
+ creator = ClientCreator(reactor, amp.AMP)
+ d = creator.connectUNIX("data/Logs/state/directory-proxy.sock")
+
+ def connected(ampProto):
+ return ampProto.callRemote(DirectoryProxyAMPCommand, command=command)
+ d.addCallback(connected)
+
+ def resulted(result):
+ return result['result']
+ d.addCallback(resulted)
+
+ def done(result):
+ print('Done: %s' % (result,))
+ reactor.stop()
+ d.addCallback(done)
+ reactor.run()
+
+if __name__ == '__main__':
+ makeRequest()
+
</ins></span></pre></div>
<a id="CalendarServertrunktxdavdpsservicepy"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/txdav/dps/service.py (0 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/dps/service.py         (rev 0)
+++ CalendarServer/trunk/txdav/dps/service.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -0,0 +1,154 @@
</span><ins>+##
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+import twext.who
+from twisted.python.usage import Options, UsageError
+from twisted.plugin import IPlugin
+from twisted.application import service
+from zope.interface import implements
+from twistedcaldav.config import config
+from twistedcaldav.stdconfig import DEFAULT_CONFIG, DEFAULT_CONFIG_FILE
+from twisted.application.strports import service as strPortsService
+from twisted.internet.protocol import Factory
+from twext.python.log import Logger
+
+from .protocol import DirectoryProxyAMPProtocol
+
+log = Logger()
+
+
+class DirectoryProxyAMPFactory(Factory):
+ """
+ """
+ protocol = DirectoryProxyAMPProtocol
+
+
+ def buildProtocol(self, addr):
+ return DirectoryProxyAMPProtocol()
+
+
+
+class DirectoryProxyOptions(Options):
+ optParameters = [[
+ "config", "f", DEFAULT_CONFIG_FILE, "Path to configuration file."
+ ]]
+
+
+ def __init__(self, *args, **kwargs):
+ super(DirectoryProxyOptions, self).__init__(*args, **kwargs)
+
+ self.overrides = {}
+
+
+ def _coerceOption(self, configDict, key, value):
+ """
+ Coerce the given C{val} to type of C{configDict[key]}
+ """
+ if key in configDict:
+ if isinstance(configDict[key], bool):
+ value = value == "True"
+
+ elif isinstance(configDict[key], (int, float, long)):
+ value = type(configDict[key])(value)
+
+ elif isinstance(configDict[key], (list, tuple)):
+ value = value.split(',')
+
+ elif isinstance(configDict[key], dict):
+ raise UsageError(
+ "Dict options not supported on the command line"
+ )
+
+ elif value == 'None':
+ value = None
+
+ return value
+
+
+ def _setOverride(self, configDict, path, value, overrideDict):
+ """
+ Set the value at path in configDict
+ """
+ key = path[0]
+
+ if len(path) == 1:
+ overrideDict[key] = self._coerceOption(configDict, key, value)
+ return
+
+ if key in configDict:
+ if not isinstance(configDict[key], dict):
+ raise UsageError(
+ "Found intermediate path element that is not a dictionary"
+ )
+
+ if key not in overrideDict:
+ overrideDict[key] = {}
+
+ self._setOverride(
+ configDict[key], path[1:],
+ value, overrideDict[key]
+ )
+
+
+ def opt_option(self, option):
+ """
+ Set an option to override a value in the config file. True, False, int,
+ and float options are supported, as well as comma seperated lists. Only
+ one option may be given for each --option flag, however multiple
+ --option flags may be specified.
+ """
+
+ if "=" in option:
+ path, value = option.split('=')
+ self._setOverride(
+ DEFAULT_CONFIG,
+ path.split('/'),
+ value,
+ self.overrides
+ )
+ else:
+ self.opt_option('%s=True' % (option,))
+
+ opt_o = opt_option
+
+ def postOptions(self):
+ config.load(self['config'])
+ config.updateDefaults(self.overrides)
+ self.parent['pidfile'] = None
+
+
+class DirectoryProxyServiceMaker(object):
+ implements(IPlugin, service.IServiceMaker)
+
+ tapname = "caldav_directoryproxy"
+ description = "Directory Proxy Service"
+ options = DirectoryProxyOptions
+
+ def makeService(self, options):
+ """
+ Return a service
+ """
+ try:
+ from setproctitle import setproctitle
+ except ImportError:
+ pass
+ else:
+ setproctitle("CalendarServer Directory Proxy Service")
+
+ desc = "unix:{path}:mode=660".format(
+ path=config.DirectoryProxy.SocketPath
+ )
+ return strPortsService(desc, DirectoryProxyAMPFactory())
</ins></span></pre>
</div>
</div>
</body>
</html>