A simple CLI library for manually configuring Pexip Transcoder Nodes in a cloud. The specific use-case that this is intended for is in spinning up Pexip Transcoder nodes in AWS using Terraform outputs the inputs to the code.
Are there better ways to do this? Yes, probably. But this way also does work, and it was an opportunity for me to mimic the layout of a piece of Python code that inspired me to work on this in the first place, httpie
A config.json
configuration file is searched for in order at the following places:
- An absolute path specified within an environment variable
ENV_PEXIP_CONFIG_DIR
- A file local to where the script is being executed, e.g.
.pexip/config.json
- The running users home directory, e.g.
~/.pexip/config.json
If no configuration file is found, all required arguments will be expected to be passed over the CLI.
The following is a simple example configuration file
{
"MANAGER_URL": "https://manager01.pexip.company.com",
"DOMAIN": "company.com",
"NETMASK": "255.255.255.0",
"GATEWAY": "192.168.1.1",
"TLS_CERTIFICATE_SUBJECT_NAME": "*.pexip.company.com",
"SYSTEM_LOCATION_NAME": "pexip-production"
}
These values will be used as explicit defaults for all nodes created or deleted from the specified manager.
Any values passed via CLI will override these values specified in the configuration.
The following is a usage example for full node creation via CLI, without any local configuration file found.
# Save MEET_MANAGER_PASS as an environment variable
$ read -s MEET_MANAGER_PASS && export MEET_MANAGER_PASS
# Create a Transcoder node configuration
$ pexip create "transcoder01.pexip.company.com" \
--manager-url 'https://manager01.pexip.company.com' \
--domain "company.com" \
--gateway "192.168.1.1" \
--private-ip "192.168.1.111" \
--public-ip "52.41.93.113" \
--tls-certificate-subject-name "*.pexip.company.com" \
--system-location-name "pexip-production"
TODO