<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Michael Jay Lissner</title><link href="https://michaeljaylissner.com/" rel="alternate"></link><link href="https://michaeljaylissner.com/feeds/tag/hook" rel="self"></link><id>https://michaeljaylissner.com/</id><updated>2010-01-15T10:27:18-08:00</updated><entry><title>How to Protect Your Open Source Code from Theft and a Mercurial Hook to Help</title><link href="https://michaeljaylissner.com/posts/2010/01/15/how-to-protect-your-open-source-code-from-theft-and-a-mercurial-hook-to-help/" rel="alternate"></link><updated>2010-01-15T10:27:18-08:00</updated><author><name>Mike Lissner</name></author><id>tag:michaeljaylissner.com,2010-01-15:posts/2010/01/15/how-to-protect-your-open-source-code-from-theft-and-a-mercurial-hook-to-help/</id><summary type="html">&lt;p&gt;&lt;strong&gt;Updated, 2010-01-24:&lt;/strong&gt; Some edits regarding the Affero license (thanks to
Brian at &lt;a href="http://cyberlawcases.com/"&gt;http://cyberlawcases.com&lt;/a&gt; for the&amp;nbsp;corrections).&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve finally begun doing some of the actual coding for &lt;a href="http://www.ischool.berkeley.edu/programs/masters/projects/2010/judicialnlp"&gt;my final 
project&lt;/a&gt; so the time has come to set up &lt;a href="https://github.com/freelawproject/courtlistener"&gt;a mercurial repository&lt;/a&gt; to 
hold the&amp;nbsp;code.&lt;/p&gt;
&lt;p&gt;Once we complete our project, we will have built a free product that 
competes with some of the core functionality of both LexisNexis and 
Westlaw, so something we wanted to do was make sure they couldn&amp;#8217;t steal our
code, enhance their product and thus moot&amp;nbsp;ours.&lt;/p&gt;
&lt;p&gt;To achieve this, we&amp;#8217;re using the &lt;a href="http://www.gnu.org/licenses/agpl.html"&gt;&lt;span class="caps"&gt;GNU&lt;/span&gt; Affero General Public License 
v3&lt;/a&gt;, which allows people to take our code for free, but requires that they 
publicly share any modifications that they make to the code. The normal &lt;span class="caps"&gt;GNU&lt;/span&gt; 
General Public License allows the code to be used at no cost, 
but only requires that changes to the code be shared with the public if one
distributes the changed version to the public. With a server-based 
project, like ours, one could operate modified versions of the code 
without ever having a need to distribute any of the software to the public. 
This loophole is closed by the Affero&amp;nbsp;license.&lt;/p&gt;
&lt;p&gt;In order to license our work, we must be its copyright holder. This is easy
enough, since we get copyright instantly in the U.S., but, 
as has been demonstrated in &lt;a href="http://en.wikipedia.org/wiki/Jacobsen_v._Katzer"&gt;Jacobsen v. Katzer&lt;/a&gt;, in order to seek remedies 
for copyright violations, we would have to register everything we made with 
the copyright office. This &lt;a href="http://www.copyright.gov/docs/fees.html"&gt;costs $35&lt;/a&gt; per registration, 
and with open source software, it&amp;#8217;s not clear whether each and every 
version needs to be registered or just major releases, or&amp;nbsp;what. &lt;/p&gt;
&lt;p&gt;Since this is too onerous to be practical, an additional approach to 
protecting our works is useful, and in the &lt;span class="caps"&gt;DMCA&lt;/span&gt; (&lt;a href="http://www.copyright.gov/title17/92chap5.html#506"&gt;17 &lt;span class="caps"&gt;U.S.C.&lt;/span&gt;§ 506(d)&lt;/a&gt;), 
remedies are provided for the &amp;#8220;fraudulent removal of copyright notice.&amp;#8221; 
Although these do not (in any way) match the protections provided by normal
copyright registration, they are a useful place to begin. Thus, 
if we place a copyright notice into each file of our code, 
those using our code must either risk violating the &lt;span class="caps"&gt;DMCA&lt;/span&gt; by removing these
notices, or leave our copyright information intact. (Placing such notices
in each file is also &lt;a href="http://www.fsf.org/licensing/licenses/gpl-howto.html"&gt;the recommendation&lt;/a&gt; of the Free Software&amp;nbsp;Foundation.)&lt;/p&gt;
&lt;p&gt;To place our information into each and every file of code that we upload 
publicly, I wrote &lt;a href="https://michaeljaylissner.com/archive/checklicense.py"&gt;a short mercurial hook&lt;/a&gt; that  adds copyright and 
licensing information it to the top of every file that is modified or added 
to the repository. To use the script, simply make it executable, 
place it in the .hg directory of your project, and add the following lines
to&amp;nbsp;.hg/hgrc:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;[hooks]
pretxncommit = .hg/checklicense.py
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;A couple of things I should note about this script is that it currently 
only checks for java and python files, and that it requires files called 
java_license.txt and python_license.txt to be in the root of your 
repository. It should be fairly easy to modify though to fit your own&amp;nbsp;needs.&lt;/p&gt;</summary><category term="mercurial"></category><category term="hook"></category><category term="Final Project"></category><category term="DMCA"></category><category term="copyright"></category><category term="Affero GPLv3"></category><category term="CourtListener"></category></entry></feed>