[CalendarServer-changes] [3205] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Oct 21 16:24:20 PDT 2008
Revision: 3205
http://trac.macosforge.org/projects/calendarserver/changeset/3205
Author: wsanchez at apple.com
Date: 2008-10-21 16:24:19 -0700 (Tue, 21 Oct 2008)
Log Message:
-----------
If ServerHostName is empty, use socket.getfqdn().
Modified Paths:
--------------
CalendarServer/trunk/conf/caldavd-test.plist
CalendarServer/trunk/conf/caldavd.plist
CalendarServer/trunk/twistedcaldav/config.py
Modified: CalendarServer/trunk/conf/caldavd-test.plist
===================================================================
--- CalendarServer/trunk/conf/caldavd-test.plist 2008-10-21 21:00:38 UTC (rev 3204)
+++ CalendarServer/trunk/conf/caldavd-test.plist 2008-10-21 23:24:19 UTC (rev 3205)
@@ -30,9 +30,9 @@
proxy which forwards connections to the server.
-->
- <!-- Network host name -->
+ <!-- Network host name [empty = system host name] -->
<key>ServerHostName</key>
- <string>localhost</string> <!-- The hostname clients use when connecting -->
+ <string></string> <!-- The hostname clients use when connecting -->
<!-- HTTP port [0 = disable HTTP] -->
<key>HTTPPort</key>
Modified: CalendarServer/trunk/conf/caldavd.plist
===================================================================
--- CalendarServer/trunk/conf/caldavd.plist 2008-10-21 21:00:38 UTC (rev 3204)
+++ CalendarServer/trunk/conf/caldavd.plist 2008-10-21 23:24:19 UTC (rev 3205)
@@ -30,9 +30,9 @@
proxy which forwards connections to the server.
-->
- <!-- Network host name -->
+ <!-- Network host name [empty = system host name] -->
<key>ServerHostName</key>
- <string>localhost</string> <!-- The hostname clients use when connecting -->
+ <string></string> <!-- The hostname clients use when connecting -->
<!-- HTTP port [0 = disable HTTP] -->
<key>HTTPPort</key>
Modified: CalendarServer/trunk/twistedcaldav/config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/config.py 2008-10-21 21:00:38 UTC (rev 3204)
+++ CalendarServer/trunk/twistedcaldav/config.py 2008-10-21 23:24:19 UTC (rev 3205)
@@ -51,9 +51,9 @@
# default. For example, it may be the address of a load balancer or
# proxy which forwards connections to the server.
#
- "ServerHostName": "localhost", # Network host name.
- "HTTPPort": 0, # HTTP port (0 to disable HTTP)
- "SSLPort" : 0, # SSL port (0 to disable HTTPS)
+ "ServerHostName": "", # Network host name.
+ "HTTPPort": 0, # HTTP port (0 to disable HTTP)
+ "SSLPort" : 0, # SSL port (0 to disable HTTPS)
# Note: we'd use None above, but that confuses the command-line parser.
@@ -344,6 +344,7 @@
self._data = copy.deepcopy(self._defaults)
self._configFile = None
self._hooks = [
+ self.updateHostName,
self.updateDirectoryService,
self.updateACLs,
self.updateRejectClients,
@@ -366,6 +367,15 @@
hook(self, items)
@staticmethod
+ def updateHostName(self, items):
+ if not self.ServerHostName:
+ from socket import getfqdn
+ hostname = getfqdn()
+ if not hostname:
+ hostname = "localhost"
+ self.ServerHostName = hostname
+
+ @staticmethod
def updateDirectoryService(self, items):
#
# Special handling for directory services configs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081021/7ac16853/attachment-0001.html>
More information about the calendarserver-changes
mailing list