gosmartkeyboard/docs/EnvironmentVariables.html

129 lines
5.4 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 Environment Variables<a id="c9"></a></h1>
<h2>1. Always use xdotool<a id="s9:0"></a></h2>
<p>Some users may always want xdotool, see the <a href="Streaming.html">Streaming.html</a> file for more information</p>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="always-use-xdotool-environment-variable-block-14" href="#always-use-xdotool-environment-variable-block-14">always use xdotool environment variable</a></em></strong></span>
<pre class="prettyprint"><code class="">var alwaysUseXdotool = false
alwaysUseXdotoolEnv, alwaysUseXdotoolExists := os.LookupEnv("KEYBOARD_ALWAYS_USE_XDOTOOL")
if alwaysUseXdotoolExists {
if alwaysUseXdotoolEnv == "true" || alwaysUseXdotoolEnv == "1" {
alwaysUseXdotool = true
}
}
</code></pre>
<p class="block-usages"><small>Used by <a href="Streaming.html#streaming-keyboard-input-block-56" title="streaming keyboard input. Streaming.html">1</a> </small></p></div>
<h2>2. Authentication token file<a id="s9:1"></a></h2>
<p>The authentication token configuration file is set by the environment variable <code>KEYBOARD_AUTH_TOKEN_FILE</code>, but defaults to
<code>XDG_CONFIG_HOME/smartkeyboard/auth-token</code>.</p>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="get-authtokenfile-from-environment-block-16" href="#get-authtokenfile-from-environment-block-16">get authTokenFile from environment</a></em></strong></span>
<pre class="prettyprint"><code class="">authTokenFile, authTokenFileIsSet := os.LookupEnv("KEYBOARD_AUTH_TOKEN_FILE")
</code></pre>
<p class="block-usages"><small>Used by <a href="Authentication.html#define-authentication-token-file-block-32" title="define authentication token file. Authentication.html">1</a> </small></p></div>
<h2>3. Authentication token input (for client)<a id="s9:2"></a></h2>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="get-authtokeninput-from-environment-block-18" href="#get-authtokeninput-from-environment-block-18">get authTokenInput from environment</a></em></strong></span>
<pre class="prettyprint"><code class="">authTokenInput, authTokenInputExists := os.LookupEnv("KEYBOARD_AUTH")
</code></pre>
<p class="block-usages"><small>Used by <a href="Client.html#setup-client-block-69" title="setup client. Client.html">1</a> </small></p></div>
<h2>4. Client fifo<a id="s9:3"></a></h2>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="get-client-fifo-input-file-from-environment-block-20" href="#get-client-fifo-input-file-from-environment-block-20">get client fifo input file from environment</a></em></strong></span>
<pre class="prettyprint"><code class="">clientFifoInputFile, clientFifoInputFileEnvExists := os.LookupEnv("KEYBOARD_FIFO")
</code></pre>
<p class="block-usages"><small>Used by <a href="Client.html#handle-client-command-block-67" title="handle client command. Client.html">1</a> <a href="Editor.html#-tools-editor-editor.go-block-83" title="/tools/editor/editor.go. Editor.html">2</a> </small></p></div>
<h2>5. HTTP Bind Settings<a id="s9:4"></a></h2>
<p>GoSmartKeyboard supports both standard TCP sockets and unix sockets for the
HTTP server.</p>
<p>First, we check for a unix socket path.</p>
<p>One should prefer a unix socket if their reverse proxy supports it and is on the
same machine.</p>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="unixsocketpath-block-22" href="#unixsocketpath-block-22">unixSocketPath</a></em></strong></span>
<pre class="prettyprint"><code class="">unixSocketPath, unixSocketPathExists := os.LookupEnv("KEYBOARD_UNIX_SOCKET_PATH")
</code></pre>
<p class="block-usages"><small>Used by <a href="Server.html#create-listener-block-49" title="create listener. Server.html">1</a> </small></p></div>
<p>If the unix socket path is set, we use it. Otherwise, we use the TCP socket.</p>
<p>The TCP socket is configured by the following environment variables:</p>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="tcpbindaddress-block-24" href="#tcpbindaddress-block-24">TCPBindAddress</a></em></strong></span>
<pre class="prettyprint"><code class="">tcpBindAddress, tcpBindAddressExists := os.LookupEnv("KEYBOARD_TCP_BIND_ADDRESS")
</code></pre>
<p class="block-usages"><small>Used by <a href="Server.html#create-listener-block-49" title="create listener. Server.html">1</a> </small></p></div>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="tcpbindport-block-26" href="#tcpbindport-block-26">TCPBindPort</a></em></strong></span>
<pre class="prettyprint"><code class="">tcpBindPort, tcpBindPortExists := os.LookupEnv("KEYBOARD_TCP_BIND_PORT")
</code></pre>
<p class="block-usages"><small>Used by <a href="Server.html#create-listener-block-49" title="create listener. Server.html">1</a> </small></p></div>
</body>
</html>