Upgrade from 1.3.0 to 1.4.0
Upgrade secrets using Vault
We have begun supporting secrets. Although still in beta, we are currently using it to store the disco and command secrets. This section explains how to update your project to use it.
Edit the secrets in config
Change the secrets in stream.hcl to have something more secure.
secrets {
disco {
GENVID_DISCO_SECRET = "discosecret"
}
command {
GENVID_COMMAND_SECRET = "commandsecret"
}
}
Change the templates
Add vault policies in order to access the password in vault
task "web" {
...
// Add vault policy
vault {
policies = ["genvid"]
}
env {
WWWROOT = "{{key `local/website/root` | js}}"
// Get access to disco secret from vault and assign the environment variable
# {{with secret `secret/disco` }}
GENVID_DISCO_SECRET = "{{ .Data.GENVID_DISCO_SECRET }}"
# {{end}}
// Get access to command secret from vault and assign the environment variable
# {{with secret `secret/command` }}
GENVID_COMMAND_SECRET = "{{ .Data.GENVID_COMMAND_SECRET }}"
# {{end}}
PORT = "${NOMAD_PORT_web}"
}
...
}
Change the static binding
We are now using an environment variable to set the static binding of ports. In the web nomad template a change is needed in order to use the environment variable.
port "web" {
// {{- if (keyOrDefault `genvid/static_binding` `false` | parseBool)}}
static = 3000
// {{- end}}
}
Becomes
port "web" {
{{- if (env "GENVID_STATIC_BINDING" | parseBool)}}
static = 3000
{{- end}}
}
Unity SDK upgrade
We are now using a C# wrapper for all the calls related to the Genvid SDK instead of using the GenvidPlugin and a C# script to do the communication.
First, GenvidPlugin is now used only for video capture. You will need to use DLL import to access this dll. Also, you will need to perform the video capture via a loop inside your code (we used to handle it with a script, now you need to add it to your code).
Second, all the calls related to the Genvid SDK are now going through
the GenvidSDKCSharp.dll
. You need to add this dll to your project
to be able to use it properly. We also reduced the length of the calls
to the GenvidSDK, so now you only need to write:
GenvidSDK.Initialize()
In short, most of the calls no longer
require to write Genvid twice.
The GenvidSDKCSharp project is available with the sample so feel free to open it to observe the changes. Overall, the GenvidSDKCSharp DLL simplifies the integration process and allow us to support other C# applications. Also, feel free to read the Unity Cube Sample section which was updated with the new changes and more details for each step.