Skip to content

Commit

Permalink
Change license to the Mozilla Public License, version 2.0
Browse files Browse the repository at this point in the history
Why am I relicensing to MPL v2? I have a range of improvements that I'll be making to
the library for use in a project I'm working on. I think it's fair that people be able to use
these improvements in their applications, even for commercial applications, and that any
improvements they make are shared back so everyone else can make use of them.

The MPL v2 allows for static linking, something that is typically done for embedded applications,
while also ensuring that the source code must be disclosed when the binary
is distributed.
  • Loading branch information
chmorgan committed Sep 14, 2017
1 parent af17e51 commit f031a46
Show file tree
Hide file tree
Showing 20 changed files with 448 additions and 74 deletions.
362 changes: 362 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,17 @@ This will result in a page stating *Welcome, John Doe, to the ESP8266/ESP32 webs
## Websocket functionality
ToDo: document this
# Licensing
libesphttpd is licensed under the MPLv2. It was originally licensed under a 'Beer-ware' license by Jeroen Domburg
but was re-licensed with the blessing of most of the projects contributors.
The topic of licenses can be controversial. The original license was more free in that it allowed users to use the code
in any way, including relicensing it to any license they chose. The MPLv2 restricts freedom in that it requires
modifications to be given back to the community. This license establishes the agreement that in exchange for using
this great library that users are required to give back their changes to let others benefit.
While the 'Beer-ware' license text was removed to avoid license confusion the authors of this great library,
especially Jeroen, deserve a beer. If you appreciate the library and you meet them in person some day please consider
buying them a beer to say thanks!
13 changes: 4 additions & 9 deletions core/auth.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
HTTP auth implementation. Only does basic authentication for now.
*/

/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <[email protected]> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/


#include <libesphttpd/esp8266.h>
#include "libesphttpd/auth.h"
Expand Down
4 changes: 4 additions & 0 deletions core/base64.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* base64.c : base-64 / MIME encode/decode */
/* PUBLIC DOMAIN - Jon Mayo - November 13, 2003 */
#include <libesphttpd/esp8266.h>
Expand Down
4 changes: 4 additions & 0 deletions core/httpd-freertos.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
ESP8266 web server - platform-dependent routines, FreeRTOS version
Expand Down
4 changes: 4 additions & 0 deletions core/httpd-nonos.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
ESP8266 web server - platform-dependent routines, nonos version
*/
Expand Down
14 changes: 4 additions & 10 deletions core/httpd.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
Esp8266 http server - core routines
*/

/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <[email protected]> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/


#include <libesphttpd/esp8266.h>
#include "libesphttpd/httpd.h"
#include "httpd-platform.h"
Expand Down
13 changes: 4 additions & 9 deletions core/httpdespfs.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
Connector to let httpd use the espfs filesystem to serve the files in it.
*/

/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <[email protected]> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/

#include <libesphttpd/esp8266.h>
#include "libesphttpd/httpdespfs.h"
#include "libesphttpd/espfs.h"
Expand Down
4 changes: 4 additions & 0 deletions core/sha1.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* This code is public-domain - it is based on libcrypt
* placed in the public domain by Wei Dai and other contributors.
*/
Expand Down
14 changes: 4 additions & 10 deletions espfs/espfs.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
This is a simple read-only implementation of a file system. It uses a block of data coming from the
mkespfsimg tool, and can use that block to do abstracted operations on the files that are in there.
It's written for use with httpd, but doesn't need to be used as such.
*/

/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <[email protected]> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/


//These routines can also be tested by comping them in with the espfstest tool. This
//simplifies debugging, but needs some slightly different headers. The #ifdef takes
//care of that.
Expand Down
4 changes: 4 additions & 0 deletions espfs/espfstest/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
Simple and stupid file decompressor for an espfs image. Mostly used as a testbed for espfs.c and
the decompressors: code compiled natively is way easier to debug using gdb et all :)
Expand Down
4 changes: 4 additions & 0 deletions espfs/heatshrink_decoder.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "libesphttpd/espfs.h"
#ifdef ESPFS_HEATSHRINK
//Stupid wrapper so we don't have to move c-files around
Expand Down
6 changes: 5 additions & 1 deletion espfs/mkespfsimage/heatshrink_encoder.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

//Stupid wraparound include to make sure object file doesn't end up in heatshrink dir
#ifdef ESPFS_HEATSHRINK
#include "../lib/heatshrink/heatshrink_encoder.c"
#endif
#endif
4 changes: 4 additions & 0 deletions espfs/mkespfsimage/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
Expand Down
4 changes: 4 additions & 0 deletions mkupgimg/mkupgimg.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
Expand Down
11 changes: 3 additions & 8 deletions util/captdns.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <[email protected]> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/*
Expand Down
13 changes: 4 additions & 9 deletions util/cgiflash.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
Some flash handling cgi routines. Used for updating the ESPFS/OTA image.
*/

/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <[email protected]> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/

#include <libesphttpd/esp8266.h>
#include "libesphttpd/cgiflash.h"
#include "libesphttpd/espfs.h"
Expand Down
13 changes: 4 additions & 9 deletions util/cgiwebsocket.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
Websocket support for esphttpd. Inspired by https://github.com/dangrie158/ESP-8266-WebSocket
*/

/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <[email protected]> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/


#include <libesphttpd/esp8266.h>
#include "libesphttpd/httpd.h"
Expand Down
13 changes: 4 additions & 9 deletions util/cgiwifi.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
Cgi/template routines for the /wifi url.
*/

/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* Jeroen Domburg <[email protected]> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/


#include <libesphttpd/esp8266.h>
#include "libesphttpd/cgiwifi.h"
Expand Down
4 changes: 4 additions & 0 deletions util/esp32_flash.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
Routines for handling the (slightly more complicated) esp32 flash.
Broken out because esp-idf is expected to get better routines for this.
Expand Down

5 comments on commit f031a46

@pathob
Copy link

@pathob pathob commented on f031a46 Feb 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if @Spritetm gave you the permission to remove the notice?

And do I understand it right, if the license change is even legal, that MPL v2 does not force me to publish the whole source code of my software, but only the modifications I made to this component?

@Spritetm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did give @chmorgan permission to relicense my own stuff in esphttpd under the MPLv2: Spritetm#43 (comment)

@chmorgan
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pathob on the second question yep. Section 3.2 appears to cover this but the best approach imo is to submit PRs back to here (or the most active fork) with the changes to the library so they can be considered for inclusion.

3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:

such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and

@chmorgan
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pathob and part of the motivation for using MPL was to allow people to static link against closed source code.

@pathob
Copy link

@pathob pathob commented on f031a46 Feb 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thank you guys. That were the answers I needed.

@chmorgan I wasn't sure if I understood it correctly. Makes sense, good choice!

Please sign in to comment.