Change rating 1-6 (#658)

This commit is contained in:
Pascal Vizeli 2018-08-19 18:17:14 +02:00 committed by GitHub
parent e3a99b9f89
commit d81bc7de46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

2
API.md
View File

@ -480,7 +480,7 @@ Get all available addons.
"homeassistant_api": "bool",
"full_access": "bool",
"protected": "bool",
"rating": "1-5",
"rating": "1-6",
"stdin": "bool",
"webui": "null|http(s)://[HOST]:port/xy/zx",
"gpio": "bool",

View File

@ -19,7 +19,7 @@ def rating_security(addon):
1 = not secure
5 = high secure
"""
rating = 4
rating = 5
# AppArmor
if addon.apparmor == SECURITY_DISABLE:
@ -36,6 +36,10 @@ def rating_security(addon):
PRIVILEGED_SYS_RAWIO):
rating += -1
# Not secure Networking
if addon.host_network:
rating += -1
# Full Access
if addon.with_full_access:
rating += -2
@ -44,7 +48,7 @@ def rating_security(addon):
if addon.access_docker_api:
rating = 1
return max(min(5, rating), 1)
return max(min(6, rating), 1)
def get_hash_from_repository(name):