Added banlimit and dirsfirst options (#200)

This commit is contained in:
Daniel Perna
2017-11-14 11:24:16 +01:00
committed by Pascal Vizeli
parent cd9c8e4e0a
commit fcb9a37c78
2 changed files with 12 additions and 6 deletions

View File

@@ -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"
}

View File

@@ -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: