def __init__(self, domain, selector, pubkeyfile): """ """ assert domain assert selector SimpleResource.__init__(self, principalCollections=None, isdir=True, defaultACL=SimpleResource.allReadACL) self.makeKeyData(domain, selector, pubkeyfile) self.domain = domain self.selector = selector
root.putChild("principals", principalCollection) if config.EnableCalDAV: root.putChild("calendars", calendarCollection) if config.EnableCardDAV: root.putChild('addressbooks', addressBookCollection) if config.DirectoryAddressBook.Enabled and config.EnableSearchAddressBook: root.putChild(config.DirectoryAddressBook.name, directoryBackedAddressBookCollection) # /.well-known if config.EnableWellKnown: log.info("Setting up .well-known collection resource") wellKnownResource = SimpleResource( principalCollections=(principalCollection,), isdir=True, defaultACL=SimpleResource.allReadACL ) root.putChild(".well-known", wellKnownResource) for enabled, wellknown_name in ( (config.EnableCalDAV, "caldav",), (config.EnableCardDAV, "carddav"), ): if enabled: wellKnownResource.putChild(wellknown_name, RedirectResource(path="/")) for name, info in config.Aliases.iteritems(): if os.path.sep in name or not info.get("path", None): log.error("Invalid alias: %s" % (name,)) continue log.info("Adding alias %s -> %s" % (name, info["path"]))
root.putChild("principals", principalCollection) if config.EnableCalDAV: root.putChild("calendars", calendarCollection) if config.EnableCardDAV: root.putChild('addressbooks', addressBookCollection) if config.DirectoryAddressBook.Enabled and config.EnableSearchAddressBook: root.putChild(config.DirectoryAddressBook.name, directoryBackedAddressBookCollection) # /.well-known if config.EnableWellKnown: log.info("Setting up .well-known collection resource") wellKnownResource = SimpleResource( principalCollections=(principalCollection,), isdir=True, defaultACL=SimpleResource.allReadACL ) root.putChild(".well-known", wellKnownResource) for enabled, wellknown_name, redirected_to in ( (config.EnableCalDAV, "caldav", "/",), (config.EnableCardDAV, "carddav", "/",), (config.TimezoneService.Enabled, "timezone", "/stdtimezones",), (config.Scheduling.iSchedule.Enabled, "ischedule", "/ischedule"), ): if enabled: if config.EnableSSL: scheme = "https" port = config.SSLPort else: scheme = "http"