feat(zigbee2mqtt): allow use of custom config file BREAKING CHANGE (#2395)
* feat(zigbee2mqtt): allow use of custom config file * fix script * test file generation * dont preset values, in case use select to use custom config * cosmetic * cosmetic * whoops * test not generate * default to false * adjust UI * UI
This commit is contained in:
@@ -10,13 +10,15 @@ secret:
|
||||
env:
|
||||
ZIGBEE2MQTT_DATA: "/data"
|
||||
ZIGBEE2MQTT_CONFIG_FRONTEND_PORT: "{{ .Values.service.main.ports.main.port }}"
|
||||
ZIGBEE2MQTT_CONFIG_EXPIRIMENTAL_NEW_API: true
|
||||
# User defined
|
||||
ZIGBEE2MQTT_CONFIG_PERMIT_JOIN: true
|
||||
ZIGBEE2MQTT_CONFIG_MQTT_SERVER: "mqtt://localhost"
|
||||
ZIGBEE2MQTT_CONFIG_MQTT_BASE_TOPIC: "zigbee2mqtt"
|
||||
ZIGBEE2MQTT_CONFIG_SERIAL_PORT: "/dev/ttyUSB0"
|
||||
ZIGBEE2MQTT_CONFIG_SERIAL_ADAPTER: "auto"
|
||||
USE_CUSTOM_CONFIG_FILE: false
|
||||
# This values are required for the autogenerated file to work.
|
||||
# ZIGBEE2MQTT_CONFIG_EXPIRIMENTAL_NEW_API: true
|
||||
# ZIGBEE2MQTT_CONFIG_PERMIT_JOIN: true
|
||||
# ZIGBEE2MQTT_CONFIG_MQTT_SERVER: "mqtt://localhost"
|
||||
# ZIGBEE2MQTT_CONFIG_MQTT_BASE_TOPIC: "zigbee2mqtt"
|
||||
# ZIGBEE2MQTT_CONFIG_SERIAL_PORT: "/dev/ttyUSB0"
|
||||
# ZIGBEE2MQTT_CONFIG_SERIAL_ADAPTER: "auto"
|
||||
|
||||
securityContext:
|
||||
runAsNonRoot: false
|
||||
@@ -64,18 +66,21 @@ initContainers:
|
||||
value: "{{ .Values.env.ZIGBEE2MQTT_CONFIG_SERIAL_PORT }}"
|
||||
- name: ZIGBEE2MQTT_CONFIG_SERIAL_ADAPTER
|
||||
value: "{{ .Values.env.ZIGBEE2MQTT_CONFIG_SERIAL_ADAPTER }}"
|
||||
- name: USE_CUSTOM_CONFIG_FILE
|
||||
value: "{{ .Values.env.USE_CUSTOM_CONFIG_FILE }}"
|
||||
command: ["/bin/sh", "-c"]
|
||||
args:
|
||||
- >
|
||||
if [ -f /data/configuration.yaml ];
|
||||
if [ -f /data/configuration.yaml ] || [ ${USE_CUSTOM_CONFIG_FILE} == true ];
|
||||
then
|
||||
echo "Initial configuration exists. Skipping";
|
||||
echo "Initial configuration exists or User selected to use custom configuration file. Skipping...";
|
||||
else
|
||||
echo "Creating initial configuration";
|
||||
touch /data/configuration.yaml;
|
||||
echo "# Configuration bellow will be always be overridden" >> /data/configuration.yaml;
|
||||
echo "# from environment settings on the Scale Apps UI." >> /data/configuration.yaml;
|
||||
echo "# You however will not see this values change in the file." >> /data/configuration.yaml;
|
||||
echo "# It's a generated file based on the values provided on initial install." >> /data/configuration.yaml;
|
||||
echo "##########################################################" >> /data/configuration.yaml;
|
||||
echo "experimental:" >> /data/configuration.yaml;
|
||||
echo " new_api: $ZIGBEE2MQTT_CONFIG_EXPIRIMENTAL_NEW_API" >> /data/configuration.yaml;
|
||||
|
||||
Reference in New Issue
Block a user