gosmartkeyboard/docs/ReadMe.html

126 lines
5.8 KiB
HTML
Raw Permalink Normal View History

2023-03-07 22:29:26 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>GoSmartKeyboard</title>
<link rel="stylesheet" href="google-code-prettify/prettify.css">
<link rel="stylesheet" href="styles/prettify-theme.css">
<script defer src="google-code-prettify/prettify.js"></script>
<script defer src="google-code-prettify/run_prettify.js"></script>
<link rel="stylesheet" href="styles/main.css">
</head>
<!-- Generated by srcweave https://github.com/justinmeiners/srcweave -->
<h1>GoSmartKeyboard<a id="c0"></a></h1>
<p>Copyright <a href="https://chaoswebs.net/">Kevin Froman</a> <a href="LICENSE.html">Licensed under GPLv3</a></p>
<p>Work in progress</p>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="version-block-1" href="#version-block-1">version</a></em></strong></span>
<pre class="prettyprint"><code class="">0.0.1
</code></pre>
<p class="block-usages"><small>Used by <a href="Plumbing.html#handle-version-command-block-42" title="handle version command. Plumbing.html">1</a> </small></p></div>
<h1>Introduction<a id="c1"></a></h1>
<p>GoSmartKeyboard is a daemon that allows you to have a more powerful keyboarding experience. It can be used with a secondary device, such as an Android phone or a raspberry pi, or it can run locally. A seperate client binary is provided that reads from a FIFO (named pipe) and sends the data to the server. This allows you to use any program that can write to a FIFO as a source of keyboard input.</p>
<p>This is done with a simple websocket server meant to accept a single connection, authenticate it, and stream UTF16 characters and send them as key strokes into the window manager. <strong>With a simple daemon like this we can enhance keyboarding with inteligent features.</strong></p>
<p>Be careful with online games, as they may interpret the keystrokes as cheating. I assume if you don&rsquo;t send keystrokes or more accurately than a human you should be fine, but don&rsquo;t blame the software if you get banned.</p>
<p><strong>See <a href="Building.html">Building.html</a> for instructions on how to build this <a href="https://en.wikipedia.org/wiki/Literate_programming">literate</a> project.</strong></p>
<h2>1. What can you do with it?<a id="s1:0"></a></h2>
<p>Examples of what you can do:</p>
<ul>
<li>Run dictation software on a separate device</li>
<li>Typical macros</li>
<li>Buffer typed text before sending it to the server, preventing invalid commands or input.</li>
<li>Clever CLI tricks, think <code>vim</code> or <code>cowsay</code> on your keyboard!</li>
<li>Isolated password manager</li>
<li>One Time Passwords</li>
<li>Virtual keyboard switch (keyboard multiplexer)</li>
<li>Typing things into VMS, or transfering text based files to VMs/servers.</li>
<li>Text storage, such as configuration or SSH pubkeys</li>
<li>On-the-fly spell checking or translation</li>
<li>On-the-fly encryption (ex: PGP sign every message you type), isolated from the perhaps untrusted computer</li>
<li>Easy layout configuration</li>
<li>Key logging</li>
<li>Delay keystrokes by a few dozen or so milliseconds to reduce <a href="https://en.wikipedia.org/wiki/Keystroke_dynamics">key stroke timing biometrics</a></li>
</ul>
<p>Some points about the design of this project:</p>
<ul>
<li>Written in go with the <a href="https://en.wikipedia.org/wiki/Literate_programming">literate</a> tool <a href="https://github.com/justinmeiners/srcweave">srcweave</a>, so this
markdown book is actually the source code</li>
<li>KISS principle above All</li>
<li>Small and light core</li>
<li>No dependencies for the core and most features</li>
<li>Features (such as described in above section) are implementend as seperate programs, unix style</li>
<li>Simple <a href="ThreatModel.html">threat model</a></li>
</ul>
<h1>Running<a id="c2"></a></h1>
<h2>1. Installation<a id="s2:0"></a></h2>
<p>The server and client are both single static binaries. The only requirement is Linux. This software has been tested
with typical US keyboards in QWERTY and Colemak layouts. It should work with any keyboard layout, though.</p>
<h3>Keyboard weirdness</h3>
<p>Not all keyboards are equal, per the <a href="https://www.kernel.org/doc/html/latest/input/event-codes.html#ev-key">Linux kernel documentation</a>,
some keyboards do not autorepeat keys. Autorepeat behavior was also found inconsistent during testing and seems to mess up the rawcapture tool.</p>
<h2>2. Server<a id="s2:1"></a></h2>
<p><code>sudo KEYBOARD_TCP_BIND_ADDRESS=127.1 KEYBOARD_TCP_BIND_PORT=8080 ./keyboard</code></p>
<p>You could also run sudoless by giving your user access to uinput, but it would minimally if at all be more secure.</p>
<p>On first run it will output your authentication token. Store it in a safe place such as your password manager.</p>
<p>It is highly recommended to use SSH forwarding (preferred) or a reverse https proxy to access the server.</p>
<h3>SSH example</h3>
<p>To connect with ssh, run this on the client:</p>
<p><code>ssh -R 8080:localhost:8080 user@myserver</code></p>
<h3>Socket file</h3>
<p>It is more secure and mildly more efficient to use a unix socket file. To do this, set the environment variable <code>KEYBOARD_UNIX_SOCKET_PATH</code> to the path of the socket file. The server will create the file if it does not exist. The socket is useful for reverse proxies or SSH forwarding.</p>
<h2>3. Client<a id="s2:2"></a></h2>
<p><code>KEYBOARD_AUTH=your_token_here KEYBOARD_FIFO=keyboard_control_file ./keyboard-client "ws://myserver:8080/sendkeys</code></p>
<p>From here you can use any program that can write to a FIFO to send keystrokes to the server. For example, you could use <code>cat</code> to send a file to the server, or <code>cowsay</code> to send a cow message to the server.</p>
<h3>Tools</h3>
</body>
</html>