Giter Site home page Giter Site logo

apple / ccs-calendarserver Goto Github PK

View Code? Open in Web Editor NEW
483.0 31.0 137.0 22.91 MB

The Calendar and Contacts Server.

Home Page: https://www.calendarserver.org

License: Apache License 2.0

Shell 0.83% Python 81.03% HTML 0.32% DTrace 0.11% Makefile 0.12% CSS 0.03% JavaScript 0.56% C 0.02% DIGITAL Command Language 0.01% PLSQL 0.12% PLpgSQL 2.11% SQLPL 0.06% TSQL 14.68%

ccs-calendarserver's Introduction

Notice of Archival

The developers of the Calendar and Contacts Server have each moved on to other projects over the past few years, and given the change in the Python language landscape, in addition to the care and feeding requried to maintain a secure set of dependecies, the time has come to officially archive the project. Thank you to all the users and contributors; it was neat to hear about how this code was being deployed around the world, and we hope it remains useful for years to come.

Getting Started

This is the core code base for the Calendar and Contacts Server, which is a CalDAV, CardDAV, WebDAV, and HTTP server.

For general information about the server, see https://apple.github.io/ccs-calendarserver.

Copyright and License

Copyright (c) 2005-2017 Apple Inc. All rights reserved.

This software is licensed under the Apache License, Version 2.0. The Apache License is a well-established open source license, enabling collaborative open source software development.

See the "LICENSE" file for the full text of the license terms.

QuickStart

WARNING: these instructions are for running a server from the source tree, which is useful for development. These are not the correct steps for running the server in deployment or as part of an OS install. You should not be using the run script in system startup files (eg. /etc/init.d); it does things (like download software) that you don't want to happen in that context.

Begin by creating a directory to contain Calendar and Contacts Server and all its dependencies:

mkdir ~/CalendarServer
cd CalendarServer

Next, check out the source code from the GIT repository. To check out the latest code:

git clone https://github.com/apple/ccs-calendarserver.git

Note: if you have two-factor authentication activated on GitHub, you'll need to use a personal access token instead of your password. You can generate personal access tokens at https://github.com/settings/tokens

Pip is used to retrieve the python dependencies and stage them for use by virtualenv, however if your system does not have pip (and virtualenv), install it by running:

python -m ensurepip

If this yields a permission denied error, you are likely using a system-wide installation of Python, so either retry with a user installation of Python or prefix the command with 'sudo'.

The server requires various external libraries in order to operate. The bin/develop script in the sources will retrieve these dependencies and install them to the .develop directory. Note that this behavior is currently also a side-effect of bin/run, but that is likely to change in the future:

cd ccs-calendarserver
./bin/develop
____________________________________________________________

Using system version of libffi.

____________________________________________________________

Using system version of OpenLDAP.

____________________________________________________________

Using system version of SASL.

____________________________________________________________
...

Before you can run the server, you need to set up a configuration file for development. There is a provided test configuration that you can use to start with, conf/caldavd-test.plist, which can be copied to conf/caldavd-dev.plist (the default config file used by the bin/run script). If conf/caldavd-dev.plist is not present when the server starts, you will be prompted to create a new one from conf/caldavd-test.plist.

You will need to choose a directory service to use to populate your server's principals (users, groups, resources, and locations). A directory service provides the Calendar and Contacts Server with information about these principals. The directory services supported by Calendar and Contacts Server are:

  • XMLDirectoryService: this service is configurable via an XML file that contains principal information. The file conf/auth/accounts.xml provides an example principals configuration.
  • OpenDirectoryService: this service uses Apple's OpenDirectory client, the bulk of the configuration for which is handled external to Calendar and Contacts Server (e.g. System Preferences --> Users & Groups --> Login Options --> Network Account Server).
  • LdapDirectoryService: a highly flexible LDAP client that can leverage existing LDAP servers. See twistedcaldav/stdconfig.py for the available LdapDirectoryService options and their defaults.

The caldavd-test.plist configuration uses XMLDirectoryService by default, set up to use conf/auth/accounts-test.xml. This is a generally useful configuration for development and testing.

This file contains a user principal, named admin, with password admin, which is set up (in caldavd-test.plist) to have administrative permissions on the server.

Start the server using the bin/run script, and use the -n option to bypass dependency setup:

bin/run -n
Using /Users/andre/CalendarServer/ccs-calendarserver/.develop/roots/py_modules/bin/python as Python

Missing config file: /Users/andre/CalendarServer/ccs-calendarserver/conf/caldavd-dev.plist
You might want to start by copying the test configuration:

  cp conf/caldavd-test.plist conf/caldavd-dev.plist

Would you like to copy the test configuration now? [y/n]y
Copying test cofiguration...

Starting server...

The server should then start up and bind to port 8008 for HTTP and 8443 for HTTPS. You should then be able to connect to the server using your web browser (eg. Safari, Firefox) or with a CalDAV client (eg. Calendar).

ccs-calendarserver's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ccs-calendarserver's Issues

Support RDATEs with PERIOD values

@wsanchez originally submitted this as ticket:20

  • Keywords: CalDAV-access

2006/02/16 1:00 PM Cyrus Daboo:

  • SUMMARY

python-dateutil does not support RDATE properties with period values.

  • NOTES

Fixing this requires significant changes to the way recurrence expansion is done in dateutil, as rather than returning just the start time for each expanded instance, it needs to return the start/end (period) for each one, as durations of instances may not be constant if periods used in RDATE.

Support collations as defined in the new -15 caldav draft

@cyrusdaboo originally submitted this as ticket:55

  • Keywords: CalDAV-access

The new -15 draft of caldav has added support for collations for the calendar-query report text-match operation. The server needs to support at a minimum the i;ascii-casemap and i;octet collations. i;octet is a straight octet-by-octet comparison (e.g. memcmp), i;ascii-casemap is a case-insensitive comparisons - however it must only casemap ascii characters < 0x80 - non-ascii must be left as-is. Unfortunately there is at present no collation that will do case-insensitive matching of non-ascii as well as proper unicode normalization. That has still to be defined. What's more I am not exactly sure what Python's string comparison operation currently does (that's what we have been using). That will need to be checked wrt unicode normalization. 

run -s: svn checkout fails due to @REV append at url (patch inline)

marcel@… originally submitted this as ticket:10


svn checkout doesnt take the '@Rev' format but uses a -r option already

Patch is trivial:

Index: run
===================================================================
--- run (revision 34)
+++ run (working copy)
@@ -230,7 +230,7 @@
     fi;
   else
     echo "Checking out ${name}...";
-    svn checkout -r "${revision}" "${uri}@${revision}" "${path}";
+    svn checkout -r "${revision}" "${uri}" "${path}";

     apply_patches "${name}" "${path}";
   fi;

Need incremental iCalendar parsing to avoid blocking

@dreid originally submitted this as ticket:40


http_PUT blocks while storing the calendar data, and it can take up to 5 minutes for a request involving a 208K ics file to complete. This is obviously a pretty good place for a DoS to happen. I suspect the culprit is the calendar validation, this stuff should be deferred to a thread.

Note we have a similar problem with XML; we probably need to switch to ElementTree or similar.

Directory private WebDAV properties should not appear in an <DAV:allprop> response.

@wsanchez originally submitted this as ticket:28


2006/07/06 12:53 PM Cyrus Daboo:

  • SUMMARY

The Twisted private properties used to store open directory attributes on principal resources should not appear in the respond to a PROPFIND that uses <DAV:allprop/>.

  • STEPS TO REPRODUCE
  1. Do PROPFIND with <DAV:allprop/> on a principal resource.
  • RESULTS

Properties such as <group-member-guids xmlns='http://twistedmatrix.com/xml_namespace/dav/'> appear in the response.

  • NOTES

The <calendar-principal-uri>, <group-member-guids>, <guid> and <last-modified> properties should be hidden.

Support namespaced REPORT queries

matt@… originally submitted this as ticket:47


I've been exploring what it will take to get Evolution to talk to CalendarServer over CalDAV. Andrew McMillan has pointed out some differences in the REPORT query between CalendarServer and Cosmo, a server that works with Evolution over CalDAV.

CalendarServer is generating a response in the form of <multistatus xmlns='DAV:'><response><href> while Evolution is expecting a response in the form of <D:multistatus xmlns:D="DAV:"><D:response><D:href>. Evolution is doing this on line 651 of e-cal-backend-caldav.c via an xpath query: result = xpath_eval (xpctx, "/D:multistatus/D:response");

The caldav spec in section 7.1 refers to sections 3.6 and 3.8 of the webdav spec which (at least in the examples) uses the more complex namespaced response.

I am not sure which way is correct (or if they both are) but someone more experienced might be able to figure that out from the specs.

Attributes on property elements are not preservered

@wsanchez originally submitted this as ticket:18


2006/02/22 2:03 PM Cyrus Daboo:

  • SUMMARY

If an attribute (e.g. xml:lang) is specified on a property by the client, the server MUST return those attributes when returning the property. As per 2518 section 12.13.2.

  • STEPS TO REPRODUCE
  1. Do a PROPPATCH:
PROPPATCH /cal/ HTTP/1.1
Host: localhost
Content-Type: text/xml; charset="utf-8"
Content-Length: 196

<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:">
<D:set>
<D:prop>
<D:displayname xml:lang="en">English Text</D:displayname>
</D:prop>
</D:set>
</D:propertyupdate>
  1. Do a PROPFIND:
PROPFIND /cal/ HTTP/1.1
Host: localhost
Content-Length: 124
Content-Type: text/xml; charset=utf-8
Depth: 0

<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:displayname/>
</D:prop>
</D:propfind>
  • RESULTS

Note that the xml:lang attribute is not returned on the displayname property element.

  • NOTES

Obviously we need a way to preserve the XML element attributes in the xattrs database. One solution might be to store the entire property element in the xattr rather than just the value, but still index it by the property name.

On run, authkerb.py fails to import kerberos

tpherndon@… originally submitted this as ticket:6


When I run the server, I get a traceback that points to authkerb.py failing to import kerberos. I did not previously have PyKerberos installed on my system, and have not actually run setup.py install. The run script seems to be trying to make the whole server self-contained, but it looks like the developer probably has a site-packages install of PyKerberos, and authkerb.py isn't set up to import a local copy.

System details: OS 10.4.7, Python 2.4.3 from the python.org binary, Mac Book Pro 2GHz.

Traceback:

Ralf:~/Projects/Personal/calserver/CalendarServer herndonp$ ~/Projects/Personal/calserver/CalendarServer/run

Building PyXML... running build running build_py running build_ext running build_scripts

Building PyOpenSSL... running build running build_py running build_ext

Building PyKerberos... running build running build_ext

Building PyOpenDirectory... running build running build_py running build_ext

Building xattr... running build running build_py running build_ext 2006/08/09 17:37 EDT [-] Log opened. 2006/08/09 17:37 EDT [-] twistd 2.3.0+r17097 (/Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python 2.4.3) starting up 2006/08/09 17:37 EDT [-] reactor class: <class 'twisted.internet.selectreactor.SelectReactor'> 2006/08/09 17:37 EDT [-] Loading /tmp/caldavL2H2oT... 2006/08/09 17:37 EDT [-] Document root is: twistedcaldav/test/data/ 2006/08/09 17:37 EDT [-] Repository configuration is: conf/repository-dev.xml 2006/08/09 17:37 EDT [-] No dead property store available; using nonePropertyStore. 2006/08/09 17:37 EDT [-] Setting of dead properties will not be allowed. 2006/08/09 17:37 EDT [-] Traceback (most recent call last): 2006/08/09 17:37 EDT [-] File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/application/app.py", line 159, in getApplication 2006/08/09 17:37 EDT [-] application = service.loadApplication(filename, style, passphrase) 2006/08/09 17:37 EDT [-] File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/application/service.py", line 301, in loadApplication 2006/08/09 17:37 EDT [-] application = sob.loadValueFromFile(filename, 'application', passphrase) 2006/08/09 17:37 EDT [-] File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/persisted/sob.py", line 206, in loadValueFromFile 2006/08/09 17:37 EDT [-] exec fileObj in d, d 2006/08/09 17:37 EDT [-] File "/tmp/caldavL2H2oT", line 49, in ? 2006/08/09 17:37 EDT [-] from twistedcaldav.repository import RepositoryBuilder 2006/08/09 17:37 EDT [-] File "/Users/herndonp/Projects/Personal/calserver/CalendarServer/twistedcaldav/repository.py", line 38, in ? 2006/08/09 17:37 EDT [-] from twistedcaldav.directory import DirectoryResourcePrincipalProvisioningResource 2006/08/09 17:37 EDT [-] File "/Users/herndonp/Projects/Personal/calserver/CalendarServer/twistedcaldav/directory.py", line 39, in ? 2006/08/09 17:37 EDT [-] from twistedcaldav.resource import CalendarPrincipalCollectionResource 2006/08/09 17:37 EDT [-] File "/Users/herndonp/Projects/Personal/calserver/CalendarServer/twistedcaldav/resource.py", line 56, in ? 2006/08/09 17:37 EDT [-] from twistedcaldav import authkerb 2006/08/09 17:37 EDT [-] File "/Users/herndonp/Projects/Personal/calserver/CalendarServer/twistedcaldav/authkerb.py", line 48, in ? 2006/08/09 17:37 EDT [-] import kerberos 2006/08/09 17:37 EDT [-] ImportError: No module named kerberos 2006/08/09 17:37 EDT [-] Failed to load application: No module named kerberos 2006/08/09 17:37 EDT [-] Traceback (most recent call last):

File "/Users/herndonp/Projects/Personal/calserver/Twisted/bin/twistd", line 25, in ?

run()

File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/scripts/twistd.py", line 205, in run

app.run(runApp, ServerOptions)

File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/application/app.py", line 278, in run

runApp(config)

File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/scripts/twistd.py", line 195, in runApp

application = app.getApplication(config, passphrase)

--- <exception caught here> ---

File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/application/app.py", line 159, in getApplication

application = service.loadApplication(filename, style, passphrase)

File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/application/service.py", line 301, in loadApplication

application = sob.loadValueFromFile(filename, 'application', passphrase)

File "/Users/herndonp/Projects/Personal/calserver/Twisted/twisted/persisted/sob.py", line 206, in loadValueFromFile

exec fileObj in d, d

File "/tmp/caldavL2H2oT", line 49, in ?

from twistedcaldav.repository import RepositoryBuilder

File "/Users/herndonp/Projects/Personal/calserver/CalendarServer/twistedcaldav/repository.py", line 38, in ?

from twistedcaldav.directory import DirectoryResourcePrincipalProvisioningResource

File "/Users/herndonp/Projects/Personal/calserver/CalendarServer/twistedcaldav/directory.py", line 39, in ?

from twistedcaldav.resource import CalendarPrincipalCollectionResource

File "/Users/herndonp/Projects/Personal/calserver/CalendarServer/twistedcaldav/resource.py", line 56, in ?

from twistedcaldav import authkerb

File "/Users/herndonp/Projects/Personal/calserver/CalendarServer/twistedcaldav/authkerb.py", line 48, in ?

import kerberos

exceptions.ImportError: No module named kerberos

Failed to load application: No module named kerberos 2006/08/09 17:37 EDT [-] Starting CalDAV Server [Done]

Case-sensitive resource names

@wsanchez originally submitted this as ticket:13


2006/04/10 8:57 AM Cyrus Daboo:

  • SUMMARY

Resource names are sometimes treated as case-sensotive and sometimes not.

  • STEPS TO REPRODUCE
  1. Do a PROPFIND on iTIP Inbox called 'Inbox'. Not that the actual collections is called 'inbox' on the file system.
  • RESULTS

PROPFIND returns with a 207 implying that the resource exists, but the set of properties does not match those of the actual resource. e.g., <DAV:resourcetype> only indicates <DAV:collection> and not also <CALDAV:itip-inbox>.

  • NOTES

What appears to happen is that the 'self.exists()' test is case-insenstive so that it appears that the collection 'Inbox' exists when in fact it is called 'inbox'. However, the child resource matching methods, e.g. getChild, are case-senstive and return a child that is not the same as the 'inbox' child - in this case a CalDAVFile and not an iTIPInboxFile. Thus resourcetype specific behavior is lost.

kerberos krb_err.h not found on leopard...

Everette_Allen@… originally submitted this as ticket:9


Building PyKerberos... running build running build_ext building 'kerberos' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c src/kerberos.c -o build/temp.darwin-9.0.0d1-i386-2.4/src/kerberos.o In file included from src/kerberos.c:21: src/kerberosbasic.h:22:30: error: Kerberos/krb_err.h: No such file or directory error: command 'gcc' failed with exit status 1

On-demand provisioning

@wsanchez originally submitted this as ticket:25


Right now, when provisioning accounts from OpenDirectory, we're periodically polling OD for all of its records. That seems a little rude, and also suboptimal.

Here is what I propose:

The provisioning resources (that is /calendars/* and /principals/*) should do lazy loading of data from OD.

Say a request comes in for /principals/users/wsanchez or /calendars/users/wsanchez:

  • If the principal for wsanchez doesn't yet exist (on disk), check OD to see if this is a valid calendar user (ie. has a CalendarPrincipalURI attribute for this server)
  • If yes:
    - Create the principal on disk and cache the relevant data from OD for the principal
    - Record the time
    - Provision a calendar home (/calendars/users/wsanchez)
  • If the principal for wsanchez does exist (on disk):
  • If it is stale (for some configurable value, say one hour), reload the cached data from OD and:
    - If the user still exists in OD (same name and GUID), update the cached principal data as appropriate.
    - If the user still exists in OD, but is no longer a valid calendar user, or if the user no longer exists in OD:
    • Archive the user's calendar home
    • Delete the user's principal
    • Return a 404 NOT FOUND response
      - If the user still exists in OD, but has a different GUID
    • Treat that as a deleted user that has been replaced by a new user with the same name:
    • Archive the user's calendar home
    • Delete the user's principal
    • Create the principal on disk and cache the relevant data from OD for the principal
    • Record the time
    • Provision a calendar home (/calendars/users/wsanchez)
  • Once you have an up-to-date principal on disk, continue with request processing using that data.

Issues with QuickStart

Hagedorn@… originally submitted this as ticket:8


There are a few problems with the current version of QuickStart and README. I'm on 10.4.7 with python 2.4 installed in /sw/bin/python2.4 using Fink. Here's what happens when I follow the instructions to the letter:

./run -s works (after the correction mentioned in #⁠7), but then it fails:

[a0620@tyrion:CalendarServer (0)]% cp ./conf/repository-static.xml ./conf/repository-dev.xml
[a0620@tyrion:CalendarServer (0)]% ~/Developer/Collaboration/CalendarServer/run
Traceback (most recent call last):
  File "/Users/a0620/Developer/Collaboration/CalendarServer/bin/caldavd", line 26, in ?
    from plistlib import readPlist
ImportError: cannot import name readPlist

The reason is that caldavd also uses "python" instead of python2.4. When I change caldavd to use python2.4, this happens:

[a0620@tyrion:CalendarServer (0)]% ~/Developer/Collaboration/CalendarServer/run
SSL Private Key File does not exist: /etc/certificates/Default.key

OK, so I disable SSL by modifying conf/caldavd.plist. But apparently that's not being used. When I rund caldavd directly, I get this:

[a0620@tyrion:CalendarServer (0)]% ~/Developer/Collaboration/CalendarServer/bin/caldavd -p
Configuration file does not exist: /etc/caldavd/caldavd.plist

So I copy conf/caldavd.plist to /etc/caldavd/caldavd.plist. Now I see:

[a0620@tyrion:CalendarServer (1)]% ~/Developer/Collaboration/CalendarServer/bin/caldavd -p
Current Configuration

Configuration File:               /etc/caldavd/caldavd.plist

Run as daemon:                    True
Document Root:                    /Library/CalendarServer/Documents
Repository Configuration:         /etc/caldavd/repository.xml
Generate Accounts in Repository:  True
Reset ACLs on Generated Accounts: True
Non-ssl Port:                     8008
Use SSL:                          False
SSL Port:                         8443
Only Use SSL:                     False
SSL Private Key File:             /etc/certificates/Default.key
SSL Certificate File:             /etc/certificates/Default.crt
Log File:                         /var/log/caldavd/server.log
PID File:                         /var/log/caldavd/caldavd.pid
twistd Location:                  /usr/share/caldavd/bin/twistd

But nothing changes for run:

[a0620@tyrion:CalendarServer (0)]% ~/Developer/Collaboration/CalendarServer/run
SSL Private Key File does not exist: /etc/certificates/Default.key

When I actually try to start caldavd directly, I get this:

[a0620@tyrion:CalendarServer (1)]% ~/Developer/Collaboration/CalendarServer/bin/caldavd start
twistd does not exist: /usr/share/caldavd/bin/twistd

An earlier attempt where I installed CalendarServer using ./run -I resulted in a different error:

[a0620@tyrion:CalendarServer (1)]% ~/CalendarServer/bin/caldavd -v -X start
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/tmp/CalendarServer/Release/usr/share/caldavd/bin/twistd", line 12, in ?
    import sys, os, string
  File "/sw/lib/python2.4/os.py", line 133
    from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
                        ^
SyntaxError: invalid syntax
Starting CalDAV Server         [Done]

I'm no Python expert and don't know what else to try ...

Todo Alarm Creation Fails

@wsanchez originally submitted this as ticket:26


2006/07/20 3:48 PM David Reid:

  • SUMMARY

Attempting to add an alarm for a Todo item stored on the calendar server causes an exception

  • STEPS TO REPRODUCE
  1. Create a todo
  2. Click due date
  3. Add an alarm
  • RESULTS

iCal claims to add an alarm but displays an error notice next to the calendar name and the server log shows the following exception

2006/07/20 15:47 PDT [-] Traceback (most recent call last):
      File "/usr/share/caldavd/lib/python/twisted/web2/stream.py", line 407, in _read
        self._gotData(result)
      File "/usr/share/caldavd/lib/python/twisted/web2/stream.py", line 418, in _gotData
        result.callback(None)
      File "/usr/share/caldavd/lib/python/twisted/internet/defer.py", line 229, in callback
        self._startRunCallbacks(result)
      File "/usr/share/caldavd/lib/python/twisted/internet/defer.py", line 294, in _startRunCallbacks
        self._runCallbacks()
    --- <exception caught here> ---
      File "/usr/share/caldavd/lib/python/twisted/internet/defer.py", line 307, in _runCallbacks
        self.result = callback(self.result, *args, **kw)
      File "/usr/share/caldavd/lib/python/twistedcaldav/method/put_common.py", line 473, in doIndexing
        result = doDestinationIndex(calendar)
      File "/usr/share/caldavd/lib/python/twistedcaldav/method/put_common.py", line 407, in doDestinationIndex
        destination_index.addResource(destination.fp.basename(), caltoindex)
      File "/usr/share/caldavd/lib/python/twistedcaldav/index.py", line 196, in addResource
        self._add_to_db(name, calendar)
      File "/usr/share/caldavd/lib/python/twistedcaldav/index.py", line 520, in _add_to_db
        instances = calendar.expandTimeRanges(expand_max)
      File "/usr/share/caldavd/lib/python/twistedcaldav/ical.py", line 652, in expandTimeRanges
        return self.expandSetTimeRanges(componentSet, limit)
      File "/usr/share/caldavd/lib/python/twistedcaldav/ical.py", line 669, in expandSetTimeRanges
        instances.expandTimeRanges(componentSet, limit)
      File "/usr/share/caldavd/lib/python/twistedcaldav/instance.py", line 133, in expandTimeRanges
        self._addMasterToDoComponent(component, limit)
      File "/usr/share/caldavd/lib/python/twistedcaldav/instance.py", line 233, in _addMasterToDoComponent
        duration = due - start
    exceptions.TypeError: unsupported operand type(s) for -: 'datetime.date' and 'datetime.datetime'
  • REGRESSION

This only happens for ToDos; alarms on events work fine.

Need better logging

@wsanchez originally submitted this as ticket:30


I'd love to see something like log4j in a form that plays nicely with Twisted's logging facilities. I'm not sure how feasable that is.

In any case, we're making rather poor use of what Twisted does have, I think, so we should clean this up. At the very least, we need better use of logging levels.

Poor user experience with DIGEST authentication

@cyrusdaboo originally submitted this as ticket:54


When the server is set to digest authentication and a browser is pointed to a resource, the user is prompted for their user/pswd everytime the resource is refreshed. The problem is that the Twisted digest authenticator generates a new 'opaque' parameter for each request, which prevents clients from caching and replaying authentication. Twisted needs to be changed to cache the 'opaque' parameter. A good example to follow is that of apache mod_auth_digest which keeps a per-client 'opaque' parameter in a garbage collected map.

use locateResource instead of getChild when doing index based resource lookups

@cyrusdaboo originally submitted this as ticket:41


Currently, when looking up calendar resources via the index, the resource name is returned and a getChild(name) is used. This does not work when ther URI of the child resource is subsequently needed as the resource->URI mapping has not been created. As a result the registerResourceURI method was made public and manual registertion doen. THis is not good.

What should be done instead is take the child name from the index and do joinURL(request.uri, child) and then use locateResource - this is guaranteed to generate the resource->URI mapping that will later be needed. One thing we do have to check is that the name stored in the index is the last path segment of the resource URI and NOT the file name of the child (even though those will be the same in our current implementation).

RHEL 3 needs different include path for pyOpenSSL

Hagedorn@… originally submitted this as ticket:31


I'm trying to build and run Calendar Server under Red Hat Enterprise Linux 3. I installed Python 2.4 manually and the initial setup seems to work. The first stumbling block comes with pyOpenSSL:

building 'OpenSSL.crypto' extension
creating build/temp.linux-i686-2.4
creating build/temp.linux-i686-2.4/src
creating build/temp.linux-i686-2.4/src/crypto
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/afs/rrz.uni-koeln.de/usr/uninv/41/a0620/Python-2.4.3-linux/include/python2.4 -c src/crypto/crypto.c -o build/temp.linux-i686-2.4/src/crypto/crypto.o
In file included from /usr/include/openssl/ssl.h:179,
                 from src/crypto/x509.h:17,
                 from src/crypto/crypto.h:17,
                 from src/crypto/crypto.c:13:
/usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory

The reason is that RHEL has Kerberos in /usr/kerberos/include. What needs to be done on this platform is to build pyOpenSSL like this:

      "${python}" ./setup.py build_ext -I/usr/kerberos/include;
      "${python}" ./setup.py build;

Here's a diff:

--- run 2006-08-16 09:21:46.000000000 +0200
+++ run.hg      2006-08-16 10:14:04.000000000 +0200
@@ -319,6 +319,7 @@
       echo "";
       echo "Building PyOpenSSL...";
       cd "${ssl}";
+      "${python}" ./setup.py build_ext -I/usr/kerberos/include;
       "${python}" ./setup.py build;
     fi;
   fi;

I don't know if it would be OK to just do this on all platforms or if that needs to be IFDEF'd somehow.

Recycled PID prevents server from starting

@wsanchez originally submitted this as ticket:27


2006/07/19 12:01 PM Cyrus Daboo:

  • SUMMARY

When a server crash/restart occurs, of the if caldav.pid PID number is re-used by some other process not owned by the 'calendar' user, then the calendar server cannot startup. The server log shows:

Can't check status of PID 192 from pidfile /var/log/caldavd/caldavd.pid: Operation not permitted
  • STEPS TO REPRODUCE (actually I have not tried this yet - will take some time to setup)
  1. Kill server leaving behind a pid.
  2. Edit the pid file and set it to a currently running process not owned by 'calendar'.
  3. Try to restart the server.
  • RESULTS

Server fails to start with log entry as above.

This problem was seen when a server crashed and was restarted. The original PID was 192 before the crash. After the crash the calendar server would not startup because the 192 process already existed and was owned by 'jabber'.

Use incremental XML parsing to avoid blocking

@wsanchez originally submitted this as ticket:16


When we receive requests from the network which contain XML bodies (eg. DAV methods), we read the request stream into memory until we have all of it, then parse the XML. This is the only option we ahve with PyXML, I think, since it's parse() routines require a string, or do blocking I/O on a filehandle.

The downside here is that we have to have all of the XML in memory before we can continue, which is lame.

What we actually want is a parser that we can feed data to incrementally. ElementTree appears to have this property, so switching parsers to ElementTree could be nice. ElementTree also has the advantage of being slated for inclusion in future python releases, seems lighter weight than PyXML, and has a less complicated licensing situation.

We should also consider LXML, which is ElementTree-like, but binds to the Libxml2 C library and apparently performs better.

What we're after here is better performance, in terms of both memory and CPU. XML parsing and iCalendar parsing are, I think, going to be some of our prominent bottlenecks.

I'll mark this as a P4 for Preview 1, since our main goal for Preview 1 is feature completeness, so people can start using it.

please move patches/ to patches-external or similar

agx@… originally submitted this as ticket:43


Hi, can you move patches/ to something less generic, like patches-external (because they all apply to packages outside of the actual svn tree). This would make working with things like e.g. quilt a bit easier. Cheers,

-- Guido

Indirect group membership not supported

@wsanchez originally submitted this as ticket:17


2006/07/07 7:39 AM Cyrus Daboo:

  • SUMMARY

When one group is a member of another group, the server will not recognize a principal in the first group as also being a member of the second group (indirect group membership).

plistlib unavailable on Linux

Hagedorn@… originally submitted this as ticket:45


It seems as though the Python plistlib is by default available only under OS X. When I try to run CalendarServer under Linux I get

Traceback (most recent call last):
  File ".../CalendarServer/bin/caldavd", line 26, in ?
    from plistlib import readPlist
ImportError: No module named plistlib

This is confirmed here (with solution)

http://blog.etc.gen.nz/index.php?/archives/14-Apple-CalendarServer-on-Linux.html

Perhaps the run script should install this on these platforms?

hCalendar input/output

@wsanchez originally submitted this as ticket:19


It would be swell if the server could accept hCalendar input and emit hCalendar output, given the right content-type/accept headers. This would help the microformats folks use it to embed calendar data into HTML and so on.

Instance wrong when start/end has one floating one not

@wsanchez originally submitted this as ticket:14

  • Keywords: CalDAV-access

When DTSTART/DTEND are both DATE-TIME values, but one of them is floating and the other is not, instance expansion does not work properly. Right now we coerce the floating one to non-floating. A fix for this will be complicated, and may not be necessary given that 2445 states that the date-time values really ought to be of the same type (but that is only a recommendation and not a MUST).

Writing to property fails on Linux

wallaye@… originally submitted this as ticket:48

  • Keywords: twisted, dead, property, acl

When I run on linux I get the following error :

2006/09/07 10:48 CEST [-] Traceback (most recent call last):
2006/09/07 10:48 CEST [-]   File "/tmp/Twisted/twisted/application/app.py", line 159, in getApplication
2006/09/07 10:48 CEST [-]     application = service.loadApplication(filename, style, passphrase)
2006/09/07 10:48 CEST [-]   File "/tmp/Twisted/twisted/application/service.py", line 301, in loadApplication
2006/09/07 10:48 CEST [-]     application = sob.loadValueFromFile(filename, 'application', passphrase)
2006/09/07 10:48 CEST [-]   File "/tmp/Twisted/twisted/persisted/sob.py", line 206, in loadValueFromFile
2006/09/07 10:48 CEST [-]     exec fileObj in d, d
2006/09/07 10:48 CEST [-]   File "/tmp/caldav2Y_Xf_", line 52, in ?
2006/09/07 10:48 CEST [-]     builder.buildFromFile(repo)
2006/09/07 10:48 CEST [-]   File "/tmp/CalendarServer/twistedcaldav/repository.py", line 161, in buildFromFile
2006/09/07 10:48 CEST [-]     self.docRoot.build()
2006/09/07 10:48 CEST [-]   File "/tmp/CalendarServer/twistedcaldav/repository.py", line 211, in build
2006/09/07 10:48 CEST [-]     self.collection.build(self.path, "/")
2006/09/07 10:48 CEST [-]   File "/tmp/CalendarServer/twistedcaldav/repository.py", line 343, in build
2006/09/07 10:48 CEST [-]     self.resource.setAccessControlList(self.acl.acl)
2006/09/07 10:48 CEST [-]   File "/tmp/Twisted/twisted/web2/dav/resource.py", line 679, in setAccessControlList
2006/09/07 10:48 CEST [-]     self.writeDeadProperty(TwistedACLProperty(acl))
2006/09/07 10:48 CEST [-]   File "/tmp/Twisted/twisted/web2/dav/resource.py", line 385, in writeDeadProperty
2006/09/07 10:48 CEST [-]     self.deadProperties().set(property)
2006/09/07 10:48 CEST [-]   File "/tmp/Twisted/twisted/web2/dav/noneprops.py", line 56, in set
2006/09/07 10:48 CEST [-]     raise HTTPError(StatusResponse(responsecode.FORBIDDEN, "Permission denied for setting property: %s" % (property,)))
2006/09/07 10:48 CEST [-] HTTPError
2006/09/07 10:48 CEST [-] Failed to load application:
2006/09/07 10:48 CEST [-] Traceback (most recent call last):
          File "/tmp/Twisted/bin/twistd", line 25, in ?
            run()
          File "/tmp/Twisted/twisted/scripts/twistd.py", line 205, in run
            app.run(runApp, ServerOptions)
          File "/tmp/Twisted/twisted/application/app.py", line 278, in run
            runApp(config)
          File "/tmp/Twisted/twisted/scripts/twistd.py", line 195, in runApp
            application = app.getApplication(config, passphrase)
        --- <exception caught here> ---
          File "/tmp/Twisted/twisted/application/app.py", line 159, in getApplication
            application = service.loadApplication(filename, style, passphrase)
          File "/tmp/Twisted/twisted/application/service.py", line 301, in loadApplication
            application = sob.loadValueFromFile(filename, 'application', passphrase)
          File "/tmp/Twisted/twisted/persisted/sob.py", line 206, in loadValueFromFile
            exec fileObj in d, d
          File "/tmp/caldav2Y_Xf_", line 52, in ?
            builder.buildFromFile(repo)
          File "/tmp/CalendarServer/twistedcaldav/repository.py", line 161, in buildFromFile
            self.docRoot.build()
          File "/tmp/CalendarServer/twistedcaldav/repository.py", line 211, in build
            self.collection.build(self.path, "/")
          File "/tmp/CalendarServer/twistedcaldav/repository.py", line 343, in build
            self.resource.setAccessControlList(self.acl.acl)
          File "/tmp/Twisted/twisted/web2/dav/resource.py", line 679, in setAccessControlList
            self.writeDeadProperty(TwistedACLProperty(acl))
          File "/tmp/Twisted/twisted/web2/dav/resource.py", line 385, in writeDeadProperty
            self.deadProperties().set(property)
          File "/tmp/Twisted/twisted/web2/dav/noneprops.py", line 56, in set
            raise HTTPError(StatusResponse(responsecode.FORBIDDEN, "Permission denied for setting property: %s" % (property,)))
        twisted.web2.http.HTTPError:


Failed to load application:
2006/09/07 10:48 CEST [-]
Starting CalDAV Server         [Done]

Search for Subversion repository is locale-sensitive

Hagedorn@… originally submitted this as ticket:50


The "run" script tries to find the URI of the Subversion repository. The way it does this only works on systems with an English locale:

svn_uri_base="$(svn info "${caldav}" | sed -n 's|Repository Root: ||p')";

if [ -z "${svn_uri_base}" ]; then
    echo "Unable to locate subversion base URI for sources.";
    exit 1;
fi;

I have a German system and the output of "svn info" looks like this:

Pfad: /Users/a0620/Developer/Collaboration/CalendarServer
URL: http://svn.macosforge.org/repository/collaboration/CalendarServer/trunk
UUID des Projektarchivs: e27351fd-9f3e-4f54-a53b-843176b1656c
Revision: 127
Knotentyp: Verzeichnis
Plan: normal
Letzter Autor: [email protected]
Letzte geänderte Rev: 127
Letztes Änderungsdatum: 2006-09-12 03:08:48 +0200 (Di, 12 Sep 2006)

Perhaps you could use the --xml flag for svn? That output is locale-independent ...

More Documentation

pat2man@… originally submitted this as ticket:4


It is going to be hard for anyone to use this without any documentation, at least for installation.

Reports need to make more use of deferreds

@wsanchez originally submitted this as ticket:15


2006/04/27 11:14 AM Cyrus Daboo:

Reports current execute synchronously once the xml data has been parsed. This means that the server is blocked whilst generating report data, and for a report on a big calendar that could take a while. We need to make use of deferreds in some way to split up the report generation process into smaller chunks so that the server can handle other requests at the same time.

schedule-inbox-URL/schedule-outbox-URL elements wrong

@cyrusdaboo originally submitted this as ticket:36


The CALDAV:schedule-inbox-URL and CALDAV:schedule-outbox-URL are defined with lowercase 'URL' but the spec uses upper case and XML element names are case senstive. Also those elements currently require a DAV:href child element, but they are properties and need to be specified as an empty element in a PROPFIND request.

Calendar collections only properties appear on all resources

@cyrusdaboo originally submitted this as ticket:52


Properties: supported-calendar-set, supported-calendar-data and max-resource-size are only defined on calendar collection resources, but they appear on ALL CalDAVResource objects.

It is hard to change this without making a new CalDAVCalendarCollectionResource type with those listed as live-properties and remove them from CalDAVResource.

Note that we are not strictly violating the spec as it only says those properties MAY be defined on calendar collections. It does not say they MUST NOT be on other resources. So this is just a nice to have fix.

Trac: Internal error when using https with Timeline

@cyrusdaboo originally submitted this as ticket:11


After logging in to Trac and being redirected to https, the Timeline page fails with:

Oops...

Trac detected an internal error: argument number 0: a 'apr_pool_t *' is expected, 'instance(<libsvn.core.GenericSWIGWrapper instance at 0x25bc120>)' is received If you think this really should work and you can reproduce it. Then you should consider to report this problem to the Trac team.

Go to http://trac.edgewall.com/ and create a new ticket where you describe the problem, how to reproduce it. Don't forget to include the python traceback found below.

TracGuide — The Trac User and Administration Guide

Python traceback

Traceback (most recent call last):

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line 209, in handler

dispatch_request(mpr.path_info, mpr, env)

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/web/main.py", line 139, in dispatch_request

dispatcher.dispatch(req)

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/web/main.py", line 107, in dispatch

resp = chosen_handler.process_request(req)

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/Timeline.py", line 140, in process_request

filters)

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/versioncontrol/web_ui/changeset.py", line 108, in get_timeline_events

repos = self.env.get_repository()

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/env.py", line 155, in get_repository

from trac.versioncontrol.svn_fs import SubversionRepository

File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/versioncontrol/svn_fs.py", line 26, in ?

from svn import fs, repos, core, delta

File "/usr/local/subversion/lib/svn-python/svn/fs.py", line 19, in ?

from libsvn.fs import *

File "/usr/local/subversion/lib/svn-python/libsvn/fs.py", line 29, in ?

import core

File "/usr/local/subversion/lib/svn-python/libsvn/core.py", line 3057, in ?

svn_pool_create()

File "/usr/local/subversion/lib/svn-python/libsvn/core.py", line 1098, in svn_pool_create

return apply(_core.svn_pool_create, args)

TypeError: argument number 0: a 'apr_pool_t *' is expected, 'instance(<libsvn.core.GenericSWIGWrapper instance at 0x25bc120>)' is received

default repository XML file does not exist

matt@… originally submitted this as ticket:32


On a fresh checkout of DCS ([42]) I get the following error after running ./run -s:

$ ./run 
Repository File does not exist: conf/repository-dev.xml

This is easily fixed by copying conf/repository-static.xml to conf/repository-dev.xml but it feels like this should work "out of the box". I'm running OSX 10.4.7 with Python 2.4.

run has unwanted dependency on "python"

Hagedorn@… originally submitted this as ticket:7


The "run" script initially checks if the python binary in the path is new enough and uses python2.4 if it isn't. However, the function py_have_module () uses "python" as a hard-coded value:

PYTHONPATH="" python -c "import ${module}" > /dev/null 2>&1;

I use python2.4 installed by Fink under 10.4.7. Due to this buglet my initial attempts failed:

Installing Twisted...
Traceback (most recent call last):
  File "twisted/topfiles/setup.py", line 20, in ?
    from twisted import copyright
  File "./twisted/__init__.py", line 22, in ?
    raise ImportError("you need zope.interface installed "
ImportError: you need zope.interface installed (http://zope.org/Products/ZopeInterface/)
Error: Subprocess exited with result 1 for project core

When I changed the function to use python2.4 it worked, because the missing interface was automatically installed.

bashism in ./run

agx@… originally submitted this as ticket:44

  • Keywords: review

There are several bash specifics in the run script (e.g. line 1111 or 415), so thos should be specified in the script. Patch attached.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.