From fcb9a37c78cdb14b8667775342b96d9d1f318397 Mon Sep 17 00:00:00 2001 From: Daniel Perna Date: Tue, 14 Nov 2017 11:24:16 +0100 Subject: [PATCH] Added banlimit and dirsfirst options (#200) --- configurator/config.json | 10 +++++++--- configurator/map.py | 8 +++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configurator/config.json b/configurator/config.json index 403ab18..f005da8 100644 --- a/configurator/config.json +++ b/configurator/config.json @@ -1,6 +1,6 @@ { "name": "Configurator", - "version": "0.2.0-p3", + "version": "0.2.3", "slug": "configurator", "description": "Browser-based configuration file editor for Home Assistant.", "url": "https://home-assistant.io/addons/configurator", @@ -20,7 +20,9 @@ "ssl": false, "allowed_networks": ["192.168.0.0/16"], "banned_ips": ["8.8.8.8"], - "ignore_pattern": ["__pycache__"] + "banlimit": 0, + "ignore_pattern": ["__pycache__"], + "dirsfirst": false }, "schema": { "username": "str", @@ -30,7 +32,9 @@ "ssl": "bool", "allowed_networks": ["str"], "banned_ips": ["str"], - "ignore_pattern": ["str"] + "banlimit": "int", + "ignore_pattern": ["str"], + "dirsfirst": "bool" }, "image": "homeassistant/{arch}-addon-configurator" } diff --git a/configurator/map.py b/configurator/map.py index 23088c7..e176cd2 100644 --- a/configurator/map.py +++ b/configurator/map.py @@ -13,15 +13,17 @@ configurator = { 'BASEPATH': "/config", 'HASS_API': "http://hassio/homeassistant/api/", 'HASS_API_PASSWORD': None, - 'CREDENTIALS': + 'CREDENTIALS': "{}:{}".format(options['username'], options['password']), - 'SSL_CERTIFICATE': + 'SSL_CERTIFICATE': "ssl/{}".format(options['certfile']) if options['ssl'] else None, - 'SSL_KEY': + 'SSL_KEY': "ssl/{}".format(options['keyfile']) if options['ssl'] else None, 'ALLOWED_NETWORKS': options['allowed_networks'], 'BANNED_IPS': options['banned_ips'], 'IGNORE_PATTERN': options['ignore_pattern'], + 'BANLIMIT': options['banlimit'], + 'DIRSFIRST': options['dirsfirst'], } with Path(sys.argv[1]).open('w') as json_file: