[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-active
Subject:    Re: Review Request 110752: Bodega-server: Add documentation support to bodega-server. Also add markd
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2013-05-31 23:01:34
Message-ID: 20130531230134.23367.77061 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110752/#review33542
-----------------------------------------------------------


i don't think it makes much sense to include the README file, since that is required \
to get the server started. which makes it a bit of a chicken-and-egg problem ;) i \
also don't see much value in having the README available there. what might be more \
interesting is a license file in the docs.

also, this needs a test before it can go in. test should ensure that /api/ works, \
that requesting a non-existent file fails and requesting and existing file returns \
the actual file contents (the test can load it from disk to compare)


server/routes.js
<http://git.reviewboard.kde.org/r/110752/#comment24794>

    this means we can't have subdirs in the doc/ directory. perhaps better would be \
to call path.normalize .. sth like:  
    app.get('/api/(.*)', function(req, res) {
        var filename = path.normalize(req.params[0]);
    
    this allows subdirs, and protects against things like '..' causing problems.



server/routes.js
<http://git.reviewboard.kde.org/r/110752/#comment24793>

    this should be an async read with the callback sending the file contents.
    
    also, if the file does not exist the 404 page should be sent.


- Aaron J. Seigo


On May 31, 2013, 5:59 p.m., Antonis Tsiapaliokas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110752/
> -----------------------------------------------------------
> 
> (Updated May 31, 2013, 5:59 p.m.)
> 
> 
> Review request for Bodega.
> 
> 
> Description
> -------
> 
> Hello
> 
> with that patch i am adding the following support to the bodega-server:
> 
> 1) server/doc is the place which all of our documentaion lives.
> 2) The docs are accessible from /api/filename.E.x. for docs/README.markdown => \
> api/README 
> If you all agree with that patch, i will push it to the branch which i am referring \
> above(kokeroulis/markdown/documentation) 
> P.S. the two files are from bodega-server and bodega-client
> 
> 
> Diffs
> -----
> 
> server/doc/index.markdown PRE-CREATION 
> server/doc/json_api.markdown PRE-CREATION 
> server/package.json 09f2527 
> server/routes.js 95883a9 
> 
> Diff: http://git.reviewboard.kde.org/r/110752/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Antonis Tsiapaliokas
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/110752/">http://git.reviewboard.kde.org/r/110752/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">i don&#39;t think it \
makes much sense to include the README file, since that is required to get the server \
started. which makes it a bit of a chicken-and-egg problem ;) i also don&#39;t see \
much value in having the README available there. what might be more interesting is a \
license file in the docs.

also, this needs a test before it can go in. test should ensure that /api/ works, \
that requesting a non-existent file fails and requesting and existing file returns \
the actual file contents (the test can load it from disk to compare)</pre>  <br />







<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/110752/diff/1/?file=147519#file147519line366" \
style="color: black; font-weight: bold; text-decoration: \
underline;">server/routes.js</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">function serverPath(path)</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">366</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="kd">var</span> <span class="nx">filename</span> <span class="o">=</span> <span \
class="nx">path</span><span class="p">.</span><span class="nx">basename</span><span \
class="p">(</span><span class="nx">req</span><span class="p">.</span><span \
class="nx">url</span><span class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this means \
we can&#39;t have subdirs in the doc/ directory. perhaps better would be to call \
path.normalize .. sth like:

app.get(&#39;/api/(.*)&#39;, function(req, res) {
    var filename = path.normalize(req.params[0]);

this allows subdirs, and protects against things like &#39;..&#39; causing \
problems.</pre> </div>
<br />

<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/110752/diff/1/?file=147519#file147519line376" \
style="color: black; font-weight: bold; text-decoration: \
underline;">server/routes.js</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">function serverPath(path)</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">376</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="kd">var</span> <span class="nx">filenameData</span> <span class="o">=</span> \
<span class="nx">fs</span><span class="p">.</span><span \
class="nx">readFileSync</span><span class="p">(</span><span \
class="nx">filePath</span><span class="p">,</span> <span \
class="s1">&#39;utf8&#39;</span><span class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this should \
be an async read with the callback sending the file contents.

also, if the file does not exist the 404 page should be sent.</pre>
</div>
<br />



<p>- Aaron J.</p>


<br />
<p>On May 31st, 2013, 5:59 p.m. UTC, Antonis Tsiapaliokas wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Bodega.</div>
<div>By Antonis Tsiapaliokas.</div>


<p style="color: grey;"><i>Updated May 31, 2013, 5:59 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Hello

with that patch i am adding the following support to the bodega-server:

1) server/doc is the place which all of our documentaion lives.
2) The docs are accessible from /api/filename.E.x. for docs/README.markdown =&gt; \
api/README

If you all agree with that patch, i will push it to the branch which i am referring \
above(kokeroulis/markdown/documentation)

P.S. the two files are from bodega-server and bodega-client</pre>
  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>server/doc/index.markdown <span style="color: grey">(PRE-CREATION)</span></li>

 <li>server/doc/json_api.markdown <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>server/package.json <span style="color: grey">(09f2527)</span></li>

 <li>server/routes.js <span style="color: grey">(95883a9)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/110752/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
Active mailing list
Active@kde.org
https://mail.kde.org/mailman/listinfo/active


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic