#!/usr/bin/env sh # --------------------------------------------------------------------------- # Generates the MQTT fixture's password file + TLS material into ./secrets/. # # NOTHING this script writes is committed: ./secrets/ is excluded by the sibling # .gitignore. The SCRIPT is the artifact in git, the OUTPUT never is. Re-run it on any # machine that needs the fixture (or on the Docker host); the material is throwaway by # construction — a self-issued CA, a 2048-bit server key, and whatever password the # operator supplies in the environment. # # Usage: # MQTT_FIXTURE_PASSWORD='' ./gen-fixture-material.sh # # Environment: # MQTT_FIXTURE_PASSWORD (required) broker password. No default — a committed or # defaulted password is exactly what the plan's # "secrets from env, never committed" rule forbids. # MQTT_FIXTURE_USERNAME broker username (default: otopcua) # MQTT_FIXTURE_SAN_IPS comma-separated IP SANs for the server certificate # (default: 10.100.0.35,127.0.0.1) # MQTT_FIXTURE_SAN_DNS comma-separated DNS SANs # (default: localhost,mosquitto) # MQTT_FIXTURE_CERT_CN server certificate CN (default: first IP SAN) # MQTT_FIXTURE_CERT_DAYS certificate lifetime in days (default: 825) # MQTT_FIXTURE_SECRETS_DIR output directory (default: