-
-
Notifications
You must be signed in to change notification settings - Fork 30
Setup: Application
This application can be run as a standalone application or as a Docker image. For standalone setup, precompiled releases are available here.
The primary configuration file appsettings.Production.json
must be provided to override all configuration defaults. This file must exist in the application root directory. A default file to get started can be found here. More information about the available settings can be found here.
All other supporting configuration is expected by default to be in an app-relative config
directory. There are several specific files.
-
googleDevices.json
- Provides device configuration including MQTT mappings, etc. A sample is provided in the application, but application will start without one (i.e., with no devices configured). Actual path is configurable in appsettings if you want to change it. -
signingCert.pfx
- (Recommended) If you want to use your own generated signing certificate you should put them in this directory and configure them inappsettings.production.json
. The app will start without this configuration, and generate a temporary key, but you shouldn't use that beyond testing.
Signing certificates can be added to the config like below. You can add multiple signing certificates to allow for rolling out new certs if your original is about to expire. The first certificate specified in the array will always be the current active signing certificate, but when its close to expiration, you can add a new certificate as the first item in the array, and the old certificate will remain active for message validation until its expiration so that consumers can roll over to the new signing certificate seamlessly.
{
"oauth": {
"signingCerts": [
{
"file": "config/signingKey.pfx",
"passPhrase": "yourKeyPassword"
}
]
}
}
In addition, after first start you should see some other files show up here as the application writes them out:
-
tempkey.jwk
- If you don't provide a signing certificate, this file will be generated to hold an automatically generated signing certificate so it persists between app restarts. Note that this has a very short expiration though, so if you want a stable implementation, you'll want to provide your own certificate. You should immediately move off of this to your own certificate, as it isn't meant to be used except for development. -
tokens.json
- Storage for OAuth tokens to persist between app restarts.
This application is distributed in Docker.
Docker images are available for both x86
and arm32
(e.g., Raspberry Pi). The Docker image will expect volume mounts for the config
and logs
directories. You can create the image without the directories existing first, which will create them with some example files in them, but you will need to configure everything before starting the container or it will just fail to start.
docker run
-dit \
--name homeautio.mqtt.googlehome \
--restart=always \
--user=1000 \
-p 5000:5000 \
-v appsettings.Production.json:/app/appsettings.Production.json:ro \
-v config:/app/config \
-v logs:/app/logs \
-e TZ=America/New_York \
ghcr.io/i8beef/homeautio.mqtt.googlehome:latest
This app runs on port 5000. This needs to be mapped to an exposed port. There is no built in SSL support, so to actually expose this you must proxy it through nginx and port forward through your router / firewall.
Mount | Usage |
---|---|
/appsettings.Production.json | Primary configuration file. |
/app/config | Directory the app will use to write stored tokens (tokens.json), OAuth signing key config if not using your own (tempkey.jwk), and where googleDevices.json should be housed. |
/app/logs | Logs directory |
The following files need to be created. Pay special attention to the notes on the appsettings.Production.json documentation around signing certificate generation. You almost certainly want to do that.
-
appsettings.Production.json
- See appsettings.Production.json documentation. -
config/googleDevices.json
- See googleDevice.json documentation. Name can be specified in config. -
config/serviceAccount.json
- A file for Google Home Graph Service Account, for Report State. Name can be specified in config.