mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-08 10:29:30 +00:00
Support host tokens (#507)
* Update coresys.py * Update bootstrap.py * Update security.py * fix lint * Update bootstrap.py
This commit is contained in:
@@ -24,6 +24,11 @@ from .dbus import DBusManager
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ENV_SHARE = 'SUPERVISOR_SHARE'
|
||||
ENV_NAME = 'SUPERVISOR_NAME'
|
||||
ENV_REPO = 'HOMEASSISTANT_REPOSITORY'
|
||||
ENV_MACHINE = 'MACHINE_ID'
|
||||
|
||||
|
||||
def initialize_coresys(loop):
|
||||
"""Initialize HassIO coresys/objects."""
|
||||
@@ -46,6 +51,9 @@ def initialize_coresys(loop):
|
||||
# bootstrap config
|
||||
initialize_system_data(coresys)
|
||||
|
||||
# Set Machine/Host ID
|
||||
coresys.machine_id = os.environ.get(ENV_MACHINE)
|
||||
|
||||
return coresys
|
||||
|
||||
|
||||
@@ -139,8 +147,7 @@ def initialize_logging():
|
||||
def check_environment():
|
||||
"""Check if all environment are exists."""
|
||||
# check environment variables
|
||||
for key in ('SUPERVISOR_SHARE', 'SUPERVISOR_NAME',
|
||||
'HOMEASSISTANT_REPOSITORY'):
|
||||
for key in (ENV_SHARE, ENV_NAME, ENV_REPO):
|
||||
try:
|
||||
os.environ[key]
|
||||
except KeyError:
|
||||
|
||||
Reference in New Issue
Block a user