This file is indexed.

/usr/share/doc/ganeti/html/design-http-server.html is in ganeti-doc 2.16.0~rc2-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Design for replacing Ganeti’s HTTP server &#8212; Ganeti 2.16.0~rc2 documentation</title>
    <link rel="stylesheet" href="_static/style.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '2.16.0~rc2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Design for import/export version 2" href="design-impexp2.html" />
    <link rel="prev" title="Design for a X509 Certificate Authority" href="design-x509-ca.html" /> 
  </head>
  <body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="design-impexp2.html" title="Design for import/export version 2"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="design-x509-ca.html" title="Design for a X509 Certificate Authority"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Ganeti 2.16.0~rc2 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="design-draft.html" accesskey="U">Design document drafts</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="design-for-replacing-ganeti-s-http-server">
<h1><a class="toc-backref" href="#id2">Design for replacing Ganeti’s HTTP server</a><a class="headerlink" href="#design-for-replacing-ganeti-s-http-server" title="Permalink to this headline"></a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Created:</th><td class="field-body">2011-Mar-23</td>
</tr>
<tr class="field-even field"><th class="field-name">Status:</th><td class="field-body">Draft</td>
</tr>
</tbody>
</table>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#design-for-replacing-ganeti-s-http-server" id="id2">Design for replacing Ganeti’s HTTP server</a><ul>
<li><a class="reference internal" href="#current-state-and-shortcomings" id="id3">Current state and shortcomings</a></li>
<li><a class="reference internal" href="#proposed-changes" id="id4">Proposed changes</a><ul>
<li><a class="reference internal" href="#software-choice" id="id5">Software choice</a></li>
<li><a class="reference internal" href="#rpc-feedback" id="id6">RPC feedback</a></li>
<li><a class="reference internal" href="#software-requirements" id="id7">Software requirements</a></li>
<li><a class="reference internal" href="#lighttpd-ssl-configuration" id="id8">Lighttpd SSL configuration</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="current-state-and-shortcomings">
<span id="http-srv-shortcomings"></span><h2><a class="toc-backref" href="#id3">Current state and shortcomings</a><a class="headerlink" href="#current-state-and-shortcomings" title="Permalink to this headline"></a></h2>
<p>The <a class="reference internal" href="design-impexp2.html"><span class="doc">new design for import/export</span></a> depends on an
HTTP server. Ganeti includes a home-grown HTTP server based on Python’s
<code class="docutils literal"><span class="pre">BaseHTTPServer</span></code>. While it served us well so far, it only implements
the very basics of the HTTP protocol. It is, for example, not structured
well enough to support chunked transfers (<span class="target" id="index-0"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc2616.html"><strong>RFC 2616</strong></a>, section 3.6.1),
which would have some advantages. In addition, it has not been designed
for sending large responses.</p>
<p>In the case of the node daemon the HTTP server can not easily be
separated from the actual backend code and therefore must run as “root”.
The RAPI daemon does request parsing in the same process as talking to
the master daemon via LUXI.</p>
</div>
<div class="section" id="proposed-changes">
<h2><a class="toc-backref" href="#id4">Proposed changes</a><a class="headerlink" href="#proposed-changes" title="Permalink to this headline"></a></h2>
<p>The proposal is to start using a full-fledged HTTP server in Ganeti and
to run Ganeti’s code as <a class="reference external" href="http://www.fastcgi.com/">FastCGI</a>
applications. Reasons:</p>
<ul class="simple">
<li>Simplify Ganeti’s code by delegating the details of HTTP and SSL to
another piece of software</li>
<li>Run HTTP frontend and handler backend as separate processes and users
(esp. useful for node daemon, but also import/export and Remote API)</li>
<li>Allows implementation of <a class="reference internal" href="#rpc-feedback"><span class="std std-ref">RPC feedback</span></a></li>
</ul>
<div class="section" id="software-choice">
<h3><a class="toc-backref" href="#id5">Software choice</a><a class="headerlink" href="#software-choice" title="Permalink to this headline"></a></h3>
<p>Theoretically any server able of speaking FastCGI to a backend process
could be used. However, to keep the number of steps required for setting
up a new cluster at roughly the same level, the implementation will be
geared for one specific HTTP server at the beginning. Support for other
HTTP servers can still be implemented.</p>
<p>After a rough selection of available HTTP servers <a class="reference external" href="http://www.lighttpd.net/">lighttpd</a> and <a class="reference external" href="http://www.nginx.org/">nginx</a> were
the most likely candidates. Both are <a class="reference external" href="http://news.netcraft.com/archives/2011/01/12/january-2011-web-server-survey-4.html">widely used</a> and tested.</p>
<p>Nginx’ <a class="reference external" href="http://sysoev.ru/nginx/docs/">original documentation</a> is in
Russian, translations are <a class="reference external" href="http://wiki.nginx.org/">available in a Wiki</a>. Nginx does not support old-style CGI
programs.</p>
<p>The author found <a class="reference external" href="http://redmine.lighttpd.net/wiki/lighttpd">lighttpd’s documentation</a> easier to understand and
was able to configure a test server quickly. This, together with the
support for more technologies, made deciding easier.</p>
<p>With its use as a public-facing web server on a large number of websites
(and possibly more behind proxies), lighttpd should be a safe choice.
Unlike other webservers, such as the Apache HTTP Server, lighttpd’s
codebase is of manageable size.</p>
<p>Initially the HTTP server would only be used for import/export
transfers, but its use can be expanded to the Remote API and node
daemon (see <a class="reference internal" href="#rpc-feedback"><span class="std std-ref">RPC feedback</span></a>).</p>
<p>To reduce the attack surface, an option will be provided to configure
services (e.g. import/export) to only listen on certain network
interfaces.</p>
</div>
<div class="section" id="rpc-feedback">
<span id="id1"></span><h3><a class="toc-backref" href="#id6">RPC feedback</a><a class="headerlink" href="#rpc-feedback" title="Permalink to this headline"></a></h3>
<p>HTTP/1.1 supports chunked transfers (<span class="target" id="index-1"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc2616.html"><strong>RFC 2616</strong></a>, section 3.6.1). They
could be used to provide feedback from node daemons to the master,
similar to the feedback from jobs. A good use would be to provide
feedback to the user during long-running operations, e.g. downloading an
instance’s data from another cluster.</p>
<p>WSGI 1.0 (<span class="target" id="index-2"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0333"><strong>PEP 333</strong></a>) includes the following <a class="reference external" href="http://www.python.org/dev/peps/pep-0333/#buffering-and-streaming">requirement</a>:</p>
<blockquote>
<div>WSGI servers, gateways, and middleware <strong>must not</strong> delay the
transmission of any block; they <strong>must</strong> either fully transmit the
block to the client, or guarantee that they will continue transmission
even while the application is producing its next block</div></blockquote>
<p>This behaviour was confirmed to work with lighttpd and the
<a class="reference internal" href="#http-software-req"><span class="std std-ref">flup</span></a> library. FastCGI by itself has no such
guarantee; webservers with buffering might require artificial padding to
force the message to be transmitted.</p>
<p>The node daemon can send JSON-encoded messages back to the master daemon
by separating them using a predefined character (see <a class="reference internal" href="design-2.0.html#luxi"><span class="std std-ref">LUXI</span></a>). The final message contains the method’s result. pycURL passes
each received chunk to the callback set as <code class="docutils literal"><span class="pre">CURLOPT_WRITEFUNCTION</span></code>.
Once a message is complete, the master daemon can pass it to a callback
function inside the job, which then decides on what to do (e.g. forward
it as job feedback to the user).</p>
<p>A more detailed design may have to be written before deciding whether to
implement RPC feedback.</p>
</div>
<div class="section" id="software-requirements">
<span id="http-software-req"></span><h3><a class="toc-backref" href="#id7">Software requirements</a><a class="headerlink" href="#software-requirements" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>lighttpd 1.4.24 or above built with OpenSSL support (earlier versions
<a class="reference external" href="http://redmine.lighttpd.net/issues/1288">don’t support SSL client certificates</a>)</li>
<li><a class="reference external" href="http://trac.saddi.com/flup">flup</a> for FastCGI</li>
</ul>
</div>
<div class="section" id="lighttpd-ssl-configuration">
<h3><a class="toc-backref" href="#id8">Lighttpd SSL configuration</a><a class="headerlink" href="#lighttpd-ssl-configuration" title="Permalink to this headline"></a></h3>
<p>The following sample shows how to configure SSL with client certificates
in Lighttpd:</p>
<div class="highlight-lighttpd"><div class="highlight"><pre><span></span><span class="nb">$SERVER</span><span class="p">[</span><span class="s2">&quot;socket&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="s2">&quot;:443&quot;</span> <span class="p">{</span>
  <span class="k">ssl.engine</span> <span class="o">=</span> <span class="s2">&quot;enable&quot;</span>
  <span class="k">ssl.pemfile</span> <span class="o">=</span> <span class="s2">&quot;server.pem&quot;</span>
  <span class="k">ssl.ca-file</span> <span class="o">=</span> <span class="s2">&quot;ca.pem&quot;</span>
  <span class="k">ssl.use-sslv</span><span class="m">2</span>  <span class="o">=</span> <span class="s2">&quot;disable&quot;</span>
  <span class="k">ssl.cipher-list</span> <span class="o">=</span> <span class="s2">&quot;HIGH:-DES:-3DES:-EXPORT:-ADH&quot;</span>
  <span class="k">ssl.verifyclient.activate</span> <span class="o">=</span> <span class="s2">&quot;enable&quot;</span>
  <span class="k">ssl.verifyclient.enforce</span> <span class="o">=</span> <span class="s2">&quot;enable&quot;</span>
  <span class="k">ssl.verifyclient.exportcert</span> <span class="o">=</span> <span class="s2">&quot;enable&quot;</span>
  <span class="k">ssl.verifyclient.username</span> <span class="o">=</span> <span class="s2">&quot;SSL_CLIENT_S_DN_CN&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Design for replacing Ganeti’s HTTP server</a><ul>
<li><a class="reference internal" href="#current-state-and-shortcomings">Current state and shortcomings</a></li>
<li><a class="reference internal" href="#proposed-changes">Proposed changes</a><ul>
<li><a class="reference internal" href="#software-choice">Software choice</a></li>
<li><a class="reference internal" href="#rpc-feedback">RPC feedback</a></li>
<li><a class="reference internal" href="#software-requirements">Software requirements</a></li>
<li><a class="reference internal" href="#lighttpd-ssl-configuration">Lighttpd SSL configuration</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="design-x509-ca.html"
                        title="previous chapter">Design for a X509 Certificate Authority</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="design-impexp2.html"
                        title="next chapter">Design for import/export version 2</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/design-http-server.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="design-impexp2.html" title="Design for import/export version 2"
             >next</a></li>
        <li class="right" >
          <a href="design-x509-ca.html" title="Design for a X509 Certificate Authority"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Ganeti 2.16.0~rc2 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="design-draft.html" >Design document drafts</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2018, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Google Inc..
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.7.
    </div>
  </body>
</html>