Git Based License Server

Git Based License Server

Web Applications / license-server

I usually forget to include anything in LICENSE.md files and after a quick Goolge I found this script on GitHub by remy to host your license details online. I do not tend to use the MIT license myself so I needed to enhance the code a little bit to suite my needs. This is my version of his code. Bellow is the project README file, and under that you can download the project for your self.

Now I can always include http://stuart.nx15.at in all my projects which links stuart (the cname) against my copyright holder name Stuart McCulloch Anderson - all stored in the users directory.

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 is contains a copyright field - everything else is optional. Remember to ensure the user.json file is valid JSON.

Available fields

yournameurlcompanycompanyurlthemeformatemailgravatarpgpkeypgpidpgpurlboilerplateoslicense

yourname

Add your name. This can be your full name, part of it or just the nickname you prefer

{
  "yourname": "Stuart McCulloch Anderson"
}

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

{
  "email": "youremail@example.com"
}

url

If you want to make a link from the copyright text, you can include a url property:

{
  "url": "http://nx15.at"
}

gravatar

And if you want to show your gravatar, just add the gravatar boolean property:

{
  "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.

pgpkey

You can add a link to your PGP/GPG key if you use one here:

{
  "pgpkey": "FULL KEY HASH"
  "pgpid": "PARTAL KEY HASH"
  "pgpurl": "URL TO KEY FILE"
}

company

If you work in a company or other organisation which shares the copyright with you, you can include if the company field:

{
  "company": "NxFifteen Research"
}

companyurl

You can also use a seperate URL for your company than for you:

{
  "companyurl": "http://nxfifteen.me.uk"
}

theme

Themes are CSS files. The default is in the same style as NxFifteen.me.uk but you can change the CSS or add a new file. Each user has control over the theme displayed here:

{
  "theme": "default"
}

format

And if you want your license to appear as plain text or markdown, just add the format property (currently only txt, md and html are supported):

{
  "format": "html"
}

boilerplate

It is often it is adventagious to add some additional text to the lience blurb. You can do that here:

{
  "boilerplate": "Text that will appear under the license"
}

oslicense

The default license is the FreeBSD license, but a user has control over changing their default here. The license must exsist in the license folder, else it will revert to FreeBSD:

{
  "oslicense": "default"
}

License version targeting

License version targeting allows you to link your license to a specific revision in this project - therefore fixing it permanently to a specific license text.

Though I don’t expect the license text to change ever, this is just some extra assurance for you.

Targeting requires the sha from the license commit. This can be specified on the URL (in your permalink) or in the JSON file.

For example: http://stuart.nx15.at/401a52e0b (make sure to view-source) shows an older version of the LICENSE.html file (compared to the latest version - the older version didn’t have the new themes).

This can also be targeted in my JSON file:

{
  "version": "401a52e0b"
}

Note that if no version is supplied, the latest copy of the LICENSE.html will be displayed with your information included.

Themes

If you’ve got an eye for design you can contribute a theme by adding a CSS file to the themes directory. 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:

{
  "theme": "default"
}

Current available themes:

Formats & URLs

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

You can select the license to use as well. This must be the same as the file name inside the licenses folder

You can also select a specific commit file version to display, you just need the sha from the license commit

The url also supports including a start year:

Now that you see the formula you can combine all these eliments together to build a very specific license file:

Ways to contribute

If you can help make the software better then please let me know, or just check out the Git repository for your self then just send me a patch file - currently my Git central repository doesn’t offer user registrations, but I will do it manually if you feel you would benefit from it.

Development contributions from:

Development contributions to mit-license (at the time it was forked) from:

License

And of course:

The MIT License (MIT): http://stuart.nx15.at/8504faf/mit/2014/license.html


© 2020. Some rights reserved. The contents of this site is released under a Creative Commons Attribution-Share Alike license.