I always forget to add an MIT-license.txt
file to my projects, so I wanted to link to a single resource that would always be up to date and would always have my details online.
Why keep this to myself, there are two ways to create your own MIT license page:
- Use the generator tool (easiest)
- Make a request to the API (details below)
- Fork this project and send a pull request
Now I can always include https://rem.mit-license.org in all my projects which links rem
(the CNAME) against my copyright holder name Remy Sharp
- all stored in the users
directory.
The simplest way to create your own MIT license page is to use the self-service generator found here.
You can fork this project, send me a pull request and wait for me to pull (which I'll do as quickly as possible) or if the user is still available you can do it yourself from the command line:
curl -d'{ "copyright": "Remy Sharp" }' https://rem.mit-license.org
If the rem
user isn't taken already, then this will create the new user file on the fly and the URL will be immediately available.
You can send a full JSON file to the API, not just the copyright, so this works too:
curl -d'{ "copyright": "Remy Sharp", "url": "https://remysharp.com", "email": "me@mysite.com", "format": "txt" }' https://rem.mit-license.org
Whilst the command above sends the data as a string which will later be parsed, you can explicitly specify a JSON Content-Type
:
curl -H 'Content-Type: application/json' -d'{ "copyright": "Remy Sharp", "url": "https://remysharp.com", "email": "me@mysite.com", "format": "txt" }' https://rem.mit-license.org
You can also encode the data as URL query parameters like so:
curl -X POST "https://rem.mit-license.org/?copyright=Remy%20Sharp&url=http%3A%2F%2Fremysharp.com&email=me%40mysite.com&format=txt"
If there are any problems in the automated creation, send me a pull request and it'll go live soon after.
Equally, if you need to update the user file to include more details that you didn't initially include (extra fields in the next section) you will need to send a pull request on that user.json
file via GitHub.
The users
directory contains a list of files, each representing a host on mit-license.org. The minimum requirement for the JSON is that it contains a copyright
field - everything else is optional. Remember to ensure the user.json
file is valid JSON.
Available fields:
- copyright (required)
- URL
- format
- gravatar
- theme
- license
Create a new file and give it the name of the CNAME you want (in my case it's rem.json
). This file contains a JSON object containing at least a copyright
property:
{
"copyright": "Remy Sharp, https://remysharp.com"
}
Means I can now link to https://rem.mit-license.org and it will show my license name (note that the date will always show the current year).
You can also use an array to hold multiple copyright holders:
{
"copyright": ["Remy Sharp", "Richie Bendall"]
}
Which will be formatted as:
Remy Sharp and Richie Bendall
If you additionally want to include a URL and email with each copyright holder, use objects in the array:
{
"copyright": [
{
"name": "Remy Sharp, https://remysharp.com",
"url": "https://remysharp.com",
"email": "remy@remysharp.com"
},
{
"name": "Richie Bendall, https://www.richie-bendall.ml",
"url": "https://www.richie-bendall.ml",
"email": "richiebendall@gmail.com"
}
]
}
In addition to the copyright
property, if you want to make a link from the copyright text, you can include a URL
property:
{
"copyright": "Remy Sharp, https://remysharp.com",
"url": "https://remysharp.com"
}
You can also include a link to your email which is displayed after the copyright notice using the email
property (note the mailto:
is automatically added):
{
"copyright": "Remy Sharp, https://remysharp.com",
"url": "https://remysharp.com",
"email": "me@mysite.com"
}
And if you want your license to appear as plain text, just add the format
property (currently only txt
and html
are supported):
{
"copyright": "Remy Sharp, https://remysharp.com",
"url": "https://remysharp.com",
"format": "txt"
}
And if you want to show your gravatar, just add the gravatar
boolean property:
{
"copyright": "Remy Sharp, https://remysharp.com",
"url": "https://remysharp.com",
"email": "me@mysite.com",
"gravatar": true
}
Note that the gravatar requires the email property. You also need to check the compatibility of the chosen theme. Currently, only the default theme supports Gravatar.
If you've got an eye for design (or like me: not): you can contribute a theme by adding a CSS file to the themes
directory. You can use the latest CSS technologies since they are automatically polyfilled. The default theme is simple and clean, but you can add your own as you like.
To use a theme, add the theme
property to your user.json
file, for example:
{
"copyright": "Remy Sharp, https://remysharp.com",
"url": "https://remysharp.com",
"theme": "flesch"
}
Current available themes:
- default - preview (by @remy, @raphaelbastide & @evertton)
- flesch - preview (by @flesch)
- eula-modern - preview (by @sauerlo)
- afterdark - preview (by @rmartindotco)
- orange - preview (by @kirbylover4000)
- plaintext - preview (by @barberboy)
- double-windsor - preview (by @desandro)
- cherry - preview (by @mustafa-x)
- white cherry - preview (by @mustafa-x)
- blackwood - preview (by @mustafa-x)
- hipster-gray - preview (by @noformnocontent)
- xtansia - preview (by @tomass1996)
- magic-mint - preview (by @ekhager)
- default-dark - preview (by @remy, @raphaelbastide & @evertton)
- black-beauty - preview (by @evertton)
- silver-style - preview (by @dev-dipesh)
- friendly - preview (by @evertton)
- opensans - preview (by @pburtchaell)
- solarized - preview (by @anmoljagetia)
- willpower - preview (by @willpowerart)
- rokkitt - preview (by @luizpicolo)
- mitserrat - preview (by @WouterJanson)
- material - preview (by @ahaasler). Available colours: blue gray (default), red, pink, purple, deep purple, indigo, blue, light blue, cyan, teal, green, light green, lime, yellow, amber, orange, deep orange, brown and grey. To use a specific colour, add it as a dash-separated suffix on the theme name, such as
material-deep-orange
. - hmt-blue - preview (by @J2TeaM)
- dusk - preview (by @georapbox)
- 8bits - preview (by @matricali). Available colours: monochrome, monochrome-white, monochrome-blue-white, monochrome-green, monochrome-amber. To use a specific colour, add it as a dash-separated suffix on the theme name, such as
8bits-monochrome
. - hacker - preview (by @TommyPujol06)
- anon-pro - preview (by @bbbrrriiiaaannn)
- richienb - preview (by @Richienb). Dark variant:
richienb-dark
- preview. - tryhtml - preview (by @abranhe)
The following types of requests can be made to this project:
- https://rem.mit-license.org/ HTML, or the default format specified in
the json file (currently none specified on
rem
) - https://rem.mit-license.org/license.html HTML
- https://rem.mit-license.org/license.txt Text
The URL also supports including a start year:
- https://rem.mit-license.org/2009/ will show a license year range of 2009-2016 (2016 being the current year)
- https://rem.mit-license.org/2009-2010 allows me to force the year range
- https://rem.mit-license.org/2009-2010/license.txt year range of 2009-2010 in plain text
You can also specify either the MIT
or ISC
license in the URL:
- https://rem.mit-license.org/+MIT will show the MIT License (default)
- https://rem.mit-license.org/+ISC shows the ISC license instead
Finally, the URL also supports pinning the year
- https://rem.mit-license.org/@2009 this is useful for when your software copyright should expire (as discussed here)
Aside from code contributions that make the project better, there are a few other specific ways that you can contribute to this project.
Development contributions from:
SSL and wildcard DNS is supported by CloudFlare - thank you 🙏💙
I host the domain with namecheap.com and yearly renewal is $9.69 per year. If you want to contribute a year, send me a message and I'll add the years on.
Of course, I'll do my best to continue running the domain and hosting, but this is your chance to contribute to the community project.
Domain contributions:
- remy - 2011-2012
- barberboy - 2012-2013
- paulirish - 2013-2014
- batuhanicoz - 2014-2015
- buritica - 2015-2016
- adamstrawson - 2016-2018 (2 years)
- keithamus - 2018-2026 (8 years)
- pmuellr - 2026-2027
- danielknell - 2027-2029 (2 years)
- barberboy - 2029-2030
- mostly-magic - 2030-2032
Please note that the whois says 2021 as you can only have 10 active registered years with ICANN - but the domain is set to auto-renew, so it's all good :)
For the first 5 years, mit-license.org was hosted on my own dedicated server, but I've now moved to Heroku and am paying a monthly fee. If you would like to donate please donate here include a message and I will add your name to the credit. Hosting currently costs $7 per month if you want to donate in months or years, it's gratefully received ❤
Hosting contributions:
- remy - 2011-2016 Apr...
- therebelrobot 1 month
- mkody 2 months
- dan9186 1 year
- Kristin Anthony 1 year
- zhengyi-yang 5 months
- catodd 2 months
- lrz0 1 month
- matricali 3 months
- youchenlee 12 months
- ramsey 12 months
- rmm5t 1 month
- wrainaud 3 months
- romkey 12 months
- kylewelsby 6 months
- wiesner 1 month
- rajinwonderland 3 months
- miszo 1 month
- you?
I'm a developer, I seem only capable of grey! If you're a designer and want to contribute a decent lick of paint on the project that would be super. Just create a new theme and send me a pull request.
And of course: