From 68ec507e30bead5e9263c0fdc4c47e18c257d82f Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 3 Aug 2023 20:48:23 +0200 Subject: [PATCH] fix: Add secure default config (#18357) * fix: Add secure default config. https://github.com/Koenkk/zigbee2mqtt/issues/16188 * Enable frontend by default --- .gitignore | 1 + data/configuration.example.yaml | 25 +++++++++++++++++++++++++ docker/docker-entrypoint.sh | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 data/configuration.example.yaml diff --git a/.gitignore b/.gitignore index f720f3eef..2ce286a93 100644 --- a/.gitignore +++ b/.gitignore @@ -80,6 +80,7 @@ data/extension # Ignore config data/*.yaml +!data/configuration.example.yaml # commit-user-lookup.json scripts/commit-user-lookup.json diff --git a/data/configuration.example.yaml b/data/configuration.example.yaml new file mode 100644 index 000000000..53df87926 --- /dev/null +++ b/data/configuration.example.yaml @@ -0,0 +1,25 @@ +# Home Assistant integration (MQTT discovery) +homeassistant: false + +# Enable the frontend, runs on port 8080 by default +frontend: true + +# MQTT settings +mqtt: + # MQTT base topic for zigbee2mqtt MQTT messages + base_topic: zigbee2mqtt + # MQTT server URL + server: 'mqtt://localhost' + # MQTT server authentication, uncomment if required: + # user: my_user + # password: my_password + +# Serial settings +serial: + # Location of CC2531 USB sniffer + port: /dev/ttyACM0 + +# Advanced settings +advanced: + # Let Zigbee2MQTT generate a network key on first start + network_key: GENERATE \ No newline at end of file diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 4f1c4fa37..1258344cc 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -11,7 +11,7 @@ echo "Using '$DATA' as data directory" if [ ! -f "$DATA/configuration.yaml" ]; then echo "Creating configuration file..." - cp /app/configuration.yaml "$DATA/configuration.yaml" + cp /app/configuration.example.yaml "$DATA/configuration.yaml" fi exec "$@"