[CalendarServer-changes] [8458] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu Dec 15 15:45:48 PST 2011
Revision: 8458
http://trac.macosforge.org/projects/calendarserver/changeset/8458
Author: sagen at apple.com
Date: 2011-12-15 15:45:47 -0800 (Thu, 15 Dec 2011)
Log Message:
-----------
Adds support for MacOSX server promotion, including new config location. DocumentRoot now relative to DataRoot rather than ServerRoot.
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tap/caldav.py
CalendarServer/trunk/conf/caldavd-apple.plist
CalendarServer/trunk/support/Makefile.Apple
CalendarServer/trunk/twistedcaldav/stdconfig.py
CalendarServer/trunk/twistedcaldav/test/test_stdconfig.py
Added Paths:
-----------
CalendarServer/trunk/contrib/migration/calendarpromotion.py
Removed Paths:
-------------
CalendarServer/trunk/calendarserver/tap/carddav.py
CalendarServer/trunk/twisted/plugins/carddav.py
Modified: CalendarServer/trunk/calendarserver/tap/caldav.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/caldav.py 2011-12-15 23:36:22 UTC (rev 8457)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py 2011-12-15 23:45:47 UTC (rev 8458)
@@ -350,6 +350,13 @@
#
# Verify that other root paths are OK
#
+ if config.DataRoot.startswith(config.ServerRoot + os.sep):
+ self.checkDirectory(
+ config.DataRoot,
+ "Data root",
+ access=os.W_OK,
+ create=(0750, config.UserName, config.GroupName),
+ )
if config.DocumentRoot.startswith(config.ServerRoot + os.sep):
self.checkDirectory(
config.DocumentRoot,
@@ -358,14 +365,6 @@
access=os.R_OK,
create=(0750, config.UserName, config.GroupName),
)
- if config.DataRoot.startswith(config.ServerRoot + os.sep):
- self.checkDirectory(
- config.DataRoot,
- "Data root",
- access=os.W_OK,
- create=(0750, config.UserName, config.GroupName),
- )
-
if config.ConfigRoot.startswith(config.ServerRoot + os.sep):
self.checkDirectory(
config.ConfigRoot,
Deleted: CalendarServer/trunk/calendarserver/tap/carddav.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/carddav.py 2011-12-15 23:36:22 UTC (rev 8457)
+++ CalendarServer/trunk/calendarserver/tap/carddav.py 2011-12-15 23:45:47 UTC (rev 8458)
@@ -1,56 +0,0 @@
-##
-# Copyright (c) 2005-2009 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.
-##
-
-__all__ = [
- "CardDAVServiceMaker",
-]
-
-from zope.interface import implements
-
-from twisted.plugin import IPlugin
-from twisted.application.service import IServiceMaker
-
-from twistedcaldav.stdconfig import DEFAULT_CARDDAV_CONFIG_FILE
-from twext.python.log import Logger
-
-log = Logger()
-
-from calendarserver.tap.caldav import CalDAVServiceMaker, CalDAVOptions
-
-try:
- from twistedcaldav.authkerb import NegotiateCredentialFactory
-except ImportError:
- NegotiateCredentialFactory = None
-
-
-
-class CardDAVOptions(CalDAVOptions):
- """
- The same as L{CalDAVOptions}, but with a different default config file.
- """
-
- optParameters = [[
- "config", "f", DEFAULT_CARDDAV_CONFIG_FILE, "Path to configuration file."
- ]]
-
-
-
-class CardDAVServiceMaker (CalDAVServiceMaker):
- implements(IPlugin, IServiceMaker)
-
- tapname = "carddav"
- description = "Darwin Contacts Server"
- options = CardDAVOptions
Modified: CalendarServer/trunk/conf/caldavd-apple.plist
===================================================================
--- CalendarServer/trunk/conf/caldavd-apple.plist 2011-12-15 23:36:22 UTC (rev 8457)
+++ CalendarServer/trunk/conf/caldavd-apple.plist 2011-12-15 23:45:47 UTC (rev 8458)
@@ -110,7 +110,7 @@
<!-- Configuration root -->
<key>ConfigRoot</key>
- <string>/etc/caldavd</string>
+ <string>Config</string>
<!-- Run root -->
<key>RunRoot</key>
Added: CalendarServer/trunk/contrib/migration/calendarpromotion.py
===================================================================
--- CalendarServer/trunk/contrib/migration/calendarpromotion.py (rev 0)
+++ CalendarServer/trunk/contrib/migration/calendarpromotion.py 2011-12-15 23:45:47 UTC (rev 8458)
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+#
+# PromotionExtra script for calendar server.
+#
+# Copyright (c) 2011 Apple Inc. All Rights Reserved.
+#
+# IMPORTANT NOTE: This file is licensed only for use on Apple-labeled
+# computers and is subject to the terms and conditions of the Apple
+# Software License Agreement accompanying the package this file is a
+# part of. You may not port this file to another platform without
+# Apple's written consent.
+
+import os
+import shutil
+
+SRC_CONFIG_DIR = "/Applications/Server.app/Contents/ServerRoot/private/etc/caldavd"
+CALENDAR_SERVER_ROOT = "/Library/Server/Calendar and Contacts"
+DEST_CONFIG_DIR = "%s/Config" % (CALENDAR_SERVER_ROOT,)
+
+def main():
+ # Create calendar ServerRoot
+ os.mkdir(CALENDAR_SERVER_ROOT)
+
+ # Copy configuration
+ shutil.copytree(SRC_CONFIG_DIR, DEST_CONFIG_DIR)
+
+if __name__ == '__main__':
+ main()
Modified: CalendarServer/trunk/support/Makefile.Apple
===================================================================
--- CalendarServer/trunk/support/Makefile.Apple 2011-12-15 23:36:22 UTC (rev 8457)
+++ CalendarServer/trunk/support/Makefile.Apple 2011-12-15 23:45:47 UTC (rev 8458)
@@ -102,6 +102,10 @@
$(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SERVERSETUP)/MigrationExtras"
$(_v) $(INSTALL_FILE) "$(Sources)/contrib/migration/calendarmigrator.py" "$(DSTROOT)$(SERVERSETUP)/MigrationExtras/59_calendarmigrator.py"
$(_v) chmod ugo+x "$(DSTROOT)$(SERVERSETUP)/MigrationExtras/59_calendarmigrator.py"
+ @echo "Installing server promotion config..."
+ $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SERVERSETUP)/PromotionExtras"
+ $(_v) $(INSTALL_FILE) "$(Sources)/contrib/migration/calendarpromotion.py" "$(DSTROOT)$(SERVERSETUP)/PromotionExtras/59_calendarpromotion.py"
+ $(_v) chmod ugo+x "$(DSTROOT)$(SERVERSETUP)/PromotionExtras/59_calendarpromotion.py"
@echo "Installing database configuration scripts..."
$(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SERVERSETUP)/CommonExtras/PostgreSQLExtras"
$(_v) $(INSTALL_FILE) "$(Sources)/contrib/create_caldavd_db.sh" "$(DSTROOT)$(SERVERSETUP)/CommonExtras/PostgreSQLExtras/create_caldavd_db.sh"
Deleted: CalendarServer/trunk/twisted/plugins/carddav.py
===================================================================
--- CalendarServer/trunk/twisted/plugins/carddav.py 2011-12-15 23:36:22 UTC (rev 8457)
+++ CalendarServer/trunk/twisted/plugins/carddav.py 2011-12-15 23:45:47 UTC (rev 8458)
@@ -1,19 +0,0 @@
-##
-# Copyright (c) 2010 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.
-##
-
-from twisted.plugins.caldav import TAP
-
-TwistedCardDAV = TAP("calendarserver.tap.carddav.CardDAVServiceMaker")
Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py 2011-12-15 23:36:22 UTC (rev 8457)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py 2011-12-15 23:45:47 UTC (rev 8458)
@@ -34,14 +34,17 @@
from twistedcaldav.util import getPasswordFromKeychain
from twistedcaldav.util import KeychainAccessError, KeychainPasswordNotFound
+from twisted.python.runtime import platform
+
from calendarserver.push.util import getAPNTopicFromCertificate
log = Logger()
+if platform.isMacOSX():
+ DEFAULT_CONFIG_FILE = "/Library/Server/Calendar and Contacts/Config/caldavd.plist"
+else:
+ DEFAULT_CONFIG_FILE = "/etc/caldavd/caldavd.plist"
-DEFAULT_CONFIG_FILE = "/etc/caldavd/caldavd.plist"
-DEFAULT_CARDDAV_CONFIG_FILE = "/etc/carddavd/carddavd.plist"
-
DEFAULT_SERVICE_PARAMS = {
"twistedcaldav.directory.xmlfile.XMLDirectoryService": {
"xmlFile": "accounts.xml",
@@ -299,7 +302,7 @@
"DatabaseRoot" : "Database",
"AttachmentsRoot" : "Attachments",
"DocumentRoot" : "Documents",
- "ConfigRoot" : "/etc/caldavd",
+ "ConfigRoot" : "Config",
"LogRoot" : "/var/log/caldavd",
"RunRoot" : "/var/run/caldavd",
"WebCalendarRoot" : "/usr/share/collabd",
@@ -938,10 +941,10 @@
RELATIVE_PATHS = [
("ServerRoot", "DataRoot"),
- ("ServerRoot", "DocumentRoot"),
("ServerRoot", "ConfigRoot"),
("ServerRoot", "LogRoot"),
("ServerRoot", "RunRoot"),
+ ("DataRoot", "DocumentRoot"),
("DataRoot", "DatabaseRoot"),
("DataRoot", "AttachmentsRoot"),
("DataRoot", ("TimezoneService", "BasePath",)),
Modified: CalendarServer/trunk/twistedcaldav/test/test_stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_stdconfig.py 2011-12-15 23:36:22 UTC (rev 8457)
+++ CalendarServer/trunk/twistedcaldav/test/test_stdconfig.py 2011-12-15 23:45:47 UTC (rev 8458)
@@ -140,7 +140,7 @@
}))
cfg.addPostUpdateHooks([_updateDataStore])
cfg.load(tempfile1.path)
- self.assertEquals(cfg.DocumentRoot, "/root/defaultdoc")
+ self.assertEquals(cfg.DocumentRoot, "/root/overridedata/defaultdoc")
self.assertEquals(cfg.DataRoot, "/root/overridedata")
def test_updateDataStore(self):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111215/fb0bb3eb/attachment-0001.html>
More information about the calendarserver-changes
mailing list