TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What license should I use in my open-source startup/product?

8 点作者 rafaqueque大约 10 年前
tl;dr<p>What license should I use for the codebase in order to protect it and still be open?<p>---<p>Hey guys,<p>I&#x27;m about to open-source my product in the summer and I want to build something great, with the help of the community, out of this and the main goal is to make the code available somewhere (it will end up in Github, 98% sure). I know that it might sound crazy, but I really want to give something back to the open-source community.<p>This has been proved to be a good strategy (Sentry rings a bell here, also Wordpress), I guess.<p>I&#x27;m trying to figure out what is the best license to my product&#x2F;codebase. Some guidance would be nice.<p>Thanks in advance.

6 条评论

informatimago大约 10 年前
Basically, the question you have to answer is whether you want to allow others (notably commercial corporations), to use your code to integrate into their own products without contributing back either to your code, or in general.<p>If you want that, then you can use licenses like MIT or BSD. (Notice how MIT and BSD are universities, where the people who worked on those software, initially, had alreay been paid, by the american tax payer, thru university salaries or DARPA grants; in this setting, it makes perfectly sense that the american tax payer be able to use the code he already paid for, and possibly to integrate it into proprietary commercial products).<p>On the other hand, if you want to ensure that people who use you code to make and distribute derived works provide their own contribution and share their own software too, then you will want to use a GPL license. (An intermediate license is the LGPL, better reserved for libraries that should compete with other libraries already under MIT or BSD). Notably, nowadays a lot of people build services accessible thru the network without distributing any software, but having it just run on their own servers. For this situation, the AGPL3 licence is indicated: if they use your code to make such a remote service, they will still have to distribute their modifications and sources, which will then allow users to verify that your code and their code is not used for nefarious purposes (like, forwarding private data to the NSA), notably allowing those users to run the server code on their own servers. (Cf. eg. opencloud vs. dropbox).<p>So my advice is to use the AGPL3 license by default, and only upon very special circumstances, release your code under another license.<p>For example, if such a commercial corporation wants pay you for a MIT license so they can use your code, as the right owner, you still can provide them with such; if they don&#x27;t then they can always hire you, unless most probably they just expected free work from you?<p>You will hear complains about the GPL and the AGPL, but only from selfish people or corporations.
评论 #9417618 未加载
giodamelio大约 10 年前
You should really check out <a href="http:&#x2F;&#x2F;choosealicense.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;choosealicense.com&#x2F;</a> (Made by the fine folks at Github), it gives a really good overview of the most popular licenses, with examples of notable projects that use them.
评论 #9417554 未加载
jtfairbank大约 10 年前
Checkout GitLab [1]. They have an open source model, you may also want to consider them for hosting your repo.<p>[1]: <a href="https:&#x2F;&#x2F;about.gitlab.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;about.gitlab.com&#x2F;</a>
LanceHaynie大约 10 年前
That kind of depends on how you want to approach your project... The MIT license is very open and let&#x27;s anyone do just about anything with it, of course they have to let people know where the code came from giving you due credit. The Apache license is similar, but throws in some verbiage about patents. GPL is probably the most restrictive in my view, it forces any forks of your code to also be listed under GPL.<p>Check this out for more info: <a href="http:&#x2F;&#x2F;opensource.org&#x2F;licenses&#x2F;" rel="nofollow">http:&#x2F;&#x2F;opensource.org&#x2F;licenses&#x2F;</a>
评论 #9411381 未加载
brudgers大约 10 年前
What do you mean by &quot;protect the code base&quot;?
yellowapple大约 10 年前
I personally use the MIT License (as defined by the OSI; in FSF terms, it would be the &quot;Expat&quot; license) as my default license for most things. My personal rule of thumb is that a software license should readably fit on a single screen whenever possible (I got sick of folks like Apple and Microsoft and their million-page EULAs), and most &quot;copyfree&quot; licenses, like the MIT&#x2F;Expat (and MIT&#x2F;X11), BSD, ISC, etc. licenses fit the bill rather perfectly.<p>I&#x27;ve tended to avoid copyleft licenses due to the potential complications caused by license incompatibility when trying to combine code with other code; since I&#x27;d prefer my code to be as useful to as many open-source projects as possible, I consequently prefer something as relaxed as possible.<p>My one exception (other than when required to make an exception by an employer or client, of course), however, is when I&#x27;m writing Perl code (particularly Perl code that&#x27;s meant to be reused, such as something on CPAN); in these cases, it&#x27;s standard convention to use either &quot;the same license as Perl itself&quot; (Artistic License &#x2F; GNU GPL dual-license) or the Artistic License 2.0 (or later), so I just stick to convention.<p>-----<p>Those are my needs, however. Everyone has different needs for a license.<p>If your priority is ensuring that your code doesn&#x27;t make its way into proprietary projects, the most surefire way to do this is with a &quot;copyleft&quot; license. The GNU General Public License (version 2 or later) is probably the most common such license. When I use the GNU GPL (aside from with Perl packages), I tend to use version 2 with an &quot;or any later version&quot; statement; version 3 includes anti-TiVOization language that - while useful if I&#x27;m an extremist - is a bit excessive for my tastes. Other options here include the GNU &quot;Lesser&quot; General Public License (basically the GPL, except that it allows non-free software to dynamically link against your software; useful for libraries, for example), the Mozilla Public License 2.0 (allows integration with differently-licensed software, so long as the MPL&#x27;d parts remain MPL&#x27;d), and the Artistic License 2.0 (derived works may be distributed either under the same license (to either everyone or just the original author, at the new author&#x27;s discretion) or under a different license but forbidden to use the original name or interfere with the installation of the original version); the MPL2.0 and AL2.0 are both compatible with the GPL (though the MPL has an optional &quot;Exhibit B&quot; that can disallow that compatibility), and are better classified as being &quot;partial&quot; copyleft licenses (in the sense that they aren&#x27;t as strict as even the LGPL).<p>If your priority is instead just to make sure you&#x27;re credited for your work, pretty much any non-public-domain-dedicating free software license will do in practice, though the BSD license is the most explicit about this in the copyfree camp (the 2-clause or 3-clause is recommended; the 4-clause is frowned upon). The ISC and MIT (of the Expat or X11 varieties) are also suitable here, though they&#x27;re not as explicit about attribution in binary distributions of derived works.<p>If you&#x27;re concerned about patents, the Apache License 2.0 and GNU General Public License version 3 provide some protections regarding patents that might be useful. The Apache License has some other nice features as well (trademark protection, proper attribution, non-copyleft, default contribution agreement, etc.).<p>It&#x27;s difficult to provide a more specific suggestion without clarification regarding what, exactly, about your code you intend to &quot;protect&quot;.
评论 #9417572 未加载