about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-23 15:12:22 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-23 15:32:56 +0200
commitbe9ba2f95826227fd46fcc46c2ca1bb061acd41e (patch)
tree117f67de5b8ea538341b2e8c706d70e06f5ede68
parente901e00ed67c3497c7f2ce4b348e69a7ccd75b8a (diff)
downloadchawan-be9ba2f95826227fd46fcc46c2ca1bb061acd41e.tar.gz
Add about:license
-rw-r--r--README.md4
-rw-r--r--res/license.html116
-rw-r--r--src/loader/about.nim6
3 files changed, 126 insertions, 0 deletions
diff --git a/README.md b/README.md
index d0adf5bf..94bb8cb3 100644
--- a/README.md
+++ b/README.md
@@ -132,3 +132,7 @@ traversal commands.)
 ## License
 
 Chawan is dedicated to the public domain. See the UNLICENSE file for details.
+
+Chawan also includes and depends on several other libraries. For further
+details, see [license.html](doc/license.html) or check the about:license
+page in Chawan.
diff --git a/res/license.html b/res/license.html
new file mode 100644
index 00000000..93a830c2
--- /dev/null
+++ b/res/license.html
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML>
+<HTML>
+<HEAD>
+<TITLE>Licensing</TITLE>
+</HEAD>
+<BODY>
+Chawan itself is dedicated to the public domain. However, it contains and
+depends on projects with different licensing terms.
+<P>
+This document attempts to list licensing terms of projects included in
+the Chawan repository. Note that Chawan is dynamically linked against
+your copy of zlib, libcurl, your C library, and if exists, your termcap
+library. For licensing terms of these, please consult the appropriate
+library's documentation.
+<P>
+Also, Chawan is statically linked to the Nim standard library. At the time
+of writing, (i.e. as of Nim 2.0.0,) this is the MIT license (same terms as
+the vendored Punycode library).
+<P>
+Table of contents:
+<UL>
+<LI><A HREF="#chawan">Chawan</A>
+<LI><A HREF="#quickjs">QuickJS</A>
+<LI><A HREF="#punycode">Punycode library</A>
+</UL>
+<H2 id=chawan>Chawan</H2>
+<PRE>
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+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 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.
+
+For more information, please refer to &lt;http://unlicense.org/&gt;
+</PRE>
+
+<H2 id=quickjs>QuickJS</H2>
+Note that our vendored copy of QuickJS also includes code from
+<A HREF="https://www.freelists.org/post/quickjs-devel/PATCH-toplevel-await-TLA">zamfofex</A>,
+<A HREF="https://github.com/bellard/quickjs/pull/132">Bo Yao</A>,
+and
+<A HREF="https://github.com/bellard/quickjs/pull/182">Nick Vatamaniuc</A>.
+<BR>
+We also include changes made to the QuickJS sources in the
+<A HREF="https://github.com/saghul/txiki.js">txiki.js</A> project by
+Saúl Ibarra Corretgé.
+<PRE>
+QuickJS Javascript Engine
+
+Copyright (c) 2017-2021 Fabrice Bellard
+Copyright (c) 2017-2021 Charlie Gordon
+
+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.
+</PRE>
+
+<H2 id=punycode>Punycode library</H2>
+We also vendor the punycode library, which is no longer included in the Nim
+standard library. This library is distributed under the following terms:
+<PRE>
+MIT License
+
+Copyright (c) 2022 The Nim programming language
+
+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.
+</PRE>
+</BODY>
+</HTML>
diff --git a/src/loader/about.nim b/src/loader/about.nim
index f2ac6d74..054cee89 100644
--- a/src/loader/about.nim
+++ b/src/loader/about.nim
@@ -5,6 +5,7 @@ import loader/request
 import types/url
 
 const chawan = staticRead"res/chawan.html"
+const license = staticRead"res/license.html"
 const HeaderTable = {
   "Content-Type": "text/html"
 }
@@ -22,5 +23,10 @@ proc loadAbout*(handle: LoaderHandle, request: Request) =
     t handle.sendStatus(200) # ok
     t handle.sendHeaders(newHeaders(HeaderTable))
     t handle.sendData(chawan)
+  elif request.url.pathname == "license":
+    t handle.sendResult(0)
+    t handle.sendStatus(200) # ok
+    t handle.sendHeaders(newHeaders(HeaderTable))
+    t handle.sendData(license)
   else:
     t handle.sendResult(ERROR_ABOUT_PAGE_NOT_FOUND)