about summary refs log tree commit diff
path: root/kittybox-rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2022-10-03 17:45:22 +0300
committerVika <vika@fireburn.ru>2022-10-03 17:45:22 +0300
commit0e0d711a9d524c445a61a05831a824ac7080f3b8 (patch)
tree66fcd25abd802fb9fd74aadbc3293c3a34ccf940 /kittybox-rs
parent568f98589b6c30bb3f807517d28039b12dd54be3 (diff)
LibreJS compatibility
I don't know how worthwhile that was, given that LibreJS developers
themselves don't care to properly declare licenses on the Bazaar
frontend they use to host the extension's source code on the Web 🤡
Diffstat (limited to 'kittybox-rs')
-rw-r--r--kittybox-rs/companion-lite/index.html54
-rw-r--r--kittybox-rs/javascript/jslicense.html31
-rw-r--r--kittybox-rs/src/frontend/mod.rs3
-rw-r--r--kittybox-rs/templates/src/templates.rs2
4 files changed, 88 insertions, 2 deletions
diff --git a/kittybox-rs/companion-lite/index.html b/kittybox-rs/companion-lite/index.html
index e494cd9..fc99c60 100644
--- a/kittybox-rs/companion-lite/index.html
+++ b/kittybox-rs/companion-lite/index.html
@@ -5,6 +5,7 @@
         <title>Kittybox-Micropub debug client</title>
         <link rel="stylesheet" href="./style.css">
         <script type="module" src="./main.js"></script>
+        <link rel="jslicense" href="#jslicense">
     </head>
     <body>
       <noscript>
@@ -71,7 +72,56 @@
             </fieldset>
           </fieldset>
           <input type="submit">
-        </div>
-      </main>
+        </form>
+      </div>
+
+      <details id="jslicense">
+        <summary>JavaScript licensing information for this software</summary>
+        <table id="jslicense-labels1">
+          <tr>
+            <td><a href="/.kittybox/micropub/client/main.js">main.js</a></td>
+            <td><a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a></td>
+            <td><a href="https://git.sr.ht/~vikanezrimaya/kittybox/tree/main/item/kittybox-rs/companion-lite/src/main.ts">main.ts (Kittybox source code)</a></td>
+          </tr>
+          <tr>
+            <td><a href="/.kittybox/micropub/client/micropub_api.js">micropub_api.js</a></td>
+            <td><a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a></td>
+            <td><a href="https://git.sr.ht/~vikanezrimaya/kittybox/tree/main/item/kittybox-rs/companion-lite/src/micropub_api.ts">micropub_api.ts (Kittybox source code)</a></td>
+          </tr>
+          <tr>
+            <td><a href="/.kittybox/micropub/client/indieauth.js">indieauth.js</a></td>
+            <td><a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a></td>
+            <td><a href="https://git.sr.ht/~vikanezrimaya/kittybox/tree/main/item/kittybox-rs/companion-lite/src/indieauth.ts">indieauth.ts (Kittybox source code)</a></td>
+          </tr>
+          <tr>
+            <td><a href="/.kittybox/micropub/client/base64.js">base64.js</a></td>
+            <td><a href="http://creativecommons.org/publicdomain/zero/1.0/legalcode">CC0 (Public Domain)</a></td>
+            <td><a href="https://git.sr.ht/~vikanezrimaya/kittybox/tree/main/item/kittybox-rs/companion-lite/src/base64.ts">base64.ts</a>, adapted from <a href="https://developer.mozilla.org/en-US/docs/Glossary/Base64#solution_2_%E2%80%93_rewriting_atob_and_btoa_using_typedarrays_and_utf-8">MDN page on Base64</a></td>
+          </tr>
+          <tr>
+            <td><a href="https://esm.sh/microformats-parser@1.4.1?pin=v96">ESM.sh entrypoint for microformats-parser</a></td>
+            <td><a href="http://www.jclark.com/xml/copying.txt">MIT/Expat</a></td>
+            <td><a href="https://github.com/ije/esm.sh/blob/main/server/handler.go">esm.sh source code</a>
+          </tr>
+          <tr>
+            <td><a href="https://esm.sh/v96/microformats-parser@1.4.1/es2022/microformats-parser.js">microformats-parser</a></td>
+            <td><a href="http://www.jclark.com/xml/copying.txt">MIT/Expat</a></td>
+            <td><a href="https://github.com/microformats/microformats-parser">GitHub repository</a>
+          </tr>
+          <tr>
+            <td><a href="https://esm.sh/v96/parse5@6.0.1/es2022/parse5.js">parse5</a></td>
+            <td>
+              <a href="http://www.jclark.com/xml/copying.txt">MIT/Expat</a>
+              <br>
+              <a href="http://www.freebsd.org/copyright/freebsd-license.html">BSD-2-Clause</a>
+            </td>
+            <td>
+              <a href="https://github.com/inikulin/parse5">GitHub repository for parse5</a>
+              <br>
+              <a href="https://github.com/fb55/entities">GitHub repository for entitites</a>, a parse5 dependency
+            </td>
+          </tr>
+        </table>
+      </details>
     </body>
 </html>
diff --git a/kittybox-rs/javascript/jslicense.html b/kittybox-rs/javascript/jslicense.html
new file mode 100644
index 0000000..90c681c
--- /dev/null
+++ b/kittybox-rs/javascript/jslicense.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>JavaScript licensing information for Kittybox</title>
+  </head>
+  <body>
+    <p>All JavaScript included with Kittybox is licensed as free software, most of it under AGPL-3.0.</p>
+    <table id="jslicense-labels1">
+      <tr>
+        <td><a href="/.kittybox/static/onboarding.js">onboarding.js</a></td>
+        <td><a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a></td>
+        <td><a href="https://git.sr.ht/~vikanezrimaya/kittybox/tree/main/item/kittybox-rs/javascript/src/onboarding.ts">onboarding.ts (Kittybox source code)</a></td>
+      </tr>
+      <tr>
+        <td><a href="/.kittybox/static/indieauth.js">indieauth.js</a></td>
+        <td><a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a></td>
+        <td><a href="https://git.sr.ht/~vikanezrimaya/kittybox/tree/main/item/kittybox-rs/javascript/src/indieauth.ts">indieauth.ts (Kittybox source code)</a></td>
+      </tr>
+      <tr>
+        <td><a href="/.kittybox/static/lib.js">lib.js</a></td>
+        <td><a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a></td>
+        <td><a href="https://git.sr.ht/~vikanezrimaya/kittybox/tree/main/item/kittybox-rs/javascript/src/lib.ts">lib.ts (Kittybox source code)</a></td>
+      </tr>
+      <tr>
+        <td><a href="/.kittybox/static/indieauth.js">indieauth.js</a></td>
+        <td><a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a></td>
+        <td><a href="https://git.sr.ht/~vikanezrimaya/kittybox/tree/main/item/kittybox-rs/javascript/src/indieauth.ts">indieauth.ts (Kittybox source code)</a></td>
+      </tr>
+    </table>
+  </body>
+</html>
diff --git a/kittybox-rs/src/frontend/mod.rs b/kittybox-rs/src/frontend/mod.rs
index 970a09b..58de39d 100644
--- a/kittybox-rs/src/frontend/mod.rs
+++ b/kittybox-rs/src/frontend/mod.rs
@@ -283,9 +283,11 @@ const INDIEAUTH_JS: &[u8] = include_bytes!(concat!(
 const LIB_JS: &[u8] = include_bytes!(concat!(
     env!("OUT_DIR"), "/", "kittybox_js", "/", "lib.js"
 ));
+const JSLABELS_HTML: &[u8] = include_bytes!("../../javascript/jslicense.html");
 const MIME_JS: &str = "application/javascript";
 const MIME_CSS: &str = "text/css";
 const MIME_PLAIN: &str = "text/plain";
+const MIME_HTML: &str = "text/html; charset=utf-8";
 
 pub async fn statics(Path(name): Path<String>) -> impl IntoResponse {
     use axum::http::header::CONTENT_TYPE;
@@ -296,6 +298,7 @@ pub async fn statics(Path(name): Path<String>) -> impl IntoResponse {
         "onboarding.css" => (StatusCode::OK, [(CONTENT_TYPE, MIME_CSS)], ONBOARDING_CSS),
         "indieauth.js" => (StatusCode::OK, [(CONTENT_TYPE, MIME_JS)], INDIEAUTH_JS),
         "lib.js" => (StatusCode::OK, [(CONTENT_TYPE, MIME_JS)], LIB_JS),
+        "jslicense.html" => (StatusCode::OK, [(CONTENT_TYPE, MIME_HTML)], JSLABELS_HTML),
         _ => (
             StatusCode::NOT_FOUND,
             [(CONTENT_TYPE, MIME_PLAIN)],
diff --git a/kittybox-rs/templates/src/templates.rs b/kittybox-rs/templates/src/templates.rs
index 60daa55..ba5b684 100644
--- a/kittybox-rs/templates/src/templates.rs
+++ b/kittybox-rs/templates/src/templates.rs
@@ -19,6 +19,8 @@ markup::define! {
                 // legacy links for some dumb clients
                 link[rel="authorization_endpoint", href="/.kittybox/indieauth/auth"];
                 link[rel="token_endpoint", href="/.kittybox/indieauth/token"];
+                // LibreJS-compliant JS licensing info (because TypeScript is a bitch)
+                link[rel="jslicense", href="/.kittybox/static/jslicense.html"];
                 /*@if let Some(endpoints) = endpoints {
                     @if let Some(webmention) = &endpoints.webmention {
                         link[rel="webmention", href=&webmention];