<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>the purple greeko &#187; Sysadmin</title>
	<atom:link href="http://blogs.gentoo.org/tampakrap/category/sysadmin/feed" rel="self" type="application/rss+xml" />
	<link>http://blogs.gentoo.org/tampakrap</link>
	<description></description>
	<lastBuildDate>Sun, 24 Mar 2013 13:06:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Puppet Portage module version 2.0</title>
		<link>http://blogs.gentoo.org/tampakrap/puppet-portage-module-version-2-0/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/puppet-portage-module-version-2-0/#comments</comments>
		<pubDate>Thu, 28 Feb 2013 01:11:41 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=1025</guid>
		<description><![CDATA[After a few months of a lot of hard work, I&#8217;m thrilled to announce the availability of the Portage Puppet module version 2.0! Background This module was initally developed by Lance Albertson and some other guys from OSUOSL. Adrien Thebo, who &#8230; <a href="http://blogs.gentoo.org/tampakrap/puppet-portage-module-version-2-0/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>After a few months of a lot of hard work, I&#8217;m thrilled to announce the availability of the <a href="http://forge.puppetlabs.com/adrien/portage/2.0.0" target="_blank">Portage Puppet module</a> version 2.0!</p>
<p align="center"><span style="font-size:x-large"><strong>Background</strong></span></p>
<p>This module was initally developed by <a href="http://www.lancealbertson.com/" target="_blank">Lance Albertson</a> and some other guys from OSUOSL. <a href="http://somethingsinistral.net/" target="_blank">Adrien Thebo</a>, who by the way works for PuppetLabs, stepped in after some time and did some cleanup in the native types/providers that were included in there, and later he took over completely. Judging from the commit log though, the module was not getting the love it deserved <img src='http://blogs.gentoo.org/tampakrap/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Meanwhile, we, the Gentoo Infrastructure team, decided to migrate from Cfengine 2 to Puppet. So I started digging around to check about Gentoo support in Puppet. Given the complexity of the package management in Gentoo, I didn&#8217;t have high expectations, and I wasn&#8217;t wrong. The internal Puppet Portage provider has pretty basic support, so I had to get my hands dirty and write something decent. Then I stumbled upon Adrien&#8217;s puppet-portage repo, which made me felt like I hit the jackpot. I started testing it to understand the functionality it covers, and meanwhile I spent some time reading books and experimenting with Puppet and Ruby, as both of them were pretty new to me.</p>
<p>Right after the Gentoo Miniconf I finally contacted Adrien and expressed my interest in developing more functionality to the module. In 3 &#8211; 4 months of hard work we managed to have all the functionality I had in mind, which is impressive. It was a great journey, as I had the chance to do quite some stuff in a technology that was completely unknown to me. Adrien was very helpful in giving me correct directions, and I even managed to write a native type and provider from scratch! Thanks a lot Adrien!</p>
<p>Special thanks also to <a href="http://blogs.gentoo.org/zmedico" target="_blank">Zac Medico</a>, main Portage developer, for all his valuable input.</p>
<p align="center"><span style="font-size:x-large"><strong>Features</strong></span></p>
<p>Let&#8217;s see all the functionality this module provides. Most of the info below is stolen from the README file.</p>
<p><strong>1) /etc/portage/package.*/*</strong></p>
<p>There is a set of native providers that add support of handling entries for<br />
/etc/portage/package.keywords, /etc/portage/package.use, /etc/portage/package.mask, /etc/portage/package.unmask. Examples:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">package_use <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'app-admin/puppet'</span>:
  use     <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'flag1'</span>, <span style="color:#996600;">'flag2'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  target  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'puppet-flags'</span>,
  version <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'&gt;=3.0.1'</span>,
  <span style="color:#9966CC; font-weight:bold;">ensure</span>  <span style="color:#006600; font-weight:bold;">=&gt;</span> present,
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>&#8220;$use&#8221; can be either a string or an array of strings.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">package_keywords <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'app-admin/puppet'</span>:
  keywords <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'~x86'</span>, <span style="color:#996600;">'-hppa'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  target   <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'puppet'</span>,
  version  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'&gt;=3.0.1'</span>,
  <span style="color:#9966CC; font-weight:bold;">ensure</span>   <span style="color:#006600; font-weight:bold;">=&gt;</span> present,
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>&#8220;$keywords&#8221; can be either a string or an array of strings.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">package_unmask <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'app-admin/puppet'</span>:
  target  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'puppet'</span>,
  version <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'&gt;=3.0.1'</span>,
  <span style="color:#9966CC; font-weight:bold;">ensure</span>  <span style="color:#006600; font-weight:bold;">=&gt;</span> present,
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">package_mask <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'app-admin/puppet'</span>:
  target  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'tree'</span>,
  version <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'&gt;=3.0.1'</span>,
  <span style="color:#9966CC; font-weight:bold;">ensure</span>  <span style="color:#006600; font-weight:bold;">=&gt;</span> present,
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>A few issues for the above providers (all the issues are reported in the repo&#8217;s Github tracker, but we decided to leave them for the next milestone)</p>
<ul>
<li><a href="https://github.com/adrienthebo/puppet-portage/issues/12" target="_blank">Renaming the target leaves an empty file behind</a></li>
<li><a href="https://github.com/adrienthebo/puppet-portage/issues/24" target="_blank">Wrong permissions in package.*/* files</a>: This is actually solved for newly created files, we need to find a way to enforce sane permissions to all files under /etc/portage though</li>
<li><a href="https://github.com/adrienthebo/puppet-portage/issues/26" target="_blank">Trigger rebuild after package_* addition/edit</a>: The portage_* providers don&#8217;t trigger rebuild, but portage::package (which is described below) does trigger proper rebuilds</li>
<li><a href="https://github.com/adrienthebo/puppet-portage/issues/46" target="_blank">package_* should always use default values when their attributes are not explicitly specified</a></li>
<li><a href="https://github.com/adrienthebo/puppet-portage/issues/46" target="_blank">package_* types do not update version when it was not initially defined</a></li>
<li><a href="https://github.com/adrienthebo/puppet-portage/issues/55" target="_blank">integration tests need to cover the cases of adding removing attributes</a>: Those last three issues are related</li>
<li><a href="https://github.com/adrienthebo/puppet-portage/issues/34" target="_blank">Automatically convert old package.* files to dirs</a>: This is probably not going to be fixed. In short, the Portage module works only if /etc/portage/package.* are directories. If any of those is a file, it will print an error. For now you should convert any package.* files there to directories manually. A bash script to do it quickly:</li>
</ul>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> target <span style="color: #000000; font-weight: bold;">in</span> keywords use mask unmask; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.<span style="color: #007800;">$target</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.<span style="color: #007800;">$target</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.<span style="color: #800000;">${target}</span>_bak
        <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.<span style="color: #007800;">$target</span>
        <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.<span style="color: #800000;">${target}</span>_bak <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.<span style="color: #007800;">$target</span><span style="color: #000000; font-weight: bold;">/</span>old
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p><strong>2) make.conf</strong></p>
<p><span style="color:red">NOTE: Be aware that make.conf has changed location, from /etc/make.conf to /etc/portage/make.conf. Make sure to update your systems as well. It&#8217;s new location makes much more sense. The Portage module uses by default the new location by default.</span></p>
<p>The Portage module provides a custom class to handle your entries in make.conf. Example:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">portage::makeconf <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'use'</span>:
  content <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'flag1 flag2 flag3'</span>
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>This entry will also trigger rebuild of the affected packages.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">portage::makeconf <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'gentoo_mirrors'</span>:
  content <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'url1 url2'</span>
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>As stated in <a href="https://github.com/adrienthebo/puppet-portage/issues/56" target="_blank">issue #56</a>, in a later milestone we will convert this class to a native type/provider, in order to make it more powerful.</p>
<p><strong>3) portage::package</strong></p>
<p>This is another custom class, which acts as a wrapper to the native package resource of Puppet. The following example sums up pretty much all of its functionality:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">portage::package <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'app-admin/puppet'</span>:
  use              <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'-minimal'</span>, <span style="color:#996600;">'augeas'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  use_version      <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'&gt;=3.0.1'</span>,
  keywords         <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'~amd64'</span>, <span style="color:#996600;">'~x86'</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  keywords_version <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'&gt;=3.0.1'</span>,
  mask             <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'&lt;=2.3.17'</span>,
  unmask           <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'&gt;=3.0.1'</span>,
  target           <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'puppet'</span>,
  target_keywords  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'puppet-keywords'</span>,
  <span style="color:#9966CC; font-weight:bold;">ensure</span>           <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'3.0.1'</span>,
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<ul>
<li>If no $target_{keywords,use,mask,unmask} is specified, then the value of $target is being used.</li>
<li>The variables keywords, mask and unmask also accept the special value &#8216;all&#8217;, that will create versionless entries. (This applies only to portage::package, if you want versionless entries in any of the above package_* types, you can just omit the version attribute.)</li>
<li>Any change in portage::package will also trigger the appropriate re-emerge to the affected package.</li>
</ul>
<p>This class was my ultimate functionality request for Portage support in Puppet generally, thus it&#8217;s the part I&#8217;ve spent most of my time on.</p>
<p><strong>4) Facts</strong></p>
<p>All make.conf variables and most of the eselect modules are shown by facter:</p>
<pre>...
eselect_profile => hardened/linux/amd64
eselect_python => python3.2
eselect_ruby => ruby19
...
portage_portage_tmpdir => /var/tmp
portage_portdir => /usr/portage
portage_python_single_target => python2_7
portage_python_targets => python2_7 python3_2
portage_ruby_targets => ruby19
portage_sync => rsync://rsync.gentoo.org/gentoo-portage
...</pre>
<p>Keep in mind though that some of the eselect modules are not being shown as facts on purpose. The reason is that either they are not useful, or they produce too complex output that needs further investigation on how to implement. The blacklisted eselect modules are &#8216;help&#8217;, &#8216;usage&#8217;, &#8216;version&#8217;, &#8216;bashcomp&#8217;, &#8216;env&#8217;, &#8216;fontconfig&#8217;, &#8216;modules&#8217;, &#8216;news&#8217; and &#8216;rc&#8217;.</p>
<p><strong>5) eselect</strong></p>
<p>The eselect type/provider checks for the current state of an eselect module by reading the variable of the equivalent fact. Examples:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">eselect <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'ruby'</span>:
  set <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'ruby19'</span>,
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>For eselect modules that have submodules (eg php):</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">eselect <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">'php_apache2'</span>:
  set <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'php5.3'</span>,
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>This pretty much covers everything. I hope it will be useful for the community. Feel free to submit bugs, patches or ideas at the <a href="https://github.com/adrienthebo/puppet-portage/issues" target="_blank">repo&#8217;s Github issue tracker</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/puppet-portage-module-version-2-0/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>RIP recruiting.gentoo.org</title>
		<link>http://blogs.gentoo.org/tampakrap/rip-recruiting-gentoo-org/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/rip-recruiting-gentoo-org/#comments</comments>
		<pubDate>Wed, 14 Nov 2012 13:28:49 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[recruiting]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=1002</guid>
		<description><![CDATA[The recruiters team announced a few months ago that they decided not to use the recruiting webapp any more, and move back to the txt quizes instead. Additionally, the webapp started showing random ruby exceptions, and since nobody is willing &#8230; <a href="http://blogs.gentoo.org/tampakrap/rip-recruiting-gentoo-org/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>The recruiters team <a href="http://article.gmane.org/gmane.linux.gentoo.devel.announce/1690">announced a few months ago</a> that they decided not to use the recruiting webapp any more, and move back to the txt quizes instead. Additionally, the webapp started showing random ruby exceptions, and since nobody is willing to fix them, we found it a good opportunity to shut down the service completely. There have been people that were still working on it though (including me), so if you are a mentor, mentee or someone who had answers in there, please let me know so I can extract your data and send it to you.<br />
And now I&#8217;d like to state my personal thoughts regarding the webapp and the recruiter&#8217;s decision to move back to the quizes. First of all, I used this webapp as mentor a lot from the very first point it came up, and I mentored about 15 people through it. It was a really nice idea, but not properly implemented. With the txt quizes, the mentees were sending me the txt files by mail, then we had to schedule an IRC meeting to review the answers, or I had to send the mail back etc. It was a hell for both me and the mentee. I was ending up with hundreds of attachments, trying to find out the most recent one (or the previous one to compare answers), and the mentee had to dig between irc logs and mails to find my feedback.<br />
The webapp solved that issue, since the mentee was putting his answers in a central place, and I could easily leave comments there. But it had a bunch of issues though, mostly UI related. It required too many clicks for simple actions, the notification system was broken by design, I had no easy way to see diffs or to see the progress of my mentee (answers replied / answers left). For example, in order to approve an answer, I had to press &#8220;Edit&#8221; which transfered me in a new page, where I had to tick &#8220;Approve&#8221; and press save. Too much, I just wanted to press &#8220;Approve&#8221;! When I decided to start filling bugs, surprisingly I found out that all my UI complaints had already been reported, clearly I was not alone in this world.<br />
In short, cool idea but annoying UI. That was not the problem though, the real problem is that nobody was willing to fix those issues, which led to the recruiters&#8217; decision to move back to txt quizes. But I am not going back to the txt quizes, no way. Instead, I will start a Google doc and tell my mentees to put their answers there. This will allow me to write my comments below their answers with different font/color, so I can have async communication with them. I was present during the recruitment interview session of my last mentee <a href="http://blog.dastergon.gr">Pavlos</a>, and his recruiter <a href="http://hwoarang.silverarrow.org">Markos</a> fired up a Google doc for some coding answers, and it worked pretty well. So I decided to do the same. If the recruiters want the answers in plain text, fine, I can extract them easily.<br />
I&#8217;d like to thank a lot Joachim Bartosik, for his work on the webapp and his interesting ideas he put on this (it saved me a lot of time, and made the mentoring process fun again), and Petteri Räty who mentored Joachim creating the recruiting webapp as GSoC project, and helped in deploying it to infra servers. I am kinda sad that I had to shut it down, and I really hope that someone steps up and revives it or creates an alternative. There has been some discussion regarding that webapp during the Gentoo Miniconf, I hope it doesn&#8217;t sink.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/rip-recruiting-gentoo-org/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>moving services around</title>
		<link>http://blogs.gentoo.org/tampakrap/moving-services-around/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/moving-services-around/#comments</comments>
		<pubDate>Fri, 26 Oct 2012 15:53:17 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[ganeti]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[outage]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=988</guid>
		<description><![CDATA[A few days ago the box that was hosting our low-risk webapps died (barbet.gentoo.org). The services that were affected are get.gentoo.org planet.gentoo.org packages.gentoo.org devmanual.gentoo.org infra-status.gentoo.org and bouncer.gentoo.org. We quickly migrated the services to another box (brambling.gentoo.org). Brambling had issues in &#8230; <a href="http://blogs.gentoo.org/tampakrap/moving-services-around/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>A few days ago the box that was hosting our low-risk webapps died (barbet.gentoo.org). The services that were affected are <a href="http://get.gentoo.org" target="_blank">get.gentoo.org</a> <a href="http://planet.gentoo.org" target="_blank">planet.gentoo.org</a> <a href="http://packages.gentoo.org" target="_blank">packages.gentoo.org</a> <a href="http://devmanual.gentoo.org" target="_blank">devmanual.gentoo.org</a> <a href="http://infra-status.gentoo.org" target="_blank">infra-status.gentoo.org</a> and <a href="http://bouncer.gentoo.org" target="_blank">bouncer.gentoo.org</a>. We quickly migrated the services to another box (brambling.gentoo.org). Brambling had issues in the past with its RAM, but we changed them with new ones a couple of months ago. Additionally, this machine was used for testing only. Unfortunately the machine started to malfunction as soon as those services were transferred there, which means that it has more hardware issues than the RAM. The resulting error messages stopped when we disabled packages.gentoo.org temporarily. The truth is that this packages webapp is old, unmaintained, uses deprecated interfaces and real pain to debug. In this year&#8217;s GSoC we had a really nice replacement by Slava Bacherikov written in django. Additionally, recently we were given a <a href="http://code.google.com/p/ganeti/" target="_blank">Ganeti cluster</a> hosted at <a href="http://osuosl.org/" target="_blank">OSUOSL</a>. Thus we decided not to put up again the old packages.gentoo.org instance, and instead create 4 virtual machines in our Ganeti cluster, and migrate the above webapps there, along with the new and shiny packages.gentoo.org website. Furthermore, we will also deploy another GSoC webapp, gentoostats, and start providing our developers with virtual machines. We will not give public IPv4 IPs to the dev VMs though, but probably use IPv6 only so that developers can access them through woodpecker (the box where the developers have their shell accounts), but it is still under discussion. We already started working on the above, and we expect next week to be fully finished with the new webapps live and rocking. Special thanks to Christian and Alec who took care of the migrations before and during the Gentoo Miniconf.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/moving-services-around/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Okupy &#8211; Report #7</title>
		<link>http://blogs.gentoo.org/tampakrap/okupy-report-7/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/okupy-report-7/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 19:36:35 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[okupy]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=711</guid>
		<description><![CDATA[Quick summary: I&#8217;m writing a CMS for the Gentoo website, that will offer an LDAP web interface, plus it will replace Gorg and provide Beacon as WYSIWYG editor to edit the XML file There were some serious bugs in the &#8230; <a href="http://blogs.gentoo.org/tampakrap/okupy-report-7/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>Quick summary:</p>
<p>I&#8217;m writing a CMS for the Gentoo website, that will offer an LDAP web interface, plus it will replace Gorg and provide Beacon as WYSIWYG editor to edit the XML file</p>
<p>There were some serious bugs in the edit account page. The ACL is very complex there, since there are public attributes (accessed by everyone), semi-private attributes (accessed by the user only and the admins (eg. birthday)), and private ones (accessed only by admins). Keep in mind that everything is configurable, but there is some duplication between the Django and LDAP ACL, since there is no easy way to parse the LDAP slapd.conf yet, we need to migrate our infra to cn=config first, which is a not easy long term task. The bug was not in the LDAP part, remember that the user changes his/others&#8217; (in case he has the right privs) attributes with his own account, not by using a global admin account. The bug was in the Django part, where the system expected to be able to change some data, and weird error messages/exceptions were thrown out. Unfortunately this is not complete yet, it needs more investigation in order to ensure we are not opening any security holes here. The good news is that I tested with our current official configuration, and various tweaks on it, and seems to perform fine. Plus, it seems ready for the improvements I intend to do (for adding regular users in LDAP etc).</p>
<p>I was also able to plug in some CSS/JS written by my mentor. It is just some preliminary work, nothing complete yet, we&#8217;ll need more help on this, especially from people with some experience in web design stuff.</p>
<p>Beacon didn&#8217;t work out as expected. It became too complex, consisting of lots of JS and XSLT, for reading the XML files and printing them. It even stores accounts in its own DB to keep track of the documents that users edit. This was way out of our needs, we just need the WYSIWYG part only and plug it in in a separate web app. Obviously in its current state it is not a workable solution without significant additional effort. What we could do for now is to split some parts of its code, like the python scripts for converting XML to HTML and the opposite, which is also not an easy task.</p>
<p>I must admit that I am really happy that the GSoC is coming to its end, and the real fun begins <img src='http://blogs.gentoo.org/tampakrap/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/okupy-report-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KDE development environment in Gentoo</title>
		<link>http://blogs.gentoo.org/tampakrap/kde-development-environment-in-gentoo/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/kde-development-environment-in-gentoo/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 17:02:47 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Planet KDE]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[akademy]]></category>
		<category><![CDATA[akregator]]></category>
		<category><![CDATA[amarok]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[choqok]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[kaffeine]]></category>
		<category><![CDATA[kde]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=687</guid>
		<description><![CDATA[Introduction As a KDE packager, I usually have to write and test patches, especially build system related (Examples: Choqok, Amarok, Plasma and happy KStatusNotifierItem&#8217;d Akregator and Kaffeine, they don&#8217;t look ancient any more ). Gentoo, as a source based distro, &#8230; <a href="http://blogs.gentoo.org/tampakrap/kde-development-environment-in-gentoo/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: center;"><b><span class="Apple-style-span" style="font-size: x-large;">Introduction</span></b></p>
<p>As a KDE packager, I usually have to write and test patches, especially build system related (Examples: <a href="https://projects.kde.org/projects/extragear/network/choqok/repository/revisions/cc7199008dea3a8076471dc6e416fc10a8ae34e3">Choqok</a>, <a href="https://projects.kde.org/projects/extragear/multimedia/amarok/repository/revisions/8df0197616a3db7d661cb3556f87330dfa024a71/diff/src/CMakeLists.txt">Amarok</a>, Plasma and happy KStatusNotifierItem&#8217;d <a href="https://projects.kde.org/projects/kde/kdepim/repository/revisions/a014b9a20d1bc7c1f345ed5f449d422e47eedc7c">Akregator</a> and <a href="https://projects.kde.org/projects/extragear/multimedia/kaffeine/repository/revisions/2fe9157f5cf87d7a262edddd187d621a401eeaaf">Kaffeine</a>, they don&#8217;t look ancient any more <img src='http://blogs.gentoo.org/tampakrap/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). Gentoo, as a source based distro, has the ability to provide packages that clone/checkout the source from upstream&#8217;s SCM and compile it directly (called live ebuilds). For KDE, it provides live ebuilds from KDE SC master/trunk and the branch(es) (currently 4.7), plus live ebuilds for many extragear/playground and other packages (all of the above are available in the kde overlay). Also, we provide Qt live ebuilds both from master and many branches, in the qting-edge overlay. I wanted to use our Gentoo live ebuilds in order to test patches, but there were multiple problems. Emerge downloads the sources in $DISTDIR and stores them as the portage user. Plus, the git eclass was using bare repos, and it would reset the repo to master before each emerge. In order to solve those problems, I created a few scripts and wrappers, and convinced <a href="http://blogs.gentoo.org/scarabeus">Tomas</a> to introduce two new variables in the new git-2 eclass to fit my needs (thanks a lot bro, you owe me a beer).</p>
<p style="text-align: center;"><span class="Apple-style-span" style="font-size: x-large;"><b>Define the needs</b></span></p>
<p>In short, what I want is:</p>
<ul>
<li>download the sources somewhere in my homedir</li>
<li>my everyday user to have write permissions to them</li>
<li>non-bare clones</li>
<li>url = anongit.kde.org AND pushUrl = git.kde.org, if possible directly on initial clone</li>
<li>if possible, have a live and a regular release side by side</li>
</ul>
<p>The last dot was solvable, but not any more. We used to provide a kdeprefix USE flag, that allowed us to do exactly this (install multiple KDE versions using different prefix (eg /usr/kde/4.7 /usr/kde/live). It had many problems though, that forced us to remove it. The problems it had were mostly in non-KDE packages, eg Sip, which also needed to be prefixed, which was too much workload. Anyway, a chroot could solve that issue.</p>
<p>As for the permission issue, I asked <a href="http://blogs.gentoo.org/zmedico">Zac</a> if portage itself could provide something like this (using my user instead of the portage user), and he suggested that creating a git wrapper would be a clean solution.</p>
<p>After a while I was able to extend the above for my gentoo overlays (unofficial ebuild git repositories), since I have write access to most of the ones I use in my system.</p>
<p style="text-align: center;"><span class="Apple-style-span" style="font-size: x-large;"><b>Configuration</b></span></p>
<p>All the scripts mentioned can be found <a href="https://github.com/tampakrap/bin">here</a>. Although well tested here for the past few months, use them at your own risk. In the following examples I&#8217;m going to use the configurations for both the KDE and Gentoo git repos. Of course, you can ignore them (&#8220;Gentoo repos&#8221; blocks in the following scripts).</p>
<p>First, we need to set the following in /etc/make.conf:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Needed by the Git wrapper</span>
<span style="color: #007800;">KDE_DEVELOPER</span>=<span style="color: #000000;">1</span> <span style="color: #666666; font-style: italic;"># For the KDE repos</span>
<span style="color: #007800;">GENTOO_DEVELOPER</span>=<span style="color: #000000;">1</span> <span style="color: #666666; font-style: italic;"># For the Gentoo repos</span>
<span style="color: #007800;">EGIT_NONBARE</span>=<span style="color: #000000;">1</span> <span style="color: #666666; font-style: italic;"># This one sets the git-2 eclass to clone non-bare repos</span></pre></td></tr></table></div>

<p>Next, we set up some git aliases in ~/.gitconfig, as suggested <a href="http://community.kde.org/Sysadmin/GitKdeOrgManual#Let_Git_rewrite_URL_prefixes">here</a>:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># KDE Repos</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>url <span style="color: #ff0000;">&quot;git://anongit.kde.org/&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
    insteadOf = kde:
<span style="color: #7a0874; font-weight: bold;">&#91;</span>url <span style="color: #ff0000;">&quot;git@git.kde.org:&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
    pushInsteadOf = kde:
<span style="color: #666666; font-style: italic;"># Gentoo Repos</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>url <span style="color: #ff0000;">&quot;git://git.overlays.gentoo.org/&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
    insteadOf = gentoo:
<span style="color: #7a0874; font-weight: bold;">&#91;</span>url <span style="color: #ff0000;">&quot;git@git.overlays.gentoo.org:&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
    pushInsteadOf = gentoo:</pre></td></tr></table></div>

<p>And the git wrapper, which should be put in /usr/local/sbin/git:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>make.conf
<span style="color: #007800;">USER</span>=<span style="color: #ff0000;">&quot;tampakrap&quot;</span>
<span style="color: #007800;">GROUP</span>=<span style="color: #ff0000;">&quot;tampakrap&quot;</span>
<span style="color: #007800;">GIT</span>=<span style="color: #ff0000;">&quot;/usr/bin/git&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> == <span style="color: #ff0000;">'clone'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #666666; font-style: italic;"># KDE Repos</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$2</span> == <span style="color: #ff0000;">&quot;git://anongit.kde.org/&quot;</span><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$KDE_DEVELOPER</span> == <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">KDE_REPO</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s:git\://anongit.kde.org/::'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #007800;">$GIT</span> <span style="color: #ff0000;">&quot;$@&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> <span style="color: #007800;">$USER</span>:<span style="color: #007800;">$USER</span> <span style="color: #007800;">$DISTDIR</span><span style="color: #000000; font-weight: bold;">/</span>egit-src<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$KDE_REPO</span>
    <span style="color: #666666; font-style: italic;"># Gentoo Repos</span>
    <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$2</span> == <span style="color: #ff0000;">&quot;git://git.overlays.gentoo.org/&quot;</span><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$GENTOO_DEVELOPER</span> == <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">GENTOO_REPO</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s:git\://git.overlays.gentoo.org/::'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #007800;">$GIT</span> <span style="color: #ff0000;">&quot;$@&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> <span style="color: #007800;">$USER</span>:<span style="color: #007800;">$GROUP</span> <span style="color: #007800;">$DISTDIR</span><span style="color: #000000; font-weight: bold;">/</span>egit-src<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$GENTOO_REPO</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #007800;">$GIT</span> <span style="color: #ff0000;">&quot;$@&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span> 
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #800000;">${PWD%/*}</span> == <span style="color: #007800;">$DISTDIR</span><span style="color: #000000; font-weight: bold;">/</span>egit-src <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-s</span> <span style="color: #660033;">-q</span> gentoo .git<span style="color: #000000; font-weight: bold;">/</span>config <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-s</span> <span style="color: #660033;">-q</span> kde .git<span style="color: #000000; font-weight: bold;">/</span>config <span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-u</span> <span style="color: #007800;">$USER</span> <span style="color: #007800;">$GIT</span> <span style="color: #ff0000;">&quot;$@&quot;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #007800;">$GIT</span> <span style="color: #ff0000;">&quot;$@&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>The above script consists of two parts: if the git argument is clone,&nbsp;it checks if the URL is a KDE or Gentoo one and&nbsp;chowns the repo after cloning. If it is something else (eg pull), it checks again if the URL is a KDE or Gentoo one, and uses sudo -u $USER:$GROUP to preserve the permissions of the repo. The repos are still in the $DISTDIR/egit-src dir ($DISTDIR is usually /usr/portage/distfiles, but it can be changed in /etc/make.conf), so the following script creates symlinks of those somewhere in the homedir (put it in /usr/local/bin/create_repolinks):</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Headers</span>
<span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>make.conf
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions.sh
&nbsp;
<span style="color: #666666; font-style: italic;"># Variables</span>
<span style="color: #007800;">REPO_DIR</span>=<span style="color: #ff0000;">&quot;/home/tampakrap/Source_Code/&quot;</span> <span style="color: #666666; font-style: italic;"># Where to store the symlinks of the repos</span>
<span style="color: #007800;">GENTOO_REPO_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${REPO_DIR}</span>gentoo/&quot;</span>  <span style="color: #666666; font-style: italic;"># Gentoo repos</span>
<span style="color: #007800;">KDE_REPO_DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${REPO_DIR}</span>kde/&quot;</span> <span style="color: #666666; font-style: italic;"># KDE repos</span>
<span style="color: #007800;">OVERLAY_DIR</span>=<span style="color: #ff0000;">&quot;/var/lib/layman&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># No root</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> == <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	   eerror <span style="color: #ff0000;">'root is forbidden'</span>
	   <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Gentoo Overlays</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$OVERLAY_DIR</span>
<span style="color: #000000; font-weight: bold;">for</span> repo <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">*/`</span>
<span style="color: #000000; font-weight: bold;">do</span>
	   <span style="color: #7a0874; font-weight: bold;">pushd</span> <span style="color: #007800;">$repo</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
	   einfo <span style="color: #ff0000;">&quot;Checking <span style="color: #007800;">$repo</span> overlay&quot;</span>
	   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-z</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> git.overlays.gentoo.org .git<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		      <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s:git\://git.overlays.gentoo.org/:gentoo\::'</span> .git<span style="color: #000000; font-weight: bold;">/</span>config
		      ewarn <span style="color: #ff0000;">&quot;gentoo git url corrected for <span style="color: #007800;">$repo</span> overlay&quot;</span>
	   <span style="color: #000000; font-weight: bold;">fi</span>
	   <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-L</span> <span style="color: #800000;">${GENTOO_REPO_DIR}</span><span style="color: #800000;">${repo%/*}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>layman<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$repo</span> <span style="color: #800000;">${GENTOO_REPO_DIR}</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> ewarn <span style="color: #ff0000;">&quot;New symlink for <span style="color: #007800;">$repo</span> overlay&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
	   <span style="color: #7a0874; font-weight: bold;">popd</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># KDE Repositories</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$DISTDIR</span><span style="color: #000000; font-weight: bold;">/</span>egit-src
<span style="color: #000000; font-weight: bold;">for</span> repo <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">*/`</span>
<span style="color: #000000; font-weight: bold;">do</span>
	   <span style="color: #7a0874; font-weight: bold;">pushd</span> <span style="color: #007800;">$repo</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
	   einfo <span style="color: #ff0000;">&quot;Checking <span style="color: #007800;">$repo</span> repository&quot;</span>
	   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-z</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> anongit.kde.org .git<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		      <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s:git\://anongit.kde.org:kde\::'</span> .git<span style="color: #000000; font-weight: bold;">/</span>config
		      ewarn <span style="color: #ff0000;">&quot;kde git url corrected for <span style="color: #007800;">$repo</span>&quot;</span>
	   <span style="color: #000000; font-weight: bold;">fi</span>
	   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-z</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> kde: .git<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		      <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-L</span> <span style="color: #800000;">${KDE_REPO_DIR}</span><span style="color: #800000;">${repo%/*}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #800000;">${DISTDIR}</span><span style="color: #000000; font-weight: bold;">/</span>egit-src<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$repo</span> <span style="color: #800000;">${KDE_REPO_DIR}</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> ewarn <span style="color: #ff0000;">&quot;New symlink for <span style="color: #007800;">$repo</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
	   <span style="color: #000000; font-weight: bold;">fi</span>
	   <span style="color: #7a0874; font-weight: bold;">popd</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>Last but not least, we need the kde overlay, to get the live ebuilds:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">layman <span style="color: #660033;">-f</span> <span style="color: #660033;">-a</span> kde</pre></td></tr></table></div>

<p>For more information on this, take a look at the <a href="http://www.gentoo.org/proj/en/desktop/kde/kde4-guide.xml#live">Gentoo KDE Guide</a></p>
<p style="text-align: center;"><span class="Apple-style-span" style="font-size: x-large;"><b>Usage</b></span></p>
<p>With the above configuration, we can use:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">emerge <span style="color: #660033;">-av</span> =amarok-<span style="color: #000000;">9999</span>
create_repolinks</pre></td></tr></table></div>

<p>and get the amarok repository in our homedir, ready to patch it. As I said, in case we modified the code and tried to re-emerge the ebuild to get our patch in action, emerge will reset our repo to master again. Thus, we need to use the following variable:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">EVCS_OFFLINE</span>=<span style="color: #000000;">1</span> emerge <span style="color: #660033;">-av1</span> amarok</pre></td></tr></table></div>

<p>This will prevet the reset of the repo. In case we want to use a full live environment, we can even put that var in make.conf, but it is not recommended, better to use it in single emerge runs like the above.</p>
<p style="text-align: left;">That&#8217;s it. I plan to write a PyKDE UI for easy installation of the scripts, and maybe write a proper techbase article for it. Any feedback is appreciated.</p>
<p style="text-align: center;"><a href="https://desktopsummit.org"><img width="333" height="110" src="http://blogs.gentoo.org/tampakrap/files/2011/07/DS2011banner.png"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/kde-development-environment-in-gentoo/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Okupy &#8211; Report #5</title>
		<link>http://blogs.gentoo.org/tampakrap/okupy-report-5/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/okupy-report-5/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 07:32:53 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Planet KDE]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[okupy]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=684</guid>
		<description><![CDATA[Quick summary: I&#8217;m writing a CMS for the Gentoo website, that will offer an LDAP web interface, plus it will replace Gorg and provide Beacon as WYSIWYG editor to edit the XML file Two important things hapenned: 1) I passed &#8230; <a href="http://blogs.gentoo.org/tampakrap/okupy-report-5/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>Quick summary:</p>
<p>I&#8217;m writing a CMS for the Gentoo website, that will offer an LDAP web interface, plus it will replace Gorg and provide Beacon as WYSIWYG editor to edit the XML file</p>
<p>Two important things hapenned: 1) I passed the midterm (thanks to my mentor and everyone involved) 2) I graduated YEY!</p>
<p>I&#8217;ve left the LDAP bits behind for now (apart from bugfixing here and there). It is working fine, and supports:</p>
</p>
<ul>
<li>login (with any of user&#8217;s mail)</li>
<li>registration (the admin can specify which OU will be used for initial user creation) (for development purposes, it can even create top O and OU in an empty LDAP server)</li>
<li>map LDAP ACL to Django ACL</li>
<li>view some user&#8217;s data (in settings we can specify which attrs the user himself can see, and which ones privileged users can see)</li>
<li>edit own data (again, only specific attrs based on perms)</li>
<li>edit other user&#8217;s data (if the logged in user has the correct permissions for that)</li>
<li>An addressbook (list of users, separated in developers, exdevs, others (the lists are configurable))</li>
</ul>
<p>I&#8217;m still working on the UI, and started messing around with Beacon. It is a very interesting project, which is getting more love again, through a Fedora GSoC project (it even started as a GSoC project). It has two backends, a PHP and a Django one. I already talked to the upstream guys, they showed me their TODO list [1]. Some of those are needed for me as well, which is very nice, since my patches can go upstream directly. I was going to write a custom script to export the generated XML output, which is one of the things Beacon itself needs as well. Another important thing is to load external files in order to edit them. Finally, the git integration I was going to implement also sounded like a nice feature. Really glad to see that we are on the same road, my plan was to not fork the project but keep the changes there as possible. Matt, my mentor, was helping Beacon with the Django part since the beginning. I plan to work on those three features for the next week (weekend included).</p>
<p>Apart from the above, I&#8217;m working on our XSLT and Python&#8217;s decorators to create Django templates based on our XML files.</p>
<p>Okupy is deployed in the server, I need a final review from my mentor and will open it to some people for testing really soon (target: this weekend).</p>
<p>[1]&nbsp;<a href="http://tinyurl.com/3g4424o">http://tinyurl.com/3g4424o</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/okupy-report-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Okupy &#8211; Report #4</title>
		<link>http://blogs.gentoo.org/tampakrap/okupy-report-4/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/okupy-report-4/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 12:40:11 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[okupy]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=681</guid>
		<description><![CDATA[Quick summary: I&#8217;m writing a CMS for the Gentoo website, that will offer an LDAP web interface, plus it will replace Gorg and provide Beacon as WYSIWYG editor to edit the XML files. This is going to be small but &#8230; <a href="http://blogs.gentoo.org/tampakrap/okupy-report-4/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>Quick summary:</p>
<p>I&#8217;m writing a CMS for the Gentoo website, that will offer an LDAP web interface, plus it will replace Gorg and provide Beacon as WYSIWYG editor to edit the XML files.</p>
<p>This is going to be small but really important. Robin set up for me an LDAP instance in vulture for me, plus reviewed my cfengine patches for OpenLDAP, Django and the various depedencies, thanks a lot for this! I&#8217;m in the process of deploying the web application to the server, and will move development fully there. I plan to open it for a few people for more beta testing in the following week. There has also been some internal Infra discussion on whether to use multiple OUs (OU=users, OU=developers etc), without an agreement yet, but my code works either way. Also I need to expand our LDAP configs and add a few more groups there, like a user.group, and some other privileged groups like devrel, pr (currently we have only infra, recruiters and devrel I think).</p>
<p>As for the development of the app itself, the past days I&#8217;ve been doing various bugfixing in the LDAP frontend and playing around with the UI mostly. It is very configurable, the admin can choose which LDAP values to print, and in which form (eg human readable: username / first name / last name OR keep the LDAP names: uid / givenName / sn). The user can view his own attributes or someone else&#8217;s public attributes. A privileged user can see more attributes from other users, plus add/remove another user from some groups. There has been some ACL duplication here, but unfortunately there isn&#8217;t a better way to do it at the moment. Robin proposed another long term solution: if we move our LDAP configs to the new cn=Config style, the app then could parse that config and generate the ACL accordingly to Django settings. It can&#8217;t be done now though, since Infra needs to migrate LDAP to that style first, which I know it&#8217;s going to be painful (I&#8217;ve done it already for a uni server about a year ago). I&#8217;m working on the UI of the edit view now, which is a generated form by the user profile model. Although it works (user can edit his data successfully, admins (eg infra/recruiters in Gentoo case) can edit other users&#8217; data as well), there has been some pain in printin nice the multivalued attributes of LDAP. Currently, the multivalued attrs are transfered to a TextField in the DB, and the values are separated with :: for easy split-desplit. With the help of Matt I wrote a form widget, but it still needs to look prettier when the user wants to add or delete a new value.</p>
<p>Apart from the above, I&#8217;ve also started working in general on the UI, and the front page. Matt gave me some some CSS to plug in to my templates, but my overall goal would be to create an easy way to create new themes to the app, instead of having to touch the templates (should be easy in Django). The UI and the front page is what I&#8217;m going to do for the next few days, and then start working on the Beacon and XSLT/XML parts. Last but not least, I wrote an addressbook as a replacement to <a href="http://www.gentoo.org/proj/en/devrel/roll-call/userinfo.xml">userinfo.xml</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/okupy-report-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Okupy &#8211; Report #3</title>
		<link>http://blogs.gentoo.org/tampakrap/okupy-report-3/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/okupy-report-3/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 01:38:11 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[okupy]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=677</guid>
		<description><![CDATA[Quick summary: I&#8217;m writing a CMS for the Gentoo website, that will offer an LDAP web interface, plus it will replace Gorg and provide Beacon as WYSIWYG editor to edit the XML files. The past two weeks I&#8217;ve finished the &#8230; <a href="http://blogs.gentoo.org/tampakrap/okupy-report-3/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>Quick summary:</p>
<p>I&#8217;m writing a CMS for the Gentoo website, that will offer an LDAP web interface, plus it will replace Gorg and provide Beacon as WYSIWYG editor to edit the XML files.</p>
<div>The past two weeks I&#8217;ve finished the LDAP bits, plus I&#8217;ve added some more features mostly needed for development purposes. In the settings files, the administrator can provide a bunch of variables:
<ul>
<li>the OU(s) the users are stored (there is support for multiple OUs, for example to separate users from developers with ou=users and ou=developers, while keeping unique usernames)</li>
<li>the credentials for the anon user (minimal privileged user to perform LDAP queries in case the anonymous search is disabled, both cases are covered in the app)</li>
<li>credentials of the admin user (needed mostly for user creation), the objectClasses for new users, the base attribute to search for users (uid and cn are the most common)</li>
<li>a map with user profile attributes (Django has only username/password/email/real name in its base profile, it is easily extendable though by specifying a connection between user profile fields and LDAP attributes)</li>
<li>a map with LDAP and ACP groups (for example, is_infra, is_devrel etc, depending on the LDAP permissions the user is able to view or touch other user&#8217;s data)</li>
</ul>
</div>
<p>The login system had to change though. Robin wanted mail logins instead of username logins. This needed a lot of changes, since in LDAP mail is a multi-valued attribute, and in Django is single-valued field. I created an all_mails field in user profile instead, that has all the mails, but the user has to verify about them first. In initial registration, the user&#8217;s mail is stored in a DB table, along with a 30char string, and a mail is sent to the user which contains the same string in the form of a URL. The system checks if those two match, and if they do, it removes the entry from that table and moves the mail to the user&#8217;s LDAP mail attribute (and in the all_mails field in the DB, if applicable). The same procedure is followed when the user wants to add a new email to his account, for which he has to verify before getting it in the list. Afterwards, the user can log in with any of those emails he has verified. For password recovery, the user fills in the mail he wants to use for that session.</p>
<p>The user profile is extendable, if other people want to use the LDAP frontend. For now there is a GentooProfile class that extends the UserProfile class, that has gentoo-specific fields based on the LDAP attributes Gentoo uses, plus the custom gentoo LDAP schema.</p>
<p>User settings are available, under accounts/$USER subURL. The system checks if the URL maps to the user currently logged in, or another user in the LDAP server, then checks if the user is in the DB, migrates it if not, and shows the fields according to the logged in user&#8217;s permissions. Edit settings is also available and works with the same logic.</p>
<p>I&#8217;ve also added a lot of docstrings there, and started messing around with sphinx.</p>
<p>The logging system is improved as well. The errors are printed in console if the project is run with Django&#8217;s runserver for development purposes, and in /var/log/messages (which is configurable, it can go to a dedicated dir easily) for production use.</p>
<p>More tests were written, and the ebuild is almost complete. I&#8217;ve set up an instance in one of my home servers, which will run tests automatically and notify me for failures.</p>
<p>There is an addressbook available, as a replacement to userinfo.xml we currently have. I&#8217;m going to play around with genmap as well to replace the developer map.</p>
<p>Since the LDAP work is done, with only bugfixes and small improvements needed here and there, I&#8217;ve started working on the front page. It will follow the steps of the one we currently have. It will be a syndication-like page, combining the info from planet/blogs, news items written by PR team, new packages etc. I also started working on the lxml scripts to parse our XML documentation, and next week I&#8217;ll plug in the design done in www-redesign repo, and improve it as possible.</p>
<p>PS. The report was delayed, because I&#8217;ve been offline pretty frequent due to multiple reasons. I had my last exams, which went good and I probably graduated (finally!), I had to be on another city without internet for some days, and finally, the frequent power cut in Greece (as part of the general strikes, riots and frustration of the economic crysis here) not only kept me offline, but also destroyed one of my drives in my desktop, and one of my home servers completely. I learned from that though, I follow their website for future power cuts.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/okupy-report-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Okupy &#8211; Report #2</title>
		<link>http://blogs.gentoo.org/tampakrap/okupy-report-2/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/okupy-report-2/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 00:45:20 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[okupy]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=675</guid>
		<description><![CDATA[This comes with a dealy, as I&#8217;ve been sick the past days. The LDAP related code is 90% done. It now has the following features: &#160;Login to the system (report #1 explains in detail how login works). It previously was &#8230; <a href="http://blogs.gentoo.org/tampakrap/okupy-report-2/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>This comes with a dealy, as I&#8217;ve been sick the past days. The LDAP related code is 90% done. It now has the following features:</p>
<p>
<ul>
<li>&nbsp;Login to the system (report #1 explains in detail how login works). It previously was using only the basic info (real name, primary email), but now it is configurable to use more info, where the sysadmin is able to define in the config files. This was easy to do, by creating a second dictionary to map the django user profile fields with LDAP attributes.</li>
<li>Signup. For this, an admin LDAP account is needed to be put in the config file. The admin account, contrary to other backends, is used only to create new users. Other LDAP implementations use that admin account for everything though. So, now the user declares username/password, the anon account searches if the user already exists (both the username and the email have to be unique), and if not, it creates the account, using the same dictionary to map django DB fields with LDAP attributes.</li>
<li>User settings. There are some forms that allow the user to change his data. This is done by using his own account, and not by using the admin account to do that. A second password is being created for the session, since we didn&#8217;t want to cache the regular password. (again, report #1 has more info about it).</li>
<li>Map LDAP ACL to Django groups. For that, a special multivalued attribute is used, in gentoo it is called gentooAccess, which contains some *.group entries that specify the user&#8217;s special permissions. This gives the abillity to a special team to touch other users&#8217; data, eg infra. While the mapping is complete, the UI is not yet.</li>
</ul>
<p>Other things that I did:</p>
<p>
<ul>
<li>I set up the service in one of my home servers, so that Matt can test it too. The LDAP used there is very minimalistic.</li>
<li>I gave Robin some cfengine patches for both the webapp and the LDAP (which should be as much identical to the official as possible). They are not complete yet though. Once the webapp is up and running in vulture ( the soc.dev server) I&#8217;ll be able to test it in our official configuration.</li>
</ul>
<p>What I&#8217;m going to do during the weekend:</p>
<p>
<ul>
<li>Improve documentation (docstrings) and fire up sphinx</li>
<li>Improve logging system</li>
<li>I started writing some tests for the backend, I&#8217;m going to finish it, and plus write tests for all the above as well.</li>
<li>Create an ebuild to automate tests</li>
<li>Finish the &#8220;touch other users&#8217; data&#8221; UI</li>
</ul>
<p>After that, the LDAP system will be finished, and let the tests show me bugs. Next week I&#8217;ll start working on the website part, beginning with the LXML parsing of our docs.</p>
<p>Time to sleep, it is 0640 already here, I didn&#8217;t even realize the sun is up.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/okupy-report-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Okupy &#8211; Report #1</title>
		<link>http://blogs.gentoo.org/tampakrap/okupy-report-1/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blogs.gentoo.org/tampakrap/okupy-report-1/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 01:02:14 +0000</pubDate>
		<dc:creator>tampakrap</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Planet FOSS Greece]]></category>
		<category><![CDATA[Planet Gentoo]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[okupy]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://blogs.gentoo.org/tampakrap/?p=672</guid>
		<description><![CDATA[The past week I&#8217;ve been experimenting with LDAP mostly. I set up a clone of ldap1.gentoo.org (with fake data of course) at my home server, and gave a Cfengine patch to Robin, pending for review, in order to have the &#8230; <a href="http://blogs.gentoo.org/tampakrap/okupy-report-1/"><div class="nav-next">Continue reading</div></a>]]></description>
				<content:encoded><![CDATA[<p>The past week I&#8217;ve been experimenting with LDAP mostly. I set up a clone of ldap1.gentoo.org (with fake data of course) at my home server, and gave a Cfengine patch to Robin, pending for review, in order to have the testing LDAP service to vulture (the soc.dev box). I also set up my git repo, and split the settings.py file in many files, under a settings/ dir. This is how the transifex guys and my mentor Matt do it, and this approach allows us to put the config files even in /etc for example.</p>
<p>My major goal was to finish the LDAP backend part, either by using an existing library or writing it from scratch. Finally, after taking a look at many libraries and implementations, I wrote my own. More specifically, what the Django LDAP authentication backend does is to override the default Django DB authentication backend. When a user logs in, the backend checks if the user exists in the LDAP server. In order to do the search, the OpenLDAP server has to provide either an account to do that (an &#8220;anonymous&#8221; account with minimal privileges, just to do those kinds of ldap queries) or allow anonymous searches. In case the account is being used, it has to be declared in the settings file. I took it one step further from what the other backends did actually: in a common ldap configuration, all users are under OU=users or something. I intend to split it though to OU=users and OU=developers, thus I allowed the backend to search in multiple organizational units, by converting the variable to a python list. If the query sends a result (meaning the user is found), then it tries to bind with the credentials provided in the login form. If it suceeds, then the user data (apart from the password) are transfered to the django db, where they are going to be used for the rest of the session. Django actually has only email, real name and username in its accounts, but it gives the opportunity to extend those by creating a profile. That is technically an extra table in the db, with the ability to add custom fields, really handy.</p>
<p>The major problem that I&#8217;ve faced with all those ldap backends was that they all asked for an admin account, and they performed all changes with that account. That is acceptable for user creations but not for all the other cases. If a user wants to change his data, he should be able to do it with his regular account. Another problem emerged here though. OpenLDAP asks for the password before every action and one solution was to do it that way. Bcooksley had another idea though, to create a second 50char password, which will stay only for one session, and will be destroyed using itself at the end. I liked that idea very much, as asking the password is not too user friendly in my opinion, and the web frontend looses its purpose. For important changes though the password will be required (that includes uploading a new SSH/GPG key, or resetting the password).</p>
<p>The LDAP backend is now working, which is really cool, I didn&#8217;t expect it to be done so fast. My next step is to write some tests and documentation, for which I&#8217;ll use sphinx. Also, I plan to continue working on the ldap web frontend, by finishing the login/signup systems, and the user settings page, and then start messing with the UI.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gentoo.org/tampakrap/okupy-report-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
