cert config
- Changed SAN default for generating server certificate - Added two new options for organizations
This commit is contained in:
@@ -31,8 +31,10 @@ def load_options():
|
||||
"mqtt_password": "",
|
||||
"request_topic_prefix": "cert/enroll",
|
||||
"cert_validity_days": 825,
|
||||
"broker_hostnames": "core-mosquitto,localhost",
|
||||
"broker_hostnames": "homeassistant.local,192.168.1.80",
|
||||
"renewal_window_days": 30,
|
||||
"cert_organization": "",
|
||||
"cert_organizational_unit": "",
|
||||
}
|
||||
if os.path.exists(OPTIONS_PATH):
|
||||
with open(OPTIONS_PATH) as f:
|
||||
@@ -41,7 +43,10 @@ def load_options():
|
||||
|
||||
|
||||
options = load_options()
|
||||
ca = CertificateAuthority()
|
||||
ca = CertificateAuthority(
|
||||
organization=options["cert_organization"],
|
||||
organizational_unit=options["cert_organizational_unit"],
|
||||
)
|
||||
app = Flask(__name__)
|
||||
|
||||
# Guard: this server has no login of its own. It relies entirely on only
|
||||
@@ -60,7 +65,7 @@ def restrict_to_ingress_proxy():
|
||||
|
||||
|
||||
def parsed_broker_hostnames():
|
||||
raw = options.get("broker_hostnames", "core-mosquitto,localhost")
|
||||
raw = options.get("broker_hostnames", "homeassistant.local,192.168.1.80")
|
||||
return [h.strip() for h in raw.split(",") if h.strip()]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user