📜 Alin Li · peatükk 13

Avatud lähtekood Litsentsid
Explained for Humans

Litsentsid on jagamise reeglid. Need pole hirmutavad — need on sinu supervõime! Õpi, millist kasutada, mida need lubavad ja miks need tähtsad on.

What Are Licenses? 📖 Help Me Choose 🧭
📖 PÕHITÕED

Mis on tarkvaralitsents?

Think of it as the rules that come with sharing your creation.

🍰 The Cake Analogy

Imagine you bake an amazing cake and want to share the recipe. A license is like a little note you attach that says what others can do with it:

🔒
Litsents puudub

„Ma ei jaga retsepti. Saad süüa ainult kooki, mille sulle annan.“

📋
MIT litsents

„Siin on retsept! Tee, mida soovid — lihtsalt maini, et mina selle tegin.“

🔄
GPL License

„Siin on retsept! Kui seda muudad, PEAD ka oma versiooni jagama!“

🛡️
Apache License

„Siin on retsept! Kasuta seda vabalt ja ma luban, et ei kaeba sind kohtusse.“

⚠️ Why Licenses Matter

Without a license, your code is EI OLE avatud lähtekoodiga — even if it's on GitHub! By default, copyright law means "all rights reserved." A license is what officially gives people permission to use, modify, and share your work. No license = no one can legally use your code.

⚖️ THE BIG FIVE

Kõige olulisemad avatud lähtekoodi litsentsid

These 5 licenses cover 95% of all open-source projects.

📘

MIT litsents

The most popular license in the world — simple and free!

In plain English: „Tee minu koodiga, mida soovid. Jäta lihtsalt minu nimi alles. Ma ei vastuta, kui midagi katki läheb.“

The MIT License is the simplest and most permissive open-source license. It's just 170 words long! It lets anyone use, copy, modify, merge, publish, distribute, and even sell your code — as long as they include your original copyright notice.

✅ Use commercially
✅ Modify freely
✅ Distribute
✅ Use in closed-source projects
❌ No warranty
⚡ Must include license text
Who uses MIT?

React (Meta), VS Code (Microsoft), jQuery, Ruby on Rails, Node.js, Bootstrap, Electron, and thousands more. It's the #1 most popular license on GitHub!

// Kogu MIT-litsents on vaid see:
Copyright (c) [year] [your name]

Käesolevaga antakse tasuta luba igale isikule
obtaining a copy of this software... to deal in the Software
without restriction... subject to the following conditions:

The above copyright notice shall be included in all copies.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
📕

GPL (GNU General Public License)

The "share-alike" license — keep it free, forever!

In plain English: „Kasuta minu koodi vabalt. Aga kui seda muudad ja jagad, PEAD ka OMA koodi GPL-i alusel jagama. Keegi ei saa seda suletud lähtekoodiga tarkvaraks muuta.“

Created by Richard Stallman, the GPL is the "copyleft" license. Its key rule: if you use GPL code in your project and distribute it, your entire project must also be GPL. This ensures the code stays free forever — no company can take it, close it, and sell it.

✅ Use commercially
✅ Modify freely
✅ Distribute
❌ Can NOT make it closed-source
⚡ Must share your changes under GPL
⚡ Must include source code
Who uses GPL?

Linuxi tuum, WordPress, GIMP, Blender, GCC, Bash ja paljud vaba tarkvara põhiprojektid. Kui see kuulub GNU projekti, on litsents GPL!

⚠️ The "viral" effect: If you use GPL code in your app, your WHOLE app must become GPL. This is why some companies avoid GPL — they don't want to open their code. But this is exactly what GPL was designed to do: keep software free forever.

📗

Apache License 2.0

Nagu MIT, kuid sisseehitatud patendikaitsega!

In plain English: „Kasuta minu koodi vabalt, ka kommertstoodetes. Lisaks luban, et ei kaeba sind kohtusse selles koodis sisalduvate patentide pärast. Kui keegi seda muudab, peab ta muudatused ära märkima.“

Apache 2.0 is similar to MIT but adds two important things: patent protection (autor annab sulle litsentsi koodis sisalduvate patentide kasutamiseks) ning change documentation (muudetud failides tuleb märkida, et neid on muudetud).

✅ Use commercially
✅ Modify freely
✅ Use in closed-source
✅ Patent protection
⚡ Must include license + NOTICE file
⚡ Must note changes to files
Who uses Apache 2.0?

Android (Google), Kubernetes, TensorFlow, Swift (Apple), Apache HTTP Server, Kafka, Hadoop. Suurettevõtted eelistavad seda patendiklausli tõttu!

📘

BSD License (2-clause & 3-clause)

The original academic freedom license

In plain English: „Tee, mida soovid. Säilita minu autoriõiguse märge. Ära kasuta minu nime oma versiooni reklaamimiseks.“ Väga sarnane MIT-ga, kuid pärineb akadeemilisest maailmast (Berkeley).

BSD came from the University of California, Berkeley. The 2-clause version is almost identical to MIT. The 3-clause adds a "no endorsement" rule: you can't say "Berkeley approves this" unless they actually do.

✅ Use commercially
✅ Modify freely
✅ Use in closed-source
⚡ Keep copyright notice
⚡ No endorsement (3-clause)
Who uses BSD?

FreeBSD, OpenBSD, NetBSD operating systems, Nginx, PostgreSQL (similar), and many university research projects. macOS and PlayStation OS are based on BSD!

📙

Creative Commons (CC)

Mitte koodile — kõigele muule! Kunst, muusika, kirjutamine, õpetamine.

In plain English: „Creative Commons on mõeldud sisule, mis pole kood: pildid, muusika, videod, dokumendid ja õppematerjalid. Valid reeglid lihtsate ehitusplokkide abil!“

CC licenses use a mix-and-match system with 4 building blocks:

👤
BY (Attribution)
Autorile tuleb viidata
🔄
SA (Share-Alike)
Same license for remixes
🚫
NC (mitteäriline)
Raha teenimine keelatud
🔒
ND (tuletatud teosteta)
Muudatused pole lubatud

The most open CC license is CC0 (üldkasutatav — piiranguteta!) ja CC BY (piisab autorile viitamisest). Vikipeedia kasutab CC BY-SA.

Who uses CC?

Wikipedia (CC BY-SA), Khan Academy, Flickr photos, MIT OpenCourseWare, many YouTube creators, and this Alin Li course! CC is the standard for open educational resources.

📊 KÕRVUTI

Litsentside võrdlustabel

See all licenses at a glance!

Feature MIT GPL v3 Apache 2.0 BSD
Commercial use✅ Yes✅ Yes✅ Yes✅ Yes
Muuda ja levita✅ Yes✅ Yes✅ Yes✅ Yes
Use in closed-source✅ Yes❌ No!✅ Yes✅ Yes
Muudatused tuleb jagada❌ No⚠️ YES!❌ No❌ No
Patendikaitse❌ No✅ Yes✅ Yes❌ No
Keep copyright notice✅ Yes✅ Yes✅ Yes✅ Yes
Muudatuste märkimine❌ No✅ Yes✅ Yes❌ No
ComplexitySimpleComplexKeskmineSimple
Pikkus~170 words~5,600 words~4,200 words~200 words
Best for...Maksimaalne vabadusKeeping code free foreverEnterprise + patentsAkadeemilised projektid
🧭 INTERAKTIIVNE

Millist litsentsi peaksid SINA kasutama?

Answer 3 questions and we'll recommend the perfect license!

🧭 Litsentsivalija

1️⃣ Kas ettevõtted võivad kasutada sinu koodi suletud lähtekoodiga (omanduslikes) toodetes?
2️⃣ Kas soovid patendikaitset?
3️⃣ Kui lihtsat litsentsi soovid?
🛠️ JUHEND

Kuidas lisada oma projektile litsents

It takes literally 2 minutes!

1

Go to choosealicense.com

GitHub's tool makes it easy to pick the right license with a comparison.

2

Create a LICENSE file

In the root of your project, create a file named LICENSE või LICENSE.md

3

Kleebi litsentsi tekst

Copy the full license text and replace [year] and [author] with your information.

4

Done! You're open source! 🎉

GitHub will automatically detect your license and show a badge on your repo. On GitHub, you can even add a license when creating a new repo — just select it from the dropdown!

🧠 PANE END PROOVILE

Litsentsitest!

Vaatame, kas said litsentsidest aru!

1. Kui GitHubi koodil POLE litsentsi, kas tohid seda kasutada?

2. Milline litsents nõuab muudatuste jagamist sama litsentsi alusel?

3. Milline litsents annab patendikaitse?

4. Mida tähendab „copyleft“?

5. Which license is best for a school project you want everyone to use freely?

6. Creative Commons licenses are best for...