gosmartkeyboard/EnvironmentVariables.md

82 lines
1.8 KiB
Markdown
Raw Normal View History

# GoSmartKeyboard Environment Variables
2023-01-27 23:22:02 +00:00
## Always use xdotool
Some users may always want xdotool, see the [Streaming.md](Streaming.md) file for more information
2023-01-27 23:22:02 +00:00
``` go
2023-01-27 23:22:02 +00:00
--- always use xdotool environment variable
2023-03-03 03:20:34 +00:00
var alwaysUseXdotool = false
alwaysUseXdotoolEnv, alwaysUseXdotoolExists := os.LookupEnv("KEYBOARD_ALWAYS_USE_XDOTOOL")
if alwaysUseXdotoolExists {
if alwaysUseXdotoolEnv == "true" || alwaysUseXdotoolEnv == "1" {
alwaysUseXdotool = true
}
}
2023-01-27 23:22:02 +00:00
---
```
2023-01-27 23:22:02 +00:00
## Authentication token file
The authentication token configuration file is set by the environment variable `KEYBOARD_AUTH_TOKEN_FILE`, but defaults to
`XDG_CONFIG_HOME/smartkeyboard/auth-token`.
``` go
--- get authTokenFile from environment
authTokenFile, authTokenFileIsSet := os.LookupEnv("KEYBOARD_AUTH_TOKEN_FILE")
---
```
2023-01-01 21:25:32 +00:00
## Authentication token input (for client)
--- get authTokenInput from environment
2023-01-27 23:22:02 +00:00
authTokenInput, authTokenInputExists := os.LookupEnv("KEYBOARD_AUTH")
2023-01-01 21:25:32 +00:00
---
2023-01-22 03:28:56 +00:00
## Client fifo
--- get client fifo input file from environment
2023-03-03 03:20:34 +00:00
clientFifoInputFile, clientFifoInputFileEnvExists := os.LookupEnv("KEYBOARD_FIFO")
2023-01-22 03:28:56 +00:00
---
## HTTP Bind Settings
GoSmartKeyboard supports both standard TCP sockets and unix sockets for the
HTTP server.
First, we check for a unix socket path.
One should prefer a unix socket if their reverse proxy supports it and is on the
same machine.
--- unixSocketPath
unixSocketPath, unixSocketPathExists := os.LookupEnv("KEYBOARD_UNIX_SOCKET_PATH")
---
If the unix socket path is set, we use it. Otherwise, we use the TCP socket.
The TCP socket is configured by the following environment variables:
--- TCPBindAddress
tcpBindAddress, tcpBindAddressExists := os.LookupEnv("KEYBOARD_TCP_BIND_ADDRESS")
---
--- TCPBindPort
tcpBindPort, tcpBindPortExists := os.LookupEnv("KEYBOARD_TCP_BIND_PORT")
---