Move development runtime to isolated Athena Debian instance
This commit is contained in:
@@ -71,7 +71,7 @@ class HardwareProvider:
|
||||
self.checked = 0
|
||||
|
||||
def snapshot(self):
|
||||
if os.environ.get('DECK_LOCAL_HARDWARE') == '1':
|
||||
if os.environ.get('DECK_LOCAL_HARDWARE', '1') == '1':
|
||||
from collect_hardware import collect
|
||||
with self.lock:
|
||||
if self.cached is None or time.monotonic()-self.checked >= 5:
|
||||
@@ -218,7 +218,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
signed_in = self.authenticated(session_only=True)
|
||||
value = dict(initialized=record is not None, authenticated=signed_in)
|
||||
if signed_in:
|
||||
value.update(api_token_configured=bool(record['api_token_hash']), password_changed_at=record['password_changed_at'], token_changed_at=record['token_changed_at'], account='Administrator', location=os.environ.get('DECK_LOCATION', 'Athena' if os.environ.get('DECK_AUTH_RPC') else 'Mac'))
|
||||
value.update(api_token_configured=bool(record['api_token_hash']), password_changed_at=record['password_changed_at'], token_changed_at=record['token_changed_at'], account='Administrator', location=os.environ.get('DECK_LOCATION', 'Athena · Debian-Server'))
|
||||
return self.respond(value)
|
||||
|
||||
def change_credentials(self, kind):
|
||||
@@ -262,7 +262,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
name, mime = routes[self.path]
|
||||
return self.respond((ROOT/name).read_bytes(), mime=mime)
|
||||
if self.path == '/api/v1/status':
|
||||
return self.respond(dict(name='Athena Deck', version='0.4.0', state='ready', uptime_seconds=round(time.time()-self.server.started), mode='isolated', location=os.environ.get('DECK_LOCATION', 'Athena' if os.environ.get('DECK_AUTH_RPC') else 'Mac'), demo=self.server.demo.status()))
|
||||
return self.respond(dict(name='Athena Deck', version='0.4.0', state='ready', uptime_seconds=round(time.time()-self.server.started), mode='isolated', location=os.environ.get('DECK_LOCATION', 'Athena · Debian-Server'), demo=self.server.demo.status()))
|
||||
if self.path == '/api/v1/hardware':
|
||||
return self.respond(self.server.hardware.snapshot())
|
||||
if self.path == '/api/v1/network':
|
||||
|
||||
Reference in New Issue
Block a user