2022-09-08 18:35:17 +00:00
|
|
|
# GoSmartKeyboard Environment Variables
|
|
|
|
|
2022-09-10 19:23:48 +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")
|
|
|
|
|
|
|
|
---
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2022-09-08 18:35:17 +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
|
2022-09-10 19:23:48 +00:00
|
|
|
|
2022-09-08 18:35:17 +00:00
|
|
|
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
|
2022-09-10 19:23:48 +00:00
|
|
|
|
2022-09-08 18:35:17 +00:00
|
|
|
tcpBindAddress, tcpBindAddressExists := os.LookupEnv("KEYBOARD_TCP_BIND_ADDRESS")
|
|
|
|
---
|
|
|
|
|
|
|
|
--- TCPBindPort
|
2022-09-10 19:23:48 +00:00
|
|
|
|
2022-09-08 18:35:17 +00:00
|
|
|
tcpBindPort, tcpBindPortExists := os.LookupEnv("KEYBOARD_TCP_BIND_PORT")
|
|
|
|
---
|