<!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>[12870] CalendarServer/trunk/calendarserver/webadmin</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/12870">12870</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2014-03-10 15:58:24 -0700 (Mon, 10 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add server configuration page.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarserverwebadminlandingpy">CalendarServer/trunk/calendarserver/webadmin/landing.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadminlandingxhtml">CalendarServer/trunk/calendarserver/webadmin/landing.xhtml</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarserverwebadminconfigpy">CalendarServer/trunk/calendarserver/webadmin/config.py</a></li>
<li><a href="#CalendarServertrunkcalendarserverwebadminconfigxhtml">CalendarServer/trunk/calendarserver/webadmin/config.xhtml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarserverwebadminconfigpy"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/calendarserver/webadmin/config.py (0 => 12870)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/config.py         (rev 0)
+++ CalendarServer/trunk/calendarserver/webadmin/config.py        2014-03-10 22:58:24 UTC (rev 12870)
</span><span class="lines">@@ -0,0 +1,132 @@
</span><ins>+# -*- test-case-name: calendarserver.webadmin.test.test_landing -*-
+##
+# Copyright (c) 2009-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.
+##
+
+"""
+Calendar Server Configuration UI.
+"""
+
+__all__ = [
+ "ConfigurationResource",
+]
+
+from twisted.web.template import renderer, tags as html
+
+from .resource import PageElement, TemplateResource
+
+
+
+class ConfigurationPageElement(PageElement):
+ """
+ Configuration management page element.
+ """
+
+ def __init__(self, configuration):
+ PageElement.__init__(self, u"config")
+
+ self.configuration = configuration
+
+
+ def pageSlots(self):
+ slots = {
+ u"title": u"Server Configuration",
+ }
+
+ for key in (
+ "ServerHostName",
+ "HTTPPort",
+ "SSLPort",
+ "BindAddresses",
+ "BindHTTPPorts",
+ "BindSSLPorts",
+ "EnableSSL",
+ "RedirectHTTPToHTTPS",
+ "SSLCertificate",
+ "SSLPrivateKey",
+ "SSLAuthorityChain",
+ "SSLMethod",
+ "SSLCiphers",
+ "EnableCalDAV",
+ "EnableCardDAV",
+ "ServerRoot",
+ "EnableSSL",
+ "UserQuota",
+ "MaxCollectionsPerHome",
+ "MaxResourcesPerCollection",
+ "MaxResourceSize",
+ "UserName",
+ "GroupName",
+ "ProcessType",
+ "MultiProcess.MinProcessCount",
+ "MultiProcess.ProcessCount",
+ "MaxRequests",
+ ):
+ value = self.configuration
+
+ for key in key.split("."):
+ value = getattr(value, key)
+
+ def describe(value):
+ if value == u"":
+ return u"(empty string)"
+
+ if value is None:
+ return u"(no value)"
+
+ return html.code(unicode(value))
+
+ if isinstance(value, list):
+ result = []
+ for item in value:
+ result.append(describe(item))
+ result.append(html.br())
+ result.pop()
+
+ else:
+ result = describe(value)
+
+ slots[key] = result
+
+ return slots
+
+
+ @renderer
+ def log_level_row(self, request, tag):
+ def rowsForNamespaces(namespaces):
+ for namespace in namespaces:
+ yield tag.clone().fillSlots(
+ log_level_name="** name **",
+ log_level_value="** value **",
+ )
+
+ namespaces = ()
+
+ return rowsForNamespaces(namespaces)
+
+
+
+class ConfigurationResource(TemplateResource):
+ """
+ Configuration management page resource.
+ """
+
+ addSlash = False
+
+
+ def __init__(self, configuration):
+ TemplateResource.__init__(
+ self, lambda: ConfigurationPageElement(configuration)
+ )
</ins></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminconfigxhtml"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/calendarserver/webadmin/config.xhtml (0 => 12870)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/config.xhtml         (rev 0)
+++ CalendarServer/trunk/calendarserver/webadmin/config.xhtml        2014-03-10 22:58:24 UTC (rev 12870)
</span><span class="lines">@@ -0,0 +1,261 @@
</span><ins>+<!DOCTYPE html>
+<html
+ xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
+ t:render="main"
+>
+
+ <head>
+ <title><t:slot name="title" /></title>
+ <link t:render="stylesheet" />
+
+ <style>
+
+ .config_key {
+ width: 20%;
+ }
+ .config_value {
+ width: 40%;
+ }
+
+ </style>
+
+ </head>
+
+ <body>
+
+ <h1><t:slot name="title" /></h1>
+
+
+ <h2>Public Network Address Information</h2>
+
+ <table>
+ <caption>
+ These settings determine how one accesses the server on the Internet.
+ This may or may not be the same address that the server listens to itself.
+ This may, for example, be the address for a load balancer which forwards requests to the server.
+ </caption>
+ <tbody>
+ <tr>
+ <th class="config_key">Host Name</th>
+ <td class="config_value"><t:slot name="ServerHostName" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">HTTP Port</th>
+ <td class="config_value"><t:slot name="HTTPPort" /></td>
+ <td class="comment">
+ For most servers, this should be <code>80</code>.
+ </td>
+ </tr>
+ <tr>
+ <th class="config_key">HTTPS (TLS) Port</th>
+ <td class="config_value"><t:slot name="SSLPort" /></td>
+ <td class="comment">
+ For most servers, this should be <code>443</code>.
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+ <h2>Bound Network Address Information</h2>
+
+ <table>
+ <caption>
+ These settings determine the actual network address that the server binds to.
+ By default, this is the same as the public network address information provided above.
+ </caption>
+ <tbody>
+ <tr>
+ <th class="config_key">IP Addresses</th>
+ <td class="config_value"><t:slot name="BindAddresses" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">HTTP Ports</th>
+ <td class="config_value"><t:slot name="BindHTTPPorts" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">TLS Ports</th>
+ <td class="config_value"><t:slot name="BindSSLPorts" /></td>
+ <td class="comment" />
+ </tr>
+ </tbody>
+ </table>
+
+
+ <h2>Transport Layer Security (TLS) Settings</h2>
+
+ <table>
+ <caption>
+ These settings determine how one accesses the server on the Internet.
+ This may or may not be the same address that the server listens to itself.
+ This may, for example, be the address for a load balancer which forwards requests to the server.
+ </caption>
+ <tbody>
+ <tr>
+ <th class="config_key">Enable HTTPS (TLS)</th>
+ <td class="config_value"><t:slot name="EnableSSL" /></td>
+ <td class="comment">
+ It is strongly advised that TLS is enabled on production servers.
+ </td>
+ </tr>
+ <tr>
+ <th class="config_key">Redirect To HTTPS</th>
+ <td class="config_value"><t:slot name="RedirectHTTPToHTTPS" /></td>
+ <td class="comment">
+ Redirect clients to the secure port (recommended).
+ </td>
+ </tr>
+ <tr>
+ <th class="config_key">TLS Certificate</th>
+ <td class="config_value"><t:slot name="SSLCertificate" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">TLS Private Key</th>
+ <td class="config_value"><t:slot name="SSLPrivateKey" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">TLS Authority Chain</th>
+ <td class="config_value"><t:slot name="SSLAuthorityChain" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">TLS Methods</th>
+ <td class="config_value"><t:slot name="SSLMethod" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">TLS Ciphers</th>
+ <td class="config_value"><t:slot name="SSLCiphers" /></td>
+ <td class="comment" />
+ </tr>
+ </tbody>
+ </table>
+
+
+ <h2>Service Settings</h2>
+
+ <table>
+ <caption />
+ <tbody>
+ <tr>
+ <th class="config_key">Enable CalDAV</th>
+ <td class="config_value"><t:slot name="EnableCalDAV" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">Enable CardDAV</th>
+ <td class="config_value"><t:slot name="EnableCardDAV" /></td>
+ <td class="comment" />
+ </tr>
+ </tbody>
+ </table>
+
+
+ <h2>Data Store</h2>
+
+ <table>
+ <caption />
+ <tbody>
+ <tr>
+ <th class="config_key">Server Root</th>
+ <td class="config_value"><t:slot name="ServerRoot" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">Data Source Name</th>
+ <td class="config_value"><t:slot name="EnableSSL" /></td>
+ <td class="comment">
+ Database connection string.
+ </td>
+ </tr>
+ <tr>
+ <th class="config_key">Attachment Quota (Bytes)</th>
+ <td class="config_value"><t:slot name="UserQuota" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">Max # Collections Per Account</th>
+ <td class="config_value"><t:slot name="MaxCollectionsPerHome" /></td>
+ <td class="comment">
+ Collections include calendars and address books.
+ </td>
+ </tr>
+ <tr>
+ <th class="config_key">Max # Objects Per Collection</th>
+ <td class="config_value"><t:slot name="MaxResourcesPerCollection" /></td>
+ <td class="comment">
+ Objects include events, to-dos and contacts.
+ </td>
+ </tr>
+ <tr>
+ <th class="config_key">Max Object Size</th>
+ <td class="config_value"><t:slot name="MaxResourceSize" /></td>
+ <td class="comment" />
+ </tr>
+ </tbody>
+ </table>
+
+
+ <h2>Logging</h2>
+
+ <table>
+ <caption />
+ <tbody>
+ <tr t:render="log_level_row">
+ <th class="config_key"><t:slot name="log_level_name" /></th>
+ <td class="config_value"><t:slot name="log_level_value" /></td>
+ <td class="comment" />
+ </tr>
+ </tbody>
+ </table>
+
+
+ <h2>Process Management</h2>
+
+ <table>
+ <caption />
+ <tbody>
+ <tr>
+ <th class="config_key">User Name</th>
+ <td class="config_value"><t:slot name="UserName" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">Group Name</th>
+ <td class="config_value"><t:slot name="GroupName" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">Process Type</th>
+ <td class="config_value"><t:slot name="ProcessType" /></td>
+ <td class="comment" />
+ </tr>
+<!--
+ <tr>
+ <th class="config_key">Min Process Count</th>
+ <td class="config_value"><t:slot name="MultiProcess.MinProcessCount" /></td>
+ <td class="comment" />
+ </tr>
+ <tr>
+ <th class="config_key">Max Process Count</th>
+ <td class="config_value"><t:slot name="MultiProcess.ProcessCount" /></td>
+ <td class="comment" />
+ </tr>
+ -->
+ <tr>
+ <th class="config_key">Max Requests Per Process</th>
+ <td class="config_value"><t:slot name="MaxRequests" /></td>
+ <td class="comment" />
+ </tr>
+ </tbody>
+ </table>
+
+
+ </body>
+
+</html>
</ins></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminlandingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/landing.py (12869 => 12870)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/landing.py        2014-03-10 22:58:02 UTC (rev 12869)
+++ CalendarServer/trunk/calendarserver/webadmin/landing.py        2014-03-10 22:58:24 UTC (rev 12870)
</span><span class="lines">@@ -26,14 +26,9 @@
</span><span class="cx"> # from twisted.web.template import renderer
</span><span class="cx">
</span><span class="cx"> from .resource import PageElement, TemplateResource
</span><del>-from .logs import LogsResource
-from .principals import PrincipalsResource
-from .work import WorkMonitorResource
</del><span class="cx">
</span><del>-from . import logs, principals, work
</del><span class="cx">
</span><span class="cx">
</span><del>-
</del><span class="cx"> class WebAdminLandingPageElement(PageElement):
</span><span class="cx"> """
</span><span class="cx"> Web administration langing page element.
</span><span class="lines">@@ -61,14 +56,25 @@
</span><span class="cx"> def __init__(self, path, root, directory, store, principalCollections=()):
</span><span class="cx"> TemplateResource.__init__(self, WebAdminLandingPageElement)
</span><span class="cx">
</span><ins>+ from twistedcaldav.config import config as configuration
+
+ self.configuration = configuration
</ins><span class="cx"> self.directory = directory
</span><span class="cx"> self.store = store
</span><span class="cx"> # self._path = path
</span><span class="cx"> # self._root = root
</span><span class="cx"> # self._principalCollections = principalCollections
</span><span class="cx">
</span><ins>+ from .config import ConfigurationResource
+ self.putChild(u"config", ConfigurationResource(configuration))
+
+ from .principals import PrincipalsResource
+ self.putChild(u"principals", PrincipalsResource(directory))
+
+ from .logs import LogsResource
</ins><span class="cx"> self.putChild(u"logs", LogsResource())
</span><del>- self.putChild(u"principals", PrincipalsResource(directory))
</del><ins>+
+ from .work import WorkMonitorResource
</ins><span class="cx"> self.putChild(u"work", WorkMonitorResource(store))
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -85,14 +91,20 @@
</span><span class="cx"> # re-loaded for each request.
</span><span class="cx"> #
</span><span class="cx">
</span><del>- if name == u"logs":
- reload(logs)
- return logs.LogsResource()
</del><ins>+ from . import config, principals, logs, work
</ins><span class="cx">
</span><ins>+ if name == u"config":
+ reload(config)
+ return config.ConfigurationResource(self.configuration)
+
</ins><span class="cx"> elif name == u"principals":
</span><span class="cx"> reload(principals)
</span><span class="cx"> return principals.PrincipalsResource(self.directory)
</span><span class="cx">
</span><ins>+ elif name == u"logs":
+ reload(logs)
+ return logs.LogsResource()
+
</ins><span class="cx"> elif name == u"work":
</span><span class="cx"> reload(work)
</span><span class="cx"> return work.WorkMonitorResource(self.store)
</span></span></pre></div>
<a id="CalendarServertrunkcalendarserverwebadminlandingxhtml"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/webadmin/landing.xhtml (12869 => 12870)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/webadmin/landing.xhtml        2014-03-10 22:58:02 UTC (rev 12869)
+++ CalendarServer/trunk/calendarserver/webadmin/landing.xhtml        2014-03-10 22:58:24 UTC (rev 12870)
</span><span class="lines">@@ -11,8 +11,12 @@
</span><span class="cx"> <h1><t:slot name="title" /></h1>
</span><span class="cx">
</span><span class="cx"> <ul>
</span><ins>+ <li><a href="config">Server Configuration</a></li>
+ <li><a href="principals">Principal Management</a></li>
+ </ul>
+
+ <ul>
</ins><span class="cx"> <li><a href="logs">Server Logs</a></li>
</span><del>- <li><a href="principals">Principal Management</a></li>
</del><span class="cx"> <li><a href="work">Workload Monitor</a></li>
</span><span class="cx"> </ul>
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>