Git Product home page Git Product logo

mit-license's Introduction

A permalink for your MIT License

I always forget to add a LICENSE 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 three ways to create your own MIT license page:

  1. Use the generator tool (easiest)
  2. Make a request to the API (details below)
  3. 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.

Requesting your own MIT license page

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": "[email protected]", "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": "[email protected]", "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 user.json file

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
  • email
  • format
  • gravatar
  • theme
  • license

copyright

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": "[email protected]"
    },
    {
      "name": "Richie Bendall, https://www.richie-bendall.ml",
      "url": "https://www.richie-bendall.ml",
      "email": "[email protected]"
    }
  ]
}

url

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"
}

email

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": "[email protected]"
}

format

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"
}

gravatar

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": "[email protected]",
  "gravatar": true
}

Note that the gravatar option requires the email property. You also need to check the compatibility of the chosen theme.

Themes

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"
}

Browse custom themes

Formats & URLs

The following types of requests can be made to this project:

The URL also supports including a start year:

You can also specify either the MIT or ISC license in the URL:

Finally, the URL also supports pinning the year

Ways to contribute

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 🙏💙

1. Donate domain years

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:

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 :)

2. Hosting

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:

3. A lick of paint

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.

License

And of course:

MIT: https://rem.mit-license.org

mit-license's People

Contributors

39e avatar arhayati avatar axorax avatar benniemosher avatar dehnavi avatar dev-dipesh avatar evertton avatar flesch avatar hubdotcom avatar ipiyushsonar avatar jaswinder-singh avatar kirb avatar kolobus avatar krinkle avatar legitzenith avatar mathiasbynens avatar matricali avatar mustafa-x avatar pborreli avatar ptango avatar pthangeda avatar raphaelbastide avatar remy avatar revi avatar richienb avatar robertlucian avatar saisrivathsa avatar seyedi avatar sinky avatar squanto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mit-license's Issues

New user added. But licence doesn't include user's name and url

My user with CNAME ramanan was added and licence page is now retrieving properly. However there is a small problem - Licence header doesn't include my name and url.

Is there something I'm missing or is it pending some configuration at your end?

Thanks!

Multiple license-holders?

I've got a forked project. Tehcnically I can't say that the sole licensor of the project is the original creator, as several people have made large contributions. Any chance of allowing an array to be passed, instead of just a single licensor?

Plain text format

It would be nice to have a plain text version.

The URL could be something like that:

http://rem.mit-license.org/ # HTML, or the default format specified in the json file
http://rem.mit-license.org/license.html # HTML
http://rem.mit-license.org/license.txt # Text
http://rem.mit-license.org/a526bf7ad1 # a526bf7ad1 version, HTML, or the default format specified in the json file
http://rem.mit-license.org/a526bf7ad1/license.html # a526bf7ad1 version, HTML
http://rem.mit-license.org/a526bf7ad1/license.txt # a526bf7ad1 version, text

Gravatar needs an alt attribute

According to Google Lighthouse, the gravatar image needs an alt attribute which should be easily added via the name key in the JSON file.

Send txt license with trailing newline

This results in a file that has no trailing newline:

curl http://th.mit-license.org/license.txt > LICENSE

Editing the file in vim (or many other *nix-y editors) will then add a trailing newline.

I think a newline should be sent at the end of the response body.

Incorrect display when eula-modern theme is applied to final license

Hey hey!

Thanks for doing this! I am 'ddd'. I've an display problem I don't understand, so I'm opening an issue. I'm adding a marked up image of what I'm seeing.

As the in-pic note says, this happens regardless of browser employed, and only after my users/ddd.json is applied. The preview of the elua-modern theme displays correctly.

ddd-mit-license

Any ideas on the issue? I can use the developer tools to add additional information if required.

Curl add user failing with 'JSON requires "copyright" property and value'

curl -d '{"copyright":"myname"}' http://name.mit-license.org
This seems to be a permanent failure on my machine (see version bellow)

I'm guessing this is the problem
property_exists($data, 'copyright')

I'm wondering why you're checking the object rather than the array with isset() ?
Something like this:

$data = json_decode(file_get_contents('php://input'),true);
if (!isset($data['copyright']) {
Throw new Exception('>>> JSON requires "copyright" property and value');
}

Thank you

--Version information

curl 7.20.0 (i386-pc-win32) libcurl/7.20.0 OpenSSL/0.9.8o zlib/1.2.3
Protocols: dict file ftp ftps http https imap imaps ldap pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS Largefile NTLM SSL libz

Create via Windows Powershell

Does anyone know how to do this:
curl -d'{ "copyright": "Remy Sharp" }' http://rem.mit-license.org
from a Windows Powershell?

Creation of article & footer via javascript, is it needed here ?

<script>document.createElement('article');document.createElement('footer');</script>

is the creation of article and footer needed via JS here. This seemed to me as unnecessary hence reported.

<script>document.createElement('article');document.createElement('footer');</script>

The created article and footer are nowhere used in the page because as such there is no reference to these. Hence wondering if they actually serve a real purpose.

@remy ??

Return markdown version (license.md)

It would be nice if it would be possible to return /license.md. That way, I could simply curl the url and save license.md in all my projects easily.

Google Analytics

Hi @remy,

First of all, thanks for this initiative. I've been using it for many years and have adopted it in various projects and often recommend it.

It took me by surprise the other day when looking at GA's tracking net for one of my browsing sessions, to see it also included mit-license.org.

Perhaps you're an active user of the GA metrics and I suppose I have no ask in that case, but if they're not critical, perhaps you'd be willing to reconsider its use for mit-license.org, in favour of something simpler, e.g. server-side based, or image-based.

Alternatively, perhaps it could be limited to the landing page of the base domain only, and/or specific subdomains only.

Is this legal / morally ok?

First of all, cool project this! So please don't see this is as negative criticism...

In your readme you state that

note that the date will always show the current year

This is actually pretty common practice but I've always frowned upon it.
Copyright is not unlimited. It expires. This is why copyright notices contain a year. It allows us to know when the copyright has expired (and resolve matters of prior art etc). By always setting it to the current year we are basically extending it infinitely...

The copyright notice does not in itself hold much legal value afaik, so just putting the current year in it is probably not illegal, but it is definitely wrong technically and I wonder about it's moral implications...
It's also a bit weird that all works by a person licensed under the MIT license would have the same copyright year. The license does not change, but the copyright notice should. It should be different for each created work.

The right thing to do would probably be to allow for the copyright notice details to be passed along in the URL itself, so they could be changed for each project:

http://rem.mit-license.org?year=2014

Of course you could always fall back to the current year if no year was passed in the URL. Or better yet, use the year the cname was created. That will also stimulate people to pass the URL argument to 'update' the copyright when they make changes later.

What do you think?

user was created but not existing now.

Hi,
I sent pull request bitmxittz.json and user was created but bitmxittz.mit-license.org did not show copyright info.
I sent pull request as following
curl -d'{ "copyright": "Bitmxittz Developers", "url": "https://bitmxittz.com", "email": "[email protected]", "theme": "flesch", "gravatar": true }' https://bitmxittz.mit-license.org

then i commited changes to
{ "copyright": "Bitmxittz Developers", "url": "https://bitmxittz.com", "email": "[email protected]", "theme": "flesch", "gravatar": true }

still didn't work. so deleted bitmxittz.json and sent another request new pull request shows "All checks have passed" but user is not found in https://github.com/remy/mit-license/tree/master/users

Thank in advance for assistance in getting own mit-license page bitmxittz.mit-license.org with copyright info.

Thanks.

Upgrade tracking to GA Universal?

I noticed the core LICENSE.html uses the old ga.js - this will eventually be deprecated and should be upgraded to Universal Analytics - see here for instructions https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

Also, since this loads asynchronously, it's recommended by Google to put it just before the closing to ensure a higher percentage of visitors are tracked. This does not block page rendering and thus has no impact on performance.

License array is now Not valid metadata

According to NPM, the following expressions are no longer supported in the package.json:

// Not valid metadata
{ "license" :
  { "type" : "ISC"
  , "url" : "http://opensource.org/licenses/ISC"
  }
}

// Not valid metadata
{ "licenses" :
  [
    { "type": "MIT"
    , "url": "http://www.opensource.org/licenses/mit-license.php"
    }
  , { "type": "Apache-2.0"
    , "url": "http://opensource.org/licenses/apache2.0.php"
    }
  ]
}

Any idea how to point the license filed to a valid URL recognised by NPM?

They suggest to use this syntax instead:

If you are using a license that hasn't been assigned an SPDX identifier, or if you are using a custom license, use a string value like this one:

{ "license" : "SEE LICENSE IN <filename>" }

Then include a file named at the top level of the package.

But, I think this require a LICENSE file in the same folder. Any idea how to point that to an URL in order to conue using this mit-license service?

Interest in migrating to AWS Lambda?

This project is a great concept. I'm curious if you can cut costs significantly by porting the project to Python or NodeJS and hosting it on AWS using API Gateway and Lambda. It would largely depend on request rates.

If there's interest I can certainly lay some groundwork and see if I can build a proof of concept.

Question: MIT License conditions

Hi, if I forked a repository(under MIT License), and close the source code, I need to provide the link/source of original repository MIT License owner right?

However, if I also modify the source code, should I put my copyright & mit license notice in my forked repository?

Example:

Original repository owner license

The MIT License (MIT)

Copyright (c) 2016 Mr Owner

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

and I modified the code in my forked/cloned repository, for my own use/publishing, and here is the license I think to use -

The MIT License (MIT)

Copyright (c) 2016 Mr Owner
Copyright (c) 2016 dvrein


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note: I changed the copyright section.

So is the second license acceptable?

or should I need to provide my new MIT License separated along with the original owner MIT License or just the original owner license (no mine).

EDIT: So I found my question is related to sublicensing under the same MIT License. However, I still don't know if I can add an additional copyright notice under the same license file, under the Mr Owner part?

Thanks.

ISC anyone?

Hi All,

Since it appears that the ISC license is starting to get pushed as a replacement for the MIT, would you ever consider adding the ISC to this project, or allowing a fork of it?

I'm not sure that it would be called, but thelicense.org, and thelicen.se are both available.

Thoughts?

support for years in copyright statement

Seems like it might be nice to support a way to inject a "year string" in the generated copyright file. The standards here are pretty ... non-standard, but I've certainly seen things like the following:

2011
2009-2011
2009,2011
2009,2010,2011
2008,2010-2011

ad nausem

I've always thought either a single year or a single range would be enough - the comma'd versions don't make too much logical sense to me.

Some examples of how you might use this:

part of the URL path:

http://rem.mit-license.org/2009-2011/license.txt
http://rem.mit-license.org/2009/license.txt

query string:

http://rem.mit-license.org/license.txt?2009-2011
http://rem.mit-license.org/license.txt?2009

or

http://rem.mit-license.org/license.txt?years=2009-2011
http://rem.mit-license.org/license.txt?years=2009

The query string versions look rather hideous. I like the in-path version. Perhaps this could be supported by looking at every path segment, see if it matches a "year string" regex, and if it does, the pull that out as the year string.

GitHub pages as hosting

It might be late to change things now but it'd be great to have it hosted on GitHub. For free. With an automated generation.

Here's how it could work:

  • URLs would be https://mit-license.org/username
  • Usernames can only be added via PR
  • PR would be a single file, Jekyll would take care of template generation
  • A bot on Travis would verify the PR and automatically pull it or reject it

Advantages:

  • Free hosting
  • No risk of downtime (i.e. no need to mess with it, ever)
  • Zero human interaction 🎉

Disadvantages:

  • No automatic 2009-2010 year creation unless you also have a bot that is notified on 404 and creates the page for the next visit. Alternatively it's just a one-line PR away. Or it can be added via JS on the client.
  • No curl, but maybe a new command could be crafted to do it from cli

Notes for the change:

  • You'll probably need to setup redirects from the existing URLs to the new URLs, but this might be easy if your registrar offers redirects directly
  • License versioning should just be updated to specific numbers rather than commits, to simplify automated page creation. /v1 instead of /a526bf7ad1

License not live!!

I made the the json file called "mayankjha.json" and also created a pull request that was merged but the license dosen't to be live yet why?
am I missing something?
image

Are folks okay with the "fork ribbon"?

It's clearer that way that this is something a new user can own themselves.

On the other hand it's a little ugly.

That said, I could go the tumblr route, and allow people to opt-out in their json files.

Thoughts?

HTTP status codes in the API

In the API we create user files, I think API should also return HTTP codes like 200 OK, 403 forbidden etc.

I was gonna add this and send a PR but I'm not sure which HTTP status codes to return.

Any ideas?

Updating user details

After setting up a user, is it possible to update the details without issuing a pull request? Say, for example through a curl request. Of course, this would request some kind of authentication. Love to hear if this is possible or such a thing is planned.

https anyone?

Is there any point to add https (SSL) support to mit-license.org (and *.mit-license.org) for allowing https://username.mit-license.org? I probably can try to donate a certificate.

What's more important - does current hosting support SSL at all?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.