diff options
author | Vika <vika@fireburn.ru> | 2022-07-15 02:18:14 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-07-15 02:18:14 +0300 |
commit | c00547c8437b992aa073378ab165aa40b073e1b4 (patch) | |
tree | 01c62edbca13acc2789c427c7abdd4d2eb0a7bc1 /kittybox-rs/companion-lite/index.html | |
parent | 9c3b8424fb834a0f3576dfd1970ba4cad0afb95a (diff) | |
download | kittybox-c00547c8437b992aa073378ab165aa40b073e1b4.tar.zst |
PoC for modularity and WIP built-in Micropub client rework
This is the living, breathing proof that Kittybox can be split into independent components without sacrificing any functionality. Just make sure all neccesary backing storage components are available to the modules that need them. Also the Micropub client was split into several files, because it's about to get much bigger and more full-featured. Yes, I am going to write it in vanilla JavaScript. I don't trust anything from NPM to run on my computer. Not anymore. Not after the node-ipc malware fiasco. And I am definitely not going to spin up a VM or a Docker container (who uses Docker containers as a security measure?) to hack on my own code. Cargo can at least be sandboxed inside Nix, where it can't do much harm. NPM basically requires unrestricted network access to download dependencies, and it runs arbitrary code upon **downloading** them. Cargo and rust-analyzer, on the other hand, can be configured to not trust the source code and its dependencies (for example, Cargo doesn't execute code on fetching dependencies - only on building, and rust-analyzer's proc-macro expansion support can be sacrificed for more security).
Diffstat (limited to 'kittybox-rs/companion-lite/index.html')
-rw-r--r-- | kittybox-rs/companion-lite/index.html | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/kittybox-rs/companion-lite/index.html b/kittybox-rs/companion-lite/index.html new file mode 100644 index 0000000..b643ba2 --- /dev/null +++ b/kittybox-rs/companion-lite/index.html @@ -0,0 +1,77 @@ +<html> + <head> + <meta charset="utf-8"> + <title>Kittybox-Micropub debug client</title> + <link rel="stylesheet" href="./style.css"> + <script type="module" src="./main.js"></script> + </head> + <body> + <noscript> + <h1 class="header">Kittybox Companion (Lite)</h1> + <p>I'm sorry, Kittybox Companion requires JavaScript to work.</p> + + <p>This is a requirement due to multiple interactive features present in Kittybox, such as support for multiple-entry form fields, interactive login sequence and more.</p> + + <p>However, the Micropub standard is extremely flexible, and if you happen to have a token, you can publish articles, notes, likes, follows and more by sending requests directly to the Micropub endpoint.</p> + + <p><a href="https://micropub.spec.indieweb.org/">The Micropub spec is defined here.</a> Good luck!</p> + </noscript> + + <div class="view" id="unauthorized" style="display:none"> + + </div> + + <div class="view" id="authorized" style="display:none"> + <form action="/.kittybox/micropub" method="POST" id="micropub"> + <fieldset> + <legend>Authorization details</legend> + <section> + <label for="access_token">Access token:</label> + <input id="access_token" name="access_token" type="password"> + + <p><a href="https://gimme-a-token.5eb.nl/" target="_blank">Get an access token (will open in a new tab)</a></p> + </section> + </fieldset> + <fieldset> + <legend>Post details:</legend> + <section> + <label for="name">Name (leave blank for an unnamed post):</label> + <input id="name" type="text"> + </section> + <section> + <label for="content">Content:</label> + <textarea id="content" placeholder="Your post's text goes here"></textarea> + </section> + <section> + <label for="category">Categories (separeted by commas):</label> + <input id="category" type="text"> + </section> + <fieldset> + <legend>Channels</legend> + <section> + <input type="radio" id="no_channel" name="channel_select" checked value=""> + <label for="no_channel">Default channel only</label> + </section> + + <section> + <input type="radio" id="select_channels" name="channel_select" value="on"> + <label for="select_channels">Select channels manually</label> + </section> + + <fieldset id="channels" style="display: none"> + <legend>Available channels:</legend> + <template id="channel_selector"> + <section> + <input type="checkbox" name="channel" id="" value=""> + <label for=""></label> + </section> + </template> + <div id="channels_target"></div> + </fieldset> + </fieldset> + </fieldset> + <input type="submit"> + </div> + </main> + </body> +</html> |